* lisp/progmodes/ruby-mode.el: First cut at SMIE support.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
07525f77
EZ
12013-05-08 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (row_for_charpos_p): New function, with code of
4 cursor_row_p, but accepts an additional argument CHARPOS instead
5 of using a hardcoded PT.
6 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
7 (row_containing_pos): Call row_for_charpos_p instead of partially
8 doing the same. Fixes cursor positioning under longlines-mode
9 when longlines-show-effect includes more than one newline, when
10 moving the cursor vertically up.
11
d901fc8d
JB
122013-05-08 Juanma Barranquero <lekktu@gmail.com>
13
14 * makefile.w32-in (ACL_H): New macro.
15 ($(BLD)/fileio.$(O)): Update dependencies.
16
f269bc61
PE
172013-05-07 Paul Eggert <eggert@cs.ucla.edu>
18
ffdc270a
PE
19 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
20 * Makefile.in (LIB_ACL): New macro.
21 (LIBACL_LIBS): Remove.
22 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
23 * fileio.c: Include <acl.h>.
24 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
25 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
26 !acl_errno_valid.
27 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
28 it ourselves.
29
f269bc61
PE
30 * unexelf.c: Don't assume ElfW (Half) fits in int.
31 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
32 when dealing with ElfW (Half) values, since they can exceed 2**31
33 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
34 (entry_address): Omit unused NUM arg. All uses changed.
35
a261c53e
JL
362013-05-07 Juri Linkov <juri@jurta.org>
37
38 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
39 to the string converted from number with `Fnumber_to_string'.
40 (Bug#14254)
41
2b66427d
PE
422013-05-07 Paul Eggert <eggert@cs.ucla.edu>
43
44 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
45 This fixes a problem introduced by my previous change.
46
15acfe41
GM
472013-05-07 Glenn Morris <rgm@gnu.org>
48
49 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
50
5ea03bf5
JD
512013-05-07 Jan Djärv <jan.h.d@swipnet.se>
52
53 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
54
e0c9d565
PE
552013-05-07 Paul Eggert <eggert@cs.ucla.edu>
56
57 Static checking by GCC 4.8.0.
58 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
59 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
60 (x_get_monitor_attributes_fallback)
61 (x_get_monitor_attributes_xinerama)
62 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
63 Define only if USE_GTK.
64 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
65 (x_get_monitor_attributes_fallback): Omit unused locals.
66 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
67 Use double, not float, to avoid mixed-mode floating point arithmetic.
68
4e3f9230
YM
692013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
70 Jan Djärv <jan.h.d@swipnet.se>
71
72 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
73 (XINERAMA_CFLAGS): New macros.
74 (ALL_CFLAGS, LIBES): Use them.
75
76 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
77 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
78 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
79 (syms_of_xfns): DEFSYM them.
80 (struct MonitorInfo): New struct.
81 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
82 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
83 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
84 (x_get_monitor_attributes_xinerama): New functions.
85 (Fx_display_monitor_attributes_list): New primitive.
86 (syms_of_xfns): Defsubr it.
87
88 * xterm.h (x_display_info): Add Xatom_net_workarea and
89 Xatom_net_current_desktop.
90
91 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
92 and dpyinfo->Xatom_net_current_desktop.
93
05839b6a
EZ
942013-05-06 Eli Zaretskii <eliz@gnu.org>
95
96 * xdisp.c (pos_visible_p): Use the special code for finding the
97 beginning of a display property or overlay for any "replacing"
98 display property, not just for display strings. This solves
99 incorrect reporting of position by posn-at-point. (Bug#14241)
100
dc4a2ee0
PE
1012013-05-06 Paul Eggert <eggert@cs.ucla.edu>
102
5ee94506
PE
103 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
104 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
105 Verify that ElfW (Half) fits in int.
106 (fatal): Use same signature as lisp.h.
107 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
108 configure and build with -DUNEXELF_DEBUG without worrying about
109 other modules that use DEBUG.
110 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
111 possibly-wide integers now uses it instead of plain fprintf.
112 (entry_address): New function, which avoids problems with 32-bit
113 overflow on 64-bit hosts.
114 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
115 (round_up): Don't assume the remainder fits in int.
116 (find_section): Use bool for boolean. Simplify debug code.
117 (unexec): Don't assume file sizes fit in int or size_t.
118 Omit unnecessary trailing newline in 'fatal' format.
119 Use strerror rather than outputting decimal error number.
120 Remove unused code when emacs is not defined;
121 this file relies on Emacs now.
122 Don't assume e_phnum and e_shnum are positive.
123
dc4a2ee0
PE
124 * regex.c: Fix problems when DEBUG is defined.
125 (extract_number, extract_number_and_incr): Define regardless of
126 whether DEBUG is defined; that's simpler and makes the code less
127 likely to go stale in the normal case when DEBUG is not defined.
128 Return int rather than taking an int * arg. All callers changed.
129 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
130 Remove, replacing with ...
131 (DEBUG_PRINT): New macro. All callers changed.
132 (DEBUG_COMPILES_ARGUMENTS): New macro.
133 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
134 (print_compiled_pattern, print_double_string) [DEBUG]:
135 Use prototype rather than old-style definition.
136 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
137 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
138 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
139 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
140 Don't assume ptrdiff_t, size_t, and long are the same width as int.
141 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
142 This matters only when DEBUG is defined.
143
14c7ed05
EZ
1442013-05-05 Eli Zaretskii <eliz@gnu.org>
145
146 * xdisp.c (set_iterator_to_next): Set the
147 ignore_overlay_strings_at_pos_p flag only if we are _really_
148 iterating over an overlay string, as indicated by the
149 current.overlay_string_index member. (Bug#14306)
150
e6076b1b
JD
1512013-05-05 Jan Djärv <jan.h.d@swipnet.se>
152
153 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
154 to where it is used, to avoid autorelease issues (Bug#14050).
155
cbee2131
PE
1562013-05-05 Paul Eggert <eggert@cs.ucla.edu>
157
158 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
159 * fileio.c (syms_of_fileio): Implement this.
160 * filelock.c (create_lock_file): If symbolic links don't work, so
161 we use a regular file as a lock file, do not fsync the lock file;
162 it's not needed.
163
30c7e542
SM
1642013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
165
166 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
167 (syms_of_minibuf): Adjust accodingly.
168 * lread.c (Fread):
169 * callint.c (Fcall_interactively): Adjust calls accordingly.
170
5bebd186
EZ
1712013-05-04 Eli Zaretskii <eliz@gnu.org>
172
173 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
174 w->contents is a buffer before computing everything else.
175 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
176
177 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
178 assertion violations. (Bug#14062)
179
0fb0a4f3
DR
1802013-05-01 David Reitter <david.reitter@gmail.com>
181
182 * nsfns.m (ns_tooltip): Initialize.
183
9e63b4a5
EZ
1842013-04-28 Eli Zaretskii <eliz@gnu.org>
185
186 * coding.c (decode_coding_gap): Don't remove the character before
187 a newline unless it's a CR character. (Bug#14287)
188
ad60824e
DN
1892013-04-28 Dan Nicolaescu <dann@gnu.org>
190
191 * dispextern.h (struct face): Move enum face_underline_type
192 earlier so that bitfields can be in the same word.
193
edbdcec0
JD
1942013-04-28 Jan Djärv <jan.h.d@swipnet.se>
195
196 * nsfns.m (handlePanelKeys): New function.
197 (EmacsOpenPanel:performKeyEquivalent:)
198 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
199 arrows/function/control and copy/paste keys (Bug#14296).
200
0208ede7
JL
2012013-04-27 Juri Linkov <juri@jurta.org>
202
203 * callint.c (Fcall_interactively): Call `Qread_number' for
204 interactive code letter `n' instead of using duplicate code.
205 (Bug#14254)
206
b8dd59f7
PE
2072013-04-27 Paul Eggert <eggert@cs.ucla.edu>
208
209 * systime.h (make_timeval): Declare as 'const'.
210
8bd722db
KH
2112013-04-27 Kenichi Handa <handa@gnu.org>
212
213 * font.c (font_open_entity): Always open a font of manageable
214 size.
215
13d0e56f 2162013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 217
f780d632
PE
218 Port better to AIX (Bug#14258).
219 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
220 to pacify AIX xlc.
221
ec509856
KH
2222013-04-24 Kenichi Handa <handa@gnu.org>
223
224 * coding.c (decode_coding_iso_2022): When an invalid escape
225 sequence is encountered, reset the invocation and designation
226 status to the safest one.
227
84fc48e5
PE
2282013-04-22 Paul Eggert <eggert@cs.ucla.edu>
229
230 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
231 Without this fix, "make distclean" leaves stamp-h1 behind.
232
806bda47
EC
2332013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
234
235 * w32fns.c (w32_fullscreen_rect): New function to compute the
236 window rectangle for the given fullscreen mode.
237 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
238 longer tunes the window size. This keeps the window's edges flush
239 with the screen and allows the taskbar to hide itself in fullboth.
240
241 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
242 window decorations and uses the entire screen.
243
244 * w32term.h (w32_fullscreen_rect) Add prototype.
245 (struct w32_output): Replace normal_width, normal_height,
246 normal_top, and normal_left members with a single normal_placement
247 struct.
248 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
249 Remove macros.
250 (FRAME_NORMAL_PLACEMENT): New macro.
251
9cc2810b
JB
2522013-04-16 Juanma Barranquero <lekktu@gmail.com>
253
254 * minibuf.c (Ftest_completion): Silence compiler warning.
255
fd16b54c
EZ
2562013-04-15 Eli Zaretskii <eliz@gnu.org>
257
258 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 259 bug#14062.
fd16b54c
EZ
260
261 * frame.h (WINDOW_FRAME): Protect macro and its argument with
262 parentheses.
263
264 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
265 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
266 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
267 parentheses where appropriate.
268
9e3379a0
PE
2692013-04-14 Paul Eggert <eggert@cs.ucla.edu>
270
271 * keyboard.c (timer_start_idle): Remove no-longer-used local.
272
ddd6b685
EZ
2732013-04-14 Eli Zaretskii <eliz@gnu.org>
274
275 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
276 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
277 Mention in the doc string that setting these variables takes
278 effect only after a call to set-window-buffer. (Bug#14200)
279
29b79ba1
EZ
2802013-04-13 Eli Zaretskii <eliz@gnu.org>
281
282 * indent.c (Fvertical_motion): Don't consider display strings on
283 overlay strings as display strings on the buffer position we
284 started from. This prevents vertical cursor motion from jumping
285 more than one line when there's an overlay string with a display
286 property at end of line.
287 Reported by Karl Chen <Karl.Chen@quarl.org> in
288 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
289
562c6ee9
SM
2902013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
291
292 * window.c (select_window): `record_buffer' even if window is
293 already selected (bug#14191).
294
fcc1fe85
EZ
2952013-04-11 Eli Zaretskii <eliz@gnu.org>
296
297 * window.c (Fwindow_end): Test more flags, including the buffer's
298 last_overlay_modified flag, to determine whether the window's
299 display is really up-to-date. Prevents the function from
300 returning a stale value. (Bug#14170)
301 (Fwindow_line_height): Fix the test for up-to-date-ness of the
302 current matrix.
303
f009190a
EZ
3042013-04-10 Eli Zaretskii <eliz@gnu.org>
305
306 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
307 garbaged only if it is not already the top frame on its TTY.
308 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
309 there are GUI frames open in the same session. (Bug#13864)
310
78ce603d
SM
3112013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
312
313 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
314 of marking the idle timers directly.
315
a8036e40
SM
3162013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
317
318 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
319 tables (bug#14054).
320
7ffe7ef6
SM
3212013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
322
323 * window.c (select_window): Don't record_buffer while the invariant is
324 temporarily broken (bug#14161).
325
326 * fns.c (Fdelq): Don't assume !NILP => CONSP.
327
7d9f6883
EZ
3282013-04-07 Eli Zaretskii <eliz@gnu.org>
329
330 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
331
5406cfd9
RF
3322013-04-07 Romain Francoise <romain@orebokech.com>
333
334 Ignore additional platform-specific ACL errors (Bug#13702).
335 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
336 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
337
95c0e83b
JD
3382013-03-31 Jan Djärv <jan.h.d@swipnet.se>
339
340 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
341 f->output_data.ns.
342
876da980
PE
3432013-04-07 Paul Eggert <eggert@cs.ucla.edu>
344
345 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
346 This bug was introduced by my 2013-02-25 change that simplified
347 data_start configuration. Without this change, on GNU/Linux
348 an Emacs configured with --enable-profiling fails immediately
349 due to a profiler signal.
350 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
351 with these flags. On platforms where special flags are needed
352 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
353 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
354 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
355
7452b7bd
DA
3562013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
357
358 Get rid of some platform-specific functions examining window
359 system and its capabilities. This is a partial rework of the
360 2013-04-05 change.
361 * lisp.h (have_menus_p): Remove prototype. This function is
362 replaced with platform-independent window_system_available.
363 (check_window_system): Move to...
364 * frame.h (decode_window_system_frame, window_system_available):
365 ...here, add new prototypes.
366 * frame.c (window_system_available, decode_window_system_frame):
367 New functions.
368 (check_window_system): Platform-independent now.
369 * xterm.h (x_in_use): Remove declaration.
370 (check_x_frame):
371 * w32term.h (check_x_frame):
372 * nsterm.h (check_x_frame): Remove prototypes. This function
373 is replaced with platform-independent decode_window_system_frame.
374 * msdos.c (have_menus_p): Remove.
375 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
376 Remove platform-specific functions. Use check_window_system,
377 decode_window_system_frame and check_ns_display_info where
378 appropriate. Minor style and comment tweaks.
379 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
380 (check_x_frame): Likewise.
381 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
382 Likewise.
383 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
384 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
385 * xmenu.c, xselect.c: All related users changed.
386
251e9147
KH
3872013-04-03 Kenichi Handa <handa@gnu.org>
388
389 The following changes is to optimize the code for reading UTF-8
390 files.
391
562c6ee9 392 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
393 changed. Check EOL format. Do not call adjust_coding_eol_type
394 here.
395 (check_utf_8): New function.
396 (adjust_coding_eol_type): Do nothing if already adjusted.
397 (detect_coding): Compare the return value of check_ascii with
398 coding->src_bytes. Call adjust_coding_eol_type if necessary.
399 (decode_coding_gap): Optimize for valid UTF-8.
400
8bc369d4
KH
4012013-03-21 Kenichi Handa <handa@gnu.org>
402
403 * coding.c (syms_of_coding): Cancel previous change.
404
405 * insdel.c (insert_from_gap): Fix previous change.
406
73931ad1
DA
4072013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
408
409 Consistently use platform-specific function to detect window system.
410 * lisp.h (check_window_system): New prototype. This function is
411 going to replace check_x, check_w32 and check_ns.
412 (have_menus_p): Mention msdos.c in comment.
413 * fontset.c (check_window_system_func): Remove. Adjust all users.
414 * fontset.h (check_window_system_func): Remove prototype.
415 * nsterm.h (check_ns):
416 * xterm.h (check_x):
417 * w32term.h (check_w32): Likewise.
418 * menu.c (Fx_popup_menu): Use check_window_system.
419 * msdos.c (check_window_system): Define for MS-DOS.
420 * nsfns.m (check_window_system): Define for NS. Adjust all users.
421 * w32fns.c (check_window_system): Likewise for MS-Windows.
422 * xfns.c (check_window_system): Likewise for X.
423 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
424 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
425
7216e43b
PE
4262013-04-02 Paul Eggert <eggert@cs.ucla.edu>
427
428 Prefer < to > in range checks such as 0 <= i && i < N.
429 This makes it easier to visualize quantities on a number line.
430 This patch doesn't apply to all such range checks,
431 only to the range checks affected by the 2013-03-24 change.
432 This patch reverts most of the 2013-03-24 change.
433 * alloc.c (xpalloc, Fgarbage_collect):
434 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
435 * character.c (string_escape_byte8):
436 * charset.c (read_hex):
437 * data.c (cons_to_unsigned):
438 * dispnew.c (update_frame_1):
439 * doc.c (Fsubstitute_command_keys):
440 * doprnt.c (doprnt):
441 * editfns.c (hi_time, decode_time_components):
442 * fileio.c (file_offset):
443 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
444 * font.c (font_intern_prop):
445 * frame.c (x_set_alpha):
446 * gtkutil.c (get_utf8_string):
447 * indent.c (check_display_width):
448 * keymap.c (Fkey_description):
449 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
450 * lread.c (read1):
451 * minibuf.c (read_minibuf_noninteractive):
452 * process.c (wait_reading_process_output):
453 * search.c (Freplace_match):
454 * window.c (get_phys_cursor_glyph):
455 * xdisp.c (redisplay_internal):
456 * xsmfns.c (smc_save_yourself_CB):
457 Prefer < to > for range checks.
458 * dispnew.c (sit_for): Don't mishandle NaNs.
459 This fixes a bug introduced in the 2013-03-24 change.
460 * editfns.c (decode_time_components): Don't hoist comparison.
461 This fixes another bug introduced in the 2013-03-24 change.
462
92759988
DA
4632013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
464
465 * frame.h (struct frame): Drop scroll_bottom_vpos
466 member becaue all real users are dead long ago.
467 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
468 * xdisp.c (redisplay_internal): Adjust user.
469
9a1971bb
GM
4702013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
471
f38ab167
JD
472 * nsmenu.m (showAtX:Y:for:): setLevel to
473 NSPopUpMenuWindowLevel (Bug#13998).
474
6d01f1fe
JD
4752013-03-30 Jan Djärv <jan.h.d@swipnet.se>
476
477 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
478 (ns_check_pending_open_menu): Declare.
479
480 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
481 (x_activate_menubar): Update the menu with title that matches
482 ns_get_pending_menu_title, and call
483 ns_check_pending_openmenu (Bug#12698).
484 (menuWillOpen:): New method.
485 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
486
487 * nsterm.m (menu_will_open_state, menu_mouse_point)
488 (menu_pending_title): New varaibles.
489 (ns_get_pending_menu_title, ns_check_menu_open)
490 (ns_check_pending_open_menu): New functions.
491
781f4782
DA
4922013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
493
494 * indent.c (current_column_bol_cache): Remove leftover which is not
495 used in Fmove_to_column any more.
496 (current_column, scan_for_column): Adjust users.
497 * keyboard.c (last_point_position_buffer, last_point_position_window):
498 Remove leftovers which are not used for recording undo any more.
499 (command_loop_1, syms_of_keyboard): Adjust users.
500 * xdisp.c (last_max_ascent): Remove leftover which is not used in
501 redisplay_window any more.
502 (move_it_to): Adjust user.
503
1921c31b
JB
5042013-03-29 Juanma Barranquero <lekktu@gmail.com>
505
506 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
507 Update dependencies.
508
717b8bcd
SM
5092013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
510
511 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
512 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
513 forward references.
514
e74aeda8
DA
5152013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
516
517 * window.h (struct window): Replace hchild, vchild and buffer slots
518 with the only contents slot. This is possible because each valid
519 window may have either the child window (in vertical or horizontal
520 combination) or buffer to display (for the leaf window). Using that,
521 a lof of operations to traverse and/or change window hierarchies may
522 be simplified. New member horizontal is used to distinguish between
523 horizontal and vertical combinations of internal windows.
524 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
525 (WINDOW_VERTICAL_COMBINATION_P): New macros.
526 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
527 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
528 Use contents slot, not buffer, where appropriate.
529 (wset_combination): New function.
530 (wset_buffer): Add eassert.
531 (Fframe_first_window): Simplify the loop reaching first window.
532 (Fwindow_buffer): Use WINDOW_LEAF_P.
533 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
534 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
535 (unshow_buffer): Convert initial debugging check to eassert.
536 (replace_window, recombine_windows, Fdelete_other_windows_internal)
537 (make_parent_window, window_resize_check, window_resize_apply)
538 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
539 (Fset_window_configuration, delete_all_child_windows, save_window_save):
540 Adjust to match struct window changes.
541 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
542 (mark_window_cursors_off, count_windows, get_leaf_windows)
543 (foreach_window_1): Simplify the loop.
544 * alloc.c (mark_object): Do not check for the leaf window because
545 internal windows has no glyph matrices anyway.
546 * dispnew.c (clear_window_matrices, showing_window_margins_p)
547 (allocate_matrices_for_window_redisplay, fake_current_matrices)
548 (allocate_matrices_for_frame_redisplay, free_window_matrices)
549 (build_frame_matrix_from_window_tree, mirror_make_current)
550 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
551 (update_window_tree, set_window_update_flags): Simplify the loop.
552 (sync_window_with_frame_matrix_rows): Enforce live window.
553 Use contents slot, not buffer, where appropriate.
554 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
555 and WINDOW_HORIZONTAL_COMBINATION_P.
556 (make_frame_visible_1): Simplify the loop.
557 Use contents slot, not buffer, where appropriate.
558 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
559 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
560 (expose_window_tree): Likewise.
561 Use contents slot, not buffer, where appropriate.
562 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
563 to avoid deleted windows. Use contents slot instead of buffer.
564 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
565 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
566 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
567 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
568
121ab1cd
EZ
5692013-03-28 Eli Zaretskii <eliz@gnu.org>
570
ef454cf7
EZ
571 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
572 identify the reasons for assertion violations in bug#14062 and
573 similar ones.
21e930f8
EZ
574 (Fx_show_tip): Fix compilation error under
575 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 576
121ab1cd
EZ
577 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
578 Reported by <rzl24ozi@gmail.com>.
579
5c89ca24
DA
5802013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
581
582 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
583 start marker...
562c6ee9
SM
584 (unwind_with_echo_area_buffer): ...to restore it here.
585 This is needed to ensure that...
5c89ca24
DA
586 (redisplay_window): ...both window markers are valid here,
587 which is verified by eassert.
588 * editfns.c (save_excursion_save): Do not assume that
589 selected_window always displays the buffer.
c7f53895
DA
590 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
591 Fix comment.
5c89ca24 592
f557c1b1
SM
5932013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
594
595 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
596 the upcase table.
597
40693bba 5982013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
599
600 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
601
c86f791f
EZ
6022013-03-27 Eli Zaretskii <eliz@gnu.org>
603
604 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
605 since MinGW's w32api headers do. This avoids compiler warnings.
606
607 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
608 if already defined.
609
c6e72e17
EZ
6102013-03-26 Eli Zaretskii <eliz@gnu.org>
611
612 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
613
54e95010
JD
6142013-03-26 Jan Djärv <jan.h.d@swipnet.se>
615
616 * gtkutil.c (style_changed_cb): Check if frame is live and an
617 X frame (Bug#14038).
618
b88b62de
EZ
6192013-03-26 Eli Zaretskii <eliz@gnu.org>
620
a18d7de6
EZ
621 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
622 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
623 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
624 MinGW64.
8f5e14c8
EZ
625 Move inclusion of time.h before sys/time.h, so that MinGW64 could
626 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 627
b88b62de
EZ
628 Fix incompatibilities between MinGW.org and MinGW64 headers.
629 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
630
631 * w32.c (REPARSE_DATA_BUFFER): Guard with
632 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
633
c074e458
JD
6342013-03-25 Jan Djärv <jan.h.d@swipnet.se>
635
636 * xterm.c: Include X11/XKBlib.h
637 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
638
908589fd
AS
6392013-03-24 Andreas Schwab <schwab@linux-m68k.org>
640
641 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
642 written backwards.
643 * blockinput.h (input_blocked_p): Likewise.
644 * bytecode.c (exec_byte_code): Likewise.
645 * callproc.c (call_process_kill, call_process_cleanup)
646 (Fcall_process): Likewise.
647 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
648 (Fccl_execute_on_string): Likewise.
649 * character.c (string_escape_byte8): Likewise.
650 * charset.c (read_hex): Likewise.
651 * cm.c (calccost): Likewise.
652 * data.c (cons_to_unsigned): Likewise.
653 * dired.c (directory_files_internal, file_name_completion):
654 Likewise.
655 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
656 (sit_for): Likewise.
657 * doc.c (Fsubstitute_command_keys): Likewise.
658 * doprnt.c (doprnt): Likewise.
659 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
660 * emacsgtkfixed.c: Likewise.
661 * fileio.c (file_offset, Fwrite_region): Likewise.
662 * floatfns.c (Fexpt, fmod_float): Likewise.
663 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
664 Likewise.
665 * font.c (font_intern_prop): Likewise.
666 * frame.c (x_set_alpha): Likewise.
667 * gtkutil.c (get_utf8_string): Likewise.
668 * indent.c (check_display_width): Likewise.
669 * intervals.c (create_root_interval, rotate_right, rotate_left)
670 (split_interval_right, split_interval_left)
671 (adjust_intervals_for_insertion, delete_node)
672 (interval_deletion_adjustment, adjust_intervals_for_deletion)
673 (merge_interval_right, merge_interval_left, copy_intervals)
674 (set_intervals_multibyte_1): Likewise.
675 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
676 * keymap.c (Fkey_description): Likewise.
677 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
678 * lread.c (openp, read_integer, read1, string_to_number):
679 Likewise.
680 * menu.c (ensure_menu_items): Likewise.
681 * minibuf.c (read_minibuf_noninteractive): Likewise.
682 * print.c (printchar, strout): Likewise.
683 * process.c (create_process, Faccept_process_output)
684 (wait_reading_process_output, read_process_output, send_process)
685 (wait_reading_process_output): Likewise.
686 * profiler.c (make_log, handle_profiler_signal): Likewise.
687 * regex.c (re_exec): Likewise.
688 * regex.h: Likewise.
689 * search.c (looking_at_1, Freplace_match): Likewise.
690 * sysdep.c (get_child_status, procfs_ttyname)
691 (procfs_get_total_memory): Likewise.
692 * systime.h (EMACS_TIME_VALID_P): Likewise.
693 * term.c (dissociate_if_controlling_tty): Likewise.
694 * window.c (get_phys_cursor_glyph): Likewise.
695 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
696 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
697 Likewise.
698 * xfns.c (Fx_window_property): Likewise.
699 * xmenu.c (set_frame_menubar): Likewise.
700 * xselect.c (x_get_window_property, x_handle_dnd_message):
701 Likewise.
702 * xsmfns.c (smc_save_yourself_CB): Likewise.
703 * xterm.c (x_scroll_bar_set_handle): Likewise.
704
2bf7d27a
DA
7052013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
706
707 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
708 to be optional or nil. Adjust comment and convert it to docstring.
709 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
710 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
711
a9ebfa0b
PE
7122013-03-24 Paul Eggert <eggert@cs.ucla.edu>
713
714 Static checking by GCC 4.8-20130319.
715 * image.c (gif_load): Assume pass < 3 to pacify GCC.
716 * process.c (Fset_process_datagram_address)
717 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
718 * xdisp.c (get_char_face_and_encoding):
719 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
720 (get_glyph_face_and_encoding): Prepare face before possibly using it.
721 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
722
4f3576ee
KB
7232013-03-24 Ken Brown <kbrown@cornell.edu>
724
789b5e9a
KB
725 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
726 fix compilation on 64-bit Cygwin, where underscores are not
727 automatically prepended.
728
4f3576ee
KB
729 * w32term.c (w32_initialize): Silence compiler warning.
730
b5b7745f
EZ
7312013-03-23 Eli Zaretskii <eliz@gnu.org>
732
cdc0d0bd
EZ
733 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
734 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
735 variables, to save and restore frame dimensions.
736 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
737 after returning from a 'fullscreen' configuration.
738 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
739 to avoid races between the main thread and the input thread.
740
741 * w32term.h (struct w32_output): New members normal_width,
742 normal_height, normal_top, normal_left, and prev_fsmode.
743 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
744 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
745 members of a frame.
746
b5b7745f
EZ
747 * w32term.c (w32fullscreen_hook): Record last value of the frame's
748 'fullscreen' parameter. Always record previous width and height
749 of the frame, except when switching out of maximized modes, so
750 that they could be restored correctly, instead of resetting to the
751 default frame dimensions. Send SC_RESTORE command to the frame,
752 unless we are going to send SC_MAXIMIZE, to restore the frame
753 resize hints in the mouse pointer shown by the window manager.
754 (Bug#14032)
755
756 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
757
758 * lisp.h (get_frame_param): Adjust conditions for prototype
759 declaration.
760
a3454eed
KB
7612013-03-22 Ken Brown <kbrown@cornell.edu>
762
763 * unexcw.c: Drop unneeded inclusion of w32common.h.
764 (report_sheap_usage): Declare.
765 (read_exe_header): Add magic numbers for x86_64.
766 (fixup_executable): Fix printf format specifier for unsigned long
767 argument.
768
5a49b79c
DA
7692013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
770
771 * frame.h (struct frame): Put menu_bar_window under #ifdef
772 because this member is not needed when X toolkit is in use.
773 (fset_menu_bar_window):
774 * dispnew.c (clear_current_matrices, clear_desired_matrices)
775 (free_glyphs, update_frame):
776 * xdisp.c (expose_frame): Likewise.
777 (display_menu_bar): Likewise. Remove redundant eassert.
778 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
779 toolkit is in use.
780
d6723bf7
PE
7812013-03-21 Paul Eggert <eggert@cs.ucla.edu>
782
7b1123d8
PE
783 Use functions and constants to manipulate Lisp_Save_Value objects.
784 This replaces code that used macros and strings and token-pasting.
785 The change makes the C source a bit easier to follow,
786 and shrinks the Emacs executable a bit.
787 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
788 (make_save_value): Change 1st arg from string to enum. All callers
789 changed.
790 (INTX): Remove.
791 (mark_object): Use if, not #if, for GC_MARK_STACK.
792 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
793 (XSAVE_OBJECT): Now functions, not macros.
794 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
795 the constant was never used.
796 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
797 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
798 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
799 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
800 New constants.
801 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
802 type3 with a single member save_type. All uses changed.
803 (save_type, set_save_pointer, set_save_integer): New functions.
804 * print.c (PRINTX): Remove.
805
d6723bf7
PE
806 * alloc.c: Remove redundant static declarations.
807
5f24fa51
DA
8082013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
809
810 * window.h (struct window): Convert left_col, top_line, total_lines
811 and total_cols from Lisp_Objects to integers. Adjust comments.
812 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
813 Remove.
814 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
815 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
816 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
817 Adjust users where appropriate.
818
42143acd
DA
8192013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
820
821 * frame.h (struct frame): Drop resx and resy because the same data is
822 available from window system-specific output context. Adjust users.
562c6ee9
SM
823 (default_pixels_per_inch_x, default_pixels_per_inch_y):
824 New functions to provide defaults when no window system available.
42143acd 825 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 826 (NUMVAL): Move from xdisp.c.
42143acd
DA
827 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
828 (Ffont_face_attributes, Fopen_font):
829 * image.c (gs_load):
830 * w32font.c (fill_in_logfont):
831 * xdisp.c (calc_pixel_width_or_height):
832 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
833 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
834
c0a17406
KH
8352013-03-20 Kenichi Handa <handa@gnu.org>
836
837 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
838 to 1 (temporary workaround until a bug related to ASCII
839 optimization is fixed).
840
095d384d
DA
8412013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
842
843 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
844 Signal error if window is not internal. Adjust docstring.
845 (delete_all_child_windows): Use combination_limit to save the buffer.
846 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
847 * print.c (syms_of_print): Initialize debugging output not here...
848 (init_print_once): ...but in a new function here.
849 * lisp.h (init_print_once): Add prototype.
850 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 851
748fa866
DA
8522013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
853
854 * window.c (window_resize_check, window_resize_apply)
855 (window_from_coordinates, recombine_windows, set_window_buffer)
856 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
857 (Fsplit_window_internal, Fdelete_window_internal)
858 (freeze_window_starts): Use bool for booleans.
859 * window.h (window_frame_coordinates, resize_frame_windows)
860 (freeze_window_starts, set_window_buffer): Adjust prototypes.
861
81519fd2
SM
8622013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
863
864 * dispnew.c (bitch_at_user): Use `user-error'.
865
6db423a9
KB
8662013-03-17 Ken Brown <kbrown@cornell.edu>
867
868 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
869 as return type of image_background. (Bug#13981)
870 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
871
8f2906f5
JD
8722013-03-16 Jan Djärv <jan.h.d@swipnet.se>
873
960ce480 874 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 875 (ns_select): Don't return with result uninitialized.
960ce480 876
8f2906f5
JD
877 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
878 and getDirectory.
879
81519fd2
SM
880 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
881 New functions.
8f2906f5
JD
882 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
883 directories. If filename is nil, get directory name (Bug#13932).
884 Use getFilename and getDirectory.
885 (getFilename, getDirectory): New methods for EmacsSavePanel and
886 EmacsOpenPanel.
887 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
888
cded56c1
PE
8892013-03-15 Paul Eggert <eggert@cs.ucla.edu>
890
891 * coding.c (decode_coding_gap): Fix typo caught by static checking.
892
251e9147 8932013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
894
895 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
896 (adjust_after_replace): Make it back to static. Delete the third
897 arg text_at_gap_tail. Cancel the code for handling it.
898
899 * coding.h (struct coding_system): New member eol_seen.
900
901 * coding.c (detect_ascii): New function.
902 (detect_coding): Set coding->head_ascii and coding->eol_seen only
903 when the source bytes are actually scanned. On detecting for
904 coding_category_utf_8_auto, call detect_ascii instead of scanning
905 source bytes directly.
906 (produce_chars): Call insert_from_gap with the new arg 0.
907 (encode_coding): Likewise.
908 (decode_coding_gap): Control ASCII optimization by the variable
909 disable_ascii_optimization instead of #ifndef .. #endif.
910 Deccode EOL format according to coding->eol_seen.
911 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
912 variable.
913
8a44e6d1
KH
914 * lisp.h (adjust_after_replace): Cancel externing it.
915 (insert_from_gap): Adjust prototype.
916
5f795e34
EZ
9172013-03-15 Eli Zaretskii <eliz@gnu.org>
918
919 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
920 FULLSCREEN_MAXIMIZED. (Bug#13935)
921
f258b4be
DA
9222013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
923
924 * region-cache.c (find_cache_boundary, move_cache_gap)
925 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
926 Simplify debugging check and convert to eassert. Adjust comment.
927 (pp_cache): Put under ENABLE_CHECKING.
928
a5cc4dde
EZ
9292013-03-14 Eli Zaretskii <eliz@gnu.org>
930
931 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
932 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
933 and WM_ACTIVATEAPP.
934 (w32fullscreen_hook): If the frame is visible, reset
935 f->want_fullscreen flag after changing the frame size. If the
936 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
937 (Bug#13953)
938
3fc5e44a
DC
9392013-03-13 Daniel Colascione <dancol@dancol.org>
940
941 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
942 too so that these builds can use Cygwin's file conversion
943 functions. (We've been building and linking cygw32.o all along
944 and just not using it.)
945
47d7532e
PE
9462013-03-13 Paul Eggert <eggert@cs.ucla.edu>
947
948 File synchronization fixes (Bug#13944).
949 * Makefile.in (LIB_FDATASYNC): New macro.
950 (LIBES): Use it.
951 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
952 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
953 Don't worry about HAVE_FSYNC, since a substitute fsync is
954 available if the system lacks one.
955 (Fwrite_regin): Retry fsync if interrupted.
956
c7ffccaf
EZ
9572013-03-13 Eli Zaretskii <eliz@gnu.org>
958
4e2df81d 959 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
960 activated, call w32fullscreen_hook, to make sure the new frame
961 dimensions are in effect. (Bug#13937)
962
8a7debc1
DA
9632013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
964
965 * xdisp.c (init_iterator): Simplify because both character and byte
966 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
967 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
968 character and byte positions can be obtained from marker.
8a7debc1 969
7fd8c501
PE
9702013-03-13 Paul Eggert <eggert@cs.ucla.edu>
971
d9df6f40
PE
972 Static checking by Sun C 5.12.
973 * alloc.c (buffer_memory_full) [REL_ALLOC]:
974 * bytecode.c (exec_byte_code):
975 * dispnew.c (init_display):
976 * eval.c (error):
977 * fileio.c (Fsubstitute_in_file_name):
978 * keyboard.c (Fevent_convert_list):
979 * keymap.c (Fsingle_key_description):
980 * term.c (maybe_fatal, fatal):
981 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
982 * xsmfns.c (Fhandle_save_session):
983 Omit unreachable code.
984 * keymap.c (map_keymap_char_table_item): Cast void * to
985 a function pointer type; the C Standard requires this.
986
7fd8c501
PE
987 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
988 Include <sys/param.h> unconditionally, as that works elsewhere and
989 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
990 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
991 and FreeBSD now.
992
cb0290df
PE
9932013-03-11 Paul Eggert <eggert@cs.ucla.edu>
994
995 * insdel.c (adjust_after_replace): Use bool for boolean.
996
cbae07d5
SM
9972013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
998
999 * keyboard.c: Move keyboard decoding to read_key_sequence.
1000 (decode_keyboard_code): Remove.
1001 (tty_read_avail_input): Don't try to decode input.
1002 (read_decoded_char): New function.
1003 (read_key_sequence): Use it.
1004
819e2da9
DC
10052013-03-10 Daniel Colascione <dancol@dancol.org>
1006
1007 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1008 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1009 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1010 w32fns.c.
1011
1012 * w32term.c (construct_drag_n_drop): Use the above macros to make
1013 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1014
1015 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1016 properly display non-ASCII frame titles in cygw32 builds.
1017
1018 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1019 call ShellExecute in cygw32 builds.
1020
1021 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1022 common file dialog code.
1023
1024 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1025 can just use du like other systems.
1026
1027 * coding.c (from_unicode_buffer): Declare.
1028 * coding.c (from_unicode_buffer): Implement.
1029
99ec1647
SM
10302013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1031
d2e24f92
SM
1032 * lread.c: Minor cleanup.
1033 (FROM_FILE_P): New macro.
1034 (skip_dyn_bytes, unreadchar, read1): Use it.
1035 (read_list): Consolidate duplicated code.
1036
99ec1647
SM
1037 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1038
138c0ae8
EZ
10392013-03-10 Eli Zaretskii <eliz@gnu.org>
1040
1041 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1042 (redisplay_internal, set_cursor_from_row, try_window)
1043 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1044 (display_line, notice_overwritten_cursor)
99ec1647
SM
1045 (mouse_face_from_buffer_pos, note_mouse_highlight):
1046 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 1047 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
1048 (mouse_face_from_string_pos, fast_find_string_pos):
1049 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
1050
1051 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1052
1053 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1054
1055 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1056 MATRIX_MODE_LINE_ROW.
1057
1058 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1059
c230dd7d
KH
10602013-03-10 handa <handa@gnu.org>
1061
1062 * lisp.h (adjust_after_replace): Extern it.
1063
1064 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1065 case of detection for coding_category_utf_8_auto.
99ec1647
SM
1066 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1067 Skip decoding if all bytes are ASCII.
c230dd7d
KH
1068
1069 * insdel.c (adjust_after_replace): Make it public. New arg
1070 text_at_gap_tail.
1071 (adjust_after_insert): Call adjust_after_replace with the new arg
1072 value 0.
1073
27a98a62
SM
10742013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1075
1076 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1077 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1078 from Elisp via unread-command-events.
1079
1080 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1081 functions to mean "no change".
1082
457882c2
PE
10832013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1084
1085 region-cache.c, scroll.c, search.c: Use bool for booleans.
1086 * lisp.h (compile_pattern):
1087 * scroll.c (do_scrolling, do_direct_scrolling):
1088 * search.c (struct regexp_cache, compile_pattern_1)
1089 (compile_pattern, string_match_1, search_command)
1090 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1091 (search_regs_saved, Fregexp_quote):
1092 Use bool for boolean.
1093 * region-cache.c (region_cache_forward, region_cache_backward):
1094 Fix comments to match code: these functions return int, not boolean.
1095
b5426561
DA
10962013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1097
1098 * search.c (find_newline): Accept start and end byte positions
1099 as arguments and allow -1 if not known.
1100 (find_newline_no_quit): Likewise for start position.
1101 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1102 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1103 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
1104 * editfns.c (Fconstrain_to_field): Break long line.
1105 Adjust call to find_newline.
b5426561
DA
1106 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1107 Use DEC_BOTH to start next search from the previous buffer
1108 position, where appropriate.
1109 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1110 (get_visually_first_element, move_it_vertically_backward): Likewise.
1111 Obtain byte position from the display iterator, where appropriate.
1112
0bce5d9e
PE
11132013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 print.c, process.c: Use bool for booleans.
1116 * lisp.h (wait_reading_process_output):
1117 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1118 (strout, debug_output_compilation_hack, float_to_string, print)
1119 (print_object):
1120 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1121 (decode_status, status_message, create_process, create_pty)
1122 (Fmake_network_process, Fnetwork_interface_info)
1123 (wait_reading_process_output, read_process_output)
1124 (write_queue_push, write_queue_pop, process_send_signal)
1125 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1126 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1127 Use bool for booleans.
1128 * process.c (Fnetwork_interface_list): Remove unused local.
1129 (connect_counter): Now EMACS_INT, not int.
1130
36075a19
DA
11312013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1132
1133 * bidi.c (bidi_fetch_char): Swap first and second arguments
1134 to match other functions accepting character and byte positions.
1135 Adjust comment.
1136 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1137 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1138 when you need just to move to the previous buffer position.
1139 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1140
4aae1914
EZ
11412013-03-07 Eli Zaretskii <eliz@gnu.org>
1142
1143 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1144
c54aa166
DA
11452013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1146
1147 Avoid character to byte conversions in motion subroutines.
1148 * indent.h (compute_motion, vmotion): Add byte position argument.
1149 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1150 Add eassert.
1151 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1152 Use list5 for return value.
1153 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1154 Adjust comments, style and calls to compute_motion.
1155 (Fvertical_motion): Adjust call to vmotion.
1156 * window.c (Fdelete_other_windows_internal): Record window start
1157 byte position and adjust call to vmotion.
1158 (window_scroll_line_based): Likewise with call to compute_motion.
1159 Use SET_PT_BOTH.
1160 (Frecenter): Adjust calls to vmotion.
1161
3de717bd
DA
11622013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1163
1164 * lisp.h (list2i, list3i): New functions.
1165 (list4i): Move from window.c and make LISP_INLINE.
1166 * editfns.c (make_lisp_time):
1167 * fns.c (Flocale_info):
1168 * keyboard.c (parse_modifiers):
1169 * xterm.c (x_ewmh_activate_frame): Use list2i.
1170 * instel.c (signal_after_change):
1171 * nsfns.m (Fx_server_version, Fxw_color_values):
1172 * w32fns.c (Fxw_color_values, Fx_server_version):
1173 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1174 * fileio.c (Fvisited_file_modtime):
1175 * nsfns.m (Fns_display_usable_bounds):
1176 * w32.c (ltime): Use list4i.
1177
d26e478e
EZ
11782013-03-06 Eli Zaretskii <eliz@gnu.org>
1179
a611149e
EZ
1180 * search.c (find_newline_no_quit): Rename from find_next_newline.
1181 Add commentary.
1182
1183 * lisp.h (find_newline_no_quit): Rename prototype.
1184
1185 * xdisp.c (back_to_previous_line_start)
1186 (forward_to_next_line_start, get_visually_first_element)
1187 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1188 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1189 * bidi.c (bidi_find_paragraph_start): Callers of
1190 find_newline_no_quit changed.
1191
d26e478e
EZ
1192 * msdos.c: Change encoding to cp850. (Bug#13879)
1193 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1194
1af1a51a
DA
11952013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1196
1197 Coding system support cleanup and minor refactoring.
1198 * coding.h (enum coding_result_code): Remove
1199 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1200 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1201 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1202 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1203 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1204 (decode_coding_region, encode_coding_region, decode_coding_string):
1205 Remove unused compatibility macros.
1206 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1207 (record_conversion_result): Adjust user.
1208 (syms_of_coding): Likewise.
1209 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1210 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1211 (decode_coding_object): Simplify since xrealloc never returns NULL.
1212 Add eassert.
1213
0bafabe7 12142013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1215
9b1c3271 1216 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1217 * sysdep.c (list_system_processes)
1218 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1219 Make it a stub in this case; otherwise the build might fail,
0845a75c 1220 and this code hasn't been tested on such hosts anyway.
725eb027 1221 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1222 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1223 and analyzed by Jérémie Courrèges-Anglas in
1224 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1225
ffc65bee
DA
12262013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1227
1228 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1229 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1230 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1231 * bidi.c (bidi_find_paragraph_start): Likewise.
1232 * indent.c (vmotion): Likewise.
1233
70743157
PE
12342013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1237 * filelock.c: Include <c-ctype.h>.
1238 (MAX_LFINFO): New top-level constant.
1239 (lock_info_type): Remove members pid, boot_time. Add members at,
1240 dot, colon. Change user member to be the entire buffer, not a
1241 pointer. This allows us to handle the case where a foreign
1242 pid or boot time exceeds the local range. All uses changed.
1243 (LINKS_MIGHT_NOT_WORK): New constant.
1244 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1245 (defined_WINDOWSNT): Remove.
1246 (MAKE_LOCK_NAME, file_in_lock_file_name):
1247 Always use .#FILE (not .#-FILE) for the file lock,
1248 even if it is a regular file.
1249 (rename_lock_file): New function.
1250 (create_lock_file): Use it.
1251 (create_lock_file, read_lock_data):
1252 Prefer a symbolic link for the lock file, falling back on a
1253 regular file if symlinks don't work. Do not try to create
1254 symlinks on MS-Windows, due to security hassles. Stick with
1255 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1256 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1257 host may be using a Windowsish file system, and cannot use
1258 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1259 doesn't work. Don't fail merely because of a symlink-contents
1260 length limit in the current file system; fall back on regular
1261 files. Increase the symlink contents length limit to 8 KiB, this
1262 should be big enough for any real use and doesn't crunch the
1263 stack.
1264 (create_lock_file, lock_file_1, read_lock_data):
1265 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1266 (lock_file_1): Return error number, not bool. All callers changed.
1267 (ELOOP): New macro, if not already defined.
1268 (read_lock_data): Return size of lock file contents, not Lisp object.
1269 All callers changed. Handle a race condition if some other process
1270 replaces a regular-file lock with a symlink lock or vice versa,
1271 while we're trying to read the lock.
1272 (current_lock_owner): Parse contents more carefully, to help avoid
1273 confusing a regular-file lock with some other application's use
1274 of the file. Check for lock file contents being too long, or
1275 not parsing correctly.
1276 (current_lock_owner, lock_file):
1277 Allow foreign pid and boot times that exceed the local range.
1278 (current_lock_owner, lock_if_free, lock_file):
1279 Simplify allocation of lock file contents.
1280 * w32.c (sys_rename_replace): New function, containing most of
1281 the contents of the old sys_rename.
1282 (sys_rename): Use it.
1283 (fchmod): New dummy function.
1284 * w32.h (sys_rename_replace, fchmod): New decls.
1285
05e193f1
EZ
12862013-03-05 Eli Zaretskii <eliz@gnu.org>
1287
1288 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1289 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1290 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1291 <dmantipov@yandex.ru>.
1292
3bfc46eb
DA
12932013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1294
1295 * composite.c (get_composition_id, fill_gstring_header):
1296 Use make_uninit_vector where appropriate.
1297 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1298 * xselect.c (clean_local_selection_data): Likewise.
1299
84ac6f9d
PE
13002013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1303 * image.c (imagemagick_load_image): Calculate height and width
1304 after flattening the image, not before.
1305
42926ec8
DA
13062013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1307
1308 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1309 * ftfont.c (ftfont_shape_by_flt): Likewise.
1310 * w32uniscribe.c (uniscribe_shape): Likewise.
1311
b5029e23
PE
13122013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1313
1314 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1315 The old approach, which fell back on DIR/.#FILE.0 through
1316 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1317 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1318 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1319 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1320 because the locking mechanism was never reliable in that case).
1321 This patch fixes this and other bugs discovered by a code
1322 inspection that was prompted by
1323 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1324 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1325 to avoid interoperability problems between the MS-Windows and
1326 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1327 instances of Emacs now ignore each others' locks.
1328 * filelock.c (defined_WINDOWSNT): New constant.
1329 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1330 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1331 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1332 regular files on MS-Windows hosts.
1333 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1334 Use SAFE_ALLOCA to avoid problems with long file names.
1335 (MAX_LFINFO): Now a local constant, not a global macro.
1336 (IS_LOCK_FILE): Remove.
1337 (lock_file_1): Don't inspect errno if symlink call succeeds;
1338 that's not portable.
1339 (lock_file): Document that this function can return if lock
1340 creation fails.
2db41375 1341 (lock_file): Don't access freed storage.
b5029e23 1342
b270d116
AS
13432013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1344
1345 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1346
81c23309
PE
13472013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1348
1349 * textprop.c: Use bool for booleans.
1350 (validate_interval_range, Fadd_text_properties)
1351 (Fremove_text_properties): Prefer bool to int when either works.
1352
18f2ac09
EZ
13532013-03-02 Eli Zaretskii <eliz@gnu.org>
1354
27a98a62
SM
1355 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1356 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1357 modify_region, re-do processing starting from the call to
1358 validate_interval_range. (Bug#13743)
1359
929aeac6 13602013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1361
1362 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1363 (Bug#13546).
1364
531e70ec
EZ
13652013-02-27 Eli Zaretskii <eliz@gnu.org>
1366
1367 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1368 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1369 access to the lock file until it is written and closed.
1370 (Bug#13807)
1371
6e65b9cc
PE
13722013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1373
1374 * callint.c (Qcall_interactively):
1375 * macros.c (Qexecute_kbd_macro):
1376 Now static.
1377
3b166f09
BG
13782013-02-26 Bastien Guerry <bzg@gnu.org>
1379
1380 * window.c (Frecenter): Tiny docstring enhancement.
1381
ecc0fdd4
PE
13822013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1383
1384 Minor textprop integer cleanup.
1385 * intervals.h, textprop.c (add_text_properties_from_list):
1386 Return void, not int, since nobody uses the return value.
1387 * textprop.c (validate_plist, add_properties, remove_properties)
1388 (Fadd_text_properties):
1389 Don't assume list length fits in int.
1390 (interval_has_all_properties, interval_has_some_properties)
1391 (interval_has_some_properties_list, add_properties, remove_properties)
1392 (Fadd_text_properties, Fremove_text_properties)
1393 (Fremove_list_of_text_properties, text_property_stickiness):
1394 Use bool for booleans.
1395 (Fadd_text_properties, Fremove_text_properties):
1396 (Fremove_list_of_text_properties):
1397 Reindent do-while as per GNU style.
1398
0248b0d7
EZ
13992013-02-25 Eli Zaretskii <eliz@gnu.org>
1400
343a2aef
EZ
1401 Implement CLASH_DETECTION for MS-Windows.
1402
1403 * filelock.c [WINDOWSNT]: Include w32.h.
1404 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1405 function of that name. Up-case the macro arguments.
1406 (IS_LOCK_FILE): New macro.
1407 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1408 (create_lock_file): New function, with body extracted from
1409 lock_file_1.
1410 [WINDOWSNT]: Implement lock files by writing a regular file with
1411 the lock information as its contents.
1412 (read_lock_data): New function, on Posix platforms just calls
1413 emacs_readlinkat.
1414 [WINDOWSNT]: Read the lock info from the file.
1415 (current_lock_owner): Call read_lock_data instead of calling
1416 emacs_readlinkat directly.
1417 (lock_file) [WINDOWSNT]: Run the file name through
1418 dostounix_filename.
1419
1420 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1421 just check if the process by that PID exists.
1422
1423 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1424 also present, as doing so will fail to error out if the file
1425 already exists.
1426
1427 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1428
0248b0d7
EZ
1429 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1430 (Fremove_list_of_text_properties): Skip all of the intervals in
1431 the region between START and END that already have resp. don't
27a98a62
SM
1432 have the requested properties, not just the first one.
1433 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1434 properties. (Bug#13743)
1435
b5071fc7
SM
14362013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1437
1438 * callint.c (Fcall_interactively): Use the right lexical environment
1439 for `interactive' specs (bug#13811).
1440 * eval.c (Feval): Accept a lexical environment.
1441
1ddc2bd6
PE
14422013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1443
1444 Simplify data_start configuration (Bug#13783).
1445 This is a followon simplification to the fix for Bug#13650.
1446 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1447 (START_FILES): Remove. All uses removed.
1448 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1449 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1450 (buildobj.h): Use it.
1451 ($(ALLOBJS)): Depend on globals.h.
1452 (temacs$(EXEEXT)): Use $(ALLOBJS).
1453 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1454 * deps.mk (vm-limit.o):
1455 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1456 Do not depend on mem-limits.h.
1457 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1458 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1459 [__GNUC__ && !ORDINARY_LINK]: Remove.
1460 * mem-limits.h, pre-crt0.c: Remove.
1461 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1462 * unexcoff.c (etext): New decl.
1463 (make_hdr): Use DATA_START instead of start_of_data.
1464 * vm-limit.c: Move most of mem-limits.h's contents here.
1465 (data_start): New decl. It's OK if this is approximate,
1466 so simplify-away some unnecessary exactness.
1467 (POINTER): Remove; all uses removed.
1468 (data_space_start): Now char *, to avoid casts.
1469 (exceeds_lisp_ptr): New function, replacing the old
1470 EXCEEDS_LISP_PTR macro. All uses changed.
1471 (check_memory_limits): Simplify and remove casts.
1472 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1473 (memory_warnings): Use data_start instead of start_of_data.
1474
51aa2a8b
AS
14752013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1476
1477 * xdisp.c (set_message): Only check for debug-on-message if STRING
1478 is a string. (Bug#13797)
1479
1938d88c
PE
14802013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1481
1482 Fix regression introduced by July 10 filelock.c patch.
1483 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1484 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1485 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1486 and diagnosed by Andreas Schwab in
1487 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1488
fcee5028
PE
14892013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 Assume C89 or better.
1492 * ralloc.c (SIZE, POINTER, NIL):
1493 * vm-limit.c (POINTER):
1494 Remove, replacing all uses with C89 equivalents. These old
1495 symbols were present only for porting to pre-C89 platforms.
1496
d78cf5ed
CB
14972013-02-22 Claudio Bley <claudio.bley@gmail.com>
1498
1499 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1500 This avoids warning messages reported as part of Bug#13546.
1501
6bcd97a4
KB
15022013-02-21 Ken Brown <kbrown@cornell.edu>
1503
1504 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1505
b6c2bfff
SM
15062013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1507
e11dacb5
SM
1508 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1509
b6c2bfff
SM
1510 * keyboard.c (Qcommand_execute): New var.
1511 (command_loop_1, read_char): Use it.
1512 (Fcommand_execute): Remove, replace by an Elisp implementation.
1513 (syms_of_keyboard): Adjust accordingly.
1514
f4ad7ea1 15152013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1516
d69f1120
DC
1517 * sheap.c (report_sheap_usage): Use message, not message1, so
1518 that we don't try to create a buffer while we're in the middle
1519 of dumping Emacs. Explain why.
b6c2bfff 1520
2a14a4f1 15212013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1522
2a14a4f1
DA
1523 * search.c (find_newline): Return byte position in bytepos.
1524 Adjust comment.
b6c2bfff
SM
1525 (find_next_newline_no_quit, find_before_next_newline):
1526 Add bytepos argument.
2a14a4f1
DA
1527 * lisp.h (find_newline, find_next_newline_no_quit)
1528 (find_before_next_newline): Adjust prototypes.
1529 * bidi.c (bidi_find_paragraph_start):
1530 * editfns.c (Fconstrain_to_field, Fline_end_position):
1531 * indent.c (compute_motion, vmotion):
1532 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1533 (get_visually_first_element, move_it_vertically_backward):
1534 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1535
872faefb 15362013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1537
1538 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1539 resources were not orderly released.
1540
fd80c659
EZ
15412013-02-17 Eli Zaretskii <eliz@gnu.org>
1542
1543 * xdisp.c (x_draw_vertical_border): For a window that is neither
1544 the leftmost nor the rightmost, redraw both the left and the right
1545 vertical borders. (Bug#13723)
1546
2f73da9c
SM
15472013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1548
1549 * xml.c (init_libxml2_functions):
1550 * sound.c (sound_warning):
1551 * sheap.c (report_sheap_usage):
1552 * process.c (wait_reading_process_output):
1553 * msdos.c (XMenuActivate):
1554 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1555 * keyboard.c (top_level_1):
1556 * editfns.c (Fmessage, Fmessage_box):
1557 * callint.c (Fcall_interactively):
1558 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1559
fd9547e8
JD
15602013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1561
1562 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1563 * frame.c (syms_of_frame): ... to here.
1564
f277993b
EZ
15652013-02-16 Eli Zaretskii <eliz@gnu.org>
1566
c7939585
EZ
1567 * w32.c (sys_chown): Remove unused function.
1568
cd91fb4b
EZ
1569 * w32term.c <input_signal_count>: Declare 'volatile'
1570 unconditionally. (Bug#9066)
1571
f277993b
EZ
1572 * w32.c (set_errno): Reset h_errno and don't set it to any other
1573 value. Set errno instead.
1574 (check_errno): Reset h_errno.
1575 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1576 (sys_gethostname, sys_getservbyname, sys_getpeername)
1577 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1578 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1579 h_errno.
1580 (sys_gethostbyname): Set h_errno only errors detected.
1581
e454145b
PE
15822013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1585
bcf7fe2a
EZ
15862013-02-15 Eli Zaretskii <eliz@gnu.org>
1587
ef9c57e2
EZ
1588 * keyboard.c (read_char): Fix calculation of auto-save time out
1589 when auto-save-timeout is less than 4. (Bug#13720)
1590
ef862e20 1591 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1592 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1593
bcf7fe2a
EZ
1594 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1595 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1596 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1597 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1598 make sure errno is set to an appropriate value. (Bug#13546)
1599 (socket_to_fd): Add assertion against indexing fd_info[] with a
1600 value that is out of bounds.
1601 (sys_accept): If fd is negative, do not set up the child_process
1602 structure for reading.
1603
0063fdb1
DA
16042013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1605
1606 * composite.c (fill_gstring_header): Remove useless prototype.
1607 Break long line.
1608 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1609 * print.c (PRINTDECLARE, print_object):
1610 * search.c (compile_pattern, fast_looking_at, search_buffer):
1611 (simple_search, boyer_moore, Freplace_match):
1612 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1613 (get_overlay_arrow_glyph_row, display_mode_element):
1614 (decode_mode_spec_coding, message3):
1615 * xfaces.c (face_at_string_position): Use bool for booleans.
1616 Adjust comments.
1617
648e5523 16182013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1619
35b3a27e
PE
1620 Fix AIX port (Bug#13650).
1621 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1622 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1623 was #undeffed earlier, so it cannot be used as a macro here.
1624 Use the constant and not the macro.
35b3a27e 1625
648e5523 16262013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1627
0e4e7b74
EZ
1628 * w32proc.c (new_child): If no vacant slots are found in
1629 child_procs[], make another pass looking for slots whose process
1630 has exited or died. (Bug#13546)
1631
6e432f0c
EZ
1632 * w32.c (sys_pipe): When failing due to file descriptors above
1633 MAXDESC, set errno to EMFILE.
1634 (_sys_read_ahead): Update cp->status when failing to read serial
1635 communications input, so that the status doesn't stay at
1636 STATUS_READ_IN_PROGRESS. (Bug#13546)
1637
51b3a99c
JD
16382013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1639
1640 * gtkutil.c (tb_size_cb): New function.
1641 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1642
e31560a7
SM
16432013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1644
1645 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1646 an event.
1647
fe336261
SM
16482013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1649
1650 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1651
5a655b9f
DA
16522013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1653
1654 * font.c (font_range): Add pos_byte argument. Adjust comment
1655 and break long line.
1656 * font.h (font_range): Adjust prototype.
1657 * composite.c (autocmp_chars): Pass byte position to font_range.
1658 Break long line. Remove useless prototype and format comment.
1659
1a359750
GM
16602013-02-13 Glenn Morris <rgm@gnu.org>
1661
1662 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1663
01fcc3a5 16642013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1665
f53f992a
PE
1666 Improve AIX port some more (Bug#13650).
1667 With this, it should be as good as it was in 23.3, though it's
1668 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1669 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1670 * unexaix.c (start_of_text): Remove.
1671 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1672 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1673 (orig_load_scnptr, orig_data_scnptr):
1674 Now off_t, not long, since they are file offsets.
1675 (make_hdr): Use _data, not start_of_data ().
1676 This is the key part of the fix.
1677 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1678 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1679
4458c255
PE
1680 * pre-crt0.c (data_start): Initialize to 1.
1681 This ports to compilers that optimize the external declaration
1682 'int x = 0;' as if it were 'int x;' to shrink the executable.
1683
227be86d
PE
1684 Improve AIX port (Bug#13650).
1685 This doesn't fix the bug, but it makes progress: Emacs builds now.
1686 * unexaix.c: Include inttypes.h, stdarg.h.
1687 (report_error, report_error_1): Mark as _Noreturn.
1688 (report_error): Don't report the wrong errno.
1689 (report_error_1): Now varargs. All callers changed.
1690 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1691 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1692 (write_ptr): Use %p to print address rather than %lx and a cast
1693 to unsigned long. Grow buffer a bit, to be safer.
1694
01fcc3a5 16952013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1696
1697 * bidi.c (bidi_resolve_neutral): After finding the next
1698 non-neutral character, accept NEUTRAL_ON type as well, because
1699 directional control characters, such as LRE and RLE, have their
1700 type converted to that by bidi_resolve_weak. This avoids aborts
1701 when LRE/RLE follows a run of neutrals.
1702 (bidi_move_to_visually_next): Assert that return value of
1703 bidi_peek_at_next_level is non-negative. Negative values will
1704 cause an infloop.
1705
83be8524
PE
17062013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1707
1708 Minor getenv-related fixes.
1709 * callproc.c (Fcall_process_region) [!DOS_NT]:
1710 Avoid unnecessary duplicate call to getenv.
1711 * callproc.c (init_callproc):
1712 * dispnew.c (init_display):
1713 * sysdep.c (sys_subshell):
1714 Omit unnecessary cast of getenv or egetenv.
1715
45b2b768
JB
17162013-02-13 Juanma Barranquero <lekktu@gmail.com>
1717
1718 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1719 Update dependencies.
1720
33b49d71
EZ
17212013-02-12 Eli Zaretskii <eliz@gnu.org>
1722
1723 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1724 marker's position.
1725 (display_line): Set w->region_showing to the value of
1726 it->region_beg_charpos, not to -1. This fixes redisplay
1727 optimization when cursor is moved up after M->. (Bug#13623)
1728 (Bug#13626)
c4131562
EZ
1729 (try_scrolling): Scroll text up more if point is too close to ZV
1730 and inside the scroll margin. This makes sure point is moved
1731 outside the scroll margin in these cases.
33b49d71
EZ
1732
1733 * window.h (struct window): region_showing can no longer be
1734 negative.
1735
b09a4810
PE
17362013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1737
a84b7c53
PE
1738 Tune by using memchr and memrchr.
1739 * doc.c (Fsnarf_documentation):
1740 * fileio.c (Fsubstitute_in_file_name):
1741 * search.c (find_newline, scan_newline):
1742 * xdisp.c (pos_visible_p, display_count_lines):
1743 Use memchr and memrchr rather than scanning byte-by-byte.
1744 * search.c (find_newline): Rename from scan_buffer.
1745 Omit first arg TARGET, as it's always '\n'. All callers changed.
1746
b09a4810
PE
1747 Clean up read_key_sequence a tiny bit more.
1748 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1749 (read_key_sequence): Remove unused locals.
1750
99d0d6dc
SM
17512013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1752
1753 Clean up read_key_sequence a bit; reread active keymaps after first event.
1754 * keyboard.c (read_char, read_char_x_menu_prompt)
1755 (read_char_minibuf_menu_prompt):
1756 Replace nmaps+maps with a single `map' arg.
1757 (follow_key): Operate on a single map.
1758 (active_maps): New function.
1759 (test_undefined): Also return true for nil bindings.
1760 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1761 a single (composed) keymap. Remember `first_event' to choose the right
1762 set of active keymaps. Recompute the set of keymaps after receiving
1763 the first event. Remove GOBBLE_FIRST_EVENT.
1764 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1765 * keyboard.h (read_char): Update declaration.
1766 * lread.c (read_filtered_event): Adjust call to read_char.
1767
f5e1b680
EZ
17682013-02-11 Eli Zaretskii <eliz@gnu.org>
1769
99d0d6dc
SM
1770 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1771 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1772 in the window. (Bug#13675)
1773
f74de345
DA
17742013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1775
1776 * marker.c (set_marker_internal): If desired position is passed
1777 as a marker, avoid call to buf_charpos_to_bytepos.
1778 * window.c (Fset_window_point): Omit redundant type checking.
1779 (Fset_window_start): Likewise. Format comment.
1780 (window_scroll_pixel_based): Use set_marker_restricted_both
1781 with character and byte positions obtained from an iterator.
1782 (Fset_window_configuration): Use set_marker_restricted_both.
1783 * xdisp.c (message_dolog): Likewise.
1784
a4ba3963
EZ
17852013-02-10 Eli Zaretskii <eliz@gnu.org>
1786
99d0d6dc
SM
1787 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1788 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1789 too far. This speeds up some redisplay operations. (Bug#13675)
1790
68643cde
DA
17912013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1792
1793 * syntax.c (scan_sexps_forward): Fix byte position calculation
1794 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1795
7ba11bee
PE
17962013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1797
1798 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1799 that was not needed.
1800
eff1c190
PE
18012013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1802
1803 Minor hashing refactoring.
1804 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1805 (sxhash_float): Return EMACS_UINT, for consistency with the other
1806 hash functions.
1807 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1808 non-static inline function and therefore can't use static vars.
1809 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1810 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1811 with the other hash functions.
1812
6b48c831
EZ
18132013-02-09 Eli Zaretskii <eliz@gnu.org>
1814
4dde2087
EZ
1815 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1816 XXXXXX part of the temporary file pattern is not downcased even
1817 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1818
8549f9e8
EZ
1819 * xdisp.c (decode_mode_spec): Remove handling of %t.
1820
6b48c831
EZ
1821 * msdos.c (careadlinkatcwd): Remove.
1822
75a65c7e
SM
18232013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1824
1825 * lread.c (skip_dyn_bytes): New function (bug#12598).
1826 (read1): Use it. Use getc instead of READCHAR to read bytes.
1827 (load_each_byte): Remove. Update users.
1828
8ca30920
DA
18292013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1830
1831 * search.c (scan_buffer): Calculate end byte position just once.
1832 (scan_newline): Do not recalculate start_byte.
1833 (search_command): Use eassert.
1834 * syntax.c (struct lisp_parse_state): New member location_byte.
1835 (scan_sexps_forward): Record from_byte and avoid redundant
1836 character to byte position calculation ...
1837 (Fparse_partial_sexp): ... here. Break too long line.
1838
25721f5b
DA
18392013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1840
1841 * lisp.h (make_uninit_vector): New function.
1842 * alloc.c (Fvector, Fmake_byte_code):
1843 * ccl.c (Fregister_ccl_program):
1844 * charset.c (Fdefine_charset_internal, define_charset_internal):
1845 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1846 * composite.c (syms_of_composite):
1847 * font.c (Fquery_font, Ffont_info, syms_of_font):
1848 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1849 * ftfont.c (ftfont_shape_by_flt):
1850 * indent.c (recompute_width_table):
1851 * nsselect.m (clean_local_selection_data):
1852 * syntax.c (init_syntax_once):
1853 * w32unsubscribe.c (uniscribe_shape):
1854 * window.c (Fcurrent_window_configuration):
1855 * xfaces.c (Fx_family_fonts):
1856 * xselect.c (selection_data_to_lisp_data): Use it.
1857
9a9d91d9
DA
18582013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1859
1860 * coding.c (Fdefine_coding_system_internal): Use AREF where
1861 argument is known to be a vector.
1862 * fns.c (Flocale_info): Likewise for ASET.
1863 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1864 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1865
6871e574
JD
18662013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1867
1868 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1869 height.
1870
1871 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1872 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1873 updateCollectionBehaviour.
1874
1875 * nsterm.m (NEW_STYLE_FS): Remove.
1876 (ns_last_use_native_fullscreen): New variable.
1877 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1878 (x_set_window_size): Do not take title bar and tool bar into account
1879 if isFullscreen returns YES.
1880 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1881 (check_native_fs): New function.
1882 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1883 (ns_term_init): Remove NEW_STYLE_FS.
1884 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1885 and tool bar if isFullscreen returns NO.
1886 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1887 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1888 with HAVE_NATIVE_FS.
1889 (window:willUseFullScreenPresentationOptions:): New method.
1890 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1891 Hide toolbar if not enabled (Bug#13444).
1892 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1893 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1894 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1895 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1896 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1897 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1898 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1899 (syms_of_nsterm): Add ns-use-native-fullscreen.
1900
3f011c7f
PE
19012013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1902
1903 * fileio.c (Qchoose_write_coding_system): Now static.
1904
86f7c0fe
EZ
19052013-02-04 Eli Zaretskii <eliz@gnu.org>
1906
1907 * xdisp.c (window_buffer_changed): region_showing can be negative,
1908 which still means region is being displayed.
1909 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1910 whole window when showing region and the mark has changed.
1911 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1912 (display_line): If it->region_beg_charpos is non-zero, set the
1913 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1914
1915 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1916 not bitfield of 1 bit.
1917
5257b701
DC
19182013-02-03 Daniel Colascione <dancol@dancol.org>
1919
1920 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1921 daemon mode works on cygw32 when Emacs is installed and not just
1922 during development.
1923
8ea41ea9
PE
19242013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1925
1926 Avoid file time stamp bug on MS-Windows (Bug#13149).
1927 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1928 as FAT32 doesn't update time stamps when truncating them.
1929 Also, check that a file time stamp is not a multiple of 100 ns;
1930 this should catch all instances of the problem on MS-Windows,
1931 as its native file system resolution is 100 ns or worse, and
1932 checking for a non-multiple of 100 ns should impose only a small
1933 overhead on systems with ns resolution.
1934
94fbc901 19352013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1936
e7ac588e
EZ
1937 Avoid encoding file names on MS-Windows when they need to be run
1938 through dostounix_filename.
1939 * w32.c (normalize_filename): Accept an additional argument
1940 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1941 downcase it even if w32-downcase-file-names is non-nil.
1942 (dostounix_filename): Accept an additional argument MULTIBYTE and
1943 pass it to normalize_filename.
1944 (emacs_root_dir): Adjust.
1945
1946 * msdos.h (dostounix_filename): Adjust prototype.
1947
1948 * w32.h (dostounix_filename): Adjust prototype.
1949
1950 * msdos.c (dostounix_filename): Accept an additional argument and
1951 ignore it.
1952 (init_environment): Adjust callers of dostounix_filename.
1953
1954 * fileio.c (Ffile_name_directory, file_name_as_directory)
1955 (directory_file_name, Fexpand_file_name)
1956 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1957 dostounix_filename.
1958 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1959 non-nil.
1960 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1961 variables, as egetenv is case-insensitive for DOS_NT.
1962
1963 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1964 with an encoded file name.
1965
99d0d6dc
SM
1966 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1967 Adjust calls to dostounix_filename.
e7ac588e
EZ
1968
1969 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1970
1971 * unexw32.c (unexec): Adjust call to dostounix_filename.
1972
1973 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1974
1975 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1976 dostounix_filename.
1977
1978 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1979 dostounix_filename.
1980
e7c3fb06
EZ
1981 * callproc.c (Fcall_process): Make sure program name in PATH and
1982 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1983 is passed to exec/spawnve, which fails unless the file-name
1984 encoding is UTF-8.
1985
18a80473
EZ
1986 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1987 even if w32-quote-process-args is nil.
1988
35e85499
PE
19892013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 Fix timestamp bug when write-region appends nothing (Bug#13149).
1992 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1993 the file's time stamp doesn't change if Emacs happens to write nothing
1994 to the file, and on a buggy file system this could cause Emacs to
1995 incorrectly infer that the file system doesn't have the bug.
1996 Avoid this problem by inhibiting the inference in this case.
1997
422ff52b
DA
19982013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1999
2000 * window.h (struct window): Convert base_line_number, base_line_pos
2001 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2002 Convert region_showing member from Lisp_Object to bitfield.
2003 Remove sequence_number member. Adjust comments.
2004 * window.c (sequence_number): Remove.
2005 (make_window): Initialize column_number_displayed.
2006 * print.c (print_object): Follow the printed representation of
2007 frames and print window pointer to distinguish between windows.
2008 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2009 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2010 (wset_column_number_displayed, wset_region_showing): Remove.
2011 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2012 (try_scrolling, try_cursor_movement, redisplay_window)
2013 (try_window_reusing_current_matrix, try_window_id, display_line)
2014 (display_mode_lines, decode_mode_spec): Adjust users.
2015 * .gdbinit (pwinx): Do not print sequence_number.
2016
8654f9d7
PE
20172013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2018
2019 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2020 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2021 * dired.c: Include <fcntl.h>.
2022 (open_directory): New function, which uses open and fdopendir
2023 rather than opendir. DOS_NT platforms still use opendir, though.
2024 (directory_files_internal, file_name_completion): Use it.
2025 (file_attributes): New function, with most of the old Ffile_attributes.
2026 (directory_files_internal, Ffile_attributes): Use it.
2027 (file_attributes, file_name_completion_stat): First arg is now fd,
2028 not dir name. All uses changed. Use fstatat rather than lstat +
2029 stat.
2030 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2031 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2032 (emacs_readlinkat): New function, with much of the old
2033 Ffile_symlink_p, but with an fd argument for speed.
2034 It uses readlinkat rather than careadlinkatcwd, so that it
2035 need not assume the working directory.
2036 (Ffile_symlink_p): Use it.
2037 * filelock.c (current_lock_owner): Use emacs_readlinkat
2038 rather than emacs_readlink.
2039 * lisp.h (emacs_readlinkat): New decl.
2040 (READLINK_BUFSIZE, emacs_readlink): Remove.
2041 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2042 (emacs_norealloc_allocator, emacs_readlink): Remove.
2043 This stuff is moved to fileio.c.
2044 * w32.c (fstatat, readlinkat): New functions.
2045 (careadlinkat): Don't check that fd == AT_FDCWD.
2046 (careadlinkatcwd): Remove; no longer needed.
2047
9dbda100
GM
20482013-01-31 Glenn Morris <rgm@gnu.org>
2049
2050 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
2051 (Fwrite_region): Update for new choose_write_coding_system args.
2052 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
2053 (syms_of_fileio): Add choose-write-coding-system.
2054
3f82a88a 20552013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
2056
2057 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2058 (sys_close): Zero out the flags for the file descriptor before
2059 closing it. (Bug#13546)
2060
806fed21 2061 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
2062 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2063 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
2064 DBCS. (Bug#13553)
2065
6ee4509a
EZ
2066 * w32.c (w32_get_long_filename, init_environment, readlink):
2067 Support file names encoded in DBCS codepages.
26854e9c
EZ
2068 (readlink): Use the current file-name-coding-system, not the ANSI
2069 codepage, to decode and handle targets of symlinks.
6ee4509a 2070
cf01a359
EZ
20712013-01-28 Eli Zaretskii <eliz@gnu.org>
2072
2073 * w32.c (opendir): Now accepts a 'const char *'.
2074
6fd326b7
DA
20752013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 Remove obsolete redisplay code. See the discussion at
2078 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2079 * dispnew.c (preemption_period, preemption_next_check): Remove.
2080 (Vredisplay_preemption_period): Likewise.
2081 (update_frame, update_single_window, update_window, update_frame_1):
2082 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2083 used, following the 2012-06-22 change.
2084
d8cd7742
EZ
20852013-01-25 Eli Zaretskii <eliz@gnu.org>
2086
2087 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2088
266fee4f
DA
20892013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2090
2091 * font.c (num_fonts): Remove the leftover from old
2092 debugging code. Adjust comment style here and there.
59e624b3
DA
2093 * insdel.c (insert_1): Remove.
2094 * lisp.h (insert_1): Remove prototype.
2095 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 2096
830e46e6 20972013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
2098
2099 * w32.c (max_filename_mbslen): New function.
2100 (normalize_filename, readdir): Use it to detect locales where ANSI
2101 encoding of file names uses a double-byte character set (DBCS).
2102 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
2103 CharNextExA, instead of incrementing a 'char *' pointer.
2104 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 2105
81abbb95
EZ
2106 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2107 request of memory reservation to 1.7GB. (Bug#13065)
2108
830e46e6 21092013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
2110
2111 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2112 at check_extra_latin label. (Bug#13505)
2113
fd3ceb09
DA
21142013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2115
2116 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2117 Avoid redundant calls to strlen.
2118
edfa7fa0
DA
21192013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 Drop async_visible and async_iconified fields of struct frame.
2122 This is possible because async input is gone; for details, see
2123 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2124 * frame.h (struct frame): Remove async_visible and async_iconified
2125 members, convert garbaged to unsigned bitfield. Adjust comments.
2126 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2127 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2128 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2129 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2130 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2131 * w32term.c: Ditto.
2132 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2133 properly. Likewise for obscured.
2134 * xterm.c: Ditto.
266fee4f 2135 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
2136 properly.
2137 * nsterm.m: Ditto.
2138 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2139
5ad86e34
DA
21402013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2143 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2144
b09cca6a
SM
21452013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2146
2147 * xdisp.c (message2, message2_nolog): Remove functions.
2148 (message3, message3_nolog): Extract nbytes and multibyteness directly
2149 from the string. Change all callers.
2150 (message3_nolog): Don't set message_enable_multibyte since set_message
2151 will reset it anyway.
2152 (message1, message1_nolog): Use message3.
2153 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2154 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2155 (set_message): Drop all but the second arg, which has to be a string.
2156 (set_message_1): Simplify now that we know that a1 is NULL and the
2157 second arg is a string.
2158 * frame.h (struct frame): Remove `message_buf' field.
2159 Use glyphs_initialized_p instead.
2160 (FRAME_MESSAGE_BUF): Remove macro.
2161 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2162 * lisp.h (message2, message2_nolog): Remove declarations.
2163 (message3, message3_nolog): Update declarations.
2164 * keyboard.c (read_char_minibuf_menu_text)
2165 (read_char_minibuf_menu_width): Remove vars.
2166 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2167 to correctly handle multibyte strings.
2168 * frame.c (delete_frame): Don't free message_buf any more.
2169 * editfns.c (message_text, message_length): Remove vars.
2170 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2171 * fileio.c (auto_save_error): Use message3 instead of message2.
2172 * dispnew.c (adjust_frame_message_buffer): Remove function.
2173
54ab1c5a
EZ
21742013-01-23 Eli Zaretskii <eliz@gnu.org>
2175
2176 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2177 real estate used for the tool bar and the menu bar.
2178
6c27465b
DA
21792013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2180
2181 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2182 hidden buffer is prepared to modification (Bug#13164).
2183
9d93ce29
DA
21842013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 * window.h (struct window): Change window_end_valid member from
2187 Lisp_Object to a bitfield. Adjust comments.
2188 (wset_window_end_valid): Remove.
2189 * window.c (adjust_window_count): Clear window_end_valid.
2190 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2191 (Fwindow_line_height, set_window_buffer, Frecenter)
2192 (Fsplit_window_internal, Fdelete_other_windows_internal)
2193 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2194 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2195 * xdisp.c (check_window_end, reconsider_clip_changes)
2196 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2197 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2198 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2199
1dcb8ea2
DA
22002013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2201
2202 * xdisp.c (mark_window_display_accurate): Simplify the loop
2203 assuming that the only one of vchild, hchild or buffer window
2204 slots is non-nil. Call mark_window_display_accurate_1 for
2205 the leaf windows only.
2206 (mark_window_display_accurate_1): Always assume leaf window.
2207 Adjust comment.
2208
b41b8a7e
PE
22092013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2210
593a5f2e
PE
2211 * emacs.c (Qkill_emacs_hook): Now static.
2212
b41b8a7e
PE
2213 * fileio.c (Finsert_file_contents): Simplify.
2214 Remove unnecessary assignments and tests.
2215
84e5ed96
EZ
22162013-01-21 Eli Zaretskii <eliz@gnu.org>
2217
2218 * w32.c (acl_set_file): Don't test for errors unless
2219 set_file_security returns FALSE. Avoids spurious errors when
2220 saving files.
2221
2ef88fd4
DA
22222013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2223
2224 * fileio.c (Finsert_file_contents): Revert code introduced at
2225 2013-01-18 in favor of the simpler and generally better fix.
2226 Save stack space by removing 'buffer' and reusing 'read_buf'
2227 where appropriate.
2228
d7a0a7c9
PE
22292013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2230
2231 * lisp.h (eabs): Define unconditionally (Bug#13419).
2232 The old "#if !defined (eabs)" was an unnecessary revenant of back
2233 when this macro was called "abs". Document 'eabs' better.
2234
795e7a5b 22352013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2236
2237 * fns.c (Frandom): Doc fix.
2238
59ac2d13
EZ
22392013-01-19 Eli Zaretskii <eliz@gnu.org>
2240
2241 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2242 segfault when there are lots of overlays.
2243
2244 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2245 when there are lots of overlays.
2246 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2247 for the details and a way to reproduce.
2248
b3fbb395
PE
22492013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2250
3a955a1f
PE
2251 * fileio.c: Use O_APPEND to append.
2252 This corresponds better to the natural interpretation of "append",
2253 and avoids the need to open the output file twice, or to invoke
2254 lseek when APPEND is neither nil nor a number.
2255 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2256 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2257 file possibly twice, and lseeking to its end; this avoids the
2258 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2259 at the same time: the combination is never needed and apparently
2260 it doesn't work with DOS_NT.
2261
21cd50b8
PE
2262 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2263 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2264
b3fbb395
PE
2265 Allow floating-point file offsets.
2266 Problem reported by Vitalie Spinu in
2267 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2268 * fileio.c (emacs_lseek): Remove.
2269 (file_offset): New function.
2270 (Finsert_file_contents, Fwrite_region): Use it.
2271
73c14218
CY
22722013-01-19 Chong Yidong <cyd@gnu.org>
2273
2274 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2275 aborting on Fsignal (Bug#13289).
2276
6a9465f3
EZ
22772013-01-19 Eli Zaretskii <eliz@gnu.org>
2278
2279 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2280 set_file_security as failure due to insufficient privileges.
2281 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2282 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2283
fa705c99
PE
22842013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2285
9fe43ff6
PE
2286 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2287 The bug was observed on Ubuntu operating inside a virtual machine,
2288 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2289 The workaround introduces a race condition on non-buggy hosts,
2290 but it's an unlikely race and anyway there's a nearly identical
2291 nearby race that can't be fixed.
2292 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2293 New static vars.
2294 (Fwrite_region): Test for file system time stamp bug.
2295 (init_fileio): New function.
2296 * lisp.h (init_fileio): Declare it.
2297 * emacs.c (main): Call it.
2298
fa705c99
PE
2299 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2300 and make it more consistent with other stat-failure diagnostics.
2301
e07469fa
DA
23022013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2303
99d0d6dc
SM
2304 Fix crash when inserting data from non-regular files.
2305 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2306 for the error description produced by valgrind.
2307 * fileio.c (read_non_regular): Rename to read_contents.
2308 Free Lisp_Save_Value object used to pass parameters.
2309 (read_non_regular_quit): Rename to read_contents_quit.
2310 (Finsert_file_contents): Redesign internal file reading loop to adjust
2311 gap and end positions after each read and so help make_gap to work
2312 properly. Do not signal an I/O error too early and so do not leave
2313 not yet decoded characters in a buffer, which was the reason of
2314 redisplay crash. Use list2 to build return value. Adjust comments.
2315
67722112
PE
23162013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 Close a race when statting and reading files (Bug#13149).
2319 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2320 This avoids a race if the file is renamed between stat and open.
2321 This race is not the problem originally noted in Bug#13149;
2322 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2323
468afbac
DA
23242013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2327 objects, related functions and macros.
2328 (make_save_value): Adjust prototype.
2329 (make_save_pointer): New prototype.
2330 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2331 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2332 * alloc.c (format_save_value): Rename to make_save_value.
2333 (make_save_pointer): New function.
2334 (record_xmalloc): Use make_save_pointer.
2335 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2336 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2337 Change users of make_save_value to make_save_pointer.
2338 Likewise for format_save_value and make_save_value.
2339
0e70695a
DA
23402013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2341
2342 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2343 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2344 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2345 debugging stubs.
2346
963ea40f
PE
23472013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * alloc.c (free_save_value): Now static.
2350
3346c1d0
DA
23512013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2352
2353 * keymap.c (map_keymap_internal): Use format_save_value.
2354 (map_keymap_char_table_item): Adjust accordingly.
2355 * fileio.c (non_regular_fd, non_regular_inserted)
2356 (non_regular_nbytes): Remove.
99d0d6dc
SM
2357 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2358 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2359 (read_non_regular): Use XSAVE_ macros to extract parameters.
2360 Adjust comment.
2361 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2362 format_save_value.
2363 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2364
2b30549c
DA
23652013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2366
2367 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2368 extraction from any Lisp_Save_Value slot. Add type checking.
2369 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2370 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2371 * xselect.c: All users changed.
2372
1b971ac1
DA
23732013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2374
2375 Some convenient bits to deal with Lisp_Save_Values.
2376 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2377 (allocate_misc): Remove prototype.
2378 (format_save_value): New prototype.
2379 * alloc.c (allocate_misc): Revert back to static.
2380 (format_save_value): New function to build Lisp_Save_Value
2381 object with the specified internal structure.
2382 (make_save_value): Reimplement using format_save_value.
2383 * editfns.c (save_excursion_save): Use format_save_value.
2384 (save_excursion_restore): Use XSAVE_OBJECT.
2385
c50cf2ea
PE
23862013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 Avoid needless casts with XSAVE_POINTER.
2389 * alloc.c (mark_object) [GC_MARK_STACK]:
2390 * dired.c (directory_files_internal_unwind):
2391 * fileio.c (do_auto_save_unwind):
2392 * gtkutil.c (pop_down_dialog):
2393 * keymap.c (map_keymap_char_table_item):
2394 * lread.c (load_unwind):
2395 * nsmenu.m (pop_down_menu):
2396 * print.c (print_object) [GC_MARK_STACK]:
2397 * xfns.c (clean_up_file_dialog):
2398 * xmenu.c (cleanup_widget_value_tree):
2399 Omit casts between XSAVE_POINTER and a pointer type.
2400
9d5a1260
DA
24012013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2402
2403 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2404 * eval.c (eval_sub): Protect `form' from being GCed before its
2405 car and cdr becomes protected with the backtrace entry.
2406
73ebd38f
DA
24072013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2408
2409 Make Lisp_Save_Value more versatile storage for up to four objects.
2410 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2411 (struct Lisp_Save_Value): New layout. Adjust comments.
2412 (XSAVE_POINTER): New macro.
2413 (XSAVE_INTEGER): Likewise.
2414 (allocate_misc): Add prototype.
2415 (free_misc): Likewise.
2416 * alloc.c (allocate_misc): Now global.
2417 (free_misc): Likewise. Adjust comment.
2418 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2419 (free_save_value): Likewise.
2420 (mark_object): Likewise.
2421 * editfns.c (save_excursion_save): Pack everything within
2422 Lisp_Save_Value and so avoid xmalloc.
2423 (save_excursion_restore): Adjust to match new layout. Use free_misc
2424 because we do not allocate extra memory any more. Add eassert.
2425 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2426 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2427 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2428 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2429 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2430
b826986f
JD
24312013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2432
2433 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2434 (nsfont_draw): Remove disabling of LCD smoothing.
2435 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2436 Bug#11484 with LCD smoothing on.
b826986f 2437
c0511b57 24382013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2439
b6f960a0
PE
2440 Fix SIGDANGER handlers, for AIX (Bug#13408).
2441 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2442 Move handlers here from emacs.c; they were out of place.
2443
616763d5
JD
24442013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2445
2446 * xterm.c (syms_of_xterm): Adjust documentation for
2447 scroll-bar-adjust-thumb-portion.
2448
0b59090b 24492012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2450
2451 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2452 determine whether scroll bar thumb size should be adjusted or
2453 not. Use variable for MOTIF.
2454
2455 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2456 GTK.
2457
7bc916b4
JD
24582013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2459
eac4d08f
JD
2460 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2461 event is generated.
2462 (doCommandBySelector:): Set processingCompose to NO.
2463
7bc916b4
JD
2464 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2465 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2466 (nsfont_list_family): Add block/unblock_input calls.
2467 (nsfont_open): Move block_input earlier. Add unblock_input before early
2468 return.
2469 (nsfont_draw): Add block/unblock_input calls.
2470
bdc9b756
PE
24712013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2474 for old_charpos and old_bytepos.
2475
ee56a6dc
PE
24762013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2479 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2480 Clear tzvalbuf_in_environ if this workaround is in effect.
2481 Problem and fix reported by Kazuhiro Ito.
2482
9fc9a531
AH
24832013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2484
99d0d6dc
SM
2485 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2486 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2487
2488 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2489 doc string cross-reference(s).
2490
2491 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2492 string cross-reference(s).
2493
6020559a
DA
24942013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2495
2496 Avoid unnecessary byte position calculation for the gap movement.
2497 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2498 anyway, all of them should use move_gap_both instead.
2499 * lisp.h (move_gap): Remove prototype.
2500 * insdel.c (move_gap): Remove.
2501 (move_gap_both): Add eassert.
2502 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2503 * xml.c (parse_region): Likewise.
2504
b8956427
PE
25052013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 emacsclient -t should not suspend Emacs server (Bug#13387)
2508 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2509 New functions.
2510 * term.c (init_tty): Use them instead of rolling our own code.
2511 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2512 switches from 'signal' to 'pthread_sigmask', which is safer in
2513 multithreaded applications.
2514 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2515 which has already arranged for that.
2516 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2517 This is the main part of the bug fix.
2518
0b59090b 25192013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2520
2521 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2522 x_last_font_name (Bug#13403).
2523
58cc0a01
DA
25242013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2525
2526 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2527 the type of per-buffer values where appropriate.
2528 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2529 predicate, which is how it's really used now. Adjust comment.
2530 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2531 * buffer.c (buffer_slot_type_mismatch): Remove.
2532 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2533 predicate. Adjust comment.
2534 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2535 fill-column, left-margin, tab-width, buffer-saved-size,
2536 left-margin-width, right-margin-width, left-fringe-width,
2537 right-fringe-width, scroll-bar-width and buffer-display-count.
2538 Use Qstringp for default-directory, buffer-file-name,
2539 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2540 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2541 line-spacing.
2542 * data.c (store_symval_forwarding): Adjust to call the predicate.
2543
5104861e
JB
25442013-01-09 Juanma Barranquero <lekktu@gmail.com>
2545
2546 * w32.c (get_name_and_id, acl_set_file):
2547 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2548
eefd7278
DA
25492013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2550
2551 * lisp.h (make_gap_1): New prototype.
2552 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2553 gap size values.
2554 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2555 naming convention.
2556 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2557 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2558 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2559 (make_gap_1): New function to adjust the gap of any buffer.
2560 * coding.c (coding_alloc_by_making_gap): Use it.
2561 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2562 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2563
073ca75b
JL
25642013-01-08 Juri Linkov <juri@jurta.org>
2565
2566 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2567 of (supports :underline (:style wave)). (Bug#13000)
2568
3bace969
AH
25692013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2570
2571 * undo.c (Fprimitive_undo): Move to simple.el.
2572 (syms_of_undo): Remove declarations for Sprimitive_undo.
2573
63a63bd4
SM
25742013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2575
2576 * keyboard.c (echo_add_key): Rename from echo_add_char.
2577
56ed110a
CY
25782013-01-06 Chong Yidong <cyd@gnu.org>
2579
2580 * keyboard.c (echo_add_char): New function, factored out from
2581 echo_char. Don't add a space if the previous echo string was
2582 empty (Bug#13255).
2583 (echo_char): Use it.
2584 (read_key_sequence): When echoing mock input, ensure that the
2585 trailing dash is properly added.
2586
b630991b
EZ
25872013-01-05 Eli Zaretskii <eliz@gnu.org>
2588
2589 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2590 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2591 digits for buffer positions, before misalignment starts.
2592 Display "0" for integer "object" field.
b630991b
EZ
2593 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2594 Display the newline glyph more unambiguously.
2595
f032a318
YM
25962013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2597
2598 * nsterm.m (ns_draw_underwave):
2599 * w32term.c (w32_draw_underwave):
2600 * xterm.c (x_draw_underwave): Make underwave look more triangular
2601 and also degrade gracefully for small fonts. (Bug#13000)
2602
4240dd3c
YM
2603 * nsterm.m (ns_draw_text_decoration):
2604 * w32term.c (x_draw_glyph_string):
2605 * xterm.c (x_draw_glyph_string): Don't use previous underline
2606 thickness and position if previous underline type is underwave.
2607
553081a5
SM
26082013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2609
2610 * fileio.c (Ffile_acl): Undocument return format.
2611
9539d465 26122013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2613
2614 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2615
71376d4b
PE
26162013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2617
2618 Simplify via eabs.
2619 * dired.c (file_name_completion):
2620 * doc.c (get_doc_string):
2621 * floatfns.c (round2):
2622 * font.c (font_score, font_delete_unmatched):
2623 * fringe.c (compute_fringe_widths):
2624 * lread.c (read_list):
2625 * minibuf.c (Ftry_completion):
2626 * term.c (tty_ins_del_lines):
2627 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2628 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2629
a7f11948
EZ
26302012-12-31 Eli Zaretskii <eliz@gnu.org>
2631
2632 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2633 correctly.
2634 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2635 for the bug this caused.
2636
84cc1ab6
PE
26372012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2638
2639 * coding.c (Qmac): Now static.
2640
5a1d858b
JD
26412012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2642
2643 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2644 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2645 handlebox_widget. Set toolbar_in_hbox to false/true, set
2646 toolbar_is_packed to true.
2647 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2648 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2649 Show all on TOOLBAR_TOP_WIDGET.
2650 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2651 by TOOLBAR_TOP_WIDGET.
2652 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2653 Check toolbar_is_packed.
8b745d92
JD
2654 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2655 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2656 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2657 false.
2658 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2659 (xg_update_menubar): Update title only if
2660 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2661 (xg_update_submenu): Skip tearoff only if
2662 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2663 (xg_initialize): Initialize xg_detached_menus only if
2664 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2665
2666 * xterm.h (struct x_output): Surround handlebox_widget with
2667 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2668 toolbar_in_hbox is bool.
2669
d5e5e7b4 26702012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2671
2672 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2673 (LIBS_GNUSTEP): Define.
2674 (LIBES): Add $(LIBS_GNUSTEP).
2675 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2676
d5e5e7b4 26772012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2678
2679 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2680 continuation glyph on a TTY with an indication of an empty line.
2681 (Bug#13277)
2682
e7ae8039
EZ
26832012-12-29 Eli Zaretskii <eliz@gnu.org>
2684
ccad023b
EZ
2685 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2686 file's SELinux context or ACLs successfully set, nil otherwise.
2687 (Bug#13298)
8d23a331 2688 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2689
e7ae8039
EZ
2690 * w32proc.c (reader_thread): Avoid passing NULL handles to
2691 SetEvent and WaitForSingleObject.
2692
7456e13f
PE
26932012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 Port EXTERNALLY_VISIBLE to Clang 3.2.
2696 * conf_post.h (__has_attribute): New macro.
2697 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2698
1ab0c851
GM
26992012-12-27 Glenn Morris <rgm@gnu.org>
2700
2701 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2702 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2703
82e2a1f0 27042012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2705
63a63bd4
SM
2706 * fileio.c (file_name_as_directory, directory_file_name):
2707 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2708 came from a multibyte or a unibyte Lisp string; all callers
2709 adjusted. Don't assume the input string is always multibyte.
2710 (Bug#13262)
2711 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2712 don't ENCODE_FILE them, and return a unibyte string if the input
2713 was unibyte.
2714 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2715 don't assume the input strings will always be multibyte. If the
2716 input strings are multibyte, decode strings obtained from C
2717 library functions.
2718
8847a0de
DA
27192012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 * lisp.h (toplevel): Add two notices to the comment about
2722 defining a new Lisp data type.
6cda572a
DA
2723 * print.c (print_object): If Lisp_Save_Value object's pointer
2724 is the address of a memory area containing Lisp_Objects, try
2725 to print them.
2726 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2727
4b298d5a
DA
27282012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2729
2730 * keyboard.c (record_asynch_buffer_change): Initialize an event
2731 only if it's really needed.
2732 * frame.h (enum output_method): Remove output_mac member since
2733 it's a leftover from the deleted code.
2734 * frame.c (Fframep): Adjust user here ...
2735 * terminal.c (Fterminal_live_p): ... and here.
2736 * coding.c (Qmac): Now here because it's only used to denote
2737 end-of-line encoding type.
2738 (syms_of_coding): DEFSYM it.
2739 * frame.h (Qmac): Remove duplicated declaration.
2740
12384b01
PE
27412012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2742
2743 * window.c (select_window_1): Now static, since it's used only here.
2744
f1665bdc
EZ
27452012-12-25 Eli Zaretskii <eliz@gnu.org>
2746
2747 * window.c (window_body_cols): Subtract display margins from the
2748 window body width on TTYs as well. See
2749 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2750 for the original report.
2751
9a0d4f34
DA
27522012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2753
2754 * xdisp.c (redisplay_window): Remove inner local variable
2755 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2756 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2757 set but never used.
2758 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2759 (xg_create_tool_bar): Adjust users.
9a0d4f34 2760
f9e7c67e
DA
27612012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2762
2763 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2764 * buffer.c (Fget_buffer_create): Use it to set compact field of
2765 struct buffer_text to avoid accessing an uninitialized value
2766 when compact_buffer is called for the first time.
2767 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2768 (Fset_buffer_modified_p): Use buffer_window_count to check
2769 whether the buffer is displayed in some window.
2770 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2771
299614f3
EZ
27722012-12-23 Eli Zaretskii <eliz@gnu.org>
2773
40ff07a5
EZ
2774 * w32.c (acl_set_file): If setting the file security descriptor
2775 fails, and the new DACL is identical to the existing one, silently
2776 return success. This fixes problems for users backing up their
2777 own files without having the necessary privileges for setting
2778 security descriptors.
2779
299614f3
EZ
2780 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2781 values.
2782 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2783 after WaitForSingleObject returns normally. This expedites reader
2784 thread shutdown when delete_child triggers it.
2785 (reap_subprocess): More accurate commentary for why we call
2786 delete_child only when cp->fd is negative.
2787
2788 * w32.c (sys_close): Do not call delete_child on a subprocess
2789 whose handle is not yet closed. Instead, set its file descriptor
2790 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2791 delete_child on that subprocess when its SIGCHLD arrives.
2792 This avoids closing handles used for communications between sys_select
299614f3
EZ
2793 and reader_thread, which doesn't give sys_select a chance to
2794 notice that the process exited and invoke the SIGCHLD handler for
2795 it.
2796
cf162aee
JD
27972012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2798
2799 * nsfns.m (Fns_do_applescript): Run event loop until script has
2800 been executed (Bug#12969).
2801 (ns_run_ascript): Chech as_script for nil, set to nil after
2802 executing script.
2803
94900bfe
MR
28042012-12-22 Martin Rudalics <rudalics@gmx.at>
2805
2806 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2807
b2faf49c
EZ
28082012-12-22 Eli Zaretskii <eliz@gnu.org>
2809
2810 * w32term.c (w32fullscreen_hook): New function.
2811 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2812
7efa3fb3
EZ
28132012-12-21 Eli Zaretskii <eliz@gnu.org>
2814
bb085aed
EZ
2815 * fileio.c (Finsert_file_contents): Doc fix.
2816
7efa3fb3
EZ
2817 * w32proc.c (new_child, delete_child, find_child_pid): For a
2818 subprocess, consider its slot being in use as long as its process
2819 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2820 slot when a new process is started immediately after killing
2821 another one, without waiting enough time for the first process to
2822 be reaped and resources allocated for it be orderly freed.
2823 (Bug#13086)
2824 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2825
c1f02afa
CY
28262012-12-21 Chong Yidong <cyd@gnu.org>
2827
2828 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2829
5bec25eb
CY
2830 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2831
a4b0cca1 28322012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2833
2834 * w32.c (get_name_and_id): Always pass NULL as the first argument
2835 of lookup_account_sid. Avoids crashes with UNC file names that
2836 refer to DFS domains, not to specific machine names. (Bug#12621)
2837 Remove now unused argument FNAME; all callers changed.
2838 (get_file_owner_and_group): Remove now unused argument FNAME; all
2839 callers changed.
2840
34b4b7eb
CY
28412012-12-21 Chong Yidong <cyd@gnu.org>
2842
2843 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2844 error for invalid chars, don't check for a nil return value.
2845
13002885
DA
28462012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2847
2848 Avoid calls to CHAR_TO_BYTE if byte position is known.
2849 * editfns.c (make_buffer_string_both): Use move_gap_both.
2850 (Fbuffer_string): Use make_buffer_string_both.
2851 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2852 Adjust comment.
2853 (buf_bytepos_to_charpos): Likewise.
2854 (charpos_to_bytepos): Remove.
2855 * fileio.c (Finsert_file_contents): Use move_gap_both.
2856 * search.c (Freplace_match): Likewise.
9a0d4f34 2857 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2858 names for byte positions.
2859 * lisp.h (charpos_to_bytepos): Remove prototype.
2860 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2861 * insdel.c (move_gap): Likewise.
2862
99e9311c
PE
28632012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2864
2865 * xdisp.c (redisplay_internal): Remove now-unused local.
2866
e02230bf
SM
28672012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2868
2869 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2870 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2871 proper value of frame-local variables (bug#13225).
e02230bf 2872
1687fb14
DA
28732012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2874
2875 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2876 Rename 4th argument since it may be buffer or string. Adjust comment.
2877 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2878
a2f07cd2
DA
28792012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2880
2881 * coding.c (Fdetect_coding_region): Do not check start and end with
2882 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2883 (code_convert_region): Likewise.
2884
474d441e
EZ
28852012-12-18 Eli Zaretskii <eliz@gnu.org>
2886
2887 * w32.c (acl_get_file, acl_set_file): Run the file name through
2888 map_w32_filename, and resolve any symlinks in the file name, like
2889 Posix platforms do.
2890 (acl_set_file): Call revert_to_self, if any privileges were
2891 enabled.
2892
8725c076
JB
28932012-12-17 Juanma Barranquero <lekktu@gmail.com>
2894
2895 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2896 ($(BLD)/w32.$(O)): Update dependencies.
2897
1e101a4b
SM
28982012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2899
2900 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2901 propagate redisplay's scrolling (if any) to the right window.
2902 (redisplay_internal): Use ensure_selected_frame.
2903 (display_mode_lines): Complete last fix.
2904 * window.c (select_window_1): New func, extracted from select_window.
2905 (select_window): Use it.
2906 * window.h (select_window_1): Declare.
2907
66447e07
EZ
29082012-12-17 Eli Zaretskii <eliz@gnu.org>
2909
2910 Emulate Posix ACL APIs on MS-Windows.
2911 * w32.c: Include sddl.h and sys/acl.h.
2912 (SDDL_REVISION_1): Define if not already defined.
2913 (g_b_init_get_security_descriptor_dacl)
2914 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2915 (g_b_init_is_valid_security_descriptor)
2916 (g_b_init_set_file_security): New static flags.
2917 (globals_of_w32): Initialize them to zero.
2918 (SetFileSecurity_Name): New string constant.
2919 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2920 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2921 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2922 (IsValidSecurityDescriptor_Proc): New typedefs.
2923 (get_file_security, get_security_descriptor_owner)
2924 (get_security_descriptor_group): Set errno to ENOTSUP.
2925 (set_file_security, get_security_descriptor_dacl)
2926 (is_valid_security_descriptor, convert_sd_to_sddl)
2927 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2928 (acl_free, acl_get_file, acl_set_file): New functions.
2929
2930 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2931
207a7ef0
PE
29322012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2933
2934 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2935 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2936 for some of that bug's symptoms can now cause Emacs to abort.
2937 Remove the workaround.
2938 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2939 The bug that caused SIGCHLD to get lost has been fixed, and the
2940 workaround for it can now cause Emacs to abort.
2941
17fdfc15
PE
29422012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2943
2944 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2945 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2946 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2947
7c3d167f
RF
29482012-12-16 Romain Francoise <romain@orebokech.com>
2949
2950 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2951 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2952 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2953 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2954
2955 * Makefile.in (LIBACL_LIBS): New macro.
2956 (LIBES): Use it.
2957
7d80ea23
PE
29582012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 * fileio.c (internal_delete_file): Use bool for boolean.
2961
b0728617
EZ
29622012-12-15 Eli Zaretskii <eliz@gnu.org>
2963
2964 Fix bug #13079 on MS-Windows with temp files not being deleted.
2965 * w32.h (_child_process): New members input_file and
2966 pending_deletion.
2967 (register_child): First argument is now pid_t.
2968 (record_infile, record_pending_deletion): New prototypes.
2969
2970 * w32proc.c (new_child): Initialize input_file and
2971 pending_deletion members of the child.
2972 (delete_child): Delete the child's temporary input file, if any,
2973 that is pending deletion.
2974 (register_child): First argument is now pid_t.
2975 (record_infile, record_pending_deletion): New functions.
2976 (reap_subprocess): Fix a typo in DebPrint string.
2977 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2978
2979 * fileio.c (internal_delete_file): Return an int again: non-zero
2980 if delete-file succeeds, zero otherwise.
2981
2982 * lisp.h (internal_delete_file): Adjust prototype.
2983
2984 * callproc.c (Fcall_process): Don't overwrite infile with result
2985 of DECODE_FILE.
2986 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2987 asynchronous subprocess, record the name of the input file name,
2988 if any.
2989 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2990 delete the file, record it as pending deletion when the subprocess
2991 exits.
2992
7e90af26
EZ
29932012-12-14 Eli Zaretskii <eliz@gnu.org>
2994
2995 * editfns.c [HAVE_PWD_H]: Include grp.h.
2996
2997 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2998
97976f9f
PE
29992012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3000
3001 Fix permissions bugs with setgid directories etc. (Bug#13125)
3002 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3003 to mark it as a placeholder. The old value was often wrong.
3004 The only user of this attribute has been changed to use
3005 file-ownership-preserved-p instead, with its new group arg.
3006 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3007
26ec1f49
SM
30082012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3009
ad966fe7
SM
3010 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3011 Keep selected_window and selected_frame in sync.
26ec1f49 3012
5c207910
EZ
30132012-12-14 Eli Zaretskii <eliz@gnu.org>
3014
3015 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3016 try to get accurate owner and group information from NT file
3017 security APIs. This is to make most callers of 'stat' and
3018 'lstat', which don't need that information, much faster.
3019
26ec1f49
SM
3020 * dired.c (Ffile_attributes) [WINDOWSNT]:
3021 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
3022 owner and group information from 'lstat'.
3023
893f52d8
PE
30242012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3025
4c95c9a5
PE
3026 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3027 as that confuses set-auto-coding, so insist on the head-read
3028 returning the full 1024 bytes. Let lseek compute the tail offset;
3029 less work for us. Do not ignore I/O errors when reading the tail.
3030
893f52d8
PE
3031 * xdisp.c: Minor style fixes.
3032 (init_iterator): Hoist assignment out of if-expression.
3033 (markpos_of_region): Callers now test for sign, not for -1.
3034
40d1e434
DA
30352012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3036
3037 Minor redisplay optimization when the region length is zero.
3038 * xdisp.c (markpos_of_region): New function.
3039 (init_iterator): Do not highlight the region of zero length.
3040 (redisplay_window): Check whether the region is of non-zero length.
3041 (try_cursor_movement): Allow if the region length is zero.
3042 (try_window_reusing_current_matrix, try_window_id): Likewise.
3043
727f9739 30442012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
3045
3046 * search.c (search_buffer): Check the inverse translations of each
3047 character in pattern when the buffer being searched is unibyte.
3048 (Bug#13084)
3049
727f9739 30502012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
3051
3052 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3053 files, fixing a regression from 24.2.
645c6a30 3054 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 3055
d20704ef
PE
30562012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3057
3058 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3059 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3060 Remove unnecessary S_ISLNK test, as (contra the comments) this
3061 function can't copy symlinks. Improve quality of error message
3062 when attempting to copy files that are neither regular files nor
3063 directories.
3064
2dd61a9b
DA
30652012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3066
3067 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3068 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3069 * window.c (Frecenter):
3070 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3071 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3072
cc98b684
DC
30732012-12-12 Daniel Colascione <dancol@dancol.org>
3074
1e101a4b 3075 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
3076 the dumped Emacs is not a sparse file, greatly improving Cygwin
3077 "make bootstrap" performance.
3078
38e791fd
MA
30792012-12-11 Michael Albinus <michael.albinus@gmx.de>
3080
3081 * inotify.c (inotify_callback): Generate an Emacs event for every
3082 incoming inotify event.
3083
f9d1448f
EZ
30842012-12-11 Eli Zaretskii <eliz@gnu.org>
3085
3086 * xdisp.c (handle_face_prop): Fix logic of computing
3087 it->start_of_box_run_p.
3088 (append_space_for_newline): If the glyph row is R2L, reset the
3089 iterator's end_of_box_run_p flag before prepending the space glyph.
3090 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3091 iterator's start_of_box_run_p flag before prepending the stretch.
3092 (append_glyph, produce_image_glyph, append_composite_glyph)
3093 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3094 left_box_line_p and right_box_line_p flags of the glyph for R2L
3095 glyph rows. (Bug#13011)
3096
c6afe371
DA
30972012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3098
3099 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3100 if changed buffer is not shown in a window.
3101 * insdel.c (prepare_to_modify_buffer): Likewise.
3102 * window.c (replace_buffer_in_windows_safely): Do nothing
3103 if buffer is not shown in a window.
3104 (Fforce_window_update): Likewise if string or buffer argument
3105 is passed.
3106
1b47babd
EZ
31072012-12-11 Eli Zaretskii <eliz@gnu.org>
3108
3109 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3110 encoded_file_name, which is what it is.
3111
4c1acb95
DA
31122012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3113
3114 Consistently use marker_position and marker_byte_position.
3115 * fringe.c (Ffringe_bitmaps_at_pos):
3116 * indent.c (Fvertical_motion):
3117 * insdel.c (prepare_to_modify_buffer):
3118 * keyboard.c (make_lispy_position):
3119 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3120 (window_scroll_pixel_based, displayed_window_lines)
3121 (Fset_window_configuration):
3122 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3123 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3124 Replace direct access to marker fields with calls
3125 to marker_position and/or marker_byte_position.
3126
0eeb69fe
JB
31272012-12-11 Juanma Barranquero <lekktu@gmail.com>
3128
3129 * makefile.w32-in (SIG2STR_H): New macro.
3130 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3131 ($(BLD)/w32notify.$(O)): Update dependencies.
3132
1cf1bbd5
DC
31332012-12-10 Daniel Colascione <dancol@dancol.org>
3134
8db4b52f
DC
3135 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3136 Windows file notification functionality unless WINDOWSNT.
3137
1cf1bbd5
DC
3138 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3139 declarations.
3140
3141 * w32fns.c (cache_system_info): Initialize the global hinst
3142 variable here so various initialization calls DTRT.
3143
1e101a4b 3144 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
3145 (hinst): Remove unneeded extern declaration.
3146 (_start): Remove initialization of above variables; remove
3147 initialization of hinst, as cache_system_info now does that.
3148
3149 * emacs.c (main): Call cache_system_info early in startup; we
3150 previously weren't calling it in Cygwin builds.
3151
26ec1f49
SM
3152 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3153 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3154 and link it to Emacs.
3155
98a07056
DA
31562012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3157
3158 Per-buffer window counters.
3159 * buffer.h (struct buffer): New member window_count.
3160 (buffer_window_count): New function.
3161 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3162 Initialize window_count.
3163 (Fkill_buffer): Verify window_count for the buffer being killed.
3164 (modify_overlay): Do not force redisplay if buffer is not shown
3165 in any window.
3166 (init_buffer_once): Initialize window_count for buffer_defaults
3167 and buffer_local_symbols.
3168 * window.h (buffer_shared): Remove declaration.
3169 (wset_buffer): Convert from inline ...
3170 * window.c (wset_buffer): ... to an ordinary function.
3171 (adjust_window_count): New function.
3172 (make_parent_window): Use it.
3173 * xdisp.c (buffer_shared): Remove.
3174 (redisplay_internal, redisplay_window): Adjust users.
3175 (buffer_shared_and_changed): Use per-buffer window counter.
3176
2b8c9064
EZ
31772012-12-10 Eli Zaretskii <eliz@gnu.org>
3178
3179 Support for filesystem notifications on MS-Windows.
3180 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3181 and this is a TTY frame, signal the caller that keyboard input is
3182 available.
3183
3184 * w32xfns.c (drain_message_queue): Now returns an int: an
3185 indication whether any WM_EMACS_FILENOTIFY messages were found in
3186 the queue.
3187
3188 * w32inevt.c (handle_file_notifications): New function.
3189 (w32_console_read_socket): Call it to process file notifications.
3190
3191 * w32console.c (initialize_w32_display): Record the main thread ID
3192 in dwMainThreadId.
3193
3194 * deps.mk (inotify.o): New dependency list.
3195
3196 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3197
3198 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3199 (WM_EMACS_END): Bump value by 1.
3200 (notification_buffer_in_use, file_notifications)
3201 (notifications_size, notifications_desc): Declare.
3202 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3203 Add prototypes.
3204
3205 * w32term.c (lispy_file_action, queue_notifications): New functions.
3206 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3207 <Qrenamed_to>: New symbols.
3208 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3209
3210 * w32notify.c: New file, implements file event notifications for
3211 MS-Windows.
3212
3213 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3214 by posting it to the w32_read_socket queue.
3215
1e101a4b 3216 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3217
3218 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3219 (GLOBAL_SOURCES): Add w32notify.c
3220 ($(BLD)/w32notify.$(O)): New set of dependencies.
3221
3222 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3223
1e101a4b
SM
3224 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3225 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3226 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3227 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3228 w32notify-handle-event by default.
3229
3230 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3231 syms_of_w32notify.
3232
81606b10
RS
32332012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3234
2b8c9064 3235 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3236 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3237
3238 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3239
3240 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3241 (syms_of_keyboard): DEFSYM it.
3242 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3243 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3244 Qfile_inotify events.
3245 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3246 special-event-map to inotify-handle-event.
3247
3248 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3249
3250 * Makefile.in (base_obj): Add inotify.o.
3251
3252 * inotify.c: New file.
3253
265c2fbf 32542012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3255
3256 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3257
265c2fbf 32582012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3259
3260 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3261 DWORD_PTR, for compatibility with 64-bit builds.
3262
a06ae17d 3263 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3264 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3265 (system_process_attributes): Use SIZE_T rather than DWORD, for
3266 compatibility with 64-bit builds.
3267
265c2fbf 32682012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3269
3270 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3271
265c2fbf 32722012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3273
3274 * indent.c (Fvertical_motion): If a display string will be
3275 displayed on the left or the right margin, don't consider it as a
3276 factor in cursor positioning. (Bug#13108)
3277
265c2fbf 32782012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3279
3280 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3281
5f460827
PE
32822012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3283
3284 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3285 for string length.
3286
a16e75cd
EZ
32872012-12-08 Eli Zaretskii <eliz@gnu.org>
3288
3289 * w32.c (unsetenv): Return 0 if the input string is too long.
3290
5745a7df
PE
32912012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3292
3293 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3294 * alloc.c (xputenv): New function.
3295 * dbusbind.c (Fdbus_init_bus):
3296 * emacs.c (main):
3297 * xterm.c (x_term_init):
3298 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3299 * editfns.c (initial_tz): Move static var decl up.
3300 (tzvalbuf_in_environ): New static var.
3301 (init_editfns): Initialize these two static vars.
3302 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3303 Save old TZ value on stack, if it's small.
3304 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3305 instead, use xputenv+unsetenv to set and restore TZ.
3306 (environbuf): Remove static var. All uses removed.
3307 (Fset_time_zone_rule): Do not save TZ and environ;
3308 no longer needed here.
3309 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3310 Move to inside set_time_zone_rule; they don't need file scope any more.
3311 (set_time_zone_rule): Maintain the TZ=value string separately.
3312 (syms_of_editfns): Don't initialize initial_tz;
3313 init_editfns now does it.
3314 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3315 * lisp.h (xputenv): New decl.
3316
c56efa40
FP
33172012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3318
3319 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3320
75ceee05
EZ
33212012-12-08 Eli Zaretskii <eliz@gnu.org>
3322
3323 * w32.c (unsetenv, sys_putenv): New functions.
3324
1b6dbfeb
CY
33252012-12-08 Chong Yidong <cyd@gnu.org>
3326
3327 * editfns.c (Finsert_char): Make the error message more
3328 informative (Bug#12992).
3329
d983a10b
PE
33302012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3331
7be78020
PE
3332 Simplify get_lim_data.
3333 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3334 Remove USG and vlimit methods; no longer used these days.
3335 Add #error catchall just in case.
3336
d983a10b
PE
3337 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3338 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3339 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3340 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3341 (deleted_pid_list, Fdelete_process, create_process)
3342 (record_child_status_change, handle_child_signal, deliver_child_signal)
3343 (init_process_emacs, syms_of_process):
3344 Assume SIGCHLD is defined.
3345 (parse_signal): Remove. All uses removed.
3346 (abbr_to_signal): New static function.
3347 (Fsignal_process): Use it to convert signal names to ints.
3348 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3349 kill (getpgrp (), ...).
3350 (emacs_sigaction_init): Assume SIGCHLD is defined.
3351 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3352 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3353 * syssignal.h (EMACS_KILLPG): Remove.
3354 All uses replaced by 'kill' with a negative pid.
3355 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3356 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3357
9cdde1e2
PE
33582012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3359
3360 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3361 This will cause a production Emacs to dump core instead of
3362 infinite-looping.
3363
822995f8
DA
33642012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3365
3366 * frame.c (make_frame): Do not set window's buffer to t.
3367 * window.c (Fsplit_window_internal): Likewise. Previously it was
3368 used to indicate that the window is being set up. Now we use
3369 set_window_buffer for all new windows, so the condition in ...
3370 (Fset_window_buffer): ... is always true and can be removed.
3371
ed08365b
DA
33722012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3373
3374 Convenient macro to check whether the buffer is hidden.
3375 * buffer.h (BUFFER_HIDDEN_P): New macro.
3376 * frame.c (make_frame): Use it. Adjust comment.
3377 * buffer.c (candidate_buffer): New function.
3378 (Fother_buffer, other_buffer_safely): Use it.
3379
e86f5134
EZ
33802012-12-06 Eli Zaretskii <eliz@gnu.org>
3381
3382 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3383 if the child process is still running. Instead, exit the wait
3384 loop and return zero. (Bug#13086)
3385
1700db3c
DA
33862012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3387
3388 * frame.h (x_char_width, x_char_height): Remove prototypes.
3389 * w32term.h (x_char_width, x_char_height): Likewise.
3390 * xfns.c (x_char_width, x_char_height): Remove.
3391 * w32fns.c (x_char_width, x_char_height): Likewise.
3392 * nsfns.c (x_char_width, x_char_height): Likewise.
3393 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3394 all window frames.
3395 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3396 * keyboard.c (command_loop_1): Remove prototype.
3397 (command_loop_2, top_level_1): Add static to match prototype.
3398
35fb8050
PE
33992012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 Fix a recently-introduced delete-process race condition.
3402 * callproc.c, process.h (record_kill_process):
3403 New function, containing part of the old call_process_kill.
3404 (call_process_kill): Use it.
3405 This does not change call_process_kill's behavior.
3406 * process.c (Fdelete_process): Use record_kill_process to fix a
3407 race condition that could cause Emacs to lose track of a child.
3408
565212e5
DA
34092012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3410
3411 Avoid code duplication between prev_frame and next_frame.
3412 * frame.c (candidate_frame): New function. Add comment.
3413 (prev_frame, next_frame): Use it. Adjust comment.
3414
d8ad4d3f 34152012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3416
3417 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3418 fails, signal an error instead of continuing with an empty
3419 string. (Bug#13079)
7c2fcf9b
EZ
3420 Encode expanded temp file pattern before passing it to mkstemp or
3421 mktemp.
d3cefd13 3422
2e7cddd3
EZ
3423 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3424 Encode the file name before passing it to dostounix_filename, in
3425 case it will downcase it (under w32-downcase-file-names).
3426 (Bug#12933)
3427
644d3f0d
PE
34282012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3429
3430 Minor call-process cleanups.
3431 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3432 at the same time as other platforms, to simplify analysis.
3433 No need for fd0_volatile since we have synch_process_fd.
3434 Avoid needless emacs_close; arg is always negative.
3435
396376f1
AS
34362012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3437
3438 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3439 processes.
3440
350f51ad
DA
34412012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3442
3443 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3444 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3445 and mouse_face_hidden members to a bitfields.
3446 * frame.h (struct frame): Remove set-but-not-used space_width member.
3447 (FRAME_SPACE_WIDTH): Remove.
3448 * nsterm.m, w32term.c, xterm.c: Adjust users.
3449 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3450 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3451 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3452 members to a bitfields.
3453
bc9dbce6
PE
34542012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3455
bb5f74ee
PE
3456 Don't let call-process be a zombie factory (Bug#12980).
3457 Fixing this bug required some cleanup of the signal-handling code.
3458 As a side effect, this change also fixes a longstanding rare race
3459 condition whereby Emacs could mistakenly kill unrelated processes,
3460 and it fixes a bug where a second C-g does not kill a recalcitrant
3461 synchronous process in GNU/Linux and similar platforms.
3462 The patch should also fix the last vestiges of Bug#9488,
3463 a bug which has mostly been fixed on the trunk by other changes.
3464 * callproc.c, process.h (synch_process_alive, synch_process_death)
3465 (synch_process_termsig, sync_process_retcode):
3466 Remove. All uses removed, to simplify analysis and so that
3467 less consing is done inside critical sections.
3468 * callproc.c (call_process_exited): Remove. All uses replaced
3469 with !synch_process_pid.
3470 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3471 These take the role of what used to be in unwind-protect arg.
3472 All uses changed.
3473 (block_child_signal, unblock_child_signal):
3474 New functions, to avoid races that could kill innocent-victim processes.
3475 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3476 (call_process_kill): Record killed processes as deleted, so that
3477 zombies do not clutter up the system. Do this inside a critical
3478 section, to avoid a race that would allow the clutter.
3479 (call_process_cleanup): Fix code so that the second C-g works again
3480 on common platforms such as GNU/Linux.
3481 (Fcall_process): Create the child process in a critical section,
3482 to fix a race condition. If creating an asynchronous process,
3483 record it as deleted so that zombies do not clutter up the system.
3484 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3485 light of these changes. Omit unnecessary call to emacs_close
3486 before failure, as the unwind-protect code does that.
3487 * callproc.c (call_process_cleanup):
3488 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3489 * process.c (record_deleted_pid): New function, containing
3490 code refactored out of Fdelete_process.
3491 (Fdelete_process): Use it.
3492 (process_status_retrieved): Remove. All callers changed to use
3493 child_status_change.
3494 (record_child_status_change): Remove, folding its contents into ...
3495 (handle_child_signal): ... this signal handler. Now, this
3496 function is purely a handler for SIGCHLD, and is not called after
3497 a synchronous waitpid returns; the synchronous code is moved to
3498 wait_for_termination. There is no need to worry about reaping
3499 more than one child now.
3500 * sysdep.c (get_child_status, child_status_changed): New functions.
3501 (wait_for_termination): Now takes int * status and bool
3502 interruptible arguments, too. Do not record child status change;
3503 that's now the caller's responsibility. All callers changed.
3504 Reimplement in terms of get_child_status.
3505 (wait_for_termination_1, interruptible_wait_for_termination):
3506 Remove. All callers changed to use wait_for_termination.
3507 * syswait.h: Include <stdbool.h>, for bool.
3508 (record_child_status_change, interruptible_wait_for_termination):
3509 Remove decls.
3510 (record_deleted_pid, child_status_changed): New decls.
3511 (wait_for_termination): Adjust to API changes noted above.
3512
bc9dbce6
PE
3513 * bytecode.c, lisp.h (Qbytecode): Remove.
3514 No longer needed after 2012-11-20 interactive-p changes.
3515
3cf3c607
EZ
35162012-12-03 Eli Zaretskii <eliz@gnu.org>
3517
3518 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3519 the scroll margin, move point outside the margin. (Bug#13055)
3520
005c8d13
JD
35212012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3522
3523 * gtkutil.c (my_log_handler): New function.
3524 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3525
20edc1c9
DA
35262012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3527
3528 * lisp.h (modify_region): Rename to...
3529 (modify_region_1): ...new prototype.
3530 * textprop.c (modify_region): Now static. Adjust users.
3531 * insdel.c (modify_region): Rename to...
3532 (modify_region_1): ...new function to work with current buffer.
3533 Adjust comment and users. Use true and false for booleans.
3534
62c2e5ed
DA
35352012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3536
3537 * alloc.c (free_save_value): New function.
3538 (safe_alloca_unwind): Use it.
3539 * lisp.h (free_save_value): New prototype.
3540 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3541 Add comment.
3542 (save_excursion_restore): Adjust to match saved data structure.
3543 Use free_save_value to offload some work from GC. Drop obsolete
3544 #if 0 code.
3545
c5bc2d1d 35462012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3547
3548 * fileio.c (Vauto_save_list_file_name): Doc fix.
3549
c5bc2d1d 35502012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3551
3552 * w32fns.c: Remove prototype of atof.
1e101a4b 3553 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3554 builds.
1e101a4b 3555 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3556
3557 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3558 with 64-bit builds.
3559
3560 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3561 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3562 defined.
3563
c5bc2d1d 35642012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3565
a9de9f0c 3566 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3567
21e54a94
PE
35682012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3569
2dd2e622
PE
3570 Fix xpalloc confusion after memory is exhausted.
3571 * alloc.c (xpalloc): Comment fix.
3572 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3573 and signals an error, do not clear charset_table_size, as
3574 charset_table is still valid.
3575 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3576
21e54a94
PE
3577 Use execve to avoid need to munge environ (Bug#13054).
3578 * callproc.c (Fcall_process):
3579 * process.c (create_process):
3580 Don't save and restore environ; no longer needed.
3581 * callproc.c (child_setup):
3582 Use execve, not execvp, to preserve environ.
3583
3e5490f7
PE
35842012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3585
3586 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3587
75b4f59c
YM
35882012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3589
3590 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3591 display for sliced images (Bug#10500).
3592
3593 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3594
f8aff4c6
JB
35952012-11-30 Juanma Barranquero <lekktu@gmail.com>
3596
3597 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3598 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3599
3940b924
DA
36002012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3601
3602 * xdisp.c (window_outdated): Remove eassert since it hits
3603 some suspicious corner cases (see Bug#13007 and Bug#13012).
3604 (mode_line_update_needed): New function.
3605 (redisplay_internal, redisplay_window): Use it.
3606 (ensure_selected_frame): New function.
3607 (redisplay_internal, unwind_redisplay): Use it.
3608 (redisplay_internal): Move comment about buffer_shared...
3609 (buffer_shared_and_changed): ...near to its real use.
3610
4a9204fe
PE
36112012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3612
3613 * callproc.c (Fcall_process): Don't misreport vfork failure.
3614
60aeceb8
PE
36152012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 * callproc.c (Fcall_process): Fix vfork portability problems.
3618 Do not assume that fd[0], count, filefd, and save_environ survive
3619 vfork. Fix bug whereby wrong errno value could be reported for
3620 pipe failure. Some minor cleanups, too, as follows. Move buf and
3621 bufsize to the context where they're needed. Change new_argv to
3622 be of type char **, as this is more convenient and avoids casts.
3623 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3624 Now local constants, not macros.
3625
00dc3ead
KH
36262012-11-18 Kenichi Handa <handa@gnu.org>
3627
3628 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3629 for the variable "f".
3630
e1bf05c1
KH
36312012-11-13 Kenichi Handa <handa@gnu.org>
3632
3633 * font.c (font_unparse_xlfd): Exclude special characters from the
3634 generating XLFD name.
3635
22626a85
PE
36362012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3637
350e0088
PE
3638 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3639 * dired.c (stat_uname, stat_gname):
3640 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3641
22626a85
PE
3642 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3643 * dired.c (directory_files_internal, file_name_completion):
3644 Assume EAGAIN and EINTR are defined.
350e0088 3645
22626a85
PE
3646 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3647 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3648 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3649 * lread.c (readbyte_from_file): Assume EINTR is defined.
3650 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3651 Assume EIO and EAGAIN are defined.
3652 * unexcoff.c (write_segment): Assume EFAULT is defined.
3653
5c9cf0a3 36542012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3655
3656 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3657 (Bug#11964)
3658
22294a56
EZ
3659 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3660 highlighting on the frame was cleared. Prevents assertion
3661 violations when repeatedly clicking on the "Top" link of the
3662 "bread-crumbs" in Info buffers.
3663
5fbab051
PE
36642012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3667
bcd77a2b
KB
36682012-11-24 Ken Brown <kbrown@cornell.edu>
3669
3670 * keyboard.c (HAVE_MOUSE):
3671 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3672 were always defined.
3673
d125ca15 36742012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3675
24becea4
EZ
3676 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3677 between bpos_covered and bpos_max. This fixes cursor display when
3678 several display strings follow each other.
3679
8654a41b
EZ
3680 * .gdbinit (pgx): If the glyph's object is a string, display the
3681 pointer to string data, rather than the value of the string object
3682 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3683
cb5867b1
EZ
3684 * indent.c (Fvertical_motion): If the starting position is covered
3685 by a display string, return to one position before that, to avoid
3686 overshooting it inside move_it_to. (Bug#12930)
3687
f418b22e
DA
36882012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3689
3690 * frame.h (struct frame): Remove display_preempted member
3691 since all users are dead long ago.
3692 * nsterm.h (struct x_output): Use the only dummy member.
3693 * w32menu.c (pending_menu_activation): Remove since not
3694 really used.
3695 (set_frame_menubar): Adjust user.
3696 * w32term.h (struct x_output): Drop outdated #if 0 code.
3697 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3698 asked_for_visible and menubar_active members.
3699 Drop unused pending_menu_activation member.
f418b22e
DA
3700 * xterm.h (struct x_output): Drop outdated #if 0 code.
3701 Use bitfields for explicit_parent, asked_for_visible,
3702 has_been_visible and net_wm_state_hidden_seen members.
3703
a879f0ea
EZ
37042012-11-23 Eli Zaretskii <eliz@gnu.org>
3705
3706 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3707 of a literal "/". (Bug#12955)
3708 (gl-stamp): Invoke fc.exe directly, not through cmd.
3709
95ef7787
PE
37102012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3711
3712 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3713 * dired.c: Assume HAVE_DIRENT_H.
3714 (NAMLEN): Remove, replacing with ...
3715 (dirent_namelen): New function. All uses changed. Use the GNU macro
3716 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3717 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3718 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3719 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3720 $(NT_INC)/dirent.h.
3721 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3722 * ndir.h: Rename to ../nt/inc/dirent.h.
3723 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3724 Do not include <dirent.h>; no longer needed.
3725 * w32.c: Include <dirent.h> rather than "ndir.h".
3726
12645ae6
CY
37272012-11-23 Chong Yidong <cyd@gnu.org>
3728
3729 * xftfont.c (xftfont_open): Remove duplicate assignment.
3730
5c747675
DA
37312012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3732
3733 * alloc.c (Fgarbage_collect): Unblock input after clearing
3734 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3735 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3736 * msdos.c (IT_frame_up_to_date): Use it here...
3737 * w32term.c (w32_frame_up_to_date): ...here...
3738 * xterm.c (XTframe_up_to_date): ...and here...
3739 * nsterm.m (ns_frame_up_to_date): ...but not here.
3740 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3741 Adjust users.
3742 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3743 Do not check whether GC is in progress.
3744
6ceeb5f1
DA
37452012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3746
3747 * xdisp.c (window_buffer_changed): New function.
3748 (update_menu_bar, update_tool_bar): Use it to
3749 simplify large 'if' statements.
3750 (redisplay_internal): Generalize commonly used
3751 'tail' and 'frame' local variables.
3752
ec84768f
EZ
37532012-11-22 Eli Zaretskii <eliz@gnu.org>
3754
3755 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3756 with Windows system header.
3757
9239d970
PE
37582012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3759
3760 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3761 * alloc.c: Assume unistd.h exists.
3762 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3763 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3764 (getwd) [USG]: Remove; no longer needed.
3765 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3766 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3767 * w32.h (getcwd): Remove decl.
3768
954bba56
SM
37692012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3770
3771 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3772 Make it set selected_window as well.
3773 (update_tool_bar): Use it.
3774
6ef2e5ef 37752012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3776
3777 * emacs.c (main): Set the G_SLICE environment variable for all
3778 Cygwin builds, not just GTK builds. See
3779 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3780
6ef2e5ef 37812012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3782
3783 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3784 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3785 Define for the MSVC compiler.
3786
6ef2e5ef 3787 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3788
3789 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3790 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3791 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3792 dostounix_filename assumes it gets a unibyte string.
3793 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3794 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3795
eadf1faa
SM
37962012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3797
3798 Conflate Qnil and Qunbound for `symbol-function'.
3799 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3800 * lread.c (init_obarray): Set `function' fields to Qnil.
3801 * eval.c (Fcommandp): Ignore Qunbound.
3802 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3803 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3804 Test NILP rather than Qunbound.
3805 (Ffmakunbound): Set to Qnil.
3806 (Fsymbol_function): Never signal an error.
3807 (Finteractive_form): Ignore Qunbound.
3808
b83fdfa9
PE
38092012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3810
3811 * eval.c (interactive_p): Remove no-longer-used decl.
3812
952580c5
DA
38132012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3814
3815 * xdisp.c (buffer_shared): Adjust comment.
3816 (buffer_shared_and_changed): New function.
3817 (prepare_menu_bars, redisplay_internal): Use it to
3818 decide whether all windows or frames should be updated.
ea6de9b1
DA
3819 (window_outdated): New function.
3820 (text_outside_line_unchanged_p, redisplay_window): Use it.
3821 (redisplay_internal): Likewise. Fix indentation.
952580c5 3822
23ba2705
SM
38232012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3824
3825 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3826 (syms_of_eval): Remove corresponding defsubr.
3827 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3828
6e9f7997
DC
38292012-11-19 Daniel Colascione <dancol@dancol.org>
3830
3831 * w32fns.c (Fx_file_dialog):
3832 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3833 cygwin_convert_file_name*.
3834
3835 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3836 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3837
552a1590
PE
38382012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3841
2ac9538d 38422012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3843
3844 * w32select.c: Include w32common.h before w32term.h, so that
3845 windows.h gets included before w32term.h uses some of its
3846 features, see below.
3847
23ba2705
SM
3848 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3849 New typedefs.
3850 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3851 New prototypes.
d8715cdf
EZ
3852 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3853
2ac9538d 38542012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3855
3856 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3857 (ns_select): Return at once if events are held (Bug#12834).
3858
2ac9538d 38592012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3860
3861 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3862 Needed following 2012-10-20 change. (Bug#12902)
3863
c1f7ba3a
JB
38642012-11-18 Juanma Barranquero <lekktu@gmail.com>
3865
3866 * w32proc.c (waitpid): Remove unused label get_result.
3867
a75ce9d3
JB
38682012-11-17 Juanma Barranquero <lekktu@gmail.com>
3869
3870 * makefile.w32-in (SYSWAIT_H): New macro.
3871 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3872 ($(BLD)/sysdep.$(O)): Update dependencies.
3873
49cdacda
PE
38742012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3877 * callproc.c (relocate_fd): Assume F_DUPFD.
3878 * emacs.c, term.c (O_RDWR): Remove.
3879 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3880 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3881 * nsterm.m: Assume <fcntl.h> exists.
3882 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3883 (create_pty, Fmake_network_process, server_accept_connection)
3884 (wait_reading_process_output, init_process_emacs):
3885 Assume O_NONBLOCK.
3886 (wait_reading_process_output): Put in a special case for WINDOWSNT
3887 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3888 It's not clear this is needed, but it's a more-conservative change.
3889 (create_process): Assume FD_CLOEXEC.
3890 (create_process, create_pty): Assume O_NOCTTY.
3891 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3892 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3893 Omit if not DOS_NT, since F_GETFL is not defined there.
3894 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3895 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3896 (O_NOCTTY): Remove.
3897 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3898 lack it, since gnulib guarantees this.
3899 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3900
22bae83f
EZ
39012012-11-17 Eli Zaretskii <eliz@gnu.org>
3902
6ad30855
EZ
3903 * w32.c (faccessat): Pretend that directories have the execute bit
3904 set. Emacs expects that, e.g., in files.el:cd-absolute.
3905
22bae83f
EZ
3906 * w32proc.c (create_child): Don't clip the PID of the child
3907 process to fit into an Emacs integer, as this is no longer a
3908 restriction.
3909 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3910 reaping only the process specified by PID argument, if that is
3911 positive. Use PID instead of dead_child to know which process to
3912 reap. Wait for the child to die only if WNOHANG is not in
3913 OPTIONS.
3914 (sys_select): Don't set dead_child.
3915
3916 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3917 as it is no longer needed.
3918
3919 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3920 no longer needed.
3921 (record_child_status_change): Remove the setting of
3922 record_at_most_one_child for the !WNOHANG case.
3923
a631d0e0
PE
39242012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3925
3926 Fix problems in ns port found by static checking.
3927 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3928 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3929 not to process group.
3930 (ns_select): Use emacs_write, not write, as that's more robust
3931 in the presence of signals.
3932 (fd_handler:): Check for read errors.
3933
d56f2e49
GM
39342012-11-16 Glenn Morris <rgm@gnu.org>
3935
3936 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3937
96e05507 39382012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3939
3940 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3941
96e05507 39422012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3943
3944 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3945 use the same value of thread handle.
3946 (start_timer_thread): If the timer thread exited (due to error),
3947 clean up by closing the two handles it used. Duplicate the caller
3948 thread's handle here, so it gets duplicated only once, when
3949 launching the timer thread. Set priority of the timer thread, not
3950 the caller thread.
3951 (getitimer): Don't duplicate the caller thread's handle here.
3952 (Bug#12832)
3953
96e05507 39542012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3955
3956 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3957 called (Bug#12834).
3958
3d082a26
PE
39592012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3960
3961 Remove no-longer-used pty_max_bytes variable.
3962 * process.c (pty_max_bytes): Remove; unused.
3963 (send_process): Do not set it.
3964
b72c161c
JB
39652012-11-15 Juanma Barranquero <lekktu@gmail.com>
3966
3967 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3968 Update dependencies.
3969
bf20ea80
PE
39702012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3971
3972 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3973 This follows up on the 2012-09-29 patch that removed indirection
3974 for the 'function' field. Reported by Sergey Vinokurov in
3975 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3976
14f20728
EZ
39772012-11-14 Eli Zaretskii <eliz@gnu.org>
3978
3979 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3980 different name, as the MS runtime does not have such a function,
3981 and probably never will.) All callers changed. Ignore DIRFD
3982 value if PATH is an absolute file name, to match Posix spec
3983 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3984 symlinks.
3985
77731919
DA
39862012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3987
3988 * xdisp.c (echo_area_display, redisplay_internal):
3989 Omit redundant check whether frame_garbaged is set.
3990
73dcdb9f
PE
39912012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 Use faccessat, not access, when checking file permissions (Bug#12632).
3994 This fixes a bug that has been present in Emacs since its creation.
3995 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3996 which must set some sort of record. (Torek's bug report was against
3997 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3998 same common flaw.) See Torek's Usenet posting
3999 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4000 Posted: Fri Apr 8 14:18:56 1983.
4001 * Makefile.in (LIB_EACCESS): New macro.
4002 (LIBES): Use it.
4003 * callproc.c (init_callproc):
4004 * charset.c (init_charset):
4005 * fileio.c (check_existing, check_executable, check_writable)
4006 (Ffile_readable_p):
4007 * lread.c (openp, load_path_check):
4008 * process.c (allocate_pty):
4009 * xrdb.c (file_p):
4010 Use effective UID when checking permissions, not real UID.
4011 * callproc.c (init_callproc):
4012 * charset.c (init_charset):
4013 * lread.c (load_path_check, init_lread):
4014 Test whether directories are accessible, not merely whether they exist.
4015 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4016 * fileio.c (check_existing, check_executable, check_writable)
4017 (Ffile_readable_p):
4018 Use symbolic names instead of integers for the flags, as they're
4019 portable now.
4020 (check_writable): New arg AMODE. All uses changed.
4021 Set errno on failure.
4022 (Ffile_readable_p): Use faccessat, not stat + open + close.
4023 (Ffile_writable_p): No need to call check_existing + check_writable.
4024 Just call check_writable and then look at errno. This saves a syscall.
4025 dir should never be nil; replace an unnecessary runtime check
4026 with an eassert. When checking the parent directory of a nonexistent
4027 file, check that the directory is searchable as well as writable, as
4028 we can't create files in unsearchable directories.
4029 (file_directory_p): New function, which uses 'stat' on most platforms
4030 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4031 (Ffile_directory_p, Fset_file_times): Use it.
4032 (file_accessible_directory_p): New function, which uses a single
4033 syscall for efficiency.
4034 (Ffile_accessible_directory_p): Use it.
4035 * xrdb.c (file_p): Use file_directory_p.
4036 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4037 * lread.c (openp): When opening a file, use fstat rather than
4038 stat, as that avoids a permissions race. When not opening a file,
4039 use file_directory_p rather than stat.
4040 (dir_warning): First arg is now a usage string, not a format.
4041 Use errno. All uses changed.
4042 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4043 that merely introduced a race.
4044 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4045 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4046 and similarly for the other O_* flags.
4047 * w32.c (sys_faccessat): Rename from sys_access and switch to
4048 faccessat's API. All uses changed.
4049 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4050 (magic_db): Rename from magic_file_p.
4051 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4052 char *, so that we don't have to test for file existence
4053 separately from opening the file for reading. This removes a race
4054 fixes a permission-checking problem, and simplifies the code.
4055 All uses changed.
4056 (file_p): Remove; no longer needed.
4057
2a14f83b
DA
40582012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4059
4060 Omit glyphs initialization at startup.
4061 * dispnew.c (glyphs_initialized_initially_p): Remove.
4062 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4063 (Fredraw_frame): Move actual code from here...
c7085245 4064 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
4065 (Fredraw_display): Use redraw_frame.
4066 * xdisp.c (clear_garbaged_frames): Likewise.
4067
f78ee6af 40682012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
4069
4070 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4071 passed to pint2str and pint2hrstr to be at most the size of the
4072 frame's decode_mode_spec_buffer. This avoids crashes with very
4073 large values of FIELD_WIDTH argument to decode_mode_spec.
4074 (Bug#12867)
4075
b95a9c0c
PE
40762012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4077
4078 Fix a race with verify-visited-file-modtime (Bug#12863).
4079 Since at least 1991 Emacs has ignored an mtime difference of no
4080 more than one second, but my guess is that this was to work around
4081 file system bugs that were fixed long ago. Since the race is
4082 causing problems now, let's remove that code.
4083 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4084 whose time stamp is off by no more than a second. Insist that the
4085 file time stamps match exactly.
4086
be49ba74
DA
40872012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4088
4089 * frame.h (struct frame): Convert external_tool_bar member to
4090 1-bit unsigned bitfield.
4091 * termhooks.h (struct terminal): Remove mouse_moved member since
4092 all users are long dead. Adjust comment on mouse_position_hook.
4093
5b04e9f9
DA
40942012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4095
4096 Simplify by using FOR_EACH_FRAME here and there.
4097 * frame.c (next_frame, prev_frame, other_visible_frames)
4098 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4099 * w32term.c (x_window_to_scroll_bar): Likewise.
4100 * window.c (window_list): Likewise.
4101 * xdisp.c (x_consider_frame_title): Likewise.
4102 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4103 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4104 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4105 * xmenu.c (menubar_id_to_frame): Likewise.
4106 * xselect.c (frame_for_x_selection): Likewise.
4107 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4108 (x_window_to_menu_bar): Likewise.
4109 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4110
76ae24d7
PE
41112012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4112
12cc4337
PE
4113 * data.c (Qdefalias_fset_function): Now static.
4114
76ae24d7
PE
4115 Another tweak to vectorlike_header change.
4116 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4117 Remove, and replace all uses with ...
4118 (next_in_free_list, set_next_in_free_list):
4119 New functions, which respect C's aliasing rules better.
4120
1479c557
PE
41212012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4122
4123 * window.c (list4i): Rename from 'quad'. All uses changed.
4124 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4125
11235c03
JB
41262012-11-11 Juanma Barranquero <lekktu@gmail.com>
4127
4128 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4129 warning about mixing declarations and code in ISO C90.
4130
6baf66d5 41312012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
4132
4133 * window.c (Fsplit_window_internal): Set combination limit of
4134 new parent window to t iff Vwindow_combination_limit is t;
4135 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 4136 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 4137
6baf66d5 41382012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
4139
4140 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4141 amount when the scroll margins are too large. When scrolling
4142 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
4143 scroll margin within a reasonable number of screen lines.
4144 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
4145 point is positioned many lines beyond the window top/bottom.
4146 (Bug#12811)
4147
508f51f5
EZ
4148 * ralloc.c (relinquish): If real_morecore fails to return memory
4149 to the system, don't crash; instead, leave the last heap
4150 unchanged and return. (Bug#12774)
4151
32e5c58c
SM
41522012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4153
4154 * lisp.h (AUTOLOADP): New macro.
4155 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4156 * data.c (Ffset): Remove special ad-advice-info handling.
4157 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4158 (Fsubr_arity): CSE.
4159 (Finteractive_form): Simplify.
4160 (Fquo): Don't insist on having at least 2 arguments.
4161 (Qdefalias_fset_function): New var.
4162
719b0aa5
JD
41632012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4164
4ab15c3e
JD
4165 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4166
719b0aa5
JD
4167 * nsfont.m (Qcondensed, Qexpanded): New variables.
4168 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4169 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4170
535cc8e9
DA
41712012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4172
4173 Fix recently introduced crash on MS-Windows (Bug#12839).
4174 * w32term.h (struct scroll_bar): Use convenient header.
4175 (SCROLL_BAR_VEC_SIZE): Remove.
4176 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4177
7d377c48
DA
41782012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4179
4180 Tweak last vectorlike_header change.
4181 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4182 vectorlike object on the free list. This is introduced to avoid
4183 some (but not all) pointer casting and aliasing problems, see
4184 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4185 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4186 objects.
4187 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4188
7ad27466
JD
41892012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4190
32e5c58c 4191 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4192 been removed, so remove them here also.
4193
57618ecf
SM
41942012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4195
4196 * doc.c (Fdocumentation): Handle new property
4197 dynamic-docstring-function to replace the old ad-advice-info.
4198
53371430
PE
41992012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * fns.c (Qeql, hashtest_eq): Now static.
4202
61ddb1b9
SM
42032012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4204
4205 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4206 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4207 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4208 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4209
04a2d0d3
PE
42102012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4211
4212 Use same hash function for hashfn_profiler as for hash_string etc.
4213 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4214 * lisp.h (sxhash_combine): New inline function, with the contents
4215 of the old SXHASH_COMBINE.
4216 * profiler.c (hashfn_profiler): Use it, instead of having a
4217 special hash function containing a comparison that always yields 1.
4218
de5ef41a
SM
42192012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4220
4221 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4222 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4223 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4224 Remove unused vars.
4225
a23c4171
JD
42262012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4227
4228 * image.c (xpm_make_color_table_h): Fix compiler error because
4229 make_hash_table changed.
4230
0b59090b 42312012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4232
4233 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4234
b7432bb2
SM
42352012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4236
4237 Use ad-hoc comparison function for the profiler's hash-tables.
4238 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4239 (make_log): Use them.
4240 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4241 call Fequal any more.
4242 (Ffunction_equal): New function.
4243 (cmpfn_profiler, hashfn_profiler): New functions.
4244 (syms_of_profiler): Initialize them.
4245 * lisp.h (struct hash_table_test): New struct.
4246 (struct Lisp_Hash_Table): Use it.
4247 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4248 * fns.c (make_hash_table): Take a struct to describe the test.
4249 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4250 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4251 (hash_lookup, hash_remove_from_table): Move assertion checking of
4252 hashfn result here. Check hash-equality before calling cmpfn.
4253 (Fmake_hash_table): Adjust call to make_hash_table.
4254 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4255 (syms_of_fns): Initialize them.
4256 * emacs.c (main): Move syms_of_fns earlier.
4257 * xterm.c (syms_of_xterm):
4258 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4259 * print.c (print_object): Adjust to new hash-table struct.
4260 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4261
88002743
EZ
42622012-11-08 Eli Zaretskii <eliz@gnu.org>
4263
4264 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4265 value of w32-scroll-lock-modifier is neither nil nor one of the
4266 known key modifiers. (Bug#12806)
4267
914adc42
DA
42682012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Shrink struct vectorlike_header to the only size field.
4271 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4272 Adjust comment.
4273 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4274 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4275 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4276 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4277 information from the vector header. Adjust comment.
4278 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4279 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4280 layout.
4281 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4282 (struct vectorlike_header): Remove next member. Adjust comment.
4283 (struct Lisp_Subr): Add convenient header. Adjust comment.
4284 (allocate_pseudovector): Adjust prototype.
4285 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4286 (sweep_string, lisp_malloc): Remove useless prototypes.
4287 (enum mem_type): Adjust comment.
4288 (NEXT_IN_FREE_LIST): New macro.
4289 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4290 (Fmake_bool_vector): Likewise.
4291 (struct large_vector): New type to represent allocation unit for
4292 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4293 (large_vectors): Change type to struct large_vector.
4294 (allocate_vector_from_block): Simplify.
4295 (PSEUDOVECTOR_NBYTES): Replace with...
4296 (vector_nbytes): ...new function. Adjust users.
4297 (sweep_vectors): Adjust processing of large vectors.
4298 (allocate_vectorlike): Likewise.
4299 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4300 Add easserts. Adjust XSETPVECTYPESIZE usage.
4301 (allocate_buffer): Use BUFFER_PVEC_INIT.
4302 (live_vector_p): Adjust to match large vector.
4303 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4304 * buffer.h (struct buffer): Add next member.
4305 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4306 New macros.
4307 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4308 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4309 (copy_hash_table): Adjust to match vector header change.
4310 * lread.c (defsubr): Use XSETPVECTYPE.
4311 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4312 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4313 (xvecsize): New command.
4314
c66f21ea
DA
43152012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4316
4317 * keyboard.c (event_to_kboard): Do not dereference
4318 frame_or_window field of SELECTION_REQUEST_EVENT
4319 and SELECTION_CLEAR_EVENT events (Bug#12814).
4320 * xterm.h (struct selection_input_event): Adjust comment.
4321
eb147960
EZ
43222012-11-07 Eli Zaretskii <eliz@gnu.org>
4323
dab72075
EZ
4324 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4325 such as Scroll Lock, if the respective keys are treated as
4326 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4327 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4328
5890e400
DA
43292012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4332
b6b3b294
PE
43332012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 Restore some duplicate definitions (Bug#12814).
4336 This undoes part of the 2012-11-03 changes. Some people build
4337 with plain -g rather than with -g3, and they need the duplicate
4338 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4339 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4340 Define as macros, as well as as enums or as constants.
4341
e770aad5
JD
43422012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4343
4344 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4345 to keypad keys (Bug#12816).
4346
68f8f1c0
PE
43472012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4348
4349 Minor adjustments of recently-changed frame functions.
4350 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4351 known to be a frame (we're in the FRAMEP branch).
4352 * lisp.h (Qframep): Remove decl. frame.h declares this.
4353 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4354 since they're meant for Lisp fixnum values.
4355
72f94d4b
DA
43562012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4357
4358 * window.c (Fwindow_combination_limit): Revert to the only
4359 required argument and adjust docstring as suggested in
4360 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4361 by Martin Rudalics <rudalics@gmx.at>.
4362
d9f07150
DA
43632012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4364
4365 Widely used frame validity and checking functions.
4366 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4367 * frame.c (decode_live_frame, decode_any_frame): New functions.
4368 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4369 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4370 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4371 (Fframe_pointer_visible_p): Use decode_any_frame.
4372 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4373 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4374 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4375 (Fframe_focus): Likewise. Allow zero number of arguments.
4376 Adjust docstring.
4377 (frame_buffer_list, frame_buffer_predicate): Remove.
4378 * lisp.h (frame_buffer_predicate): Remove prototype.
4379 * buffer.c (Fother_buffer): Use decode_any_frame.
4380 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4381 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4382 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4383 (Fclose_font, Ffont_info): Use decode_live_frame.
4384 * fontset.c (check_fontset_name): Likewise.
4385 * terminal.c (Fframe_terminal): Likewise.
4386 * w32fns.c (check_x_frame): Likewise.
4387 * window.c (Fminibuffer_window, Fwindow_at)
4388 (Fcurrent_window_configuration): Likewise.
4389 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4390 Likewise. Allow zero number of arguments. Adjust docstring.
4391 * dispnew.c (Fredraw_frame): Likewise.
4392 * xfaces.c (frame_or_selected_frame): Remove.
4393 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4394 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4395 (Fframe_face_alist): Use decode_live_frame.
4396 * xfns.c (check_x_frame): Likewise.
4397
89bc0592
DA
43982012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4399
4400 * window.c (quad): New function.
4401 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4402 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4403 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4404 (Fwindow_line_height): Use it.
4405 (Fwindow_fringes): Use list3.
4406 (Fwindow_scroll_bars): Use list4.
4407 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4408 (Fwindow_combination_limit): Allow zero number of arguments.
4409
c8e3a9c3
EZ
44102012-11-05 Eli Zaretskii <eliz@gnu.org>
4411
4412 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4413
8e2417bf 4414 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4415 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4416 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4417
209c6a58
CY
44182012-11-05 Chong Yidong <cyd@gnu.org>
4419
4420 * process.c (wait_reading_process_output): Revert previous change.
4421
8148369c
PE
44222012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4423
dd0333b6
PE
4424 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4425 This removes code that has been obsolete since around 1990.
4426 * callproc.c (Fcall_process):
4427 * emacs.c (main):
4428 * process.c (create_process):
4429 * term.c (dissociate_if_controlling_tty):
4430 Assume setsid exists.
4431 * callproc.c (child_setup): Assume setpgid exists and behaves as
4432 per POSIX.1-1988 or later.
4433 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4434 * emacs.c (shut_down_emacs):
4435 * sysdep.c (sys_suspend, init_foreground_group):
4436 Assume getpgrp behaves as per POSIX.1-1998 or later.
4437 * msdos.c (setpgrp): Remove.
4438 (tcgetpgrp, setpgid, setsid): New functions.
4439 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4440 * term.c (no_controlling_tty): Remove; unused.
4441 * w32proc.c (setpgrp): Remove.
4442 (setsid, tcgetpgrp): New functions.
4443
8148369c
PE
4444 Simplify by assuming __fpending.
4445 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4446 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4447 Do not assume that __fpending's result fits in int.
4448
76abf5e5
PE
44492012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4450
06b63c9b
PE
4451 Remove EMACS_OUTQSIZE+sleep hack.
4452 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4453 than 2400 bps, which throttled Emacs by having it sleep.
4454 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4455 was added, and anyway those old terminals are long dead.
4456 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4457 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4458
76abf5e5
PE
4459 Fix data-loss with --version (Bug#9574).
4460 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4461 as we can't assume that emacs_strerror is initialized, and strerror
4462 is good enough here.
4463 (main): Invoke atexit earlier, to catch earlier instances of
4464 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4465
8f31e74b
MM
44662012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4467
4468 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4469 (keyDown): Remap keypad keys to X11 virtual key codes.
4470
0d879dca
PE
44712012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4472
7ccfb720
PE
4473 Fix data-loss with --batch (Bug#9574).
4474 * emacs.c: Include <close-stream.h>.
4475 (close_output_streams): New function.
4476 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4477 and handles errors appropriately.
4478 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4479 does that now.
4480
0b3d4a47
PE
4481 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4482 The symptom is a diagnostic "GLib-WARNING **: In call to
4483 g_spawn_sync(), exit status of a child process was requested but
4484 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4485 waitpid(), so exit status can't be returned." The diagnostic
4486 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4487 The real bug is a race condition between Emacs and glib: Emacs
4488 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4489 so that glib can't find it. Work around the bug by invoking
4490 waitpid only on subprocesses that Emacs itself creates.
4491 * process.c (create_process, record_child_status_change):
4492 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4493 know the pid rather than having the callee infer it.
4494 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4495 (create_process): Set new 'alive' member if child is created.
4496 (process_status_retrieved): New function.
4497 (record_child_status_change): Use it.
4498 Accept negative 1st argument, which means to wait for the
4499 processes that Emacs already knows about. Move special-case code
4500 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4501 processes that have already been waited for, by testing and
4502 clearing new 'alive' member.
4503 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4504 now does this internally.
4505 (handle_child_signal): Let record_child_status_change do all
4506 the work, since we do not want to reap all exited child processes,
4507 only the child processes that Emacs itself created.
4508 * process.h (Lisp_Process): New boolean member 'alive'.
4509
0d879dca
PE
4510 Omit duplicate definitions no longer needed with gcc -g3.
4511 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4512 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4513 Define only as macros. There's no longer any need to also define
4514 these symbols as enums or as constants, since we now assume
4515 gcc -g3 when debugging.
4516
3478f4b5
EZ
45172012-11-03 Eli Zaretskii <eliz@gnu.org>
4518
4519 * lisp.mk: Adjust comments to the fact that term/internal is now
4520 loaded from loadup.el.
4521
4522 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4523 (msdos_fatal_signal): New function.
4524 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4525 its argument list.
4526
4527 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4528 for GCC versions before 4.
4529 (emacs_raise): Define to call msdos_fatal_signal.
4530
4531 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4532 iterator when starting in the middle of a display or overlay
4533 string. (Bug#12745)
4534
85fabcb7
CY
45352012-11-03 Chong Yidong <cyd@gnu.org>
4536
4537 * process.c (wait_reading_process_output): Clean up the last
4538 change.
4539
893cc455
CY
45402012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4541
4542 * process.c (wait_reading_process_output): Avoid a race condition
4543 with SIGIO delivery (Bug#11536).
4544
0f7b074f
CY
45452012-11-03 Chong Yidong <cyd@gnu.org>
4546
4547 * buffer.c (cursor_type): Untabify docstring.
4548
3737fee7
DA
45492012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4550
4551 * frame.h (struct frame): Drop can_have_scroll_bars member
4552 which is meaningless for a long time. Adjust comments.
4553 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4554 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4555
b6a9e8b1
DA
45562012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 * window.c (decode_next_window_args): Update window arg after
4559 calling decode_live_window and so fix crash reported at
4560 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4561 by Juanma Barranquero <lekktu@gmail.com>.
4562 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4563 * font.c (Ffont_at): Likewise.
4564
600d4768
JD
45652012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4566
4567 * widget.c (resize_cb): New function.
4568 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4569 (EmacsFrameResize): Check if all is up to date before changing frame
4570 size.
4571
1005b4b9
EZ
45722012-11-02 Eli Zaretskii <eliz@gnu.org>
4573
4574 Implement backtrace output for fatal errors on MS-Windows.
4575 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4576 (BACKTRACE_LIMIT_MAX): New macro.
4577 (w32_backtrace): New function.
4578 (emacs_abort): Use w32_backtrace when the user chooses not to
4579 attach a debugger. Update the text of the abort dialog.
4580
b9e9df47
DA
45812012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4582
4583 Window-related stuff cleanup here and there.
4584 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4585 Use decode_any_window.
4586 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4587 * xdisp.c (Fformat_mode_line): Likewise.
4588 * font.c (Ffont_at): Use decode_live_window.
4589 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4590 * window.c (decode_next_window_args): Likewise.
4591 (decode_any_window): Remove static.
4592 * window.h (decode_any_window): Add prototype.
4593 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4594 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4595 respectively.
4596
2b371ff7
DA
45972012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4598
4599 Remove pad from struct input_event.
4600 * termhooks.h (struct input_event): Remove padding field.
4601 Adjust comment.
4602 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4603 member is never cons for a long time. Adjust comment.
4604 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4605 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4606 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4607 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4608
7e8b50d9
EZ
46092012-11-01 Eli Zaretskii <eliz@gnu.org>
4610
4611 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4612
322aea6d
PE
46132012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 Fix crash when using Emacs as commit editor for git (Bug#12697).
4616 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4617 and it is configured in conf_post.h.
4618 (Fcall_process): Don't invoke both setsid and setpgid; the former
4619 is enough, if it exists.
4620 * callproc.c (Fcall_process, child_setup):
4621 * process.c (create_process): Use setpgid.
4622 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4623 for the real thing.
4624 * dispnew.c (init_display): Initialize the foreground group
4625 if we are running a tty display.
4626 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4627 * lisp.h (init_foreground_group): New decl.
4628 * sysdep.c (inherited_pgroup): New static var.
4629 (init_foreground_group, tcsetpgrp_without_stopping)
4630 (narrow_foreground_group, widen_foreground_group): New functions.
4631 (init_sys_modes): Narrow foreground group.
4632 (reset_sys_modes): Widen foreground group.
4633
220cb2bd
MA
46342012-10-31 Michael Albinus <michael.albinus@gmx.de>
4635
4636 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4637
218e997a
MR
46382012-10-31 Martin Rudalics <rudalics@gmx.at>
4639
4640 * minibuf.c (read_minibuf): Restore current buffer since
4641 choose_minibuf_frame calling Fset_frame_selected_window may
4642 change it (Bug#12766).
4643
02615da0
JD
46442012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4645
4646 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4647
aee5b18e
KH
46482012-10-30 Kenichi Handa <handa@gnu.org>
4649
4650 * font.c (Ffont_at): If WINDOW is specified and it is not
4651 displaying the current buffer, signal an error.
4652
ba116008
DC
46532012-10-29 Daniel Colascione <dancol@dancol.org>
4654
de5ef41a
SM
4655 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4656 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4657 here...
4658
4659 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4660 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4661 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4662
640bf8ad
EZ
46632012-10-28 Eli Zaretskii <eliz@gnu.org>
4664
4665 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4666 (timer_loop, getitimer, setitimer): Use it instead of
4667 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4668 'clock'.
4669 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4670 literal 10000.
4671
64ccff5f
JD
46722012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4673
4674 * nsterm.m (NO_APPDEFINED_DATA): New define.
4675 (last_appdefined_event_data): New variable
4676 (last_appdefined_event): Remove.
4677 (ns_select): Initialize t from last_appdefined_event_data instead
4678 of [last_appdefined_event data1].
4679 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4680 remove last_appdefined_event (Bug#12698).
4681
e483264c
SM
46822012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4683
4684 * frame.c (x_set_font): Catch internal error.
4685
6c16c13e
EZ
46862012-10-27 Eli Zaretskii <eliz@gnu.org>
4687
e483264c
SM
4688 Avoid overflow in w32 implementation of interval timers.
4689 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4690 actually executes.
4691 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4692 'volatile ULONGLONG' types. All the other data which was
4693 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4694 (GetThreadTimes_Proc): New typedef.
4695 (w32_get_timer_time): New function, returns a suitable time value
4696 for the timer.
4697 (timer_loop): Enter critical section when accessing ULONGLONG
4698 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4699 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4700 Remove unused variable.
6c16c13e
EZ
4701 (init_timers): Initialize s_pfn_Get_Thread_Times.
4702 (start_timer_thread): Don't assign itimer->caller_thread here.
4703 (getitimer): Assign itimer->caller_thread here.
4704 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4705 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4706
ccc83f50
EZ
47072012-10-26 Eli Zaretskii <eliz@gnu.org>
4708
4709 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4710 mouse movement events if the menu bar is active. This avoids
4711 producing a busy "hour-glass" cursor by Windows if the mouse
4712 pointer is positioned over a tooltip shown for some menu item.
4713
69deda53
PE
47142012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4715
4716 Don't assume process IDs fit in int.
4717 * emacs.c (shut_down_emacs) [!DOS_NT]:
4718 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4719 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4720 Use pid_t, not int, to store process IDs, as 'int'
4721 is not wide enough on a few platforms (e.g., AIX and IRIX).
4722
7e70a152
KH
47232012-10-23 Kenichi Handa <handa@gnu.org>
4724
4725 The following change is to make face-font-rescale-alist work
4726 correctly for non-ASCII fonts.
4727
4728 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4729 (font_open_for_lface): Handle Vface_font_rescale_alist.
4730
49238e7f
CY
47312012-10-23 Chong Yidong <cyd@gnu.org>
4732
4733 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4734
5ec86886
JD
47352012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4736
ef446959
JD
4737 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4738 for screen font.
4739 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4740
5ec86886
JD
4741 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4742 event (Bug#12681).
4743
ee7a418d
GM
47442012-10-21 Glenn Morris <rgm@gnu.org>
4745
4746 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4747
4973679b
PE
47482012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 Port to OpenBSD 5.1.
4751 * frame.c (Fmouse_position, Fmouse_pixel_position):
4752 * xdisp.c (produce_stretch_glyph):
4753 Declare local vars only when they're needed.
4754 This is clearer and avoids a warning on OpenBSD about unused vars.
4755 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4756 This is safer, and avoids OpenBSD warnings about unused vars.
4757 * keyboard.c (record_menu_key): Remove unnecessary decl.
4758 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4759 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4760 as our definition clashes with OpenBSD's.
4761 * xfaces.c (load_face_colors, check_lface_attrs)
4762 (get_lface_attributes_no_remap, get_lface_attributes)
4763 (lface_fully_specified_p, x_supports_face_attributes_p)
4764 (tty_supports_face_attributes_p, face_fontset, realize_face)
4765 (realize_x_face, realize_tty_face):
4766 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4767 merely Lisp_Object *. This is more informative and avoids
4768 a warning on OpenBSD about accessing beyond an object's size.
4769
c664f463
CY
47702012-10-20 Chong Yidong <cyd@gnu.org>
4771
4772 * lread.c (Fload): Doc fix (Bug#12592).
4773
6ec83f92 47742012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4775
4776 * font.c (Ffont_at): Fix previous change.
4777
d2824928
EZ
47782012-10-19 Eli Zaretskii <eliz@gnu.org>
4779
e483264c
SM
4780 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4781 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4782 for the reasons.
4783
d2824928
EZ
4784 * alloc.c (NSTATICS): Decrease to 0x800.
4785
f60d391f
SM
47862012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4787
4a0e1924 4788 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4789 error (bug#12677).
4790
1a9327d5
JD
47912012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4792
4793 * nsterm.m (ns_select): Check writefds before call to
4794 FD_ISSET (Bug#12668).
4795
14145a1e
DC
47962012-10-18 Daniel Colascione <dancol@dancol.org>
4797
4798 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4799 (staticpro): If we run out of staticpro slots, die with an
4800 informative error instead of just calling emacs_abort.
4801
1f76f6f5
MR
48022012-10-18 Martin Rudalics <rudalics@gmx.at>
4803
4804 Fix two flaws reported by Dmitry Antipov.
4805 * window.c (Ftemp_output_buffer_show): Remove.
4806 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4807 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4808
fcf14875
EZ
48092012-10-17 Eli Zaretskii <eliz@gnu.org>
4810
1f76f6f5
MR
4811 * makefile.w32-in ($(BLD)/w32.$(O)):
4812 ($(BLD)/vm-limit.$(O)):
4813 ($(BLD)/term.$(O)):
4814 ($(BLD)/unexw32.$(O)):
4815 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4816 ($(BLD)/dispnew.$(O)): Update dependencies.
4817
4818 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4819 Add prototypes.
4820
4821 * w32proc.c: Include ctype.h.
4822
4823 * w32.h (init_environment, check_windows_init_file)
4824 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4825 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4826 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4827 (sys_link): Add prototypes.
4828
4829 * w32.c: Include w32select.h.
4830 (sys_access, e_malloc, sys_select): Add prototypes.
4831 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4832
4833 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4834
4835 * unexw32.c: Include lisp.h and w32.h.
4836
4837 * term.c [WINDOWSNT]: Include w32term.h.
4838
4839 * process.c [WINDOWSNT]: Add prototype of sys_select.
4840
4841 * fileio.c [WINDOWSNT]: Include w32.h.
4842
4843 * dispnew.c [WINDOWSNT]: Include w32.h.
4844
fcf14875
EZ
4845 * cygw32.c (Fcygwin_convert_path_to_windows)
4846 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4847 Lisp_Object values. (Bug#12661)
4848
4849 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4850 to Lisp_Object. (Bug#12661)
4851
fe0b1ec4
KH
48522012-10-17 Kenichi Handa <handa@gnu.org>
4853
4854 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4855 invalidate.
4856
d556ebf9
DA
48572012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4858
4859 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4860 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4861
f0863a54
DA
48622012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4863
4864 Do not verify indirection counters of killed buffers (Bug#12579).
4865 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4866 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4867
12fbe755
DA
48682012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4869
4870 * alloc.c (Fmake_byte_code): Fix typo in comment.
4871 * print.c (print_interval): Define as static to match prototype.
4872 * indent.c (disptab_matches_widthtab, recompute_width_table):
4873 Convert to eassert.
4874
61655b89
DA
48752012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4876
4877 * editfns.c (get_system_name): Remove.
4878 * lisp.h (get_system_name): Remove prototype.
4879 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4880 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4881
9520f2f2
DC
48822012-10-15 Daniel Colascione <dancol@dancol.org>
4883
4884 * dbusbind.c: Add comment explaining reason for previous change.
4885
dca778d5
MR
48862012-10-15 Martin Rudalics <rudalics@gmx.at>
4887
4888 * window.c (Fwindow_end): Rewrite check whether cached position
4889 can be used (Bug#12600).
4890 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4891 Set windows_or_buffers_changed.
4892
3e0341b0
DC
48932012-10-15 Daniel Colascione <dancol@dancol.org>
4894
4895 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4896 enabled by undefining the symbol "interface", which the platform
4897 headers define to something incompatible.
4898
33d4113c
DC
48992012-10-14 Daniel Colascione <dancol@dancol.org>
4900
4901 * image.c (init_tiff_functions, init_imagemagick_functions)
4902 (init_svg_functions): Fix cygw32 build break by using these
4903 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4904
a36fb15e
JD
49052012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4906
4907 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4908
537f336d
JD
49092012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4910
4911 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4912
0ba06a77
KH
49132012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4914
4915 * coding.c (detect_coding): Set coding->id before calling
4916 this->detector.
4917
ce2fe65a
AS
49182012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4919
4920 * fileio.c: Formatting fixes.
4921
d6453ce4
PE
49222012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 Fix some stat-related races.
4925 * fileio.c (Fwrite_region): Avoid race condition if a file is
4926 removed or renamed by some other process immediately after Emacs
4927 writes it but before Emacs stats it. Do not assume that stat (or
4928 fstat) succeeds.
4929 * image.c (slurp_file): Resolve the file name with fopen + fstat
4930 rather than stat + fopen.
4931 (pbm_read_file) [0]: Remove unused code with stat race.
4932 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4933 Remove ineffective code with stat race.
4934
06485aa8
SM
49352012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4936
4937 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4938
167e3640
JD
49392012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4940
4941 * nsterm.m (hold_event_q): New static variable.
4942 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4943 ! q_event_ptr.
4944 (hold_event): New function.
4945 (ns_read_socket): If hold_event_q have events, store them and
4946 return (Bug#12384).
4947 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4948 is zero (Bug#12384).
4949
c40239df
JB
49502012-10-12 Juanma Barranquero <lekktu@gmail.com>
4951
4952 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4953
bb385a92
EZ
49542012-10-12 Eli Zaretskii <eliz@gnu.org>
4955
2a9f1099
EZ
4956 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4957
bb385a92
EZ
4958 * fileio.c (check_existing): New function.
4959 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4960 instead of calling 'stat', when what's needed is to check whether
4961 a file exists. This avoids expensive system calls on MS-Windows.
4962 (Bug#12587)
4963
8599b23a 4964 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4965
4966 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4967 determine whether a file exists and is not a directory.
4968
4969 * lisp.h (check_existing): Add prototype.
4970
2b9c2e68
JD
49712012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4972
4973 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4974
81749a23
GM
49752012-10-12 Glenn Morris <rgm@gnu.org>
4976
4977 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4978
5253a5fd
SM
49792012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4980
389a94a5
SM
4981 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4982
5253a5fd
SM
4983 * eval.c (Fautoload): Remember previous autoload status in load-history.
4984
7cded46f
PE
49852012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4986
4987 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4988 * lread.c (load_each_byte, new_backquote_flag, readchar)
4989 (read_filtered_event, lisp_file_lexically_bound_p)
4990 (safe_to_load_version, Fload, complete_filename_p, openp)
4991 (build_load_history, readevalloop, read_escape, read1)
4992 (string_to_number, read_vector, read_list):
4993 * macros.c (Fstart_kbd_macro):
4994 * marker.c (CONSIDER):
4995 * menu.c (parse_single_submenu, digest_single_submenu)
4996 (find_and_return_menu_selection, Fx_popup_menu):
4997 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4998 (Ftry_completion):
4999 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5000 (ns_menu_show):
5001 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5002 (xmenu_show, xdialog_show):
5003 Use bool for booleans.
5004 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5005 as it's not a predicate. All uses changed. Omit unnecessary
5006 buffer termination.
5007
549c3414
DA
50082012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5009
5010 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5011 (save_excursion_restore): Do not restore mark if it was not saved.
5012
e85aafe7
PE
50132012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5014
fd2f90cf
PE
5015 * marker.c (cached_modiff): EMACS_INT, not int.
5016
c1af190b
PE
5017 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5018 instead of having a wrong decl.
e85aafe7
PE
5019 * nsmenu.m (waiting_for_input): Remove wrong decl.
5020
e738ca56
PE
50212012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5022
9fa1de30
PE
5023 keyboard.c, keymap.c: Use bool for booleans.
5024 * dispnew.c (sit_for): Distinguish between 3-way display_option
5025 and boolean do_display.
5026 * keyboard.c (single_kboard, this_command_key_count_reset)
5027 (waiting_for_input, echoing, immediate_quit, input_pending)
5028 (interrupt_input, interrupts_deferred, pop_kboard)
5029 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5030 (command_loop_1, adjust_point_for_property)
5031 (safe_run_hooks_error, input_polling_used, read_char):
5032 (help_char_p, readable_events, kbd_buffer_events_waiting)
5033 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5034 (lucid_event_type_list_p, get_input_pending):
5035 (gobble_input, menu_separator_name_p, menu_bar_item)
5036 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5037 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5038 (keyremap_step, test_undefined, read_key_sequence)
5039 (detect_input_pending, detect_input_pending_ignore_squeezables)
5040 (detect_input_pending_run_timers, requeued_events_pending_p)
5041 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5042 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5043 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5044 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5045 (accessible_keymaps_1, Fkey_description, push_key_description):
5046 (shadow_lookup, struct where_is_internal_data)
5047 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5048 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5049 (describe_map, describe_vector):
5050 * menu.c (single_menu_item):
5051 * nsmenu.m (ns_update_menubar):
5052 * process.c (wait_reading_process_output):
5053 * search.c (scan_buffer, scan_newline):
5054 Use bool for boolean.
5055 * keyboard.c (timers_run, swallow_events)
5056 (detect_input_pending_run_timers):
5057 * process.c (wait_reading_process_output):
5058 Use unsigned for counter where wraparound-on-overflow is desired,
5059 since unsigned is guaranteed to have that behavior and signed is not.
5060 (read_char): Use ptrdiff_t for string length.
5061 (get_input_pending): Remove first argument, since it was always
5062 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5063 and behave as if it had that value. Return new value of
5064 input_pending. All callers changed.
5065 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5066 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5067 a string length.
5068 * keymap.c (push_key_description): Omit last arg, which was always 1.
5069 All callers changed.
5070
e738ca56
PE
5071 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5072
29f21cdf
JB
50732012-10-10 Juanma Barranquero <lekktu@gmail.com>
5074
5075 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5076 ($(BLD)/term.$(O)): Update dependencies.
5077
6aea7528
DA
50782012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5081 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5082 initializer for PVEC_NORMAL_VECTOR.
5083
5f3f57be
PE
50842012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5085
5086 Clean out old termopts cruft.
5087 * termopts.h (flow_control, meta_key): Remove unused decls.
5088 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5089 Don't include termopts.h.
5090
3e98c68e
DA
50912012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5092
5093 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5094
77e344e5
PE
50952012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 * commands.h (immediate_quit): Remove duplicate decl.
5098
5683d7cd
JD
50992012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5100
5101 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5102 caching.
5103 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 5104 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 5105
cf5fc6db
EZ
51062012-10-09 Eli Zaretskii <eliz@gnu.org>
5107
b15736e6
EZ
5108 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5109 match what GetLastError returns. Explain why the function is
5110 needed.
5111
cf5fc6db
EZ
5112 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5113 'is_tooltip_frame', to avoid confusion with its global namesake.
5114
f99714ce
DC
51152012-10-08 Daniel Colascione <dancol@dancol.org>
5116
5117 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
5118 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5119 build that caused Emacs to display the hourglass cursor forever.
f99714ce 5120
fd59cb29
GM
5121 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5122 which is broken under remote desktop, calculate the number of
5123 colors available for a display based on the display's number of
5124 planes and number of bits per pixel per plane. (bug#10397).
5125
62c480c9 51262012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 5127
62c480c9
JD
5128 * nsfont.m (Vfonts_in_cache): New variable.
5129 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5130 are used. Add cached fonts to Vfonts_in_cache.
5131 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5132
607446ba
JB
51332012-10-08 Juanma Barranquero <lekktu@gmail.com>
5134
fd5125ad
JB
5135 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5136 in nt/config.nt.
46979e0b
JB
5137 (FONT_H): Define after FRAME_H.
5138 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5139 Update dependencies.
fd5125ad 5140
607446ba
JB
5141 * w32term.c: Remove leftover declaration of keyboard_codepage.
5142
b6f4e300
EZ
51432012-10-08 Eli Zaretskii <eliz@gnu.org>
5144
c54ebba4
EZ
5145 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5146 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5147 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5148 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
5149 ($(BLD)/unexw32.$(O)):
5150 ($(BLD)/w32.$(O)):
5151 ($(BLD)/w32console.$(O)):
5152 ($(BLD)/w32fns.$(O)):
5153 ($(BLD)/w32heap.$(O)):
5154 ($(BLD)/w32menu.$(O)):
15c720a3 5155 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5156
b6f4e300
EZ
5157 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5158 'const char *'.
5159 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5160
501199a3
DC
51612012-10-08 Daniel Colascione <dancol@dancol.org>
5162
5163 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5164 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5165 accidental message numbering hole. Change other messages to
5166 match.
5167
5168 * w32select.h (HAVE_W32SELECT): Remove.
5169
5170 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5171 w32common.h instead of w32heap.h.
501199a3
DC
5172
5173 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5174 (get_allocation_unit, get_processor_type, get_w32_major_version)
5175 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5176 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5177 (OS_NT, os_subtype, cache_system_info): Move declarations to
5178 w32common.
5179
5180 * w32heap.c: Include w32common.h.
5181 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5182 (w32_minor_version, w32_build_number, w32_subtype):
5183 Remove duplicate definitions.
501199a3
DC
5184
5185 * w32fns.c: Include w32common.h; include w32heap.h only in
5186 WINDOWSNT.
5187
5188 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5189 Use `report_file_error' instead of `error' in order to better
5190 inform users of what went wrong. Increase NTGUI_UNICODE file
5191 dialog box file name length to 32k, the maximum allowed by the NT
5192 kernel.
5193
5194 * w32common.h: New file.
5195 (ROUND_UP, ROUND_DOWN, get_page_size)
5196 (get_allocation_unit, get_processor_type, get_w32_major_version)
5197 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5198 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5199 (OS_NT, os_subtype, cache_system_info): Move here.
5200
5201 * unexw32.c, unexcw.c: Include w32common.h.
5202
5203 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5204 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5205 to call syms_of_w32select.
5206
5207 * cygw32.h: Remove obsolete EXFUN declarations.
5208
5209 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5210
5211 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5212 of w32inevt.o from SOME_MACHINE_OBJECTS.
5213
93aa5c81
DC
52142012-10-08 Daniel Colascione <dancol@dancol.org>
5215
5216 * image.c: Permanent fix for JPEG compilation issue --- limit
5217 jpeglib `boolean' redefinition to Cygwin builds.
5218
d424f3d8
EZ
52192012-10-08 Eli Zaretskii <eliz@gnu.org>
5220
8ee4c6ce
EZ
5221 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5222
d424f3d8
EZ
5223 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5224 Cygwin.
5225
e08348a0
DC
52262012-10-08 Daniel Colascione <dancol@dancol.org>
5227
5228 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5229 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5230 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5231 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5232 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5233 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5234 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5235 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5236 now a supported configuration.
5237
5238 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5239 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5240
5241 * conf_post.h:
5242 (_DebPrint) declare tracing facility for W32 debugging. We need
5243 to unify tracing later.
5244
5245 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5246 unconditional use of W32 Unicode functions. Cygwin runs only on
5247 100% Unicode operating systems.
5248
5249 * cygw32.c: New file. Define Cygwin-specific facilities.
5250 (Fcygwin_convert_path_to_windows)
5251 (Fcygwin_convert_path_from_windows): New user functions for
5252 accessing Cygwin path-munging routines.
5253
5254 * cygw32.h: New file.
5255 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5256 UTF-16LE strings temporarily inside non-Lisp-visible string
5257 objects.
5258
5259 (w32_strerror): Just what it says on the tin.
5260
5261 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5262 also run for Cygwin; both systems have the same problem with using
5263 GUI facilities in a forked child. Also call syms_of_cygw32,
5264 syms_of_w32select in correct places.
5265
5266 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5267 needs fork-then-exec for daemon launching.
5268
5269 * font.h: Include frame.h.
5270
5271 * image.c: Use the image library cache machinery only when we're
5272 compiling for native WINDOWSNT; Cygwin can use shared libraries
5273 like any other Unixlike system.
5274
5275 * keyboard.c: Clarify a comment regarding the input loop.
5276
5277 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5278 functions directly instead of trying to detect at runtime that our
5279 host operating system supports them. We make this change for two
5280 reasons: Cygwin lacks support for the multibyte character
5281 conversion functions used by the legacy menu code, and Cygwin
5282 never needs to rely on non-Unicode APIs.
5283
5284 * unexw32.c (hinst): Declare extern.
5285
5286 * w32.c: Change header order;
5287 (w32_strerror): Move to w32fns.c because we need it for
5288 non-WINDOWSNT builds.
5289
5290 * w32.h: Add #error macro to make sure we don't include w32.h for
5291 Cygwin builds. Remove w32select declarations.
5292
5293 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5294 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5295
5296 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5297 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5298 POSIXy alternative.
5299 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5300 (w32_major_version, w32_minor_version, w32_build_number)
5301 (os_subtype, sound_type): Define here
5302 (w32_defined_color): Make color parameter const for consistency
5303 with other _defined_color functions.
5304 (w32_createwindow): Unconditionally call w32_init_class instead of
5305 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5306 through the code is complex and unnecessary because class
5307 registration is practically free.
5308 (w32_name_of_message): New EMACSDEBUG-only function.
5309 (Fset_message_beep): Move here
5310 (Fx_open_connection): Require that the display name for Windows be
5311 "w32" for consistency, emacsclient disambiguation, and maybe, one
5312 day, multi-window-system support.
5313 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5314 Cygwin files for W32 GUI facilities, since these clearly don't
5315 expect Cygwin names.
5316 (_DebPrint): Define.
5317 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5318 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5319 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5320 (w32_last_error): Remove.
5321
5322 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5323
5324 * w32heap.c (syspage_mask): Declare here.
5325 (cache_system_info): Remove.
5326
5327 * w32inevt.c (faked_key): Define globally, not statically.
5328 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5329 (w32_console_toggle_lock_key): Move to w32fns.c.
5330
5331 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5332
5333 * w32proc.c (_DebPrint): Move to w32fns.c.
5334 * w32select.c: Include string.h, stdio.h for Cygwin.
5335 * w32select.h: New File.
5336
5337 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5338 get_osfhandle.
5339 (w32_message_fd): New variable. Under Cygwin, holds the file
5340 descriptor the system used to tell us about pending thread
5341 messages.
5342
5343 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5344 that prevented compilation under non-WINDOWSNT systems.
5345
5346 (w32_initialize): Open /dev/windows and assign it to
5347 w32_message_fd. Provide w32 feature.
5348
5349 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5350 (WM_EMACS_INPUT_READY): add.
5351 (prepend_msg, w32_message_fd): Declare globally.
5352
5353 * w32xfns.c:
5354 (keyboard_handle): Use only when WINDOWSNT.
5355 (notify_msg_ready): New function. Posts a message to the main
5356 thread's message queue under CYGWIN, which wakes up the main
5357 thread from select(2) by making the /dev/windows file descriptor
5358 ready. Under WINDOWSNT, it sets an event the same way the old
5359 code did.
5360
5361 (post, prepend_msg): Actually call notify_msg_ready instead of
5362 setting the input event directly.
5363
98daa893
EZ
53642012-10-07 Eli Zaretskii <eliz@gnu.org>
5365
5366 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5367 but it still has blocs in it, don't return it to the system,
5368 instead of aborting. (Bug#12402)
5369
3bc0a2f7
JD
53702012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5371
8ad5b73b 5372 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5373
335f5ae4
JD
5374 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5375 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5376 (syms_of_nsterm): Remove comment about Panther and above for
5377 ns-antialias-text.
335f5ae4
JD
5378 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5379 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5380 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5381
5382 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5383 MAC_OS_X_VERSION_10_4.
5384
8ad5b73b
JD
5385 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5386 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5387
5388 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5389
5390 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5391 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5392
3bc0a2f7
JD
5393 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5394 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5395 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5396 Remove ns_in_resize check.
3bc0a2f7
JD
5397 (ns_clear_frame_area): Remove resize handle code.
5398
5399 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5400 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5401 Remove ns_in_resize check.
3bc0a2f7 5402
c622b48f
PE
54032012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5404
5405 Improve sys_siglist detection.
5406 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5407 defined as a macro, as is done in Solaris.
5408 (sys_siglist_entries): New macro.
5409 (save_strsignal): Use it.
5410 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5411 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5412
04fafa46
JD
54132012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5414
5415 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5416 fullscreen/Fullscreen.
5417
5418 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5419 tobar_height is new.
5420
5421 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5422 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5423 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5424 (windowDidResize:): Check for correct window if old style fullscreen.
5425 Capitalize word in comment. Remove incorrect comment.
5426 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5427 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5428 error in drawing background.
1f9f395d 5429 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5430 Set toolbar values to zero, save old height in tobar_height.
5431 Restore tool bar height when leaving fullscreen.
5432 (canBecomeMainWindow): New function.
5433
c6e21c03
PE
54342012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5435
5436 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5437
0d9f584b
EZ
54382012-10-05 Eli Zaretskii <eliz@gnu.org>
5439
a65fbb5f
EZ
5440 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5441
0d9f584b 5442 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5443 that time stamps of directories could also be changed.
5444 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5445 FILE_WRITE_ATTRIBUTES access rights.
5446
5447 * fileio.c (Fset_file_times): Special-case ignoring errors for
5448 directories only on MSDOS, not on MS-Windows.
5449
e8757f09 54502012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5451
5452 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5453
7604f298
EZ
54542012-10-04 Eli Zaretskii <eliz@gnu.org>
5455
5456 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5457 see whether CreateFile failed.
5458
88d69b7d
PE
54592012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5460
5461 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5462 to avoid similar races.
5463 * keyboard.c (pending_signals): Now bool, not int.
5464
7509f454
PE
5465 Port timers to OpenBSD, plus check for timer failures.
5466 OpenBSD problem reported by Han Boetes.
5467 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5468 and/or setitimer.
5469 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5470 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5471 like OpenBSD, which has timer_settime but does not declare it.
5472 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5473 whether to use itimerspec-related primitives. All uses of
5474 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5475
a3c5c0c5
PE
54762012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 * profiler.c (handle_profiler_signal): Fix a malloc race
5479 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5480
914e743b
JD
54812012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5482
5483 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5484
d8ab37a8
EZ
54852012-10-02 Eli Zaretskii <eliz@gnu.org>
5486
5487 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5488 consistent with the change in return value of 'safe_strsignal'.
5489
b3ecad33
PE
54902012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5491
0a99eee1
PE
5492 Prefer plain 'static' to 'static inline' (Bug#12541).
5493 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5494 (bidi_set_sor_type, bidi_push_embedding_level)
5495 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5496 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5497 (bidi_cache_search, bidi_cache_ensure_space)
5498 (bidi_cache_iterator_state, bidi_cache_find)
5499 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5500 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5501 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5502 Now 'static', not 'static inline'.
5503
b3ecad33
PE
5504 Count overruns when profiling; change units to ns.
5505 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5506 Give extra weight to samples after overruns, to attempt to count
5507 the time more accurately.
5508 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5509 the underlying primitives nominally do ns.
5510 (Fprofiler_cpu_start): Document the change. Mention that
5511 the sampling intervals are only approximate.
5512
090cf9db
SM
55132012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5514
5515 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5516
5517 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5518 case for the special 0 coding-system.
5519
5520 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5521 (Fmake_overlay): Remove redundant tests.
64edc777 5522 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5523
81550bf4
JB
55242012-10-02 Juanma Barranquero <lekktu@gmail.com>
5525
5526 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5527 Update dependencies.
5528
aa1ba90e
PE
55292012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5530
5531 Fix a malloc race condition involving strsignal.
5532 A signal can arrive in the middle of a malloc, and Emacs's signal
5533 handler can invoke strsignal, which can invoke malloc, which is
5534 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5535 Fix it by altering the signal handler so that it does not invoke
5536 strsignal.
5537 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5538 * process.c (status_message): Use const pointer, in case strsignal
5539 is #defined to safe_strsignal.
5540 * sysdep.c (sys_siglist, init_signals): Always define and
5541 initialize a substitute sys_siglist if the system does not define
5542 one, even if HAVE_STRSIGNAL.
5543 (safe_strsignal): Rename from strsignal. Always define,
5544 using sys_siglist. Return a const pointer.
5545 * syssignal.h (safe_strsignal): New decl.
5546 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5547
ace917bd
EZ
55482012-10-01 Eli Zaretskii <eliz@gnu.org>
5549
5550 * w32proc.c (timer_loop): Fix code that waits for timer
5551 expiration, to avoid high CPU usage.
5552
9eb71b9c
SM
55532012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5554
5555 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5556 (sweep_weak_table): Remove redundant prototypes.
5557
b3317662
FP
55582012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5559
5560 * emacs.c: Move the inclusion of TERM_HEADER after including
5561 windows.h on WINDOWSNT. This avoids compilation problems with
5562 MSVC.
5563
f0e5f225
EZ
55642012-10-01 Eli Zaretskii <eliz@gnu.org>
5565
2d7d1608
EZ
5566 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5567 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5568 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5569 as the previous version used 'void *'.
5570
5571 * ralloc.c (ROUNDUP): Fix last change.
5572 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5573 'size_t'.
5574
f0e5f225
EZ
5575 * w32proc.c <disable_itimers>: New static flag.
5576 (init_timers): Initialize it to zero, after creating the critical
5577 sections used by the timer threads.
5578 (term_timers): Set to 1 before deleting the critical sections.
5579 (getitimer, setitimer): If disable_itimers is non-zero, return an
5580 error indication without doing anything. Reported by Fabrice
5581 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5582 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5583 return results.
5584 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5585 support timers.
f0e5f225
EZ
5586
5587 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5588 term_ntproc after all the other bookkeeping, to get timers working
5589 as long as possible.
5590
82ef37c1
PE
55912012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5592
b3a4c387
PE
5593 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5594 Suggested by Juri Linkov in
5595 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5596
b0ab8123
PE
5597 Prefer plain 'static' to 'static inline' (Bug#12541).
5598 With static functions, modern compilers inline pretty well by
5599 themselves; advice from programmers often hurts as much as it helps.
5600 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5601 this change shrinks the text size of the Emacs executable by 1.1%
5602 without affecting CPU significantly in my benchmark.
5603 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5604 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5605 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5606 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5607 (bset_auto_fill_function, bset_auto_save_file_format)
5608 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5609 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5610 (bset_cache_long_line_scans, bset_case_fold_search)
5611 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5612 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5613 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5614 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5615 (bset_header_line_format, bset_indicate_buffer_boundaries)
5616 (bset_indicate_empty_lines, bset_invisibility_spec)
5617 (bset_left_fringe_width, bset_major_mode, bset_mark)
5618 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5619 (bset_name, bset_overwrite_mode, bset_pt_marker)
5620 (bset_right_fringe_width, bset_save_length)
5621 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5622 (bset_scroll_up_aggressively, bset_selective_display)
5623 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5624 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5625 (set_buffer_overlays_after):
5626 * category.c (bset_category_table):
5627 * charset.c (read_hex):
5628 * coding.c (produce_composition, produce_charset)
5629 (handle_composition_annotation, handle_charset_annotation)
5630 (char_encodable_p):
5631 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5632 (assign_row, set_frame_matrix_frame, make_current)
5633 (add_row_entry):
5634 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5635 * fns.c (maybe_resize_hash_table):
5636 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5637 * gmalloc.c (register_heapinfo):
5638 * image.c (lookup_image_type):
5639 * intervals.c (set_interval_object, set_interval_left)
5640 (set_interval_right, copy_interval_parent, rotate_right)
5641 (rotate_left, balance_possible_root_interval):
5642 * keyboard.c (kset_echo_string, kset_kbd_queue)
5643 (kset_keyboard_translate_table, kset_last_prefix_arg)
5644 (kset_last_repeatable_command, kset_local_function_key_map)
5645 (kset_overriding_terminal_local_map, kset_real_last_command)
5646 (kset_system_key_syms, clear_event, set_prop):
5647 * lread.c (digit_to_number):
5648 * marker.c (attach_marker, live_buffer, set_marker_internal):
5649 * nsterm.m (ns_compute_glyph_string_overhangs):
5650 * process.c (pset_buffer, pset_command)
5651 (pset_decode_coding_system, pset_decoding_buf)
5652 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5653 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5654 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5655 * syntax.c (bset_syntax_table, dec_bytepos):
5656 * terminal.c (tset_param_alist):
5657 * textprop.c (interval_has_some_properties)
5658 (interval_has_some_properties_list):
5659 * window.c (wset_combination_limit, wset_dedicated)
5660 (wset_display_table, wset_hchild, wset_left_fringe_width)
5661 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5662 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5663 (wset_right_fringe_width, wset_right_margin_cols)
5664 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5665 (wset_vertical_scroll_bar_type, wset_window_parameters):
5666 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5667 (wset_column_number_displayed, wset_region_showing)
5668 (window_box_edges, run_window_scroll_functions)
5669 (append_glyph_string_lists, prepend_glyph_string_lists)
5670 (append_glyph_string, set_glyph_string_background_width)
5671 (append_glyph, append_composite_glyph)
5672 (take_vertical_position_into_account):
5673 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5674 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5675 (lface_hash, lface_same_font_attributes_p, lookup_face):
5676 * xml.c (libxml2_loaded_p):
5677 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5678 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5679 Now 'static', not 'static inline'.
5680
05584c31
PE
5681 * bidi.c: Tune.
5682 (bidi_copy_it): Do the whole copy with a single memcpy.
5683 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5684
86ec63ba
PE
5685 Revert the FOLLOW-SYMLINKS change for file-attributes.
5686 Doing it right would require several changes to Tramp, and there's
5687 not enough time to get that tested before the freeze today.
5688 * dired.c (directory_files_internal, Ffile_attributes):
5689 Undo last change.
5690
82ef37c1
PE
5691 * frame.c (x_report_frame_params): Port better to wider ints.
5692 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5693 or that pointers can be printed in 15 decimal digits.
5694 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5695
62aba0d4
FP
56962012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5697
5698 Support x64 build on MS-Windows.
5699 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5700 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5701 compatibility with x64.
5e4daaf3 5702 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5703
5704 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5705 defining an XRectangle structure.
5706
5707 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5708 arithmetics for compatibility with x64.
5709
5710 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5711 compatibility with x64.
5712
5713 * w32heap.h: Adjust prototypes and declarations.
5714
5715 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5716 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5717 DWORD, long, and unsigned long, for compatibility with x64.
5718 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5719 (sbrk): Argument is now of type ptrdiff_t.
5720
5721 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5722 less than 0x0500.
5723 (w32_msg_pump): Use WPARAM type for 'result'.
5724
5725 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5726 architecture.
5727 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5728 compatibility with x64.
5729
5730 * vm-limit.c (lim_data): Now size_t.
5731 (check_memory_limits): Adjust prototypes of real_morecore and
5732 __morecore to receive argument of type ptrdiff_t. Use size_t for
5733 five_percent and data_size.
5734
5735 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5736 variables, for compatibility with x64.
5737 (rva_to_section, offset_to_section, relocate_offset)
5738 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5739 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5740 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5741 for compatibility with x64.
5742
5743 * sysdep.c (STDERR_FILENO): Define if not already defined.
5744
5745 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5746 (__morecore): Argument type is now ptrdiff_t.
5747 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5748 (relinquish): Use ptrdiff_t type for 'excess'.
5749 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5750
5751 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5752 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5753 instead of a literal number.
5754
5755 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5756 (min): Define only if not already defined.
5757
5758 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5759 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5760 hosts.
5761
5762 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5763 'bitmaps' is a pointer.
5764
5765 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5766
5767 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5768
e7a2937b
PE
57692012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5770
5771 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5772 * dired.c (directory_files_internal, Ffile_attributes):
5773 New arg follow_symlinks. All uses changed.
5774
b43d62ae
SM
57752012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5776
5777 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5778
c06c382a
EZ
57792012-09-30 Eli Zaretskii <eliz@gnu.org>
5780
5781 Support atimers and CPU profiler via profile.c on MS-Windows.
5782 * w32proc.c (sig_mask, crit_sig): New static variables.
5783 (sys_signal): Support SIGALRM and SIGPROF.
5784 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5785 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5786 sigfillset, and sigprocmask are no longer no-ops.
5787 (sigismember): New function.
5788 (struct itimer_data): New definition.
5789 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5790 (crit_prof): New static variables.
5791 (MAX_SINGLE_SLEEP): New definition.
5792 (timer_loop, stop_timer_thread, term_timers, init_timers)
5793 (start_timer_thread, getitimer, setitimer): New functions.
5794 (alarm): No longer a no-op, calls setitimer.
5795
5796 * w32.c (term_ntproc): Call term_timers.
5797 (init_ntproc): Make sure all signals are unblocked at startup, to
5798 erase any traces of dumping. Call init_timers.
5799
5800 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5801 Windows-specific code to display the hourglass mouse pointer is no
5802 longer used.
5803 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5804 to hourglass timer expiration.
5805 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5806 Remove, no longer used.
b43d62ae
SM
5807 (w32_note_current_window, show_hourglass, hide_hourglass):
5808 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5809 window systems.
5810 (syms_of_w32fns): Don't initialize hourglass_timer.
5811
5812 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5813 WINDOWSNT as well.
5814 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5815
5816 * w32.h (init_timers, term_timers): Add prototypes.
5817
95402d5f
KH
58182012-09-30 Kenichi Handa <handa@gnu.org>
5819
5820 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5821 to the buffer relocation which may be caused by ccl_driver.
5822
dd946752
JD
58232012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5824
d7e642cc
JD
5825 * xfns.c (Fx_file_dialog): Update comment.
5826
5827 * w32fns.c (Fx_file_dialog): Update comment.
5828
5829 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5830 Initialize panel name field if OSX >= 10.6.
5831
5832 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5833
dd946752
JD
5834 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5835
5836 * nsterm.m (NEW_STYLE_FS): New define.
5837 (ns_fullscreen_hook, windowWillEnterFullScreen)
5838 (windowDidEnterFullScreen, windowWillExitFullScreen)
5839 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5840 (setFSValue): New functions.
5841 (EmacsFSWindow): New implementation.
5842 (canBecomeKeyWindow): New function for EmacsFSWindow.
5843 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5844 (dealloc): Release nonfs_window if in fullscreen.
5845 (updateFrameSize:): Call windowDidMove to update top/left.
5846 (windowWillResize:toSize:): Check if frame is still maximized.
5847 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5848 next_maximized, maximized_width, maximized_height and nonfs_window.
5849 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5850 tbar_height.
5851 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5852 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5853
5854 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5855 (EmacsView): Add variables for fullscreen.
5856 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5857 (EmacsFSWindow): New interface for fullscreen.
5858
427730eb
JB
58592012-09-30 Juanma Barranquero <lekktu@gmail.com>
5860
5861 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5862
48de8b12
CY
58632012-09-30 Chong Yidong <cyd@gnu.org>
5864
5865 * fns.c (Frandom): Doc fix.
5866
5938d519
MR
58672012-09-30 Martin Rudalics <rudalics@gmx.at>
5868
5869 * window.c (Vwindow_combination_limit): New default value.
5870 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5871
cb5b0266
PE
58722012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5873
5874 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5875 Suggested by Eli Zaretskii in
5876 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5877
84f72efd
EZ
58782012-09-30 Eli Zaretskii <eliz@gnu.org>
5879
5880 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5881 HAVE_TIMER_SETTIME is defined.
5882
9d4dcdc9
PE
58832012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5884
d89460ed
PE
5885 Profiler improvements: more-accurate timers, overflow checks.
5886 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5887 signal.h, setjmp.h. Include systime.h instead.
5888 (saturated_add): New function.
5889 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5890 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5891 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5892 New static vars.
84f72efd 5893 (enum profiler_cpu_running): New enum.
d89460ed
PE
5894 (profiler_cpu_running): Now of that enum type, not bool.
5895 All uses changed to store the new value.
5896 (handle_profiler_signal): Rename from sigprof_handler_1,
5897 for consistency with other handlers. Do not check whether
5898 cpu_log is a hash-table if garbage collecting, since it
5899 doesn't matter in that case.
5900 (deliver_profiler_signal): Rename from sigprof_handler,
5901 for consistency with other handlers.
5902 (setup_cpu_timer): New function, with much of what used to be in
5903 Fprofiler_cpu_start. Check for out-of-range argument.
5904 Prefer timer_settime if available, and prefer
5905 thread cputime clocks, then process cputime clocks, then
5906 monotonic clocks, to the old realtime clock. Use make_timeval
5907 to round more-correctly when falling back to setitimer.
5908 (Fprofiler_cpu_start): Use it.
5909 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5910 Don't assume that passing NULL as the 2nd argument of setitimer
5911 is the same as passing a pointer to all-zero storage.
5912 Ignore SIGPROF afterwards.
5913 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5914 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5915 non-fatal signal handlers. Ignore SIGPROF on startup.
5916 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5917 in profiler.c, since sysdep.c now uses it.
5918
9d4dcdc9
PE
5919 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5920 Suggested by Eli Zaretskii in
5921 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5922
8e5691a0
JB
59232012-09-29 Juanma Barranquero <lekktu@gmail.com>
5924
5925 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5926
e7c1b6ef
SM
59272012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5928
5929 * lisp.h (struct backtrace): Remove indirection for `function' field.
5930 * xdisp.c (redisplay_internal):
5931 * profiler.c (record_backtrace, sigprof_handler_1):
5932 * alloc.c (Fgarbage_collect):
5933 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5934 (Fbacktrace_frame): Adjust accordingly.
5935
e61d39cd 59362012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5937
5938 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5939 (Frun_hook_with_args_until_failure): Doc fixes.
5940
404043ea
EZ
59412012-09-28 Eli Zaretskii <eliz@gnu.org>
5942
5943 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5944 Qautomatic_redisplay and change the symbol name. All users changed.
5945
704d3f45
TM
59462012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5947
5948 * profiler.c (sigprof_handler): Fix race condition.
5949
757140ff
GM
59502012-09-28 Glenn Morris <rgm@gnu.org>
5951
5952 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5953
a615a3ae
PE
59542012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5955
5956 Check more robustly for timer_settime.
89d17fd0
PE
5957 * Makefile.in (LIB_TIMER_TIME): New macro.
5958 (LIBES): Add it.
a615a3ae
PE
5959 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5960 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5961 call timer_settime.
5962
3670daf7
TM
59632012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5964
5965 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5966
6a586b7f
JB
59672012-09-26 Juanma Barranquero <lekktu@gmail.com>
5968
5969 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5970
41c8bfcf
PE
59712012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5972
5973 * character.h (MAYBE_UNIFY_CHAR): Remove.
5974 * charset.c, charset.h (maybe_unify_char): Now static.
5975 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5976 Since this stuff is now private to charset.c, there's no need for
5977 a public macro and no need to inline by hand.
5978
3a880af4 59792012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
5980 Stefan Monnier <monnier@iro.umontreal.ca>
5981 Juanma Barranquero <lekktu@gmail.com>
611b7507 5982
3a880af4
SM
5983 * profiler.c: New file.
5984 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5985 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5986 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5987 * emacs.c (main): Call syms_of_profiler.
5988 * alloc.c (Qautomatic_gc): New constant.
5989 (MALLOC_PROBE): New macro.
5990 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5991 (total_bytes_of_live_objects): New function.
5992 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5993 Call malloc_probe for the memory profiler.
5994 (syms_of_alloc): Define Qautomatic_gc.
5995 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5996 race condition.
5997 (struct backtrace): Move definition...
5998 * lisp.h (struct backtrace): ..here.
5999 (Qautomatic_gc, profiler_memory_running): Declare vars.
6000 (malloc_probe, syms_of_profiler): Declare functions.
6001 * xdisp.c (Qautomatic_redisplay): New constant.
6002 (redisplay_internal): Record itself in backtrace_list.
6003 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 6004
5938d519 60052012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
60062012-09-25 Juanma Barranquero <lekktu@gmail.com>
6007
6008 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6009
e26fd2e4
PE
60102012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 Prefer POSIX timers if available.
6013 They avoid a race if the timer is too close to the current time.
6014 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6015 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 6016 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 6017
eedec3ee
EZ
60182012-09-25 Eli Zaretskii <eliz@gnu.org>
6019
6020 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6021 CHAR_STRING_ADVANCE.
6022 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6023 STRING_CHAR_ADVANCE.
6024
aa15c6bb
JB
60252012-09-25 Juanma Barranquero <lekktu@gmail.com>
6026
6027 Move Vlibrary_cache to emacs.c and reset before dumping.
6028
6029 * lisp.h (reset_image_types): Declare.
6030 [WINDOWSNT] (Vlibrary_cache): Declare.
6031
6032 * image.c (reset_image_types): New function.
6033
6034 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6035 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6036 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6037
6038 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6039 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6040
6041 * w32.h (Vlibrary_cache): Do not declare.
6042
54d629be
EZ
60432012-09-25 Eli Zaretskii <eliz@gnu.org>
6044
16b22fef
EZ
6045 * w32proc.c (sys_signal): Handle all signals defined by the
6046 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6047 handlers for signals supported by Windows. Don't override
6048 term_ntproc as the handler for SIGABRT.
6049 (sigaction): Rewrite to call sys_signal instead of duplicating its
6050 code.
6051 (sys_kill): Improve commentary.
6052
6053 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6054 consistency with a signature of a signal handler. All callers
6055 changed.
6056 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6057 install term_ntproc as a signal handler for SIGABRT, as that
6058 should be done by the dumped Emacs.
6059
6060 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6061
6062 * w32select.c (term_w32select): Protect against repeated
6063 invocation by setting clipboard_owner to NULL after calling
6064 DestroyWindow.
6065
6066 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6067 and term_ntproc to their modified signatures.
6068
54d629be
EZ
6069 * character.c (char_string, string_char): Remove calls to
6070 MAYBE_UNIFY_CHAR. See the discussion starting at
6071 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6072 for the details.
6073
59f7af81
CY
60742012-09-25 Chong Yidong <cyd@gnu.org>
6075
6076 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6077
22e8cf4a
SM
60782012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6079
6080 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6081 when encountering an unknown bytecode.
6082
578098f3
PE
60832012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6084
6085 image.c, indent.c: Use bool for booleans.
6086 * dispextern.h (struct image_type): Members valid_p, load, init
6087 now return bool, not int. All uses changed.
6088 * image.c: Omit unnecessary static decls.
6089 (x_create_bitmap_mask, x_build_heuristic_mask):
6090 Return void, not int, since callers don't care about the return value.
6091 (x_create_bitmap_mask, define_image_type, valid_image_p)
6092 (struct image_keyword, parse_image_spec, image_spec_value)
6093 (check_image_size, image_background)
6094 (image_background_transparent, x_clear_image_1)
6095 (postprocess_image, lookup_image, x_check_image_size)
6096 (x_create_x_image_and_pixmap, xbm_image_p)
6097 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6098 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6099 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6100 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6101 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6102 (png_image_p, init_png_functions, png_load_body, png_load)
6103 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6104 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6105 (init_gif_functions, gif_load, imagemagick_image_p)
6106 (imagemagick_load_image, imagemagick_load, svg_image_p)
6107 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6108 (gs_load):
6109 * nsimage.m (ns_load_image):
6110 * nsterm.m (ns_defined_color):
6111 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6112 * xfns.c (x_defined_color):
6113 * xterm.c (x_alloc_lighter_color_for_widget)
6114 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6115 (x_alloc_lighter_color):
6116 * indent.c (disptab_matches_widthtab, current_column)
6117 (scan_for_column, string_display_width, indented_beyond_p)
6118 (compute_motion, vmotion, Fvertical_motion):
6119 Use bool for booleans.
6120
a5f2b6ec
CY
61212012-09-24 Chong Yidong <cyd@gnu.org>
6122
6123 * chartab.c (Fset_char_table_default): Obsolete function removed.
6124
18e27ea8
PE
61252012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6126
afea8a8a
PE
6127 Move pid_t related decls out of lisp.h.
6128 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6129 (interruptible_wait_for_termination):
6130 Move these decls from lisp.h to syswait.h, since they use pid_t.
6131 Needed on FreeBSD; see Herbert J. Skuhra in
6132 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6133 * callproc.c: Include syswait.h.
6134
18e27ea8
PE
6135 gnutls.c, gtkutil.c: Use bool for boolean.
6136 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6137 (emacs_gnutls_handle_error):
6138 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6139 (xg_hide_tooltip, xg_create_frame_widgets)
6140 (create_dialog, xg_uses_old_file_dialog)
6141 (xg_get_file_with_chooser, xg_get_file_with_selection)
6142 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6143 (xg_item_label_same_p, xg_update_menubar)
6144 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6145 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6146 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6147 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6148 (update_frame_tool_bar, free_frame_tool_bar):
6149 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6150 * nsmenu.m (ns_update_menubar):
6151 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6152 * xfns.c (Fx_show_tip) [USE_GTK]:
6153 Use bool for boolean.
6154 * gtkutil.c (xg_update_frame_menubar):
6155 * xmenu.c (update_frame_menubar):
6156 Return void, not int, since caller ignores return value.
6157 * gtkutil.c (xg_change_toolbar_position):
6158 Return void, not 1.
6159
af0e9f75
JB
61602012-09-23 Juanma Barranquero <lekktu@gmail.com>
6161
6162 * makefile.w32-in (BLOCKINPUT_H): Remove.
6163 (SYSSIGNAL_H): New macro.
6164 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6165 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6166 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6167 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6168 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6169 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6170 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6171 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6172 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6173 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6174 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6175 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6176 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6177 ($(BLD)/w32xfns.$(O)): Update dependencies.
6178
5101529e
EZ
61792012-09-23 Eli Zaretskii <eliz@gnu.org>
6180
6181 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6182 fatal_error_backtrace.
6183
6184 * w32proc.c (sys_kill): Undo last change: don't do anything when
6185 invoked to deliver SIGABRT to our own process. This is now
6186 handled by emacs_raise.
6187
2c3ee0ad
JB
61882012-09-23 Juanma Barranquero <lekktu@gmail.com>
6189
6190 * w32term.c (w32_read_socket): Remove leftover reference to
6191 interrupt_input_pending.
6192
62a1d661
PE
61932012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6194
6195 Do not use SA_NODEFER.
6196 Problem reported by Dani Moncayo in
6197 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6198 * alloc.c (die):
6199 * sysdep.c (emacs_abort): Do not reset signal handler.
6200 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6201 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6202 wanted even on POSIXish hosts, and it doesn't work on Windows.
6203
a0942b9a
JD
62042012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6205
6206 * xterm.c (x_term_init): Call fixup_locale before and after calling
6207 gtk_init (Bug#12392).
6208
d07ff9db
CY
62092012-09-23 Chong Yidong <cyd@gnu.org>
6210
6211 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6212 Vdynamic_library_alist.
6213
6214 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6215 (Fgnutls_available_p): Caller changed.
6216
6217 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6218 (Flibxml_parse_xml_region): Likewise.
6219
6220 * dispextern.h (struct image_type): Remove arg from init function.
6221
6222 * image.c (Finit_image_library, lookup_image_type)
6223 (define_image_type): Remove now-unneeded second arg.
6224 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6225 (init_tiff_functions, init_gif_functions, init_svg_functions):
6226 Arglist and w32_delayed_load calling convention changed.
6227 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6228 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6229
4d7e6e51
PE
62302012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6231
6232 Simplify and avoid signal-handling races (Bug#12471).
6233 * alloc.c (die):
6234 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6235 Avoid recursive loop if there's a fatal error in the function itself.
6236 * atimer.c (pending_atimers):
6237 * blockinput.h: Don't include "atimer.h"; no longer needed.
6238 (interrupt_input_pending): Remove. All uses removed.
6239 pending_signals now counts both atimers and ordinary interrupts.
6240 This is less racy than having three separate pending-signal flags.
6241 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6242 (input_blocked_p):
6243 Rename from their upper-case counterparts BLOCK_INPUT,
6244 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6245 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6246 This makes it easier to access volatile variables more accurately.
6247 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6248 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6249 that's more reliable if the code is buggy and sets
6250 interrupt_input_blocked to a negative value. All uses changed.
6251 * atimer.c (deliver_alarm_signal):
6252 Remove. No need to deliver this to the parent; any thread can
6253 handle this signal now. All uses replaced by underlying handler.
6254 * atimer.c (turn_on_atimers):
6255 * dispnew.c (handle_window_change_signal):
6256 * emacs.c (handle_danger_signal):
6257 * keyboard.c (kbd_buffer_get_event):
6258 Don't reestablish signal handler; not needed with sigaction.
6259 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6260 (UNBLOCK_INPUT_TO):
6261 Rework to avoid unnecessary accesses to volatile variables.
6262 (UNBLOCK_INPUT_TO): Now a function.
6263 (totally_unblock_input, unblock_input): New decls.
6264 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6265 (init_data): Remove. Necessary stuff now done in init_signal.
6266 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6267 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6268 (fatal_error_code): Remove; no longer needed.
6269 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6270 it doesn't always backtrace. All uses changed. No need to reset
6271 signal to default, since sigaction and/or die does that for us now.
6272 Use emacs_raise (FOO), not kill (getpid (), FOO).
6273 (main): Check more-accurately whether we're dumping.
6274 Move fatal-error setup to sysdep.c
6275 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6276 * gtkutil.c (xg_get_file_name, xg_get_font):
6277 Remove no-longer-needed signal-mask manipulation.
6278 * keyboard.c, process.c (POLL_FOR_INPUT):
6279 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6280 * keyboard.c (read_avail_input): Remove.
6281 All uses replaced by gobble_input.
6282 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6283 (kbd_buffer_store_event_hold, gobble_input):
6284 (record_asynch_buffer_change) [USABLE_SIGIO]:
6285 (store_user_signal_events):
6286 No need to mess with signal mask.
6287 (gobble_input): If blocking input and there are terminals, simply
6288 set pending_signals to 1 and return. All hooks changed to not
6289 worry about whether input is blocked.
6290 (process_pending_signals): Clear pending_signals before processing
6291 them, in case a signal comes in while we're processing.
6292 By convention callers now test pending_signals before calling us.
6293 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6294 New functions, to support changes to blockinput.h.
6295 (handle_input_available_signal): Now extern.
6296 (reinvoke_input_signal): Remove. All uses replaced by
6297 handle_async_input.
6298 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6299 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6300 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6301 Clear sigmask reliably, even if Fsignal returns, which it can.
6302 Omit unnecessary accesses to volatile var.
6303 (quit_throw_to_read_char): No need to restore sigmask.
6304 * keyboard.c (gobble_input, handle_user_signal):
6305 * process.c (wait_reading_process_output):
6306 Call signal-handling code rather than killing ourselves.
6307 * lisp.h: Include <float.h>, for...
6308 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6309 (pending_signals): Now volatile.
6310 (syms_of_data): Now const if IEEE floating point.
6311 (handle_input_available_signal) [USABLE_SIGIO]:
6312 (terminate_due_to_signal, record_child_status_change): New decls.
6313 * process.c (create_process): Avoid disaster if memory is exhausted
6314 while we're processing a vfork, by tightening the critical section
6315 around the vfork.
6316 (send_process_frame, process_sent_to, handle_pipe_signal)
6317 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6318 ignores SIGPIPE.
6319 (send_process): No need for setjmp/longjmp any more, since the
6320 SIGPIPE stuff is now gone. Instead, report an error if errno
6321 is EPIPE.
6322 (record_child_status_change): Now extern. PID and W are now args.
6323 Return void, not bool. All callers changed.
6324 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6325 Remove. All uses removed. This bug should be fixed now in a
6326 different way.
6327 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6328 and record the child status change directly. This avoids the
6329 need to futz with the signal mask.
6330 (process_fatal_action): Move here from emacs.c.
6331 (emacs_sigaction_flags): New function, containing
6332 much of what used to be in emacs_sigaction_init.
6333 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6334 caught by emacs, to make races less likely.
6335 (deliver_process_signal): Rename from handle_on_main_thread.
6336 All uses changed.
6337 (BACKTRACE_LIMIT_MAX): Now at top level.
6338 (thread_backtrace_buffer, threadback_backtrace_pointers):
6339 New static vars.
6340 (deliver_thread_signal, deliver_fatal_thread_signal):
6341 New functions, for more-accurate delivery of thread-specific signals.
6342 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6343 (deliver_arith_signal): Handle in this thread, not
6344 in the main thread, since it's triggered by this thread.
6345 (maybe_fatal_sig): New function.
6346 (init_signals): New arg DUMPING so that we can be more accurate
6347 about whether we're dumping. Caller changed.
6348 Treat thread-specific signals differently from process-general signals.
6349 Block all signals while handling fatal error; that's safer.
6350 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6351 on IEEE hosts.
6352 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6353 Ignore SIGPIPE unless batch.
6354 (emacs_backtrace): Output backtrace for the appropriate thread,
6355 which is not necessarily the main thread.
6356 * syssignal.h: Include <stdbool.h>.
6357 (emacs_raise): New macro.
6358 * xterm.c (x_connection_signal): Remove; no longer needed
6359 now that we use sigaction.
6360 (x_connection_closed): No need to mess with sigmask now.
6361 (x_initialize): No need to reset SIGPIPE handler here, since
6362 init_signals does this for us now.
6363
8f4635e9
JD
63642012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6365
6366 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6367 background rect may be larger (Bug#12245).
8f4635e9 6368
3296976d
CY
63692012-09-23 Chong Yidong <cyd@gnu.org>
6370
6371 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6372
d41e491e
PE
63732012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6374
6375 * .gdbinit: Just stop at fatal_error_backtrace.
6376 See Stefan Monnier's request in
6377 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6378 Remove no-longer-used query of system type.
6379
c88b867f
CY
63802012-09-22 Chong Yidong <cyd@gnu.org>
6381
6382 * search.c (Freplace_match): Doc fix (Bug#12325).
6383
6384 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6385
6386 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6387 (Fline_end_position): Doc fix.
6388
6389 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6390
bb4d86b4
CY
63912012-09-22 Chong Yidong <cyd@gnu.org>
6392
6393 * dispextern.h (struct image_type): Add new slot, storing a type
6394 initialization function.
6395
6396 * image.c (define_image_type): Call the image initializer function
6397 if it is defined. Arguments and return value changed.
6398 (valid_image_p, make_image): Callers changed.
6399 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6400 (gif_type, imagemagick_type, svg_type, gs_type):
6401 Add initialization functions.
bb4d86b4
CY
6402 (Finit_image_library): Call lookup_image_type.
6403 (CHECK_LIB_AVAILABLE): Macro deleted.
6404 (lookup_image_type): Call define_image_type here, rather than via
6405 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6406 (syms_of_image): Move define_image_type calls for xbm_type and
6407 pbm_type to lookup_image_type.
6408
df9685f3
EZ
64092012-09-22 Eli Zaretskii <eliz@gnu.org>
6410
6411 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6412 'idle_timers' from here ...
6413 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6414 lists, to avoid infloops when the timer does something stupid,
6415 like reinvoke itself with the same or smaller time-out.
6416 (Bug#12447)
6417
8e17c9ba
MR
64182012-09-22 Martin Rudalics <rudalics@gmx.at>
6419
6420 * window.c (Fsplit_window_internal): Handle only Qt value of
6421 Vwindow_combination_limit separately.
6422 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6423 (Vwindow_combination_limit): New default value.
6424 Rewrite doc-string.
8e17c9ba 6425
589bd69b
EZ
64262012-09-22 Eli Zaretskii <eliz@gnu.org>
6427
6428 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6429 the new overlay string. (Bug#10159)
6430
01108e3f
PE
64312012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6434 or that fprintf is async-signal-safe. POSIX doesn't require
6435 either assumption.
6436
82f8cd94
CY
64372012-09-22 Chong Yidong <cyd@gnu.org>
6438
6439 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6440 (Bug#8207).
6441
3cccbd87
KH
64422012-09-22 Kenichi Handa <handa@gnu.org>
6443
6444 * composite.c (composition_reseat_it): Handle the case that a
6445 grapheme cluster is not covered by a single font (Bug#12352).
6446
09c01941
CY
64472012-09-21 Chong Yidong <cyd@gnu.org>
6448
6449 * image.c (define_image_type): Avoid adding duplicate types to
6450 image_types (Bug#12463). Suggested by Jörg Walter.
6451
acfa068f 64522012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6453
6454 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6455 (print_load_command_name): Add case LC_DATA_IN_CODE.
6456 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6457
acfa068f 64582012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6459
6460 * eval.c (Frun_hook_with_args_until_success)
6461 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6462
acfa068f 64632012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6464
6465 * fileio.c (Ffile_selinux_context): Only call freecon when
6466 lgetfilecon succeeded.
6467 (Fset_file_selinux_context): Likewise. (Bug#12444)
6468
acfa068f 64692012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6470
6471 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6472 reordering, locate the cursor by calling set_cursor_from_row; if
6473 that fails, clear the desired glyph matrix before returning a
6474 failure indication to the caller. Fixes leaving garbled display
6475 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6476 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6477 scrolling through multibyte text.
aa36e4d2 6478
e99f70c8
SM
64792012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6480
6481 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6482 calling mark_vectorlike since that's the one that marks the window.
6483 (mark_discard_killed_buffers): Mark the final cdr.
6484 * window.h (struct window): Move prev/next_buffers to the
6485 non-standard fields.
6486 * window.c (make_window): Initialize prev/next_buffers manually.
6487
f75beb47
PE
64882012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6489
6490 Omit unused arg EXPECTED from socket hooks.
6491 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6492 * nsterm.m (ns_term_init):
6493 * termhooks.h (struct terminal.read_socket_hook):
6494 * w32inevt.c (w32_console_read_socket):
6495 * w32term.c (w32_read_socket):
6496 * xterm.c (XTread_socket):
6497 Omit unused arg EXPECTED. All callers changed.
6498 (store_user_signal_events): Return void, not int, since callers no
6499 longer care about the return value. All uses changed.
6500
b019b76a
JB
65012012-09-20 Juanma Barranquero <lekktu@gmail.com>
6502
6503 * w32gui.h (XParseGeometry): Do not declare.
6504
05642592
PE
65052012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6506
e4bce92a 6507 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6508 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6509 <http://bugs.gnu.org/12471#8> (last line).
6510
05642592
PE
6511 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6512 (XParseGeometry): Now static. Substitute extremal values for
6513 values that are out of range.
6514
e543ae91
JD
65152012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6516
6517 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6518
6519 * nsfns.m (XParseGeometry): Remove.
6520 (Fx_create_frame): Call x_set_offset to correctly interpret
6521 top_pos in geometry.
6522
3a880af4 6523 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6524 (Fx_parse_geometry): If there is a space in string, call
6525 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6526
45ba16c7
EZ
65272012-09-17 Eli Zaretskii <eliz@gnu.org>
6528
c8b9f1bc
EZ
6529 * search.c (scan_buffer): Use character positions in calls to
6530 region_cache_forward and region_cache_backward, not byte
6531 positions. (Bug#12196)
6532
b4c932a2
EZ
6533 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6534 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6535
45ba16c7
EZ
6536 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6537 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6538 emacs_blocked_malloc, now deleted.
6539
eeceac93
PE
65402012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6543 The workaround was for improving performance on Solaris 2.4, but
6544 is getting in the way now. Emacs will still work if someone is
6545 still running Solaris 2.4 in a museum somewhere; Sun dropped
6546 support for Solaris 2.4 in 2003.
6547 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6548 * process.c (create_process) [HAVE_WORKING_VFORK]:
6549 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6550 since Emacs no longer uses vfork on that platform.
6551
78f83752
GM
65522012-09-17 Glenn Morris <rgm@gnu.org>
6553
6554 * emacs.c: Use COPYRIGHT.
6555
634b8cac
PE
65562012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6557
0caaedb1
PE
6558 Remove configure's --without-sync-input option (Bug#12450).
6559 When auditing signal-handling in preparation for cleaning it up,
6560 I found that SYNC_INPUT has race conditions and would be a real
6561 pain to fix. Since it's an undocumented and deprecated
6562 configure-time option, now seems like a good time to remove it.
6563 Also see <http://bugs.gnu.org/11080#16>.
6564 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6565 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6566 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6567 (malloc_hysteresis):
6568 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6569 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6570 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6571 (dont_register_blocks, bytes_used_when_reconsidered)
6572 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6573 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6574 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6575 Remove. All uses removed.
0caaedb1
PE
6576 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6577 implementation, one that depends on whether the new macro
6578 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6579 is defined.
6580 * atimer.c (run_timers, handle_alarm_signal):
6581 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6582 (handle_async_input, process_pending_signals)
6583 (handle_input_available_signal, init_keyboard):
6584 * nsterm.m (ns_read_socket):
6585 * process.c (wait_reading_process_output):
6586 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6587 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6588 (emacs_write):
6589 * xterm.c (XTread_socket):
6590 Assume SYNC_INPUT.
6591 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6592 * eval.c (handling_signal): Remove. All uses removed.
6593 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6594 All uses replaced with the SYNC_INPUT version.
6595 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6596 Remove decls.
6597 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6598 Now static.
6599
634b8cac
PE
6600 * font.c (Ffont_shape_gstring): Remove unused local.
6601
83da1b55
GM
66022012-09-16 Glenn Morris <rgm@gnu.org>
6603
518650a5
GM
6604 * Makefile.in (clean): No longer run nextstep's clean.
6605
83da1b55
GM
6606 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6607 (ns_frag): Remove.
6608 (ns-app): Move here from ns.mk, and simplify.
6609 (clean): Simplify nextstep entry.
6610 * ns.mk: Remove file.
6611
85a43e2e
KH
66122012-09-17 Kenichi Handa <handa@gnu.org>
6613
6614 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6615 not covert the last few charactes.
6616
ba13e616 66172012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6618
6619 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6620 here, but just check the validity of glyphs in the glyph-string.
6621
a8c729af
MR
66222012-09-16 Martin Rudalics <rudalics@gmx.at>
6623
3a880af4
SM
6624 * window.c (Fwindow_parameter, Fset_window_parameter):
6625 Accept any window as argument (Bug#12452).
a8c729af 6626
c077c059
JD
66272012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6628
6629 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6630 to ns_term_init to avoid memory leak.
6631
6632 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6633 explicit retain/release.
6634 (ns_term_init): Only allow one display. Initialize outerpool and
6635 ns_*_types.
6636
39a57ad0
PE
66372012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6640 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6641 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6642 the Microsoft problem in a different way, by altering ../nt/config.nt.
6643
7105c8cb
EZ
66442012-09-15 Eli Zaretskii <eliz@gnu.org>
6645
6646 * w32xfns.c:
6647 * w32uniscribe.c:
6648 * w32term.c:
6649 * w32select.c:
6650 * w32reg.c:
6651 * w32proc.c:
6652 * w32menu.c:
6653 * w32inevt.c:
6654 * w32heap.c:
6655 * w32font.c:
6656 * w32fns.c:
6657 * w32console.c:
6658 * w32.c:
6659 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6660 by lisp.h. This completes removal of setjmp.h inclusion
6661 erroneously announced in the previous commit. (Bug#12446)
6662
6663 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6664 more accurate.
6665
6666 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6667 not defined as a macro. The latter happens on MS-Windows.
6668 (Bug#12446)
6669
0328b6de
PE
66702012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6671
6672 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6673 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6674 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6675 only reason for the instance was because "lisp.h" was included.
6676 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6677 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6678 and _longjmp with the new symbols. Emacs already uses _setjmp if
6679 available, so this change affects only POSIXish hosts that have
6680 sigsetjmp but not _setjmp, such as some versions of Solaris and
6681 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6682 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6683 (png_load_body) [HAVE_PNG]:
6684 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6685 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6686 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6687 since PNG requires jmp_buf. This is the only exception to the
6688 general rule that we now use sys_setjmp and sys_longjmp.
6689 This exception is OK since this code does not change the signal
6690 mask or longjmp out of a signal handler.
6691
2af03429
PE
66922012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6693
6694 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6695 Include "syssignal.h", for 'main_thread'.
6696
2f294edf
DA
66972012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6698
6699 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6700 * insdel.c (replace_range, replace_range_2):
6701 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6702 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6703 Remove redundant check before calling offset_intervals.
6704
6b533e9c
MR
67052012-09-14 Martin Rudalics <rudalics@gmx.at>
6706
6707 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6708 current buffer (Bug#12387).
6709
2a7931e3
JB
67102012-09-14 Juanma Barranquero <lekktu@gmail.com>
6711
6712 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6713
c18e885b
PE
67142012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6715
6716 Use a more backwards-compatible timer format (Bug#12430).
6717 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6718 vector element, not from the 4th, since PSECS is now at the end.
6719 (Fcurrent_idle_time): Doc fix.
6720
d59a1afb
DA
67212012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6722
6723 Function to mark objects and remove killed buffers at once.
6724 * alloc.c (discard_killed_buffers): Rename to ...
6725 (mark_discard_killed buffers) ... new name. Add marking
6726 of remaining objects. Fix comment. Adjust users.
6727 (mark_object): Do not touch frame buffer lists here.
6728 * frame.c (delete_frame): Reset frame buffer lists here.
6729
5f0cb45a
PE
67302012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6731
8ea47e3a
PE
6732 Better workaround for GNOME bug when --enable-gcc-warnings.
6733 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6734 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6735 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6736
4a4bbad2
PE
6737 Simplify SIGIO usage (Bug#12408).
6738 The code that dealt with SIGIO was crufty and confusing, e.g., it
6739 played tricks like "#undef SIGIO" but these tricks were not used
6740 consistently. Simplify mostly by not #undeffing standard symbols,
6741 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6742 or not as we please) rather than "defined SIGIO" (standard symbol
6743 that we probably shouldn't #undef).
6744 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6745 Modules that need it can include it.
6746 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6747 * dispextern.h (ignore_sigio): New decl.
6748 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6749 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6750 * emacs.c (shut_down_emacs):
6751 * keyboard.c (kbd_buffer_store_event_hold):
6752 Use ignore_sigio rather than invoking 'signal' directly.
6753 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6754 for FIONREAD.
6755 (FIONREAD, SIGIO): Do not #undef.
6756 (tty_read_avail_input): Use #error rather than a syntax error.
6757 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6758 for I_PIPE, used by SETUP_SLAVE_PTY.
6759 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6760 * sysdep.c (croak): Remove; no longer needed. This bit of
6761 temporary code, with Fred N. Fish's comment that it's temporary,
6762 has been in Emacs since at least 1992!
6763 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6764 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6765 * syssignal.h (croak): Remove decl.
6766 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6767 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6768 now that we're termios-only.
6769 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6770 * term.c (dissociate_if_controlling_tty): Use #error rather than
6771 a run-time error.
6772
5f0cb45a
PE
6773 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6774 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6775 to work around GNOME bug 683906.
6776 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6777 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6778 This works around GCC bug 54561.
6779
40bce90b
PE
67802012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 More fixes for 'volatile' and setjmp/longjmp.
6783 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6784 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6785 (png_load_body) [HAVE_PNG]:
6786 (jpeg_load_body) [HAVE_JPEG]:
6787 New function, with most of the old parent function's body.
6788 (png_load) [HAVE_PNG]:
6789 (jpeg_load) [HAVE_JPEG]:
6790 Invoke the new function, to avoid longjmp munging our locals.
6791 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6792 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6793 longjmp is passed 2, as the C standard doesn't guarantee this.
6794 Instead, store the failure code into mgr->failure_code.
6795
bfeae2cf
SM
67962012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6797
6798 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6799 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6800 (syms_of_keyboard): Remove support for unread-command-char.
6801
8099e36b
EZ
68022012-09-12 Eli Zaretskii <eliz@gnu.org>
6803
6804 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6805 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6806 violation. (Bug#12426)
6807
92547ff9
PE
68082012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6811
45b82ad0
SM
68122012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6813
6814 * eval.c: Add `inhibit-debugger'.
6815 (Qinhibit_debugger): New symbol.
6816 (call_debugger): Bind it instead of Qdebug_on_error.
6817 (maybe_call_debugger): Test Vinhibit_debugger.
6818 (syms_of_eval): Define inhibit-debugger.
6819 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6820 (syms_of_xdisp): Remove inhibit-debug-on-message.
6821
5779a1dc
PE
68222012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6823
50f2e553
PE
6824 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6825 If a nonvolatile local variable is written before a _longjmp to
6826 the frame containing the variable, and is read after the _longjmp,
6827 the value read is indeterminate. Some local variables of type
6828 'struct handler' and 'struct catchtag' are used in this way, so
6829 mark each of their slots as volatile if the slot can be set before
6830 _longjmp and read afterwards.
6831 * lisp.h (struct handler): var and chosen_clause are now volatile.
6832 (struct catchtag): val, next, and pdlcount are now volatile.
6833
ae1d87e2
PE
6834 * bidi.c (bidi_push_it, bidi_pop_it):
6835 * fns.c (copy_hash_table):
6836 * image.c (define_image_type):
6837 * keyboard.c (kbd_buffer_store_event_hold):
6838 * process.c (Fprocess_send_eof):
6839 * xfaces.c (x_create_gc) [HAVE_NS]:
6840 * xgselect.c (xg_select):
6841 Prefer assignment to memcpy when either will do.
6842
5779a1dc
PE
6843 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6844 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6845 time an item is removed. No need to mark this function 'inline';
6846 the compiler knows better than we do.
6847
c4c9756b
JD
68482012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6849
6850 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6851 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6852 to change_frame_size (Bug#12388).
6853 (windowDidResize:): Pass YES to updateFrameSize.
6854
6855 * nsterm.h: Add delay parameter to updateFrameSize.
6856
d73e321c
DA
68572012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6858
6859 Discard killed buffers from deleted window and frame objects.
6860 This reduces an amount of references to killed buffers and
6861 helps GC to reclaim them faster.
6862 * alloc.c (discard_killed_buffers): New function.
6863 (mark_object): Use it for deleted windows and frames.
6864 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6865 or deleted frame, restore its global binding.
d73e321c
DA
6866 * data.c (swap_in_global_binding): Add GC notice.
6867 (swap_in_symval_forwarding): Use convenient set_blv_where.
6868 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6869 * window.h: ... to here.
6870
e578f381
DA
68712012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6872
6873 Convenient macro to check whether the buffer is live.
6874 * buffer.h (BUFFER_LIVE_P): New macro.
6875 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6876 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6877
3057e615
YM
68782012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6879
6880 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6881 composition cases (Bug#12364).
6882
6883 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6884 overhang of succeeding glyphs overlapping box cursor.
6885
6886 * w32term.c (x_draw_glyph_string): Likewise.
6887
6fda35f2
PE
68882012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6889
c990426a
PE
6890 Simplify, document, and port floating-point (Bug#12381).
6891 The porting part of this patch fixes bugs on non-IEEE platforms
6892 with frexp, ldexp, logb.
6893 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6894 Now static.
6895 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6896 support, by removing commented-out code and briefly listing the
6897 C89 functions excluded. The commented-out stuff was confusing
6898 maintenance, e.g., we thought we needed cbrt but it was commented out.
6899 (logb): Remove decl; no longer needed.
6900 (isfinite): New macro, if not already supplied.
6901 (isnan): Don't replace any existing macro.
6902 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6903 are present on all C89 platforms.
6904 (Ffrexp): Do not special-case zero, as frexp does the right thing
6905 for that case.
6906 (Flogb): Do not use logb, as it doesn't have the desired meaning
6907 on hosts that use non-base-2 floating point. Instead, stick with
6908 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6909 frexp, to avoid getting an unspecified result.
6910
6fda35f2
PE
6911 * xdisp.c (Qinhibit_debug_on_message): Now static.
6912
16130a58
JD
69132012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6914
6915 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6916 NSBezierPath (Bug#12131).
6917
d105a573
CY
69182012-09-10 Chong Yidong <cyd@gnu.org>
6919
6920 * fns.c (Fdelq, Fdelete): Doc fix.
6921
ff55dfe8
PE
69222012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6925 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6926
e7032e7c
SM
69272012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6928
6929 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6930 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6931 Use it.
6932
e9957956
EZ
69332012-09-09 Eli Zaretskii <eliz@gnu.org>
6934
aba05ce9
EZ
6935 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6936 left fringe if the window has a left margin. This avoids leaving
6937 traces of the cursor because its leftmost pixel is not drawn over.
6938
e9957956
EZ
6939 * dispnew.c (update_window_line): When the left margin area of a
6940 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6941 that screen line. (Bug#12277)
6942
f6196b87
PE
69432012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6944
6945 Assume C89 or later for math functions (Bug#12381).
6946 This simplifies the code, and makes it a bit smaller and faster,
6947 and (most important) makes it easier to clean up signal handling
6948 since we can stop worring about floating-point exceptions in
6949 library code. That was a problem before C89, but the problem
6950 went away many years ago on all practical Emacs targets.
6951 * data.c, image.c, lread.c, print.c:
6952 Don't include <math.h>; no longer needed.
6953 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6954 might be autoconfigured, as that never happens.
6955 * data.c (fmod):
6956 * doprnt.c (DBL_MAX_10_EXP):
6957 * print.c (DBL_DIG):
6958 Remove. C89 or later always defines these.
6959 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6960 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6961 (arith_error, domain_error, domain_error2):
6962 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6963 no longer needed -- we simply return what C returns. All uses removed.
6964 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6965 the wrapped code.
6966 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6967 Remove. All uses expanded, as these macros are no longer used
6968 more than once and are now more trouble than they're worth.
6969 (Ftan): Use tan, not sin / cos.
6970 (Flogb): Assume C89 frexp.
6971 (fmod_float): Assume C89 fmod.
6972 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6973 (init_floatfns): Remove. All uses removed.
6974
9d7f1863
JD
69752012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6976
6977 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6978 compositeToPoint for OSX < 10.6 (Bug#12390).
6979
eabf0404
PE
69802012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6983 This produces more-accurate results.
6984
0b3b1d23
JD
69852012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6986
6987 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6988 changes (Bug#12088).
6989
6dcef6ec
CY
69902012-09-08 Chong Yidong <cyd@gnu.org>
6991
6992 * syntax.c (Fstring_to_syntax): Doc fix.
6993
aa7d57c5
JD
69942012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6995
6996 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6997 in the internal border.
6998 (x_set_window_size): Remove static variables and their usage.
6999 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
7000 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7001 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
7002 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7003 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7004 (ns_fix_rect_ibw): Remove.
7005 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7006 (ns_dumpglyphs_box_or_relief): Ditto.
7007 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7008 adjustment.
7009 (ns_dumpglyphs_image): Ditto.
fc0c31f8 7010 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
7011 border adjustment.
7012 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7013 their usage. Add fringe_extended_p and its use as in other terms.
7014 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7015 scroll bar was removed.
7016 (updateFrameSize): New function.
7017 (windowDidResize): Move code to updateFrameSize and call it.
7018
7019 * nsterm.h (EmacsView): Add updateFrameSize.
7020
1a5432bc
CY
70212012-09-07 Chong Yidong <cyd@gnu.org>
7022
b4f5313e
CY
7023 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7024
1a5432bc
CY
7025 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7026
1a4f1e9b
PE
70272012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
7030 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7031 Problem introduced when merging patches. Noted by Eli Zaretskii in
7032 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
7033 * floatfns.c: Comment fix.
7034 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7035 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7036 and anyway the declaration is harmless even if SIGDANGER is not defined.
7037 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7038 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7039 source files not surprisingly expected syssignal.h to define, or
7040 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7041 Include <sys/ioctl.h>, for FIONREAD.
7042 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7043 This eliminates a problem whereby other files mysteriously had
7044 to include "syssignal.h" before including "systty.h" if they
7045 wanted to use "#ifdef SIGIO".
7046
bc8000ff
EZ
70472012-09-07 Eli Zaretskii <eliz@gnu.org>
7048
3e6d6928
EZ
7049 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7050
7051 * w32.c (sigemptyset): Empty the set.
7052 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7053
bc8000ff
EZ
7054 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7055
b4fa72f2
DA
70562012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7057
7058 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7059 (mark_object): Likewise for frame objects.
7060
30730c93
PE
70612012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 * syssignal.h (handle_on_main_thread): Always declare,
7064 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7065 This ports to platforms without HAVE_PTHREAD.
7066
2fe28299
PE
70672012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 Signal-handler cleanup (Bug#12327).
7070 Emacs's signal handlers were written in the old 4.2BSD style with
7071 sigblock and sigmask and so forth, and this led to some
7072 inefficiencies and confusion. Rewrite these to use
7073 pthread_sigmask etc. without copying signal sets around. Also,
7074 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7075 'signal', and instead use functions that do not attempt to take
7076 over the system name space. This patch causes Emacs's text
7077 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7078 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7079 Do not include <signal.h> or "syssignal.h", as these
7080 modules do not use signals.
7081 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7082 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7083 Do not include <signal.h>, as "syssignal.h" does that for us now.
7084 * atimer.c (sigmask_atimers): New function.
7085 (block_atimers, unblock_atimers): New functions,
7086 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7087 All uses replaced.
7088 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7089 no longer needed here.
7090 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 7091 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
7092 * sysdep.c (struct save_signal): New member 'action', replacing
7093 old member 'handler'.
7094 (save_signal_handlers, restore_signal_handlers):
7095 Use sigaction instead of 'signal' to save and restore.
7096 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7097 New function. All users of 'signal' modified to use set_sighandler
7098 if they're writeonly, and to use sys_signal if they're read+write.
7099 (emacs_sigaction_init, forwarded_signal): New functions.
7100 (sys_signal): Remove. All uses replaced by calls to sigaction
7101 and emacs_sigaction_init, or by direct calls to 'signal'.
7102 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7103 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7104 all uses replaced by pthread_sigmask etc. calls.
7105 * syssignal.h: Include <signal.h>.
7106 (emacs_sigaction_init, forwarded_signal): New decls.
7107 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7108 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7109 (sigmask, sys_sigmask): Remove; no longer needed.
7110 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7111 (sigblock, sigunblock, sigfree):
7112 (sigsetmask) [!defined sigsetmask]:
7113 Remove. All uses replaced by pthread_sigmask.
7114 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7115 no longer need to be replaced, and its typical old uses
7116 are now done via emacs_sigaction_init and sigaction.
7117 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7118 (sys_sigdel): Remove; unused.
7119 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7120
0216c128
EZ
71212012-09-06 Eli Zaretskii <eliz@gnu.org>
7122
7123 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7124 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7125
c752cfa9
DA
71262012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7127
7128 Explicitly mark buffer_defaults and buffer_local_symbols.
7129 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7130 mark_local_symbols here.
7131 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7132 since special buffers aren't marked here any more.
7133 (allocate_buffer): Chain new buffer with all_buffers here...
7134 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7135 not here.
7136 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7137 (syms_of_buffer): Remove staticpro of the above.
7138 (init_buffer_once): Set names for buffer_defaults and
7139 buffer_local_symbols.
7140
a864ef14
PE
71412012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7142
7143 Use bool for booleans in font-related modules.
7144 * font.c (font_intern_prop, font_style_to_value)
7145 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7146 (generate_otf_features, font_check_otf_features, font_check_otf)
7147 (font_match_p, font_list_entities, font_at):
7148 * fontset.c (fontset_id_valid_p, reorder_font_vector
7149 (fontset_find_font, Fset_fontset_font)
7150 (face_suitable_for_char_p) [0]:
7151 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7152 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7153 (m17n_flt_initialized, ftfont_shape_by_flt):
7154 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7155 * nsfont.m (nsfont_draw):
7156 * w32font.c (w32font_draw):
7157 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7158 Use bool for booleans.
7159 * font.h: Adjust to above API changes.
7160 (struct font, struct font_driver, struct font_driver_list):
7161 Use bool for booleans.
7162 (struct font): Remove useless member encoding_type.
7163 All users removed.
7164 * fontset.c, xftfont.c: Omit unnecessary static decls.
7165
0699fc18
DA
71662012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7167
7168 * alloc.c (mark_object): Revert window marking code
7169 since it's unsafe for the Fset_window_configuration.
7170
20ef56db
PE
71712012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7172
2fe28299 7173 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7174 Be more systematic about preserving errno whenever a signal
7175 handler returns, even if it's not in the main thread. Do this by
7176 renaming signal handlers to distinguish between signal delivery
7177 and signal handling. All uses changed.
7178 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7179 * data.c (deliver_arith_signal): Rename from arith_error.
7180 * dispnew.c (deliver_window_change_signal): Rename from
7181 window_change_signal.
7182 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7183 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7184 * keyboard.c (deliver_input_available_signal): Rename from
7185 input_available_signal.
7186 (deliver_user_signal): Rename from handle_user_signal.
7187 (deliver_interrupt_signal): Rename from interrupt_signal.
7188 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7189 (deliver_child_signal): Rename from sigchld_handler.
7190 * atimer.c (handle_alarm_signal):
7191 * data.c (handle_arith_signal):
7192 * dispnew.c (handle_window_change_signal):
7193 * emacs.c (handle_fatal_signal, handle_danger_signal):
7194 * keyboard.c (handle_input_available_signal):
7195 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7196 * process.c (handle_pipe_signal, handle_child_signal):
7197 New functions, with the actual signal-handling code taken from the
7198 original respective signal handlers, sans the sporadic attempts to
7199 preserve errno, since that's now done by handle_on_main_thread.
7200 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7201 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7202 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7203 Move to sysdep.c.
7204 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7205 Move initialization of main_thread to sysdep.c's init_signals.
7206 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7207 our usage, and simplifies the mainline code.
7208 (record_child_status_change): New static function, as a helper
7209 for handle_child_signal, and with most of the old child handler's
7210 contents.
7211 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7212 (handle_child_signal): Use the above.
7213 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7214 Moved here from emacs.c.
7215 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7216 code moved here from emacs.c's main function.
7217 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7218 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7219 This lets callers save and restore errno properly.
20ef56db 7220
e3ccf108
DA
72212012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7222
7223 Remove redundant or unused things here and there.
7224 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7225 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7226 * editfns.c (Fcompare_buffer_substrings): Likewise.
7227 * frame.h (struct terminal, struct font_driver_list):
7228 Remove redundant declarations.
7229 * window.h (Qleft, Qright): Likewise.
7230
697e1e39
DA
72312012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7232
7233 Do not mark objects from deleted buffers, windows and frames.
7234 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7235 (mark_object): Likewise for windows and frames.
7236
c1ca42ca
DA
72372012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7238
7239 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7240 buffer_defaults and buffer_local_symbols as valid objects.
7241 Return special value to denote them.
7242
014d93be
PE
72432012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7244
f75d7a91
PE
7245 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7246 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7247 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7248 (file_name_absolute_p, Fsubstitute_in_file_name):
7249 (check_executable, check_writable, Ffile_accessible_directory_p)
7250 (Fset_file_selinux_context, Fdefault_file_modes)
7251 (Finsert_file_contents, choose_write_coding_system)
7252 (Fwrite_region, build_annotations, a_write, e_write)
7253 (Fdo_auto_save):
7254 * filelock.c (boot_time_initialized, get_boot_time)
7255 (get_boot_time_1, lock_file_1, within_one_second):
7256 * floatfns.c (in_float):
7257 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7258 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7259 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7260 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7261 * window.c (compare_window_configurations):
7262 Use bool for booleans.
7263 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7264 (Fdefault_file_modes): Now mode_t, not int, for modes.
7265 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7266 (internal_delete_file): Now returns void, not a (boolean) int,
7267 since nobody was looking at the return value.
7268 * lisp.h, window.h: Adjust to above API changes.
7269
014d93be
PE
7270 * xdisp.c (set_message): Simplify and reindent last change.
7271
776f29e1
JB
72722012-09-05 Juanma Barranquero <lekktu@gmail.com>
7273
7274 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7275
7f7e0167
LI
72762012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7277
7278 * eval.c (call_debugger): Make the function non-static so that we
7279 can call it from set_message.
7280
7281 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7282 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7283
cf29dd84
PE
72842012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 Give more-useful info on a fatal error (Bug#12328).
7287 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7288 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7289 of doing the work ourselves.
7290 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7291 do most of the work.
7292 (fatal_error_backtrace): New function, taken from the guts
7293 of the old fatal_error_signal, but with a new option to output
7294 a backtrace.
7295 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7296 info about the signal than just its number.
7297 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7298 * sysdep.c: Include <execinfo.h>
7299 (emacs_backtrace): New function, taken partly from the previous
7300 code of the 'die' function.
7301 (emacs_abort): Call fatal_error_backtrace rather than abort.
7302
972debf2
SM
73032012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7304
7305 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7306 eager (load-time) macro-expansion.
7307 * lisp.mk (lisp): Add macroexp.
7308
1088b922
PE
73092012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7310
7311 Simplify redefinition of 'abort' (Bug#12316).
7312 Do not try to redefine the 'abort' function. Instead, redo
7313 the code so that it calls 'emacs_abort' rather than 'abort'.
7314 This removes the need for the NO_ABORT configure-time macro
7315 and makes it easier to change the abort code to do a backtrace.
7316 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7317 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7318 Remove; sysdep.c's emacs_abort now takes its place.
7319 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7320 'abort' changed to use 'emacs_abort'.
7321 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7322 (abort) [!defined abort]: Rename to ...
7323 (emacs_abort): ... new name.
7324 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7325 the place of the old 'abort' in emacs.c.
7326 * w32.c, w32fns.c (abort): Do not #undef.
7327 * w32.c (emacs_abort): Rename from w32_abort.
7328
30934d33
EZ
73292012-09-04 Eli Zaretskii <eliz@gnu.org>
7330
7331 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7332 offsets[j].dv, since the y axis of the screen coordinates points
7333 down, while the y axis of the font definition coordinates points
7334 up. This fixes display of Arabic diacritics such as KASRA and
7335 KASRATAN. (Bug#11860)
7336
af26b72c
PE
73372012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7338
7339 Be more systematic about _setjmp vs setjmp.
7340 * alloc.c (test_setjmp, mark_stack):
7341 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7342 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7343 (png_load, my_error_exit, jpeg_load):
7344 * process.c (send_process_trap, send_process):
7345 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7346 The underscored versions are up to 30x faster on some hosts.
7347 Formerly, the code used setjmp+longjmp sometimes and
7348 _setjmp+_longjmp at other times, with no particular reason to
7349 prefer setjmp+longjmp.
7350
26d4541d
PE
73512012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7352
d42f4f0f 7353 Fix minor problem found by static checking.
26d4541d 7354 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7355
c5e28e39
MR
73562012-09-03 Martin Rudalics <rudalics@gmx.at>
7357
7358 * buffer.c (Fdelete_all_overlays): New function.
7359
3eab3ca9
CY
73602012-09-03 Chong Yidong <cyd@gnu.org>
7361
7362 * gtkutil.c: Add extern decl for Qxft.
7363
c04889f8
PE
73642012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7365
1882aa38
PE
7366 * emacs.c, eval.c: Use bool for boolean.
7367 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7368 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7369 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7370 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7371 (main, decode_env_path, Fdaemon_initialized):
7372 * eval.c (call_debugger, Finteractive_p, interactive_p):
7373 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7374 (maybe_call_debugger, Fbacktrace):
7375 * process.c (read_process_output, exec_sentinel):
7376 Use bool for booleans.
7377 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7378 All callers changed.
7379 * eval.c (interactive_p): Omit always-true boolean argument
7380 EXCLUDE_SUBRS_P. All callers changed.
7381 * dispextern.h, lisp.h: Reflect above API changes.
7382 * firstfile.c (dummy): Use the address of 'main', whose signature
7383 won't change, instead of the address of 'initialize', whose
7384 signature just changed from int to bool.
7385 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7386 * msdos.c (fatal_error_in_progress): ... from here.
7387 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7388 of incrementing it.
7389 (redisplay_internal, unwind_redisplay): Simply clear
7390 REDISPLAYING_P when unwinding, instead of saving its previous,
7391 always-false value and then restoring it.
7392
a411ac43
PE
7393 Clean up some extern decls.
7394 Mostly, this hoists extern decls out of .c files and into .h files.
7395 That way, we're more likely to catch errors if the interfaces change.
7396 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7397 declare xg_mark_data.
7398 * dispextern.h (x_frame_parm_handlers):
7399 * font.h (Qxft):
7400 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7401 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7402 (Qultra_bold, Qoblique, Qitalic):
7403 Move extern decl here from .c file.
7404 * alloc.c (xg_mark_data) [USE_GTK]:
7405 * doc.c (Qclosure):
7406 * eval.c (Qlexical_binding):
7407 * fns.c (time) [!HAVE_UNISTD_H]:
7408 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7409 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7410 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7411 * lread.c (Qinternal_interpreter_environment):
7412 * minibuf.c (Qbuffer):
7413 * process.c (QCfamily, QCfilter):
7414 * widget.c (free_frame_faces):
7415 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7416 * xfont.c (x_clear_errors):
7417 * xterm.c (x_frame_parm_handlers):
7418 Remove now-redundant extern decls.
7419 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7420 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7421 Now static.
7422 * xfaces.c: Remove unnecessary static decls.
7423 * xterm.c (updating_frame): Remove decl of nonexistent object.
7424
c04889f8
PE
7425 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7426 when building globals.h, as the objects that are not built on
7427 this host are not needed to compile C files on this host.
7428
8b339673
JD
74292012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7430
7431 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7432
7433 * frame.h: Add missing prototype for x_wm_set_size_hint.
7434
a08d4ba7
PE
74352012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7436
7437 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7438 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7439 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7440 (Fsubstitute_command_keys):
7441 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7442 (save_excursion_save, save_excursion_restore)
7443 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7444 (format_time_string, general_insert_function)
7445 (make_buffer_string, make_buffer_string_both)
7446 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7447 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7448 (copy_text, insert_1, insert_1_both, insert_from_string)
7449 (insert_from_string_before_markers, insert_from_string_1)
7450 (insert_from_buffer, insert_from_buffer_1, replace_range)
7451 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7452 (del_range_2, modify_region):
7453 * intervals.c (intervals_equal, balance_possible_root_interval)
7454 (adjust_intervals_for_insertion, merge_properties_sticky)
7455 (graft_intervals_into_buffer, lookup_char_property)
7456 (adjust_for_invis_intang, set_point_both)
7457 (get_property_and_range, compare_string_intervals)
7458 (set_intervals_multibyte_1, set_intervals_multibyte):
7459 * keyboard.c (decode_timer):
7460 Use bool for boolean.
7461 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7462 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7463
48c948de
CY
74642012-09-02 Chong Yidong <cyd@gnu.org>
7465
7466 * keymap.c (push_key_description): Print M-TAB as C-M-i
7467 (Bug#11758).
7468
6c49a40b
JB
74692012-09-02 Juanma Barranquero <lekktu@gmail.com>
7470
7471 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7472 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7473 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7474 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7475 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7476 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7477 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7478
4dfbd238
EZ
74792012-09-01 Eli Zaretskii <eliz@gnu.org>
7480
7e510e28
EZ
7481 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7482 more than one grapheme cluster passed to the shaper: compute the
7483 offset adjustment values separately for each cluster. (Bug#11860)
7484
4dfbd238
EZ
7485 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7486 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7487 about implicit conversions from integer to pointer.
7488
86571ae0
DC
74892012-09-01 Daniel Colascione <dancol@dancol.org>
7490
7491 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7492 system used too early.
7493
0e23ef9d
PE
74942012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7495
7496 Better seed support for (random).
7497 * emacs.c (main): Call init_random.
7498 * fns.c (Frandom): Set the seed from a string argument, if given.
7499 Remove long-obsolete Gentzel cruft.
7500 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7501 (init_random): New function.
7502
17a2cbbd
DC
75032012-09-01 Daniel Colascione <dancol@dancol.org>
7504
7505 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7506 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7507 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7508 x_wm_set_size_hint, x_query_colors, x_real_positions,
7509 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7510 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7511 all of which have been moved to common code.
7512
7513 * xfaces.c: Include TERM_HEADER instead of listing all possible
7514 window-system headers.
7515
7516 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7517 to match header.
7518
7519 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7520 directly accessing frame internals.
7521
f18cbb28 7522 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7523 globals_of_w32font.
7524
7525 * process.c: Include TERM_HEADER instead of listing all possible
7526 window-system headers.
7527
3a880af4
SM
7528 * nsterm.h: Remove declarations now in frame.h.
7529 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7530
7531 * menu.c: Include TERM_HEADER instead of listing all possible
7532 window-system headers.
7533
7534 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7535 window system.
7536
7537 * keyboard.c: Include TERM_HEADER instead of listing all possible
7538 window-system headers.
7539
7540 * image.c: Include TERM_HEADER instead of listing all possible
7541 window-system headers. Declare Vlibrary_cache when compiling for
7542 Windows.
7543
7544 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7545 window system declarations.
7546
7547 * frame.h: Move common functions here: set_frame_menubar,
7548 x_set_window_size, x_sync, x_get_focus_frame,
7549 x_set_mouse_position, x_set_mouse_pixel_position,
7550 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7551 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7552 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7553 x_activate_menubar, x_real_positions, x_bitmap_icon,
7554 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7555 and x_query_colors.
7556
7557 * frame.c: Include TERM_HEADER instead of listing all possible
7558 window-system headers.
7559
7560 * font.c: Include TERM_HEADER instead of listing all possible
7561 window-system headers.
7562
7563 * emacs.c: Include TERM_HEADER.
7564
f18cbb28
EZ
7565 * dispnew.c: Include TERM_HEADER instead of listing all possible
7566 window-system headers.
17a2cbbd 7567
f18cbb28 7568 * ccl.h: Include character.h.
17a2cbbd
DC
7569
7570 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7571 the current window system; include in list of objects to link into
7572 Emacs.
7573
c650a5de
DA
75742012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7575
7576 Remove mark_ttys function and fix tty_display_info initialization.
7577 * lisp.h (mark_ttys): Remove prototype.
7578 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7579 to mark_ttys because all possible values of 'top_frame' slot are
7580 the frames which are reachable from Vframe_list.
7581 * term.c (mark_ttys): Remove.
7582 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7583
4e0f6479
DA
75842012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7585
7586 Change struct frame bitfields from unsigned char to unsigned.
7587 * frame.h (struct frame): Change type of 'display_preempted',
7588 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7589 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7590 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7591 bitfields from unsigned char to unsigned.
7592
8b96a52c
DA
75932012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7594
7595 Remove unused member of struct x_output and struct w32_output.
7596 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7597 * w32term.h (struct w32_output): Likewise.
7598
b4444c8a
JD
75992012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7600
7601 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7602 does not become zero (Bug#12234).
7603
b98521db
PE
76042012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7605
7606 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7607 for GCC 4.7.1 x86-64.
7608
31d02438
GM
76092012-08-30 Glenn Morris <rgm@gnu.org>
7610
7611 * lread.c (init_lread): For out-of-tree builds, only add the
7612 source directory's site-lisp dir to the load-path if it exists,
7613 consistent with in-tree builds. (Bug#12302)
7614
7f8941d8
JD
76152012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7616
7617 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7618 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7619 (windowShouldClose:): Set window_closed.
7620 (dealloc): New member, free button_values.
fc0c31f8
JB
7621 (process_dialog:): Make member function. Remove window argument,
7622 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7623 in button_values.
7624 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7625 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7626 (addString:row:): Remove return self, declare return value as void.
7627 (addSplit): Remove return self, declare return value as void.
7628 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7629 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7630 (initFromContents:isQuestion:): Adjust call to process_dialog.
7631 Code formatting change.
7632 (timeout_handler:): Set timer_fired to YES.
7633 (runDialogAt:): Set timer_fired to NO.
7634 Handle click on close button as quit.
7635
7636 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7637 Add window_closed and button_values. Add void as return value for
7638 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7639 Add process_dialog as new member.
7640
eada0861 76412012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7642
eada0861
GM
7643 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7644 is not one of the heaps we manage. (Bug#12242)
7645
76462012-08-28 Glenn Morris <rgm@gnu.org>
7647
7648 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7649
457294dd
MR
76502012-08-28 Martin Rudalics <rudalics@gmx.at>
7651
7652 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7653 auto-buffer-name window parameter. Install revision of reverted
7654 fix.
457294dd 7655
4f2daf31
DA
76562012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7657
7658 Do not allow to set major mode for a dead buffer.
7659 * buffer.c (Fset_buffer_major_mode): Signal an error
7660 if the buffer is dead.
7661 (Fother_buffer, other_buffer_safely): Remove redundant
7662 nested declaration.
7663
66322887
DA
76642012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7665
7666 Always use set_buffer_if_live to restore original buffer at unwind.
7667 * buffer.h (record_unwind_current_buffer): New function.
7668 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7669 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7670 * undo.c, window.c: Adjust users.
7671 * buffer.c (set_buffer_if_live): Fix comment.
7672
a3d794a1
DA
76732012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7674
7675 Fix usage of set_buffer_internal.
7676 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7677 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7678 * coding.c (decode_coding): Omit redundant test.
7679 * fileio.c (decide_coding_unwind): Likewise.
7680 * fns.c (secure_hash): Likewise.
7681 * insdel.c (modify_region): Likewise.
7682 * keyboard.c (command_loop_1): Likewise.
7683 * print.c (PRINTFINISH): Likewise.
7684 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7685
59ea14cd
PE
76862012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7687
7688 * dispnew.c: Use bool for boolean.
7689 (frame_garbaged, display_completed, delayed_size_change)
7690 (fonts_changed_p, add_window_display_history)
7691 (add_frame_display_history, verify_row_hash)
7692 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7693 (row_equal_p, realloc_glyph_pool)
7694 (allocate_matrices_for_frame_redisplay)
7695 (showing_window_margins_p)
7696 (adjust_frame_glyphs_for_frame_redisplay)
7697 (build_frame_matrix_from_leaf_window, make_current)
7698 (mirrored_line_dance, mirror_line_dance, update_frame)
7699 (update_window_tree, update_single_window)
7700 (check_current_matrix_flags, update_window, update_text_area)
7701 (update_window_line, set_window_update_flags, scrolling_window)
7702 (update_frame_1, scrolling, buffer_posn_from_coords)
7703 (do_pending_window_change, change_frame_size)
7704 (change_frame_size_1, sit_for):
7705 Use bool for boolean.
7706 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7707 and remove last int (actually boolean) argument, which was always 0.
7708 All callers changed.
7709 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7710 * dispextern.h (struct composition_it): Use bool for boolean.
7711 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7712 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7713 * dired.c (file_name_completion):
7714 Use bool for boolean. (This was missed in an earlier change.)
7715
95072a94
MR
77162012-08-27 Martin Rudalics <rudalics@gmx.at>
7717
7718 * window.c (Fset_window_configuration): Revert first part of
7719 last change.
7720
0f19feff
JD
77212012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7722
7723 * nsterm.h (NSPanel): New class variable dialog_return.
7724
3a880af4
SM
7725 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7726 Initialize dialog_return.
0f19feff
JD
7727 (windowShouldClose:): Use stop instead of stopModalWithCode.
7728 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7729 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7730 event.
7731 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7732 modal loop returns.
7733
f10fe38f
PE
77342012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7735
de1339b0
PE
7736 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7737 * composite.c (find_composition, composition_gstring_p)
7738 (composition_reseat_it, find_automatic_composition):
7739 * data.c (let_shadows_buffer_binding_p)
7740 (let_shadows_global_binding_p, set_internal, make_blv)
7741 (Fmake_variable_buffer_local, Fmake_local_variable)
7742 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7743 (cons_to_signed, arith_driver):
7744 * dbusbind.c (xd_in_read_queued_messages):
7745 * dired.c (directory_files_internal, file_name_completion):
7746 Use bool for booleans.
7747 * dired.c (file_name_completion):
7748 * process.h (fd_callback):
7749 Omit int (actually boolean) argument. It wasn't being used.
7750 All uses changed.
7751 * composite.h, lisp.h: Reflect above API changes.
7752
f10fe38f
PE
7753 * cmds.c, coding.c: Use bool for booleans.
7754 * cmds.c (move_point, Fself_insert_command):
7755 * coding.h (struct composition status, struct coding_system):
7756 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7757 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7758 (emacs_mule_char, decode_coding_emacs_mule)
7759 (encode_coding_emacs_mule, detect_coding_iso_2022)
7760 (decode_coding_iso_2022, encode_invocation_designation)
7761 (encode_designation_at_bol, encode_coding_iso_2022)
7762 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7763 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7764 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7765 (encode_coding_raw_text, detect_coding_charset)
7766 (decode_coding_charset, encode_coding_charset, detect_eol)
7767 (detect_coding, get_translation_table, produce_chars)
7768 (consume_chars, reused_workbuf_in_use)
7769 (make_conversion_work_buffer, code_conversion_save)
7770 (decode_coding_object, encode_coding_object)
7771 (detect_coding_system, char_encodable_p)
7772 (Funencodable_char_position, code_convert_region)
7773 (code_convert_string, code_convert_string_norecord)
7774 (Fset_coding_system_priority):
7775 * fileio.c (Finsert_file_contents):
7776 Use bool for booleans.
7777 * coding.h, lisp.h: Reflect above API changes.
7778 * coding.c: Remove unnecessary static function decls.
7779 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7780 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7781 not a boolean 'int', since callers never look at the return value.
7782 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7783 * coding.h (decoding_buffer_size, encoding_buffer_size)
7784 (emacs_mule_string_char): Remove unused extern decls.
7785 (struct iso_2022_spec, struct coding_system):
7786 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7787 (struct emacs_mule_spec): Remove unused field 'full_support'.
7788 All initializations removed.
7789 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7790
5474c384
DA
77912012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7792
f10fe38f 7793 Fix spare memory change (Bug#12286).
5474c384
DA
7794 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7795 (valid_lisp_object_p): Likewise.
7796
c4b6914d
MR
77972012-08-27 Martin Rudalics <rudalics@gmx.at>
7798
7799 * window.c (Fset_window_configuration): Record any window's old
7800 buffer if it's replaced (see Bug#8789). If the new current
7801 buffer doesn't appear in the selected window, go to its old
7802 point (Bug#12208).
7803
35aaa1ea
DA
78042012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7805
7806 Special MEM_TYPE_SPARE to denote reserved memory.
7807 * alloc.c (enum mem_type): New memory type.
7808 (refill_memory_reserve): Use new type for spare memory.
7809 This prevents live_cons_p and live_string_p from incorrect
7810 detection of uninitialized objects from spare memory as live.
7811
6af64513
PE
78122012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7813
8b2e00a3
PE
7814 Spelling fixes.
7815 * Makefile.in (.PHONY): versioclean -> versionclean.
7816
b52d6985
PE
7817 Remove unused external symbols.
7818 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7819 * window.c (Qwindow_valid_p, decode_valid_window):
7820 Now static, not extern.
7821 * data.c (Qinterval): Remove; unused.
7822 (syms_of_data): Do not define 'interval'.
7823 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7824 * window.h (decode_valid_window):
7825 Remove decls.
7826
d5172d4f
PE
7827 * character.c, charset.c, chartab.c: Use bool for booleans.
7828 * character.c (lisp_string_width, string_count_byte8)
7829 (string_escape_byte8):
7830 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7831 (load_charset_map_from_file, map_charset_chars)
7832 (Fdefine_charset_internal, define_charset_internal)
7833 (Fdeclare_equiv_charset, find_charsets_in_text)
7834 (Ffind_charset_region, char_charset, Fiso_charset):
7835 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7836 (sub_char_table_set, sub_char_table_set_range)
7837 (char_table_set_range, optimize_sub_char_table)
7838 (map_sub_char_table):
7839 Use bool for boolean.
7840 * character.c (str_to_unibyte): Omit last boolean argument; it was
7841 always 0. All callers changed.
7842 * character.h, charset.h: Adjust to match previous changes.
7843 * character.h (char_printable_p): Remove decl of nonexistent function.
7844 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7845 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7846 are all boolean, so make them single-bit bitfields.
7847
6af64513
PE
7848 * lisp.h (ASET): Remove attempt to detect side effects.
7849 It was meant to be temporary and it often doesn't work,
7850 because when IDX has side effects the behavior of IDX==IDX
7851 is undefined. See Stefan Monnier in
7852 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7853
e1f29348
BR
78542012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7855
7856 * lisp.h (functionp): New function (extracted from Ffunctionp).
7857 (FUNCTIONP): Use it.
7858 * eval.c (Ffunctionp): Use it.
7859
17c05d74
PE
78602012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7861
0f46bc75
PE
7862 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7863 as that's faster and simpler than static storage. Don't bother
7864 with the g_main_context_query overhead if g_main_context_pending
7865 says no events are pending.
7866 (gfds, gfds_size): Remove these static vars.
7867 (xgselect_initialize): Remove; no longer needed.
7868 All uses and decls removed.
7869
ee4c0f69
PE
7870 * emacs.c (fatal_error_signal_hook): Remove.
7871 All uses removed. This leftover from old code was always 0.
7872
17c05d74
PE
7873 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7874 * casefiddle.c (casify_object, casify_region):
7875 * casetab.c (set_case_table):
7876 * category.c, category.h (word_boundary_p):
7877 * category.h (CHAR_HAS_CATEGORY):
7878 Use bool for booleans, instead of int.
7879
391ceac5
EZ
78802012-08-25 Eli Zaretskii <eliz@gnu.org>
7881
7882 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7883
2f221583
PE
78842012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7885
f4a681b0
PE
7886 On assertion failure, print backtrace if available.
7887 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7888 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7889 * Makefile.in (LIB_EXECINFO): New macro.
7890 (LIBES): Use it.
7891
2f221583
PE
7892 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7893 * bytecode.c (exec_byte_code):
7894 * callint.c (check_mark, Fcall_interactively):
7895 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7896 (getenv_internal, sync_process_alive, call_process_exited):
7897 * lisp.h (USE_SAFE_ALLOCA):
7898 Use bool for booleans, instead of int.
7899 * lisp.h, process.h: Adjust prototypes to match above changes.
7900 * callint.c (Fcall_interactively): Don't assume the mark's
7901 offset fits in 'int'.
7902
37ef52bb
PE
79032012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7904
7905 * buffer.c, buffer.h: Use bool for boolean.
7906 * buffer.c (reset_buffer_local_variables)
7907 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7908 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7909 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7910 (overlay_touches_p, overlay_strings, Foverlay_put)
7911 (report_overlay_modification, call_overlay_mod_hooks):
7912 (mmap_enlarge, mmap_set_vars):
7913 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7914 Use bool for booleans, instead of int.
7915 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7916 since the 1-or-0 return value is always ignored anyway.
7917 (mmap_initialized_p):
7918 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7919 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7920
2cc21167
PE
79212012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7922
7923 * bidi.c: Use bool for boolean.
7924 This is a bit more readable, and makes the text segment of bidi.o
7925 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7926 Presumably it's faster too.
7927 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7928 Now bool.
7929 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7930 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7931 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7932 (bidi_explicit_dir_char, bidi_level_of_next_char)
7933 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7934 Use bool for booleans, instead of int.
7935 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7936 (bidi_unshelve_cache): Adjust decls to match code.
7937
7db4ddf4
MR
79382012-08-23 Martin Rudalics <rudalics@gmx.at>
7939
7940 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7941 argument.
7942
b1bb8011
PE
79432012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7946 * atimer.h: Include <stdbool.h>.
7947
ff687885
DN
79482012-08-22 Dan Nicolaescu <dann@gnu.org>
7949
7950 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7951 compile time tests instead of run time tests on systems that do
7952 not use them.
7953 (FRAME_MAC_P): Remove leftover from deleted code.
7954 * frame.c (syms_of_frame): Remove leftover from deleted code.
7955
4ce7a138
JD
79562012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7957
7958 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7959
d733ec6d
PE
79602012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7961
7962 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7963 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7964 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7965 (fontset_add): Return void, for FONTSET_ADD.
7966
d0d2d26f
PE
79672012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7968
fce31d69
PE
7969 * alloc.c: Use bool for booleans.
7970 (gc_in_progress, abort_on_gc)
7971 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7972 (dont_register_blocks) [GC_MALLOC_CHECK]:
7973 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7974 (check_string_bytes, make_specified_string, memory_full)
7975 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7976 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7977 (mark_stack, valid_pointer_p, make_pure_string)
7978 (Fgarbage_collect, survives_gc_p, gc_sweep):
7979 Use bool for booleans, instead of int.
7980 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7981 Remove unused local.
7982 * alloc.c (PURE_POINTER_P):
7983 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7984 * editfns.c (Fformat):
7985 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7986 (Fdo_auto_save):
7987 * fns.c (sweep_weak_table):
7988 * lisp.h (suppress_checking, push_message, survives_gc_p)
7989 (make_pure_string, gc_in_progress, abort_on_gc):
7990 * lread.c (readchar, read1):
7991 * print.c (Fprin1_to_string):
7992 * xdisp.c (push_message):
7993 Use bool for booleans affected directly or indirectly by
7994 alloc.c's changes.
7995
d0d2d26f
PE
7996 Make recently-introduced setters macros.
7997 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7998 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7999 (set_fontset_default, set_fontset_fallback): Rename from their
8000 upper-case counterparts, and make them functions rather than macros.
8001 This is more consistent with the other recently-introduced setters.
8002 These don't need to be inline, since they're local.
8003
d18e2bb6
JD
80042012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8005
8006 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8007 the loop (Bug#12247).
8008
1b9d9d16
PE
80092012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8010
8011 * lisp.h (vcopy): Use memcpy rather than our own loop.
8012 This fixes a performance regression introduced by the recent
8013 addition of vcopy. This means 'vcopy' will need to be modified
8014 for a copying collector, but that's OK. Also, tighten the
8015 checking in the assertion.
8016
b2f09701
EZ
80172012-08-21 Eli Zaretskii <eliz@gnu.org>
8018
8019 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8020 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8021 non-base glyph for the width of the base character, according to
e1f29348
BR
8022 what x_draw_composite_glyph_string_foreground expects.
8023 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
8024 expectations, to produce correct width of the composed character.
8025 Reverse the sign of the DU offset produced by ScriptPlace.
8026
9b994fed
PE
80272012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8030
086ca913
DA
80312012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8032
8033 Avoid direct writes to contents member of struct Lisp_Vector.
8034 * lisp.h (vcopy): New function to copy data into vector.
8035 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8036 * fns.c (Ffillarray): Use ASET.
8037 * keyboard.c (timer_check_2): Use AREF and ASET.
8038 (append_tool_bar_item, Frecent_keys): Use vcopy.
8039 * lread.c (read_vector): Use ASET.
8040 * msdos.c (Frecent_doskeys): Use vcopy.
8041 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8042 (Finternal_merge_in_global_face): Use ASET and vcopy.
8043 * xfont.c (xfont_list_pattern): Likewise.
8044
5481664a
MR
80452012-08-21 Martin Rudalics <rudalics@gmx.at>
8046
8047 * window.c (Fwindow_point): For the selected window always return
8048 the position of its buffer's point.
8049 (Fset_window_point): For the selected window always go in its
8050 buffer to the specified position.
8051
6d470bdd
DA
80522012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8053
8054 Setter macros for fontsets.
8055 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8056 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8057 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8058 Adjust users.
8059
24564fe1
GM
80602012-08-20 Glenn Morris <rgm@gnu.org>
8061
8062 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8063 Don't assume that `ln -f' works.
8064
0a05a035
EZ
80652012-08-20 Eli Zaretskii <eliz@gnu.org>
8066
8067 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8068 and later about non-assignments with no effect. See discussion at
8069 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8070 details.
8071
e46f2325
DA
80722012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8073
8074 Inline setter functions for Lisp_Objects slots of struct specbinding.
8075 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8076 Adjust users.
8077
734fbd86
MR
80782012-08-20 Martin Rudalics <rudalics@gmx.at>
8079
8080 * window.c (select_window): Always make selected window's buffer
8081 current.
8082
f1a95992
DA
80832012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8084
8085 Use AREF and ASET for docstrings of category tables.
8086 * category.h (CATEGORY_DOCSTRING): Use AREF.
8087 (SET_CATEGORY_DOCSTRING): Use ASET.
8088 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8089
e83064be
DA
80902012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8091
8092 Inline setter functions for hash table members.
8093 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8094 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8095 (set_hash_key_and_value, set_hash_index, set_hash_next)
8096 (set_hash_hash): New functions.
8097 * charset.c, fns.c: Adjust users.
8098
4ce60d2e
DA
80992012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8100
8101 Inline getter and setter functions for per-buffer values.
8102 * buffer.h (per_buffer_default, set_per_buffer_default)
8103 (per_buffer_value, set_per_buffer_value): New functions.
8104 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8105 * buffer.c, data.c: Adjust users.
8106
c06c9690
JB
81072012-08-20 Juanma Barranquero <lekktu@gmail.com>
8108
8109 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8110
32bd4250
PE
81112012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8112
bad03192 8113 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
8114 as gnulib does this if the system doesn't.
8115 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
8116 Remove declaration. MS-Windows declares it on stdlib.h which is
8117 included by conf_post.h.
b69a6d22
PE
8118 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8119 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8120 * vm-limit.c: Include <unistd.h>, for 'environ'.
8121
22d7feb2
PE
8122 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8123 (start_of_data): Remove decl; mem-limits.h provides it.
8124
32bd4250
PE
8125 * xdisp.c (handle_invisible_prop): Make it a bit faster
8126 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8127
450809af
CY
81282012-08-19 Chong Yidong <cyd@gnu.org>
8129
8130 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8131 ends (Bug#3874).
8132
9e677988
AS
81332012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8134
6b1319ce
AS
8135 * .gdbinit: Use call instead of set when calling a function in the
8136 inferior.
8137
9e677988
AS
8138 * data.c (set_internal): Don't use set_blv_found.
8139 (Fkill_local_variable): Likewise.
8140
d7191076
AA
81412012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8142
8143 * nsfont.m (ns_ascii_average_width): Ensure the string
8144 ascii_printable is initialized with a null-terminated character
8145 array. Otherwise, it can contain undesired extra characters.
8146
e757f1c6
PE
81472012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 port new setting code to Sun C 5.8 2005/10/13
8150 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8151 Return void, not Lisp_Object. Otherwise, the compiler
8152 complains about (A?B:C) where B is void and C is Lisp_Object
8153 when compiling CHAR_TABLE_SET, due to the recent change to
8154 the API of sub_char_table_set_contents.
8155
a999ce26
CY
81562012-08-18 Chong Yidong <cyd@gnu.org>
8157
8158 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8159 for the string case (Bug#3874).
8160
3f22b86f
PE
81612012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8162
39eb03f1
PE
8163 * buffer.h (BSET): Remove (Bug#12215).
8164 Replace all uses with calls to new setter functions.
8165 (bset_bidi_paragraph_direction, bset_case_canon_table)
8166 (bset_case_eqv_table, bset_directory, bset_display_count)
8167 (bset_display_time, bset_downcase_table)
8168 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8169 (bset_last_selected_window, bset_local_var_alist)
8170 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8171 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8172 (bset_width_table):
8173 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8174 (bset_auto_fill_function, bset_auto_save_file_format)
8175 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8176 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8177 (bset_cache_long_line_scans, bset_case_fold_search)
8178 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8179 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8180 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8181 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8182 (bset_header_line_format, bset_indicate_buffer_boundaries)
8183 (bset_indicate_empty_lines, bset_invisibility_spec)
8184 (bset_left_fringe_width, bset_major_mode, bset_mark)
8185 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8186 (bset_name, bset_overwrite_mode, bset_pt_marker)
8187 (bset_right_fringe_width, bset_save_length)
8188 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8189 (bset_scroll_up_aggressively, bset_selective_display)
8190 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8191 (bset_word_wrap, bset_zv_marker):
8192 * category.c (bset_category_table):
8193 * syntax.c (bset_syntax_table):
8194 New setter functions.
8195
6a09a33b
PE
8196 * process.h (PSET): Remove (Bug#12215).
8197 Replace all uses with calls to new setter functions.
8198 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8199 (PROCESS_INLINE): New macro.
8200 (pset_childp): New setter function.
8201 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8202 * process.c (PROCESS_INLINE):
8203 Define to EXTERN_INLINE, so that the corresponding functions
8204 are compiled into code.
8205 (pset_buffer, pset_command, pset_decode_coding_system)
8206 (pset_decoding_buf, pset_encode_coding_system)
8207 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8208 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8209 (pset_type, pset_write_queue): New setter functions.
8210
e8c17b81
PE
8211 * window.h (WSET): Remove (Bug#12215).
8212 Replace all uses with calls to new setter functions.
8213 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8214 (WINDOW_INLINE): New macro.
8215 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8216 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8217 (wset_total_lines, wset_vertical_scroll_bar)
8218 (wset_window_end_pos, wset_window_end_valid)
8219 (wset_window_end_vpos): New setter functions.
8220 * window.c (WINDOW_INLINE):
8221 Define to EXTERN_INLINE, so that the corresponding functions
8222 are compiled into code.
8223 (wset_combination_limit, wset_dedicated, wset_display_table)
8224 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8225 (wset_new_normal, wset_new_total, wset_next_buffers)
8226 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8227 (wset_prev_buffers, wset_right_fringe_width)
8228 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8229 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8230 (wset_window_parameters):
8231 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8232 (wset_column_number_displayed, wset_region_showing):
8233 New setter functions.
8234
3f22b86f
PE
8235 * termhooks.h (TSET): Remove (Bug#12215).
8236 Replace all uses with calls to new setter functions.
8237 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8238 (TERMHOOKS_INLINE): New macro.
8239 (tset_charset_list, tset_selection_alist): New setter functions.
8240 * terminal.c (TERMHOOKS_INLINE):
8241 Define to EXTERN_INLINE, so that the corresponding functions
8242 are compiled into code.
8243 (tset_param_alist): New setter function.
8244
742af32f
PE
82452012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8246
15dbb4d6
PE
8247 * keyboard.h (KSET): Remove (Bug#12215).
8248 Replace all uses with calls to new setter functions.
8249 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8250 (KEYBOARD_INLINE): New macro.
8251 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8252 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8253 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8254 New setter functions.
8255 * keyboard.c (KEYBOARD_INLINE):
8256 Define to EXTERN_INLINE, so that the corresponding functions
8257 are compiled into code.
8258 (kset_echo_string, kset_kbd_queue)
8259 (kset_keyboard_translate_table, kset_last_prefix_arg)
8260 (kset_last_repeatable_command, kset_local_function_key_map)
8261 (kset_overriding_terminal_local_map, kset_real_last_command)
8262 (kset_system_key_syms): New setter functions.
8263
f00af5b1
PE
8264 * frame.h (FSET): Remove (Bug#12215).
8265 Replace all uses with calls to new setter functions.
8266 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8267 (FRAME_INLINE): New macro.
8268 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8269 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8270 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8271 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8272 (fset_param_alist, fset_root_window, fset_scroll_bars)
8273 (fset_selected_window, fset_title, fset_tool_bar_items)
8274 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8275 * frame.c (FRAME_INLINE):
8276 Define to EXTERN_INLINE, so that the corresponding functions
8277 are compiled into code.
8278 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8279
0c94c8d6
PE
8280 A few more naming-convention fixes for getters and setters.
8281 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8282 and rename from buffer_overlays_set_before.
8283 (set_buffer_overlays_after): Move here from buffer.h, and rename
8284 from buffer_overlays_set_after.
8285 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8286 All uses changed.
8287 (set_buffer_intervals): Rename from buffer_set_intervals.
8288 * intervals.c (set_interval_object): Move here from intervals.h,
8289 and rename from interval_set_object.
8290 (set_interval_left): Move here from intervals.h, and rename from
8291 interval_set_left.
8292 (set_interval_right): Move here from intervals.h, and rename from
8293 interval_set_right.
8294 (copy_interval_parent): Move here from intervals.h, and rename from
8295 interval_copy_parent.
8296 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8297 (set_interval_plist): Rename from interval_set_plist.
8298 Return void, not Lisp_Object, since no caller uses the result.
8299 * lisp.h (string_intervals): Rename from string_get_intervals.
8300 (set_string_intervals): Rename from string_set_intervals.
8301
34dabdb7
PE
8302 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8303 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8304 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8305 All uses changed. See the end of
8306 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8307
742af32f
PE
8308 * lisp.h (CSET): Remove (Bug#12215).
8309 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8310 (set_char_table_purpose): New functions,
8311 replacing CSET. All uses changed. For example, replace
8312 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8313 "set_char_table_parent (char_table, parent);".
742af32f
PE
8314 The old version was confusing because it used the same name
8315 'parent' for two different things.
8316
a04e2c62
DA
83172012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8318
8319 Functions to get and set Lisp_Object fields of buffer-local variables.
8320 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8321 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8322 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8323 * data.c, eval.c, frame.c: Adjust users.
8324
383dcbf9
CY
83252012-08-17 Chong Yidong <cyd@gnu.org>
8326
8327 * xfaces.c (merge_face_vectors): If the target font specfies a
8328 font spec, make the font's attributes take precedence over
8329 directly-specified attributes.
8330 (merge_face_ref): Recognize :font.
8331
44386687
DA
83322012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8333
8334 Do not use memcpy for copying intervals.
8335 * intervals.c (reproduce_interval): New function.
8336 (reproduce_tree, reproduce_tree_obj): Use it.
8337 (reproduce_tree_obj): Remove prototype.
8338
927c7216
PE
83392012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 * lisp.h (duration_to_sec_usec): Remove unused decl.
8342
93044f7b
AA
83432012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8344
8345 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8346 to an allocated instance of NSString, not to the class itself.
8347
9851e4a5
JB
83482012-08-17 Juanma Barranquero <lekktu@gmail.com>
8349
8350 * makefile.w32-in (C_CTYPE_H): New macro.
8351 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8352 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8353 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8354
620f13b0
PE
83552012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8356
8357 Use ASCII tests for character types.
8358 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8359 * xfns.c, xterm.c:
8360 Don't include <ctype.h>; was not needed.
8361 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8362 * sysdep.c, xfaces.c:
8363 Include <c-ctype.h> instead of <ctype.h>.
8364 * nsterm.m: Include <c-ctype.h>.
8365 * charset.c (read_hex):
8366 * doc.c (Fsnarf_documentation):
8367 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8368 (DRIVE_LETTER) [DOS_NT]:
8369 (Ffile_name_directory, Fexpand_file_name)
8370 (Fsubstitute_in_file_name):
8371 * font.c (font_parse_xlfd, font_parse_fcname):
8372 * frame.c (x_set_font_backend):
8373 * gtkutil.c (xg_get_font):
8374 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8375 * nsimage.m (hexchar):
8376 * nsterm.m (ns_xlfd_to_fontname):
8377 * sysdep.c (system_process_attributes):
8378 * xfaces.c (hash_string_case_insensitive):
8379 Use C-locale tests instead of locale-specific tests for character
8380 types, since we want the ASCII interpretation here, not the
8381 interpretation suitable for whatever happens to be the current locale.
8382
52162052
MR
83832012-08-16 Martin Rudalics <rudalics@gmx.at>
8384
8385 Consistently check windows for validity/liveness
8386 (Bug#11984, Bug#12025, Bug#12026).
8387 * lisp.h (CHECK_VALID_WINDOW): New macro.
8388 * window.c (decode_window): Rename to decode_live_window.
8389 (decode_valid_window, Fwindow_valid_p): New functions.
8390 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8391 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8392 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8393 (Fwindow_prev_sibling, Fwindow_combination_limit)
8394 (Fset_window_combination_limit, Fwindow_use_time)
8395 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8396 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8397 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8398 (Fwindow_hscroll, Fset_window_hscroll)
8399 (Fwindow_redisplay_end_trigger)
8400 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8401 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8402 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8403 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8404 (Fwindow_end, Fset_window_point, Fset_window_start)
8405 (Fpos_visible_in_window_p, Fwindow_line_height)
8406 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8407 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8408 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8409 (Fset_window_parameter, Fwindow_display_table)
8410 (Fset_window_display_table, Fdelete_other_windows_internal)
8411 (Fset_window_buffer, Fset_window_new_total)
8412 (Fset_window_new_normal, Fdelete_window_internal)
8413 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8414 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8415 (Fwindow_scroll_bars): Check whether argument window is a valid or
8416 live window. Update doc-strings.
8417 (syms_of_window): New symbol Qwindow_valid_p.
8418 * keyboard.c (Fposn_at_x_y): Check whether argument
8419 frame_or_window denotes a valid window.
8420
2751c80f
DA
84212012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8422
8423 Fix previous char table change.
8424 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8425 * chartab.c (optimize_sub_char_table): Likewise.
8426
032a42c8
CY
84272012-08-16 Chong Yidong <cyd@gnu.org>
8428
a2d19368
CY
8429 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8430
032a42c8
CY
8431 * xfont.c (xfont_open):
8432 * xftfont.c (xftfont_open): Set the font's max_width field.
8433
8434 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8435 min_width to space_width and average_width to the average over
8436 printable ASCII characters.
8437 (ns_char_width): Code cleanup.
8438 (ns_ascii_average_width): New utility function.
8439
8440 * font.h (struct font): Update comments.
8441
a098c930
DA
84422012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8443
032a42c8 8444 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8445 * lisp.h (CSET): New macro.
8446 (char_table_set_extras, char_table_set_contents)
8447 (sub_char_table_set_contents): New function.
8448 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8449 * syntax.c: Adjust users.
8450
8be3a09c
SM
84512012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8452
8453 * eval.c (eval_sub): Bind lexical-binding.
8454 * lread.c (Qlexical_binding): Make non-static.
8455
ac4845a6
JD
84562012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8457
ddee6515
JD
8458 * nsmenu.m (popupSession): Remove.
8459 (pop_down_menu): Remove endModalSession.
8460 (timeout_handler:): New method.
8461 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8462 Call runModalForWindow. Check timer_fired when it returns.
8463 If not set, cancel timer and break out of loop.
8464 Otherwise loop again, with a new timeout.
8465
8466 * nsterm.m: Include fcntl.h if present.
8467 (fd_entry, t_readfds, inNsSelect): Remove.
8468 (select_writefds, select_valid, select_timeout, selfds)
8469 (select_mutex, apploopnr): Add.
8470 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8471 Otherwise call kbd_buffer_store_event.
8472 (ns_send_appdefined): Remove release of fd_entry.
8473 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8474 Increment and decrement apploopnr.
8475 (ns_select): If no file descriptors, just do a NSTimer.
8476 Otherwise copy read/write masks and start select thread (fd_handler).
8477 Start main loop and wait for application defined event.
8478 Inform select thread to stop selecting after main loop is exited.
8479 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8480 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8481 (fd_handler:): Loop forever, wait for info from the main thread
8482 to either start or stop selecting. When select returns, send
8483 and appdefined event.
8484 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8485 If not call kbd_buffer_store_event.
8486
8487 * nsterm.h (EmacsApp): fd_handler takes id argument.
8488 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8489
ac4845a6
JD
8490 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8491
eb424fe3
EZ
84922012-08-15 Eli Zaretskii <eliz@gnu.org>
8493
8494 * region-cache.c (move_cache_gap): Update gap_len using the actual
8495 growth of the boundaries array. Do not change cache_len.
8496 (Bug#12196)
8497
4e6a86c6
DA
84982012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8499
8500 Generalize and cleanup font subsystem checks.
8501 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8502 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8503 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8504
5bf192ca
DA
85052012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8506
8507 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8508
f2045622
CY
85092012-08-15 Chong Yidong <cyd@gnu.org>
8510
8be3a09c
SM
8511 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8512 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8513 extract the font descriptor instead of just the font name.
8514 In that case, return a font spec instead of a string.
f2045622
CY
8515 (x_last_font_name): Move to this file from xfns.c.
8516
8517 * xfns.c (Fx_select_font): The return value can also be a font
8518 spec. Move x_last_font_name management to gtkutil.c.
8519
8520 * xfaces.c: Make font weight and style symbols non-static.
8521
7f6feb56
SM
85222012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8523
8524 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8525 (bug#12117).
8526
fecbd8ff
SM
85272012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8528
8529 * alloc.c (Fgarbage_collect): Use plural form consistently.
8530
9b8d5165
EZ
85312012-08-14 Eli Zaretskii <eliz@gnu.org>
8532
8533 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8534 iteration through the command loop. Fixes a problem whereby mouse
8535 movements are ignored until the first mouse click.
8536
f5d9e83a
PE
85372012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8538
8539 Use bool, not int, for Lisp booleans.
8540 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8541 makes Emacs a bit smaller and presumably a bit faster.
8542 * lisp.h: Include <stdbool.h>.
8543 (struct Lisp_Boolfwd, defvar_bool):
8544 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8545 * regex.c [!emacs]: Include <stdbool.h>.
8546 (false, true): Remove; <stdbool.h> does this for us now.
8547
55802e4a
CY
85482012-08-14 Chong Yidong <cyd@gnu.org>
8549
4abcdac8
CY
8550 * character.c (Fcharacterp): Doc fix (Bug#12076).
8551
8552 * data.c (Findirect_variable): Doc fix (Bug#11040).
8553
55802e4a
CY
8554 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8555
8556 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8557 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8558
8e99d072
BR
85592012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8560
8561 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8562 (bug#12022).
8563
08908aca
MR
85642012-08-14 Martin Rudalics <rudalics@gmx.at>
8565
8566 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8567 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8568 * minibuf.c (choose_minibuf_frame, read_minibuf):
8569 * w32fns.c (x_create_tip_frame):
8570 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8571 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8572
56120d6f
PE
85732012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * intervals.c (offset_intervals): Remove obsolete comment.
8576
67b77c0b
AS
85772012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8578
8579 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8580
f48b82fd
GR
85812012-08-14 Gergely Risko <gergely@risko.hu>
8582
8583 * coding.c (decode_coding): Record buffer modification before
8584 disabling undo_list (Bug#11773).
8585
fd318b54
DA
85862012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8587
8588 Revert and cleanup some recent overlay changes.
8589 * buffer.h (enum overlay_type): Remove.
8590 (buffer_get_overlays, buffer_set_overlays): Likewise.
8591 (buffer_set_overlays_before, buffer_set_overlays_after):
8592 New function. Adjust users.
8593 (unchain_both): Add eassert.
8594
41a62dd9
DA
85952012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8596
8597 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8598
5884c324
PE
85992012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8600
8601 * gtkutil.c (xg_mark_data): Don't assume C99.
8602
ca06f160
JD
86032012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8604
8605 * gtkutil.c (xg_frame_tb_info): New struct.
8606 (TB_INFO_KEY): New define.
8607 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8608 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8609 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8610 if not present.
8611 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8612 is up to date. Otherwise store new data.
ca06f160
JD
8613 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8614
7864a3f7
DA
86152012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8616
8617 Use KSET for write access to Lisp_Object members of struct kboard.
8618 * keyboard.h (KSET): New macro.
8619 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8620 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8621 * xterm.c: Adjust users.
8622
4c31be61
DA
86232012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8624
8625 Use BSET for write access to Lisp_Object members of struct buffer.
8626 * buffer.h (BSET): New macro.
8627 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8628 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8629 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8630 * window.c, xdisp.c, xfns.c: Adjust users.
8631
14ae4239
BT
86322012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8633
8634 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8635
32bcadb4
JD
86362012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8637
3d29b2ce 8638 * nsterm.m (not_in_argv): New function.
fc0c31f8 8639 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8640 (application:openFileWithoutUI:, application:openFiles:): Open file
8641 if not_in_argv returns non-zero (bug#12171).
8642
32bcadb4 8643 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8644 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8645 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8646 (xg_get_font_name): Use those functions/macros here.
8647 Reported by Frans Oilinki <moilinki@gmail.com>.
8648
9ff9402d 86492012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8650
8651 * unexmacosx.c (copy_data_segment): Copy initialized data in
8652 statically linked libraries from input file rather than memory.
8653
db74a5fc
YM
8654 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8655 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8656 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8657
25e65510
GM
86582012-08-10 Glenn Morris <rgm@gnu.org>
8659
8660 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8661 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8662
7961135c
DA
86632012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8664
8665 Fix last change to allow compilation with low optimization levels.
8666 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8667 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8668
42b3a444
DA
86692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8670
8671 Use common inline syntax in intervals.h.
8672 * intervals.h (INTERVALS_INLINE): New macro.
8673 Change all users from LISP_INLINE.
8674
9fb0c957
DA
86752012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8676
8677 Define Qnone once for all platforms.
8678 * frame.c (Qnone): Define here.
8679 (syms_of_frame): DEFSYM it.
8680 * lisp.h (Qnone): New declaration.
8681 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8682 * xfns.c: Remove duplication. Adjust users.
8683
65e8ee52
DA
86842012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8685
8686 Remove unused macros from intervals.h.
8687 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8688 * intervals.c: Adjust comment.
8689
9b855fd6
EZ
86902012-08-10 Eli Zaretskii <eliz@gnu.org>
8691
8692 * w32fns.c <w32_unicode_gui>: New static variable.
8693 (globals_of_w32fns): Initialize it according to os_subtype.
8694 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8695 testing os_subtype.
8696
39cb9e56 86972012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8698 Eli Zaretskii <eliz@gnu.org>
8699
8700 Fix bug #10299 with Unicode characters sent by customized
8701 keyboards created by MSKLC.
8702 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8703 (w32_init_class): Use it to initialize the Emacs class with either
8704 ANSI or Unicode API calls.
8705 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8706 later.
8707 (w32_wnd_proc): If the character code sent by WM_CHAR or
8708 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8709 original message. Call DefWindowProcW on NT and later.
8710
9374581a
GM
87112012-08-10 Glenn Morris <rgm@gnu.org>
8712
4b94e8cf
GM
8713 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8714
9374581a
GM
8715 * lisp.h (DIRECTORY_SEP): Let configure set it.
8716
a2752828
DA
87172012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Use TSET for write access to Lisp_Object slots of struct terminal.
8720 * termhooks.h (TSET): New macro.
8721 * coding.c, terminal.c, xselect.c: Adjust users.
8722
cc92c454
SM
87232012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8724
8725 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8726 the failing expression, include them in the error message.
8727 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8728 * lisp.h (internal_condition_case_n): Update declaration.
8729
4cb3e6b3
DA
87302012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8731
8732 Inline functions to examine and change buffer overlays.
8733 * buffer.c (unchain_both): New function.
8734 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8735 (buffer_has_overlays): New function.
8736 (enum overlay_type): New enum.
8737 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8738 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8739
8707c1e5
DA
87402012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8741
8742 Inline functions to examine and change buffer intervals.
8743 * alloc.c (mark_interval_tree): Remove.
8744 (MARK_INTERVAL_TREE): Simplify.
8745 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8746 * intervals.c (buffer_balance_intervals): New function.
8747 (graft_intervals_into_buffer): Adjust indentation.
8748 (set_intervals_multibyte): Simplify.
8749 * buffer.h (BUF_INTERVALS): Remove.
8750 (buffer_get_intervals, buffer_set_intervals): New function.
8751 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8752 * intervals.c, textprop.c: Adjust users.
8753
ad8c997f
DA
87542012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8755
8756 Inline functions to examine and change string intervals.
8757 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8758 (string_get_intervals, string_set_intervals): New function.
8759 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8760 * lread.c, print.c, textprop.c: Adjust users.
8761
32ac3a6b
GM
87622012-08-08 Glenn Morris <rgm@gnu.org>
8763
8764 * lisp.mk (lisp): Remove language/persian.elc.
8765
77c7bcb1
DA
87662012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8767
8768 Cleanup intervals.
8769 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8770 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8771 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8772 Adjust comment. Move under #if 0.
77c7bcb1
DA
8773 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8774 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8775
9c08a8d4
DA
87762012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8777
8778 Check total length of intervals with eassert.
8779 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8780 * intervals.c: Change all users to eassert.
8781
26d16b35
EZ
87822012-08-07 Eli Zaretskii <eliz@gnu.org>
8783
14ae4239
BT
8784 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8785 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8786 INTERNAL_FIELD in Lisp_Cons.
8787
c644523b
DA
87882012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8789
8790 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8791 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8792 name since all xname users are fixed long time ago. Do not
8793 use INTERNAL_FIELD.
8794 (set_symbol_name, set_symbol_function, set_symbol_plist):
8795 (set_symbol_next, set_overlay_plist): New function.
8796 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8797 (struct Lisp_Overlay): Likewise.
8798 (CVAR, MVAR, SVAR): Remove.
8799 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8800 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8801 * xterm.c: Adjust users.
8802 * .gdbinit: Change to use name field of struct Lisp_Symbol
8803 where appropriate.
8804
6a3d20cc
DA
88052012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8806
8807 Basic functions to set Lisp_Object and pointer slots of intervals.
8808 * intervals.h (interval_set_parent, interval_set_object):
8809 (interval_set_left, interval_set_right, interval_set_plist):
8810 (interval_copy_parent): New function.
8811 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8812 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8813 Adjust indentation.
6a3d20cc
DA
8814 (INTERVAL_SIZE): Remove. Adjust users.
8815 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8816
4d2b044c
DA
88172012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8818
8819 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8820 * process.h (PGET): Remove.
8821 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8822 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8823
d3d50620
DA
88242012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8825
8826 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8827 * window.h (WGET): Remove.
8828 (struct window): Do not use INTERNAL_FIELD.
8829 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8830 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8831 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8832 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8833 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8834 Adjust users.
8835
d10a51dc
CY
88362012-08-07 Chong Yidong <cyd@gnu.org>
8837
8838 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8839 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8840 (Fdelete_window_internal): Signal an error if the window is not on
8841 a live frame (Bug#12025).
8842
e69b0960
DA
88432012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8844
8845 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8846 * frame.h (FGET): Remove.
8847 (struct frame): Do not use INTERNAL_FIELD.
8848 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8849 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8850 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8851 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8852
25a20a3a
JB
88532012-08-06 Juanma Barranquero <lekktu@gmail.com>
8854
8855 * w32.c: Silence compiler warnings.
8856 (map_w32_filename): Remove unused variable `is_fat'.
8857 (chase_symlinks): Add parentheses around expression.
8858
1c6f11f4
GM
88592012-08-06 Glenn Morris <rgm@gnu.org>
8860
1db4583a
GM
8861 * sysdep.c: Respect BROKEN_GETWD.
8862
1c6f11f4
GM
8863 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8864 Let configure handle it.
8865 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8866
2b90362b
DA
88672012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 Use GCALIGNMENT where appropriate.
8870 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8871 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8872 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8873
5f50daf2
EZ
88742012-08-06 Eli Zaretskii <eliz@gnu.org>
8875
14ae4239
BT
8876 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8877 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8878
cbcc7007
SM
88792012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8880
8881 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8882 that should be sufficient for everyone.
8883
4d365fa4
JD
88842012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8885
8886 * keyboard.c (timer_check_2): Add break so timer_check returns next
8887 timeout.
8888
dd86bd82
DA
88892012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8890
8891 Fix Windows build errors introduced after converting to WGET and WSET.
8892 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8893 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8894
054e1668
JD
88952012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8896
8897 * nsterm.m (ns_frame_rehighlight): Use FSET.
8898
8899 * nsmenu.m (ns_update_menubar): Use FSET.
8900
21238f11
DA
89012012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8902
8903 Separate read and write access to Lisp_Object slots of Lisp_Process.
8904 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8905 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8906
077288cf
DA
89072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8908
8909 Separate read and write access to Lisp_Object slots of struct window.
8910 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8911 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8912 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8913 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8914 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8915 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8916 Adjust users.
8917
71688bd7
DA
89182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8919
8920 Fix Windows build errors introduced after converting to FGET and FSET.
8921 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8922 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8923 (w32_judge_scroll_bars): Change to use FSET.
8924 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8925
f99bac93
DA
89262012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8927
8928 Fix replacement typo.
8929 * window.c (replace_window): Set root_window instead of
8930 selected_window. This fixes a total window subsystem
8931 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8932
8c2a0f2d
GM
89332012-08-06 Glenn Morris <rgm@gnu.org>
8934
8935 * lisp.mk (lisp): Add language/persian.elc.
8936
edd74c35
DA
89372012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8938
8939 Separate read and write access to Lisp_Object slots of struct frame.
8940 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8941 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8942 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8943 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8944 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8945
8671676c
AS
89462012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8947
8948 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8949
663e2b3f
DA
89502012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8951
8952 Generalize common compile-time constants.
8953 * lisp.h (header_size, bool_header_size, word_size): Now here.
8954 (struct Lisp_Vector): Add comment.
8955 (struct Lisp_Bool_Vector): Move up to define handy constants.
8956 (VECSIZE, PSEUDOVECSIZE): Simplify.
8957 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8958 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8959 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8960 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8961 * xfont.c, xmenu.c: Use word_size where appropriate.
8962
d32e47af
LM
89632012-08-05 Lawrence Mitchell <wence@gmx.li>
8964
8965 * search.c (Freplace_match): Treat \? in the replacement text
8966 literally (Bug#8161).
8967
e5d9c0d1
CY
89682012-08-05 Chong Yidong <cyd@gnu.org>
8969
8970 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8971 * frame.c (Vdelete_frame_functions):
8972 * emacs.c (Vkill_emacs_hook): Doc fix.
8973
8da0576b
EZ
89742012-08-04 Eli Zaretskii <eliz@gnu.org>
8975
8976 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8977 --with-x-toolkit=no builds.
8978 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8979
02676e5d
CY
89802012-08-04 Chong Yidong <cyd@gnu.org>
8981
8982 * syntax.c (Fmodify_syntax_entry): Doc fix.
8983
97147da9
EZ
89842012-08-04 Eli Zaretskii <eliz@gnu.org>
8985
76151e2c
EZ
8986 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8987 * w32.c (init_environment): Change the default values of many
8988 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8989 them into environment when they were not already defined.
8990 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8991 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8992 (check_windows_init_file): Now external, not static.
8993 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8994 called when Vload_path is already set up.
8995
8996 * w32.h (check_windows_init_file): Add prototype.
8997
8998 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8999 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9000 compatibility with Posix platforms.
9001 (main): Move the call to check_windows_init_file to here from
9002 w32.c.
9003 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9004 any, in the DEFALT argument into the root of the Emacs build or
9005 installation tree, as appropriate.
9006
9007 * callproc.c (init_callproc_1): Call decode_env_path instead of
9008 doing its equivalent by hand.
9009 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9010 the code that sets Vexec_path run on MS-Windows.
9011
9012 * lread.c (init_lread): Add comments to #ifdef's.
9013
97147da9
EZ
9014 * msdos.c (dos_set_window_size, IT_update_begin)
9015 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9016 instead of direct references.
9017
185ee146
PE
90182012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9019
9020 Export DEFAULT_REHASH_* to GDB.
9021 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9022 Now constants, not macros.
9023
8834c57a
PE
90242012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9025
98c6f1e3
PE
9026 Remove unnecessary casts involving pointers.
9027 These casts are no longer needed now that we assume C89 or later,
9028 since they involve casting to or from void *.
9029 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9030 (make_pure_float, make_pure_vector):
9031 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9032 * macros.c (Fstart_kbd_macro):
9033 * menu.c (find_and_return_menu_selection):
9034 * minibuf.c (read_minibuf_noninteractive):
9035 * sysdep.c (closedir):
9036 * xdisp.c (x_produce_glyphs):
9037 * xfaces.c (compare_fonts_by_sort_order):
9038 * xfns.c (x_real_positions, select_visual):
9039 * xselect.c (x_stop_queuing_selection_requests)
9040 (x_get_window_property, x_get_window_property_as_lisp_data):
9041 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9042 Remove unnecessary pointer casts.
9043 * alloc.c (record_xmalloc): New function.
9044 * lisp.h (record_xmalloc): New decl.
9045 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9046 more like a function. This is because the pointer cast is not
9047 needed. All uses changed.
9048 * print.c (print_string, print_error_message): Avoid length recalc.
9049
8834c57a
PE
9050 Improve fix for macroexp crash with debugging (Bug#12118).
9051 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9052 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9053 not supposed to be invoked from the garbage collector.
9054 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9055 (gc_aset): New function, which is like ASET but can be
9056 used in the garbage collector.
9057 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9058 (set_hash_index): Use it instead of ASET.
9059
6dad7178
EZ
90602012-08-03 Eli Zaretskii <eliz@gnu.org>
9061
9062 Support symlinks on latest versions of MS-Windows.
9063 * w32.c: Include winioctl.h and aclapi.h.
9064 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9065 (revert_to_self): Forward declarations of static functions.
9066 <static BOOL g_b_init_get_security_info>:
9067 <g_b_init_create_symbolic_link>: New static flags.
9068 (globals_of_w32): Initialize them to zero.
9069 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9070 (map_w32_filename): Improve commentary. Simplify switch.
9071 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9072 headers (most versions of MinGW w32api don't).
9073 (get_security_info, create_symbolic_link)
9074 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9075 New functions.
9076 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9077 in the argument file name.
9078 (sys_access): Call unc_volume_file_attributes only if
9079 GetFileAttributes fails with network-related error codes.
9080 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9081 have the required privileges.
14ae4239 9082 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
9083 get_file_security_desc.
9084 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
9085 with addition of handling of symlinks and support for 'lstat'.
9086 If possible, get file's attributes and security information by
6dad7178
EZ
9087 handle, not by name. Produce S_IFLNK bit for symlinks, when
9088 called from 'lstat'.
9089 (stat, lstat): New functions, call 'stat_worker'.
9090 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9091 symlinks when the underlying filesystem supports them.
9092
f162bcc3
PE
90932012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9094
79ea6c20
PE
9095 Fix macroexp crash on Windows with debugging (Bug#12118).
9096 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9097 checking subscripts; problem introduced with the recent
9098 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9099 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9100 since it's used in non-static inline functions now.
9101
c0ce93fd
PE
9102 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9103 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 9104
f162bcc3
PE
9105 Use C99-style 'extern inline' if available.
9106 * buffer.h (BUFFER_INLINE):
9107 * category.h (CATEGORY_INLINE):
9108 * character.h (CHARACTER_INLINE):
9109 * charset.h (CHARSET_INLINE):
9110 * composite.h (COMPOSITE_INLINE):
9111 * dispextern.h (DISPEXTERN_INLINE):
9112 * lisp.h (LISP_INLINE):
9113 * systime.h (SYSTIME_INLINE):
9114 New macro, replacing 'static inline' in this header.
9115 * buffer.h, category.h, character.h, charset.h, composite.h:
9116 * dispextern.h, lisp.h, systime.h:
9117 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9118 * alloc.c (LISP_INLINE):
9119 * buffer.c (BUFFER_INLINE):
9120 * category.c (CATEGORY_INLINE):
9121 * character.c (CHARACTER_INLINE):
9122 * charset.c (CHARSET_INLINE):
9123 * composite.c (COMPOSITE_INLINE):
9124 * dispnew.c (DISPEXTERN_INLINE):
9125 * sysdep.c (SYSTIME_INLINE):
9126 Define to EXTERN_INLINE, so that the corresponding functions
9127 are compiled into code.
9128 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9129 (INLINE_HEADER_END): New macros.
9130 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9131 since it's used in non-static inline functions now.
a8333d03 9132 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 9133
837b365b
GM
91342012-08-02 Glenn Morris <rgm@gnu.org>
9135
d66b744d
GM
9136 * s/: Remove empty directory.
9137
837b365b
GM
9138 * s/ms-w32.h: Move to ../nt/inc.
9139 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9140 Update for new ms-w32.h location.
9141
13294f95
PE
91422012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9143
9144 Port to Solaris 8.
9145 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9146
90df0db3
GM
91472012-08-02 Glenn Morris <rgm@gnu.org>
9148
9149 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9150 hard-coding the path separator.
9151
4939150c
PE
91522012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9153
9154 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9155 This how ASET and AREF are supposed to work, and makes
9156 it easier to think about future improvements. See
9157 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9158 * charset.h (set_charset_attr): New function.
9159 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9160 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9161 (aref_addr): New function. All uses of &AREF(...) changed.
9162 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9163 (set_hash_index): New functions. All lvalue-style uses of
9164 HASH_KEY etc. changed.
9165 * keyboard.c (set_prop): New function. All lvalue-style uses
9166 of PROP changed.
9167
947b2afd
AA
91682012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9169
9170 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9171 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9172 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9173 * nsfns.m (ns_set_name_as_filename): Likewise.
9174 * nsmenu.m (ns_update_menubar): Likewise.
9175 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9176
4f5d0325
EZ
91772012-08-01 Eli Zaretskii <eliz@gnu.org>
9178
2008beae
EZ
9179 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9180 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9181 objects.
2008beae 9182
4f5d0325
EZ
9183 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9184
fe3cc771
GM
91852012-08-01 Glenn Morris <rgm@gnu.org>
9186
9187 * s/msdos.h: Remove file.
9188 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9189 * Makefile.in (S_FILE): Remove.
9190 (config_h): Remove S_FILE.
9191
c90acc54
JB
91922012-08-01 Juanma Barranquero <lekktu@gmail.com>
9193
9194 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9195 Remove; moved to nt/config.nt.
9196
d8a05828
DA
91972012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9198
9199 Use INTERNAL_FIELD for conses and overlays.
9200 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9201 Remove obsolete comment.
9202 (MVAR): New macro.
9203 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9204 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9205
8271d590
DA
92062012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9207
9208 Use INTERNAL_FIELD for symbols.
9209 * lisp.h (SVAR): New macro. Adjust users.
9210 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9211 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9212
3193acd2
DA
92132012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9214
9215 Use INTERNAL_FIELD for processes.
9216 * process.h (PVAR): New macro. Adjust style.
9217 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9218 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9219
3a45383a
DA
92202012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9221
9222 Use INTERNAL_FIELD for windows.
9223 * window.h (WVAR): New macro.
9224 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9225 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9226 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9227 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9228 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9229 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9230
c1dbc63c
PE
92312012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9234
5c0c0e8a
GM
92352012-08-01 Glenn Morris <rgm@gnu.org>
9236
9237 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9238 Move to configure.ac.
9239
552a99b4
JB
92402012-08-01 Juanma Barranquero <lekktu@gmail.com>
9241
9242 * makefile.w32-in (CONFIG_H): Update dependencies.
9243 (CONF_POST_H): New macro.
9244
9245 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9246
8d8e2dfe
GM
92472012-07-31 Glenn Morris <rgm@gnu.org>
9248
bc96620a
GM
9249 * Makefile.in (S_FILE): No longer set by configure.
9250
476b1b2d
GM
9251 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9252 is available.
9253 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9254
b2c7a106
GM
9255 * process.h (NULL_DEVICE):
9256 * emacs.c (SEPCHAR):
9257 * editfns.c (USER_FULL_NAME): Let configure set them.
9258
d53d062a
GM
9259 * s/README, s/template.h: Remove files.
9260
4515017f
GM
9261 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9262
8d8e2dfe
GM
9263 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9264 Move to configure.ac.
9265
5b20b3cc
EZ
92662012-07-31 Eli Zaretskii <eliz@gnu.org>
9267
1e0afd9a
EZ
9268 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9269 resulting renaming of 'struct frame' members.
9270
5b20b3cc
EZ
9271 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9272
9273 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9274 after introduction of FVAR.
9275
f1310128
JD
92762012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9277
79e721e0
JD
9278 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9279
9280 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9281 instead of compositeToPoint.
9282 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9283
8d7c7eed 9284 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9285
e34f7f79
DA
92862012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9287
9288 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9289 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9290 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9291 (BVAR): Change to use INTERNAL_FIELD.
9292 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9293 (KVAR): Change to use INTERNAL_FIELD.
9294 * frame.h (FVAR): New macro.
9295 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9296 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9297 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9298 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9299 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9300
c09bfb2f
DA
93012012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9302
9303 Miscellaneous fixes for non-default X toolkits.
9304 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9305 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9306 Move under #ifdef USE_LUCID.
9307 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9308 definition and usage to avoid warnings.
9309
14c114ae
JD
93102012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9311
9312 * nsterm.m (openFiles): Fix previous checkin.
9313
3bd21e82
PE
93142012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9315
9316 * indent.c (compute_motion): Remove unused local.
9317
c1529ded
GM
93182012-07-31 Glenn Morris <rgm@gnu.org>
9319
400d5621
GM
9320 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9321
268e2432
GM
9322 * conf_post.h [USG5_4]:
9323 Move remaining contents of s/usg5-4-common.h here.
9324 * s/usg5-4-common.h: Remove file.
9325
7552f3ee
GM
9326 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9327 * s/irix6-5.h: Remove file.
9328
6a381852
GM
9329 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9330 * s/darwin.h: Remove file.
9331
c1529ded
GM
9332 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9333 * s/hpux10-20.h: Remove file, which is now empty.
9334
b429a4ee
GM
93352012-07-30 Glenn Morris <rgm@gnu.org>
9336
9337 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9338 * Makefile.in (config_h): Add conf_post.h.
9339 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9340
adff3182
JD
93412012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9342
9343 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9344 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9345 (openFile, openTempFile, openFileWithoutUI, openFiles):
9346 Open files only if ns_do_open_file.
adff3182 9347
c32af1e4
PE
93482012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9349
7393bcbb
PE
9350 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9351 This no-op macro hasn't been needed for many years.
9352 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9353
c32af1e4
PE
9354 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9355 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9356 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9357 gdb_make_enums_visible.
9358 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9359 (DIRECTORY_SEP): Now a constant, not a macro.
9360
302fc036
EZ
93612012-07-30 Eli Zaretskii <eliz@gnu.org>
9362
9363 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9364 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9365
9366 * w32term.c <w32_keyboard_codepage>: Renamed from
9367 keyboard_codepage and now external. All users changed.
9368
9369 * w32term.h: Add declaration of w32_keyboard_codepage.
9370
9371 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9372 the codepage to translate keys to Unicode. If this argument is
9373 -1, use the value returned by GetConsoleCP. All callers changed.
9374
88fb40b4
PE
93752012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9376
0aee6912
PE
9377 Update .PHONY listings in makefiles.
9378 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9379 bootstrap-clean, distclean, maintainer-clean, versioclean,
9380 extraclean, frc.
9381
88fb40b4
PE
9382 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9383 This is a bit clearer. Fix some commentary typos.
9384
0a763bd1
GM
93852012-07-30 Glenn Morris <rgm@gnu.org>
9386
32bac6d6
GM
9387 * s/netbsd.h: Let configure include signal.h if needed.
9388 Remove file, which is now empty.
9389
b65e7c46
GM
9390 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9391 Let configure set them.
9392 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9393 No more need to undefine.
0a763bd1 9394
169304bd
AS
93952012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9396
9397 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9398 non-single-byte char when adding meta modifier. (Bug#12090)
9399
6cd7a139
DA
94002012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9401
9402 Convert safe_call to use variable number of arguments.
9403 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9404 (safe_call2): Fix comment.
9405 * lisp.h (safe_call): Adjust prototype.
9406 * coding.c (encode_coding_object): Change to use safe_call2.
9407 * xfaces.c (merge_face_heights): Change to use safe_call1.
9408
d34d6ffc
GM
94092012-07-30 Glenn Morris <rgm@gnu.org>
9410
7b8a48e4 9411 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9412 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9413
d34d6ffc
GM
9414 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9415 Remove empty files.
9416
03a660a6
PE
94172012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9418
9419 Export to GDB most of lisp.h's remaining object-like macros.
9420 * lisp.h (min, max): Move earlier, because they're used earlier now.
9421 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9422 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9423 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9424 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9425 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9426 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9427 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9428 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9429 Now constants, for GDB. They need not be macros.
9430 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9431 Now constants, for GDB, as well as macros, for static initializers.
9432 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9433 Move to after the definition of struct Lisp_Char_Table,
9434 since the former now needs that type defined.
9435 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9436 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9437 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9438 New enums, for gdb_make_enums_visible.
9439 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9440 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9441 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9442 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9443 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9444 enum maxargs, enum MAX_ALLOCA.
9445 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9446 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9447 no longer needed, now that they are done in lisp.h.
9448
e499d0ee
DA
94492012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9450
9451 Cleanup string bytes checking.
9452 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9453 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9454 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9455 (check_sblock, compact_small_strings): Simplify.
9456
d5040d2d
PE
94572012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9458
9459 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9460 These macros are confusing and no longer need to be defined, as
9461 the enum values now suffice. All uses replaced with definiens.
9462 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9463
7f259ae6
JB
94642012-07-29 Juanma Barranquero <lekktu@gmail.com>
9465
9466 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9467 ($(BLD)/w32console.$(O)): Update dependencies.
9468
7e63e0c3
DA
94692012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9470
9471 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9472 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9473 time. Adjust users.
9474 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9475
ffd817eb
JD
94762012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9477
9478 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9479 setting sitelisp (Bug#12010).
9480
417a7a0e
EZ
94812012-07-29 Eli Zaretskii <eliz@gnu.org>
9482
14ae4239 9483 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9484
9485 * w32heap.c (cache_system_info):
9486 * w32.c (sys_rename):
9487 * w32proc.c (find_child_console, sys_kill): All users changed.
9488
387d4d92
PE
94892012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9490
9491 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9492
55a6cca6
EZ
94932012-07-29 Eli Zaretskii <eliz@gnu.org>
9494
9495 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9496
dbcf001c
DA
94972012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9498
9499 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9500 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9501 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9502
e2688e4a
DA
95032012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9504
9505 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9506 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9507 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9508 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9509 (replace_range, replace_range_2, del_range_2): Change to eassert.
9510 * marker.c (byte_char_debug_check): Adjust style.
9511
b46a6a83
PE
95122012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9513
9514 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9515 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9516 long-ago-commented-out code that talks about "WIN32".
9517 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9518 All uses changed.
9519
e32a5799
PE
95202012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9521
9522 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9523 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9524 Simplify by using alignof.
9525 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9526 * lisp.h: Include <stdalign.h>.
9527 (GCALIGNMENT): New macro and constant.
9528 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9529 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9530 (stdalign): New macro, if not already defined.
9531
df81cd29
EZ
95322012-07-28 Eli Zaretskii <eliz@gnu.org>
9533
01bd1b0d
EZ
9534 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9535 * w32inevt.c: Include w32inevt.h.
9536 (w32_read_console_input): New inline function, calls either
9537 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9538 w32_console_unicode_input.
9539 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9540 (w32_kbd_patch_key, key_event): Use the codepage returned by
9541 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9542 (key_event): use uChar.UnicodeChar only if
9543 w32_console_unicode_input is non-zero.
9544
9545 * w32console.c: Include w32heap.h.
9546 <w32_console_unicode_input>: New global variable.
9547 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9548 family of Windows, zero otherwise.
9549
9550 * w32inevt.h: Declare w32_console_unicode_input.
9551
df81cd29
EZ
9552 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9553 --without-x. (Bug#11742)
9554
c20fdd9e
PE
95552012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9556
9557 Adjust GDB to reflect pvec_type changes (Bug#12036).
9558 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9559 2012-07-04 changes to pseudovector representation.
9560 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9561
32770973 95622012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9563
9564 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9565 bus address.
9566 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9567
3438fe21
EZ
95682012-07-27 Eli Zaretskii <eliz@gnu.org>
9569
bcfbc9de
EZ
9570 * alloc.c (listn): Fix the order the arguments are consed onto the
9571 list.
9572
3438fe21
EZ
9573 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9574 enumeration constants, as PURE and HEAP are too general, and clash
9575 with other headers and sources, such as gmalloc.c and the
9576 MS-Windows system headers. All users changed.
9577
eeaea515
DA
95782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9579
9580 Revert last save_excursion_save and save_excursion_restore changes.
9581 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9582 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9583
073c88c2
DA
95842012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9585
9586 Fix recently-introduced typos in Windows port.
9587 Reported by Martin Rudalics <rudalics@gmx.at>.
9588 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9589 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9590
4706125e
PE
95912012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 Improve GDB symbol export (Bug#12036).
9594 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9595 arms of an 'if', not using conditional expressions; otherwise GDB
9596 complains about the types in the unevaluated arm when the argument
9597 is an integer literal.
9598 (xgetint): Simplify expression.
9599 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9600 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9601 Zaretskii in <http://bugs.gnu.org/12036#13>.
9602 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9603 needed now that we have gdb_make_enums_visible.
9604 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9605 (enum enum_USE_LSB_TAG):
9606 New enum types, packaging up enums that need to be exported to GDB.
9607
694b6c97
DA
96082012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9609
9610 Utility function to make a list from specified amount of objects.
9611 * lisp.h (enum constype): New datatype.
9612 (listn): New prototype.
9613 * alloc.c (listn): New function.
9614 (Fmemory_use_count, syms_of_alloc): Use it.
9615 * buffer.c (syms_of_buffer): Likewise.
9616 * callint.c (syms_of_callint): Likewise.
9617 * charset.c (define_charset_internal): Likewise.
9618 * coding.c (syms_of_coding): Likewise.
9619 * keymap.c (syms_of_keymap): Likewise.
9620 * search.c (syms_of_search): Likewise.
9621 * syntax.c (syms_of_syntax): Likewise.
9622 * w32.c (init_environment): Likewise.
9623 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9624 * xdisp.c (syms_of_xdisp): Likewise.
9625 * xfns.c (syms_of_xfns): Likewise.
9626
6195f384
DA
96272012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9628
9629 Fast save_excursion_save and save_excursion_restore.
9630 * lisp.h (struct Lisp_Excursion): New data type.
9631 (PVEC_EXCURSION): New pseudovector type.
9632 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9633 to deal with it. Adjust comments.
9634 (init_marker, attach_marker): New prototype.
9635 (unchain_marker): Adjust prototype.
9636 * marker.c (attach_marker): Change to global.
9637 (init_marker): New function.
9638 * alloc.c (Fmake_marker, build_marker): Use it.
9639 (build_marker): More easserts.
9640 (mark_object): Handle struct Lisp_Excursion.
9641 * editfns.c (save_excursion_save, save_excursion_restore):
9642 Reimplement to use struct Lisp_Excursion. Add comments.
9643
5eceb8fb
PE
96442012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9645
9646 Fix export of symbols to GDB (Bug#12036).
9647 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9648 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9649 emacs.c, as this is a more-suitable home. Had this been done earlier
9650 the fix for 12036 would have avoided some of the problems noted in
9651 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9652 would have been more obvious.
562157c8
PE
9653 * emacs.c: Do not include <verify.h>; no longer needed.
9654 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9655 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9656 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9657 Remove; now done in lisp.h.
9658 * lisp.h (PUBLISH_TO_GDB): New macro.
9659 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9660 (DATA_SEG_BITS): Use it.
9661 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9662 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9663 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9664 not be usable in #if. This simplifies things.
9665
d6749401
JB
96662012-07-26 Juanma Barranquero <lekktu@gmail.com>
9667
9668 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9669
1781b9e9
PE
96702012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9671
d89518db 9672 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9673 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9674 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9675 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9676 Adjust to changes in lisp.h and emacs.c, by using
9677 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9678 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9679 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9680 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9681 instead of gdb_valbits.
9682 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9683 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9684 instead of gdb_array_mark_flag.
9685 (xboolvector): Get size from $->size, not $->header.size.
9686 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9687 (xreload, hook-run, hookpost-run): Remove.
9688 * emacs.c: Include <verify.h>.
9689 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9690 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9691 Remove.
9692 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9693 (gdb_USE_LSB_TAG): New enum constants.
9694 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9695 Also define these as enum constants, so they're visible to GDB.
9696 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9697 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9698 as constants, so they're visible to GDB.
9699 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9700 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9701 Now enum constants, not macros, so they're visible to GDB.
9702 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9703 more convenient now. All uses changed.
9704 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9705 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9706
3628596a
DA
97072012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9708
9709 Explicitly free restriction data that are not needed anymore.
9710 * editfns.c (save_restriction_restore): Free restriction data.
9711
7abaf5cc
SM
97122012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9713
9714 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9715 add argument, tune behavior, and adjust all callers.
9716
71f88e00
PE
97172012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9718
9719 Use typedef for EMACS_INT, EMACS_UINT.
9720 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9721 than macros. This simplifies debugging in the usual case, since
9722 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9723 and it allows expressions involving EMACS_INT casts.
9724 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9725
57ec3034
JD
97262012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9727
9728 * nsterm.m (ns_read_socket): Return early if there is a modal
9729 window (Bug#12043).
9730
8137e7b3
MR
97312012-07-25 Martin Rudalics <rudalics@gmx.at>
9732
9733 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9734 that FOCUS-FRAME can be omitted.
9735
04e9897c
DA
97362012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 Adjust buffer text indirection counters at the end of Fkill_buffer.
9739 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9740 buffer is definitely dead. This should really fix an issue reported
9741 by Christoph Scholtes again. (Bug#12007).
9742 (init_buffer_once): Initialize indirection counters of
9743 buffer_defaults and buffer_local_symbols (for sanity and safety).
9744
8a0484e1
EZ
97452012-07-24 Eli Zaretskii <eliz@gnu.org>
9746
9747 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9748 and continuation glyphs on tooltip frames, leave them at zero.
9749 Avoids continued lines in tooltips. (Bug#11832)
9750
fa691a83
DA
97512012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9752
9753 Simplify copy_overlay.
04e9897c 9754 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9755 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9756
436bc8e0
EZ
97572012-07-23 Eli Zaretskii <eliz@gnu.org>
9758
9759 * print.c (print_object): Don't crash when a frame's name is nil
9760 or invalid. (Bug#12025)
9761
9762 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9763 it signals an error when a tooltip frame is being created.
9764
d7a7fda3
DA
97652012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9766
9767 Cleanup miscellaneous objects allocation and initialization.
9768 * alloc.c (allocate_misc): Change to static. Add argument to
9769 specify the subtype. Adjust comment and users.
9770 (build_overlay): New function.
9771 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9772 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9773 (allocate_misc): Remove prototype.
9774 (build_overlay): Add prototype.
9775
97762012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9777
9778 Swap buffer text indirection counters in Fbuffer_swap_text.
9779 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9780 This avoids crash reported by Christoph Scholtes at
9781 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9782
9d7fa573
JD
97832012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9784
9785 * nsmenu.m (Popdown_data): New struct.
9786 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9787 free Popdown_data.
9788 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9789 (initWithContentRect): Make imgView and contentView non-static
9790 and autorelease them. Also autorelease img and matrix (Bug#12005).
9791 (dealloc): Remove (Bug#12005).
9792
0dd6d66d
DA
97932012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9794
9795 Adjust consing_since_gc when objects are explicitly freed.
9796 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9797 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9798 (free_cons, free_misc): Subtract object size from consing_since_gc.
9799
d36d71df
DA
98002012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9801
9802 Simplify and cleanup markers positioning code.
9803 * marker.c (attach_marker): More useful eassert.
9804 (live_buffer, set_marker_internal): New function.
9805 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9806 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9807
fb9ea40f
PE
98082012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9809
9810 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9811 as it's limited by the amount of memory, not by INT_MAX.
9812
2d5c5f7d
EZ
98132012-07-21 Eli Zaretskii <eliz@gnu.org>
9814
07fb592e
EZ
9815 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9816 in special-event-map. See the discussion at
9817 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9818 for the reasons.
9819
37a9eac8 9820 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9821 info.dwItemData. Fixes crashes on 64-bit Windows.
9822 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9823
c4328746
JD
98242012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9825
fc0c31f8 9826 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9827 (conversationIdentifier): Return value is NSInteger.
784051c4 9828 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9829
6e5d1c12
CY
98302012-07-21 Chong Yidong <cyd@gnu.org>
9831
9832 * window.c (decode_any_window): Signal an error if the window is
9833 on a dead frame (Bug#11984).
9834
9928463d
DA
98352012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9836
9837 Add indirection counting to speed up Fkill_buffer.
9838 * buffer.h (struct buffer): New member.
9839 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9840 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9841 base buffer indirection counter.
9842 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9843 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9844 through buffer list if indirection counter is 0.
9845
f8643a6b
DA
98462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9847
9848 Extend the value returned by Fgarbage_collect with heap statistics.
9849 * alloc.c (Qheap): New symbol.
9850 (syms_of_alloc): DEFSYM it.
9851 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9852 (Fmemory_free): Remove.
9853 (syms_of_alloc): Don't defsubr it.
9854 * buffer.c (Fcompact_buffer): Remove.
9855 (syms_of_buffer): Don't defsubr it.
9856
dac616ff
DA
98572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9858
9859 Make maybe_gc inline.
9860 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9861 * lisp.h (consing_since_gc, gc_relative_threshold)
9862 (memory_full_cons_threshold): Revert declaration.
9863 (maybe_gc): Remove prototype, define as inline.
9864 * alloc.c: Remove old commented-out code.
9865 (consing_since_gc, gc_relative_threshold)
9866 (memory_full_cons_threshold): Revert to global.
9867 (maybe_gc): Remove.
9868
d7ea76b4
DA
98692012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9870
9871 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9872 * lisp.h (build_unibyte_string): New function.
9873 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9874 * sysdep.c, w32fns.c, xfns.c: Use it.
9875 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9876 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9877 Adjust users accordingly.
9878 * font.h (font_open_by_name): Adjust prototype.
9879
765e61e3
DA
98802012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9881
9882 Cleanup calls to Fgarbage_collect.
9883 * lisp.h (maybe_gc): New prototype.
9884 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9885 Remove declarations.
9886 * alloc.c (maybe_gc): New function.
9887 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9888 Make them static.
9889 * bytecode.c (MAYBE_GC): Use maybe_gc.
9890 * eval.c (eval_sub, Ffuncall): Likewise.
9891 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9892 to avoid dependency from auto-save feature.
9893
52b852c7
PE
98942012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9895
9896 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9897 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9898 'for_each_per_buffer_object_at'.
9899 All uses changed. It's better to use upper-case for macros that
9900 cannot be implemented as functions, to give the reader a clue
9901 that they're special.
9902
5db81e33
SM
99032012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9904
9905 * alloc.c (Fgarbage_collect): Tweak docstring.
9906
5b835e1d
DA
99072012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9908
9909 Tweak the value returned from Fgarbage_collect again.
9910 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9911 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9912 Adjust documentation.
9913 (total_vector_bytes): Rename to total_vector_slots, adjust
9914 accounting.
9915 (total_free_vector_bytes): Rename to total_free_vector_slots,
9916 adjust accounting.
9917 (Qstring_bytes, Qvector_slots): New symbols.
9918 (syms_of_alloc): DEFSYM them.
9919
9cd47b72
DA
99202012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9921
9922 Buffer compaction primitive which may be used from Lisp.
9923 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9924 (syms_of_buffer): Register Fcompact_buffer.
9925 * alloc.c (Fgarbage_collect): Use compact_buffer.
9926 * buffer.h (compact_buffer): New prototype.
9927 (struct buffer_text): New member.
9928
d17337e5
DA
99292012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9930
9931 New macro to iterate over all buffers, miscellaneous cleanups.
9932 * lisp.h (all_buffers): Remove declaration.
9933 * buffer.h (all_buffers): Add declaration, with comment.
9934 (for_each_buffer): New macro.
9935 * alloc.c (Fgarbage_collect, mark_object): Use it.
9936 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9937 (init_buffer): Likewise.
9938 * data.c (Fset_default): Likewise.
9939 * coding.c (code_conversion_restore): Remove redundant check
9940 for dead buffer.
9941 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9942
60cfd278
AS
99432012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9944
9945 Fix bug that created negative-length intervals.
9946 * intervals.c (merge_interval_right, merge_interval_left):
9947 Do not zero out this interval if it is absorbed by its children,
9948 as this interval's total length doesn't change in that case. See
9949 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9950
d06714cb
PE
99512012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9952
83713154
PE
9953 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9954 when invoking (make-bool-vector N t) and N is a positive
9955 multiple of 8 -- the last 8 bits were mistakenly cleared.
9956
d06714cb
PE
9957 Remove some struct layout assumptions in bool vectors.
9958 * alloc.c (bool_header_size): New constant.
9959 (header_size, word_size): Move earlier, as they're now used earlier.
9960 Use 'word_size' in a few more places, where it's appropriate.
9961 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9962 padding before the data member of a bool vector.
9963 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9964 than doing the check by hand with an abort ().
9965
464d5a5e
SM
99662012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9967
5fbc0409
SM
9968 * eval.c (Fdefvar): Don't check constants since we only set the var if
9969 it's not yet defined anyway (bug#11904).
9970
464d5a5e
SM
9971 * lisp.h (last_undo_boundary): Declare new var.
9972 * keyboard.c (command_loop_1): Set it.
9973 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9974 were auto-added by the command loop (bug#11774).
9975
8dc2e44a
AS
99762012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9977
9978 * w32font.c (Qsymbol): Remove local definition.
9979 (syms_of_w32font): Don't DEFSYM it.
9980
169925ec
DA
99812012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9982
9983 Fix sweep_vectors to handle large bool vectors correctly.
9984 * alloc.c (sweep_vectors): Account total_vector_bytes for
9985 bool vectors larger than VBLOCK_BYTES_MAX.
9986
5fbfb018
CY
99872012-07-18 Chong Yidong <cyd@gnu.org>
9988
9989 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9990 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9991
3ab6e069
DA
99922012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9993
9994 Return more descriptive data from Fgarbage_collect.
9995 Suggested by Stefan Monnier in
9996 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9997 * alloc.c (bounded_number): New function.
9998 (total_buffers, total_vectors): New variable.
9999 (total_string_size): Rename to total_string_bytes, adjust users.
10000 (total_vector_size): Rename to total_vector_bytes, adjust users.
10001 (sweep_vectors): Account total_vectors and total_vector_bytes.
10002 (Fgarbage_collect): New return value. Adjust documentation.
10003 (gc_sweep): Account total_buffers.
10004 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10005 (VECTOR_SIZE): Remove.
10006 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10007 (Qinterval, Qmisc): New symbols.
10008 (syms_of_data): Initialize them.
10009 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10010 (Qcons, Qbuffer): New declarations.
10011
6d02fe5b
PE
100122012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10013
10014 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10015 Round up, not down. Improve doc.
10016
b7ffe040
DA
100172012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10018
10019 Restore old code in allocate_string_data to avoid Faset breakage.
10020 Reported by Julien Danjou <julien@danjou.info> in
10021 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10022 * alloc.c (allocate_string_data): Restore old code with minor
10023 adjustments, fix comment to explain this subtle issue.
10024
4dc7c8d5
SM
100252012-07-17 Eli Zaretskii <eliz@gnu.org>
10026
10027 Remove FILE_SYSTEM_CASE.
10028 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10029
10030 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10031 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10032 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10033 call-process-region passes it through expand-file-name.
10034
10035 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10036
100372012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10038
10039 Fix crash when creating indirect buffer (Bug#11917)
10040 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10041 Don't handle unbound variables specially if non-zero.
10042 (Fbuffer_local_variables): Pass zero.
10043 (clone_per_buffer_values): Pass non-zero.
10044
100452012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10046
10047 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10048 to make the loop interruptible.
10049
100502012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10051
10052 * gnutls.c (emacs_gnutls_handshake): Only retry if
10053 GNUTLS_E_INTERRUPTED.
10054
cce7fefc
DA
100552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10056
10057 Cleanup and convert miscellaneous checks to eassert.
10058 * alloc.c (mark_interval): Fix comment, partially rephrase
10059 old comment from intervals.h (see below).
10060 * intervals.c (find_interval, adjust_intervals_for_insertion)
10061 (delete_interval, adjust_intervals_for_deletion)
10062 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10063 Convert to eassert.
10064 (adjust_intervals_for_insertion, make_new_interval):
10065 Remove obsolete and unused code.
10066 * intervals.h (struct interval): Remove obsolete comment.
10067 * textprotp.c (erase_properties): Remove unused code.
10068 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10069 (Fremove_list_of_text_properties): Convert to eassert.
10070
9ea10cc3
CY
100712012-07-17 Chong Yidong <cyd@gnu.org>
10072
10073 * editfns.c (Finsert_char): Doc fix.
10074
3900d5de
DA
100752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10076
10077 Fix previous change to make Fmemory_free always accurate.
10078 * alloc.c (make_interval): Update total_free_intervals.
10079 (make_float): Likewise for total_free_floats.
10080 (free_cons, Fcons): Likewise for total_free_conses.
10081 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10082 Likewise for total_free_vector_bytes.
10083 (Fmake_symbol): Likewise for total_free_symbols.
10084 (bytes_free): Remove.
10085
7098646f
DA
100862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10087
10088 Simple free memory accounting feature.
10089 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10090 (sweep_vectors): Accumulate size of free vectors.
10091 (Fgarbage_collect): Setup bytes_free.
10092 (Fmemory_free): New function.
10093 (syms_of_alloc): Register it.
10094
22657b40
DA
100952012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10096
10097 Cleanup overlays checking.
10098 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10099 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10100 eassert and OVERLAYP.
10101 (sort_overlays): Change to use OVERLAYP.
10102
ddfc8813
RK
101032012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10104
10105 * editfns.c (Finsert_char): Make it interactive, and make the
10106 second arg optional. Copy interactive spec and docstring from
10107 ucs-insert.
10108
7c26cf3c
PE
101092012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10110
10111 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10112 Unlike the other wrapped functions, fabs has an unspecified
10113 effect on errno.
10114
5d127af9
JD
101152012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10116
10117 * nsterm.m (keyDown): Interpret flags without left/right bits
10118 as the left key (Bug#11670).
10119
6a0dd1d7
DA
101202012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10121
10122 Remove empty and useless init functions.
10123 * lisp.h (init_character_once, init_fns, init_image)
10124 (init_filelock, init_sound): Remove prototype.
10125 * character.c (init_character_once): Remove.
10126 * filelock.c (init_filelock): Likewise.
10127 * fns.c (init_fns): Likewise.
10128 * image.c (init_image): Likewise.
10129 * sound.c (init_sound): Likewise.
10130 * emacs.c (main): Adjust accordingly.
10131
7a6136fd
DA
101322012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10133
10134 * gtkutil.h: Tiny cleanups.
10135 (use_old_gtk_file_dialog): Remove useless declaration.
10136 (xg_uses_old_file_dialog): Add suggested const attribute.
10137
ce811ad9
EZ
101382012-07-15 Eli Zaretskii <eliz@gnu.org>
10139
10140 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10141 (bidi_paragraph_init): Use it to limit search forward for a strong
10142 directional character in abnormally large paragraphs full of
10143 neutral or weak characters. (Bug#11943)
10144
c9adfeaa
SF
101452012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10146
10147 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10148 the toolbar (Bug#9451).
10149 (xg_make_tool_item): Give the widget event box a transparent
10150 background.
10151
fff62aa9
DA
101522012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10153
10154 Cleanup basic allocation variables and functions.
10155 * alloc.c (ignore_warnings, init_intervals, init_float)
10156 (init_cons, init_symbol, init_marker): Remove.
10157 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10158 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10159 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10160 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10161 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10162 (staticidx, init_alloc_once, init_strings, free_ablock):
10163 Remove redundant initialization.
10164 * fns.c (init_weak_hash_tables): Remove.
10165 * lisp.h (init_weak_hash_tables): Remove prototype.
10166
9730daca
DA
101672012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10168
10169 Use zero_vector where appropriate.
10170 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10171 accordingly.
10172 * lisp.h (zero_vector): New declaration.
10173 * font.c (null_vector): Remove.
10174 (syms_of_font): Remove initialization and staticpro.
10175 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10176 * keymap.c (Faccessible_keymaps): Likewise.
10177
2e2d2a13
LL
101782012-07-15 Leo Liu <sdl.web@gmail.com>
10179
10180 * fringe.c: Fix typo in comments.
10181
cd276f6e
LL
101822012-07-14 Leo Liu <sdl.web@gmail.com>
10183
10184 * fringe.c: Add a new bitmap exclamation-mark.
10185
5a1131d9
EZ
101862012-07-14 Eli Zaretskii <eliz@gnu.org>
10187
10188 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10189
10190 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10191 (HAVE_MENUS): Don't define, defined by editing config.in with
10192 msdos/sed2v2.inp.
10193 (GMALLOC_INHIBIT_VALLOC): Don't define.
10194 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10195
22e983b7
JB
101962012-07-14 Juanma Barranquero <lekktu@gmail.com>
10197
10198 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10199
5b3f250f
GM
102002012-07-14 Glenn Morris <rgm@gnu.org>
10201
10202 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10203 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10204 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10205
33d63ff4
GM
102062012-07-13 Glenn Morris <rgm@gnu.org>
10207
5b633342
GM
10208 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10209
33d63ff4
GM
10210 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10211 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10212
b55b9f85
JD
102132012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10214
0dc8cf50
JD
10215 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10216 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10217 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10218 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10219 where appropriate.
10220 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10221 as boolean expression.
10222 (x_set_window_size): Remove unused variable toolbar.
10223 (ns_get_color_default, ns_mod_to_lisp): Remove.
10224 (ns_mouse_position): Remove unused variables xchar and ychar.
10225 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10226 (ns_set_vertical_scroll_bar): Remove unused variable count.
10227 (ns_delete_terminal): Remove unused variable i.
10228 (ns_term_init): Remove unused variables r, g and b.
10229 (mouseDown): Remove unused variable window.
10230 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10231 (initFrameFromEmacs): Remove unused variable vbextra.
10232 (mouseEntered): Remove unused variables p and dpyinfo.
10233 (mouseExited): Remove unused variables p and r.
10234 (ns_define_frame_cursor, ns_clear_frame_area)
10235 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10236 (menuDown): Assign [sender tag] to variable and cast the variable.
10237
10238 * nsterm.h (menuDown): Add id as type to argument sender.
10239 (ns_display_info_for_name): Add Lisp_Object argument.
10240 (ns_term_init): Add Lisp_Object argument.
10241 (ns_map_event_to_object): Add void argument.
10242 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10243 prototype with arguments and only declare if __OBJC__.
10244 (nxatoms_of_nsselect): Add void argument.
10245 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10246 (ns_alloc_autorelease_pool): Add void argument.
10247 (ns_release_autorelease_pool): Add void* argument.
10248 (ns_get_defaults_value): Add const char* argument.
10249
10250 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10251 (initFromContents): Use SSDATA where appropriate.
10252 (ns_update_menubar): Add braces to ambigous if-else.
10253 (initWithTitle): Put () around assignment in if statement.
10254 (ns_menu_show): Remove unused variables window and keymap.
10255 (update_frame_tool_bar): Remove unused variable selected_p.
10256 (initWithContentRect): Remove unused variable this_cmd_name.
10257
10258 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10259 appropriate.
10260 (setXBMColor): Remove unused variable len.
10261 (setPixmapData): Put () around assignment in loop statement.
10262
10263 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10264 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10265 where appropriate.
10266 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10267 around assignment in loop statement.
10268 (nsfont_open): Remove unused variable i.
10269 (nsfont_open): Remove unused variable len.
10270 (nsfont_draw): Remove unused variable cs.
10271
10272 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10273 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10274 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10275 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10276 (Fns_font_name, Fns_perform_service)
10277 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10278 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10279 (ns_set_name): Remove unused variable view.
10280 (x_set_menu_bar_lines): Remove unused variable olines.
10281 (x_set_tool_bar_lines): Remove unused variable root_window.
10282 (Fns_list_colors): Put () around assignment in while statement.
10283 (Fns_perform_service): Remove unused variable len.
10284 (Fns_display_usable_bounds): Remove unused variable top.
10285 (syms_of_nsfns): Remove unused variable i.
10286
b55b9f85
JD
10287 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10288 memcpy (Bug#11907).
10289
ed9265fc 102902012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10291
10292 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10293 and free it with DestroyExceptionInfo (Bug#11558).
10294
ef099b57
JB
102952012-07-13 Juanma Barranquero <lekktu@gmail.com>
10296
10297 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10298 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10299 Set here, not in nt/config.nt.
10300
ea814a5d
EZ
103012012-07-13 Eli Zaretskii <eliz@gnu.org>
10302
10303 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10304 cursor overflow into the last glyph on display line when the right
10305 fringe is off. (Bug#11832)
10306
1a952767
PE
103072012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 * xdisp.c (produce_special_glyphs): Now static.
10310 * dispextern.h (produce_special_glyphs): Remove decl.
10311
983188fd
GM
103122012-07-13 Glenn Morris <rgm@gnu.org>
10313
8d7c7eed 10314 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10315 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10316
983188fd
GM
10317 * s/usg5-4-common.h (USG, USG5):
10318 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10319 * s/sol2-6.h (SOLARIS2):
10320 * s/irix6-5.h (IRIX6_5):
10321 * s/hpux10-20.h (USG, USG5, HPUX):
10322 * s/gnu-linux.h (USG, GNU_LINUX):
10323 * s/freebsd.h (BSD_SYSTEM):
10324 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10325 * s/cygwin.h (CYGWIN):
10326 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10327 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10328
d1e68667 103292012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10330
10331 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10332
6de0e799
GM
103332012-07-13 Glenn Morris <rgm@gnu.org>
10334
739ae010
GM
10335 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10336
dbee5793
GM
10337 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10338
6de0e799
GM
10339 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10340 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10341
b82da769
GM
103422012-07-12 Glenn Morris <rgm@gnu.org>
10343
4fae5a7a 10344 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10345
10346 * process.c (init_process_emacs): Rename from init_process.
10347 The old name is also the name of a Mach system call.
10348 * lisp.h, emacs.c: Update for this name change.
10349 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10350 longer needed.
10351
5a979817
EZ
103522012-07-12 Eli Zaretskii <eliz@gnu.org>
10353
10354 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10355 memmove call that removes glyphs covered by the left truncation
10356 glyph. Improve commentary.
10357 (display_line): Fix display of continuation glyphs on GUI frames
10358 when the right fringe is turned off and variable-size fonts are
10359 used in the window. Move the code that appends a stretch glyph to
10360 produce_special_glyphs, so that it could be used for truncation
10361 and continuation glyphs alike.
10362 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10363 glyph of a suitably computed width, to align the special glyphs at
10364 the window margin. Code moved from display_line. (Bug#11832)
10365
3e91a053
GM
103662012-07-12 Glenn Morris <rgm@gnu.org>
10367
ba9e4b84
GM
10368 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10369
10370 * s/gnu-linux.h, s/hpux10-20.h:
10371 Do not unconditionally define HAVE_XRMSETDATABASE.
10372
3e91a053
GM
10373 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10374
b300b1f4
PE
103752012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10376
10377 Fix typos that broke OS X build.
10378 Reported by Randal L. Schwartz in
10379 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10380 * nsterm.m (ns_timeout): Add missing local decl.
10381 (ns_get_color): snprintf -> sprintf, to fix typo.
10382
6e777848
GM
103832012-07-12 Glenn Morris <rgm@gnu.org>
10384
3f922c37
GM
10385 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10386 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10387 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10388 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10389
0ab7b23a
GM
10390 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10391 Move PTY_OPEN to configure.
10392
6e777848
GM
10393 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10394 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10395 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10396
4a7edc24
DA
103972012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10398
10399 Use empty_unibyte_string where applicable.
10400 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10401 * lread.c (read1): Likewise.
10402 * xsettings.c (syms_of_xsettings): Likewise.
10403
308aab79
GM
104042012-07-12 Glenn Morris <rgm@gnu.org>
10405
42bd1719
GM
10406 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10407 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10408 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10409 * s/hpux10-20.h (RUN_TIME_REMAP):
10410 * s/bsd-common.h (TABDLY): Move to configure.
10411
10412 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10413
10414 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10415
ea0bbd17 10416 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10417 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10418
10419 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10420
308aab79
GM
10421 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10422 * s/template.h: Move NARROWPROTO to configure.
10423
ee1cf5cf
GM
104242012-07-11 Glenn Morris <rgm@gnu.org>
10425
30fe9bf4
GM
10426 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10427 unused since 2011-01-17 change to systty.h.
10428
ee1cf5cf
GM
10429 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10430 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10431 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10432
63e47e07
PE
104332012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10434
10435 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10436
c43fb4c3
GM
104372012-07-11 Glenn Morris <rgm@gnu.org>
10438
10439 * s/darwin.h, s/gnu-linux.h, s/template.h:
10440 Move INTERRUPT_INPUT to configure.
10441
e8df9267
DA
104422012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10443
10444 Minor adjustments to interning code.
10445 * lisp.h (intern, intern_c_string): Redefine as static inline
10446 wrappers for intern_1 and intern_c_string_1, respectively.
10447 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10448 * lread.c (intern_1, intern_c_string_1, oblookup):
10449 Simplify Vobarray checking.
e8df9267
DA
10450 * font.c (font_intern_prop): Likewise. Adjust comment.
10451 * w32font.c (intern_font_name): Likewise.
10452
34348bd4
AS
104532012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10454
d96a1e0c
AS
10455 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10456
34348bd4
AS
10457 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10458 of Fcar/Fcdr if possible.
10459 * font.c (check_otf_features): Likewise.
10460 * fontset.c (Fnew_fontset): Likewise.
10461 * gnutls.c (Fgnutls_boot): Likewise.
10462 * minibuf.c (read_minibuf): Likewise.
10463 * msdos.c (IT_set_frame_parameters): Likewise.
10464 * xmenu.c (Fx_popup_dialog): Likewise.
10465 * w32menu.c (Fx_popup_dialog): Likewise.
10466
c8add24e
GM
104672012-07-11 Glenn Morris <rgm@gnu.org>
10468
4b575b3c
GM
10469 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10470 since nothing has defined it on these platforms.
10471
09f4e3b0
GM
10472 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10473 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10474
172bedef
GM
10475 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10476 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10477 Move CLASH_DETECTION to configure.
10478
249685df
GM
10479 * s/gnu.h: Remove file, which is now empty.
10480
c8add24e
GM
10481 * s/gnu.h, s/gnu-linux.h:
10482 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10483
b41253a3
JW
104842012-07-11 John Wiegley <johnw@newartisans.com>
10485
10486 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10487 function attribute, so we only use it if it exists in the
10488 compiler.
10489
d923b542
DA
104902012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10491
10492 Avoid call to strlen in fast_c_string_match_ignore_case.
10493 * search.c (fast_c_string_match_ignore_case): Change to use
10494 length argument. Adjust users accordingly.
10495 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10496
5ebbef1d
PE
104972012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10498
bb352260
PE
10499 Assume mkdir, rmdir.
10500 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10501 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10502
57054ddd
PE
10503 Assume rename.
10504 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10505
b747d3f7
PE
10506 Assume perror.
10507 * s/hpux10-20.h (HAVE_PERROR): Remove.
10508 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10509 Remove dummy definition, as this problem was obsolete long ago.
10510
5ebbef1d
PE
10511 Assume strerror.
10512 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10513
984e7f30
DA
105142012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10515
10516 Avoid calls to strlen in font processing functions.
10517 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10518 (font_open_by_name): Change to use length argument.
10519 Adjust users accordingly.
d923b542
DA
10520 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10521 Adjust prototypes.
10522 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10523 Change to return ptrdiff_t.
984e7f30
DA
10524 (xfont_list_pattern, xfont_match): Use length returned by
10525 xfont_decode_coding_xlfd.
10526 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10527
20e94fdd
GM
105282012-07-11 Glenn Morris <rgm@gnu.org>
10529
9d596af3
GM
10530 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10531 Move DONT_REOPEN_PTY to configure.
10532
20e94fdd
GM
10533 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10534 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10535
e99a530f
PE
105362012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10537
22ffb973
PE
10538 Remove "#define unix" that is no longer needed (Bug#11905).
10539 * s/aix4-2.h (unix): Remove; no longer needed.
10540
e9a9ae03
PE
10541 EMACS_TIME simplification (Bug#11875).
10542 This replaces macros (which typically do not work in GDB)
10543 with functions, typedefs and enums, making the code easier to debug.
10544 The functional style also makes code easier to read and maintain.
10545 * systime.h: Include <sys/time.h> on all hosts, not just if
10546 WINDOWSNT, since 'struct timeval' is needed in general.
10547 (EMACS_TIME): Now a typedef, not a macro.
10548 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10549 not macros.
10550 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10551 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10552 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10553 (EMACS_TIME_LE): Now functions, not macros.
10554 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10555 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10556 which are not functions. All uses rewritten to use:
10557 (make_emacs_time): New function.
10558 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10559 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10560 not functions. All uses rewritten to use the following, respectively:
10561 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10562 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10563 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10564 * fileio.c (Fcopy_file):
10565 * xterm.c (XTflash): Get the current time closer to when it's used.
10566 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10567
ffacb126
PE
10568 * bytecode.c (targets): Suppress -Woverride-init warnings.
10569
e99a530f
PE
10570 Simplify by avoiding confusing use of strncpy etc.
10571 * doc.c (Fsnarf_documentation):
10572 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10573 * frame.c (Fmake_terminal_frame):
10574 * gtkutil.c (get_utf8_string):
10575 * lread.c (openp):
10576 * nsmenu.m (ns_update_menubar):
10577 * regex.c (regerror):
10578 Prefer memcpy to strncpy and strncat when either will do.
10579 * fileio.c (Fsubstitute_in_file_name):
10580 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10581 (menu_separator_name_p):
10582 * nsmenu.m (ns_update_menubar):
10583 Prefer memcmp to strncmp when either will do.
10584 * nsterm.m: Include <ftoastr.h>.
10585 (ns_get_color):
10586 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10587 Prefer snprintf to strncpy.
10588 * nsterm.m (ns_term_init):
10589 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10590 * nsterm.m (ns_term_init):
10591 Avoid the need for strncpy, by using build_string or
10592 make_unibyte_string directly. Use dtoastr, not snprintf.
10593 * process.c (Fmake_network_process): Diagnose service names that
10594 are too long, rather than silently truncating them or creating
10595 non-null-terminated names.
10596 (Fnetwork_interface_info): Likewise, for interface names.
10597 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10598 Prefer sprintf to strncat.
10599 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10600 Prefer vsnprintf to vsprintf + strncpy.
10601
c59592b3
GM
106022012-07-10 Glenn Morris <rgm@gnu.org>
10603
10604 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10605 Clarify fallback case.
10606
7d7bbefd
DA
106072012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10608
10609 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10610 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10611 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10612 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10613 where argument type is known to be a Lisp_Cons.
10614
3a4c8000
TT
106152012-07-10 Tom Tromey <tromey@redhat.com>
10616
10617 * bytecode.c (BYTE_CODE_THREADED): New macro.
10618 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10619 (enum byte_code_op): New type.
10620 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10621 (exec_byte_code): Use them. Use token threading when applicable.
10622
2a0213a6
DA
106232012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10624
10625 Optimize pure C strings initialization.
10626 * lisp.h (make_pure_string): Fix prototype.
10627 (build_pure_c_string): New function, defined as static inline. This
10628 provides a better opportunity to optimize away calls to strlen when
10629 the function is called with compile-time constant argument.
10630 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10631 argument, adjust users accordingly. Use build_pure_c_string where
10632 appropriate.
10633 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10634 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10635 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10636
cb1caeaf
DA
106372012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10638
10639 Avoid calls to strlen in miscellaneous functions.
10640 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10641 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10642 * lread.c (openp): Likewise.
10643
c293e30c
DA
106442012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10645
10646 Avoid calls to strlen in path processing functions.
10647 * fileio.c (file_name_as_directory): Add comment. Change to add
10648 srclen argument and return the length of result. Adjust users
10649 accordingly.
10650 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10651 swap 1st and 2nd arguments to obey the common convention.
10652 Adjust users accordingly.
c293e30c
DA
10653 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10654
9e059e3f
GM
106552012-07-10 Glenn Morris <rgm@gnu.org>
10656
d02eb359
GM
10657 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10658 Move PENDING_OUTPUT_COUNT definition to configure.
10659
882cf227
GM
10660 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10661 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10662 * s/gnu.h (DATA_START): Move definitions to configure.
10663
af6e839f
GM
10664 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10665 We include usg5-4-common.h, which defines them both.
10666
40289a12
GM
10667 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10668 O_RDONLY already includes it).
10669
9e059e3f
GM
10670 Stop ns builds setting the EMACSLOADPATH environment variable.
10671 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10672 Now it does not set EMACSLOADPATH, just returns the load-path string.
10673 * nsterm.h: Update accordingly.
10674 * lread.c [HAVE_NS]: Include nsterm.h.
10675 (init_lread) [HAVE_NS]: Use ns_load_path.
10676 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10677
7c4e8ec0
GM
106782012-07-09 Glenn Morris <rgm@gnu.org>
10679
d4f600ff
GM
10680 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10681 since the included bsd-common.h does so.
10682
cbb31951
GM
10683 Stop ns builds setting the EMACSPATH environment variable.
10684 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10685 (ns_init_paths): Do not set EMACSPATH.
10686 * nsterm.h (ns_exec_path): Add it.
10687 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10688 Use ns_exec_path.
10689
7c4e8ec0
GM
10690 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10691
26bccfae
PE
106922012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10693
a0bee46f
PE
10694 * process.c (wait_reading_process_output): 'waitchannels' was unset
10695 when read_kbd || !NILP (wait_for_cell); fix this.
10696
5994c183
PE
10697 Add GCC-style 'const' attribute to functions that can use it.
10698 * character.h (char_resolve_modifier_mask):
10699 * keyboard.h (make_ctrl_char):
10700 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10701 (init_character_once, next_almost_prime, init_fns, init_image)
10702 (flush_pending_output, init_sound):
10703 * mem-limits.h (start_of_data):
10704 * menu.h (finish_menu_items):
10705 Add ATTRIBUTE_CONST.
10706 * emacs.c (DEFINE_DUMMY_FUNCTION):
10707 Declare the dummy function with ATTRIBUTE_CONST.
10708 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10709 Add decls with ATTRIBUTE_CONST.
10710
26bccfae
PE
10711 Minor improvements to make_formatted_string.
10712 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10713 where int is good enough, as vsprintf returns an int.
10714 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10715
a8290ec3
DA
107162012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10717
10718 Use make_formatted_string to avoid double length calculation.
10719 * lisp.h (make_formatted_string): New prototype.
10720 * alloc.c (make_formatted_string): New function.
10721 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10722 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10723 * editfns.c (Fcurrent_time_zone): Likewise.
10724 * filelock.c (get_boot_time): Likewise.
10725 * frame.c (make_terminal_frame, set_term_frame_name)
10726 (x_report_frame_params): Likewise.
10727 * image.c (gs_load): Likewise.
10728 * minibuf.c (get_minibuffer): Likewise.
10729 * msdos.c (dos_set_window_size): Likewise.
10730 * process.c (make_process): Likewise.
10731 * xdisp.c (ensure_echo_area_buffers): Likewise.
10732 * xsettings.c (apply_xft_settings): Likewise.
10733
d01ba2f1
GM
107342012-07-09 Glenn Morris <rgm@gnu.org>
10735
10736 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10737 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10738 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10739 * nsterm.h (ns_etc_directory): Add it.
10740 * callproc.c [HAVE_NS]: Include nsterm.h.
10741 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10742
f1f924b6
DA
107432012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10744
10745 Move marker debugging code under MARKER_DEBUG.
10746 * marker.c (MARKER_DEBUG): Move marker debugging code under
10747 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10748 for bootstrap with --enable-checking (~3x slowdown reported
10749 by Juanma Barranquero <lekktu@gmail.com>).
10750 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10751
ab531b66
PE
107522012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10753
10754 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10755 See <http://bugs.gnu.org/11825#29>.
10756
c4b3bc8a
EZ
107572012-07-08 Eli Zaretskii <eliz@gnu.org>
10758
10759 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10760 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10761 (display_line): Add commentary about displaying truncation glyphs
10762 on GUI frames.
10763 (produce_special_glyphs): Move here from term.c.
10764
10765 * term.c (produce_special_glyphs): Move to xdisp.c.
10766
10767 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10768 section.
c4b3bc8a 10769
b676b881
AS
107702012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10771
f17c5273
AS
10772 * xdisp.c (display_line): Avoid warning about implicit declaration
10773 of FRAME_FONT.
10774
298819b9
AS
10775 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10776
b676b881
AS
10777 * lisp.h: Remove empty conditional.
10778
6045c4fd
PE
107792012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10780
b3350bf9
PE
10781 * lread.c (load_path_check): Now static.
10782
6045c4fd
PE
10783 Fix some minor --with-ns problems found by static checking.
10784 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10785 (x_set_font) [!HAVE_X_WINDOWS]:
10786 * image.c (xpm_load_image) [HAVE_NS]:
10787 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10788 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10789 Remove unused local.
10790 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10791 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10792 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10793 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10794 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10795 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10796 Fix pointer signedness problem.
10797 * xfaces.c (FRAME_X_FONT_TABLE):
10798 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10799
929e7845
GM
108002012-07-07 Glenn Morris <rgm@gnu.org>
10801
10802 * lread.c (load_path_check): New function, split from init_lread.
10803 (init_lread): Reorganize. Motivation:
10804 If EMACSLOADPATH is set, check/warn about that rather than the
10805 defaults, which we are not going to use. Hence we can remove
10806 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10807 Don't warn if site-lisp directories are missing.
10808 If not installed, start from a blank load-path, since
10809 PATH_LOADSEARCH refers to the eventual installation directories.
10810
58dd0aa4
EZ
108112012-07-07 Eli Zaretskii <eliz@gnu.org>
10812
10813 Support truncation and continuation glyphs on GUI frames, when
10814 fringes are disabled. (Bug#11832)
10815 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10816 continuation glyphs even if on GUI frames.
10817 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10818 or both, are absent.
10819 (start_display, move_it_in_display_line_to): Handle the case of a
10820 GUI frame without a fringe to display continuation or truncation
10821 glyphs.
10822 (insert_left_trunc_glyphs): Support GUI frames: make sure
10823 truncation glyphs overwrite enough glyphs from the current line to
10824 have sufficient space in pixels.
10825 (display_line): Support truncation and continuation glyphs on GUI
10826 frames. If some spare pixels are left on the line after inserting
10827 the truncation glyphs, fill that space with a stretch glyph of a
10828 suitably computed width.
10829
10830 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10831 produce_glyphs, to support GUI sessions.
10832
31571fd7
PE
108332012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10834
5a16b9bc
PE
10835 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10836
f3047c75
PE
10837 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10838
31571fd7
PE
10839 Do not require float-time's arg to fit in time_t (Bug#11825).
10840 This works better on hosts where time_t is unsigned, and where
10841 float-time is applied to the (negative) difference between two times.
10842 * editfns.c (decode_time_components): Last arg is now double *,
10843 not int *, and means to store all the result as a double, without
10844 worrying about whether the seconds part fits in time_t.
10845 All callers changed.
10846 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10847 All callers changed.
10848 (Ffloat_time): Do not fail merely because the specified time falls
10849 outside of time_t range.
10850
4516fbef
GM
108512012-07-07 Glenn Morris <rgm@gnu.org>
10852
10853 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10854 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10855 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10856
07adc2c6
JB
108572012-07-07 Juanma Barranquero <lekktu@gmail.com>
10858
10859 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10860 Update dependencies.
10861
10862 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10863
fd573f31
PE
108642012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10865
fee5959d
PE
10866 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10867 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10868 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10869 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10870 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10871 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10872
fd573f31
PE
10873 * xfont.c (compare_font_names): Redo to omit the need for casts.
10874
ddadbc0e
AS
108752012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10876
fca8d6b6
AS
10877 * xfns.c (Fx_change_window_property): Doc fix.
10878 * w32fns.c (Fx_change_window_property): Doc fix.
10879
ddadbc0e
AS
10880 * w32fns.c (Fx_window_property): Accept the same arguments as the
10881 X Windows version. Doc fix.
10882 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10883
ed9265fc 108842012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10885 Eli Zaretskii <eliz@gnu.org>
10886
10887 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10888 Windows-specific code from nt/config.nt moved here.
10889 Obsolete settings removed.
10890
216ee680
PE
108912012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 * process.c: Avoid unnecessary calls to gettime.
10894 (wait_reading_process_output): Don't get the time of day
10895 when gobbling data immediately and not waiting, as there's no need
10896 for it in that case. This removes a FIXME.
10897
bdd091e4
JD
108982012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10899
10900 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10901 is defined (Bug#11768).
10902
9d44f8ce
DA
109032012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10904
10905 Fix marker debugging code.
10906 * marker.c (byte_char_debug_check): Do not perform the check
10907 if buffer is not multibyte.
090bd7cb
JB
10908 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10909 Call byte_char_debug_check with correct arguments.
9d44f8ce 10910
90fc4786
DA
109112012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10912
10913 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10914 * marker.c (byte_char_debug_check, count_markers):
10915 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10916 (byte_debug_flag): Remove.
10917 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10918 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10919
7b7ae965
DA
109202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10921
4e57b342
DA
10922 Avoid code repetition in marker-related functions.
10923 * marker.c (attach_marker): New function.
10924 (Fset_marker, set_marker_restricted, set_marker_both)
10925 (set_marker_restricted_both): Use it.
10926 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10927 Consistently rename charno to charpos.
10928 (marker_position): Add eassert.
10929 (marker_byte_position): Convert to eassert.
10930
109312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10932
10933 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10934 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10935 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10936
657924ff
DA
109372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10938
10939 Introduce fast path for the widely used marker operation.
10940 * alloc.c (build_marker): New function.
10941 * lisp.h (build_marker): New prototype.
10942 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10943 * composite.c (autocmp_chars): Likewise.
10944 * editfns.c (buildmark): Remove.
10945 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10946 (save_restriction_save): Use build_marker.
10947 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10948 * window.c (save_window_save): Likewise.
10949
041a49a6
DA
109502012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10951
10952 Do not use Fdelete_overlay in delete_all_overlays
10953 to avoid redundant calls to unchain_overlay.
10954 * buffer.c (drop_overlay): New function.
10955 (delete_all_overlays, Fdelete_overlay): Use it.
10956 * minibuf.c (get_minibuffer): Fix comment.
10957
7dca65a4
PE
109582012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10959
10960 Port to OpenBSD 5.1 amd64.
10961 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10962 This is needed for OpenBSD, and should be harmless on all BSD systems.
10963 Also, include <sys/sysctl.h>, as it should be available on all
10964 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10965 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10966 use p_pid member, not kp_proc.pid.
10967
8eb876e2
GM
109682012-07-06 Glenn Morris <rgm@gnu.org>
10969
10970 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10971
38182d90
PE
109722012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10973
10974 More xmalloc and related cleanup.
10975 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10976 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10977 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10978 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10979 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10980 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10981 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10982 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10983 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10984 * xterm.c:
10985 Omit needless casts involving void * pointers and allocation.
10986 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10987 as the former is more robust if P's type is changed.
10988 Prefer xzalloc to xmalloc + memset 0.
10989 Simplify malloc-or-realloc to realloc.
10990 Don't worry about xmalloc returning a null pointer.
10991 Prefer xstrdup to xmalloc + strcpy.
10992 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10993 growing it.
10994 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10995 alloca of a constant.
10996
6dd5a677
EZ
109972012-07-05 Eli Zaretskii <eliz@gnu.org>
10998
10999 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11000 hscroll is larger than the line width. Fixes long and futile
11001 looping inside extend_face_to_end_of_line (on a TTY) producing
11002 glyphs that are not needed and thrown away.
11003
6b312f0f
DA
110042012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11005
11006 * marker.c (set_marker_restricted_both): Simplify by using
11007 clip_to_bounds.
11008
f520ef9b
PE
110092012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11010
11011 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11012
383b7c95
JD
110132012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11014
11015 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11016 not defined (Bug#11768).
11017 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11018 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11019 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11020 followed by gtk_box_set_homogeneous (Bug#11768).
11021 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
11022 (update_theme_scrollbar_width, xg_create_scroll_bar):
11023 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
11024 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11025 (is_box_type): New function (Bug#11768).
11026 (xg_tool_item_stale_p): Call is_box_type.
5293d758 11027 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
11028 with default display (Bug#11768).
11029
d6e7bf45
EZ
110302012-07-05 Eli Zaretskii <eliz@gnu.org>
11031
11032 * xdisp.c (window_hscroll_limited): New function.
11033 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11034 coordinates when window's hscroll is set to insanely large
11035 values. (Bug#11857)
11036
431391ec
JB
110372012-07-05 Juanma Barranquero <lekktu@gmail.com>
11038
11039 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11040 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11041
23f86fce
DA
110422012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11043
11044 Cleanup xmalloc.
11045 * lisp.h (xzalloc): New prototype. Omit needless casts.
11046 * alloc.c (xzalloc): New function. Omit needless casts.
11047 * charset.c: Omit needless casts. Convert all calls to
11048 xmalloc with following memset to xzalloc.
11049 * dispnew.c: Likewise.
11050 * fringe.c: Likewise.
11051 * image.c: Likewise.
11052 * sound.c: Likewise.
11053 * term.c: Likewise.
11054 * w32fns.c: Likewise.
11055 * w32font.c: Likewise.
11056 * w32term.c: Likewise.
11057 * xfaces.c: Likewise.
11058 * xfns.c: Likewise.
11059 * xterm.c: Likewise.
11060 * atimer.c: Omit needless casts.
11061 * buffer.c: Likewise.
11062 * callproc.c: Likewise.
11063 * ccl.c: Likewise.
11064 * coding.c: Likewise.
11065 * composite.c: Likewise.
11066 * doc.c: Likewise.
11067 * doprnt.c: Likewise.
11068 * editfns.c: Likewise.
11069 * emacs.c: Likewise.
11070 * eval.c: Likewise.
11071 * filelock.c: Likewise.
11072 * fns.c: Likewise.
11073 * gtkutil.c: Likewise.
11074 * keyboard.c: Likewise.
11075 * lisp.h: Likewise.
11076 * lread.c: Likewise.
11077 * minibuf.c: Likewise.
11078 * msdos.c: Likewise.
11079 * print.c: Likewise.
11080 * process.c: Likewise.
11081 * region-cache.c: Likewise.
11082 * search.c: Likewise.
11083 * sysdep.c: Likewise.
11084 * termcap.c: Likewise.
11085 * terminal.c: Likewise.
11086 * tparam.c: Likewise.
11087 * w16select.c: Likewise.
11088 * w32.c: Likewise.
11089 * w32reg.c: Likewise.
11090 * w32select.c: Likewise.
11091 * w32uniscribe.c: Likewise.
11092 * widget.c: Likewise.
11093 * xdisp.c: Likewise.
11094 * xmenu.c: Likewise.
11095 * xrdb.c: Likewise.
11096 * xselect.c: Likewise.
11097
0497dc44
PE
110982012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11099
11100 * fileio.c (time_error_value): Check the right error number.
11101 Problem reported by Troels Nielsen in
11102 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11103
356e7178
PE
111042012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11105
4e71fd89
PE
11106 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11107 This should be fixed in a better way; see Eli Zaretskii in
11108 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11109 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11110
f0941253
PE
11111 * fileio.c (time_error_value): Rename from special_mtime.
11112 The old name's problems were noted by Eli Zaretskii in
11113 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11114
065c9eb4
PE
11115 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11116 This variable's comment says Emacs needs at least one GDB-visible
11117 symbol of type enum pvec_type, to work around GDB problems.
11118 The symbol's value doesn't matter.
11119
356e7178
PE
11120 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11121 that causes compilation to fail on pre-C99 compilers.
11122
ed9265fc 111232012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
11124
11125 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11126 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11127
3884d954
DA
111282012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11129
d209e2fb 11130 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
11131 headers for buffer_defaults and buffer_local_symbols.
11132 Reported by Juanma Barranquero <lekktu@gmail.com>.
11133
ee28be33
SM
111342012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11135
11136 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11137 * lisp.h (enum pvec_type): Use fewer bits.
11138 (PSEUDOVECTOR_SIZE_BITS): New constant.
11139 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11140 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11141 change in pvec_type.
11142 (PSEUDOVECTOR_TYPEP): New macro.
11143 (TYPED_PSEUDOVECTORP): Use it.
11144 * fns.c (internal_equal): Adapt code to extract pvectype.
11145 * emacs.c (gdb_pvec_type): Update type.
11146 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11147 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11148 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11149 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11150 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11151 abusing vector->header.next.nbytes.
11152 (live_vector_p): Use PVEC_TYPE.
11153 (mark_object): Adapt code to extract pvectype. Use switch.
11154
c7f2cd7f
PE
111552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11156
11157 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11158 Tighten new eassert a bit.
11159
8ce70ed2
DA
111602012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11161
11162 Fix compilation with --enable-gcc-warnings and -O1
11163 optimization level.
11164 * doprnt.c (doprnt): Change type of tem to int, initialize
11165 to avoid compiler warning. Add eassert.
11166 * search.c (simple_search): Initialize match_byte to avoid
11167 compiler warning. Add eassert.
11168
dea7f1e5
PE
111692012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11170
24a212eb
PE
11171 Avoid weird behavior with large horizontal scrolls.
11172 Without this change, for example, large hscroll values would
11173 mess up Emacs's display on Fedora 15 x86, presumably due to
11174 overflows in int calculations in the display code.
11175 Also, if buffers had long lines, Emacs would freeze.
11176 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11177 (set_window_hscroll): New function, containing the old guts of
11178 Fset_window_hscroll. Return the clipped value.
11179 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11180 This avoids the need to check against PTRDIFF_MAX.
11181
dea7f1e5
PE
11182 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11183
76046526
DA
111842012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11185
11186 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11187
39adff0d
PE
111882012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11189
63807d47
PE
11190 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11191 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11192 since GCC 4.4.6 issues a bogus warning for them.
11193
39adff0d
PE
11194 Fix bugs in file timestamp newness comparisons.
11195 * fileio.c (Ffile_newer_than_file_p):
11196 * lread.c (Fload): Use full timestamp resolution of files,
11197 not just the 1-second resolution, so that files that are only
11198 slightly newer still count as newer.
11199 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11200 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11201
dbeed9a6
PE
112022012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11203
11204 * fileio.c: Improve handling of file time marker. (Bug#11852)
11205 (special_mtime): New function.
11206 (Finsert_file_contents, Fverify_visited_file_modtime):
11207 Use it to set special mtime values consistently.
11208
636334d6
AS
112092012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11210
11211 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11212 marker for non-existing file. (Bug#11852)
11213
e2017fe2
GM
112142012-07-03 Glenn Morris <rgm@gnu.org>
11215
11216 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11217 and did not make it into globals.h).
11218
404dbd37
TT
112192012-07-03 Tom Tromey <tromey@redhat.com>
11220
11221 * window.c (Fset_window_margins, Fset_window_fringes)
11222 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11223 * textprop.c (Fprevious_property_change): No longer static.
11224 * syntax.c (Fsyntax_table_p): No longer static.
11225 * process.c (Fget_process, Fprocess_datagram_address): No longer
11226 static.
11227 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11228 * keyboard.c (Fcommand_execute): No longer static.
11229 Remove EXFUN.
11230 * insdel.c (Fcombine_after_change_execute): No longer static.
11231 * image.c (Finit_image_library): No longer static.
11232 * fileio.c (Fmake_symbolic_link): No longer static.
11233 * eval.c (Ffetch_bytecode): No longer static.
11234 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11235 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11236 No longer static.
404dbd37
TT
11237 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11238 static.
11239 * dired.c (Ffile_attributes): No longer static.
11240 * composite.c (Fcomposition_get_gstring): No longer static.
11241 * callproc.c (Fgetenv_internal): No longer static.
11242
11243 * ccl.h: Remove EXFUNs.
11244 * buffer.h: Remove EXFUNs.
11245 * dispextern.h: Remove EXFUNs.
11246 * intervals.h: Remove EXFUNs.
11247 * fontset.h: Remove EXFUN.
11248 * font.h: Remove EXFUNs.
11249 * dosfns.c (system_process_attributes): Remove EXFUN.
11250 * keymap.h: Remove EXFUNs.
11251 * lisp.h: Remove EXFUNs.
11252 * w32term.h: Remove EXFUNs.
11253 * window.h: Remove EXFUNs.
11254 * xsettings.h: Remove EXFUN.
11255 * xterm.h: Remove EXFUN.
11256
8e4fd1e1
GM
112572012-07-03 Glenn Morris <rgm@gnu.org>
11258
11259 * lisp.h (Frandom): Make it visible to C.
11260 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11261 buffer for invisible buffers. (Bug#1229)
11262
ca95b3eb
DA
112632012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11264
11265 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11266 values which aren't power of 2.
14ae4239 11267 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11268 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11269 accordingly.
11270
7555c33f
SM
112712012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11272
11273 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11274
11275 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11276
d12e8f5a
DA
112772012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11278
11279 * alloc.c (allocate_vector_block): Remove redundant
11280 calls to mallopt if DOUG_LEA_MALLOC is defined.
11281 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11282 avoid calls to mallopt if zero_vector is returned.
11283
296094c3
DA
112842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11285
11286 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11287 is enabled, avoid dereferencing NULL current_sblock if
11288 running undumped.
11289
36429c89
DA
112902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11291
11292 Cleanup basic buffer management.
11293 * buffer.h (struct buffer): Change layout to use generic vector
11294 marking code. Fix some comments. Change type of 'clip_changed'
11295 to bitfield. Remove unused #ifndef old.
11296 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11297 (GET_OVERLAYS_AT): Fix indentation.
11298 (for_each_per_buffer_object_at): New macro.
11299 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11300 (Fbuffer_local_variables): Use it.
11301 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11302 * alloc.c (allocate_buffer): Adjust to match new layout of
11303 struct buffer. Fix comment.
11304 (mark_overlay): New function.
11305 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11306 Lisp area of struct buffer.
11307 (mark_object): Use it. Adjust marking of misc objects
11308 and related comments.
11309
3b3e4cac
PE
113102012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11311
11312 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11313 wrapper that is not needed because the wrapped code is a no-op (zero
11314 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11315 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11316
cf5c0175
DA
113172012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11318
11319 * alloc.c (mark_buffer): Simplify. Remove prototype.
11320 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11321 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11322 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11323 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11324
ca26824c
GM
113252012-06-30 Glenn Morris <rgm@gnu.org>
11326
2e4c5312
GM
11327 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11328
ca26824c
GM
11329 * epaths.in (PATH_SITELOADSEARCH): New.
11330 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11331 This is rather than relying on --enable-locallisppath elements
11332 having "site-lisp" in their names. (Bug#10208#25, 11658)
11333
0d23c240
EZ
113342012-06-30 Eli Zaretskii <eliz@gnu.org>
11335
c9240d7a
EZ
11336 * w32proc.c (sys_select): Accept and ignore one more argument.
11337
11338 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11339
0d23c240 11340 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11341 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11342
11343 * sysdep.c: Don't include dos.h and dosfns.h.
11344
11345 * process.c (sys_select):
11346 * msdos.c (sys_select): Accept one more argument and ignore it.
11347
11348 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11349 adapt data types and code to that.
11350
11351 * dosfns.c:
11352 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11353 which clashes with the gnulib function of the same name.
11354
af5a5a98
AS
113552012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11356
c5e4379c
AS
11357 * font.c (font_style_to_value, font_style_symbolic)
11358 (font_prop_validate_style): Add type checks for values in
11359 font_style_table.
11360
af5a5a98
AS
11361 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11362 argument.
11363 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11364 uses.
11365
8d38f461
EZ
113662012-06-29 Eli Zaretskii <eliz@gnu.org>
11367
2e5a6631
EZ
11368 * xdisp.c (try_window_id): Undo last change.
11369
8d38f461
EZ
11370 * w32.c (getwd): Adjust commentary about startup_dir.
11371 (init_environment): Always call sys_access, even in non-MSVC
11372 builds. Don't chdir to the directory of the Emacs executable.
11373 This undoes code from 1997 which was justified by the need to
11374 "avoid conflicts when removing and renaming directories". But its
11375 downside was that every relative file name was being interpreted
11376 relative to the directory of the Emacs executable, which can never
11377 be TRT. In particular, it broke sys_access when called with
11378 relative file names.
11379 (sys_access): Map GetLastError to errno.
11380
2af3565e
DA
113812012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11382
11383 * window.h (struct window): Change type of 'fringes_outside_margins'
11384 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11385 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11386 Adjust comment.
11387 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11388 to ptrdiff_t.
11389
c8d3a25c 113902012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11391
c8d3a25c
GM
11392 * gnutls.c (emacs_gnutls_handshake):
11393 Add QUIT to make the loop interruptible.
57570cd3 11394
c8d3a25c 113952012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11396
c8d3a25c
GM
11397 * charset.c (init_charset): Make lack of etc/charsets fatal.
11398
3e984ee8
DA
113992012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11400
11401 * editfns.c (region_limit): Fix type mismatch.
11402
ef884f23
DA
114032012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11404
11405 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11406 undefined. Convert from xassert to eassert.
11407 * nsmenu.m: Convert from xassert to eassert.
11408 * nsterm.m: Likewise.
11409
7d7e0027
SM
114102012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11411
11412 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11413
aa754e6a
PE
114142012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11415
11416 Avoid integer overflow on scroll-left and scroll-right.
11417 * window.c (HSCROLL_MAX): New macro.
11418 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11419 overflow when requested scroll falls outside ptrdiff_t range.
11420
80b00b08
DA
114212012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11422
11423 * window.h (struct window): Change type of 'hscroll',
11424 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11425 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11426 Adjust users accordingly.
11427 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11428 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11429 from EMACS_INT to ptrdiff_t.
11430 (make_window): Omit redundant initialization.
11431
62b2bcf6
JB
114322012-06-28 Juanma Barranquero <lekktu@gmail.com>
11433
11434 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11435
45942c7d
DA
114362012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11437
11438 * window.h (struct window): Change type of 'use_time' and
11439 'sequence_number' from Lisp_Object to int.
11440 * frame.c (make_frame): Adjust users accordingly.
11441 * print.c (print_object): Likewise.
11442 * window.c (select_window, Fwindow_use_time, make_parent_window)
11443 (make_window): Likewise.
11444
e509cfa6
DA
114452012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11446
11447 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11448 enabled with --enable-checking=[all,glyphs] configure option.
11449 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11450 adjust comments accordingly.
11451 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11452 undefined, adjust comments accordingly.
11453 * image.c: Likewise.
11454 * scroll.c: Likewise.
11455 * w32fns.c: Likewise.
11456 * w32term.c: Likewise.
11457 * xdisp.c: Likewise.
11458 * xfaces.c: Likewise.
11459 * xfns.c: Likewise.
11460 * xterm.c: Likewise.
11461
a54e2c05
DA
114622012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11463
11464 Generalize run-time debugging checks.
11465 * dispextern.h (XASSERTS): Remove.
11466 * fontset.c (xassert): Remove.
11467 Convert from xassert to eassert.
11468 * alloc.c: Convert from xassert to eassert.
11469 * bidi.c: Likewise.
11470 * dispnew.c: Likewise.
11471 * fns.c: Likewise.
11472 * fringe.c: Likewise.
11473 * ftfont.c: Likewise.
11474 * gtkutil.c: Likewise.
11475 * image.c: Likewise.
11476 * keyboard.c: Likewise.
11477 * menu.c: Likewise.
11478 * process.c: Likewise.
11479 * scroll.c: Likewise.
11480 * sound.c: Likewise.
11481 * term.c: Likewise.
11482 * w32console.c: Likewise.
11483 * w32fns.c: Likewise.
11484 * w32term.c: Likewise.
11485 * window.c: Likewise.
11486 * xdisp.c: Likewise.
11487 * xfaces.c: Likewise.
11488 * xfns.c: Likewise.
11489 * xselect.c: Likewise.
11490 * xterm.c: Likewise.
11491
1ec4b7b2
SM
114922012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11493
11494 * fns.c (maybe_resize_hash_table): Output message when growing the
11495 purify-hashtable.
11496
2014308a
DA
114972012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11498
11499 * alloc.c (allocate_string_data): Remove dead code.
11500 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11501 avoid GCC warning about unused macro.
11502
246155eb
DA
115032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11504
11505 * alloc.c (allocate_string): Omit intervals initialization.
11506 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11507 as in make_pure_string and make_pure_c_string.
11508
43184b7b
DA
115092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11510
d209e2fb 11511 * alloc.c (allocate_string): Fix last change.
43184b7b 11512
3fe6dd74
DA
115132012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11514
d209e2fb 11515 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11516 to memset, add explicit initialization where appropriate.
11517
1ba6038a
GM
115182012-06-27 Glenn Morris <rgm@gnu.org>
11519
11520 * lisp.mk (lisp): Remove paths.elc.
11521
c89926a5
CY
115222012-06-27 Chong Yidong <cyd@gnu.org>
11523
11524 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11525
ed6b3510
JW
115262012-06-26 John Wiegley <johnw@newartisans.com>
11527
1ec4b7b2 11528 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11529 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11530
ed6b3510
JW
11531 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11532 when building with Clang.
11533
8edd4a2b
SM
115342012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11535
11536 * eval.c (Fapply): Allow calling it with a single argument.
11537
f6f62d1b
EZ
115382012-06-26 Eli Zaretskii <eliz@gnu.org>
11539
11540 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11541 _stricmp and _strnicmp.
11542 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11543
62efea5e
DA
115442012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11545
11546 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11547 allocated window.
11548 (allocate_process): Likewise for new process.
8edd4a2b 11549 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11550 (allocate_frame): Likewise.
11551 * frame.c (make_frame): Omit redundant initialization.
11552 * window.c (make_parent_window): Use memset.
11553 (make_window): Omit redundant initialization.
11554 * process.c (make_process): Omit redundant initialization.
11555 * terminal.c (create_terminal): Likewise.
11556
42997f4d
DA
115572012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11558
11559 * term.c (delete_tty): Remove redundant call to memset.
11560
1130ecfc
DA
115612012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11562
11563 * alloc.c: Remove build_string.
11564 * lisp.h: Define build_string as static inline. This provides
11565 a better opportunity to optimize away calls to strlen when the
11566 function is called with compile-time constant argument.
11567 * image.c (imagemagick_error): Convert to build_string.
11568 * w32proc.c (sys_spawnve): Likewise.
11569 * xterm.c (x_term_init): Likewise.
11570
cf38a720
PE
115712012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11572
99027bdd
PE
11573 Use sprintf return value instead of invoking strlen on result.
11574 In the old days this wasn't portable, since some sprintf
11575 implementations returned char *. But they died out years ago and
11576 Emacs already assumes sprintf returns int.
11577 Similarly for float_to_string.
11578 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11579 * ccl.c (ccl_driver):
11580 * character.c (string_escape_byte8):
11581 * data.c (Fnumber_to_string):
11582 * doprnt.c (doprnt):
11583 * print.c (print_object):
11584 * xdisp.c (message_dolog):
11585 * xfns.c (syms_of_xfns):
11586 Use sprintf or float_to_string result to avoid need to call strlen.
11587 * data.c (Fnumber_to_string):
11588 Use make_unibyte_string, since the string must be ASCII.
11589 * lisp.h, print.c (float_to_string): Now returns int length.
11590 * term.c (produce_glyphless_glyph):
11591 Use sprintf result rather than recomputing it.
11592
cf38a720
PE
11593 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11594 * Makefile.in (ALL_CFLAGS):
11595 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11596 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11597
3511c784
DA
115982012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11599
0a08eb21 11600 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11601 strcasecmp if available.
11602 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11603
fb7da12e
AS
116042012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11605
11606 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11607 Avoid comma operator.
11608 * menu.c (push_submenu_start, push_submenu_end)
11609 (push_left_right_boundary, push_menu_pane): Likewise.
11610 * msdos.c (dos_rawgetc): Likewise.
11611
afa2ffd8
DA
116122012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11613
11614 * xfns.c (xic_create_fontsetname): Remove redundant calls
11615 to memset.
11616
b3b4476b
PE
116172012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11618
4495ff38
PE
11619 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11620 sprintf already null-terminates its output.
11621
b3b4476b
PE
11622 * xfns.c (x_window): Remove redundant cast.
11623
b00876c9
DA
116242012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11625
11626 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11627 `const char *' to `char *' to avoid compiler warning.
11628
d188e26b
PE
116292012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11630
885d1d74
PE
11631 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11632 instead of truncating it to 63 (admittedly a generous limit).
11633
d188e26b
PE
11634 * process.c: Fix spelling and caps in comments.
11635
e2f560b1
DN
116362012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11637
e86db54b 11638 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11639 * sysdep.c (setpgrp): Remove definition, not used in this file.
11640
7583a3a1
JB
116412012-06-24 Juanma Barranquero <lekktu@gmail.com>
11642
11643 * makefile.w32-in: Update dependencies.
11644
696056c2
EZ
116452012-06-24 Eli Zaretskii <eliz@gnu.org>
11646
11647 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11648 (SYSTIME_H): Add nt/inc/sys/time.h.
11649
11650 * systime.h [WINDOWSNT]: Include sys/time.h.
11651
11652 * s/ms-w32.h (struct timespec): Definition moved from
11653 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11654
845ca893
PE
116552012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11656
11657 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11658 * buffer.h (buffer_slot_type_mismatch):
11659 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11660 * eval.c (unwind_to_catch):
11661 * image.c (my_png_error, my_error_exit):
11662 * keyboard.c (quit_throw_to_read_char, user_error)
11663 (Fexit_recursive_edit, Fabort_recursive_edit):
11664 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11665 (wrong_type_argument, buffer_overflow, __executable_start)
11666 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11667 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11668 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11669 (fatal):
11670 (child_setup) [!DOS_NT]:
11671 * lread.c (end_of_file_error, invalid_syntax):
11672 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11673 * puresize.h (pure_write_error):
11674 * search.c (matcher_overflow):
11675 * sound.c (sound_perror, alsa_sound_perror):
11676 * sysdep.c, syssignal.h (croak):
11677 * term.c (maybe_fatal, vfatal):
11678 * textprop.c (text_read_only):
11679 * undo.c (user_error):
11680 * unexmacosx.c (unexec_error):
11681 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11682 Use _Noreturn rather than NO_RETURN.
11683 No need for separate decl merely because of _Noreturn.
11684 * sound.c (sound_warning, parse_sound):
11685 Remove unnecessary forward decls.
11686
f1dd8073
PE
116872012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11688
11689 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11690 * lisp.h (WAIT_READING_MAX): New macro.
11691 * dispnew.c (Fsleep_for, sit_for):
11692 * keyboard.c (kbd_buffer_get_event):
11693 * process.c (Faccept_process_output):
11694 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11695 This improves on the previous patch, which introduced a bug
11696 when time_t is unsigned and as wide as intmax_t.
11697 See <http://bugs.gnu.org/9000#51>.
11698
b82c1755
EZ
116992012-06-23 Eli Zaretskii <eliz@gnu.org>
11700
11701 * dispnew.c (sit_for, Fsleep_for):
11702 * keyboard.c (kbd_buffer_get_event):
11703 * process.c (Faccept_process_output): Avoid compiler warnings when
11704 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11705
ca300656
JB
117062012-06-23 Juanma Barranquero <lekktu@gmail.com>
11707
049ec95b
JB
11708 * makefile.w32-in: Update dependencies.
11709
ca300656
JB
11710 * w32.c (ltime): Add return type and declare static.
11711 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11712
db7b8d06
PE
117132012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11716 Privately reported by Herbert J. Skuhra.
11717 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11718 All uses changed.
11719 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11720 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11721
0bd8297f
EZ
117222012-06-23 Eli Zaretskii <eliz@gnu.org>
11723
96512555
EZ
11724 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11725 last argument of make_unibyte_string.
11726
0bd8297f
EZ
11727 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11728 language ID in the event parameters.
11729
11730 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11731 event.code, not the obscure "character set ID".
11732
63def6b6
CY
117332012-06-23 Chong Yidong <cyd@gnu.org>
11734
11735 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11736
e8a02204
EZ
117372012-06-23 Eli Zaretskii <eliz@gnu.org>
11738
388cdec0
EZ
11739 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11740 * w32.c (fdutimens): New function.
11741
11742 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11743
11744 * s/ms-w32.h (pselect): Redirect to sys_select.
11745
11746 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11747
e8a02204
EZ
11748 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11749 in the logic of incrementing and decrementing the value of
11750 use_relocatable_buffers.
11751
d054f3fb
PE
117522012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11753
11754 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11755 Privately reported by Herbert J. Skuhra.
11756 [__FreeBSD__]: Remove "*/" typo after "#include".
11757 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11758 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11759 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11760 Don't assume EMACS_TIME and struct timeval are the same type.
11761
d35af63c
PE
117622012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11763
11764 Support higher-resolution time stamps (Bug#9000).
11765 The time stamps are only nanosecond-resolution at the C level,
11766 since that's the best that any real-world system supports now.
11767 But they are picosecond-resolution at the Lisp level, as that's
11768 easy, and leaves room for future OS improvements.
11769
11770 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11771 (LIBES): Use it.
11772
11773 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11774 Don't get current time unless it's needed.
11775
11776 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11777 now provides it if it's absent.
11778 (start_atimer): Port to higher-res time stamps.
11779 Check for time stamp overflow. Don't get current time more
11780 often than is needed.
11781
11782 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11783 Include systime.h, not time.h.
11784 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11785
11786 * dired.c: Include stat-time.h.
11787 (Ffile-attributes): File times now have higher resolution.
11788
11789 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11790 (struct image): Timestamp now has higher resolution.
11791
11792 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11793 has at least microseconds now. All uses removed.
11794 (update_frame, update_single_window, update_window, update_frame_1)
11795 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11796 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11797
11798 * editfns.c (time_overflow): Now extern.
11799 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11800 (float-time, Fformat_time_string, Fcurrent_time_string)
11801 (Fcurrent_time_zone): Accept and generate higher-resolution
11802 time stamps.
11803 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11804 (decode_time_components, lisp_seconds_argument): New functions.
11805 (make_time): Now static.
11806 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11807 Report an error if the time is invalid, rather than having the caller
11808 do that.
11809
11810 * fileio.c: Include <stat-time.h>
11811 (Fcopy_file): Copy higher-resolution time stamps.
11812 Prefer to set the time stamp via a file descriptor if that works.
11813 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11814 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11815 (Fvisited_file_modtime, Fset_visited_file_modtime):
11816 Support higher-resolution time stamps.
11817
11818 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11819
11820 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11821
11822 * image.c (prepare_image_for_display, clear_image_cache)
11823 (lookup_image): Port to higer-resolution time stamps.
11824
11825 * keyboard.c (start_polling, bind_polling_period):
11826 Check for time stamp overflow.
11827 (read_char, kbd_buffer_get_event, timer_start_idle)
11828 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11829 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11830 Port to higher-resolution time stamps. Do not assume time_t is signed.
11831 (decode_timer): New function. Timers are now vectors of length 9,
11832 not 8, to accommodate the picosecond component.
11833 (timer_check_2): Use it.
11834
11835 * nsterm.m (select_timeout, timeval_subtract): Remove.
11836 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11837 as they're a bit more accurate and handle overflow better.
11838 (ns_select): Change prototype to be compatible with pselect.
11839 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11840 * nsterm.h (ns_select): Adjust prototype.
11841
11842 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11843 us-resolution time stamps.
11844 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11845
11846 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11847
11848 * lisp.h (time_overflow): New decl.
11849 (wait_reading_process_output): First arg is now intmax_t, not int,
11850 to accommodate larger waits.
11851
11852 * process.h (struct Lisp_Process.read_output_delay):
11853 Now counts nanoseconds, not microseconds.
11854 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11855 EMACS_HAS_USECS.
11856 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11857 (wait_reading_process_output):
11858 Port to ns-resolution time stamps.
11859 (Faccept_process_output, wait_reading_process_output):
11860 Check for time stamp overflow. Do not assume time_t is signed.
11861 (select_wrapper): Remove; we now use pselect.
11862 (Fprocess_attributes): Now generates ns-resolution time stamps.
11863
11864 * sysdep.c: Include utimens.h. Don't include utime.h
11865 or worry about struct utimbuf; gnulib does that for us now.
11866 (gettimeofday): Remove; gnulib provides a substitute.
11867 (make_timeval): New function.
11868 (set_file_times): Now sets ns-resolution time stamps.
11869 New arg FD; all uses changed.
11870 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11871 (system_process_attributes):
11872 Now returns ns-resolution time stamp. All uses changed.
11873 Check for time stamp overflow.
11874
11875 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11876 provides a substitute now.
11877
11878 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11879 since it guarantees struct timespec.
11880 (EMACS_TIME): Now struct timespec, so that we can support
11881 ns-resolution time stamps.
11882 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11883 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11884 (EMACS_USECS): Remove.
11885 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11886 so multiply the arg by 1000 before storing it.
11887 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11888 New macros.
11889 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11890 Port to ns-resolution time stamps.
11891 (EMACS_TIME_NEG_P): Remove; replaced by....
11892 (EMACS_TIME_SIGN): New macro.
11893 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11894 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11895 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11896 (make_timeval, make_lisp_time, decode_time_components): New decls.
11897 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11898 that it mishandled time_t overflow. You can't compare by subtracting!
11899 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11900 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11901
11902 * term.c: Include <sys/time.h>.
11903 (timeval_to_Time): New function, for proper overflow wraparound.
11904 (term_mouse_position, term_mouse_click): Use it.
11905
11906 * undo.c (record_first_change): Support higher-resolution time stamps
11907 in the undo buffer.
11908 (Fprimitive_undo): Use them when restoring time stamps.
11909
11910 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11911 (w32_get_internal_run_time):
11912 Port to higher-resolution Emacs time stamps.
11913 (ltime): Now accepts single 64-bit integer, as that's more convenient
11914 for callers.
11915
11916 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11917
11918 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11919 for compatibility with pselect. Support ns-resolution time stamps.
11920
11921 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11922
11923 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11924 Check for time stamp overflow, and support ns-resolution time stamps.
11925
11926 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11927 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11928 (timeval_subtract): Remove; no longer needed.
11929 (XTflash, XTring_bell, x_wait_for_event):
11930 Port to ns-resolution time stamps. Don't assume time_t is signed.
11931
b6a92dfe
CY
119322012-06-22 Chong Yidong <cyd@gnu.org>
11933
11934 * xdisp.c (x_consider_frame_title): Revert last change.
11935
d251c37c
EZ
119362012-06-22 Eli Zaretskii <eliz@gnu.org>
11937
11938 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11939 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11940 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11941 staticidx goes up to 1597 out of 1600 = 0x640.)
11942
f10deafb
PE
119432012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11944
11945 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11946 Otherwise, the umask might be mistakenly 0 while handling input signals.
11947
ec6de1e2
SM
119482012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11949
11950 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11951
28be1ada
DA
119522012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11953
11954 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11955 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11956 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11957 access to `contents' member of Lisp_Vector objects with AREF and ASET
11958 where appropriate.
11959
c6bf3022
CY
119602012-06-19 Chong Yidong <cyd@gnu.org>
11961
11962 * frame.c (delete_frame): When selecting a frame on a different
11963 text terminal, do not alter the terminal's top-frame.
11964
11965 * xdisp.c (format_mode_line_unwind_data): Record the target
11966 frame's selected window and its terminal's top-frame.
11967 (unwind_format_mode_line): Restore them.
11968 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11969 Callers changed.
11970 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11971 since tty frames can be explicitly named.
11972 (prepare_menu_bars): Likewise.
11973
11974 * term.c (Ftty_top_frame): New function.
11975
defd4196
PE
119762012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 Port byte-code-meter to modern targets.
11979 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11980 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11981 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11982 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11983 (METER_1, METER_2): Simplify.
11984
1053a871
SM
119852012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11986
11987 * data.c (Fdefalias): Return `symbol' (bug#11686).
11988
b7e8d081
MR
119892012-06-18 Martin Rudalics <rudalics@gmx.at>
11990
11991 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11992 gets killed during executing of this function (Bug#11665).
11993 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11994 (Vkill_buffer_query_functions): In doc-string say that functions
11995 run by this hook should not change the current buffer.
11996
7ea2b339
PE
119972012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11998
11999 Fix recently-introduced process.c problems found by static checking.
12000 * process.c (write_queue_push, write_queue_pop, send_process):
12001 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12002 (write_queue_pop): Fix pointer signedness problem.
12003 (send_process): Remove unused local.
12004
96a313a1
CY
120052012-06-17 Chong Yidong <cyd@gnu.org>
12006
12007 * xdisp.c (redisplay_internal): No need to redisplay terminal
12008 frames that are not on top.
12009
20ca2e94
TN
120102012-06-17 Troels Nielsen <bn.troels@gmail.com>
12011
12012 * process.c (make_process): Initialize write_queue.
12013 (write_queue_push, write_queue_pop): New functions.
12014 (send_process): Use them to maintain correct ordering of process
12015 writes (Bug#10815).
12016
9a900ca9
PE
120172012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12018
310fbfa8
PE
12019 * lisp.h (eassert): Assume C89 or later.
12020 This removes the need for CHECK.
12021 (CHECK): Remove. Its comments about always evaluating its
12022 argument were confusing, as 'eassert' typically does not evaluate
12023 its argument.
12024
27bb1ca4
PE
12025 * coding.c (produce_chars): Use ptrdiff_t, not int.
12026
9a900ca9
PE
12027 * xterm.c (x_draw_underwave): Check for integer overflow.
12028 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12029
41b7f8bc 120302012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
12031
12032 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12033 referenced (Bug#11583).
12034
9b0e3eba
AA
120352012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12036
12037 Implement wave-style variant of underlining.
12038 * dispextern.h (face_underline_type): New enum.
12039 (face): Add field for underline type.
12040 * nsterm.m (ns_draw_underwave): New function.
12041 (ns_draw_text_decoration): Use it.
12042 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12043 New functions.
12044 (x_draw_glyph_string): Use them.
12045 * xfaces.c (Qline, Qwave): New Lisp objects.
12046 (check_lface_attrs, merge_face_ref)
1053a871
SM
12047 (Finternal_set_lisp_face_attribute, realize_x_face):
12048 Handle wave-style underline face attributes.
9b0e3eba
AA
12049 * xterm.c (x_draw_underwave): New function.
12050 (x_draw_glyph_string): Use it.
12051
0fb52f11
JB
120522012-06-16 Juanma Barranquero <lekktu@gmail.com>
12053
12054 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12055 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12056 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12057 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12058 ($(BLD)/w32select.$(O)): Update dependencies.
12059
e5560ff7
AS
120602012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12061
12062 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12063 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12064 * character.c (_fetch_multibyte_char_p): Remove.
12065 * alloc.c: Include "character.h" before "buffer.h".
12066 * bidi.c: Likewise.
12067 * buffer.c: Likewise.
12068 * bytecode.c: Likewise.
12069 * callint.c: Likewise.
12070 * callproc.c: Likewise.
12071 * casefiddle.c: Likewise.
12072 * casetab.c: Likewise.
12073 * category.c: Likewise.
12074 * cmds.c: Likewise.
12075 * coding.c: Likewise.
12076 * composite.c: Likewise.
12077 * dired.c: Likewise.
12078 * dispnew.c: Likewise.
12079 * doc.c: Likewise.
12080 * dosfns.c: Likewise.
12081 * editfns.c: Likewise.
12082 * emacs.c: Likewise.
12083 * fileio.c: Likewise.
12084 * filelock.c: Likewise.
12085 * font.c: Likewise.
12086 * fontset.c: Likewise.
12087 * fringe.c: Likewise.
12088 * indent.c: Likewise.
12089 * insdel.c: Likewise.
12090 * intervals.c: Likewise.
12091 * keyboard.c: Likewise.
12092 * keymap.c: Likewise.
12093 * lread.c: Likewise.
12094 * macros.c: Likewise.
12095 * marker.c: Likewise.
12096 * minibuf.c: Likewise.
12097 * nsfns.m: Likewise.
12098 * nsmenu.m: Likewise.
12099 * print.c: Likewise.
12100 * process.c: Likewise.
12101 * regex.c: Likewise.
12102 * region-cache.c: Likewise.
12103 * search.c: Likewise.
12104 * syntax.c: Likewise.
12105 * term.c: Likewise.
12106 * textprop.c: Likewise.
12107 * undo.c: Likewise.
12108 * unexsol.c: Likewise.
12109 * w16select.c: Likewise.
12110 * w32fns.c: Likewise.
12111 * w32menu.c: Likewise.
12112 * window.c: Likewise.
12113 * xdisp.c: Likewise.
12114 * xfns.c: Likewise.
12115 * xmenu.c: Likewise.
12116 * xml.c: Likewise.
12117 * xselect.c: Likewise.
12118
2f07e6af
EZ
121192012-06-16 Eli Zaretskii <eliz@gnu.org>
12120
1053a871
SM
12121 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12122 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 12123 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
12124 row.
12125 (handle_face_prop): Use chunk-relative overlay string index when
12126 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
12127 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12128 the rightmost. (Bug#11720)
2f07e6af 12129
29b83cec
AS
121302012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12131
12132 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12133 (CATEGORY_MEMBER): Enforce 1/0 value.
12134 * category.c (_temp_category_set): Remove.
12135
4c5501e9
EZ
121362012-06-16 Eli Zaretskii <eliz@gnu.org>
12137
12138 * window.c (Fdelete_other_windows_internal)
12139 (Fdelete_window_internal): Don't access frame's mouse highlight
12140 info of the initial frame. (Bug#11677)
12141
2b570124
PE
121422012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12143
e93864f9
PE
12144 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12145 Assume USE_2_TAGS_FOR_INTS.
12146 (xreload): Adjust $tagmask width to match recent lisp.h change.
12147
2b570124
PE
12148 Simplify lisp.h in minor ways that should not affect code.
12149 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12150 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12151 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12152 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12153 (INTTYPEBITS): New macro, for clarity.
12154 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12155 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12156 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12157 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12158 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12159
81755f69
JB
121602012-06-13 Juanma Barranquero <lekktu@gmail.com>
12161
12162 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12163
16192a57
GM
121642012-06-13 Glenn Morris <rgm@gnu.org>
12165
12166 * s/bsd-common.h (BSD4_3):
12167 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12168
646b5f55
AS
121692012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12170
12171 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12172 instead of union.
12173 (XLI, XIL): Define.
1053a871
SM
12174 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12175 Use them.
12176 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12177 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12178 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12179 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12180 * frame.c (delete_frame): Remove outdated comment.
12181 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12182 USE_LISP_UNION_TYPE.
12183 (Fw32_unregister_hot_key): Likewise.
12184 (Fw32_toggle_lock_key): Likewise.
12185 * w32menu.c (add_menu_item): Likewise.
12186 (w32_menu_display_help): Use XIL instead of checking
12187 USE_LISP_UNION_TYPE.
12188 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12189 (init_heap): Likewise.
12190 * w32term.c (w32_read_socket): Update comment.
12191
1d3823c9
GM
121922012-06-13 Glenn Morris <rgm@gnu.org>
12193
c62ff706
GM
12194 * s/usg5-4-common.h, src/s/unixware.h:
12195 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12196
1d3823c9
GM
12197 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12198
bfe3e0a2
PE
121992012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12200
12201 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12202 * alloc.c (make_number) [!defined make_number]:
12203 Remove, as lisp.h always defines this now.
12204 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12205 (roundup_size): Verify that it is a power of 2.
12206 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12207 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12208 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12209 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12210 USE_LSB_TAG now is always defined to be either 0 or 1.
12211 All uses changed.
12212 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12213 code works fine either way, and efficiency is not a concern here,
12214 as the union type is for debugging, not for production.
12215 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12216 Use an inline function on all platforms when using the union type,
12217 since this is simpler and 'static inline' can be used portably
12218 within Emacs now.
12219 (LISP_INITIALLY_ZERO): New macro.
12220 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12221 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12222
45fa9c0f
GM
122232012-06-12 Glenn Morris <rgm@gnu.org>
12224
b4492cba
GM
12225 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12226
12227 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12228
45fa9c0f
GM
12229 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12230 Move BROKEN_SIGIO to configure.
12231
12232 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12233 Move NO_TERMIO to configure.
12234
0e25d334
CY
122352012-06-12 Chong Yidong <cyd@gnu.org>
12236
12237 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12238 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12239 MagickExportImagePixels is undefined.
12240
43682bb6
PE
122412012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12242
12243 * image.c (imagemagick_load_image): Remove unused label.
12244
a9be7d2b
GM
122452012-06-11 Glenn Morris <rgm@gnu.org>
12246
12247 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12248 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12249 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12250 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12251
3017f87f
SM
122522012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12253
12254 * alloc.c (make_byte_code): New function.
12255 (Fmake_byte_code): Use it. Don't purify here.
12256 * lread.c (read1): Use it as well to avoid extra allocation.
12257
1b9b4cf4
CY
122582012-06-11 Chong Yidong <cyd@gnu.org>
12259
12260 * image.c (imagemagick_load_image): Implement transparency.
12261
95988fcf
AS
122622012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12263
12264 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12265 account for preceding backslashes. (Bug#11663)
12266
cd4eb164
CY
122672012-06-09 Chong Yidong <cyd@gnu.org>
12268
12269 * term.c: Support italics in capable terminals (Bug#9652).
12270 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12271 (turn_on_face): Output using TS_enter_italic_mode if available.
12272 Don't handle unused blinking and alt-charset cases.
12273 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12274 and tty_alt_charset_p cases.
12275 (tty_capable_p, init_tty): Support italics.
12276
12277 * termchar.h (struct tty_display_info): Add field for italics.
12278 Remove unused blink field.
12279
12280 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12281 Handle slant.
12282
12283 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12284 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12285 tty_alt_charset_p. Add tty_italic_p.
12286
ff88beb8
MA
122872012-06-09 Michael Albinus <michael.albinus@gmx.de>
12288
12289 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12290 dbus_type_is_basic if available.
12291 (xd_extract_signed, xd_extract_unsigned): Rename from
12292 extract_signed and extract_unsigned, respectively. Adapt callers.
12293
44286096
CY
122942012-06-09 Chong Yidong <cyd@gnu.org>
12295
1682701f
CY
12296 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12297
44286096
CY
12298 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12299 case (Bug#9752).
12300
d86feb17
PE
123012012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12302
12303 * xdisp.c (vmessage): Treat frame message as multibyte.
12304 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12305 would generate the diagnostic "Making \302\247 buffer-local while
12306 let-bound!".
12307
d5c20fe8
EZ
123082012-06-08 Eli Zaretskii <eliz@gnu.org>
12309
12310 * dispnew.c (showing_window_margins_p): Undo last change, which
12311 was done due to an inadvertent commit.
12312 (adjust_frame_glyphs_for_frame_redisplay): Do call
12313 showing_window_margins_p.
12314
513749ee
SM
123152012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12316
12317 * eval.c (Fmake_var_non_special): New primitive.
12318 (syms_of_eval): Defsubr it.
12319 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12320
d4a8f5c1
JB
123212012-06-08 Juanma Barranquero <lekktu@gmail.com>
12322
12323 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12324 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12325
8bbbc977
EZ
123262012-06-08 Eli Zaretskii <eliz@gnu.org>
12327
12328 * alloc.c (allocate_vectorlike): Fix last change.
12329
f3372c87
DA
123302012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12331
12332 Block-based vector allocation of small vectors.
12333 * lisp.h (struct vectorlike_header): New field `nbytes',
12334 adjust comment accordingly.
12335 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12336 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12337 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12338 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12339 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12340 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12341 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12342 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12343 (roundup_size): New constant.
12344 (struct vector_block): New data type.
12345 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12346 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12347 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12348 (sweep_vectors): New functions.
12349 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12350 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12351 or equal to VBLOCK_BYTES_MAX.
12352 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12353 (init_alloc_once): Add call to init_vectors.
12354
4f18a4ed
SM
123552012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12356
12357 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12358
86f158bc
PE
123592012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12360
12361 * doprnt.c (doprnt): Truncate multibyte char correctly.
12362 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12363 would mishandle a string argument "Xc" if X was a multibyte
12364 character of length 2: it would truncate after X's first byte
12365 rather than including all of X.
12366
c5cfcbe0
CY
123672012-06-06 Chong Yidong <cyd@gnu.org>
12368
12369 * buffer.c (word_wrap): Doc fix.
12370
c05cf390
PE
123712012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12372
12373 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12374
0c3461de
GM
123752012-06-03 Glenn Morris <rgm@gnu.org>
12376
12377 * xdisp.c (tool-bar-style): Doc fix.
12378
c71232db
UM
123792012-06-03 Ulrich Müller <ulm@gentoo.org>
12380
12381 * Makefile.in (PAXCTL): Define.
12382 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12383 binary via PaX flags if the paxctl utility is available.
12384 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12385 Restore PaX flags to their default. (Bug#11398)
12386
383f7350
CY
123872012-06-03 Chong Yidong <cyd@gnu.org>
12388
12389 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12390 buffer (Bug#11226).
12391
5f2c76c6
CY
123922012-06-03 Chong Yidong <cyd@gnu.org>
12393
12394 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12395 (note_mode_line_or_margin_highlight): If there is no help echo,
12396 use mode-line-default-help-echo. Handle the case where the mouse
12397 position is past the end of the mode line string.
12398
12399 * buffer.c (buffer_local_value_1): New function, split from
12400 Fbuffer_local_value; can return Qunbound.
12401 (Fbuffer_local_value): Use it.
12402 (Vmode_line_format): Docstring tweaks.
12403
773d47f6
PE
124042012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12405
12406 * sysdep.c (system_process_attributes): Improve comment.
12407
f2d6a3df
SM
124082012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12409
12410 * keyboard.c: Export real-this-command to Elisp.
12411 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12412 and DEFVAR it. Update all users.
12413
63810350
PE
124142012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12415
7bd5c1f4
PE
12416 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12417
63810350
PE
12418 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12419 Convert pctcpu and pctmem to Lisp float properly.
12420 Let the compiler fold better, as 100.0/0x8000 is exact.
12421
a2821611
AS
124222012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12423
12424 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12425 cons_block.
12426
5fceba1d
PE
124272012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12428
12429 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12430
c98ff5dd
DA
124312012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12432
12433 For a 'struct window', replace some Lisp_Object fields to
12434 bitfields where appropriate, remove unused fields.
12435 * window.h (struct window): Remove unused 'last_mark_x' and
12436 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12437 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12438 Change type of 'force_start', 'optional_new_start',
12439 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12440 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12441
ca34e0be
PE
124422012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12443
12444 Pacify gcc -Wdouble-precision when using Xaw.
12445 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12446 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12447 Use 'float' consistently, rather than 'float' in most places
12448 and 'double' in a couple of places.
12449
efc00ab1 124502012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12451
12452 * xdisp.c (handle_stop): Detect whether we have overlay strings
12453 loaded by testing it->current.overlay_string_index to be
12454 non-negative, instead of checking whether n_overlay_strings is
12455 positive. (Bug#11587)
12456
efc00ab1 124572012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12458
12459 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12460
12461 * doc.c (Fsubstitute_command_keys): Doc fix.
12462
efc00ab1 124632012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12464
12465 * search.c (search_buffer): Remove calls to
12466 r_alloc_inhibit_buffer_relocation, as it is now called by
12467 maybe_unify_char, which was the cause of relocation of buffer text
12468 in bug#11519.
12469
efc00ab1 124702012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12471
12472 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12473 for the duration of call to load_charset, to avoid problems with
12474 callers of maybe_unify_char that access buffer text through C
12475 pointers.
12476
12477 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12478 decrement the inhibition flag, instead of just setting or
12479 resetting it.
12480
ba93a187
PE
124812012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12482
12483 Remove obsolete '#define static' cruft.
12484 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12485 This #undef was "temporary" in 2000; it is no longer needed
12486 now that '#define static' has gone away.
12487 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12488 (gray_bitmap_bits): Remove; no longer needed.
12489 All uses replaced with definiens.
12490 * xterm.c: Include "bitmaps/gray.xbm".
12491
9e4bf381
PE
124922012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12493
12494 Clean up __executable_start, monstartup when --enable-profiling.
12495 The following changes affect the code only when profiling.
12496 * dispnew.c (__executable_start): Rename from safe_bcopy.
12497 Define only on platforms that need it.
12498 * emacs.c: Include <sys/gmon.h> when profiling.
12499 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12500 (__executable_start): Remove decl, since lisp.h does it now.
12501 (safe_bcopy): Remove decl; no longer has that name.
12502 (main): Coalesce #if into single bit of code, for simplicity.
12503 Cast pointers to uintptr_t, since standard libraries want integers
12504 and not pointers.
12505 * lisp.h (__executable_start): New decl.
12506
32d72c2f
GM
125072012-05-31 Glenn Morris <rgm@gnu.org>
12508
12509 * image.c (Fimagemagick_types): Doc fix.
12510
baac5bc7
JM
125112012-05-30 Jim Meyering <meyering@redhat.com>
12512
12513 * callproc.c (Fcall_process_region): Include directory component
12514 in mkstemp error message (Bug#11586).
12515
72cb32cf
PE
125162012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12517
12518 * alloc.c, lisp.h (make_pure_vector): Now static.
12519
61b108cc
SM
125202012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12521
12522 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12523 Move to byte-run.el.
12524 (Fautoload): Do the hash-doc more carefully.
12525 * data.c (Fdefalias): Purify definition, except for keymaps.
12526 (Qdefun): Move from eval.c.
12527 * lisp.h (Qdefun): Remove.
12528 * lread.c (read1): Tiny simplification.
12529
471fe23d
TN
125302012-05-29 Troels Nielsen <bn.troels@gmail.com>
12531
934f3f58 12532 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12533 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12534 Bug#9642, but explicitly check that the buffer the overlay would
12535 be moved to is live and rearrange lines to make sure that errors
12536 will not put the overlay in an inconsistent state.
12537 (Fdelete_overlay): Cosmetics.
12538
85d0efd1
EZ
125392012-05-28 Eli Zaretskii <eliz@gnu.org>
12540
12541 * w32term.c (my_bring_window_to_top): New function.
12542 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12543 could be different from the original one.
12544 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12545 (Bug#11513)
12546
12547 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12548 by calling BringWindowToTop.
12549
12550 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12551 (WM_EMACS_END): Increase by one.
12552
da92a98c
PE
125532012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12554
12555 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12556 This avoids undefined behavior that might cause the eassert
12557 to not catch an out-of-range value.
12558
74d1f848
JB
125592012-05-28 Juanma Barranquero <lekktu@gmail.com>
12560
12561 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12562 Update dependencies.
12563
9e1a06fc
EZ
125642012-05-27 Eli Zaretskii <eliz@gnu.org>
12565
12566 * bidi.c (bidi_mirror_char): Fix last change.
12567
f3dd7312
AS
125682012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12569
12570 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12571 when referring to sectname field in printf format.
12572
81899c91
PE
125732012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12574
57b81a9f
PE
12575 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12576 Only r_alloc_inhibit_buffer_relocation needed to be added;
12577 the others were already declared.
12578
81899c91
PE
12579 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12580 before checking whether it's out of range. Put the check inside
12581 eassert. See
12582 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12583
33017faf 125842012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12585
12586 * callproc.c (Fcall_process): Restore a line that was accidentally
12587 commented out in the 2011-02-13 change (bug#11547).
12588
33017faf 125892012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12590
12591 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12592 defined on ralloc.c.
12593
12594 * buffer.c [REL_ALLOC]: Remove prototypes of
12595 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12596 they are now on lisp.h.
12597
12598 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12599
12600 * search.c (search_buffer): Use it to inhibit relocation of buffer
12601 text while re_search_2 is doing its job, because re_search_2 is
12602 passed C pointers to buffer text. (Bug#11519)
12603
23415acf
EZ
12604 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12605 Update value to 24.
12606
44e27368
EZ
12607 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12608 state after an additional call to move_it_in_display_line_to, keep
12609 the values of it->max_ascent and it->max_descent found for the
12610 entire line.
12611 (pos_visible_p): Revert the comparison against bottom_y to what it
12612 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12613 (Bug#11464)
12614
c1892f11
PE
126152012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12616
12617 Fix coding-related core dumps with gcc -ftrapv.
12618 The code was computing A - B, where A and B are pointers, and B is
12619 random garbage. This can lead to core dumps on platforms that
12620 have special pointer registers, and it also leads to core dumps on
12621 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12622 A - B only when B is initialized properly.
12623 * coding.c (coding_set_source, coding_set_destination): Return void.
12624 (coding_change_source, coding_change_destinations): New functions,
12625 with the old behaviors of coding_set_source and coding_set_destination.
12626 All callers that need an offset changed to use these new functions.
12627
eb7afdad
GM
126282012-05-26 Glenn Morris <rgm@gnu.org>
12629
12630 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12631
f12fdf02
EZ
126322012-05-26 Eli Zaretskii <eliz@gnu.org>
12633
53a63be6 12634 Extend mouse support on W32 text-mode console.
61b108cc
SM
12635 * xdisp.c (draw_row_with_mouse_face):
12636 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12637
eb3f6f01 12638 * w32console.c: Include window.h.
61b108cc
SM
12639 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12640 New functions.
eb3f6f01
EZ
12641 (initialize_w32_display): Initialize mouse-highlight data.
12642
53a63be6
EZ
12643 * w32inevt.c: Include termchar.h and window.h.
12644 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12645 moves, call note_mouse_highlight. If help_echo changed, call
12646 gen_help_event to produce help-echo message in the echo area.
12647 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12648 highlight info.
12649
4cfd81f6
PE
126502012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12651
12652 * lread.c (read1): Simplify slightly to avoid an overflow warning
12653 with GCC 4.7.0 on x86-64.
12654
4446092a
EZ
126552012-05-26 Eli Zaretskii <eliz@gnu.org>
12656
12657 * bidi.c (bidi_mirror_char): Revert last change: an int is
12658 definitely wide enough here.
12659
42b2a986 126602012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12661
42b2a986 12662 Fix integer width and related bugs (Bug#9874).
eb106a49 12663 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12664 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12665 (string_bytes, check_sblock, allocate_string_data):
12666 (compact_small_strings, Fmake_bool_vector, make_string)
12667 (make_unibyte_string, make_multibyte_string)
12668 (make_string_from_bytes, make_specified_string)
12669 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12670 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12671 (mark_vectorlike):
12672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12673 (allocate_pseudovector):
12674 Use int, not EMACS_INT, where int is wide enough.
12675 (inhibit_garbage_collection, Fgarbage_collect):
12676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12677 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12678 int might not be wide enough.
12679 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12680 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12681 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12682 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12683 (bidi_level_of_next_char, bidi_move_to_visually_next):
12684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12685 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12686 (Fkill_buffer, Fset_buffer_major_mode)
12687 (advance_to_char_boundary, Fbuffer_swap_text)
12688 (Fset_buffer_multibyte, overlays_at, overlays_in)
12689 (overlay_touches_p, struct sortvec, record_overlay_string)
12690 (overlay_strings, recenter_overlay_lists)
12691 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12692 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12693 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12694 (Foverlay_recenter, last_overlay_modification_hooks_used)
12695 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12697 (validate_region): Omit unnecessary test for b <= e,
12698 since that's guaranteed by the previous test.
d311d28c
PE
12699 (adjust_overlays_for_delete): Avoid pos + length overflow.
12700 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12701 (report_overlay_modification):
12702 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12703 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12704 Omit pointer cast, which isn't needed anyway, and doesn't work
12705 after the EMACS_INT -> ptrdiff_t change.
02481186 12706 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12707 * buffer.h: Adjust decls to match defn changes elsewhere.
12708 (struct buffer_text, struct buffer):
12709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12710 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12711 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12712 not int, to avoid needless 32-bit limit on 64-bit hosts.
12713 (exec_byte_code): Use tighter memory-full test, one that checks
12714 for alloca overflow. Don't compute the address of the object just
12715 before an array, as that's not portable. Use EMACS_INT, not
12716 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12717 * callint.c (Fcall_interactively):
12718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12719 * callproc.c (call_process_kill, Fcall_process):
12720 Don't assume pid_t fits into an Emacs fixnum.
12721 (call_process_cleanup, Fcall_process, child_setup):
12722 Don't assume pid_t fits into int.
12723 (call_process_cleanup, Fcall_process, delete_temp_file)
12724 (Fcall_process_region):
12725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12726 (Fcall_process): Simplify handling of volatile integers.
12727 Use int, not EMACS_INT, where int will do.
12728 * casefiddle.c (casify_object, casify_region, operate_on_word)
12729 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12731 (casify_object): Avoid integer overflow when overallocating buffer.
12732 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12733 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12734 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12735 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12736 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12737 integers are now checked earlier. All uses replaced with XINT.
12738 (ccl_driver):
12739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12740 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12741 (ccl_driver, Fregister_code_conversion_map):
12742 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12743 (resolve_symbol_ccl_program): Check that vector header is in range.
12744 Always copy the vector, so that we can check its contents reliably
12745 now rather than having to recheck each instruction as it's being
12746 executed. Check that vector words fit in 'int'.
12747 (ccl_get_compiled_code, Fregister_ccl_program)
12748 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12749 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12750 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12751 contents are in range.
12752 (Fccl_execute_on_string): Check that status is in range.
12753 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12754 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12755 Accept and return EMACS_INT, not int, because callers can pass values
12756 out of 'int' range.
12757 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12758 (multibyte_chars_in_text, parse_str_as_multibyte)
12759 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12760 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12761 (string_escape_byte8, Fget_byte):
12762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12763 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12764 avoid mishandling large integers.
12765 * character.h: Adjust decls to match defn changes elsewhere.
12766 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12767 (Ffind_charset_region):
12768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12769 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12770 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12771 Don't assume fixnum fits in int.
d311d28c
PE
12772 (load_charset_map_from_vector, Fmap_charset_chars):
12773 Remove now-unnecessary CHECK_NATNUMs.
12774 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12775 Don't rely on undefined behavior with signed left shift overflow.
12776 Don't assume unsigned int fits into fixnum, or that fixnum fits
12777 into unsigned int. Don't require max_code to be a valid fixnum;
12778 that's not true for gb10830 4-byte on a 32-bit host. Allow
12779 invalid_code to be a cons, for the same reason. Require code_offset
12780 to be a character. Avoid int overflow if max_char is close
12781 to INT_MAX.
12782 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12783 this is intended anyway and avoids some undefined behavior.
12784 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12785 INDEX_TO_CODE_POINT, as that's what it expects.
12786 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12787 * charset.h (DECODE_CHAR): Return int, not unsigned;
12788 this is what was intended anyway, and it avoids undefined behavior.
12789 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12790 integer-overflow issues.
12791 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12792 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12793 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12794 * chartab.c (Fmake_char_table, Fset_char_table_range)
12795 (uniprop_get_decoder, uniprop_get_encoder):
12796 Don't assume fixnum fits in int.
12797 * cmds.c (move_point): New function, that does the gist of
12798 Fforward_char and Fbackward_char, but does so while checking
12799 for integer overflow more accurately.
c96e5d6a 12800 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12801 (Fforward_line, Fend_of_line, internal_self_insert)
12802 (internal_self_insert):
12803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12804 Fix a FIXME, by checking for integer overflow when calculating
12805 target_clm and actual_clm.
12806 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12807 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12808 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12809 (coding_alloc_by_making_gap, alloc_destination)
12810 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12811 (encode_coding_utf_16, detect_coding_emacs_mule)
12812 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12813 (detect_coding_iso_2022, decode_coding_iso_2022)
12814 (encode_invocation_designation, encode_designation_at_bol)
12815 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12816 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12817 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12818 (encode_coding_ccl, encode_coding_raw_text)
12819 (detect_coding_charset, decode_coding_charset)
12820 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12821 (produce_composition, produce_charset, produce_annotation)
12822 (decode_coding, handle_composition_annotation)
12823 (handle_charset_annotation, consume_chars, decode_coding_gap)
12824 (decode_coding_object, encode_coding_object, detect_coding_system)
12825 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12826 (code_convert_region, code_convert_string)
8f50130c
PE
12827 (Fdefine_coding_system_internal)
12828 (coding_set_source, coding_set_destination):
d311d28c
PE
12829 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12830 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12831 (Fdefine_coding_system_internal):
12832 Don't assume fixnums fit in int.
12833 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12834 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12835 (Funencodable_char_position, Fcheck_coding_systems_region)
12836 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12837 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12838 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12839 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12840 Don't access memory outside of the args array.
d311d28c 12841 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12842 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12843 result of ENCODE_CHAR.
d311d28c
PE
12844 * coding.h: Adjust decls to match defn changes elsewhere.
12845 (struct coding_system):
12846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12847 * composite.c (get_composition_id, find_composition)
12848 (run_composition_function, update_compositions)
12849 (compose_text, composition_gstring_put_cache)
12850 (composition_gstring_p, composition_gstring_width)
12851 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12852 (composition_compute_stop_pos, composition_reseat_it)
12853 (composition_update_it, struct position_record)
12854 (find_automatic_composition, composition_adjust_point)
12855 (Fcomposition_get_gstring, Ffind_composition_internal):
12856 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12857 (update_compositions):
12858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12859 * composite.h: Adjust decls to match defn changes elsewhere.
12860 (struct composition):
12861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12862 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12863 Do not attempt to compute the address of the object just before a
12864 buffer; this is not portable.
12865 (Faref, Faset):
12866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12867 (Faset): Use int, not EMACS_INT, where int is wide enough.
12868 (Fstring_to_number): Don't assume fixnums fit in int.
12869 (Frem): Don't assume arg is nonnegative.
12870 * dbusbind.c (xd_append_arg): Check for integers out of range.
12871 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12872 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12873 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12874 (xd_get_connection_references): Return ptrdiff_t, not int.
12875 All uses changed.
12876 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12877 (xd_read_message_1):
12878 Use int, not unsigned, where the dbus API uses int.
12879 (Fdbus_message_internal): Don't overflow mtype.
12880 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12881 * dired.c (directory_files_internal, file_name_completion, scmp)
12882 (file_name_completion_stat):
12883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12884 (file_name_completion): Don't overflow matchcount.
12885 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12886 * dispextern.h: Adjust decls to match defn changes elsewhere.
12887 (struct text_pos, struct glyph, struct bidi_saved_info)
12888 (struct bidi_string_data, struct bidi_it, struct composition_it)
12889 (struct it):
12890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12891 (struct display_pos, struct composition_it, struct it):
12892 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12893 * dispnew.c (increment_matrix_positions)
12894 (increment_row_positions, mode_line_string)
12895 (marginal_area_string):
12896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12897 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12898 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12899 (duration_to_sec_usec): New function, to check for overflow better.
12900 (Fsleep_for, sit_for): Use it.
12901 * doc.c (get_doc_string, store_function_docstring):
12902 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12903 (get_doc_string, Fsnarf_documentation):
12904 Use int, not EMACS_INT, where int is wide enough.
12905 (get_doc_string):
12906 Use SAFE_ALLOCA, not alloca.
12907 Check for overflow when converting EMACS_INT to off_t.
12908 * doprnt.c (doprnt):
12909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12910 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12911 Don't assume uid_t fits into fixnum.
12912 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12913 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12914 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12915 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12916 (general_insert_function)
12917 (Finsert_char, make_buffer_string, make_buffer_string_both)
12918 (update_buffer_properties, Fbuffer_substring)
12919 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12920 (Fsubst_char_in_region, check_translation)
12921 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12922 (transpose_markers, Ftranspose_regions):
12923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12924 (clip_to_bounds): Move to lisp.h as an inline function).
12925 (Fconstrain_to_field): Don't assume integers are nonnegative.
12926 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12927 (Fsubst_char_in_region, Fsave_restriction):
12928 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12929 (Femacs_pid): Don't assume pid_t fits into fixnum.
12930 (lo_time): Use int, not EMACS_INT, when int suffices.
12931 (lisp_time_argument): Check for usec out of range.
12932 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12933 (Fuser_login_name, Fuser_full_name): Signal an error
12934 if a uid argument is out of range, rather than relying on
12935 undefined behavior.
c8d5c857
PE
12936 (Fformat_time_string): Remove now-unnecessary check.
12937 lisp_time_argument checks for out-of-range usec now.
243e0530 12938 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12939 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12940 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12941 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12942 (init_cmdargs, Fdump_emacs):
12943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12944 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12945 the bottom (typically) 32 bits of the fixnum.
12946 * eval.c (specpdl_size, call_debugger):
12947 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12948 (when_entered_debugger, Fbacktrace_debug):
12949 Don't assume fixnum can fit in int.
12950 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12951 the object just before a buffer; this is not portable.
12952 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12953 (grow_specpdl, unbind_to):
12954 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12955 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12956 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12957 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12958 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12959 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12961 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12962 (a_write, e_write):
12963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12964 (Fcopy_file, non_regular_nbytes, read_non_regular)
12965 (Finsert_file_contents):
12966 Use int, not EMACS_INT, where int is wide enough.
12967 (READ_BUF_SIZE): Verify that it fits in int.
12968 (Finsert_file_contents): Check that counts are in proper range,
12969 rather than assuming fixnums fit into ptrdiff_t etc.
12970 Don't assume fixnums fit into int.
125b3835 12971 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12972 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12973 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12974 (string_char_to_byte, string_byte_to_char)
12975 (string_make_multibyte, string_to_multibyte)
12976 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12977 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12978 (substring_both, Fdelete, internal_equal, Ffillarray)
12979 (Fclear_string, mapcar1)
12980 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12981 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12982 (larger_vector, make_hash_table, maybe_resize_hash_table)
12983 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12984 (Fmaphash, secure_hash):
12985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12986 (concat): Check for string index and length overflow.
12987 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12988 (Frequire):
12989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12990 (larger_vector): New API (vec, incr_min, size_max) replaces old
12991 one (vec, new_size, init). This catches size overflow.
12992 INIT was removed because it was always Qnil.
12993 All callers changed.
12994 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12995 the upper bound on a hash table index size.
12996 (make_hash_table, maybe_resize_hash_table): Use it.
12997 (secure_hash): Computer start_byte and end_byte only after
12998 they're known to be in ptrdiff_t range.
12999 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13000 (Ffont_get_glyphs, Ffont_at):
13001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13002 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13003 (Flist_fonts, Fopen_font):
13004 Don't assume fixnum can fit in int.
13005 (check_gstring): Don't assume index can fit in int.
13006 (font_match_p): Check that fixnum is a character, not a nonnegative
13007 fixnum, since the later code needs to stuff it into an int.
13008 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13009 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13010 conversion overflow issues.
13011 (Fopen_font): Check for integer out of range.
13012 (Ffont_get_glyphs): Don't assume index can fit in int.
13013 * font.h: Adjust decls to match defn changes elsewhere.
13014 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13015 integer overflow.
13016 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13017 printmax_t, where ptrdiff_t is wide enough.
13018 (Finternal_char_font):
13019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13020 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13021 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13022 (Fset_frame_position, x_set_frame_parameters)
13023 (x_set_line_spacing, x_set_border_width)
13024 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13025 Check that fixnums are in proper range for system types.
13026 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13028 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13029 Use SAFE_ALLOCA_LISP, not alloca.
13030 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13031 intptr_t is wide enough.
13032 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13033 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13034 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13035 Check for fixnum out of range.
13036 * ftfont.c (ftfont_list): Don't assume index fits in int.
13037 Check that fixnums are in proper range for system types.
13038 (ftfont_shape_by_flt):
13039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
13040 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13042 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13043 Check that fixnums are in proper range for system types.
13044 * gnutls.h: Adjust decls to match defn changes elsewhere.
13045 * gtkutil.c (xg_dialog_run):
13046 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13047 (update_frame_tool_bar):
13048 Check that fixnums are in proper range for system types.
13049 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 13050 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
13051 * indent.c (last_known_column, last_known_column_point):
13052 (current_column_bol_cache):
13053 (skip_invisible, current_column, check_display_width):
13054 (check_display_width, scan_for_column, current_column_1)
13055 (Findent_to, Fcurrent_indentation, position_indentation)
13056 (indented_beyond_p, Fmove_to_column, compute_motion):
13057 (Fcompute_motion, Fvertical_motion):
13058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13059 (last_known_column_modified): Use EMACS_INT, not int.
13060 (check_display_width):
13061 (Fcompute_motion):
13062 Check that fixnums and floats are in proper range for system types.
13063 (compute_motion): Don't assume index or fixnum fits in int.
13064 (compute_motion, Fcompute_motion):
13065 Use int, not EMACS_INT, when it is wide enough.
13066 (vmotion): Omit local var start_hpos that is always 0; that way
13067 we don't need to worry about overflow in expressions involving it.
13068 * indent.h: Adjust decls to match defn changes elsewhere.
13069 (struct position):
13070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13071 Use int, not EMACS_INT, where int is wide enough.
13072 Remove unused members ovstring_chars_done and tab_offset;
13073 all uses removed.
13074 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13075 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13076 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13077 (make_gap, copy_text, insert, insert_and_inherit)
13078 (insert_before_markers, insert_before_markers_and_inherit)
13079 (insert_1, count_combining_before, count_combining_after)
13080 (insert_1_both, insert_from_string)
13081 (insert_from_string_before_markers, insert_from_string_1)
13082 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13083 (adjust_after_replace, adjust_after_insert, replace_range)
13084 (replace_range_2, del_range, del_range_1, del_range_byte)
13085 (del_range_both, del_range_2, modify_region)
13086 (prepare_to_modify_buffer, signal_before_change)
13087 (signal_after_change, Fcombine_after_change_execute):
13088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13089 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13090 (balance_an_interval, split_interval_right, split_interval_left)
13091 (find_interval, next_interval, update_interval)
13092 (adjust_intervals_for_insertion, delete_node, delete_interval)
13093 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13094 (static_offset_intervals, offset_intervals)
13095 (merge_interval_right, merge_interval_left, make_new_interval)
13096 (graft_intervals_into_buffer, temp_set_point_both)
13097 (temp_set_point, set_point, adjust_for_invis_intang)
13098 (set_point_both, move_if_not_intangible, get_property_and_range)
13099 (get_local_map, copy_intervals, copy_intervals_to_string)
13100 (compare_string_intervals, set_intervals_multibyte_1):
13101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13102 * intervals.h: Adjust decls to match defn changes elsewhere.
13103 (struct interval):
13104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13105 * keyboard.c (this_command_key_count, this_single_command_key_start)
13106 (before_command_key_count, before_command_echo_length, echo_now)
13107 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13108 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13109 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13110 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13112 (last_non_minibuf_size, last_point_position, echo_truncate)
13113 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13114 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13115 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13116 (stuff_buffered_input):
13117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13118 (last_auto_save, command_loop_1, read_char):
13119 Use EMACS_INT, not int, to avoid integer overflow.
13120 (record_char): Avoid overflow in total_keys computation.
13121 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13122 * keyboard.h: Adjust decls to match defn changes elsewhere.
13123 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13124 (Fkey_description, Fdescribe_vector, Flookup_key):
13125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13126 (click_position): New function, to check that positions are in range.
13127 (Fcurrent_active_maps):
13128 (describe_command):
13129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13130 (Faccessible_keymaps, Fkey_description):
13131 (preferred_sequence_p):
13132 Don't assume fixnum can fit into int.
13133 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13134 Check for integer overflow in size calculations.
13135 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13136 avoid mishandling large integers.
13137 * lisp.h: Adjust decls to match defn changes elsewhere.
13138 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13139 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13140 (struct Lisp_Marker):
13141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13142 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
13143 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13144 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13145 All callers changed.
13146 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13147 Assume the arg has valid form, since it always does.
13148 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13149 unsigned integer system type.
13150 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13151 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13153 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13154 (duration_to_sec_usec): New decl.
13155 * lread.c (read_from_string_index, read_from_string_index_byte)
13156 (read_from_string_limit, readchar, unreadchar, openp)
13157 (read_internal_start, read1, oblookup):
13158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13159 (Fload, readevalloop, Feval_buffer, Feval_region):
13160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13161 (openp): Check for out-of-range argument to 'access'.
13162 (read1): Use int, not EMACS_INT, where int is wide enough.
13163 Don't assume fixnum fits into int.
6efdadfd 13164 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13165 (read_filtered_event): Use duration_to_sec_usec
13166 to do proper overflow checking on durations.
d311d28c
PE
13167 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13168 in size calculation.
13169 (Fexecute_kbd_macro):
13170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13171 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13172 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13173 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13174 (set_marker_both, set_marker_restricted_both, marker_position)
13175 (marker_byte_position, Fbuffer_has_markers_at):
13176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13177 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13178 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13179 It now merely ensures that the menu is large enough, without
13180 necessarily growing it, as this avoids some integer overflow issues.
13181 All callers changed.
13182 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13184 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13185 Use SAFE_ALLOCA_LISP, not alloca.
13186 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13187 to EMACS_INT. Check that fixnums are in proper range for system types.
13188 * minibuf.c (minibuf_prompt_width, string_to_object)
13189 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13190 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13192 (get_minibuffer, read_minibuf_unwind):
13193 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13194 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13195 this simplifies overflow checking. All callers changed.
13196 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13197 (Ftest_completion):
13198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13199 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13200 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13201 Check that fixnums are in proper range for system types.
13202 (Fx_create_frame, Fx_show_tip):
13203 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13204 * nsfont.m (ns_findfonts, nsfont_list_family):
13205 Don't assume fixnum fits in long.
13206 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13207 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13208 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13209 wide enough.
17fdb222 13210 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13212 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13213 (PRINTDECLARE, PRINTPREPARE):
13214 (strout, print_string):
13215 (print, print_preprocess, print_check_string_charset_prop)
13216 (print_object):
13217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13218 (PRINTDECLARE):
13219 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13221 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13222 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13223 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13224 (print_error_message): Use SAFE_ALLOCA, not alloca.
13225 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13226 (print_depth, new_backquote_output, print_number_index):
13227 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13228 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13229 (Fset_process_window_size, Fformat_network_address)
13230 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13231 (sigchld_handler):
d311d28c 13232 Check that fixnums are in proper range for system types.
d44287d4 13233 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13234 Check for process-ids out of pid_t range rather than relying on
13235 undefined behavior.
e4d81efc 13236 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13237 (Fformat_network_address, read_process_output, send_process)
13238 (Fprocess_send_region, status_notify):
13239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13240 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13241 (wait_reading_process_output, read_process_output, exec_sentinel):
13242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13243 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13244 (Faccept_process_output): Use duration_to_sec_usec to do proper
13245 overflow checking on durations.
dde14581
PE
13246 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13247 Don't assume pid_t fits in int.
02481186
PE
13248 * process.h (struct Lisp_Process): Members tick and update_tick
13249 are now of type EMACS_INT, not int.
b62b53e8
PE
13250 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13251 configured --with-wide-int.
d311d28c
PE
13252 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13253 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13254 * search.c (looking_at_1, string_match_1):
13255 (fast_string_match, fast_c_string_match_ignore_case)
13256 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13257 (scan_newline, find_before_next_newline, search_command)
13258 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13259 (set_search_regs, wordify):
13260 (Freplace_match):
13261 (Fmatch_data):
13262 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13263 (string_match_1, search_buffer, set_search_regs):
13264 (Fmatch_data):
13265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13266 (wordify): Check for overflow in size calculation.
13267 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13268 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13269 Check that fixnums are in proper range for system types.
13270 * sound.c (struct sound_device)
13271 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13273 (Fplay_sound_internal):
13274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13275 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13276 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13277 (Fparse_partial_sexp):
13278 Don't assume fixnums can fit in int.
13279 (struct lisp_parse_state, find_start_pos, find_start_value)
13280 (find_start_value_byte, find_start_begv)
13281 (update_syntax_table, char_quoted, dec_bytepos)
13282 (find_defun_start, prev_char_comend_first, back_comment):
13283 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13284 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13286 (Finternal_describe_syntax_value): Check that match_lisp is a
13287 character, not an integer, since the code stuffs it into int.
13288 (scan_words, scan_sexps_forward):
13289 Check that fixnums are in proper range for system types.
13290 (Fforward_word):
13291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13292 (scan_sexps_forward):
13293 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13294 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13295 * syntax.h: Adjust decls to match defn changes elsewhere.
13296 (struct gl_state_s):
13297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13298 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13299 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13300 * sysdep.c (wait_for_termination_1, wait_for_termination)
13301 (interruptible_wait_for_termination, mkdir):
13302 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13303 (emacs_read, emacs_write):
13304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13305 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13306 and double all fit in int.
d311d28c
PE
13307 * term.c (set_tty_color_mode):
13308 Check that fixnums are in proper range for system types.
13309 * termhooks.h (struct input_event):
13310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13311 * textprop.c (validate_interval_range, interval_of)
13312 (Fadd_text_properties, set_text_properties_1)
13313 (Fremove_text_properties, Fremove_list_of_text_properties)
13314 (Ftext_property_any, Ftext_property_not_all)
13315 (copy_text_properties, text_property_list, extend_property_ranges)
13316 (verify_interval_modification):
13317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13318 (Fnext_single_char_property_change)
13319 (Fprevious_single_char_property_change):
13320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13321 (copy_text_properties):
13322 Check for integer overflow in index calculation.
d311d28c
PE
13323 * undo.c (last_boundary_position, record_point, record_insert)
13324 (record_delete, record_marker_adjustment, record_change)
13325 (record_property_change):
13326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13327 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13328 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13329 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13330 (Fx_hide_tip, Fx_file_dialog):
13331 * w32menu.c (set_frame_menubar):
13332 Use ptrdiff_t, not int, for consistency with rest of code.
13333 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13334 (select_window, Fdelete_other_windows_internal)
13335 (window_scroll_pixel_based, window_scroll_line_based)
13336 (Frecenter, Fset_window_configuration):
13337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13338 (Fset_window_hscroll, run_window_configuration_change_hook)
13339 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13340 (Fscroll_other_window, Frecenter):
d311d28c
PE
13341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13342 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13343 Don't assume fixnum fits in int.
13344 (Fset_window_scroll_bars):
13345 Check that fixnums are in proper range for system types.
13346 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13347 (string_pos, c_string_pos, number_of_chars, init_iterator)
13348 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13349 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13350 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13351 (face_before_or_after_it_pos, handle_invisible_prop)
13352 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13353 (display_prop_intangible_p, string_buffer_position_lim)
13354 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13355 (get_overlay_strings_1, get_overlay_strings)
13356 (iterate_out_of_display_property, forward_to_next_line_start)
13357 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13358 (get_next_display_element, set_iterator_to_next)
13359 (get_visually_first_element, compute_stop_pos_backwards)
13360 (handle_stop_backwards, next_element_from_buffer)
13361 (move_it_in_display_line_to, move_it_in_display_line)
13362 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13363 (add_to_log, message_dolog, message_log_check_duplicate)
13364 (message2, message2_nolog, message3, message3_nolog
13365 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13366 (current_message_1, truncate_echo_area, truncate_message_1)
13367 (set_message, set_message_1, store_mode_line_noprop)
13368 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13369 (text_outside_line_unchanged_p, check_point_in_composition)
13370 (reconsider_clip_changes)
13371 (redisplay_internal, set_cursor_from_row, try_scrolling)
13372 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13373 (redisplay_window, find_last_unchanged_at_beg_row)
13374 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13375 (trailing_whitespace_p, find_row_edges, display_line)
13376 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13377 (display_mode_element, store_mode_line_string)
13378 (pint2str, pint2hrstr, decode_mode_spec)
13379 (display_count_lines, display_string, draw_glyphs)
13380 (x_produce_glyphs, x_insert_glyphs)
13381 (rows_from_pos_range, mouse_face_from_buffer_pos)
13382 (fast_find_string_pos, mouse_face_from_string_pos)
13383 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13385 (safe_call, init_from_display_pos, handle_fontified_prop)
13386 (handle_single_display_spec, load_overlay_strings)
13387 (with_echo_area_buffer, setup_echo_area_for_printing)
13388 (display_echo_area, echo_area_display)
13389 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13390 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13391 (redisplay_window, dump_glyph_row, display_mode_line)
13392 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13393 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13395 (handle_single_display_spec, build_desired_tool_bar_string)
13396 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13397 (get_specified_cursor_type):
13398 Check that fixnums are in proper range for system types.
13399 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13400 (Flookup_image_map):
13401 Don't assume fixnums fit in int.
13402 (compare_overlay_entries):
13403 Avoid mishandling comparisons due to subtraction overflow.
13404 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13405 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13406 (handle_tool_bar_click):
13407 Use int, not unsigned, since we prefer signed and the signedness
13408 doesn't matter here.
13409 (get_next_display_element, next_element_from_display_vector):
13410 Use int, not EMACS_INT, when int is wide enough.
13411 (start_hourglass): Use duration_to_sec_usec to do proper
13412 overflow checking on durations.
13413 * xfaces.c (Fbitmap_spec_p):
13414 Check that fixnums are in proper range for system types.
13415 (compare_fonts_by_sort_order):
13416 Avoid mishandling comparisons due to subtraction overflow.
13417 (Fx_family_fonts, realize_basic_faces):
13418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13419 (Fx_family_fonts):
13420 Don't assume fixnum fits in int.
13421 Use SAFE_ALLOCA_LISP, not alloca.
13422 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13423 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13424 (face_at_buffer_position, face_for_overlay_string)
13425 (face_at_string_position):
13426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13427 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13428 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13429 (Fx_show_tip):
13430 Check that fixnums are in proper range for system types.
13431 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13432 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13434 (Fx_change_window_property): Don't assume fixnums fit in int.
13435 * xfont.c (xfont_chars_supported):
13436 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13437 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13438 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13440 * xml.c (parse_region):
13441 * xrdb.c (magic_file_p):
13442 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13443 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13444 (x_get_local_selection, x_reply_selection_request)
13445 (x_handle_selection_request, wait_for_property_change):
13446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13447 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13448 short is wide enough.
13449 (x_send_client_event): Don't assume fixnum fits in int.
13450 * xterm.c (x_x_to_emacs_modifiers):
13451 Don't assume EMACS_INT overflows nicely into int.
13452 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13453 may come from Lisp.
13454 (handle_one_xevent): NATNUMP can eval its arg twice.
13455 (x_connection_closed):
13456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13457 * xterm.h: Adjust decls to match defn changes elsewhere.
13458 (struct scroll_bar): Use struct vectorlike_header
13459 rather than rolling our own approximation.
13460 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13461
c6574eb5
GM
134622012-05-25 Glenn Morris <rgm@gnu.org>
13463
13464 * lisp.mk (lisp): Update for more files being compiled now.
13465
e8d32c7e
SM
134662012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13467
48def666
SM
13468 * lread.c: Remove `read_pure' which makes no difference.
13469 (read_pure): Remove var.
13470 (unreadpure): Remove function.
13471 (readevalloop): Don't call read_list with -1 flag.
13472 (read1, read_vector): Don't test read_pure any more.
13473 (read_list): Simplify.
13474
e8d32c7e
SM
13475 * fileio.c, character.h: Minor style tweaks.
13476
4b2addb7
DA
134772012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13478
13479 * window.h (clip_changed): Remove useless declaration.
13480
584461b2
JB
134812012-05-22 Juanma Barranquero <lekktu@gmail.com>
13482
13483 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13484 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13485
34374650
PE
134862012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13487
13488 Remove src/m/*.
13489 This directory predates autoconf and is no longer needed nowadays.
13490 Move its few remaining bits of functionality to where they're needed.
13491 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13492 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13493 * m/template.h: Remove.
13494 * Makefile.in (M_FILE): Remove. All uses removed.
13495 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13496 * lisp.h (USE_LSB_TAG):
13497 * mem-limits.h (EXCEEDS_LISP_PTR):
13498 Use VAL_MAX, not VALBITS, in #if.
13499 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13500 (EMACS_UINT): Define unconditionally now.
13501 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13502 (BITS_PER_EMACS_INT): New constants, replacing
13503 what used to be in config.h, but not useful in #if.
13504 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13505 define them any more.
13506 (VAL_MAX): New macro.
13507 (VALMASK): Use it.
13508 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13509 BITS_PER_EMACS_INT, in #if.
13510 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13511 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13512 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13513 * s/ms-w32.h (DATA_START):
13514 Move here from removed file m/intel386.h.
13515 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13516 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13517
261cb4bb
PE
135182012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13519
13520 Assume C89 or later.
13521 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13522 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13523 (xrealloc):
13524 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13525 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13526 * textprop.c, tparam.c (NULL): Remove.
13527 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13528 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13529 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13530 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13531 * xterm.c (input_signal_count): Assume volatile works.
13532
ff23cd9f
KB
135332012-05-21 Ken Brown <kbrown@cornell.edu>
13534
13535 * xgselect.c (xg_select): Fix first argument in call to 'select'
13536 (bug#11508).
13537
1b170bc6
KB
135382012-05-20 Ken Brown <kbrown@cornell.edu>
13539
13540 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13541 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13542
b2f4d39f
KB
135432012-05-19 Ken Brown <kbrown@cornell.edu>
13544
13545 * xfns.c (x_in_use): Remove `static' qualifier.
13546 * xterm.h (x_in_use): Declare.
13547 * xgselect.c: Include xterm.h.
13548 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13549 and `display_arg' (bug#9754).
13550
003fdae2
PE
135512012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13552
9232a6d9
PE
13553 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13554
003fdae2
PE
13555 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13556 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13557
784b56e2
EZ
135582012-05-18 Eli Zaretskii <eliz@gnu.org>
13559
13560 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13561
13562 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13563 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13564
13565 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13566 reference to image_cache->refcount.
13567 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13568
a0a79cde
JL
135692012-05-17 Juri Linkov <juri@jurta.org>
13570
13571 * search.c (Fword_search_regexp, Fword_search_backward)
13572 (Fword_search_forward, Fword_search_backward_lax)
13573 (Fword_search_forward_lax): Move functions to isearch.el
13574 (bug#10145, bug#11381).
13575
b0572523
PE
135762012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13577
13578 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13579
9660f5fc
SM
135802012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13581
13582 * lread.c (init_obarray): Declare Qt and Qnil as special.
13583
4374de83
GM
135842012-05-14 Glenn Morris <rgm@gnu.org>
13585
13586 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13587 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13588
dc44c39a
PE
135892012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13590
078c97cb
PE
13591 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13592
dc44c39a
PE
13593 * unexaix.c: Port to more-recent AIX compilers.
13594 (report_error, report_error_1, make_hdr, copy_sym)
13595 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13596 Make arguments const char *, not char *, to avoid violations of C
13597 standard and to fix some AIX warnings reported by Gilles Pion.
13598
e18afed7 135992012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13600
13601 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13602 already have overlays loaded.
13603 (handle_single_display_spec): Before returning without displaying
13604 fringe bitmap, synchronize the bidi iterator with the main display
13605 iterator, by calling iterate_out_of_display_property.
13606 (iterate_out_of_display_property): Detect buffer iteration by
13607 testing that it->string is a Lisp string.
13608 (get_next_display_element): When the current object is exhausted,
13609 and there's something on it->stack, call set_iterator_to_next to
13610 proceed with what's on the stack, instead of returning zero.
13611 (set_iterator_to_next): If called at the end of a Lisp string,
13612 proceed to consider_string_end without incrementing string
13613 position. Don't increment display vector index past the end of
13614 the display vector. (Bug#11417)
c8fb9dc6
EZ
13615 (pos_visible_p): Don't report a position visible when move_it_to
13616 stopped at the last line of window, which happens to be scanned
13617 backwards by the bidi iteration. (Bug#11464)
ac268e67 13618
e18afed7 136192012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13620
13621 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13622 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13623 are on a TTY, and thus unable to display on the fringes.
13624 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13625 so we need to signal to the caller that this is a "replacing"
13626 display spec. This fixes display when the spec is invalid or we
13627 are on a TTY.
13628
e18afed7 136292012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13630
13631 * unexaix.c (make_hdr): Fix typo in prototype.
13632 This bug broke the build on AIX. Problem reported by Gilles Pion.
13633
9d0a235a
MA
136342012-05-14 Michael Albinus <michael.albinus@gmx.de>
13635
13636 * keyboard.c (kbd_buffer_get_event): Read special events also in
13637 batch mode. (Bug#11415)
13638
9e6b06ed
GM
136392012-05-12 Glenn Morris <rgm@gnu.org>
13640
13641 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13642
c1a1d7a3
EZ
136432012-05-12 Eli Zaretskii <eliz@gnu.org>
13644
13645 * lisp.mk (lisp): Add newcomment.elc.
13646
3fe7cdc8
GM
136472012-05-12 Glenn Morris <rgm@gnu.org>
13648
13649 * Makefile.in (MKDIR_P): New, set by configure.
13650 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13651
53f7d2c0
PE
136522012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13653
13654 Remove unused function hourglass_started.
13655 * dispextern.h (hourglass_started):
13656 * w32fns.c (hourglass_started):
13657 * xdisp.c (hourglass_started): Remove.
13658
75aafb17
JB
136592012-05-10 Juanma Barranquero <lekktu@gmail.com>
13660
13661 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13662 Update dependencies.
13663
12959e8e
PE
136642012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13665
97107e2e
PE
13666 * xgselect.c (xg_select): Put maxfds+1 into a var.
13667 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13668
12959e8e
PE
13669 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13670
836d29b3
DA
136712012-05-10 Dave Abrahams <dave@boostpro.com>
13672
13673 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13674 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13675
5cb67954
MA
136762012-05-09 Michael Albinus <michael.albinus@gmx.de>
13677
13678 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13679 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13680 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13681 Initialize xd_registered_buses.
13682
3478ec45
PE
136832012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13684
b263a6b0
PE
13685 Untag more efficiently if USE_LSB_TAG.
13686 This is based on a proposal by YAMAMOTO Mitsuharu in
13687 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13688 For an admittedly artificial (nth 8000 longlist) benchmark on
13689 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13690 Emacs's overall text size by 1%.
13691 * lisp.h (XUNTAG): New macro.
13692 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13693 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13694 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13695 * eval.c (Fautoload):
13696 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13697 * frame.h (XFRAME): Use XUNTAG.
13698
3478ec45
PE
13699 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13700 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13701 Remove unportable assumptions about print widths of types like
13702 dbus_uint32_t.
13703 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13704 intptr_t when converting between pointer and integer, to avoid GCC
13705 warnings about wrong width.
13706
666b903b 137072012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13708
13709 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13710 stack for each reader_thread, instead of defaulting to 8MB
13711 determined by the linker. This avoids failures in creating
13712 subprocesses on Windows 7, see the discussion in this thread:
13713 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13714
b120cc17
JC
137152012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13716
13717 Fix up display of the *Minibuf-0* buffer in the mini window.
13718 * keyboard.c (read_char): Don't clear the echo area if there's no
13719 message to clear.
13720 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13721 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13722
9a4b36f8
MA
137232012-05-07 Michael Albinus <michael.albinus@gmx.de>
13724
13725 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13726 batch mode.
13727
e5f9458f
CY
137282012-05-06 Chong Yidong <cyd@gnu.org>
13729
13730 * lisp.mk (lisp): Update.
13731
eceeb5fc 137322012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13733
13734 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13735
71873e2b
SM
137362012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13737
13738 * data.c (PUT_ERROR): New macro.
13739 (syms_of_data): Use it. Add new error type `user-error'.
13740 * undo.c (user_error): New function.
13741 (Fprimitive_undo): Use it.
13742 * print.c (print_error_message): Adjust print style for `user-error'.
13743 * keyboard.c (user_error): New function.
13744 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13745
ab0fa4e4
PE
137462012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13747
13748 Do not limit current-time-string to years 1000..9999.
13749 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13750 (Fcurrent_time_string): Support any year that is supported by the
13751 underlying localtime representation. Don't use asctime, as it
13752 has undefined behavior for years outside the range -999..9999.
13753
7ed806a7
PE
137542012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13755
13756 Fix race conditions involving setenv, gmtime, localtime, asctime.
13757 Without this fix, interrupts could mess up code that uses these
13758 nonreentrant functions, since setting TZ invalidates existing
13759 tm_zone or tzname values, and since most of these functions return
13760 pointers to static storage.
13761 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13762 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13763 Grow the critical sections to include not just invoking
13764 localtime/gmtime, but also accessing these functions' results
13765 including their tm_zone values if any, and any related TZ setting.
13766 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13767 so that the struct tm is saved in the critical section.
13768 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13769 motivated by the fact that memory allocation needs to be outside
13770 the critical section.
13771
0c16dfed
DA
137722012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13773
13774 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13775 with RESET_INTERVAL.
13776
13777 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13778 Remove duplicated buffer name initialization.
13779
3f83ace8
JM
137802012-05-02 Jim Meyering <jim@meyering.net>
13781
13782 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13783
c7b8541e
JM
13784 * xfns.c (x_window): Use xstrdup (Bug#11375).
13785
90207a15 137862012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13787
13788 * xdisp.c (pos_visible_p): If already at a newline from the
13789 display string before the 'while' loop, don't walk back the glyphs
13790 from it3.glyph_row. Solves assertion violation when the display
13791 string begins with a newline (egg.el). (Bug#11367)
13792
b593d6a9
AH
137932012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13794
13795 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13796 Move to simple.el.
13797
4737362e
GM
137982012-05-01 Glenn Morris <rgm@gnu.org>
13799
99cf43f9
GM
13800 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13801 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13802 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13803 All were removed before 23.1.
13804
9311dcff
GM
13805 * dispnew.c: Remove HAVE_LIBNCURSES test;
13806 it is always true on relevant platforms.
13807
4d5c6349
GM
13808 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13809 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13810
4737362e
GM
13811 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13812
74dd3a6b
AS
138132012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13814
13815 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13816 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13817 Remove.
13818
13c379ee
PE
138192012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13820
13821 Do not avoid creating empty evaporating overlays (Bug#9642).
13822 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13823 That is, do not delete an evaporating overlay if it becomes
13824 empty after its bounds are adjusted to fit within its buffer.
13825 This fix caused other problems, and I'm reverting it until we get
13826 to the bottom of them.
13827
a8e7d6d7 138282012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13829
13830 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13831
a8e7d6d7 138322012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13833
13834 * xdisp.c (pos_visible_p): If the window start position is beyond
13835 ZV, start the display from buffer beginning. Prevents assertion
13836 violation in init_iterator when the minibuffer window is scrolled
13837 via the scroll bar.
13838
13839 * window.c (window_scroll_pixel_based): Likewise.
13840
a8e7d6d7 138412012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13842
13843 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13844
a8e7d6d7 138452012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13846
13847 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13848 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13849
a8e7d6d7 138502012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13851
b593d6a9
AH
13852 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13853 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13854
1c6900d9
EZ
138552012-04-26 Eli Zaretskii <eliz@gnu.org>
13856
4c3fa1d9
EZ
13857 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13858 display element, check also the underlying string or buffer
13859 character. (Bug#11341)
13860
1c6900d9
EZ
13861 * w32menu.c: Include w32heap.h.
13862 (add_menu_item): If the call to AppendMenuW (via
13863 unicode_append_menu) fails, disable Unicode menus only if we are
13864 running on Windows 9X/Me.
13865
42bf8205
AS
138662012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13867
13868 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13869 (xgetint): Add missing shift for LSB tags.
13870
b1bac16e
MR
138712012-04-24 Martin Rudalics <rudalics@gmx.at>
13872
13873 * keyboard.c (read_char): Don't wipe echo area for select window
13874 events: These might get delayed via `mouse-autoselect-window'
13875 (Bug#11304).
13876
d69621cc
JB
138772012-04-24 Juanma Barranquero <lekktu@gmail.com>
13878
13879 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13880 manipulation of :loaded-from data.
13881
02fd101b
JB
138822012-04-23 Juanma Barranquero <lekktu@gmail.com>
13883
13884 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13885 now a cons (bug#11311).
13886
888bec30
PE
138872012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13888
89a438bd
PE
13889 Do not create empty overlays with the evaporate property (Bug#9642).
13890 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13891 if it becomes empty after its bounds are adjusted to fit within
13892 its buffer. Without this fix, in a nonempty buffer (let ((o
13893 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13894 yields an empty overlay that has the evaporate property, which is
13895 not supposed to happen.
13896
1068fe4d
PE
13897 Fix minor GTK3 problems found by static checking.
13898 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13899 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13900 (struct _EmacsFixedClass, emacs_fixed_get_type):
13901 Move decls here from emacsgtkfixed.h, since they needn't be public.
13902 (emacs_fixed_get_type): Now static.
13903 (emacs_fixed_class_init): Omit unused local.
13904 (emacs_fixed_child_type): Remove; unused.
13905 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13906 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13907 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13908 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13909 (EMACS_FIXED_GET_CLASS): Remove; unused.
13910 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13911
888bec30
PE
13912 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13913 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13914
de85e130
PE
139152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13916
d0baac98 13917 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13918 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13919 (__malloc_size_t, __malloc_ptrdiff_t):
13920 Remove. All uses removed, replaced by the definiens if needed,
13921 since we can assume C89 or better now.
13922 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13923 (protect_malloc_state, align, get_contiguous_space)
13924 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13925 (malloc_atfork_handler_child, malloc_enable_thread)
13926 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13927 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13928 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13929 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13930 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13931 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13932 Define using prototypes, not old style.
13933 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13934 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13935 (align): Don't assume that signed integer overflow wraps around.
13936 Omit unused local var.
13937 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13938 (_free_internal_nolock, memalign, mallochook, reallochook):
13939 Omit no-longer-needed casts.
13940 (valloc): Use getpagesize, not __getpagesize.
13941 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13942 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13943
de85e130
PE
13944 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13945
dcbf5805
MA
139462012-04-22 Michael Albinus <michael.albinus@gmx.de>
13947
13948 Move functions from C to Lisp. Make non-blocking method calls
13949 the default. Implement further D-Bus standard interfaces.
13950
13951 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13952 (QCdbus_request_name_allow_replacement)
13953 (QCdbus_request_name_replace_existing)
13954 (QCdbus_request_name_do_not_queue)
13955 (QCdbus_request_name_reply_primary_owner)
13956 (QCdbus_request_name_reply_in_queue)
13957 (QCdbus_request_name_reply_exists)
13958 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13959 (QCdbus_registered_serial, QCdbus_registered_method)
13960 (QCdbus_registered_signal): New Lisp objects.
13961 (XD_DEBUG_MESSAGE): Use sizeof.
13962 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13963 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13964 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13965 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13966 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13967 (xd_signature, xd_append_arg): Allow float for integer types.
13968 (xd_get_connection_references): New function.
b593d6a9
AH
13969 (xd_get_connection_address): Rename from xd_initialize.
13970 Return cached address.
dcbf5805
MA
13971 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13972 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13973 level.
13974 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13975 Return number of refcounts.
dcbf5805
MA
13976 (Fdbus_get_unique_name): Make stronger parameter check.
13977 (Fdbus_message_internal): New defun.
13978 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13979 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13980 (Fdbus_send_signal, Fdbus_register_service)
13981 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13982 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13983 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13984 (Vdbus_compiled_version, Vdbus_runtime_version)
13985 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13986 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13987 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13988 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13989 Adapt docstring.
dcbf5805 13990
52828e02
PE
139912012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13992
da05bc4c
PE
13993 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13994 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13995 Do not assume ptrdiff_t is the same width as 'int'.
13996
52828e02
PE
13997 * alloc.c: Handle unusual debugging option combinations.
13998 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13999 since the two debugging options are incompatible.
14000 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14001 is defined.
14002 (mem_init, mem_insert, mem_insert_fixup):
14003 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14004 (NEED_MEM_INSERT): Remove; no longer needed.
14005
f01769f9
LL
140062012-04-22 Leo Liu <sdl.web@gmail.com>
14007
14008 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14009
5790543d
PE
140102012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14011
14012 * sysdep.c [__FreeBSD__]: Minor cleanups.
14013 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14014 Use Emacs indenting style more consistently. Avoid some casts.
14015 Use 'double' consistently rather than mixing 'float' and 'double'.
14016
b91b7e4d
EW
140172012-04-21 Eduard Wiebe <usenet@pusto.de>
14018
b593d6a9
AH
14019 * sysdep.c (list_system_processes, system_process_attributes):
14020 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 14021
6114eb15
AS
140222012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14023
14024 * lisp.mk (lisp): Update.
14025
2f38dff7
PE
140262012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14027
14028 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14029 It is never used otherwise.
14030
4ae29f89
SM
140312012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14032
14033 * print.c (print_preprocess): Only check print_depth if print-circle
14034 is nil.
14035 (print_object): Check for cycles even when print-circle is nil and
14036 print-gensym is t, but only check print_depth if print-circle is nil.
14037
f30d612a
CY
140382012-04-20 Chong Yidong <cyd@gnu.org>
14039
14040 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14041 set the status to "failed" and ensure that sentinel is run.
14042
c07a4c0b 140432012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
14044
14045 * process.c (Fset_process_inherit_coding_system_flag)
14046 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 14047 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 14048
c07a4c0b 140492012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
14050
14051 * xdisp.c (string_buffer_position_lim): Limit starting position to
14052 BEGV.
14053 (set_cursor_from_row): If called for a mode-line or header-line
14054 row, return zero immediately.
14055 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
14056 farther than the first row after the header line, if any.
14057 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
14058 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14059
c07a4c0b 140602012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14061
4ae29f89
SM
14062 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14063 (bug#11238).
ad3a2b41 14064
c07a4c0b 140652012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 140662012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
14067
14068 configure: new option --enable-gcc-warnings (Bug#11207)
14069 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14070 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14071 (ALL_CFLAGS): Use new macros rather than old.
14072 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14073 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14074 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14075 -Wunused-result, -Wunused-variable. This should go away once
14076 the Emacs and Gnulib regex code is merged.
14077 (xmalloc, xrealloc): Now static.
14078
aba027e8
PE
140792012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14080
14081 * dired.c (Fsystem_groups): Remove unused local.
14082
e5a36063
GM
140832012-04-17 Glenn Morris <rgm@gnu.org>
14084
14085 * dired.c (Fsystem_users): Doc fix.
14086
316411f0
DA
140872012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14088
14089 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14090 (syms_of_dired): Add them.
14091
9426aba4
PE
140922012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14093
b62a57be
PE
14094 Fix minor alloc.c problems found by static checking.
14095 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14096 New extern decls, to avoid calling undeclared functions.
14097 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14098 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14099 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14100 (NEED_MEM_INSERT): New macro.
14101 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 14102 Remove one incorrect comment and fix another.
b62a57be 14103
3539f31f
PE
14104 Fix minor ralloc.c problems found by static checking.
14105 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14106 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14107 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14108 (r_alloc_sbrk): Now static.
14109
a041960a
PE
14110 Improve ralloc.c interface checking.
14111 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14112 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14113 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14114 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14115 [REL_ALLOC]: ... to here, to check interface.
14116 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14117 Remove decls. This fixes an "It stinks!".
14118
9426aba4
PE
14119 * alloc.c (which_symbols): Fix alignment issue / type clash.
14120
d55c12ed
AS
141212012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14122
14123 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14124 (struct Lisp_Misc_Any): Likewise.
14125 (struct Lisp_Free): Likewise.
14126 * alloc.c (union aligned_Lisp_Symbol): Define.
14127 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14128 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14129 (union aligned_Lisp_Misc): Define.
14130 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14131 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 14132 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 14133
b948ce8b
PE
141342012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14135
14136 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14137 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14138 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14139 * s/netbsd.h, s/sol2-6.h:
14140 Remove definition of GC_MARK_STACK, since the default now works.
14141 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14142 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14143 no longer the default.
14144 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14145
35dc09a1 141462012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14147
35dc09a1
GM
14148 * lread.c (lisp_file_lexically_bound_p):
14149 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14150
35dc09a1
GM
141512012-04-14 Eli Zaretskii <eliz@gnu.org>
14152
14153 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14154 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14155
141562012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14157
14158 * nsterm.m (constrainFrameRect): Always constrain when there is only
14159 one screen (Bug#10962).
14160
bcd86815
KB
141612012-04-13 Ken Brown <kbrown@cornell.edu>
14162
14163 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14164
c25df26e
RT
141652012-04-13 Reuben Thomas <rrt@sc3d.org>
14166
14167 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14168
0fc59f1e
DC
141692012-04-11 Daniel Colascione <dancol@dancol.org>
14170
14171 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14172 against is gone. It's better to use vfork now so that when Cygwin
14173 gains a new, working vfork, we use it automatically (bug#10398).
14174
de8c03dc
SM
141752012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14176
14177 * window.c (save_window_save): Obey window-point-insertion-type.
14178
2f097256
GM
141792012-04-11 Glenn Morris <rgm@gnu.org>
14180
14181 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14182
453b951e
SM
141832012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14184
14185 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14186
75f1671a 141872012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14188
14189 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14190 (force_quit_count): New var.
14191 (handle_interrupt): Use it.
14192
2a8ce227
JB
141932012-04-10 Juanma Barranquero <lekktu@gmail.com>
14194
14195 * w32.c (w32_delayed_load): Record the full path of the library
14196 being loaded (bug#10424).
14197
935396c0
GM
141982012-04-09 Glenn Morris <rgm@gnu.org>
14199
05920a43
GM
14200 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14201 not just in the obarray, before snarfing them. (Bug#11036)
14202
935396c0
GM
14203 * Makefile.in ($(leimdir)/leim-list.el):
14204 Pass EMACS rather than BUILT_EMACS.
14205
a18ecafa
TZ
142062012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14207
14208 * process.c (make_process):
14209 * process.h: Add integer `gnutls_handshakes_tried' member to
14210 process struct.
14211
6bbef4e5
JC
14212 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14213 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14214
14215 * gnutls.c (gnutls_log_function2i): Convenience log function.
14216 (emacs_gnutls_read): Use new log functions,
14217 `gnutls_handshakes_tried' process member, and
14218 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14219 attempts per process (connection).
14220
b4d3bc10
CY
142212012-04-09 Chong Yidong <cyd@gnu.org>
14222
14223 * eval.c (Fuser_variable_p, user_variable_p_eh)
14224 (lisp_indirect_variable): Functions deleted.
14225 (Fdefvar): Caller changed.
14226
14227 * callint.c (Finteractive, Fcall_interactively):
14228 * minibuf.c (Fread_variable): Callers changed.
14229
70f4d973
EZ
142302012-04-09 Eli Zaretskii <eliz@gnu.org>
14231
14232 * xdisp.c (set_cursor_from_row): If the display string appears in
14233 the buffer at position that is closer to point than the position
14234 after the display string, display the cursor on the first glyph of
14235 the display string. Fixes cursor display when a 'display' text
14236 property immediately follows invisible text. (Bug#11094)
14237
cb3c2e3e
PE
142382012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14239
14240 composite.c: use 'double' consistently
14241 * composite.c (get_composition_id): Use 'double' consistently
14242 instead of converting 'float' to 'double' and vice versa; this is
14243 easier to understand and avoids a GCC warning.
14244
fd06db5d
GM
142452012-04-09 Glenn Morris <rgm@gnu.org>
14246
50fe702a
GM
14247 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14248 preparation for dumping it with emacs. (Bug#4789)
14249 (leimdir): New variable.
14250 ($(leimdir)/leim-list.el): New rule.
14251 (emacs$(EXEEXT)): Depend on leim-list.el.
14252
fd06db5d
GM
14253 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14254 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14255 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14256
55c131ee
AS
142572012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14258
14259 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14260 proper alignment.
14261
9209588f
JB
142622012-04-07 Juanma Barranquero <lekktu@gmail.com>
14263
14264 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14265 Remove unused local variable.
14266
e3fb2efb
PE
142672012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14268
14269 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14270 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14271 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14272 objects, as mark_maybe_pointer will catch them otherwise.
14273 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14274 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14275
b5385551
PE
142762012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14277
14278 Fix typo that broke non-Windows builds.
14279 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14280
9078ead6
EZ
142812012-04-07 Eli Zaretskii <eliz@gnu.org>
14282
14283 Support building on MS-Windows with libxml2.
14284
14285 * makefile.w32-in (OBJ2): Add xml.$(O).
14286 (GLOBAL_SOURCES): Add xml.c.
14287 ($(BLD)/xml.$(O)): New dependency list.
14288
14289 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14290 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14291 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14292 [!WINDOWSNT]: New macros.
14293 (init_libxml2_functions, libxml2_loaded_p): New functions.
14294 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14295 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14296 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14297 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14298 linked in).
6bbef4e5
JC
14299 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14300 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14301 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14302
14303 * emacs.c: Don't include libxml/parser.h.
14304 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14305 xmlCleanupParser directly.
14306
14307 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14308
3811fdf3
EZ
143092012-04-07 Eli Zaretskii <eliz@gnu.org>
14310
14311 * indent.c (Fvertical_motion): If there is a display string at
14312 point, use it.vpos to compute how many lines to backtrack after
14313 move_it_to point. (Bug#11133)
14314
2f8e16b2
EZ
143152012-04-06 Eli Zaretskii <eliz@gnu.org>
14316
14317 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14318 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14319 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14320 macros related to unification of CJK characters. For the details,
14321 see the discussion following the message here:
14322 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14323
3d439cd1
CY
143242012-04-04 Chong Yidong <cyd@gnu.org>
14325
14326 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14327
8bc53d00
EZ
143282012-04-01 Eli Zaretskii <eliz@gnu.org>
14329
14330 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14331 instead of alloca. (Bug#11138)
14332
3b0512a3
AS
143332012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14334
14335 * w32menu.c (is_simple_dialog): Properly check lisp types.
14336 (Bug#11141)
14337
8427ddd2
EZ
143382012-03-31 Eli Zaretskii <eliz@gnu.org>
14339
979022ef
EZ
14340 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14341 position we get to after a call to move_it_to fails the
14342 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14343 only if we wind up in a string from display property. (Bug#11063)
14344
a6b1c7cc
EZ
14345 * window.c (Fdelete_other_windows_internal): Invalidate the row
14346 and column information about mouse highlight, so that redisplay
14347 restores it after reallocating the glyph matrices. (Bug#7464)
14348
8427ddd2
EZ
14349 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14350 string comes from a `display' text property, use the buffer
14351 position of that property as if we actually saw that position in
14352 the row's glyphs.
697ba24b
EZ
14353 (move_it_by_lines): Remove the assertion that
14354 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14355 violated when there's a before-string at the beginning of a line.
14356 (Bug#11063)
8427ddd2 14357
65a0a738
EZ
143582012-03-30 Eli Zaretskii <eliz@gnu.org>
14359
14360 * xdisp.c (append_space_for_newline): If the default face was
14361 remapped, use the remapped face for the appended newline.
14362 (extend_face_to_end_of_line): Use the remapped default face for
14363 extending the face to the end of the line.
14364 (display_line): Call extend_face_to_end_of_line when the default
14365 face was remapped. (Bug#11068)
14366
581355cc
EZ
143672012-03-29 Eli Zaretskii <eliz@gnu.org>
14368
14369 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14370
e8fc049f
SM
143712012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14372
14373 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14374
4fb9a543
GM
143752012-03-27 Glenn Morris <rgm@gnu.org>
14376
14377 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14378 Doc fixes.
14379
679910f1
KH
143802012-03-26 Kenichi Handa <handa@m17n.org>
14381
14382 * dispextern.h (struct glyph): Fix previous change. Change the
14383 bit length of glyphless.ch to 25 (Bug#11082).
14384
90d49b7f
CY
143852012-03-26 Chong Yidong <cyd@gnu.org>
14386
14387 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14388 (command_loop_1): Use it; inhibit selection update for
14389 handle-select-window too (Bug#8996).
14390
f514f6f0
FP
143912012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14392
e8fc049f 14393 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14394
bf43fa51
KH
143952012-03-25 Kenichi Handa <handa@m17n.org>
14396
14397 * dispextern.h (struct glyph): Change the bit length of
14398 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14399
8a0c01dd
EZ
144002012-03-24 Eli Zaretskii <eliz@gnu.org>
14401
14402 * s/ms-w32.h (tzname): Include time.h before redirecting to
14403 _tzname. Fixes the MSVC build. (Bug#9960)
14404
7d1c3a76
AS
144052012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14406
8ed79523
AS
14407 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14408 characters.
14409
7d1c3a76
AS
14410 * xterm.c (XTread_socket): Only modify handling_signal if
14411 !SYNC_INPUT. (Bug#11080)
14412
e99a9b8b
EZ
144132012-03-23 Eli Zaretskii <eliz@gnu.org>
14414
14415 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14416 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14417 when fetching a multibyte character consumes more bytes than
14418 CHAR_BYTES returns, due to unification of CJK characters in
14419 string_char. (Bug#11073)
14420
5063c0e1
TN
144212012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14422
14423 * process.c (wait_reading_process_output): Handle pty disconnect
14424 by refraining from sending oneself a SIGCHLD (bug#10933).
14425
9f851fbd
CY
144262012-03-22 Chong Yidong <cyd@gnu.org>
14427
14428 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14429
5063c0e1 14430 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14431 Mark string as coming from a prefix property.
14432 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14433 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14434
fb5b8aca
CY
144352012-03-21 Chong Yidong <cyd@gnu.org>
14436
14437 * xfaces.c (Vface_remapping_alist): Doc fix.
14438
62356a1b
EZ
144392012-03-20 Eli Zaretskii <eliz@gnu.org>
14440
14441 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14442 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14443 Doc fixes.
62356a1b 14444
025de85b
CY
144452012-03-20 Chong Yidong <cyd@gnu.org>
14446
14447 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14448 to reflect default non-nil value of redisplay-dont-pause.
14449
4827f94e
KH
144502012-03-19 Kenichi Handa <handa@m17n.org>
14451
14452 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14453 it fit in a valid range (Bug#11003).
14454
e50a24a2
EZ
144552012-03-18 Eli Zaretskii <eliz@gnu.org>
14456
14457 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14458 that is not from display property, accept the row as a "cursor
14459 row" if one of the string's character has a non-nil `cursor'
14460 property. Fixes cursor positioning when there are newlines in
14461 overlay strings, e.g. in icomplete.el. (Bug#11035)
14462
9af5ed87
PE
144632012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14464
14465 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14466
d1f55f16
CY
144672012-03-12 Chong Yidong <cyd@gnu.org>
14468
14469 * eval.c (inhibit_lisp_code): Rename from
14470 inhibit_window_configuration_change_hook; move from window.c.
14471
14472 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14473 * window.c (run_window_configuration_change_hook)
14474 (syms_of_window): Callers changed.
14475
66c5eebd
CY
144762012-03-11 Chong Yidong <cyd@gnu.org>
14477
413df973
CY
14478 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14479
66c5eebd
CY
14480 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14481
1de11f56
CY
144822012-03-10 Chong Yidong <cyd@gnu.org>
14483
14484 * frame.c (other_visible_frames): Don't assume the selected frame
14485 is visible (Bug#10955).
14486
cae07000
SM
144872012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14488
14489 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14490
89c94350
JD
144912012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14492
14493 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14494 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14495 zero (Bug#10954).
14496
999dd333
GM
144972012-03-03 Glenn Morris <rgm@gnu.org>
14498
01a6dcc8 14499 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14500
de0100f2
EZ
145012012-03-02 Eli Zaretskii <eliz@gnu.org>
14502
14503 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14504 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14505 (redisplay_window, next_element_from_string): Fix typos in
14506 comments.
3e441275
EZ
14507 (redisplay_window): Pass to move_it_vertically the margin in
14508 pixels, not in screen lines.
de0100f2 14509
96a72ee9
GM
145102012-03-02 Glenn Morris <rgm@gnu.org>
14511
14512 * buffer.c (buffer-list-update-hook): Doc fix.
14513
312508d7
EZ
145142012-02-29 Eli Zaretskii <eliz@gnu.org>
14515
14516 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14517 push_it before setting up the iterator for the first overlay
14518 string, even if we have an empty string loaded.
14519 (next_overlay_string): If there's an empty string on the iterator
14520 stack, pop the stack. (Bug#10903)
14521
27f3c637
PE
145222012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14523
14524 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14525 Suggested by Stefan Monnier in
14526 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14527 * alloc.c (widen_to_Lisp_Object): New static function.
14528 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14529 and widening them to Lisp_Objects. This would work even if
14530 USE_LSB_TAG is defined and wide integers are used, which might
14531 happen in a future version of Emacs.
14532
3c9dfce6
CY
145332012-02-25 Chong Yidong <cyd@gnu.org>
14534
fa74b241
CY
14535 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14536 Doc fix.
14537
3c9dfce6
CY
14538 * xselect.c (Fx_selection_exists_p): Doc fix.
14539 (x_clipboard_manager_save_all): Print an informative message
14540 before saving to clipboard manager.
14541
9486df08
CY
145422012-02-24 Chong Yidong <cyd@gnu.org>
14543
14544 * keyboard.c (process_special_events): Handle all X selection
14545 requests in kbd_buffer, not just the next one (Bug#8869).
14546
f01d3321
CY
145472012-02-23 Chong Yidong <cyd@gnu.org>
14548
14549 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14550 call when setting menu-bar-lines and tool-bar-lines parameters.
14551 (unwind_create_frame_1): New helper function.
14552
14553 * window.c (inhibit_window_configuration_change_hook): New var.
14554 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14555 (syms_of_window): Initialize it.
f01d3321 14556
86b847b6
CY
145572012-02-22 Chong Yidong <cyd@gnu.org>
14558
14559 * xterm.c (x_draw_image_relief): Add missing type check for
14560 Vtool_bar_button_margin (Bug#10743).
14561
a59225b1
CY
145622012-02-21 Chong Yidong <cyd@gnu.org>
14563
14564 * fileio.c (Vfile_name_handler_alist): Doc fix.
14565
14566 * buffer.c (Fget_file_buffer): Protect against invalid file
14567 handler return value.
14568
310f5bd4
PE
145692012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14570
cb3a28cc
PE
14571 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14572 when computing $valmask.
14573
310f5bd4
PE
14574 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14575 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14576 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14577 It's useless in that case, and it can cause problems on hosts
14578 that allocate halves of EMACS_INT values separately.
14579 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14580 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14581 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14582 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14583 it avoids undefined behavior on hosts where shifting right by more
14584 than the word width has undefined behavior.
14585
2375c96a
CY
145862012-02-19 Chong Yidong <cyd@gnu.org>
14587
14588 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14589 (Funhandled_file_name_directory, Ffile_name_as_directory)
14590 (Fdirectory_file_name, Fexpand_file_name)
14591 (Fsubstitute_in_file_name): Protect against invalid file handler
14592 return values (Bug#10845).
14593
3eb49e71
EZ
145942012-02-18 Eli Zaretskii <eliz@gnu.org>
14595
14596 * .gdbinit (pitx): Fix incorrect references to fields of the
14597 iterator stack.
14598
7b926f3f
CY
145992012-02-17 Chong Yidong <cyd@gnu.org>
14600
14601 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14602
11273115
PE
146032012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14604
14605 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14606 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14607
c3a70e2b
CY
146082012-02-15 Chong Yidong <cyd@gnu.org>
14609
14610 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14611 marked as special. Also, starting docstrings with * is obsolete.
14612
0ca43699
AS
146132012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14614
14615 * gnutls.c (emacs_gnutls_write): Fix last change.
14616
2e8f3c56
LI
146172012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14618
14619 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14620 send_process.
14621
af70074f
SM
146222012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14623
14624 * keymap.c (Fsingle_key_description): Handle char ranges.
14625
95986d52
CY
146262012-02-12 Chong Yidong <cyd@gnu.org>
14627
afd83bd1
CY
14628 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14629 as that creates a dangerous corner case.
14630
95986d52
CY
14631 * window.c (Fdelete_window_internal): Invalidate the mouse
14632 highlight (Bug#9904).
14633
bd7da63e
GM
146342012-02-12 Glenn Morris <rgm@gnu.org>
14635
14636 * xselect.c (Fx_own_selection_internal)
14637 (Fx_get_selection_internal, Fx_disown_selection_internal)
14638 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14639 * nsselect.m (Fx_own_selection_internal)
14640 (Fx_disown_selection_internal, Fx_selection_exists_p)
14641 (Fx_selection_owner_p, Fx_get_selection_internal):
14642 Sync docs and argument specs with the xselect.c versions.
14643
77abcbc2
LI
146442012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14645
14646 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14647
90b671e2
EZ
146482012-02-11 Eli Zaretskii <eliz@gnu.org>
14649
1c0ca0b7
EZ
14650 * w32select.c (Fx_selection_exists_p): Sync doc string and
14651 argument list with xselect.c. (Bug#10783)
14652
14653 * w16select.c (Fx_selection_exists_p): Sync doc string and
14654 argument list with xselect.c. (Bug#10783)
90b671e2 14655
49241268
GM
146562012-02-10 Glenn Morris <rgm@gnu.org>
14657
14658 * fns.c (Fsecure_hash): Doc fix.
14659
f998bbe7 146602012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14661
14662 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14663
0992bd9c
CY
146642012-02-07 Chong Yidong <cyd@gnu.org>
14665
14666 * buffer.c (Fbuffer_local_variables)
14667 (buffer_lisp_local_variables): Handle unbound vars correctly;
14668 don't let Qunbound leak into Lisp.
14669
af008560
GM
146702012-02-07 Glenn Morris <rgm@gnu.org>
14671
dd605cc4
GM
14672 * image.c (Fimagemagick_types): Doc fix.
14673
af008560
GM
14674 * image.c (imagemagick-render-type): Change it from a lisp object
14675 to an integer. Move the doc here from the lisp manual.
14676 Treat all values not equal to 0 the same.
14677
1449fa1d
CY
146782012-02-06 Chong Yidong <cyd@gnu.org>
14679
14680 * doc.c (store_function_docstring): Avoid applying docstring of
14681 alias to base function (Bug#2603).
14682
3723ec07
AS
146832012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14684
14685 * .gdbinit (pp1, pv1): Remove redundant defines.
14686 (pr): Use pp.
14687
79c1cc1e
CY
146882012-02-04 Chong Yidong <cyd@gnu.org>
14689
14690 * nsterm.m: Declare a global (Bug#10694).
14691
d7f29f8e
EZ
146922012-02-04 Eli Zaretskii <eliz@gnu.org>
14693
cae07000
SM
14694 * w32.c (get_emacs_configuration_options):
14695 Include --enable-checking, if specified, in the return value.
d7f29f8e 14696
3b95a6f9
MR
146972012-02-04 Martin Rudalics <rudalics@gmx.at>
14698
14699 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14700 after rounding frame sizes. (Bug#9723)
14701
d6fa96a6
EZ
147022012-02-04 Eli Zaretskii <eliz@gnu.org>
14703
14704 * keyboard.c (adjust_point_for_property): Don't position point
14705 before BEGV. (Bug#10696)
14706
df0b2940
PE
147072012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14708
14709 Handle overflow when computing char display width (Bug#9496).
14710 * character.c (char_width): Return EMACS_INT, not int.
14711 (char_width, c_string_width): Check for overflow when
14712 computing the width; this is possible now that individual
14713 characters can have unbounded width. Problem introduced
14714 by merge from Emacs 23 on 2012-01-19.
14715
6bee44d6
MA
147162012-02-02 Michael Albinus <michael.albinus@gmx.de>
14717
14718 * dbusbind.c (Fdbus_register_method): Mention the return value
14719 :ignore in the docstring.
14720
44f92739
GM
147212012-02-02 Glenn Morris <rgm@gnu.org>
14722
1b9f60cc
GM
14723 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14724
44f92739
GM
14725 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14726 Unconditionally set to t. (Bug#10673)
14727 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14728 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14729 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14730
c5d3843c
KH
147312012-02-02 Kenichi Handa <handa@m17n.org>
14732
14733 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14734 0, do not call append_composite_glyph.
14735
159462d4 147362012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14737
14738 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14739 NULL (Bug#6988).
14740 (x_produce_glyphs): If the component of a composition is a null
14741 string, set it->pixel_width to 1 to avoid zero-width glyph.
14742
78cef877
EZ
147432012-02-01 Eli Zaretskii <eliz@gnu.org>
14744
14745 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14746 first 2 arguments are identical. This makes inserting large
14747 output from a subprocess an order of magnitude faster on
14748 MS-Windows, where all sbrk'ed memory is always contiguous.
14749
97897668
GM
147502012-01-31 Glenn Morris <rgm@gnu.org>
14751
14752 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14753 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14754 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14755
31fd3586
GM
147562012-01-29 Glenn Morris <rgm@gnu.org>
14757
14758 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14759
0e24a8b2
CY
147602012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14761
14762 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14763
cc0adcb0
CY
147642012-01-28 Chong Yidong <cyd@gnu.org>
14765
14766 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14767
acc28cb9
CY
147682012-01-26 Chong Yidong <cyd@gnu.org>
14769
9c69cfb7
CY
14770 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14771
acc28cb9
CY
14772 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14773 repeat counts (Bug#10507).
14774
48da7392
GM
147752012-01-26 Glenn Morris <rgm@gnu.org>
14776
14777 * lread.c (syms_of_lread): Doc fix.
14778
14af5f7f
CY
147792012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14780
14781 * coding.c (encode_designation_at_bol): Change return value to
14782 EMACS_INT.
14783
0b21c100
CY
147842012-01-25 Chong Yidong <cyd@gnu.org>
14785
14786 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14787
3c2907f7
CY
147882012-01-21 Chong Yidong <cyd@gnu.org>
14789
14790 * floatfns.c (Fcopysign): Make the second argument non-optional,
14791 since nil is not allowed anyway.
14792
959ad23f
AS
147932012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14794
14795 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14796 (send_process): Likewise.
14797
34a02f46
MR
147982012-01-19 Martin Rudalics <rudalics@gmx.at>
14799
14800 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14801 (Vwindow_persistent_parameters): Do not use Qstate.
14802 Rewrite doc-strings.
34a02f46 14803
1259009a 148042012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14805
14806 * character.c (char_width): New function.
70d4fdf6
GM
14807 (Fchar_width, c_string_width, lisp_string_width):
14808 Use char_width (Bug#9496).
25ed9e61 14809
6a6ee00d
MR
148102012-01-16 Martin Rudalics <rudalics@gmx.at>
14811
14812 * window.c (Vwindow_persistent_parameters): New variable.
14813 (Fset_window_configuration, save_window_save): Handle persistent
14814 window parameters.
14815
c85efaf7
EZ
148162012-01-14 Eli Zaretskii <eliz@gnu.org>
14817
14818 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14819 thrashing the stack of the thread. (Bug#9087)
14820
5944709e
PE
148212012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14822
14823 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14824
e71f5d99
EZ
148252012-01-11 Eli Zaretskii <eliz@gnu.org>
14826
14827 * xdisp.c (rows_from_pos_range): Handle the case where the
14828 highlight ends on a newline. (Bug#10464)
14829 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14830 he end column for display of highlight that ends on a newline
14831 before a R2L line.
14832
ce316182
GM
148332012-01-11 Glenn Morris <rgm@gnu.org>
14834
14835 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14836 from load-path also when installation-directory is nil. (Bug#10208)
14837
5b43da69
GM
148382012-01-10 Glenn Morris <rgm@gnu.org>
14839
74cc8ff9
GM
14840 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14841
7d8d6e4e
GM
14842 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14843 Update template values to be closer to their typical values these days.
5b43da69 14844
a0db8d43
EZ
148452012-01-09 Eli Zaretskii <eliz@gnu.org>
14846
14847 * xdisp.c (rows_from_pos_range): Accept additional argument
14848 DISP_STRING, and accept any glyph in a row whose object is that
14849 string as eligible for mouse highlight. Fixes mouse highlight of
14850 display strings from overlays. (Bug#10464)
14851
9a0115ab 148522012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14853
b9110d6a 14854 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14855 * fileio.c (auto_saving_dir_umask): New static var.
14856 (Fmake_directory_internal): Use it.
14857 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14858 creating the directory. The old code temporarily assigns
14859 too-generous permissions to the directory.
14860 (do_auto_save_eh): Clear it.
b9110d6a 14861 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14862 that the var is always cleared.
14863
6c1bd3f3
EZ
148642012-01-07 Eli Zaretskii <eliz@gnu.org>
14865
14866 * search.c (scan_buffer): Pass character positions to
14867 know_region_cache, not byte positions. (Bug#6540)
14868
069d2b50
L
148692012-01-07 LynX <_LynX@bk.ru> (tiny change)
14870
14871 * w32.c (sys_rename): Report EXDEV when rename of a directory
14872 fails because the target is on another logical disk. (Bug#10284)
14873
75bf0d33
DB
148742012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14875
14876 * xterm.c (x_embed_request_focus): New function.
14877
14878 * xterm.h: Add prototype.
14879
14880 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14881
1c6e5a32
GM
148822012-01-05 Glenn Morris <rgm@gnu.org>
14883
14884 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14885
651e947e
EZ
148862012-01-01 Eli Zaretskii <eliz@gnu.org>
14887
14888 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14889 Load gnutls_transport_set_lowat only if GnuTLS version is below
14890 2.11.1.
14891 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14892 GnuTLS versions below 2.11.1.
14893
3778cdd8
AL
148942011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14895
14896 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14897 to the doc string advising against its use for altering the way
14898 windows are scrolled.
14899
0e5317f7
KH
149002011-12-28 Kenichi Handa <handa@m17n.org>
14901
14902 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14903 coding-system ASCII compatible only when it does not produce BOM
14904 on encoding (Bug#10383).
14905
93d5ca1f
JD
149062011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14907
14908 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14909 can scroll.
14910 (create_and_show_popup_menu): Always use menu_position_func for
14911 Gtk3 (Bug#10361).
14912
ca22b785
AS
149132011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14914
14915 * callint.c (Fcall_interactively): Don't truncate prompt string.
14916
d048e1e6
EZ
149172011-12-23 Eli Zaretskii <eliz@gnu.org>
14918
14919 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14920 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14921 resumed from there (after widening). (Bug#10360)
d048e1e6 14922
5ccaba1f
JD
149232011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14924
14925 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14926
204ee57f
JD
149272011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14928
b81d40f0
JB
14929 * nsterm.m (x_free_frame_resources):
14930 Release f->output_data.ns->miniimage.
204ee57f
JD
14931 (ns_index_color): Fix indentation. Do not retain
14932 color_table->colors[i].
14933
14934 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14935 before returning.
14936
14937 * nsfns.m (x_set_background_color): Assign return value from
14938 ns_index_color to face-background instead of NSColor*.
14939 (ns_implicitly_set_icon_type): Fix indentation.
14940 Change assignment in for loop to comparison.
14941
14942 * emacs.c (ns_pool): New variable.
14943 (main): Assign ns_pool.
14944 (Fkill_emacs): Call ns_release_autorelease_pool.
14945
14946 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14947 autorelease fdesc, release fdAttrs and tdict.
14948 (ns_get_covering_families): Release charset.
14949 (ns_findfonts): Release NSFontDescriptor created with new.
14950 (ns_uni_to_glyphs): Fix indentation.
14951 (setString): Release attrStr before assigning new value.
14952
c803b2b7
JD
149532011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14954
678f4426
JD
14955 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14956 and NS_IMPL_COCOA.
14957 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14958 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14959
cd394be1 149602011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14961
5fecd5fc
JD
14962 * nsterm.m (ns_term_init): Subscribe for notifications
14963 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14964 to method trackingNotification in EmacsMenu.
14965
14966 * nsmenu.m (trackingMenu): New variable.
3771cb17 14967 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14968 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14969 from Aquamacs (Bug#7030).
678f4426
JD
14970
149712011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14972
c803b2b7
JD
14973 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14974 (symbol_to_nsstring): Fix indentation.
14975 (ns_symbol_to_pb): New function.
cae07000
SM
14976 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14977 (Fns_rotate_cut_buffers_internal): Remove.
14978 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14979 Fns_store_cut_buffer_internal.
14980 (ns_get_foreign_selection, Fx_own_selection_internal)
14981 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14982 (Fns_get_selection_internal, Fns_store_selection_internal):
14983 Use ns_symbol_to_pb and check if return value is nil.
14984 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14985 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14986 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14987 renamed to Sns_store_selection_internal.
14988 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14989 and remove this function.
14990 (ns_handle_selection_clear): Remove, never used.
14991 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14992 here.
14993
e1b01a3a
KB
149942011-12-17 Ken Brown <kbrown@cornell.edu>
14995
14996 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14997 GID is unknown (Bug#10257).
14998
2adb6e85
PE
149992011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15000
15001 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15002 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15003 which caused a build failure on GNU/Linux IA-64. This problem was
15004 introduced by my 2011-10-07 patch.
15005
d1d7b339
JL
150062011-12-15 Juri Linkov <juri@jurta.org>
15007
15008 * image.c (imagemagick_error): New function. (Bug#10112)
15009 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15010 Use `imagemagick_error' where ImageMagick functions return
15011 `MagickFalse'.
15012 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15013 proper order.
15014
100d5755
KH
150152011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15016
15017 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15018 fill background (Bug#8992).
15019
454592a6
MR
150202011-12-13 Martin Rudalics <rudalics@gmx.at>
15021
15022 * window.c (Vwindow_combination_resize)
15023 (Vwindow_combination_limit): Use t instead of non-nil in
15024 doc-strings.
61d4b438
MR
15025 (Vrecenter_redisplay): Add first sentence of doc-string on
15026 separate line.
53524d93 15027 (Frecenter): Fix doc-string typo.
454592a6 15028
3633e3aa
KH
150292011-12-11 Kenichi Handa <handa@m17n.org>
15030
15031 * coding.c (Funencodable_char_position): Pay attention to the
15032 buffer text relocation (Bug#9389).
15033
7b9d523a 150342011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 15035
7b9d523a
JD
15036 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15037 gtk_init (Bug#10100).
15038
b73189c6
EZ
150392011-12-10 Eli Zaretskii <eliz@gnu.org>
15040
15041 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15042 IT->string is nil. (Bug#10263)
15043
f7dfe5d6
JD
150442011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15045
83faebb4
JD
15046 * nsterm.h (x_free_frame_resources): Declare.
15047
f7dfe5d6
JD
15048 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15049 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15050
15051 * nsterm.h (ns_get_defaults_value): Declare.
15052
15053 * nsterm.m (ns_default): Call ns_get_defaults_value.
15054
7cd4e72c
EZ
150552011-12-09 Eli Zaretskii <eliz@gnu.org>
15056
15057 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15058 (Bug#10170)
15059
b34d7317
YM
150602011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15061
15062 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15063 that where the value of an _OBJC_* symbol points to is in the .bss
15064 section (Bug#10240).
15065
76470ad1
KH
150662011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15067
15068 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 15069 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 15070
745fff94
KH
150712011-12-08 Kenichi Handa <handa@m17n.org>
15072
15073 * ftfont.c (get_adstyle_property): Fix previous change
15074 (Bug#10233).
15075
6e44397c
JB
150762011-12-07 Juanma Barranquero <lekktu@gmail.com>
15077
15078 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15079 dirs from the default value of EMACSLOADPATH (bug#10208).
15080
7efa6272
GM
150812011-12-07 Glenn Morris <rgm@gnu.org>
15082
15083 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15084 installation and source directories as well. (Bug#10208)
15085
f6fc4d87
CY
150862011-12-06 Chong Yidong <cyd@gnu.org>
15087
15088 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15089
2bf26180
GM
150902011-12-06 Glenn Morris <rgm@gnu.org>
15091
15092 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15093 as an error, not just -1. (Bug#10217)
15094
3a6ad4f0
CY
150952011-12-05 Chong Yidong <cyd@gnu.org>
15096
15097 * keyboard.c (process_special_events): New function.
15098 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15099
75a3b399
PE
151002011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15101
15102 * coding.c (encode_designation_at_bol): Don't use uninitialized
15103 local variable (Bug#9318).
15104
c3c9e25e
KH
151052011-12-05 Kenichi Handa <handa@m17n.org>
15106
15107 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15108 return Qnil (Bug#8046, Bug#10193).
15109
5eb05ea3
KH
151102011-12-05 Kenichi Handa <handa@m17n.org>
15111
15112 * coding.c (encode_designation_at_bol): New args charbuf_end and
15113 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
15114 (coding_set_source): Return how many bytes coding->source was
15115 relocated.
15116 (coding_set_destination): Return how many bytes
15117 coding->destination was relocated.
15118 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 15119 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
15120
151212011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15122
15123 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15124 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15125 macro (Bug#9318).
15126
151272011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15128
15129 The following changes are to fix Bug#9318.
15130
a79703f5 15131 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
15132 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15133 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 15134 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 15135
7dbda6df
JB
151362011-12-05 Juanma Barranquero <lekktu@gmail.com>
15137
15138 * lisp.h (process_quit_flag): Fix external declaration.
15139
6d5eb5b0
SM
151402011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15141
15142 Don't macro-inline non-performance-critical code.
15143 * eval.c (process_quit_flag): New function.
15144 * lisp.h (QUIT): Use it.
15145
a0c3fad0
JD
151462011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15147
15148 * nsfns.m (get_geometry_from_preferences): New function.
15149 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15150
6c07aac2
AS
151512011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15152
15153 * emacs.c (Qkill_emacs): Define.
15154 (syms_of_emacs): Initialize it.
15155 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15156 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15157 (quit_throw_to_read_char): Add parameter `from_signal'.
15158 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15159 * lisp.h (QUIT): Call Fkill_emacs if requested.
15160
c052ead4
JD
151612011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15162
15163 * widget.c (update_wm_hints): Return if wmshell is null.
15164 (widget_update_wm_size_hints): New function.
15165
15166 * widget.h (widget_update_wm_size_hints): Declare.
15167
15168 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15169 widget_update_wm_size_hints (Bug#10104).
15170
9e49252b
EZ
151712011-12-03 Eli Zaretskii <eliz@gnu.org>
15172
15173 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15174 before a newline, prepare the bidi iterator for consuming the
15175 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15176 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15177
02b16839
JL
151782011-12-02 Juri Linkov <juri@jurta.org>
15179
15180 * search.c (Fword_search_regexp): New Lisp function created from
15181 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15182 (Fword_search_backward, Fword_search_forward)
15183 (Fword_search_backward_lax, Fword_search_forward_lax):
15184 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15185 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15186
0068070e
SM
151872011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15188
15189 * fileio.c (Finsert_file_contents): Move after-change-function call
15190 to before the "handled:" label, since all "goto handled" appear in
15191 cases where the *-change-functions have already been properly called
15192 (bug#10117).
15193
3360a3fc
AS
151942011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15195
15196 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15197 waiting for input. (Bug#10169)
15198
73d6c093
EZ
151992011-11-30 Eli Zaretskii <eliz@gnu.org>
15200
15201 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15202 verifies glyph row's hash code--we have just reallocated the
15203 glyphs, so their contents can be complete garbage. (Bug#10164)
15204
febe6bea
JB
152052011-11-30 Juanma Barranquero <lekktu@gmail.com>
15206
15207 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15208
801a4313
EZ
152092011-11-30 Eli Zaretskii <eliz@gnu.org>
15210
15211 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15212 attributes are tested _before_ calling verify_row_hash, to protect
15213 against GCC re-ordering of the tests. (Bug#10164)
15214
2b56b87e
JD
152152011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15216
15217 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15218
15219 * xterm.c (handle_one_xevent): Only set async_visible and friends
15220 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15221 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15222 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15223
dbf31225
PE
152242011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15225
15226 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15227 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15228 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15229 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15230 All uses changed to use GCPRO1 etc.
15231 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15232 Revert to old implementation (i.e., before 2011-03-11).
15233
1305621b
YM
152342011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15235
15236 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15237 of scroll runs so as to avoid assigning disabled bogus rows and
15238 unnecessary graphics copy operations.
15239
8c9afb46
EZ
152402011-11-27 Eli Zaretskii <eliz@gnu.org>
15241
15242 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15243 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15244 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15245 (malloc, free, realloc, calloc): Redirect to e_* only when
15246 compiling Emacs.
15247
15248 * lisp.h (GCTYPEBITS): Move before first use.
15249 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15250 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15251 this macro definition.
15252
15253 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15254 _MSC_VER.
15255
54e9e3bf
JD
152562011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15257
6d5eb5b0
SM
15258 * gtkutil.c (xg_create_frame_widgets):
15259 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15260 present with Gtk+ 2.0.
15261
83aca1cb
PE
152622011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15263
15264 * fileio.c (Finsert_file_contents): Undo previous change; see
15265 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15266
5b76caa4
PE
152672011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15268
15269 Rename locals to avoid shadowing.
15270 * fileio.c (Finsert_file_contents):
15271 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15272 * process.c (wait_reading_process_output):
15273 Rename inner 'proc' to 'p' to avoid shadowing.
15274 Indent for consistency with usual Emacs style.
15275
8c535114
EZ
152762011-11-25 Eli Zaretskii <eliz@gnu.org>
15277
15278 * xdisp.c (redisplay_window): If cursor row is not fully visible
15279 after recentering, and scroll-conservatively is set to a large
15280 number, scroll window by a few more lines to make the cursor fully
15281 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15282 (start_display): Don't move to the next line if the display should
15283 start at a newline that is part of a display vector or an overlay
15284 string. (Bug#10119)
8c535114 15285
fa4fdb5c
JL
152862011-11-24 Juri Linkov <juri@jurta.org>
15287
15288 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15289 after the `MagickPingImage' call. (Bug#10112)
15290
90ec88df
CY
152912011-11-23 Chong Yidong <cyd@gnu.org>
15292
15293 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15294
56e2e794
MR
152952011-11-23 Martin Rudalics <rudalics@gmx.at>
15296
15297 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15298 making another buffer current. (Bug#10114)
15299
b6e64c41
GM
153002011-11-23 Glenn Morris <rgm@gnu.org>
15301
15302 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15303
6b21de18
CY
153042011-11-23 Chong Yidong <cyd@gnu.org>
15305
15306 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15307 using it (Bug#5984).
15308
b12cd789
EZ
153092011-11-22 Eli Zaretskii <eliz@gnu.org>
15310
15311 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15312 and header-lines, as they don't have one computed for them.
15313 (Bug#10098)
15314
15315 * .gdbinit (prow): Make displayed values more self-explaining.
15316 Add row's hash code.
15317
261b6fd4
LMI
153182011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15319
15320 * process.c (wait_reading_process_output): Fix asynchrounous
15321 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15322 (wait_reading_process_output): Add comment and URL.
261b6fd4 15323
e7cfd277
JD
153242011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15325
15326 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15327
a9b9b7f5
CY
153282011-11-21 Chong Yidong <cyd@gnu.org>
15329
15330 * window.c (Fnext_window, Fprevious_window): Doc fix.
15331
b0d15b4f
SM
153322011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15333
15334 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15335
fe7a3057
JB
153362011-11-20 Juanma Barranquero <lekktu@gmail.com>
15337
15338 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15339
d2999b1a
MR
153402011-11-20 Martin Rudalics <rudalics@gmx.at>
15341
15342 * window.c (Fset_window_combination_limit): Rename argument
15343 STATUS to LIMIT.
15344 (Vwindow_combination_limit): Remove "status" from doc-string.
15345
d5ff9cd0
AS
153462011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15347
15348 * m/ibms390.h: Remove.
15349 * m/ibms390x.h: Don't include "ibms390.h".
15350
a5bb9bd3
SM
153512011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15352
15353 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15354 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15355
cd1181db
JB
153562011-11-20 Juanma Barranquero <lekktu@gmail.com>
15357
15358 * casetab.c (Fset_case_table):
15359 * charset.c (Fcharset_after): Fix typos.
15360
615a3b8d 153612011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15362
17e845af
PE
15363 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15364 Otherwise, valgrind does not work on some platforms.
15365 Problem reported by Andreas Schwab in
6a0bf43d
PE
15366 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15367 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15368 is set, removing the need for VIRT_ADDRESS_VARIES.
15369 (PURE_P): Use a more-efficient implementation that needs just one
15370 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15371 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15372 to 4 (xorl, subq, cmpq, setbe).
15373 * alloc.c (pure): Always extern now, since that's the
15374 VIRT_ADDR_VARIES behavior.
15375 (PURE_POINTER_P): Use a single comparison, not two, for
15376 consistency with the new puresize.h.
15377 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15378 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15379 Remove VIRT_ADDR_VARIES no longer needed.
15380
f8fe6f96
EZ
153812011-11-19 Eli Zaretskii <eliz@gnu.org>
15382
15383 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15384 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15385 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15386 behave as if the cursor position were at the window margin.
15387
15388 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15389 and the cursor position is out of bounds, behave as if the cursor
15390 position were at the window margin. (Bug#10075)
15391
df05a53c
CY
153922011-11-18 Chong Yidong <cyd@gnu.org>
15393
15394 * window.c (Fwindow_combination_limit): Make first argument
15395 non-optional, since it is meaningless for live windows like the
15396 selected window.
61ccba97 15397
2071918e
DA
153982011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15399
15400 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15401
b50a28de
SM
154022011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15403
15404 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15405 (graft_intervals_into_buffer): Simplify.
15406
015137db
EZ
154072011-11-18 Eli Zaretskii <eliz@gnu.org>
15408
15409 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15410 hash values of the two rows.
15411 (copy_row_except_pointers): Preserve the used[] arrays and the
15412 hash values of the two rows. (Bug#10035)
68c95424 15413 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15414
15415 * xdisp.c (row_hash): New function, body extracted from
15416 compute_line_metrics.
15417 (compute_line_metrics): Call row_hash, instead of computing the
15418 hash code inline.
15419
15420 * dispnew.c (verify_row_hash): Call row_hash for computing the
15421 hash code of a row, instead of duplicating code from xdisp.c.
15422
15423 * dispextern.h (row_hash): Add prototype.
15424
a2addb04
TH
154252011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15426
15427 * frame.c (delete_frame): Don't delete the terminal when the last
15428 X frame is closed if emacs is built with GTK toolkit.
15429
df85d315
JB
154302011-11-17 Juanma Barranquero <lekktu@gmail.com>
15431
15432 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15433
a0c2d0ae
MR
154342011-11-17 Martin Rudalics <rudalics@gmx.at>
15435
15436 * window.c (Vwindow_splits): Rename to
15437 Vwindow_combination_resize. Suggested by Juri Linkov.
15438 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15439 of Vwindow_splits.
15440
58179cce
JB
154412011-11-16 Juanma Barranquero <lekktu@gmail.com>
15442
7877f373
JB
15443 * nsfns.m (Fns_font_name):
15444 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15445
b6f67890
MR
154462011-11-16 Martin Rudalics <rudalics@gmx.at>
15447
15448 * window.h (window): Rename slot "nest" to "combination_limit".
15449 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15450 (Fset_window_nest): Rename to Fset_window_combination_limit.
15451 (Vwindow_nest): Rename to Vwindow_combination_limit.
15452 (recombine_windows, make_parent_window, make_window)
15453 (Fsplit_window_internal, saved_window)
15454 (Fset_window_configuration, save_window_save): Rename all
15455 occurrences of window_nest to window_combination_limit.
15456
c7015153
JB
154572011-11-15 Juanma Barranquero <lekktu@gmail.com>
15458
15459 * image.c (imagemagick_load_image): Fix typo.
15460
322ad6ec
EZ
154612011-11-14 Eli Zaretskii <eliz@gnu.org>
15462
15463 * xdisp.c (display_line): Move the call to
15464 highlight_trailing_whitespace before the call to
15465 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15466 faces of all the glyphs to compute ROW's hash value.
15467 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15468
f067b8ec
JB
154692011-11-14 Juanma Barranquero <lekktu@gmail.com>
15470
15471 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15472 just return (bug#10044).
15473
1e5b2111
EZ
154742011-11-12 Eli Zaretskii <eliz@gnu.org>
15475
7ef3cbd5
EZ
15476 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15477 with user-defined heap size. Bump the default size of the temacs
15478 heap to 27MB, to avoid memory warning when running temacs.
15479 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15480
1e5b2111
EZ
15481 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15482 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15483 (verify_row_hash) [XASSERTS]: New function.
15484 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15485 that the hash value of glyph rows is correct.
1e5b2111 15486
89d61221
MR
154872011-11-12 Martin Rudalics <rudalics@gmx.at>
15488
15489 * window.h (window): Remove splits slot.
15490 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15491 (Fdelete_other_windows_internal, make_parent_window)
15492 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15493 (Fset_window_configuration, save_window_save): Don't deal with
15494 split status of windows.
15495 (saved_window): Remove splits slot.
15496 (Vwindow_splits): Rewrite doc-string.
15497
97f18cc8
JD
154982011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15499
15500 * xfns.c (unwind_create_frame):
15501 * nsfns.m (unwind_create_frame):
15502 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15503 Vframe_list (Bug#9999).
15504
22a648b4
DA
155052011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15506
0b381c7e 15507 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15508
659afede
KH
155092011-11-11 Kenichi Handa <handa@m17n.org>
15510
15511 * callproc.c (Fcall_process): Set the member dst_multibyte of
15512 process_coding.
15513
9ac0394b
KH
155142011-11-11 Johan Bockgård <bojohan@gnu.org>
15515
15516 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15517 avoid a crash (bug#9496).
15518
2fbdc249
CY
155192011-11-09 Chong Yidong <cyd@gnu.org>
15520
15521 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15522 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15523
ac6b1f81
PE
155242011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15525
15526 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15527
09db192c
PE
155282011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15529
15530 Avoid some portability problems by eschewing 'extern inline' functions.
15531 The trivial performance wins aren't worth the portability hassles; see
15532 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15533 et seq.
15534 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15535 (window_box_width, window_box_left, window_box_left_offset)
15536 (window_box_right, window_box_right_offset): Undo previous change,
15537 by removing the "extern"s.
15538 * intervals.c (adjust_intervals_for_insertion)
15539 (adjust_intervals_for_deletion): Undo previous change,
15540 making these static again.
15541 (offset_intervals, temp_set_point_both, temp_set_point)
15542 (copy_intervals_to_string): No longer inline.
15543 * xdisp.c (window_text_bottom_y, window_box_width)
15544 (window_box_height, window_box_left_offset)
15545 (window_box_right_offset, window_box_left, window_box_right)
15546 (window_box): No longer inline.
15547
105216ed
CY
155482011-11-08 Chong Yidong <cyd@gnu.org>
15549
15550 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15551 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15552 Signal an error if not a live window.
105216ed
CY
15553 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15554 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15555
ae9e237f
JB
155562011-11-07 Juanma Barranquero <lekktu@gmail.com>
15557
15558 * lisp.h (syms_of_abbrev): Remove declaration.
15559 Reported by CHENG Gao <chenggao@royau.me>.
15560
c7aa8333
EZ
155612011-11-07 Eli Zaretskii <eliz@gnu.org>
15562
15563 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15564 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15565 of temacs in GUI mode.
15566
be7f5545
MR
155672011-11-07 Martin Rudalics <rudalics@gmx.at>
15568
15569 * window.h: Declare delete_all_child_windows instead of
15570 delete_all_subwindows.
15571 * window.c (Fwindow_nest, Fset_window_nest)
15572 (Fset_window_new_total, Fset_window_new_normal)
15573 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15574 (delete_all_subwindows): Rename to delete_all_child_windows.
15575 (Fdelete_other_windows_internal, Fset_window_configuration):
15576 Call delete_all_child_windows instead of delete_all_subwindows.
15577 * frame.c (delete_frame): Call delete_all_child_windows instead
15578 of delete_all_subwindows.
15579
ca78dc43
PE
155802011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15581
15582 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15583 This is also needed for porting to any host where GC_MARK_STACK is
15584 not GC_MAKE_GCPROS_NOOPS.
15585 (which_symbols): Use it.
15586
a0241d01
KH
155872011-11-07 Kenichi Handa <handa@m17n.org>
15588
15589 * coding.c (coding_set_destination): Check coding->src_pos only
15590 when coding->src_object is a buffer (bug#9910).
15591
15592 * process.c (send_process): Set the member src_multibyte of coding
15593 to 0 (bug#9911) when sending a unibyte text.
15594
15595 * callproc.c (Fcall_process): Set the member src_multibyte of
15596 process_coding to 0 (bug#9912).
15597
a64bfdfa 155982011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15599
15600 * xmenu.c (cleanup_widget_value_tree): New function.
15601 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15602 calling free_menubar_widget_value_tree directly (Bug#9830).
15603
cb41b32a
PE
156042011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15605
15606 Fix some portability problems with 'inline'.
15607 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15608 (window_box_width, window_box_left, window_box_left_offset)
15609 (window_box_right, window_box_right_offset): Declare extern.
15610 Otherwise, these inline functions do not conform to C99 and
15611 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15612 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15613 * intervals.c (adjust_intervals_for_insertion)
15614 (adjust_intervals_for_deletion): Now extern, because otherwise the
15615 extern inline functions 'offset_intervals' couldn't refer to it.
15616 (static_offset_intervals): Remove.
15617 (offset_intervals): Rewrite using the old contents of
15618 static_offset_intervals. The old version didn't conform to C99
15619 because an extern inline function contained a reference to an
15620 identifier with static linkage.
15621
b7041366
AS
156222011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15623
15624 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15625 GC.
15626
88a37c4d
EZ
156272011-11-06 Eli Zaretskii <eliz@gnu.org>
15628
15629 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15630 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15631 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15632 return Qleft_to_right.
15633
49745b39
CY
156342011-11-06 Chong Yidong <cyd@gnu.org>
15635
15636 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15637 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15638 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15639 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15640 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15641 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15642 (Fwindow_vscroll): Doc fix.
15643 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15644 argument, since it makes no sense to pass a live window and for
15645 consistency with window-child.
15646
1f05cd82
CS
156472011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15648
15649 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15650 support MSVC.
15651
22610910
JR
156522011-11-05 Jason Rumney <jasonr@gnu.org>
15653
15654 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15655 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15656 fonts (Bug#6029).
15657 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15658 bitwise arithmetic preventing use of unicode-sip and non-truetype
15659 opentype fonts.
15660
a06776b2
EZ
156612011-11-05 Eli Zaretskii <eliz@gnu.org>
15662
3ad924ba
EZ
15663 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15664 "emacs"-only part.
15665
a06776b2
EZ
15666 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15667 initialization code to keep similarity to xfns.c after changes
15668 from 2011-11-05.
15669
c9e7db78
JD
156702011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15671
a97f8f3f
JD
15672 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15673 (unwind_create_frame): New function (Bug#9943).
15674 (Fx_create_frame): Restructure code to be more similar to the one in
15675 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15676 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15677 Move terminal->reference_count++ just before making the frame official
15678 (Bug#9943).
15679
15680 * nsterm.m (x_free_frame_resources): New function.
15681 (x_destroy_window): Move code to x_free_frame_resources.
15682
c9e7db78 15683 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15684 (Fx_create_frame, x_create_tip_frame):
15685 Move terminal->reference_count++ just before making the frame
75f1671a 15686 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15687 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15688
a6fc3b5c
EZ
156892011-11-05 Eli Zaretskii <eliz@gnu.org>
15690
15691 Support MSVC build with newer versions of Visual Studio.
15692 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15693 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15694 nt/gmake.defs.
15695
15696 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15697 which are not supported by MSVC.
15698 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15699 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15700 bitfields.
15701 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15702 types in bitfields.
15703 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15704
15705 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15706
58179cce 157072011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15708
15709 Support MSVC build with newer versions of Visual Studio.
15710 * w32.c: Don't include w32api.h for MSVC.
15711 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15712
15713 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15714 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15715 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15716 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15717 e_* cousins.
15718 (alloca) [_MSC_VER]: Define to _alloca.
15719
15720 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15721
15722 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15723
a58c13ed
EZ
157242011-11-04 Eli Zaretskii <eliz@gnu.org>
15725
15726 * xdisp.c (note_mouse_highlight): If either of
15727 previous/next-single-property-change returns nil, treat that as
15728 the beginning or the end of the buffer. (Bug#9955)
15729
fe0b6370
JD
157302011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15731
a58c13ed 15732 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15733 label is not null (Bug#9951).
15734 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15735 may be NULL.
15736
89bd5ee1
EZ
157372011-11-04 Eli Zaretskii <eliz@gnu.org>
15738
15739 * window.c (Fwindow_body_size): Mention in the doc string that the
15740 return value is in frame's canonical units. (Bug#9949)
15741
84c3edb9
EZ
157422011-11-03 Eli Zaretskii <eliz@gnu.org>
15743
4e2fb5c7
EZ
15744 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15745
84c3edb9 15746 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15747 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15748 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15749
bc17a887
EZ
157502011-11-01 Eli Zaretskii <eliz@gnu.org>
15751
15752 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15753 Don't stop backward scan on the continuation glyph, even though
15754 its CHARPOS is positive.
6d5eb5b0
SM
15755 (mouse_face_from_buffer_pos, note_mouse_highlight):
15756 Rename cover_string to disp_string.
bc17a887 15757
4ee88440
MR
157582011-11-01 Martin Rudalics <rudalics@gmx.at>
15759
15760 * window.c (temp_output_buffer_show): Don't use
15761 Vtemp_buffer_show_specifiers.
15762 (Vtemp_buffer_show_specifiers): Remove unused variable.
15763
c2ff3c02
EZ
157642011-10-30 Eli Zaretskii <eliz@gnu.org>
15765
15766 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15767 past the beginning of the current glyph matrix.
15768
58179cce 157692011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15770
15771 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15772 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15773 HAVE_GTK3 (Bug#9869).
b77a6a7f 15774
3b574623
JD
15775 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15776 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15777
b77a6a7f
JD
15778 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15779
15780 * xterm.c: Declare x_handle_net_wm_state to return int.
15781 (handle_one_xevent): Check if we are iconified but don't have
15782 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15783 (get_current_wm_state): Return non-zero if not hidden,
15784 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15785 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15786 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15787 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15788
196e41e4
PE
157892011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15790
15791 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15792 so that this new function doesn't get optimized away by a
15793 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15794
021f2e1a
AS
157952011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15796
15797 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15798
8b058d44
EZ
157992011-10-29 Eli Zaretskii <eliz@gnu.org>
15800
15801 Fix the `xbytecode' command.
15802 * .gdbinit (xprintbytestr): New command.
b50a28de 15803 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15804 (xbytecode): Print the byte-code string as well.
15805
4452fb80
EZ
158062011-10-29 Kim Storm <storm@cua.dk>
15807
8b058d44
EZ
15808 * alloc.c (which_symbols): New function.
15809
21b72067
AS
158102011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15811
15812 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15813 line. (Bug#9903)
15814
83ed7b5c
GM
158152011-10-29 Glenn Morris <rgm@gnu.org>
15816
15817 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15818 Not clear what it was for, and it causes various bugs. (Bug#9839)
15819
5a7a728b
EZ
158202011-10-28 Eli Zaretskii <eliz@gnu.org>
15821
15822 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15823 possible random value that matches one of those tested as
15824 condition to clear the mouse face.
15825
d3d0842f
CY
158262011-10-28 Chong Yidong <cyd@gnu.org>
15827
15828 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15829
31b39d13
DN
158302011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15831
15832 * window.c (make_window): Initialize phys_cursor_on_p.
15833
9aba6043
SM
158342011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15835
15836 * lisp.h (struct Lisp_Symbol): Update comments.
15837
c20992f4
JB
158382011-10-28 Juanma Barranquero <lekktu@gmail.com>
15839
15840 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15841
db4f02f2
EZ
158422011-10-28 Eli Zaretskii <eliz@gnu.org>
15843
15844 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15845 <oslsachem@gmail.com> for helping to debug this.
15846
15847 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15848 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15849 (g_b_init_get_glyph_outline_w): New static variables.
15850 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15851 (GetGlyphOutlineW_Proc): New typedefs.
15852 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15853 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15854 New functions.
15855 (w32font_open_internal, compute_metrics):
15856 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15857 instead of calling the "wide" APIs directly.
15858
15859 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15860
15861 * w32.h (syms_of_w32font): Add prototype.
15862
87e68db4
JB
158632011-10-27 Juanma Barranquero <lekktu@gmail.com>
15864
15865 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15866 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15867 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15868 (Fmove_to_window_line): Doc fix.
15869
435c1d67
CY
158702011-10-27 Chong Yidong <cyd@gnu.org>
15871
15872 * process.c (make_process): Set gnutls_state to NULL.
15873
15874 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15875 non-NULL, regardless of GNUTLS_INITSTAGE.
15876 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15877 an error. Set process slots as soon as we allocate them.
15878
15879 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15880
9c6c6f49
CY
158812011-10-27 Chong Yidong <cyd@gnu.org>
15882
9aba6043
SM
15883 * gnutls.c (emacs_gnutls_deinit): New function.
15884 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15885 (Fgnutls_deinit, Fgnutls_boot): Use it.
15886
15887 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15888 (deactivate_process): Call emacs_gnutls_deinit.
15889
657d08d3
JB
158902011-10-27 Juanma Barranquero <lekktu@gmail.com>
15891
15892 * image.c (x_create_x_image_and_pixmap):
15893 * w32.c (sys_rename, w32_delayed_load):
15894 * w32font.c (fill_in_logfont):
15895 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15896
5430d399
JB
158972011-10-26 Juanma Barranquero <lekktu@gmail.com>
15898
15899 * w32fns.c (w32_default_color_map): New function,
15900 extracted from Fw32_default_color_map.
a7ef684b 15901 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15902
fe0055fa
PE
159032011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15904
15905 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15906
e6346438
SM
159072011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15908
15909 * keyboard.c (test_undefined): New function (bug#9751).
15910 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15911
e112cc37
ET
159122011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15913
15914 * sysdep.c (init_sys_modes): Fix the check for the controlling
15915 terminal (Bug#6649).
15916
7b5d6677
EZ
159172011-10-20 Eli Zaretskii <eliz@gnu.org>
15918
15919 * dispextern.h (struct bidi_it): New member next_en_type.
15920
15921 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15922 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15923 current character, check also for next_en_type being WEAK_EN.
15924 (bidi_resolve_weak): Don't enter the expensive loop if the current
15925 position is before next_en_pos. Record the bidi type of the first
15926 non-ET, non-BN character we find, in addition to its position.
15927 (bidi_level_of_next_char): Invalidate next_en_type when
15928 next_en_pos is over-stepped.
15929
7da0b018
PE
159302011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15931
15932 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15933 * editfns.c: Rewrite current-time-zone so that it invokes
15934 the equivalent of (format-time-string "%Z") to get the time zone name.
15935 This fixes a bug when the time zone name contains characters that
15936 need converting from the system time locale to Emacs internal format.
15937 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15938 that patch fixed format-time-string to do the conversion, but
15939 I forgot to fix current-time-zone.
15940 (format_time_string): New function, containing most of
15941 what Fformat_time_string used to contain.
15942 (Fformat_time_string): Rewrite in terms of format_time_string.
15943 This doesn't change this function's behavior.
15944 (current-time-zone): Rewrite to use format_time_string.
15945 This fixes the bug reported by Michael Schierl in
15946 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15947 Jason Rumney's 2007-06-07 change worked around this bug, but
15948 didn't fix it.
15949 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15950
8547b010
EZ
159512011-10-19 Eli Zaretskii <eliz@gnu.org>
15952
15953 * xdisp.c (start_display): If the character at POS is displayed
15954 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15955 (try_window_reusing_current_matrix): If a line ends in a display
15956 vector or the next line starts in a display vector, continue
15957 redrawing the window even though the character position of
15958 start_row was reached.
8547b010
EZ
15959 (Bug#9771, part 2)
15960
4e948d15
CY
159612011-10-18 Chong Yidong <cyd@gnu.org>
15962
15963 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15964 with nobreak-char-display too.
15965
4787455f
EZ
159662011-10-18 Eli Zaretskii <eliz@gnu.org>
15967
15968 Fix part 3 of bug#9771.
15969 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15970 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15971 non-neutral characters if the current character is a paragraph
15972 separator (a.k.a. Newline). This avoids running the same
15973 expensive loop twice, once when we consume the preceding newline
15974 and the other time when the line actually needs to be displayed.
15975 Avoid the loop when we see neutrals on the base embedding level
15976 following a character whose directionality is the same as the
15977 paragraph's. This avoids running the expensive loop when a line
15978 ends in a long sequence of neutrals, like control characters.
15979 Add assertion against STRONG_AL type. Slightly rearrange code
15980 that determines the type of a neutral given the first non-neutral
15981 that follows it.
15982 (bidi_level_of_next_char): Set next_en_pos to zero when
15983 invalidating its info.
15984
2c91f553
EZ
159852011-10-17 Eli Zaretskii <eliz@gnu.org>
15986
15987 * xdisp.c (push_display_prop): Determine whether to record string
15988 or buffer position by IT->string, not by IT->method. Allow
15989 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15990 (move_it_vertically_backward): Don't look for character position
15991 immediately after the newline when in a continuation line.
15992 (Bug#9771, part 1)
2c91f553 15993
c7b08b0d
MR
159942011-10-15 Martin Rudalics <rudalics@gmx.at>
15995
15996 * window.c (coordinates_in_window): Rewrite and delabelize
15997 vertical border check. (Bug#5357) (Bug#9618)
15998
6b02f655
SM
159992011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16000
16001 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16002 errors in XSetWindowBorder (bug#9310).
16003
81d40c92
DA
160042011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16005
16006 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16007 avoid crash when xmalloc overrun checking is enabled.
16008
d4172c3b
EZ
160092011-10-13 Eli Zaretskii <eliz@gnu.org>
16010
16011 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16012 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16013 cursor motion with <left> and <right> arrow keys.
16014
16015 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16016 some callers set that themselves.
16017
b00eea75
EZ
160182011-10-12 Eli Zaretskii <eliz@gnu.org>
16019
16020 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16021 display string and the previous row comes from the same string and
16022 is empty. (Bug#9739) (Bug#9738)
16023
8fe012c4
SM
160242011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16025
16026 * doc.c (get_doc_string): Encode file name (bug#9735).
16027
0074aef2
EZ
160282011-10-12 Eli Zaretskii <eliz@gnu.org>
16029
79beb178
EZ
16030 * bidi.c (bidi_level_of_next_char):
16031 * xdisp.c (get_visually_first_element): Remove old incorrect
16032 comments regarding the Unicode Line Separator character.
16033
0074aef2
EZ
16034 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16035
6e4b3fbe
DA
160362011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16037
16038 * alloc.c (Fgc_status): Do not access beyond zombies array
16039 boundary if nzombies > MAX_ZOMBIES.
16040 * alloc.c (dump_zombies): Add missing format specifier.
16041
0324f3af
PE
160422011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16043
b5525cac
PE
16044 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16045 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16046
0324f3af
PE
16047 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16048 Some packages use them to denote characters with modifiers.
16049
e9b5f888
AS
160502011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16051
16052 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16053 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16054 matching a pp-number. Rename parameter var to var1.
16055
127827c0
SM
160562011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16057
16058 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16059
c8fd3bd0
GM
160602011-10-08 Glenn Morris <rgm@gnu.org>
16061
16062 * callint.c (Fcall_interactively): Give a more explicit error for the
16063 'c' case with a non-character input. (Bug#8479)
16064
352ec8ff
EZ
160652011-10-08 Eli Zaretskii <eliz@gnu.org>
16066
03669ccb
EZ
16067 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16068 lines.
7061c986
EZ
16069 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16070 lines that are hscrolled on the left.
03669ccb 16071
352ec8ff
EZ
16072 * dispnew.c (buffer_posn_from_coords): Account for a possible
16073 presence of header-line. (Bug#4426)
16074
a66cfb1c
SM
160752011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16076
6b02f655
SM
16077 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16078 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 16079
7c5ee88e
PE
160802011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16081
16082 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16083 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16084 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16085 this makes Emacs dump core during garbage collection on rare
16086 occasions. sizeof is obviously inferior to offsetof here, so
16087 stick with offsetof.
16088 (GC_POINTER_ALIGNMENT): New macro.
16089 (mark_memory): Omit 3rd (offset) arg; caller changed.
16090 Don't assume EMACS_INT alignment is the same as pointer alignment.
16091
df1bbe5b
SM
160922011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16093
16094 * keyboard.c (read_key_sequence_remapped): New var.
16095 (read_key_sequence): Compute remapping in the right buffer.
16096 (command_loop_1): Use read_key_sequence's remapping directly.
16097
51553db6
SM
160982011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16099
32c1fffd
SM
16100 * dired.c (file_name_completion): Don't expand file name.
16101 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16102 before checking file name handler.
16103
51553db6
SM
16104 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16105 they've been requested explicitly (bug#9591).
16106
b6bd1599 161072011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
16108
16109 * keymap.c (Fsingle_key_description): Use make_specified_string
16110 instead of build_string to build string from push_key_description.
16111 (Bug#5193)
16112
f701dc2a
PE
161132011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16114
4222c55d
PE
16115 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16116 This fixes a Y2038 bug on 64-bit hosts.
16117 * buffer.c (reset_buffer):
16118 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16119 (Fclear_buffer_auto_save_failure):
16120 Use 0, not -1, to represent an unset failure time, since time_t
16121 might not be signed.
16122
f701dc2a
PE
16123 Remove dependency on glibc malloc internals.
16124 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16125 Move back here from lisp.h, but with their new implementations.
16126 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16127 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16128 * charset.c (charset_table_init): New static var.
16129 (syms_of_charset): Use it instead of xmalloc. This removes a
16130 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16131 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16132 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16133 Move back to alloc.c.
16134 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16135 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16136
9ceebf39
JD
161372011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16138
16139 * nsterm.m (windowDidResize): Call x_set_window_size only when
16140 ns_in_resize is true. Otherwise set pixelwidth/height and
16141 call change_frame_size (Bug#9628).
16142
cb993c58
PE
161432011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16144
3930c88b
PE
16145 Port --enable-checking=all to Fedora 14 x86-64.
16146 * charset.c (syms_of_charset): Also account for glibc malloc's
16147 internal overhead when calculating the initial malloc maximum.
16148
cb993c58
PE
16149 Port --enable-checking=all to Fedora 14 x86.
16150 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16151 Move to lisp.h.
16152 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16153 (overrun_check_realloc, overrun_check_free):
16154 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16155 That way, xmalloc returns a properly-aligned pointer even if
16156 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16157 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16158 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16159 into account when calculating the initial malloc maximum.
16160 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16161 Move here from alloc.c, so that charset.c can use it too.
16162 Properly align; the old code wasn't right for common 32-bit hosts
16163 when configured with --enable-checking=all.
16164 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16165 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16166
31bed486
EZ
161672011-09-29 Eli Zaretskii <eliz@gnu.org>
16168
04c70788 16169 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16170 use EDOM.
16171
fbcaa2f3
EZ
161722011-09-28 Eli Zaretskii <eliz@gnu.org>
16173
16174 * xdisp.c (compute_display_string_end): If there's no display
16175 string at CHARPOS, return -1.
16176
16177 * bidi.c (bidi_fetch_char): When compute_display_string_end
16178 returns a negative value, treat the character as a normal
16179 character not covered by a display string. (Bug#9624)
16180
a239d4e9
JB
161812011-09-28 Juanma Barranquero <lekktu@gmail.com>
16182
16183 * lread.c (Fread_from_string): Fix typo in docstring.
16184
88652fd5
EZ
161852011-09-27 Eli Zaretskii <eliz@gnu.org>
16186
16187 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16188 newline, reseat the iterator instead of bidi-iterating there one
16189 character at a time. (Bug#9610)
32c1fffd
SM
16190 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16191 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16192
ed497dd4
AS
161932011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16194
16195 * lread.c (readevalloop): Use correct code for NBSP.
16196 (read1): Likewise. (Bug#9608)
16197
b2bf61aa
MA
161982011-09-25 Michael Albinus <michael.albinus@gmx.de>
16199
16200 * dbusbind.c (Fdbus_register_signal): When service is not
16201 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16202
32bbb17c
GM
162032011-09-25 Glenn Morris <rgm@gnu.org>
16204
16205 * buffer.c (truncate-lines): Doc fix.
16206
94e0933e
CY
162072011-09-24 Chong Yidong <cyd@stupidchicken.com>
16208
16209 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16210 (Fset_window_next_buffers): Doc fix.
16211
cddde921
GM
162122011-09-24 Glenn Morris <rgm@gnu.org>
16213
16214 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16215
1260aef1
PE
162162011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16217
25b4bfa0
PE
16218 Fix minor problems found by static checking.
16219 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16220 * indent.c (Fvertical_motion): Fix == vs = typo.
16221
e3cbd34b
EZ
162222011-09-24 Eli Zaretskii <eliz@gnu.org>
16223
a66cfb1c
SM
16224 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16225 Default value is now t. Doc fix.
6bf7006f 16226
e3cbd34b 16227 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16228 logic when moving up, not only when moving down. Fix the
e3cbd34b 16229 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16230 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16231
16232 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16233 CHARPOS is covered by a display string which includes newlines.
16234 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16235 is covered by a display string with embedded newlines.
16236
a3de0cbd
MA
162372011-09-24 Michael Albinus <michael.albinus@gmx.de>
16238
16239 * dbusbind.c (Fdbus_register_signal): Add match rule to
16240 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16241 (Fdbus_register_method, Vdbus_registered_objects_table):
16242 Fix docstring.
a3de0cbd 16243
b260039d
JM
162442011-09-24 Jim Meyering <meyering@redhat.com>
16245
32c1fffd 16246 do not ignore write error for any output size
b260039d
JM
16247 The previous change was incomplete.
16248 While it makes emacs --batch detect the vast majority of stdout
16249 write failures, errors were still ignored whenever the output size is
16250 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16251 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16252 && echo FAIL: ignored write error
16253 FAIL: ignored write error
16254 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16255 && echo FAIL: ignored write error
16256 FAIL: ignored write error
16257 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16258
8eca8a7c
AS
162592011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16260
16261 * emacs.c (Fkill_emacs): In noninteractive mode exit
16262 non-successfully if a write error occurred on stdout. (Bug#9574)
16263
3341db62
EZ
162642011-09-21 Eli Zaretskii <eliz@gnu.org>
16265
16266 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16267 the xassert test.
16268
16269 * dispextern.h (struct it): Update the comment documenting what
16270 can it->OBJECT be.
16271
8c203dbf
EZ
162722011-09-20 Eli Zaretskii <eliz@gnu.org>
16273
16274 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16275 a display string, extend search for cursor position to end of row.
16276 (find_row_edges): If the row ends in a newline from a display
16277 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16278 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16279 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16280 non-empty line. Fixes confusing cursor motion with arrow keys at
16281 the beginning of a line that starts with whitespace.
8c203dbf 16282
a4824228
LMI
162832011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16284
16285 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16286 (bug#9493).
16287
33ed493b
CY
162882011-09-18 Chong Yidong <cyd@stupidchicken.com>
16289
16290 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16291 boolean (Bug#9154).
16292
56cd55c8
EZ
162932011-09-18 Eli Zaretskii <eliz@gnu.org>
16294
16295 * xdisp.c (display_line): Record maximum and minimum buffer
16296 positions even if no glyphs were produced (e.g., by a zero-width
16297 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16298 buffer positions that will be removed from the glyph row because
16299 they don't fit.
c02dcedf
EZ
16300 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16301 column is beyond frame width: don't subtract 1 "pixel" when
16302 computing width of the stretch.
3e62b7e0
EZ
16303 (reseat_at_next_visible_line_start): Undo the change made on
16304 2011-09-17 that saved paragraph information and restored it after
16305 the call to `reseat'. (Bug#9545)
56cd55c8 16306
5ed99d36 163072011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16308
16309 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16310 and turn window cursor on if cleared (Bug#9415).
16311
5ed99d36 163122011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16313
16314 * search.c (boyer_moore): Take unibyte characters from pattern
16315 literally. (Bug#9458)
16316
9bade7b2
EZ
163172011-09-18 Eli Zaretskii <eliz@gnu.org>
16318
16319 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16320
e5e9d610
PE
163212011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16322
87e4427a
PE
16323 Fix minor problem found by static checking.
16324 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16325 initialized, to pacify gcc -Wuninitialized.
16326
e5e9d610
PE
16327 * fileio.c: Report proper errno when syscall falls.
16328 (Finsert_file_contents): Save and restore errno,
16329 so that report_file_error outputs the correct diagnostic.
16330 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16331
a1674f0b
EZ
163322011-09-18 Eli Zaretskii <eliz@gnu.org>
16333
16334 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16335
fbfb6dd4
EZ
163362011-09-17 Eli Zaretskii <eliz@gnu.org>
16337
16338 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16339 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16340
bb187662
EZ
163412011-09-17 Eli Zaretskii <eliz@gnu.org>
16342
1137e8b8 16343 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16344 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16345
16346 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16347 (bidi_find_paragraph_start): Search back for paragraph beginning
16348 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16349 (bidi_move_to_visually_next): Only trigger paragraph-related
16350 computations when the last character is a newline or at EOB, not
16351 just any NEUTRAL_B. (Bug#9470)
16352
bb187662
EZ
16353 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16354 truncated lines if point is covered by a display string. (Bug#9524)
16355
2e621251
PE
163562011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16357
16358 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16359 (cons_to_x_long): New function.
16360 (lisp_data_to_selection_data): Use it. Correct the test for
16361 short-versus-long data; it was negated. Break out of vector
16362 loop, for efficiency, when a long datum is discovered.
16363
91a15bc6
SM
163642011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16365
16366 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16367
b41c3a35
EZ
163682011-09-16 Eli Zaretskii <eliz@gnu.org>
16369
16370 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16371 GCC PR/17406) by declaring this function with external scope.
16372
7812ba2d
PE
163732011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16374
16375 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16376 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16377
cf7edc2a
AS
163782011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16379
16380 * editfns.c (Fformat): Correctly handle text properties on "%%".
16381
bd01620e
EZ
163822011-09-15 Eli Zaretskii <eliz@gnu.org>
16383
16384 * xterm.c (x_draw_composite_glyph_string_foreground):
16385 * w32term.c (x_draw_composite_glyph_string_foreground):
16386 * term.c (encode_terminal_code):
16387 * composite.c (composition_update_it, get_composition_id):
16388 * xdisp.c (get_next_display_element)
16389 (fill_composite_glyph_string): Add comments about special meaning
16390 of TAB characters in a composition.
16391
a02719a3
PE
163922011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16393
16394 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16395 This occurs when processing a multibyte format.
16396 Problem reported by Wolfgang Jenker.
a02719a3 16397
72589a3c
JB
163982011-09-15 Johan Bockgård <bojohan@gnu.org>
16399
16400 * xdisp.c (try_cursor_movement): Only check for exact match if
16401 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16402
1c14176c
PE
164032011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16404
16405 Remove unused external symbols.
16406 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16407 * xdisp.c (calc_pixel_width_or_height): Now static.
16408 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16409 * indent.c (check_display_width):
16410 * w32term.c: Fix comment to match code.
16411 * xterm.c, xterm.h (x_catching_errors): Remove.
16412
d2eea5b5
PE
164132011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16414
16415 * xselect.c: Use signed conversions more consistently (Bug#9498).
16416 (selection_data_to_lisp_data): Assume incoming selection data are
16417 signed integers, not unsigned. This is to be consistent with
16418 outgoing selection data, which was modified to use signed integers
16419 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16420 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16421 expects long, not unsigned long.
16422
46888499
EZ
164232011-09-14 Eli Zaretskii <eliz@gnu.org>
16424
16425 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16426 computation of loop end. Reported by Johan Bockgård
16427 <bojohan@gnu.org>.
16428
ef8ef9fb
CY
164292011-09-13 Chong Yidong <cyd@stupidchicken.com>
16430
16431 * frame.c (Fother_visible_frames_p): Function deleted.
16432
fa819fed
EZ
164332011-09-12 Eli Zaretskii <eliz@gnu.org>
16434
16435 * indent.c (compute_motion): Process display vector front to back
16436 rather than the other way around. (Bug#2496)
16437
2ba8e008
SM
164382011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16439
16440 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16441
20f53c69
CY
164422011-09-11 Chong Yidong <cyd@stupidchicken.com>
16443
16444 * minibuf.c (Fread_from_minibuffer): Doc fix.
16445
d562d7a4
EZ
164462011-09-11 Eli Zaretskii <eliz@gnu.org>
16447
16448 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16449 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16450
1c4d7f3d
LMI
164512011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16452
16453 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16454 value for non-existent files.
16455
b885bf36
EZ
164562011-09-11 Eli Zaretskii <eliz@gnu.org>
16457
16458 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16459 set its "size" to -1. This will set the modtime_size field of
16460 the corresponding buffer to -1, which is what
16461 verify-visited-file-modtime expects for files that do not exist.
16462 (Bug#9139)
16463
6612f0bf
PE
164642011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16465
16466 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16467 here ...
16468 * lisp.h: ... from here. push_key_description is no longer
16469 defined in keyboard.c, so its declaration should not be in
16470 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16471 logically belongs with push_key_description.
16472
dfb3f755
PE
164732011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16474
16475 * buffer.h: Include <sys/types.h> instead of <time.h>.
16476 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16477 Problem reported by Herbert J. Skuhra.
16478
3134906c
LMI
164792011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16480
16481 * xml.c (parse_region): Make the parsing work for
16482 non-comment-starting XML files again (bug#9144).
16483
8d903f4e
AS
164842011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16485
16486 * image.c (gif_load): Fix calculation of bottom and right corner.
16487 (Bug#9468)
16488
80ad64f4
EZ
164892011-09-10 Eli Zaretskii <eliz@gnu.org>
16490
16491 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16492 redisplay in small windows.
16493
208a048d
EZ
164942011-09-09 Eli Zaretskii <eliz@gnu.org>
16495
16496 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16497
9b1c252e
MR
164982011-09-08 Martin Rudalics <rudalics@gmx.at>
16499
16500 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16501 Operate on live windows only.
16502
2949f33b
JB
165032011-09-08 Juanma Barranquero <lekktu@gmail.com>
16504
16505 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16506
e08dcafd
EZ
165072011-09-07 Eli Zaretskii <eliz@gnu.org>
16508
16509 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16510 only under bidi iteration.
16511
115b96bd
JD
165122011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16513
16514 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16515
c8199d0f
PE
165162011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16517
16518 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16519 Without this fix, the command to link temacs failed due to an
16520 undefined symbol __builtin_isnan. This is because
16521 /usr/include/iso/math_c99.h #defines isnan(x) to
16522 __builtin_isnan(x), but the bundled gcc, which identifies itself
16523 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16524 a __builtin_isnan.
16525 * floatfns.c (isnan): #undef, and then #define to a clone of
16526 what's in data.c.
16527 (Fisnan): Always define, since it's always available now.
16528 (syms_of_floatfns): Always define isnan at the Lisp level.
16529
e39b275c 165302011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16531
16532 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16533
b2db44d9 165342011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16535
f4af5137 16536 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16537 The previous code assumed that file offsets (off_t values) fit in
16538 EMACS_INT variables, which is not true on typical 32-bit hosts.
16539 The code messed up by falsely reporting buffer overflow in cases
16540 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16541 when "big" contains more than 2**29 bytes, even though this
16542 inserts just one byte and does not overflow the buffer.
16543 (Finsert_file_contents): Store file offsets as off_t
16544 values, not as EMACS_INT values. Check for overflow when
16545 converting between EMACS_INT and off_t. When checking for
16546 buffer overflow or for overlap, take the offsets into account.
16547 Don't use EMACS_INT for small values where int suffices.
16548 When checking for overlap, fix a typo: ZV was used where
16549 ZV_BYTE was intended.
16550 (Fwrite_region): Don't assume off_t fits into 'long'.
16551 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16552
ecfc0a49
MA
165532011-09-05 Michael Albinus <michael.albinus@gmx.de>
16554
16555 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16556
6511acf2 165572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16558
0999621a 16559 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16560
16561 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16562 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16563 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16564 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16565 (modify_event_symbol): Do not assume that the length of
16566 name_alist_or_stem is safe to alloca and fits in int.
16567 (Fexecute_extended_command): Likewise for function name and binding.
16568 (Frecursion_depth): Wrap around reliably on integer overflow.
16569 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16570 since some callers pass EMACS_INT values.
16571 (Fsingle_key_description): Don't crash if symbol name contains more
16572 than MAX_ALLOCA bytes.
16573 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16574 (get_minibuffer): Arg is now EMACS_INT, not int.
16575 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16576 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16577 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16578
2be7d702
PE
16579 * dbusbind.c (signature_cat): New function.
16580 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16581 Do not overrun buffer; instead, report string overflow.
16582
9d1df220
PE
16583 * dispnew.c (add_window_display_history): Don't overrun buffer.
16584 Truncate instead; this is OK since it's just a log.
16585
33ef5c64
PE
16586 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16587 even if the time zone offset is outlandishly large.
16588 Don't mishandle offset == INT_MIN.
16589
66c6fdd5
PE
16590 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16591 when creating daemon; the previous buffer-overflow check was incorrect.
16592
d749b01b
PE
16593 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16594 which has the guts of the old verror function.
16595
b5cd1905
PE
16596 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16597 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16598
6e1a67fb
PE
16599 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16600 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16601 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16602 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16603 length of string rather than counting it via multiple sprintfs;
16604 that's simpler and more reliable.
c21721cc
PE
16605 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16606 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16607 sprintf, in case result does not fit in int.
16608
c57b67fc
PE
16609 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16610 (fontset_from_font): Print it.
16611
8a401434
PE
16612 * frame.c (tty_frame_count): Now printmax_t, not int.
16613 (make_terminal_frame, set_term_frame_name): Print it.
16614 (x_report_frame_params): In X, window IDs are unsigned long,
16615 not signed long, so print them as unsigned.
16616 (validate_x_resource_name): Check for implausibly long names,
16617 and don't assume name length fits in 'int'.
16618 (x_get_resource_string): Don't blindly alloca invocation name;
16619 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16620 not fit in int.
16621
6e1a67fb
PE
16622 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16623 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16624 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16625
0df02bf3
PE
16626 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16627 Use esprintf, not sprintf, in case result does not fit in int.
16628
48e30793
PE
16629 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16630 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16631 it as a large positive number.
16632 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16633 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16634
a66ff6d8
PE
16635 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16636 in case result does not fit in int.
16637
aca216ff
PE
16638 * print.c (float_to_string): Detect width overflow more reliably.
16639 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16640 buffer overrun. Don't assume list length fits in 'int'. Treat
16641 print length of 0 as 0, not as infinity; to be consistent with other
16642 uses of print length in this function. Don't overflow print length
16643 index. Don't assume hash table size fits in 'long', or that
16644 vectorlike size fits in 'unsigned long'.
16645
31c286f7
PE
16646 * process.c (make_process): Use printmax_t, not int, to format
16647 process-name gensyms.
16648
55e5faa1
PE
16649 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16650
80f2e268
PE
16651 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16652 to avoid potential buffer overrun.
16653
670741ab
PE
16654 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16655 if X resource line is longer than 512 bytes.
16656
b7163a50
PE
16657 * xfns.c (x_window): Make sprintf buffer a bit bigger
16658 to avoid potential buffer overrun.
16659
ae58ff1f
PE
16660 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16661
c43c8a6a
PE
16662 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16663
3f8236f4
PE
166642011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16665
53e9fe90 16666 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16667 Without these, Emacs silently mishandles large integers sometimes.
16668 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16669 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16670
6511acf2
PE
16671 * xdisp.c (try_window_id): Check Emacs fixnum range before
16672 converting to 'int'.
806add1d 16673
6511acf2 16674 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16675 Check that an Emacs fixnum is in range before assigning it to 'int'.
16676 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16677 values converted from Emacs fixnums.
16678 (Frecenter): Don't wrap around a line count if it is out of 'int'
16679 range; instead, treat it as an extreme value.
16680 (Fset_window_configuration, compare_window_configurations):
16681 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16682
6511acf2
PE
16683 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16684 that can exceed INT_MAX. Check that EMACS_INT value is in range
16685 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16686 (match_limit): Don't assume that a fixnum can fit in 'int'.
16687
6511acf2 16688 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16689 exceed INT_MAX.
16690
6511acf2 16691 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16692 (Fvertical_motion): Don't wrap around LINES values that don't fit
16693 in 'int'. Instead, treat them as extreme values. This is good
16694 enough for windows, which can't have more than INT_MAX lines anyway.
16695
fcb901a7
LMI
166962011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16697
0f2f6b6d
LMI
16698 * Require libxml/parser.h to avoid compilation warning.
16699
fcb901a7
LMI
16700 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16701
16702 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16703 since this reportedly can destroy thread storage.
16704
6e20a0d4
CY
167052011-08-30 Chong Yidong <cyd@stupidchicken.com>
16706
16707 * syntax.c (find_defun_start): Update all cache variables if
16708 exiting early (Bug#9401).
16709
148ae00e
EZ
167102011-08-30 Eli Zaretskii <eliz@gnu.org>
16711
f6cfbd8f
EZ
16712 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16713
148ae00e
EZ
16714 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16715 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16716 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16717
16718 * term.c (tty_append_glyph): New function.
16719 (produce_stretch_glyph): Static function and its prototype deleted.
16720
a66cfb1c
SM
16721 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16722 Add prototypes.
148ae00e 16723
c4a07a4c
PE
167242011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16725
16726 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16727 when checking :margin (Bug#9390).
16728 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16729 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16730 so that the name doesn't mislead. All uses changed.
16731
6bc8cd65
JB
167322011-08-28 Johan Bockgård <bojohan@gnu.org>
16733
16734 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16735 set_tty_hooks.
16736
dca4927e
EZ
167372011-08-27 Eli Zaretskii <eliz@gnu.org>
16738
16739 * xdisp.c (move_it_to): Don't bail out early when reaching
16740 position beyond to_charpos, if we are scanning backwards.
16741 (move_it_vertically_backward): When DY == 0, make sure we get to
16742 the first character in the line after the newline.
16743
f2cad773
PE
167442011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16745
16746 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16747 (ccl_driver): Do not generate an out-of-range pointer.
16748 (Fccl_execute_on_string): Remove unnecessary check for
16749 integer overflow, noted by Stefan Monnier in
16750 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16751 Remove a FIXME that didn't need fixing.
16752 Simplify the newly-introduced buffer reallocation code.
16753
0cae2cdb
JB
167542011-08-27 Juanma Barranquero <lekktu@gmail.com>
16755
16756 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16757
5fc295a4 167582011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16759
70c60eb2 16760 Integer and memory overflow issues (Bug#9196).
726e0ab1 16761
d31850da
PE
16762 * doc.c (get_doc_string): Rework so that
16763 get_doc_string_buffer_size is the actual buffer size, rather than
16764 being 1 less than the actual buffer size; this makes xpalloc more
16765 convenient.
16766
a69fbedb
PE
16767 * image.c (x_allocate_bitmap_record, cache_image):
16768 * xselect.c (Fx_register_dnd_atom):
16769 Simplify previous changes by using xpalloc.
16770
fe5c5d37
PE
16771 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16772 since either will do and ptrdiff_t is convenient with xpalloc.
16773
0065d054
PE
16774 * charset.c (charset_table_size)
16775 (struct charset_sort_data.priority): Now ptrdiff_t.
16776 (charset_compare): Don't overflow if priorities differ greatly.
16777 (Fsort_charsets): Don't assume list length fits in int.
16778 Check for size-calculation overflow when allocating sort data.
16779 (syms_of_charset): Allocate an initial charset table that is
16780 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16781
16782 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16783
16784 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16785 The actual value is always <= INT_MAX, and leaving it unsigned made
16786 overflow checking harder.
16787
16788 * dispextern.h (struct glyph_matrix.rows_allocated)
16789 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16790 with xpalloc. The values are still always <= INT_MAX.
16791
16792 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16793
16794 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16795 (SAFE_NALLOCA): New macro.
16796
16797 * region-cache.c (struct boundary.pos, find_cache_boundary)
16798 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16799 (set_cache_region, invalidate_region_cache)
16800 (revalidate_region_cache, know_region_cache, region_cache_forward)
16801 (region_cache_backward, pp_cache):
16802 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16803 so that ptrdiff_t * can be passed to xpalloc.
16804 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16805 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16806 (pp_cache): Don't assume cache_len fits in int.
16807 * region-cache.h: Adjust extern decls to match.
16808
16809 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16810 EMACS_INT, since either will do, for xpalloc.
16811
16812 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16813 (xnmalloc, xnrealloc, xpalloc): New functions.
16814
726e0ab1
PE
16815 * bidi.c (bidi_shelve_header_size): New constant.
16816 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16817 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16818
51f30bc5 16819 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16820 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16821 (overlay_strings):
16822 Don't update size of array until after memory allocation succeeds,
16823 because xmalloc/xrealloc may not return.
0065d054
PE
16824 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16825 now that we have proper integer overflow checking.
16826 (record_overlay_string, overlay_strings): Catch overflows when
16827 calculating size of overlay_str_buf.
726e0ab1 16828
0065d054
PE
16829 * callproc.c (Fcall_process): Check for size overflow when
16830 calculating size of args2.
16831 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16832 Normally we prefer signed values, but sticking with ptrdiff_t would
16833 require adding more-complicated checks.
726e0ab1
PE
16834
16835 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16836 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16837 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16838 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16839
16840 * character.c (Fstring): Check for size-calculation overflow.
16841
16842 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16843 unnecessary integer overflow. Check for size overflow.
16844 (encode_coding_object): Don't update size until xmalloc succeeds.
16845
16846 * composite.c (get_composition_id): Check for overflow in glyph
16847 length calculations.
16848
16849 Integer and memory overflow fixes for display code.
16850 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16851 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16852 (scrolling_window): Check for overflow in size calculations.
16853 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16854 Don't assume glyph table len fits in int.
16855 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16856 (row_table_size): Now ptrdiff_t, not int.
16857 (scrolling_window): Avoid overflow in size calculations.
16858 Don't update size until allocation succeeds.
16859 * fns.c (concat): Check for overflow in size calculations.
16860 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16861 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16862 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16863
16864 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16865 (get_doc_string): Check for size calculation overflow.
16866 Don't update size until allocation succeeds.
16867 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16868 EMACS_INT, where ptrdiff_t will do.
16869 (Fsubstitute_command_keys): Check for string overflow.
16870
16871 * editfns.c (set_time_zone_rule): Don't assume environment length
16872 fits in int.
16873 (message_length): Now ptrdiff_t, not int.
16874 (Fmessage_box): Don't update size until allocation succeeds.
16875 Don't assume message length fits in int.
16876 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16877
0065d054
PE
16878 * emacs.c (main): Do not reallocate argv, since there is a null at
16879 the end that can be overwritten, and this way there's no need to
16880 worry about size-calculation overflow.
16881 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16882
16883 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16884 alloc succeeds.
16885 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16886
16887 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16888 (x_set_scroll_bar_width, x_figure_window_size):
16889 Check for integer overflow.
16890 (x_set_alpha): Do not assume XINT fits in int.
16891
16892 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16893 This is for the members text_lines, text_cols, total_lines, total_cols,
16894 where the system imposes an 'int' limit.
16895
16896 * fringe.c (Fdefine_fringe_bitmap):
16897 Don't update size until alloc works.
16898
16899 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16900 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16901
16902 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16903 Check for size-calculation overflow.
16904 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16905 do, as we prefer signed integers.
16906 (id_to_widget.max_size, id_to_widget.used)
16907 (xg_store_widget_in_map, xg_remove_widget_from_map)
16908 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16909 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16910 Use and return ptrdiff_t, not int.
16911 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16912 * gtkutil.h: Change prototypes to match the above.
16913
16914 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16915 are duplicate now that they've been promoted to lisp.h.
16916 (x_allocate_bitmap_record, x_alloc_image_color)
16917 (make_image_cache, cache_image, xpm_load):
16918 Don't update size until alloc is done.
16919 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16920 (x_detect_edges):
3256efce 16921 Check for size calculation overflow.
726e0ab1
PE
16922 (ct_colors_allocated_max): New constant.
16923 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16924 overflow.
3256efce 16925
726e0ab1
PE
16926 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16927 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16928 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16929 Use ptrdiff_t, not int, to count maps.
16930 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16931 calculations. Don't update size until allocation succeeds.
16932 Redo calculations to avoid overflow.
726e0ab1
PE
16933 * keyboard.h: Change prototypes to match the above.
16934
16935 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16936 to count maps.
16937 (current_minor_maps): Check for size calculation overflow.
16938 * keymap.h: Change prototypes to match the above.
16939
16940 * lread.c (read1, init_obarray): Don't update size until alloc done.
16941
16942 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16943 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16944
726e0ab1
PE
16945 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16946 Now ptrdiff_t, not int.
16947 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16948 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16949
16950 * process.c (Fnetwork_interface_list): Check for overflow
16951 in size calculation.
16952
16953 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16954
16955 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16956 overflow. Don't bother calling xmalloc when xrealloc will do.
16957
16958 * search.c (Freplace_match): Check for size calculation overflow.
16959 (Fset_match_data): Don't assume list lengths fit in 'int'.
16960
16961 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16962 for command line length. Do not attempt to address one before the
16963 beginning of an array, as that's not portable.
16964
16965 * term.c (max_frame_lines): Remove; unused.
16966 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16967 not int.
16968 (encode_terminal_code, calculate_costs): Check for size
16969 calculation overflow.
16970 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16971 table lengths and related sizes. Don't update size until alloc
16972 done. Redo calculations to avoid overflow.
16973 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16974
16975 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16976 subtracting pointers.
16977 (gobble_line): Check for overflow more carefully. Don't update size
16978 until alloc done.
16979
16980 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16981 Don't update size until alloc done.
16982 Redo size calculations to avoid overflow.
16983 Check for size calculation overflow.
0065d054 16984 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16985
16986 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16987 Use ptrdiff_t, not int, for sizes.
16988 (store_mode_line_noprop_char): Don't update size until alloc done.
16989
0065d054
PE
16990 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16991 Use ptrdiff_t, not int, for sizes.
16992 (Finternal_make_lisp_face, cache_face):
16993 Check for size calculation overflow.
16994 (cache_face): Treat size calculation overflows as if they were
16995 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16996
16997 * xfns.c (x_encode_text, x_set_name_internal)
16998 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16999 sizes, since they can exceed INT_MAX in size. Check for size
17000 calculation overflow.
17001
0065d054
PE
17002 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17003 (xg_select): Check for size calculation overflow.
726e0ab1
PE
17004 Don't update size until alloc done.
17005
0065d054 17006 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 17007 as sprintf is limited to int lengths.
1d526e2f 17008
252c5ee1
PE
17009 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17010 (X_LONG_MIN): New macros.
864d7ce7
PE
17011 Use them to make the following changes clearer.
17012 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17013 This change doesn't affect the value now, but it may help remind
17014 future maintainers not to raise the value too much later.
17015 (SELECTION_QUANTUM): Remove, replacing with ...
17016 (selection_quantum): ... new function, which avoids overflow.
17017 All uses changed.
17018 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17019 assumption that selection length fits in 'int'.
17020 (x_reply_selection_request, x_handle_selection_request)
17021 (x_get_window_property, receive_incremental_selection)
17022 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17023 (lisp_data_to_selection_data, clean_local_selection_data):
17024 Use ptrdiff_t, not int, to record length of selection.
17025 (x_reply_selection_request, x_get_window_property)
17026 (receive_incremental_selection, x_property_data_to_lisp):
17027 Redo calculations to avoid overflow.
17028 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 17029 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
17030 something.
17031 (x_get_window_property, receive_incremental_selection)
17032 (lisp_data_to_selection_data, x_property_data_to_lisp):
17033 Check for size-calculation overflow.
17034 (x_get_window_property, receive_incremental_selection)
17035 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17036 Don't store size until memory allocation succeeds.
17037 (x_get_window_property): Plug memory leak on memory exhaustion.
17038 Don't double-block input; malloc is safe here. Don't assume 2**34
17039 - 4 fits in unsigned long. Add an xassert to check
17040 XGetWindowProperty overflow. Be more careful about overflow
17041 calculations, and distinguish size from memory overflow better.
17042 (receive_incremental_selection): When tracing, don't assume
17043 unsigned int is less than INT_MAX.
17044 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17045 harmful) conversions of unsigned short to int.
17046 (lisp_data_to_selection_data): Don't assume that integers
17047 in the range -65535 through -1 fit in an X unsigned short.
17048 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17049 result parameters unless successful. Rely on cons_to_unsigned
17050 to report problems with elements; the old code wasn't right anyway.
17051 (x_check_property_data): Check for int overflow; we cannot use
17052 a wider type due to X limits.
17053 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17054
726e0ab1 17055 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 17056
0065d054
PE
17057 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17058 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
17059 (x_color_cells): Don't store size until memory allocation succeeds.
17060 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 17061 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
17062 (x_term_init): Don't assume length fits in int (sprintf is limited
17063 to int size).
bc18e09d 17064
ebfa62c0
PE
17065 Use ptrdiff_t for composition IDs.
17066 * character.c (lisp_string_width):
17067 * composite.c (composition_table_size, n_compositions)
17068 (get_composition_id, composition_gstring_from_id):
17069 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17070 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17071 * window.c (Frecenter):
17072 Use ptrdiff_t, not int, for composition IDs.
17073 * composite.c (get_composition_id): Check for integer overflow.
17074 * composite.h: Adjust prototypes to match the above changes.
17075
d3411f89
PE
17076 Use ptrdiff_t for hash table indexes.
17077 * category.c (hash_get_category_set):
17078 * ccl.c (ccl_driver):
17079 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17080 * coding.c (coding_system_charset_list, detect_coding_system):
17081 * coding.h (struct coding_system.id):
17082 * composite.c (get_composition_id, gstring_lookup_cache):
17083 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17084 * image.c (xpm_get_color_table_h):
17085 * lisp.h (hash_lookup, hash_put):
17086 * minibuf.c (Ftest_completion):
17087 Use ptrdiff_t for hash table indexes, not int (which is too
17088 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17089 32-bit --with-wide-int hosts).
17090
e097a6fa
PE
17091 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17092 Add a FIXME comment about memory leaks.
17093 (syms_of_charset): Don't assume xmalloc returns.
17094
5637687f
PE
17095 Don't assume that stated character widths fit in int.
17096 * character.c (Fchar_width, c_string_width, lisp_string_width):
17097 * character.h (CHAR_WIDTH):
17098 * indent.c (MULTIBYTE_BYTES_WIDTH):
17099 Use sanitize_char_width to avoid undefined and/or bad behavior
17100 with outlandish widths.
a66cfb1c 17101 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
17102 now that we have two such functions. All uses changed.
17103 (sanitize_char_width): New inline function.
17104
a2271ba2
PE
17105 Don't assume that tab-width fits in int.
17106 * character.h (sanitize_width): New inline function.
17107 (SANE_TAB_WIDTH): New macro.
17108 (ASCII_CHAR_WIDTH): Use it.
17109 * indent.c (sane_tab_width): Remove. All uses replaced by
17110 SANE_TAB_WIDTH (current_buffer).
17111 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17112
18c52557
PE
17113 * fileio.c: Integer overflow issues with file modes.
17114 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17115
caeeedc1
PE
17116 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17117 Remove unreachable code.
17118 (read_hex, load_charset_map_from_file): Check for integer overflow.
17119
6df6ae42 17120 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
17121 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17122 (x_send_scroll_bar_event): Likewise. Check that the size does not
17123 exceed limits imposed by XClientMessageEvent, as well as the usual
17124 ptrdiff_t and size_t limits.
17125
b13995db
PE
17126 * keyboard.c: Overflow, signedness and related fixes.
17127 (make_lispy_movement): Use same integer type in forward decl
17128 that is used in the definition.
17129 (read_key_sequence, keyremap_step):
17130 Change bufsize argument back to int, undoing my 2011-03-30 change.
17131 We prefer signed types, and int is wide enough here.
17132 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17133 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17134 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17135 length, not size_t. Use ptrdiff_t for index, not int.
17136 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17137 possibility of integer overflow.
17138
13464394
PE
17139 Overflow, signedness and related fixes for images.
17140
17141 * dispextern.h (struct it.stack[0].u.image.image_id)
17142 (struct_it.image_id, struct image.id, struct image_cache.size)
17143 (struct image_cache.used, struct image_cache.ref_count):
17144 * gtkutil.c (update_frame_tool_bar):
17145 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17146 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17147 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17148 * nsmenu.m (update_frame_tool_bar):
17149 * xdisp.c (calc_pixel_width_or_height):
17150 * xfns.c (image_cache_refcount):
17151 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17152 on typical 64-bit hosts.
17153
17154 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17155 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17156 Omit unnecessary casts to int.
17157 (parse_image_spec): Check that integers fall into 'int' range
17158 when the callers expect that.
17159 (image_ascent): Redo ascent calculation to avoid int overflow.
17160 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17161 (lookup_image): Remove unnecessary tests.
17162 (xbm_image_p): Locals are now of int, not EMACS_INT,
17163 since parse_image_check makes sure they fit into int.
17164 (png_load, gif_load, svg_load_image):
17165 Prefer int to unsigned where either will do.
17166 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17167 old tiff_error_handler and tiff_warning_handler.
17168 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17169 stack buffer overflows. It uses only the features of vsnprintf
17170 that are common to both POSIX and native Microsoft.
17171 (tiff_error_handler, tiff_warning_handler): Use it.
17172 (tiff_load, gif_load, imagemagick_load_image):
17173 Don't assume :index value fits in 'int'.
17174 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17175 (imagemagick_load_image): Check that crop parameters fit into
17176 the integer types that MagickCropImage accepts. Don't assume
17177 Vimagemagick_render_type has a nonnegative value. Don't assume
17178 size_t fits in 'long'.
17179 (gs_load): Use printmax_t to print the widest integers possible.
17180 Check for integer overflow when computing image height and width.
17181
c11821d4
EZ
171822011-08-26 Eli Zaretskii <eliz@gnu.org>
17183
17184 * xdisp.c (redisplay_window): Don't force window start if point
17185 will be invisible in the resulting window. (Bug#9324)
17186
0c95fcf7
EZ
171872011-08-25 Eli Zaretskii <eliz@gnu.org>
17188
17189 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17190 the display spec is of the form `(space ...)'.
17191 (handle_display_spec): Return the value returned by
17192 handle_single_display_spec, not just 1 or zero.
17193 (handle_single_display_spec): If the display spec is of the form
17194 `(space ...)', and specifies display in the text area, return 2
17195 rather than 1.
fee65a97 17196 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17197 accurately, and prefer exact match for point under bidi.
17198 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17199
17200 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17201 into disp_prop; all users changed.
17202
17203 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17204 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17205 for the text covered by the display property.
17206
e4ed06f1
CY
172072011-08-25 Chong Yidong <cyd@stupidchicken.com>
17208
17209 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17210 Change return value to nil.
17211 (Frecord_buffer): Delete unused function.
17212
f67cdd7f
EZ
172132011-08-24 Eli Zaretskii <eliz@gnu.org>
17214
5980d4c6
EZ
17215 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17216 buffers, return left-to-right.
8610fe8b
EZ
17217 (set_cursor_from_row): Consider candidate row a win if its glyph
17218 represents a newline and point is on that newline. Fixes cursor
17219 positioning on the newline at EOL of R2L text within L2R
17220 paragraph, and vice versa.
17221 (try_cursor_movement): Check continued rows, in addition to
17222 continuation rows. Fixes unwarranted scroll when point enters a
17223 continued line of R2L text within an L2R paragraph, or vice versa.
17224 (cursor_row_p): Consider the case of point being equal to
17225 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17226 from the end of a short line to the beginning of a continued line
17227 of R2L text within L2R paragraph.
17228 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17229 composed characters.
5980d4c6 17230
f67cdd7f
EZ
17231 * bidi.c (bidi_check_type): Use xassert.
17232 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17233 members.
17234
bca633fb
EZ
172352011-08-23 Eli Zaretskii <eliz@gnu.org>
17236
17237 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17238 a character.
17239
4a5885a7
CY
172402011-08-23 Chong Yidong <cyd@stupidchicken.com>
17241
17242 * nsfont.m (ns_otf_to_script): Fix typo.
17243
0902a04e
KH
172442011-08-22 Kenichi Handa <handa@m17n.org>
17245
17246 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17247 extra slot even if the purpose is char-code-property-table.
17248
1a2e6670
EZ
172492011-08-23 Eli Zaretskii <eliz@gnu.org>
17250
8ddde651
EZ
17251 * xdisp.c (redisplay_window): When computing centering_position,
17252 account for the height of the header line. (Bug#8874)
17253
425cc014
EZ
17254 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17255 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17256 candidate is selected by the mouse, and that candidate has a
17257 composed character under the mouse.
17258
1a2e6670
EZ
17259 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17260 coordinates reported by pos-visible-in-window-p for a composed
17261 character in column zero.
17262
8b76d6f8
SM
172632011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17264
17265 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17266
dac347dd
EZ
172672011-08-22 Eli Zaretskii <eliz@gnu.org>
17268
17269 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17270 consider it a hit if to_charpos is anywhere in the range of the
17271 composed buffer positions.
17272
e013fb34
CY
172732011-08-22 Chong Yidong <cyd@stupidchicken.com>
17274
17275 * image.c (gif_load): Don't assume that each subimage has the same
17276 dimensions as the base image. Handle disposal method that is
17277 "undefined" by the gif spec (Bug#9335).
17278
bd1ba3e8
CY
172792011-08-20 Chong Yidong <cyd@stupidchicken.com>
17280
17281 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17282 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17283
54a1215b
EZ
172842011-08-19 Eli Zaretskii <eliz@gnu.org>
17285
823564e5
EZ
17286 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17287 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17288 from an Org mode buffer to a Speedbar frame.
17289
54a1215b
EZ
17290 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17291 a composition, take its buffer position from IT->cmp_it.charpos.
17292 Fixes cursor positioning at the beginning of a line that begins
17293 with a composed character.
17294
9778ebcc
EZ
172952011-08-18 Eli Zaretskii <eliz@gnu.org>
17296
0be6ee06
EZ
17297 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17298 character bidirectional type, use STRONG_L instead. Fixes crashes
17299 in a buffer produced by `describe-categories'.
17300
9778ebcc
EZ
17301 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17302 members before the level stack, so they would be saved and
17303 restored when copying iterator state. Fixes incorrect reordering
17304 around TABs covered by display properties.
17305
156bffbe
AS
173062011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17307
6b02f655 17308 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17309
72ad093b
CY
173102011-08-17 Chong Yidong <cyd@stupidchicken.com>
17311
17312 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17313 (internal_condition_case_2, internal_condition_case_n):
17314 Remove unnecessary aborts (Bug#9081).
72ad093b 17315
35774242
EZ
173162011-08-17 Eli Zaretskii <eliz@gnu.org>
17317
17318 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17319 has no `load' handler, try opening the file locally. (Bug#9311)
17320
db76dd85
KB
173212011-08-16 Ken Brown <kbrown@cornell.edu>
17322
17323 * gmalloc.c: Expand comment.
17324
b215eee5
EZ
173252011-08-16 Eli Zaretskii <eliz@gnu.org>
17326
17327 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17328 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17329
a4579d33
KB
173302011-08-16 Ken Brown <kbrown@cornell.edu>
17331
17332 Fix memory allocation problems in Cygwin build (Bug#9273).
17333
17334 * unexcw.c ( __malloc_initialized): Declare external variable.
17335 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17336
8b76d6f8
SM
17337 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17338 New variables.
a4579d33
KB
17339 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17340 dumped emacs.
17341 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17342 in the static heap.
17343 [CYGWIN] (special_realloc): New function.
17344 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17345 requests to realloc storage in the static heap.
17346
3ebec551
PE
173472011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17348
17349 * bidi.c (bidi_initialize): Remove unused local.
17350
9fd8be00
EZ
173512011-08-15 Eli Zaretskii <eliz@gnu.org>
17352
6b02f655
SM
17353 * bidimirror.h:
17354 * biditype.h: Remove file.
17355 * makefile.w32-in ($(BLD)/bidi.$(O)):
17356 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17357
17358 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17359
17360 * chartab.c: Improve commentary for the uniprop_table API.
17361
32413314
EZ
17362 * bidi.c (bidi_paragraph_init): Support zero value of
17363 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17364 (bidi_initialize): Use uniprop_table instead of including
17365 biditype.h and bidimirror.h.
32413314 17366
9fd8be00
EZ
17367 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17368 coordinates of the iterator when restoring from ppos_it.
17369 (Bug#9296)
17370
5cf2b69b
KH
173712011-08-14 Kenichi Handa <handa@m17n.org>
17372
17373 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17374 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17375
daf17d00
EZ
173762011-08-14 Eli Zaretskii <eliz@gnu.org>
17377
17378 * xdisp.c (move_it_in_display_line_to): Don't invoke
17379 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17380 ppos_it. Fixes vertical cursor motion when line beginning is
17381 covered by an image. (Bug#9296)
17382
08e3161a
JD
173832011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17384
17385 * nsterm.h (ns_run_ascript): Declare.
17386 (NSAPP_DATA2_RUNASSCRIPT): Define.
17387
17388 * nsfns.m (as_script, as_result, as_status): New static variables.
17389 (ns_run_ascript): New function.
5e617bc2 17390 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17391 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17392 the event loop. Get status from as_status (Bug#7276).
17393
17394 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17395 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17396 the event loop (Bug#7276).
17397
a3720aa2
AS
173982011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17399
17400 * gnutls.c (QCgnutls_bootprop_priority)
17401 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17402 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17403 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17404 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17405 (QCgnutls_bootprop_verify_hostname_error)
17406 (QCgnutls_bootprop_callbacks_verify): Rename from
17407 Qgnutls_bootprop_..., all uses changed.
17408
17409 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17410 uses changed.
17411
0a0d27fb
PE
174122011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17413
19d5c50c
PE
17414 * xfaces.c (Qframe_set_background_mode): Now static.
17415 * dispextern.h (Qframe_set_background_mode): Remove decl.
17416
0a0d27fb
PE
17417 * process.c (Fnetwork_interface_info): Declare local only if needed.
17418
377538cb
JD
174192011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17420
17421 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17422 (Fnetwork_interface_list): Allocate in increments of bytes instead
17423 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17424 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17425 sockaddr.
17426 (struct ifflag_def): notrailers is smart on OSX.
17427 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17428 Get hardware address with getifaddrs if available.
17429
08fff70c
EZ
174302011-08-12 Eli Zaretskii <eliz@gnu.org>
17431
17432 * xdisp.c (iterate_out_of_display_property): xassert that
17433 IT->position is set to within IT->object's boundaries. Break from
17434 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17435 when IT->position is set up wrongly due to some bug.
17436 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17437 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17438 entry. Force push_it to save on the stack the current
17439 buffer/string position, to be restored by pop_it. Fix flags in
17440 the iterator structure wrt the object coming from a display
17441 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17442 properties. (Bug#9284)
17443
7be1c708 174442011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17445
7be1c708
CY
17446 * fontset.c (fontset_get_font_group): Add proper type checks.
17447 (Bug#9172)
aac0c6e3 17448
7be1c708 174492011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17450
7be1c708
CY
17451 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17452 and LC_VERSION_MIN_MACOSX.
17453 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17454 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17455
97bb72a6
EZ
174562011-08-08 Eli Zaretskii <eliz@gnu.org>
17457
17458 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17459 no-display-properties-and-no-overlays under bidi display.
17460 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17461 properties and overlays.
97bb72a6 17462
d5617611
CY
174632011-08-08 Chong Yidong <cyd@stupidchicken.com>
17464
37e11a63
CY
17465 * editfns.c (Fset_time_zone_rule): Document relationship with the
17466 setenv function.
17467
d5617611
CY
17468 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17469 the font entity extracted from the cache (Bug#8109).
17470
58872834
CY
174712011-08-07 Chong Yidong <cyd@stupidchicken.com>
17472
17473 * composite.c (autocmp_chars): Don't reset point. That is done by
17474 restore_point_unwind (Bug#5984).
17475
75bfc667
JL
174762011-08-07 Juri Linkov <juri@jurta.org>
17477
17478 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17479 to show the arg `TIME' instead of `TIMEVAL'.
17480
d1410150
EZ
174812011-08-06 Eli Zaretskii <eliz@gnu.org>
17482
17483 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17484 display property strides EOL and includes a newline, as in
17485 longlines-mode. (Bug#9254)
75b771e4
EZ
17486 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17487 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17488
17489 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17490 is non-zero, even if the data buffer is NULL. Fixes a crash in
17491 vertical-motion with longlines-mode. (Bug#9254)
17492
35928349
EZ
174932011-08-05 Eli Zaretskii <eliz@gnu.org>
17494
ec7cc85b
EZ
17495 * bidi.c <bidi_cache_total_alloc>: Now static.
17496 (bidi_initialize): Initialize bidi_cache_total_alloc.
17497
8b76d6f8 17498 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17499 cache. (Bug#9221)
17500
17501 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17502 amount allocated this far in `bidi_cache_total_alloc'.
17503 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17504 non-zero, only free the data buffer without restoring the cache
17505 contents. All callers changed.
17506
17507 * dispextern.h (bidi_unshelve_cache): Update prototype.
17508
17509 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17510 (move_it_in_display_line, move_it_to)
17511 (move_it_vertically_backward, move_it_by_lines): Replace the call
17512 to xfree to an equivalent call to bidi_unshelve_cache.
17513 (move_it_in_display_line_to): Fix logic of returning
412b6358 17514 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17515
e2e2423b
EZ
175162011-08-05 Eli Zaretskii <eliz@gnu.org>
17517
17518 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17519 came from a string character with a `cursor' property. (Bug#9229)
17520
ae9e757a
JD
175212011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17522
17523 * Makefile.in (LIB_PTHREAD): New variable.
17524 (LIBES): Add LIB_PTHREAD (Bug#9216).
17525
17526 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17527 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17528
213bd7f2
AS
175292011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17530
6b02f655 17531 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17532
99aaf75f
JD
175332011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17534
17535 * xterm.c (x_find_topmost_parent): New function.
17536 (x_set_frame_alpha): Find topmost parent window with
17537 x_find_topmost_parent and set the property there also (bug#9181).
17538 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17539
c74e9d86
PE
175402011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17541
17542 * callproc.c (Fcall_process): Avoid vfork clobbering
17543 the local vars buffer, coding_systems, current_dir.
17544
640c8776
SM
175452011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17546
17547 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17548
f26d0e4c
PE
175492011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17550
8a10d76c
PE
17551 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17552 so that it is not optimized away.
17553
f26d0e4c
PE
17554 * xdisp.c (compute_display_string_pos): Remove unused local.
17555
55439c61
EZ
175562011-08-02 Eli Zaretskii <eliz@gnu.org>
17557
17558 Fix slow cursor motion and scrolling in large buffers with
17559 selective display, like Org Mode buffers. (Bug#9218)
17560
17561 * dispextern.h (struct bidi_it): New member disp_prop_p.
17562
17563 * xdisp.c: Remove one-slot cache of display string positions.
17564 (compute_display_string_pos): Accept an additional argument
5e617bc2 17565 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17566 for a display string or property. If found, set DISP_PROP_P
17567 non-zero.
17568
17569 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17570 DISP_PROP_P, and pass it to compute_display_string_pos.
17571 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17572 non-zero. All callers of bidi_fetch_char changed.
17573
fb33fa43
SM
175742011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17575
17576 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17577
b099e063
DM
175782010-12-03 Don March <don@ohspite.net>
17579
17580 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17581 last character M-[char] is translated to ESC [char] (bug#7541).
17582
5cc7f7af
KH
175832011-08-02 Kenichi Handa <handa@m17n.org>
17584
d0fffa3f 17585 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17586
17587 * chartab.c (uniprop_table): Make it non-static.
17588
525d5e6e
EZ
175892011-08-01 Eli Zaretskii <eliz@gnu.org>
17590
17591 * xdisp.c (forward_to_next_line_start): Accept additional argument
17592 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17593 on the newline.
17594 (reseat_at_next_visible_line_start): Use the bidi iterator state
17595 returned by forward_to_next_line_start to restore the state of
17596 it->bidi_it after backing up to previous newline. (Bug#9212)
17597
31011111
AS
175982011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17599
17600 * regex.c (re_comp): Protoize.
17601 (re_exec): Fix return type.
17602 (regexec): Fix type of `ret'. (Bug#9203)
17603
476371c4
PE
176042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17605
e5d76069
PE
17606 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17607 This is needed if max-image-size is a floating-point number.
17608
9a79b20c
AS
176092011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17610
17611 * print.c (print_object): Print empty symbol as ##.
17612
17613 * lread.c (read1): Read ## as empty symbol.
17614
d8c2fa78
AA
176152011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17616
17617 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17618 setting frame foreground color (Bug#9175).
17619 (x_set_background_color): Likewise.
17620
ffe57a7a
AA
17621 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17622 contents (Bug#9176).
17623 (EmacsTooltip -init): Remove bezels and add shadows to
17624 tooltip windows.
17625
bf3492a5
AA
17626 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17627 or scroll bar (Bug#8470).
17628
d55e9c53
AA
17629 * nsfont.m (nsfont_open): Remove assignment to voffset and
17630 unnecessary vars hshink, expand, hd, full_height, min_height.
17631 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17632
17633 * nsterm.h (nsfont_info): Remove voffset field.
17634
d8c2fa78 176352011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17636
17637 Implement strike-through and overline on NextStep (Bug#8863).
17638
17639 * nsfont.m (nsfont_open): Use underline position provided by font,
17640 instead of hard-coded value of 2.
17641 (nsfont_draw): Call ns_draw_text_decoration instead.
17642
17643 * nsterm.h: Add declaration for ns_draw_text_decoration.
17644
17645 * nsterm.m (ns_draw_text_decoration): New function for drawing
17646 underline, overline, and strike-through.
17647 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17648 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17649 accommodate underlining, etc.
4843aac3 17650
4cc60b9b
EZ
176512011-07-28 Eli Zaretskii <eliz@gnu.org>
17652
bc7ece87
EZ
17653 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17654 default.
4cc60b9b 17655
476371c4
PE
176562011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17657
66606eea
PE
17658 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17659 Without this fix, if a signal arrives just after memory fills up,
17660 'malloc' might be invoked reentrantly.
17661
476371c4
PE
17662 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17663 In other words, assume that every image size is allowed, on non-X
17664 hosts. This assumption is probably wrong, but it lets Emacs compile.
17665
f3fcc40d
AS
176662011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17667
17668 * regex.c (re_iswctype): Convert return values to boolean.
17669
350c992f
EZ
176702011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17671
17672 * xdisp.c (compute_display_string_pos): Don't use cached display
17673 string position if the buffer had its restriction changed.
17674 (Bug#9184)
17675
5266b4bb
PE
176762011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17677
17678 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17679
2573a837 176802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17681
41f55ccd 17682 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17683
39e378da
PE
17684 * bidi.c: Integer size and overflow fixes.
17685 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17686 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17687 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17688 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17689 (bidi_find_other_level_edge):
17690 Use ptrdiff_t instead of EMACS_INT where either will do.
17691 This works better on 32-bit hosts configured --with-wide-int.
17692 (bidi_cache_ensure_space): Check for size-calculation overflow.
17693 Use % rather than repeated addition, for better worst-case speed.
17694 Don't set bidi_cache_size until after xrealloc returns, because it
17695 might not return.
17696 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17697 (bidi_cache_ensure_space): Also check that the bidi cache size
17698 does not exceed that of the largest Lisp string or buffer. See Eli
17699 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17700
5e927815
PE
17701 * alloc.c (__malloc_size_t): Remove.
17702 All uses replaced by size_t. See Andreas Schwab's note
17703 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17704
ca4aa935
PE
17705 * image.c: Improve checking for integer overflow.
17706 (check_image_size): Assume that f is nonnull, since
17707 it is always nonnull in practice. This is one less thing to
17708 worry about when checking for integer overflow later.
17709 (x_check_image_size): New function, which checks for integer
17710 overflow issues inside X.
17711 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17712 This removes the need for a memory_full check.
17713 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17714 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17715 (xbm_read_bitmap_data): Change locals back to 'int', since
17716 their values must fit in 'int'.
17717 (xpm_load_image, png_load, tiff_load):
17718 Invoke x_create_x_image_and_pixmap earlier,
17719 to avoid much needless work if the image is too large.
17720 (tiff_load): Treat overly large images as if
17721 x_create_x_image_and_pixmap failed, not as malloc failures.
17722 (gs_load): Use x_check_image_size.
17723
5f8f9cc2
PE
17724 * gtkutil.c: Omit integer casts.
17725 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17726 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17727
5adf60bc
PE
17728 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17729
c8907a93
PE
17730 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17731 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17732 would wrongly return t on a 64-bit host.
17733
e3c25c68
PE
17734 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17735 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17736 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17737 and therefore cause GCC to emit a bogus diagnostic in some cases.
17738
3f791afe
PE
17739 * image.c: Integer signedness and overflow and related fixes.
17740 This is not an exhaustive set of fixes, but it's time to
17741 record what I've got.
17742 (lookup_pixel_color, check_image_size): Remove redundant decls.
17743 (check_image_size): Don't assume that arbitrary EMACS_INT values
17744 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17745 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17746 (tiff_load, imagemagick_load_image):
17747 Check for overflow in size calculations.
17748 (x_create_x_image_and_pixmap): Remove unnecessary test for
17749 xmalloc returning NULL; that can't happen.
17750 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17751 (xpm_color_bucket): Use better integer hashing function.
17752 (xpm_cache_color): Don't possibly over-allocate memory.
17753 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17754 (gif_memory_source):
17755 Use ptrdiff_t, not int or size_t, to record sizes.
17756 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17757 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17758 either works, as we prefer signed integers.
17759 (tiff_read_from_memory, tiff_write_from_memory):
17760 Return tsize_t, not size_t, since that's what the TIFF API wants.
17761 (tiff_read_from_memory): Don't fail simply because the read would
17762 go past EOF; instead, return a short read.
17763 (tiff_load): Omit no-longer-needed casts.
17764 (Fimagemagick_types): Don't assume size fits into 'int'.
17765
3cc5a532
PE
17766 Improve hashing quality when configured --with-wide-int.
17767 * fns.c (hash_string): New function, taken from sxhash_string.
17768 Do not discard information about ASCII character case; this
17769 discarding is no longer needed.
17770 (sxhash-string): Use it. Change sig to match it. Caller changed.
17771 * lisp.h: Declare it.
17772 * lread.c (hash_string): Remove, since we now use fns.c's version.
17773 The fns.c version returns a wider integer if --with-wide-int is
17774 specified, so this should help the quality of the hashing a bit.
17775
b312a492
PE
17776 * emacs.c: Integer overflow minor fix.
17777 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17778 Define only if GNU_LINUX.
17779 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17780
dfd153ae
PE
17781 * dispnew.c: Integer signedness and overflow fixes.
17782 Remove unnecessary forward decls, that were a maintenance hassle.
17783 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17784 All uses changed.
17785 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17786 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17787 (prepare_desired_row, line_draw_cost):
17788 Use int, not unsigned, where either works.
17789 (save_current_matrix, restore_current_matrix):
17790 Use ptrdiff_t, not size_t, where either works.
17791 (init_display): Check for overflow more accurately, and without
17792 relying on undefined behavior.
17793
a81d11a3
PE
17794 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17795 Remove, replacing with the new symbols in lisp.h. All uses changed.
17796 * fileio.c (make_temp_name):
17797 * filelock.c (lock_file_1, lock_file):
17798 * xdisp.c (message_dolog):
17799 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17800 Use pMd etc. instead.
17801 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17802 replacing the pWIDE etc. symbols removed from editfns.c.
17803
3300e6fd
PE
17804 * keyboard.h (num_input_events): Now uintmax_t.
17805 This is (very slightly) less likely to mess up due to wraparound.
17806 All uses changed.
17807
fd05c7e9
PE
17808 * buffer.c: Integer signedness fixes.
17809 (alloc_buffer_text, enlarge_buffer_text):
17810 Use ptrdiff_t rather than size_t when either will do, as we prefer
17811 signed integers.
17812
903fe15d
PE
17813 * alloc.c: Integer signedness and overflow fixes.
17814 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17815 (__malloc_size_t): Default to size_t, not to int.
17816 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17817 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17818 Prefer ptrdiff_t to size_t when either would do, as we prefer
17819 signed integers.
17820 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17821 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17822 Now const. Initialize with values that are in range even if char
17823 is signed.
17824 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17825 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17826 These functions do the right thing with sizes > 2**32.
17827 (check_depth): Now ptrdiff_t, not int.
17828 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17829 Adjust to new way of storing sizes. Check for size overflow bugs
17830 in rest of code.
17831 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17832 slightly wrong anyway, as it missed one instance of
17833 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17834 (refill_memory_reserve): Omit needless cast to size_t.
17835 (mark_object_loop_halt): Mark as externally visible.
17836
ac82cc6a
PE
17837 * xselect.c: Integer signedness and overflow fixes.
17838 (Fx_register_dnd_atom, x_handle_dnd_message):
17839 Use ptrdiff_t, not size_t, since we prefer signed.
17840 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17841 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17842 x_dnd_atoms_size and x_dnd_atoms_length.
17843
c2d1e36d
PE
17844 * doprnt.c: Prefer signed to unsigned when either works.
17845 * eval.c (verror):
17846 * doprnt.c (doprnt):
17847 * lisp.h (doprnt):
17848 * xdisp.c (vmessage):
17849 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17850 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17851 prefer signed arithmetic to avoid comparison confusion.
17852 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17853 but is a bit tricky.
17854
0e926e56
PE
17855 Assume freestanding C89 headers, string.h, stdlib.h.
17856 * data.c, doprnt.c, floatfns.c, print.c:
17857 Include float.h unconditionally.
17858 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17859 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17860 * regex.c: Likewise for stddef.h, string.h.
17861 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17862 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17863 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17864 (STDC_HEADERS): Remove obsolete defines.
17865 * sysdep.c: Include limits.h unconditionally.
17866
9cfdb3ec
PE
17867 Assume support for memcmp, memcpy, memmove, memset.
17868 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17869 * regex.c (memcmp, memcpy):
17870 Remove; we assume C89 now.
17871
17872 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17873 (__malloc_safe_bcopy): Remove; no longer needed.
17874
cf950e6b 17875 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17876 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17877 well either way, and we prefer signed to unsigned.
17878
dbf38e02
LMI
178792011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17880
17881 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17882 closes the connection while we're reading (bug#9182).
17883
d6f0886c 178842011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17885
d6f0886c
JD
17886 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17887 are specified (Bug#9168).
24e0f6b1 17888
2eb1f9e6
PE
178892011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17890
17891 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17892 Found by GCC static checking and --with-wide-int on a 32-bit host.
17893
22381272 178942011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17895
17896 * xdisp.c (compute_display_string_pos): Fix logic of caching
17897 previous display string position. Initialize cached_prev_pos to
17898 -1. Fixes slow-down at the beginning of a buffer.
17899
f25e39b4
EZ
179002011-07-24 Eli Zaretskii <eliz@gnu.org>
17901
17902 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17903 for attrs[LFACE_FONTSET_INDEX].
17904
04c4b52e
PE
179052011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17906
17907 * xml.c (parse_region): Remove unused local
17908 that was recently introduced.
17909
c1734fbd
EZ
179102011-07-23 Eli Zaretskii <eliz@gnu.org>
17911
be18c5a5
EZ
17912 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17913 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17914
c1734fbd
EZ
17915 * xdisp.c (move_it_in_display_line_to): Record the best matching
17916 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17917 exit if none of the characters scanned was an exact match.
17918 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17919 when exact match is impossible due to invisible text, and the
17920 lines are truncated.
17921
a258d627
JD
179222011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17923
17924 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17925 for OSX >= 10.7.
17926
b6d5a689
EZ
179272011-07-22 Eli Zaretskii <eliz@gnu.org>
17928
0f74f785
EZ
17929 Fix a significant slow-down of cursor motion with C-n, C-p,
17930 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17931 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17932 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17933 (next_element_from_buffer): Call compute_stop_pos_backwards to
17934 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17935 base_level_stop.
17936 (reseat): Don't look for prev_stop, as that could mean a very long
17937 run.
17938 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17939 <cached_disp_overlay_modiff>: Cache for last found display string
17940 position.
551918c1 17941 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17942 about the same buffer in the same area of character positions, and
17943 the buffer wasn't changed since the time the display string
17944 position was cached.
551918c1 17945
b2d0c91a
EZ
179462011-07-22 Eli Zaretskii <eliz@gnu.org>
17947
17948 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17949 is an integer, which is important for empty lines. (Bug#9149)
17950
043604ee
CY
179512011-07-22 Chong Yidong <cyd@stupidchicken.com>
17952
17953 * frame.c (Fmodify_frame_parameters): In tty case, update the
17954 default face if necessary (Bug#4238).
17955
da4adb04
CY
179562011-07-21 Chong Yidong <cyd@stupidchicken.com>
17957
17958 * editfns.c (Fstring_to_char): No need to explain what a character
17959 is in the docstring (Bug#6576).
17960
9abd0532
LMI
179612011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17962
17963 * xml.c (parse_region): Make sure we always return a tree.
17964
36881d16
HK
179652011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17966
17967 * xml.c (parse_region): If a document contains only comments,
17968 return that, too.
17969
1e98674d
LMI
179702011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17971
17972 * xml.c (make_dom): Return comments, too.
17973
590bd467
PE
179742011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17975
17976 Port to OpenBSD.
17977 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17978 and the surrounding thread.
17979 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17980 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17981 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17982 timer goes off.
17983 * s/openbsd.h (BROKEN_SIGIO): Define.
17984 * unexelf.c (unexec) [__OpenBSD__]:
17985 Don't update the .mdebug section of the Alpha COFF symbol table.
17986
f41628b2
LMI
179872011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17988
17989 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17990 (bug#8460).
17991
b59b67c5
PE
179922011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17993
15e3a074
PE
17994 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17995 This fixes some race conditions on the permissions of any newly
17996 created file.
17997
41bed37d
PE
17998 * alloc.c (valid_pointer_p): Use pipe, not open.
17999 This fixes some permissions issues when debugging.
18000
b59b67c5
PE
18001 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18002 If fchown fails to set both uid and gid, try to set just gid,
18003 as that is sometimes allowed. Adjust the file's mode to eliminate
18004 setuid or setgid bits that are inappropriate if fchown fails.
18005
925a6be7
SM
180062011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18007
18008 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18009 to compare Lisp_Objects.
18010 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18011 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18012 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18013
52968808
AS
180142011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18015
0a6a104b
AS
18016 * lread.c (read_integer): Unread even EOF character.
18017 (read1): Likewise. Properly record start position of symbol.
18018
52968808
AS
18019 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18020 symbol character follows.
18021
9e381cdd
PE
180222011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18023
18024 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18025 This works around a problem with the previous change to Fcopy_file.
18026 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18027 and without this change, GCC might complain about discarding
18028 fchown's return value.
18029
b5641435
JB
180302011-07-16 Juanma Barranquero <lekktu@gmail.com>
18031
18032 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18033
a8031457
PE
180342011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18035
18036 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18037
dd889327
LMI
180382011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18039
750c33f7
LMI
18040 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18041 it's used from the C level.
18042
dd889327
LMI
18043 * process.c: Use the same condition for POLL_FOR_INPUT in both
18044 keyboard.c and process.c (bug#1858).
18045
87e86684
LM
180462011-07-09 Lawrence Mitchell <wence@gmx.li>
18047
18048 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18049 (Fgnutls_boot): Use it.
18050
64348f40
AS
180512011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18052
18053 * doc.c (Fsubstitute_command_keys): Revert last change.
18054
1d698799
LMI
180552011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18056
f863868c
LMI
18057 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18058 quotes the next character, and doesn't affect other longer
18059 sequences (bug#8935).
18060
1d698799
LMI
18061 * lread.c (syms_of_lread): Clarify that is isn't only
18062 `eval-buffer' and `eval-defun' that's affected by
18063 `lexical-binding' (bug#8460).
18064
aa4b6df6
EZ
180652011-07-15 Eli Zaretskii <eliz@gnu.org>
18066
18067 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 18068 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 18069
5d856da6
PE
180702011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18071
ad6042bb
PE
18072 Fix minor problems found by static checking.
18073 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18074 (elsz): Now a signed constant, not a size_t var. We prefer signed
18075 types to unsigned, to avoid integer comparison confusion. Without
18076 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18077 "cannot optimize loop, the loop counter may overflow", a symptom
18078 of the confusion.
f00bbb22 18079 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
18080 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18081
6468f31c
LMI
180822011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18083
49080b10
LMI
18084 * search.c (Fre_search_backward): Mention `case-fold-search' in
18085 all the re_search_* functions (bug#8138).
18086
6468f31c
LMI
18087 * keyboard.c (Fopen_dribble_file): Document when the file is
18088 closed (bug#8056).
18089
c965adc5
EZ
180902011-07-14 Eli Zaretskii <eliz@gnu.org>
18091
df9733bf
EZ
18092 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18093 bidi_cache_idx.
18094
0bb23927
EZ
18095 Support bidi reordering of display and overlay strings.
18096 * xdisp.c (compute_display_string_pos)
18097 (compute_display_string_end): Accept additional argument STRING.
18098 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18099 (reseat_to_string): Initialize bidi_it->string.s and
18100 bidi_it->string.schars.
18101 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
18102 NULL (avoids a crash in bidi_paragraph_init).
18103 Initialize itb.string.lstring.
0bb23927
EZ
18104 (init_iterator): Call bidi_init_it only of a valid
18105 buffer position was specified. Initialize paragraph_embedding to
18106 L2R.
18107 (reseat_to_string): Initialize the bidi iterator.
18108 (display_string): If we need to ignore text properties of
18109 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18110 original value of -1 will not work with bidi.)
18111 (compute_display_string_pos): First arg is now struct
18112 `text_pos *'; all callers changed. Support display properties on
18113 Lisp strings.
18114 (compute_display_string_end): Support display properties on Lisp
18115 strings.
18116 (init_iterator, reseat_1, reseat_to_string): Initialize the
18117 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18118 when iterating on a string not from display properties).
640c8776
SM
18119 (compute_display_string_pos, compute_display_string_end):
18120 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
18121 arrow keys.
18122 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
18123 base_level_stop; instead, set base_level_stop to BEGV.
18124 Fixes crashes in vertical-motion.
0bb23927
EZ
18125 (next_element_from_buffer): Improve commentary for when
18126 the iterator is before prev_stop.
18127 (init_iterator): Initialize bidi_p from the default value of
18128 bidi-display-reordering, not from buffer-local value. Use the
18129 buffer-local value only if initializing for buffer iteration.
18130 (handle_invisible_prop): Support invisible properties on strings
18131 that are being bidi-reordered.
18132 (set_iterator_to_next): Support bidi reordering of C strings and
18133 Lisp strings.
18134 (next_element_from_string): Support bidi reordering of Lisp
18135 strings.
18136 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
18137 (display_string): Support display of R2L glyph rows.
18138 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
18139 (init_iterator): Don't initialize it->bidi_p for strings
18140 here.
18141 (reseat_to_string): Initialize it->bidi_p for strings here.
18142 (next_element_from_string, next_element_from_c_string)
18143 (next_element_from_buffer): Add xassert's for correspondence
18144 between IT's object being iterated and it->bidi_it.string
18145 structure.
18146 (face_before_or_after_it_pos): Support bidi iteration.
18147 (next_element_from_c_string): Handle the case of the first string
18148 character that is not the first one in the visual order.
18149 (get_visually_first_element): New function, refactored from common
18150 parts of next_element_from_buffer, next_element_from_string, and
18151 next_element_from_c_string.
18152 (tool_bar_lines_needed, redisplay_tool_bar)
18153 (display_menu_bar): Force left-to-right direction. Add a FIXME
18154 comment for making that be controlled by a user option.
18155 (push_it, pop_it): Save and restore the state of the
18156 bidi iterator. Save and restore the bidi_p flag.
18157 (pop_it): Iterate out of display property for string iteration as
18158 well.
18159 (iterate_out_of_display_property): Support iteration over strings.
18160 (handle_single_display_spec): Set up it->bidi_it for iteration
18161 over a display string, and call bidi_init_it.
18162 (handle_single_display_spec, next_overlay_string)
18163 (get_overlay_strings_1, push_display_prop): Set up the bidi
18164 iterator for displaying display or overlay strings.
18165 (forward_to_next_line_start): Don't use the shortcut if
18166 bidi-iterating.
18167 (back_to_previous_visible_line_start): If handle_display_prop
18168 pushed the iterator stack, restore the internal state of the bidi
18169 iterator by calling bidi_pop_it same number of times.
18170 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18171 and we are bidi-iterating, don't decrement the iterator position;
18172 instead, set the first_elt flag in the bidi iterator, to produce
18173 the same effect.
18174 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18175 (push_display_prop): xassert that we are iterating a buffer.
18176 (push_it, pop_it): Save and restore paragraph_embedding member.
18177 (handle_single_display_spec, next_overlay_string)
18178 (get_overlay_strings_1, reseat_1, reseat_to_string)
18179 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18180 correctly. Don't assume unibyte strings are not bidi-reordered.
18181 (compute_display_string_pos)
18182 (compute_display_string_end): Fix handling the case of C string.
18183 (push_it, pop_it): Save and restore from_disp_prop_p.
18184 (handle_single_display_spec, push_display_prop): Set the
18185 from_disp_prop_p flag.
18186 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18187 (pop_it): Call iterate_out_of_display_property only if we are
18188 popping after iteration over a string that came from a display
18189 property. Fix a typo in popping stretch info. Add an assertion
18190 for verifying that the iterator position is in sync with the bidi
18191 iterator.
18192 (handle_single_display_spec, get_overlay_strings_1)
18193 (push_display_prop): Fix initialization of paragraph direction for
18194 string when that of the parent object is not yet determined.
18195 (reseat_1): Call bidi_init_it to resync the bidi
18196 iterator with IT's position. (Bug#7616)
18197 (find_row_edges): If ROW->start.pos gives position
18198 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18199 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18200 Reset the from_disp_prop_p flag.
18201 (SAVE_IT, RESTORE_IT): New macros.
18202 (pos_visible_p, face_before_or_after_it_pos)
18203 (back_to_previous_visible_line_start)
18204 (move_it_in_display_line_to, move_it_in_display_line)
18205 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18206 (try_scrolling, redisplay_window, display_line): Use them when
18207 saving a temporary copy of the iterator and restoring it back.
18208 (back_to_previous_visible_line_start, reseat_1)
18209 (init_iterator): Empty the bidi cache "stack".
18210 (move_it_in_display_line_to): If iterator ended up at
18211 EOL, but we never saw any buffer positions smaller than
18212 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18213 motion in bidi-reordered lines.
18214 (move_it_in_display_line_to): Record prev_method and prev_pos
18215 immediately before the call to set_iterator_to_next. Fixes cursor
18216 motion in bidi-reordered lines with stretch glyphs and strings
18217 displayed in margins. (Bug#8133) (Bug#8867)
18218 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18219 TO_CHARPOS.
640c8776
SM
18220 (pos_visible_p): Support positions in bidi-reordered lines.
18221 Save and restore bidi cache.
0bb23927
EZ
18222
18223 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18224 (bidi_paragraph_info): Delete unused struct.
18225 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18226 (bidi_cache_start): New variable.
18227 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18228 to zero.
18229 (bidi_cache_fetch_state, bidi_cache_search)
18230 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18231 (bidi_cache_find, bidi_peek_at_next_level)
18232 (bidi_level_of_next_char, bidi_find_other_level_edge)
18233 (bidi_move_to_visually_next): Compare cache index with
18234 bidi_cache_start rather than with zero.
18235 (bidi_fetch_char): Accept new argument STRING; all callers
18236 changed. Support iteration over a string. Support strings with
18237 display properties. Support unibyte strings. Fix the type of
18238 `len' according to what STRING_CHAR_AND_LENGTH expects.
18239 (bidi_paragraph_init, bidi_resolve_explicit_1)
18240 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18241 (bidi_level_of_next_char, bidi_move_to_visually_next):
18242 Support iteration over a string.
0bb23927
EZ
18243 (bidi_set_sor_type, bidi_resolve_explicit_1)
18244 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18245 can now be zero (for strings); special values 0 and -1 were
18246 changed to -1 and -2, respectively.
18247 (bidi_char_at_pos): New function.
18248 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18249 Call it instead of FETCH_MULTIBYTE_CHAR.
18250 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18251 initialized to valid values.
18252 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18253 values.
18254 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18255 the test for valid cached positions. Fix the logic for looking up
18256 the sentinel state in the cache. GCPRO the Lisp string we are
18257 iterating.
18258 (bidi_push_it, bidi_pop_it): New functions.
18259 (bidi_initialize): Initialize the bidi cache start stack pointer.
18260 (bidi_cache_ensure_space): New function, refactored from part of
18261 bidi_cache_iterator_state. Don't assume the required size is just
18262 one BIDI_CACHE_CHUNK away.
18263 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18264 (bidi_count_bytes, bidi_char_at_pos): New functions.
18265 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18266 always valid if bidi_cache_idx is valid.
18267 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18268 is valid if it's going to be used.
18269 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18270 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18271 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18272 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18273 (bidi_find_other_level_edge, bidi_cache_start_stack):
18274 All variables related to cache indices are now EMACS_INT.
c965adc5 18275
0bb23927
EZ
18276 * dispextern.h (struct bidi_string_data): New structure.
18277 (struct bidi_it): New member `string'. Make flag members be 1-bit
18278 fields, and put them last in the struct.
640c8776
SM
18279 (compute_display_string_pos, compute_display_string_end):
18280 Update prototypes.
0bb23927
EZ
18281 (bidi_push_it, bidi_pop_it): Add prototypes.
18282 (struct iterator_stack_entry): New members bidi_p,
18283 paragraph_embedding, and from_disp_prop_p.
18284 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18285 (bidi_shelve_cache, bidi_unshelve_cache):
18286 Declare prototypes.
0bb23927
EZ
18287
18288 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18289 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18290 and vector-like objects.
18291
18292 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18293 cache around display iteration.
18294
18295 * window.c (Fwindow_end, window_scroll_pixel_based)
18296 (displayed_window_lines, Frecenter): Save and restore the bidi
18297 cache around display iteration.
18298
3bbd2265
LMI
182992011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18300
18301 * editfns.c (Fdelete_region): Clarify the use of the named
18302 parameters (bug#6788).
18303
adc47434
MR
183042011-07-14 Martin Rudalics <rudalics@gmx.at>
18305
18306 * indent.c (Fvertical_motion): Set and restore w->pointm when
18307 saving and restoring the window's buffer (Bug#9006).
18308
837c31f8
LMI
183092011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18310
18311 * editfns.c (Fstring_to_char): Clarify just what is returned
18312 (bug#6576). Text by Eli Zaretskii.
18313
ac389d0c
JB
183142011-07-13 Juanma Barranquero <lekktu@gmail.com>
18315
18316 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18317
0be0ce47
EZ
183182011-07-13 Eli Zaretskii <eliz@gnu.org>
18319
18320 * buffer.c (mmap_find): Fix a typo.
18321
cd18e7e3
JB
183222011-07-13 Johan Bockgård <bojohan@gnu.org>
18323
18324 Fix execution of x selection hooks.
18325 * xselect.c (Qx_lost_selection_functions)
18326 (Qx_sent_selection_functions): New vars.
18327 (syms_of_xselect): DEFSYM them.
18328 (x_handle_selection_request): Pass Qx_sent_selection_functions
18329 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18330 (x_handle_selection_clear,x_clear_frame_selections):
18331 Pass Qx_lost_selection_functions rather than
18332 Vx_lost_selection_functions to Frun_hook_with_args.
18333
47ea7f44
PE
183342011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18335
ac389d0c 18336 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18337 The old code sometimes used this field without initializing it.
18338
47ea7f44
PE
18339 * alloc.c (gc_sweep): Don't read past end of array.
18340 In theory, the old code could also have corrupted Emacs internals,
18341 though it'd be very unlikely.
18342
bc985c87
AS
183432011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18344
18345 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18346 argument. (Bug#4026)
bc985c87 18347
0cf34688
LMI
183482011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18349
b3dadd76
LMI
18350 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18351 key" (bug#4257).
18352
0cf34688
LMI
18353 * window.c (Fset_window_start): Doc fix (bug#4199).
18354 (Fset_window_hscroll): Ditto.
18355
270768cd
PE
183562011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18357
077e3dda 18358 Fix minor new problems caught by GCC 4.6.1.
270768cd 18359 * term.c (init_tty): Remove unused local.
490011a6 18360 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18361 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18362 not used otherwise.
270768cd 18363
b1f58454
CY
183642011-07-12 Chong Yidong <cyd@stupidchicken.com>
18365
18366 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18367
22b9578d
LMI
183682011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18369
6e70ab07
LMI
18370 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18371 are the mini-buffer and the echo area (bug#3320).
18372
22b9578d
LMI
18373 * term.c (init_tty): Remove support for supdup, c10 and perq
18374 terminals, which are no longer supported (bug#1482).
18375
8974cc9f
JB
183762011-07-10 Johan Bockgård <bojohan@gnu.org>
18377
18378 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18379
a560d974
JD
183802011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18381
18382 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18383 for non-popups (Bug#3642).
18384
1dae0f0a
AS
183852011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18386
268c2c36 18387 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18388 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18389 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18390 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18391 * data.c (fmod): Likewise.
18392 * dispnew.c (swap_glyphs_in_rows): Likewise.
18393 * emacs.c (memory_warning_signal): Likewise.
18394 * floatfns.c (float_error): Likewise.
18395 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18396 (otf_open, font_otf_capability, generate_otf_features)
18397 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18398 Likewise.
18399 * image.c (pbm_read_file): Likewise.
18400 * indent.c (string_display_width): Likewise.
18401 * intervals.c (check_for_interval, search_for_interval)
18402 (inc_interval_count, count_intervals, root_interval)
18403 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18404 * lread.c (defalias): Likewise.
268c2c36 18405 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18406 * regex.c (set_image_of_range_1, set_image_of_range)
18407 (regex_grow_registers): Likewise.
18408 * sysdep.c (strerror): Likewise.
18409 * termcap.c (valid_filename_p, tprint, main): Likewise.
18410 * tparam.c (main): Likewise.
18411 * unexhp9k800.c (run_time_remap, save_data_space)
18412 (update_file_ptrs, read_header, write_header, calculate_checksum)
18413 (copy_file, copy_rest, display_header): Likewise.
18414 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18415 Likewise.
18416 * xdisp.c (check_it): Likewise.
18417 * xfaces.c (register_color, unregister_color, unregister_colors):
18418 Likewise.
18419 * xfns.c (print_fontset_result): Likewise.
18420 * xrdb.c (member, fatal, main): Likewise.
18421
99033785
PE
184222011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18423
18424 Fix minor problems found by static checking (Bug#9031).
18425 * chartab.c (char_table_set_range, map_sub_char_table):
18426 Remove unused locals.
18427 (uniprop_table): Now static.
18428 * composite.c (_work_char): Remove unused static var.
18429
9cb2ac56
JB
184302011-07-09 Juanma Barranquero <lekktu@gmail.com>
18431
18432 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18433
f25661f0
JD
184342011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18435
18436 * gtkutil.c (qttip_cb): Remove code without function.
18437
8278c4fe
EZ
184382011-07-09 Eli Zaretskii <eliz@gnu.org>
18439
18440 * w32.c (pthread_sigmask): New stub.
18441
1692ae2d 184422011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18443
8a6ebd58 18444 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18445 sigprocmask is portable only for single-threaded applications, and
18446 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18447 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18448 (LIBES): Use it.
18449 * callproc.c (Fcall_process):
18450 * process.c (create_process):
18451 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18452 Use pthread_sigmask, not sigprocmask.
123403e4 18453
1b854618
JD
184542011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18455
18456 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18457 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18458 wrong (Bug#8591).
18459
3fe4b549
JD
184602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18461
0ce7e563
JD
18462 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18463 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18464 (xg_hide_tooltip): Fix comment.
18465
3fe4b549
JD
18466 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18467 in registerServicesMenuSendTypes.
18468 (validRequestorForSendType): Don't check ns_return_types.
18469
18470 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18471 ns_return_type.
18472
5df75e47
JR
184732011-07-08 Jason Rumney <jasonr@gnu.org>
18474
22610910
JR
18475 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18476 SH_SHOW for hidden windows (Bug#5482).
18477
5df75e47
JR
18478 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18479 frame struct members of non-existent frames (Bug#6284).
18480
699c10bd
JD
184812011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18482
4393663b
JD
18483 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18484 variable firstTime not needed on OSX >= 10.6.
18485 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18486 >= 10.5. Use setKnobProportion, setDoubleValue.
18487
18488 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18489 (MAC_OS_X_VERSION_10_5): Define if not defined.
18490 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18491 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18492 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18493
18494 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18495 cString and lossyCString on OSX >= 10.4.
4393663b 18496
58179cce 18497 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18498 sizeToFit on OSX >= 10.2.
18499
18500 * nsimage.m (allocInitFromFile): Don't use deprecated method
18501 bestRepresentationForDevice on OSX >= 10.6.
18502
18503 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18504 to avoid warning.
18505
18506 * emacs.c: Declare unexec_init_emacs_zone.
18507
a63e0781
JD
18508 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18509
699c10bd
JD
18510 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18511
18512 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18513 on svcsMenu (Bug#8842).
18514
18515 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18516 ns_return_types.
18517 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18518
18519 * nsterm.m (QUTF8_STRING): Declare.
18520 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18521 (validRequestorForSendType): Return type is (id).
18522 Change indexOfObjectIdenticalTo to indexOfObject.
18523 Check if we have local selection before returning self (Bug#8842).
18524 (writeSelectionToPasteboard): Put local selection into paste board
18525 if we have a local selection (Bug#8842).
18526 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18527
18528 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18529 (ns_get_local_selection): Declare.
18530
54e10184
LMI
185312011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18532
9888ff71
LMI
18533 * keymap.c (describe_map_tree): Don't insert a double newline at
18534 the end of the buffer (bug#1169) and return whether we inserted
18535 something.
18536
54e10184
LMI
18537 * callint.c (Fcall_interactively): Change "reading args" to
18538 "providing args" to try to clarify what it does (bug#1010).
18539
15fa4783
KH
185402011-07-07 Kenichi Handa <handa@m17n.org>
18541
18542 * composite.c (composition_compute_stop_pos): Ignore a static
18543 composition starting before CHARPOS (Bug#8915).
18544
18545 * xdisp.c (handle_composition_prop): Likewise.
18546
a8815b00
EZ
185472011-07-07 Eli Zaretskii <eliz@gnu.org>
18548
18549 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18550 (Bug#9015)
18551
ef7b981d 185522011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18553
18554 * character.h (unicode_category_t): New enum type.
18555
18556 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18557 (Qchar_code_property_table): New variable.
18558 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18559 (UNIPROP_COMPRESSED_FORM_P): New macros.
18560 (char_table_ascii): Uncompress the compressed values.
18561 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18562 Uncompress the compressed values.
ac389d0c 18563 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18564 (char_table_ref_and_range): Uncompress the compressed values.
18565 (sub_char_table_set): New arg is_uniprop. Callers changed.
18566 Uncompress the compressed values.
18567 (sub_char_table_set_range): Args changed. Callers changed.
18568 (char_table_set_range): Adjuted for the above change.
18569 (map_sub_char_table): Delete args default_val and parent. Add arg
18570 top. Give decoded values to a Lisp function.
640c8776 18571 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18572 values to a Lisp function. Gcpro more variables.
18573 (uniprop_table_uncompress)
18574 (uniprop_decode_value_run_length): New functions.
18575 (uniprop_decoder, uniprop_decoder_count): New variables.
18576 (uniprop_get_decoder, uniprop_encode_value_character)
18577 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18578 New functions.
18579 (uniprop_encoder, uniprop_encoder_count): New variables.
18580 (uniprop_get_encoder, uniprop_table)
18581 (Funicode_property_table_internal, Fget_unicode_property_internal)
18582 (Fput_unicode_property_internal): New functions.
18583 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18584 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18585 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18586 char-code-property-alist.
18587
640c8776 18588 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18589 Vunicode_category_table.
18590
640c8776 18591 * font.c (font_range): Adjust for the change of
c805dec0
KH
18592 Vunicode_category_table.
18593
76b397fb
DN
185942011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18595
18596 * m/iris4d.h: Remove file, move contents ...
18597 * s/irix6-5.h: ... here.
18598
22b4128e
PE
185992011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18600
18601 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18602 * alloc.c (mark_buffer):
18603 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18604 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18605 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18606 This isn't true in general, and it's particularly not true
18607 if Emacs is configured with --with-wide-int.
18608 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18609 New macros, used in the buffer.c change.
18610
869795d6
JD
186112011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18612
18613 * xsettings.c: Use both GConf and GSettings if both are available.
18614 (store_config_changed_event): Add comment.
18615 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18616 (store_tool_bar_style_changed): New functions.
5e617bc2 18617 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18618 (struct xsettings): Move font inside HAVE_XFT.
18619 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18620 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18621 Move inside HAVE_XFT.
640c8776 18622 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18623 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18624 also.
18625 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18626 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18627 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18628 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18629 (parse_settings): Move check for font inside HAVE_XFT.
18630 (read_settings, apply_xft_settings): Add comment.
18631 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18632 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18633 call store_font_name_changed.
18634 (xft_settings_event): Add comment.
18635 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18636 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18637 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18638 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18639 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18640 (xsettings_get_system_font, xsettings_get_system_normal_font):
18641 Add comment.
869795d6 18642
d8ed26bd
PE
186432011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18644
18645 Random fixes. E.g., (random) never returned negative values.
18646 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18647 subseconds part to the entropy, as that's a bit more random.
18648 Prefer signed to unsigned, since the signedness doesn't matter and
18649 in general we prefer signed. When given a limit, use a
18650 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18651 latter isn't right if USE_2_TAGS_FOR_INTS.
18652 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18653 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18654
cabf1cac
SM
186552011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18656
18657 * textprop.c (text_property_stickiness):
18658 Obey Vtext_property_default_nonsticky.
18659 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18660 * w32fns.c (syms_of_w32fns):
18661 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18662
6e9b2be9
PE
186632011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18664
18665 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18666 This is more efficient than Ffile_directory_p and avoids a minor race.
18667
90186c68
LMI
186682011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18669
7c301272
LMI
18670 * buffer.c (Foverlay_put): Say what the return value is
18671 (bug#7835).
18672
c4f2d8d4
LMI
18673 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18674 is a directory before asking whether to use the file name
18675 (bug#7564).
ad637907
LMI
18676 (barf_or_query_if_file_exists): Make the "File is a directory"
18677 error be more correct.
c4f2d8d4 18678
90186c68
LMI
18679 * fns.c (Frequire): Remove the mention of the .gz files, since
18680 that's installation-specific, but keep the mention of
18681 `get-load-suffixes'.
18682
da64016e
PE
186832011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18684
18685 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18686 Report string overflow if the output is too long.
18687
7d47b580
JB
186882011-07-04 Juanma Barranquero <lekktu@gmail.com>
18689
a555cb87
JB
18690 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18691 (syms_of_gnutls): Remove duplicate DEFSYM for
18692 Qgnutls_bootprop_verify_hostname_error, an error for
18693 Qgnutls_bootprop_verify_error (which is no longer used).
18694
7d47b580
JB
18695 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18696 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18697 Also (re)move comments that are misplaced or no longer relevant.
18698
1e49bfab
LMI
186992011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18700
18701 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18702
1485f4c0
CY
187032011-07-03 Chong Yidong <cyd@stupidchicken.com>
18704
18705 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18706 and background color parameters if they have been changed.
18707
a9ab721e
LMI
187082011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18709
18710 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18711
cf7cff57
PE
187122011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18713
2e13213d
PE
18714 * xsettings.c (SYSTEM_FONT): Define only when used.
18715 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18716
cf7cff57
PE
18717 * keymap.c (access_keymap_1): Now static.
18718
7a8e04f7
CY
187192011-07-02 Chong Yidong <cyd@stupidchicken.com>
18720
18721 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18722 leave any prefix arg for the up event (Bug#1586).
18723
61352f62
LMI
187242011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18725
69bb1ef7
LMI
18726 * lread.c (syms_of_lread): Mention single symbols defined by
18727 `defvar' or `defconst' (bug#7154).
18728
61352f62 18729 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18730 (Frequire): Mention get-load-suffixes.
61352f62 18731
28545e04
MR
187322011-07-02 Martin Rudalics <rudalics@gmx.at>
18733
18734 * window.h (window): Remove clone_number slot.
18735 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18736 Remove.
18737 (make_parent_window, make_window, saved_window)
18738 (Fset_window_configuration, save_window_save): Don't deal with
18739 clone numbers.
18740 * buffer.c (Qclone_number): Remove declaration.
18741 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18742
3349e122
SM
187432011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18744
18745 Add multiple inheritance to keymaps.
18746 * keymap.c (Fmake_composed_keymap): New function.
18747 (Fset_keymap_parent): Simplify.
18748 (fix_submap_inheritance): Remove.
18749 (access_keymap_1): New function extracted from access_keymap to handle
18750 embedded parents and handle lists of maps.
18751 (access_keymap): Use it.
18752 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18753 (Fcopy_keymap): Handle embedded parents.
18754 (Fcommand_remapping, define_as_prefix): Simplify.
18755 (Fkey_binding): Simplify.
18756 (syms_of_keymap): Move minibuffer-local-completion-map,
18757 minibuffer-local-filename-completion-map,
18758 minibuffer-local-must-match-map, and
18759 minibuffer-local-filename-must-match-map to Elisp.
18760 (syms_of_keymap): Defsubr make-composed-keymap.
18761 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18762 (parse_menu_item): Trivial simplification.
18763
3279eb87
GM
187642011-07-01 Glenn Morris <rgm@gnu.org>
18765
18766 * Makefile.in (SETTINGS_LIBS): Fix typo.
18767
39cb9e56 187682011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18769
18770 * coding.c (Fencode_coding_string): Record the last coding system
18771 used, as the function doc string says (bug#8738).
18772
0949d2b6
JD
187732011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18774
18775 * xsettings.c (store_monospaced_changed): Take new font as arg and
18776 check for change against current_mono_font.
18777 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18778 (emacs_settings_constructor, emacs_settings_get_property)
18779 (emacs_settings_set_property, emacs_settings_class_init)
18780 (emacs_settings_init, gsettings_obj): Remove.
18781 (something_changedCB): New function for HAVE_GSETTINGS.
18782 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18783 with value as argument.
18784 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18785 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18786 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18787 "changed".
18788
18789 * xgselect.c: Add defined (HAVE_GSETTINGS).
18790 (xgselect_initialize): Ditto.
18791
18792 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18793 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18794 xg_select.
18795
bbc6b304
PE
187962011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18797
18798 * eval.c (struct backtrace): Simplify and port the data structure.
18799 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18800 signed bit field, as this assumption is not portable and it makes
18801 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18802 "char debug_on_exit : 1" as this is not portable either; instead,
18803 use the portable "unsigned int debug_on_exit : 1". Remove unused
18804 member evalargs. Remove obsolete comments about cc bombing out.
18805
9851bfc5
JD
188062011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18807
51bb811f 18808 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18809 Let HAVE_GSETTINGS override HAVE_GCONF.
18810 (store_monospaced_changed): New function.
18811 (EMACS_SETTINGS): A new type derived from GObject to handle
18812 GSettings notifications.
18813 (emacs_settings_constructor, emacs_settings_get_property)
18814 (emacs_settings_set_property, emacs_settings_class_init):
18815 New functions.
18816 (gsettings_client, gsettings_obj): New variables.
18817 (GSETTINGS_SCHEMA): New define.
18818 (something_changedCB): Call store_monospaced_changed.
18819 (init_gsettings): New function.
18820 (xsettings_initialize): Call init_gsettings.
18821 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18822 to NULL.
18823
640c8776 18824 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18825 GCONF_CFLAGS/LIBS.
18826
5386012d
MR
188272011-06-29 Martin Rudalics <rudalics@gmx.at>
18828
18829 * window.c (resize_root_window, grow_mini_window)
18830 (shrink_mini_window): Rename Qresize_root_window to
18831 Qwindow_resize_root_window and Qresize_root_window_vertically to
18832 Qwindow_resize_root_window_vertically.
18833
f13e0b08
PE
188342011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18835
18836 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18837
94515237
JB
188382011-06-27 Juanma Barranquero <lekktu@gmail.com>
18839
18840 * makefile.w32-in: Redesign dependencies so they reflect more
18841 clearly which files are directly included by each source file,
18842 and not through other includes.
18843
e43b6e43
MR
188442011-06-27 Martin Rudalics <rudalics@gmx.at>
18845
18846 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18847 (sort_overlays, overlay_strings): When an overlay's clone number
18848 matches the window's clone number process the overlay even if
18849 the overlay's window property doesn't match the current window.
18850
d68443dc
MR
18851 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18852 (Fwindow_hchild): Rename to Fwindow_left_child.
18853 (Fwindow_next): Rename to Fwindow_next_sibling.
18854 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18855 (resize_window_check): Rename to window_resize_check.
18856 (resize_window_apply): Rename to window_resize_apply.
18857 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18858 (Fdelete_other_windows_internal, resize_frame_windows)
18859 (Fsplit_window_internal, Fdelete_window_internal)
18860 (grow_mini_window, shrink_mini_window)
18861 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18862
c7e73be5
JD
188632011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18864
18865 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18866 (emacs_fixed_set_min_size): Remove.
18867 (emacs_fixed_new): Take frame as argument.
18868
18869 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18870 (_EmacsFixedPrivate): Remove minwidth/height.
18871 Add struct frame *f.
18872 (emacs_fixed_init): Initialize priv->f.
18873 (get_parent_class, emacs_fixed_set_min_size): Remove.
18874 (emacs_fixed_new): Set priv->f to argument.
18875 (emacs_fixed_get_preferred_width)
18876 (emacs_fixed_get_preferred_height): Use min_width/height from
18877 frames size_hint to set minimum and natural (Bug#8919).
18878 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18879 and use min_width/height from frames size_hint to set
18880 min_width/height (Bug#8919).
18881
18882 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18883 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18884 Fix indentation.
c7e73be5 18885
cf99dcf8
EZ
188862011-06-26 Eli Zaretskii <eliz@gnu.org>
18887
18888 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18889 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18890 called at ZV.
18891
029529ac
CY
188922011-06-26 Chong Yidong <cyd@stupidchicken.com>
18893
18894 * process.c (wait_reading_process_output): Bypass select if
18895 waiting for a cell while ignoring keyboard input, and input is
18896 pending. Suggested by Jan Djärv (Bug#8869).
18897
7a7ef429
PE
188982011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18899
18900 Use gnulib's dup2 module instead of rolling our own.
18901 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18902
11fdef7d 189032011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18904
18905 * dispnew.c (scrolling_window): Before scrolling, turn off a
18906 mouse-highlight in the window being scrolled.
18907
cd3520a4
JB
189082011-06-24 Juanma Barranquero <lekktu@gmail.com>
18909
18910 Move DEFSYM to lisp.h and use everywhere.
18911
18912 * character.h (DEFSYM): Move declaration...
18913 * lisp.h (DEFSYM): ...here.
18914
18915 * gnutls.c:
18916 * minibuf.c:
18917 * w32menu.c:
18918 * w32proc.c:
18919 * w32select.c: Don't include character.h.
18920
18921 * alloc.c (syms_of_alloc):
18922 * buffer.c (syms_of_buffer):
18923 * bytecode.c (syms_of_bytecode):
18924 * callint.c (syms_of_callint):
18925 * casefiddle.c (syms_of_casefiddle):
18926 * casetab.c (init_casetab_once):
18927 * category.c (init_category_once, syms_of_category):
18928 * ccl.c (syms_of_ccl):
18929 * cmds.c (syms_of_cmds):
18930 * composite.c (syms_of_composite):
18931 * dbusbind.c (syms_of_dbusbind):
18932 * dired.c (syms_of_dired):
18933 * dispnew.c (syms_of_display):
18934 * doc.c (syms_of_doc):
18935 * editfns.c (syms_of_editfns):
18936 * emacs.c (syms_of_emacs):
18937 * eval.c (syms_of_eval):
18938 * fileio.c (syms_of_fileio):
18939 * fns.c (syms_of_fns):
18940 * frame.c (syms_of_frame):
18941 * fringe.c (syms_of_fringe):
18942 * insdel.c (syms_of_insdel):
18943 * keymap.c (syms_of_keymap):
18944 * lread.c (init_obarray, syms_of_lread):
18945 * macros.c (syms_of_macros):
18946 * msdos.c (syms_of_msdos):
18947 * print.c (syms_of_print):
18948 * process.c (syms_of_process):
18949 * search.c (syms_of_search):
18950 * sound.c (syms_of_sound):
18951 * syntax.c (init_syntax_once, syms_of_syntax):
18952 * terminal.c (syms_of_terminal):
18953 * textprop.c (syms_of_textprop):
18954 * undo.c (syms_of_undo):
18955 * w32.c (globals_of_w32):
18956 * window.c (syms_of_window):
18957 * xdisp.c (syms_of_xdisp):
18958 * xfaces.c (syms_of_xfaces):
18959 * xfns.c (syms_of_xfns):
18960 * xmenu.c (syms_of_xmenu):
18961 * xsettings.c (syms_of_xsettings):
18962 * xterm.c (syms_of_xterm): Use DEFSYM.
18963
4228cf16
TZ
189642011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18965
cd3520a4 18966 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18967
7fcccf1e
PE
189682011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18969
7efb4e0e
PE
18970 Integer and buffer overflow fixes (Bug#8873).
18971
ff5844ad
PE
18972 * print.c (printchar, strout): Check for string overflow.
18973 (PRINTPREPARE, printchar, strout):
18974 Don't set size unless allocation succeeds.
18975
90532f02
PE
18976 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18977 for sizes. Check for string overflow more accurately.
18978 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18979
6d84508d
PE
18980 * macros.c: Integer and buffer overflow fixes.
18981 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18982 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18983 Use ptrdiff_t, not int, for sizes.
18984 Don't increment bufsize until after realloc succeeds.
18985 Check for size-calculation overflow.
18986 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18987
437b2cb4
PE
18988 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18989
8b9ac8b4
PE
18990 * lread.c: Integer overflow fixes.
18991 (read_integer): Radix is now EMACS_INT, not int,
18992 to improve quality of diagnostics for out-of-range radices.
18993 Calculate buffer size correctly for out-of-range radices.
18994 (read1): Check for integer overflow in radices, and in
18995 read-circle numbers.
82cb60d3
PE
18996 (read_escape): Avoid int overflow.
18997 (Fload, openp, read_buffer_size, read1)
18998 (substitute_object_recurse, read_vector, read_list, map_obarray):
18999 Use ptrdiff_t, not int, for sizes.
19000 (read1): Use EMACS_INT, not int, for sizes.
20270765 19001 Check for size overflow.
8b9ac8b4 19002
7fcccf1e
PE
19003 * image.c (cache_image): Check for size arithmetic overflow.
19004
bfbbd7e7
PE
19005 * lread.c: Integer overflow issues.
19006 (saved_doc_string_size, saved_doc_string_length)
19007 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19008 Now ptrdiff_t, not int.
19009 (read1): Don't assume doc string length fits in int. Check for
19010 out-of-range doc string lengths.
19011 (read_list): Don't assume file position fits in int.
39019e54 19012 (read_escape): Check for hex character overflow.
bfbbd7e7 19013
4e323265
LL
190142011-06-22 Leo Liu <sdl.web@gmail.com>
19015
19016 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19017 Move to minibuffer.el.
19018
85fece3e
PE
190192011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19020
20b84ce9 19021 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
19022 The following patches are for when GLYPH_DEBUG && !XASSERT.
19023 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19024 * dispnew.c (flush_stdout):
19025 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19026 Mark as externally visible.
19027 * dispnew.c (check_window_matrix_pointers): Now static.
19028 * dispnew.c (window_to_frame_vpos):
19029 * xfns.c (unwind_create_frame):
19030 * xterm.c (x_check_font): Remove unused local.
19031 * scroll.c (CHECK_BOUNDS):
19032 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19033 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19034 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19035 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19036 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19037 Now static.
19038 (debug_method_add): Use va_list and vsprintf rather than relying
19039 on undefined behavior with wrong number of arguments.
19040 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19041 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19042 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19043 since we're not interested in debugging glyphs with old libraries.
19044 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19045 GCC 4.6.0's static checking.
19046
0766b489
PE
190472011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19048
31fd4b32
PE
19049 Integer overflow and signedness fixes (Bug#8873).
19050 A few related buffer overrun fixes, too.
19051
b79e8648
PE
19052 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19053
0766b489
PE
19054 * dispextern.h (struct face.stipple):
19055 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19056 (x_bitmap_mask, x_allocate_bitmap_record)
19057 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19058 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19059 (x_create_bitmap_from_xpm_data):
19060 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19061 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19062 (.bitmaps_last):
19063 * xfaces.c (load_pixmap):
19064 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19065 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19066 (.bitmaps_last, struct x_output.icon_bitmap):
19067 Use ptrdiff_t, not int, for bitmap indexes.
19068 (x_allocate_bitmap_record): Check for size overflow.
19069 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19070
b081724f
PE
19071 Use ptrdiff_t, not int, for overlay counts.
19072 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19073 * editfns.c (overlays_around, get_pos_property):
19074 * textprop.c (get_char_property_and_overlay):
19075 * xdisp.c (next_overlay_change, note_mouse_highlight):
19076 * xfaces.c (face_at_buffer_position):
21514da7
PE
19077 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19078 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19079 (Fnext_overlay_change, Fprevious_overlay_change)
19080 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 19081 Use ptrdiff_t, not int, for sizes.
21514da7 19082 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 19083
3de73e5e
PE
19084 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19085
2606c57b
PE
19086 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19087 (x_session_initialize): Do not assume string length fits in int.
19088
aaafe47a
PE
19089 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19090 This is unlikely, but can occur if DPI is outlandish.
19091
2674ddc8 19092 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
19093 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19094
28154962
PE
19095 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19096 * xrdb.c (magic_file_p, search_magic_path):
19097 Omit last arg SUFFIX; it was always 0. All callers changed.
19098 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19099
7de51af5
PE
19100 * xfont.c (xfont_match): Avoid need for strlen.
19101
25ed6cc3
PE
19102 * xfns.c: Don't assume strlen fits in int.
19103 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19104
4eab31dd
PE
19105 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19106 not unsigned long, as we prefer signed integers. All callers changed.
19107 Detect integer overflow in repeat count.
19108 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 19109 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 19110
171e2a58
PE
19111 * termcap.c: Don't assume sizes fit in int and never overflow.
19112 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19113 (gobble_line): Check for size-calculation overflow.
19114
ad39faca 19115 * minibuf.c (Fread_buffer):
6e5bb2dc 19116 * lread.c (intern, intern_c_string):
74ca2eb3
PE
19117 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19118 Don't assume string length fits in int.
19119
52c61c22 19120 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
19121 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19122
b5b8c9e5
PE
19123 * font.c: Don't assume string length fits in int.
19124 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19125 Use ptrdiff_t, not int.
ccd6111c
PE
19126 (font_intern_prop): Don't assume string length fits in int.
19127 Don't assume integer property fits in fixnum.
19128 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 19129
882f0d81 19130 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 19131 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
19132 Reformulate so as not to need the command string.
19133 Invoke gzip -cd rather than gunzip, as it's more portable.
19134 (lock_info_type, lock_file_1, lock_file):
19135 Don't assume pid_t and time_t fit in unsigned long.
19136 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19137 (current_lock_owner): Prefer signed type for sizes.
19138 Use memcpy, not strncpy, where memcpy is what is really wanted.
19139 Don't assume (via atoi) that time_t and pid_t fit in int.
19140 Check for time_t and/or pid_t out of range, e.g., via a network share.
19141 Don't alloca where an auto var works fine.
19142
93f4cf88
PE
19143 * fileio.c: Fix some integer overflow issues.
19144 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19145 Don't assume string length fits in int.
19146 (directory_file_name): Don't assume string length fits in long.
19147 (make_temp_name): Don't assume pid fits in int, or that its print
19148 length is less than 20.
19149
f3e92b69
PE
19150 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19151
1bfdaf10
PE
19152 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19153
35016e9a
PE
19154 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19155
3d1e65a1
PE
19156 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19157 We prefer signed integers, even for size calculations.
19158
0b963a93
PE
19159 * emacs.c: Don't assume string length fits in 'int'.
19160 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19161 (main): Don't invoke strlen when not needed.
19162
573f4b54
PE
19163 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19164 (XD_DEBUG_MESSAGE): Don't waste a byte.
19165
989f33ba
PE
19166 * callproc.c (getenv_internal_1, getenv_internal)
19167 (Fgetenv_internal):
965d34eb
PE
19168 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19169
e4d29b33
PE
19170 * lread.c (invalid_syntax): Omit length argument.
19171 All uses changed. This doesn't fix a bug, but it simplifies the
19172 code away from its former Hollerith-constant appearance, and it's
19173 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19174 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19175
eb49b136
PE
19176 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19177 This didn't break anything, but it didn't help either.
19178 It's confusing to put a bogus integer in a place where the actual
19179 value does not matter.
9f62aeb1 19180 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19181 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19182
15375a22
PE
19183 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19184 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19185 implementation.
b61cc01c
PE
19186 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19187 We prefer signed types, and the value cannot exceed the EMACS_INT
19188 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19189 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19190 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19191 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19192
53b2623d
PE
19193 * indent.c (sane_tab_width): New function.
19194 (current_column, scan_for_column, Findent_to, position_indentation)
19195 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19196 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19197
51cab52b 19198 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19199
f2ed8a70
PE
19200 * lisp.h (lint_assume): New macro.
19201 * composite.c (composition_gstring_put_cache):
19202 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19203
abe80cc6
PE
19204 * editfns.c, insdel.c:
19205 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19206
b02c740e
PE
19207 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19208
ebc96716
PE
19209 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19210
b4e50fa0 19211 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19212 Use much-faster test for byte-length change.
311d5d7c 19213 Don't assume string byte-length fits in 'int'.
a4cf38e4 19214 Check that character arg fits in 'int'.
85461888 19215 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19216
c0c1ee9f
PE
19217 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19218
a498d7f4
PE
19219 * fns.c (concat): Catch string overflow earlier.
19220 Do not rely on integer wraparound.
19221
51cab52b
PE
19222 * dispextern.h (struct it.overlay_strings_charpos)
19223 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19224 * xdisp.c (forward_to_next_line_start)
19225 (back_to_previous_visible_line_start)
19226 (reseat_at_next_visible_line_start, next_element_from_buffer):
19227 Don't arbitrarily truncate the value of 'selective' to int.
19228
76031fad
PE
19229 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19230
5eb55db9
PE
19231 * composite.c: Don't truncate sizes to 'int'.
19232 (composition_gstring_p, composition_reseat_it)
19233 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19234 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19235 not EMACS_UINT, for indexes.
5eb55db9 19236
0703a717
PE
19237 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19238
d6202519
PE
19239 * buffer.c: Include <verify.h>.
19240 (struct sortvec.priority, struct sortstr.priority):
8961a454 19241 Now EMACS_INT, not int.
c20998a7 19242 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19243 (struct sortstr.size, record_overlay_string)
19244 (struct sortstrlist.size, struct sortlist.used):
19245 Don't truncate size to int.
19246 (record_overlay_string): Check for size-calculation overflow.
d6202519 19247 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19248
d5a19415
JM
192492011-06-22 Jim Meyering <meyering@redhat.com>
19250
029529ac 19251 Don't leak an XBM-image-sized buffer
d5a19415
JM
19252 * image.c (xbm_load): Free the image buffer after using it.
19253
a9041e6c
PE
192542011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19255
19256 Port to Sun C.
19257 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19258 that Sun C diagnosed.
19259 * fns.c (secure_hash): Fix pointer signedness issue.
19260 * intervals.c (static_offset_intervals): New function.
19261 (offset_intervals): Use it.
19262
7f3f739f
LL
192632011-06-21 Leo Liu <sdl.web@gmail.com>
19264
19265 * deps.mk (fns.o):
19266 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19267 sha512.h.
19268
19269 * fns.c (secure_hash): Rename from crypto_hash_function and change
19270 the first arg to accept symbols.
5b66d427 19271 (Fsecure_hash): New primitive.
7f3f739f
LL
19272 (syms_of_fns): New symbols.
19273
76147d94
DD
192742011-06-20 Deniz Dogan <deniz@dogan.se>
19275
19276 * process.c (Fset_process_buffer): Clarify return value in
19277 docstring.
19278
7d7d0045
CY
192792011-06-18 Chong Yidong <cyd@stupidchicken.com>
19280
19281 * dispnew.c (add_window_display_history): Use BVAR.
19282
19283 * xdisp.c (debug_method_add): Use BVAR.
19284 (check_window_end, dump_glyph_matrix, dump_glyph)
19285 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19286
19287 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19288 Likewise.
19289
19290 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19291 check till after the cache is created in init_frame_faces.
19292
ff2bc410
SM
192932011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19294
19295 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19296
28177add
PE
192972011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19298
dd3482fe
PE
19299 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19300 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19301 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19302
393d71f3 19303 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19304 * fileio.c (Finsert_file_contents):
19305 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19306 Remove the old (too-loose) buffer overflow checks.
19307 They weren't needed, since make_gap checks for buffer overflow.
19308 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19309 The old code merely checked for Emacs fixnum overflow, and relied
19310 on undefined (wraparound) behavior. The new code avoids undefined
19311 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19312
2e6813b0 19313 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19314 Tune. Don't use wider integers than needed. Don't use alloca.
19315 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19316
599a9e4f
PE
19317 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19318
99561444
PE
19319 * insdel.c, lisp.h (buffer_overflow): New function.
19320 (insert_from_buffer_1, replace_range, replace_range_2):
19321 * insdel.c (make_gap_larger):
19322 * editfns.c (Finsert_char):
19323 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19324
28177add
PE
19325 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19326
e69dafad
PE
193272011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19328
4baa020d 19329 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19330
b1c46f02
PE
19331 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19332 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19333
e69dafad
PE
19334 * fileio.c: Don't assume EMACS_INT fits in off_t.
19335 (emacs_lseek): New static function.
19336 (Finsert_file_contents, Fwrite_region): Use it.
19337 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19338
566684ea
PE
19339 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19340
e6966cd6
PE
19341 * fns.c: Don't overflow int when computing a list length.
19342 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19343 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19344 truncation on 64-bit hosts. Check for QUIT every
19345 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19346 faster and is responsive enough.
19347 (Flength): Report an error instead of overflowing an integer.
19348 (Fsafe_length): Return a float if the value is not representable
19349 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19350 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19351 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19352
dd0b0efb
PE
19353 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19354 (header_size, word_size): New constants.
19355 (allocate_vectorlike): Don't check size overflow here.
19356 (allocate_vector): Check it here instead, since this is the only
19357 caller of allocate_vectorlike that could cause overflow.
19358 Check that the new vector's length is representable as a fixnum.
19359
86fe5cfe
PE
19360 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19361 The previous code was bogus. For example, next_almost_prime (32)
19362 returned 39, which is undesirable as it is a multiple of 3; and
19363 next_almost_prime (24) returned 25, which is a multiple of 5 so
19364 why was the code bothering to check for multiples of 7?
19365
80e88859
PE
19366 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19367
4a2f0ad6
PE
19368 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19369
f66c7cf8
PE
19370 Variadic C functions now count arguments with ptrdiff_t.
19371 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19372 Back then I didn't know that the Emacs coding style prefers signed int.
19373 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19374 were being counted with int, which may truncate counts on 64-bit
19375 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19376 * lisp.h (struct Lisp_Subr.function.aMANY)
19377 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19378 Arg counts are now ptrdiff_t, not size_t.
19379 All variadic functions and their callers changed accordingly.
19380 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19381 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19382 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19383 * callint.c (Fcall_interactively): Check arg count for overflow,
19384 to avoid potential buffer overrun. Use signed char, not 'int',
19385 for 'varies' array, so that we needn't bother to check its size
19386 calculation for overflow.
19387 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19388 * eval.c (apply_lambda):
19389 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19390 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19391 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19392
a1759b76
PE
19393 * callint.c (Fcall_interactively): Don't use index var as event count.
19394
d96be9fc
PE
19395 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19396 * mem-limits.h (SIZE): Remove; no longer used.
19397
a690a978 19398 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19399
578c21e6
PE
19400 Remove unnecessary casts.
19401 * xterm.c (x_term_init):
19402 * xfns.c (x_set_border_pixel):
19403 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19404 These aren't needed now that we assume ANSI C.
19405
96f53c6c
PE
19406 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19407 It's more likely to cause problems (due to unsigned overflow)
19408 than to cure them.
19409
83c77d31
PE
19410 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19411
ee2079f1
PE
19412 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19413
6da65536
PE
19414 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19415
7147c4a4
PE
19416 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19417
193e32d9
PE
19418 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19419
e5533da6
PE
19420 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19421
9910e595
PE
19422 GLYPH_CODE_FACE returns EMACS_INT, not int.
19423 * dispextern.h (merge_faces):
19424 * xfaces.c (merge_faces):
01103c44
PE
19425 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19426 Don't assume EMACS_INT fits in int.
9910e595 19427
2638320e
PE
19428 * character.h (CHAR_VALID_P): Remove unused parameter.
19429 * fontset.c, lisp.h, xdisp.c: All uses changed.
19430
045eb8d9
PE
19431 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19432
c1f134b5
PE
19433 * fns.c (concat): Minor tuning based on overflow analysis.
19434 This doesn't fix any bugs. Use int to hold character, instead
19435 of constantly refetching from Emacs object. Use XFASTINT, not
19436 XINT, for value known to be a character. Don't bother comparing
19437 a single byte to 0400, as it's always less.
19438
395fcb93 19439 * floatfns.c (Fexpt):
327eeec8
PE
19440 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19441
abbd3d23
PE
19442 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19443 for characters.
19444
684a03ef
PE
19445 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19446
0fed43f3
PE
19447 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19448 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19449 incorrectly succeed when S was a string, because 4294967386 was
19450 truncated before it was used.
19451
8fd02eb7
PE
19452 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19453 Otherwise, an out-of-range integer could cause undefined behavior
19454 on a 64-bit host.
19455
f8c86b69
PE
19456 * composite.c: Use int, not EMACS_INT, for characters.
19457 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19458 EMACS_INT, for values that are known to be in character range.
19459 This doesn't fix any bugs but is the usual style inside Emacs and
19460 may generate better code on 32-bit machines.
19461
34206dd2
PE
19462 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19463 This is for reasons similar to the recent CHAR_STRING fix.
19464 * charset.c (Fencode_char): Check that character arg is actually
19465 a character. Pass an int to ENCODE_CHAR.
19466 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19467 wider than 'int', as a compile-time check to prevent future regressions
19468 in this area.
19469
c5958d4c 19470 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19471
19472 Make sure a 64-bit char is never passed to CHAR_STRING.
19473 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19474 by silently ignoring the top 32 bits, allowing some values
19475 that were far too large to be valid characters.
19476 * character.h: Include <verify.h>.
19477 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19478 arguments are no wider than unsigned, as a compile-time check
19479 to prevent future regressions in this area.
19480 * data.c (Faset):
01103c44 19481 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19482 (Fsubst_char_in_region):
19483 * fns.c (concat):
19484 * xdisp.c (decode_mode_spec_coding):
19485 Adjust to CHAR_STRING's new requirement.
19486 * editfns.c (Finsert_char, Fsubst_char_in_region):
19487 * fns.c (concat): Check that character args are actually
19488 characters. Without this test, these functions did the wrong
19489 thing with wildly out-of-range values on 64-bit hosts.
19490
d37ca623
PE
19491 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19492 These casts should not be needed on 32-bit hosts, either.
19493 * keyboard.c (read_char):
19494 * lread.c (Fload): Remove casts to unsigned.
19495
ea204efb
PE
19496 * lisp.h (UNSIGNED_CMP): New macro.
19497 This fixes comparison bugs on 64-bit hosts.
19498 (ASCII_CHAR_P): Use it.
19499 * casefiddle.c (casify_object):
01103c44 19500 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19501 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19502 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19503 * dispextern.h (FACE_FROM_ID):
19504 * keyboard.c (read_char): Use UNSIGNED_CMP.
19505
41cb286c
PE
19506 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19507 not to EMACS_INT, to avoid GCC warning.
19508
4a1b9832
PE
19509 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19510
55daad71
PE
19511 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19512 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19513 isn't needed on 32-bit machines.
8f95c75c 19514
01103c44
PE
19515 * buffer.c (Fgenerate_new_buffer_name):
19516 Use EMACS_INT for count, not int.
0ceccced 19517 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19518
19519 * data.c (Qcompiled_function): Now static.
19520
c6f072e7
PE
19521 * window.c (window_body_lines): Now static.
19522
20ce5912
PE
19523 * image.c (gif_load): Rename local to avoid shadowing.
19524
9c4c5f81
PE
19525 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19526 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19527 * alloc.c (make_save_value): Integer argument is now of type
19528 ptrdiff_t, not int.
19529 (mark_object): Use ptrdiff_t, not int.
19530 * lisp.h (pD): New macro.
19531 * print.c (print_object): Use it.
19532
c0c5c8ae
PE
19533 * alloc.c: Use EMACS_INT, not int, to count objects.
19534 (total_conses, total_markers, total_symbols, total_vector_size)
19535 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19536 (total_free_floats, total_floats, total_free_intervals)
19537 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19538 Now EMACS_INT, not int. All uses changed.
19539 (Fgarbage_collect): Compute overall total using a double, so that
19540 integer overflow is less likely to be a problem. Check for overflow
19541 when converting back to an integer.
5a25e253
PE
19542 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19543 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19544 These were 'int' variables that could overflow on 64-bit hosts;
19545 they were never used, so remove them instead of repairing them.
211a0b2a 19546 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19547 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19548 Previously, this ceilinged at INT_MAX, but that doesn't work on
19549 64-bit machines.
e46bb31a 19550 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19551
c78baabf 19552 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19553 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19554 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19555 when a (possibly-narrower) signed value would do just as well.
19556 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19557
c9d624c6
PE
19558 * alloc.c: Catch some string size overflows that we were missing.
19559 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19560 for convenience in STRING_BYTES_MAX.
19561 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19562 The definition here is exact; the one in lisp.h was approximate.
19563 (allocate_string_data): Check for string overflow. This catches
19564 some instances we weren't catching before. Also, it catches
19565 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19566 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19567 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19568
c9d624c6
PE
19569 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19570 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19571 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19572
353032ce
PE
19573 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19574
2bccce07
PE
19575 * alloc.c (Fmake_string): Check for out-of-range init.
19576
0ac30604
SM
195772011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19578
19579 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19580
c195f2de
JD
195812011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19582
19583 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19584 xg_get_default_scrollbar_width.
19585
19586 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19587 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19588 (style_changed_cb): Call update_theme_scrollbar_width and call
19589 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19590 all frames (Bug#8505).
19591 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19592 Call gtk_window_set_resizable if HAVE_GTK3.
19593 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19594 and height if HAVE_GTK3 (Bug#8505).
19595 (scroll_bar_width_for_theme): New variable.
19596 (update_theme_scrollbar_width): New function.
19597 (xg_get_default_scrollbar_width): Move code to
19598 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19599 (xg_initialize): Call update_theme_scrollbar_width.
19600
19601 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19602
19603 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19604
e10ac9f1
MR
196052011-06-12 Martin Rudalics <rudalics@gmx.at>
19606
19607 * frame.c (make_frame): Call other_buffer_safely instead of
19608 other_buffer.
19609
19610 * window.c (temp_output_buffer_show): Call display_buffer with
19611 second argument Vtemp_buffer_show_specifiers and reset latter
19612 immediately after the call.
19613 (Vtemp_buffer_show_specifiers): New variable.
19614 (auto_window_vscroll_p, next_screen_context_lines)
19615 (Vscroll_preserve_screen_position): Remove leading asterisks from
19616 doc-strings.
19617
2d3c217e 196182011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19619
7b7f97e8 19620 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19621 * buffer.c (Qclone_number): Remove for now, as it's unused.
19622 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19623 (record_buffer): Remove unused local.
19624 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19625 (set_frame_buffer_list): Remove; unused.
19626 * frame.h (other_visible_frames): Remove decl.
19627 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19628 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19629 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19630 if HAVE_GPM.
19631 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19632 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19633 Define only if HAVE_GPM.
19634 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19635 (update_hints_inhibit): Remove; never set. All uses removed.
19636 * widgetprv.h (emacsFrameClassRec): Remove decl.
19637 * window.c (delete_deletable_window): Now returns void, since it
19638 wasn't returning anything.
19639 (compare_window_configurations): Remove unused locals.
19640 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19641 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19642 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19643 the same widths as pointers. This follows up on the 2011-05-06 patch.
19644 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19645 * xterm.h: Likewise.
19646 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19647
1384b89e
JB
196482011-06-12 Juanma Barranquero <lekktu@gmail.com>
19649
19650 * makefile.w32-in: Update dependencies.
19651 (LISP_H): Add lib/intprops.h.
19652
1100a63c
CY
196532011-06-11 Chong Yidong <cyd@stupidchicken.com>
19654
19655 * image.c (gif_load): Add animation frame delay to the metadata.
19656 (syms_of_image): Use DEFSYM. New symbol `delay'.
19657
6198ccd0
MR
196582011-06-11 Martin Rudalics <rudalics@gmx.at>
19659
19660 * window.c (delete_deletable_window): Re-add.
19661 (Fset_window_configuration): Rewrite to handle dead buffers and
19662 consequently deletable windows.
19663 (window_tree, Fwindow_tree): Remove. Supply functionality in
19664 window.el.
19665 (compare_window_configurations): Simplify code.
19666
b6e3633c
AS
196672011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19668
1ab0dee5
AS
19669 * image.c (imagemagick_load_image): Fix type mismatch.
19670 (Fimagemagick_types): Likewise.
19671
b6e3633c
AS
19672 * window.h (replace_buffer_in_windows): Declare.
19673
9397e56f
MR
196742011-06-11 Martin Rudalics <rudalics@gmx.at>
19675
19676 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19677 Qclone_number. Remove external declaration of Qdelete_window.
19678 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19679 code.
640c8776
SM
19680 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19681 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19682 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19683 buffer list implementation.
19684 (other_buffer_safely): New function.
19685 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19686 calls to replace_buffer_in_windows and
19687 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19688 if allowed.
19689 (record_buffer): Inhibit quitting and rewrite using quittable
19690 functions. Run Qbuffer_list_update_hook if allowed.
19691 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19692 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19693 Move switch-to-buffer to window.el.
9397e56f
MR
19694 (bury-buffer): Move to window.el.
19695 (Vbuffer_list_update_hook): New variable.
19696
19697 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19698 section.
19699
19700 * window.h (resize_frame_windows): Move up in code.
19701 (Fwindow_frame): Remove EXFUN.
19702 (replace_buffer_in_all_windows): Remove prototype.
19703 (replace_buffer_in_windows_safely): Add prototype.
19704
19705 * window.c: Declare Qdelete_window static again. Move down
19706 declaration of select_count.
19707 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19708 (Fother_window): Move to window.el.
19709 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19710 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19711 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19712 window.el.
19713 (replace_buffer_in_windows): Implement by calling
19714 Qreplace_buffer_in_windows.
19715 (replace_buffer_in_all_windows): Remove with some functionality
19716 moved into replace_buffer_in_windows_safely.
19717 (replace_buffer_in_windows_safely): New function.
19718 (select_window_norecord, select_frame_norecord): Move in front
19719 of run_window_configuration_change_hook. Remove now obsolete
19720 declarations.
640c8776
SM
19721 (Fset_window_buffer): Rewrite doc-string.
19722 Call Qrecord_window_buffer.
9397e56f
MR
19723 (keys_of_window): Move binding for other-window to window.el.
19724
b50691aa
CY
197252011-06-11 Chong Yidong <cyd@stupidchicken.com>
19726
19727 * dispextern.h (struct image): Replace data member, whose int_val
19728 and ptr_val fields were not used by anything, with a single
19729 lisp_val object.
19730
19731 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19732 (gif_clear_image, gif_load, imagemagick_load_image)
19733 (gs_clear_image, gs_load): Callers changed.
19734
3f754b86
PE
197352011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19736
cca69397
PE
19737 * buffer.h: Include <time.h>, for time_t.
19738 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19739
109e28d0
PE
19740 Fix minor problems found by static checking.
19741
60737f02
PE
19742 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19743
4b66faf3
PE
19744 Make identifiers static if they are not used in other modules.
19745 * data.c (Qcompiled_function, Qframe, Qvector):
19746 * image.c (QimageMagick, Qsvg):
19747 * minibuf.c (Qmetadata):
19748 * window.c (resize_window_check, resize_root_window): Now static.
19749 * window.h (resize_window_check, resize_root_window): Remove decls.
19750
109e28d0
PE
19751 * window.c (window_deletion_count, delete_deletable_window):
19752 Remove; unused.
46a4ce9e
PE
19753 (window_body_lines): Now static.
19754 (Fdelete_other_windows_internal): Mark vars as initialized.
19755 Make sure 'resize_failed' is initialized.
19756 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19757 (resize_window_apply): Remove unused local.
19758 * window.h (delete_deletable_window): Remove decl.
19759
109e28d0 19760 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19761 (imagemagick_load_image): Fix pointer signedness problem by changing
19762 last arg from unsigned char * to char *. All uses changed.
19763 Also, fix a local for similar reasons.
19764 Remove unused locals. Remove locals to avoid shadowing.
19765 (fn_rsvg_handle_free): Remove; unused.
19766 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19767 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19768
3f754b86
PE
19769 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19770
2547adb1
CY
197712011-06-10 Chong Yidong <cyd@stupidchicken.com>
19772
19773 * image.c (gif_load): Fix omitted cast error introduced by
19774 2011-06-06 change.
19775
2c8e37d4
MR
197762011-06-10 Martin Rudalics <rudalics@gmx.at>
19777
19778 * window.h (resize_proportionally, orig_total_lines)
19779 (orig_top_line): Remove from window structure.
19780 (set_window_height, set_window_width, change_window_heights)
19781 (Fdelete_window): Remove prototypes.
19782 (resize_frame_windows): Remove duplicate declaration.
19783
440a42e3
EZ
197842011-06-10 Eli Zaretskii <eliz@gnu.org>
19785
19786 * window.h (resize_frame_windows, resize_window_check)
19787 (delete_deletable_window, resize_root_window)
19788 (resize_frame_windows): Declare prototypes.
19789
19790 * window.c (resize_window_apply): Make definition be "static" to
19791 match the prototype.
19792
562dd5e9
MR
197932011-06-10 Martin Rudalics <rudalics@gmx.at>
19794
19795 * window.c: Remove declarations of Qwindow_size_fixed,
19796 window_min_size_1, window_min_size_2, window_min_size,
19797 size_window, window_fixed_size_p, enlarge_window, delete_window.
19798 Remove static from declaration of Qdelete_window, it's
19799 temporarily needed by Fbury_buffer.
19800 (replace_window): Don't assign orig_top_line and
19801 orig_total_lines.
19802 (Fdelete_window, delete_window): Remove. Window deletion is
19803 handled by window.el.
640c8776
SM
19804 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19805 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19806 (Fdelete_other_windows): Remove. Deleting other windows is
19807 handled by window.el.
19808 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19809 handled in window.el.
19810 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19811 Window minimum sizes are handled in window.el.
19812 (shrink_windows, size_window, set_window_height)
19813 (set_window_width, change_window_heights, window_height)
19814 (window_width, CURBEG, CURSIZE, enlarge_window)
19815 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19816 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19817 handled in window.el.
19818 (make_dummy_parent): Rename to make_parent_window and give it a
19819 second argument horflag.
19820 (make_window): Don't set resize_proportionally any more.
19821 (Fsplit_window): Remove. Windows are split in window.el.
19822 (save_restore_action, save_restore_orig_size)
19823 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19824 Resize mini windows in window.el.
19825 (grow_mini_window, shrink_mini_window): Implement by calling
19826 Qresize_root_window_vertically, resize_window_check and
19827 resize_window_apply.
640c8776
SM
19828 (saved_window, Fset_window_configuration, save_window_save):
19829 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19830 resize_proportionally.
19831 (window_min_height, window_min_width): Move to window.el.
19832 (keys_of_window): Move bindings for delete-other-windows,
19833 split-window, delete-window and enlarge-window to window.el.
19834
19835 * buffer.c: Temporarily extern Qdelete_window.
19836 (Fbury_buffer): Temporarily call Qdelete_window instead of
19837 Fdelete_window (Fbury_buffer will move to window.el soon).
19838
19839 * frame.c (set_menu_bar_lines_1): Remove code handling
19840 orig_top_line and orig_total_lines.
19841
19842 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19843 set_window_height but set heights directly.
19844 (change_frame_size_1): Use resize_frame_windows.
19845
19846 * xdisp.c (init_xdisp): Don't use set_window_height but set
19847 heights directly.
19848
640c8776
SM
19849 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19850 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19851 run_window_configuration_change_hook.
19852
19853 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19854 instead of change_window_heights and run
19855 run_window_configuration_change_hook.
19856
1a13852e
MR
198572011-06-09 Martin Rudalics <rudalics@gmx.at>
19858
19859 * window.c (replace_window): Rename second argument REPLACEMENT to
19860 NEW. New third argument SETFLAG. Rewrite.
19861 (delete_window, make_dummy_parent): Call replace_window with
19862 third argument 1.
19863 (window_list_1): Move down in code.
19864 (run_window_configuration_change_hook): Move set_buffer part
19865 before select_frame_norecord part in order to unwind correctly.
19866 Rename count1 to count.
19867 (recombine_windows, delete_deletable_window, resize_root_window)
19868 (Fdelete_other_windows_internal)
19869 (Frun_window_configuration_change_hook, make_parent_window)
19870 (resize_window_check, resize_window_apply, Fresize_window_apply)
19871 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19872 (Fdelete_window_internal, Fresize_mini_window_internal):
19873 New functions.
1a13852e
MR
19874 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19875
f3d1777e
MR
198762011-06-08 Martin Rudalics <rudalics@gmx.at>
19877
496e208e
MR
19878 * window.h (window): Add some new members to window structure -
19879 normal_lines, normal_cols, new_total, new_normal, clone_number,
19880 splits, nest, prev_buffers, next_buffers.
19881 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19882 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19883
f3d1777e
MR
19884 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19885 Remove.
496e208e
MR
19886 (make_dummy_parent): Set new members of windows structure.
19887 (make_window): Move down in code. Handle new members of window
19888 structure.
19889 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19890 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19891 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19892 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19893 (Fset_window_next_buffers, Fset_window_clone_number):
19894 New functions.
496e208e
MR
19895 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19896 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19897 Doc-string fixes.
19898 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19899 Argument WINDOW can be now internal window too.
19900 (Fwindow_use_time): Move up in code.
19901 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19902 Rewrite doc-string.
19903 (Fset_window_configuration, saved_window)
19904 (Fcurrent_window_configuration, save_window_save): Handle new
19905 members of window structure.
b9e809c2
MR
19906 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19907 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19908 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19909 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19910 Qget_mru_window, Qresize_root_window,
19911 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19912 Qauto_buffer_name; staticpro them.
f3d1777e 19913
abde8f8c
MR
199142011-06-07 Martin Rudalics <rudalics@gmx.at>
19915
19916 * window.c (Fwindow_total_size, Fwindow_left_column)
19917 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19918 (Fwindow_list_1): New functions.
19919 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19920 (Fwindow_width, Fscroll_left, Fscroll_right):
19921 Use window_body_cols instead of window_box_text_cols.
19922 (delete_window, Fset_window_configuration):
19923 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19924 (delete_all_subwindows): Take a window as argument and not a
19925 structure. Rewrite.
190b47e6
MR
19926 (window_loop): Remove handling of GET_LRU_WINDOW and
19927 GET_LARGEST_WINDOW.
19928 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19929
19930 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19931 window_box_text_cols. delete_all_subwindows now takes a
19932 Lisp_Object as argument.
abde8f8c 19933
640c8776
SM
19934 * indent.c (compute_motion, Fcompute_motion):
19935 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19936
fa8a67e6
MR
19937 * frame.c (delete_frame): Call delete_all_subwindows with root
19938 window as argument.
19939
a54e3482
DC
199402011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19941
19942 * fns.c (Fputhash): Document return value.
19943
60002bf5
CY
199442011-06-06 Chong Yidong <cyd@stupidchicken.com>
19945
19946 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19947
0c671da6 199482011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19949
b862a52a 19950 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19951
be44ca6c
PE
19952 Check for overflow when converting integer to cons and back.
19953 * charset.c (Fdefine_charset_internal, Fdecode_char):
19954 Use cons_to_unsigned to catch overflow.
19955 (Fencode_char): Use INTEGER_TO_CONS.
19956 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19957 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19958 * data.c (long_to_cons, cons_to_long): Remove.
19959 (cons_to_unsigned, cons_to_signed): New functions.
19960 These signal an error for invalid or out-of-range values.
19961 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19962 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19963 * font.c (Ffont_variation_glyphs):
19964 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19965 * lisp.h: Include <intprops.h>.
19966 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19967 (cons_to_signed, cons_to_unsigned): New decls.
19968 (long_to_cons, cons_to_long): Remove decls.
19969 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19970 (Fprimitive_undo): Use CONS_TO_INTEGER.
19971 * xfns.c (Fx_window_property): Likewise.
19972 * xselect.c: Include <limits.h>.
19973 (x_own_selection, selection_data_to_lisp_data):
19974 Use INTEGER_TO_CONS.
19975 (x_handle_selection_request, x_handle_selection_clear)
19976 (x_get_foreign_selection, Fx_disown_selection_internal)
19977 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19978 (lisp_data_to_selection_data): Use cons_to_unsigned.
19979 (x_fill_property_data): Use cons_to_signed.
19980 Report values out of range.
19981
d1f3d2af
PE
19982 Check for buffer and string overflow more precisely.
19983 * buffer.h (BUF_BYTES_MAX): New macro.
19984 * lisp.h (STRING_BYTES_MAX): New macro.
19985 * alloc.c (Fmake_string):
19986 * character.c (string_escape_byte8):
19987 * coding.c (coding_alloc_by_realloc):
19988 * doprnt.c (doprnt):
19989 * editfns.c (Fformat):
19990 * eval.c (verror):
19991 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19992 since they may not be the same number.
19993 * editfns.c (Finsert_char):
19994 * fileio.c (Finsert_file_contents):
19995 Likewise for BUF_BYTES_MAX.
19996
dd52fcea
PE
19997 * image.c: Use ptrdiff_t, not int, for sizes.
19998 (slurp_file): Switch from int to ptrdiff_t.
19999 All uses changed.
20000 (slurp_file): Check that file size fits in both size_t (for
20001 malloc) and ptrdiff_t (for sanity and safety).
20002
7f9bbdbb
PE
20003 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20004 if b->modtime has its maximal value.
20005
dfe18f82
PE
20006 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20007
84acfcf0
PE
20008 Don't assume time_t can fit into int.
20009 * buffer.h (struct buffer.modtime): Now time_t, not int.
20010 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20011 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20012
ccd9a01a
PE
20013 Minor fixes for signed vs unsigned integers.
20014 * character.h (MAYBE_UNIFY_CHAR):
20015 * charset.c (maybe_unify_char):
20016 * keyboard.c (read_char, reorder_modifiers):
20017 XINT -> XFASTINT, since the integer must be nonnegative.
20018 * ftfont.c (ftfont_spec_pattern):
20019 * keymap.c (access_keymap, silly_event_symbol_error):
20020 XUINT -> XFASTINT, since the integer must be nonnegative.
20021 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20022 since it makes no difference and we prefer signed.
20023 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20024 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20025 nonnegative.
20026
d6d100dd
SM
200272011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20028
20029 * window.h (Fwindow_frame): Declare.
20030
2b6148e4
PE
200312011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20032
20033 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20034 (SPARE_MEMORY): Always define.
20035 (LARGE_REQUEST): Remove.
20036 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20037
f230ecc9
MR
200382011-06-06 Martin Rudalics <rudalics@gmx.at>
20039
727e958e
MR
20040 * lisp.h: Move EXFUNS for Fframe_root_window,
20041 Fframe_first_window and Fset_frame_selected_window to window.h.
20042
20043 * window.h: Move EXFUNS for Fframe_root_window,
20044 Fframe_first_window and Fset_frame_selected_window here from
20045 lisp.h.
20046
20047 * frame.c (Fwindow_frame, Fframe_first_window)
20048 (Fframe_root_window, Fframe_selected_window)
20049 (Fset_frame_selected_window): Move to window.c.
20050 (Factive_minibuffer_window): Move to minibuf.c.
20051 (Fother_visible_frames_p): New function.
20052
20053 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20054
f230ecc9
MR
20055 * window.c (decode_window, decode_any_window): Move up in code.
20056 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20057 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
20058 (Fwindow_buffer): Move up and rewrite doc-string.
20059 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20060 (Fwindow_prev): New functions.
727e958e
MR
20061 (Fwindow_frame): Move here from frame.c. Accept any window as
20062 argument.
20063 (Fframe_root_window, Fframe_first_window)
20064 (Fframe_selected_window): Move here from frame.c. Accept frame
20065 or arbitrary window as argument. Update doc-strings.
20066 (Fminibuffer_window): Move up in code.
20067 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
20068 (Fset_frame_selected_window): Move here from frame.c.
20069 Marginal rewrite.
727e958e
MR
20070 (Fselected_window, select_window, Fselect_window): Move up in
20071 code. Minor doc-string fixes.
f230ecc9 20072
4d09bcf6
PE
200732011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20074
20075 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20076 Do not assume that spare memory exists; that assumption is valid
20077 only if SYSTEM_MALLOC.
20078 (LARGE_REQUEST): New macro, so that the issue of large requests
20079 is separated from the issue of spare memory.
20080
810928a2
AS
200812011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20082
172418ad
AS
20083 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20084 format. (Bug#8806)
20085
43f862f7
AS
20086 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20087
810928a2
AS
20088 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20089 before statements.
20090
a059fe24
JD
200912011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20092
20093 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20094
20095 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20096
20097 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20098 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20099
989bf368
JB
201002011-06-05 Juanma Barranquero <lekktu@gmail.com>
20101
20102 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20103
4b80f674
CY
201042011-06-04 Chong Yidong <cyd@stupidchicken.com>
20105
20106 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20107 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
20108 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20109 New error handlers.
4b80f674
CY
20110 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20111 Obey Vx_select_enable_clipboard_manager. Catch errors in
20112 x_clipboard_manager_save (Bug#8779).
20113 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 20114 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 20115
99a33b77 201162011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
20117
20118 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20119
99a33b77 201202011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
20121
20122 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20123 in the current matrix if keep_current_p is non-zero.
20124
8264569d
EZ
201252011-06-04 Eli Zaretskii <eliz@gnu.org>
20126
20127 * bidi.c (bidi_level_of_next_char): Fix last change.
20128
57f97249
EZ
201292011-06-03 Eli Zaretskii <eliz@gnu.org>
20130
fec2107c 20131 Support bidi reordering of text covered by display properties.
57f97249 20132
fec2107c
EZ
20133 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20134 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20135 (bidi_cache_search, bidi_cache_iterator_state)
20136 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
20137 (bidi_level_of_next_char, bidi_move_to_visually_next):
20138 Support character positions inside a run of characters covered by a
fec2107c
EZ
20139 display string.
20140 (bidi_paragraph_init, bidi_resolve_explicit_1)
20141 (bidi_level_of_next_char): Call bidi_fetch_char and
20142 bidi_fetch_char_advance instead of FETCH_CHAR and
20143 FETCH_CHAR_ADVANCE.
20144 (bidi_init_it): Initialize new members.
20145 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20146 definitions.
20147 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20148 instead of using explicit *_CHAR codes.
d6d100dd
SM
20149 (bidi_resolve_explicit, bidi_resolve_weak):
20150 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20151 bidirectional text is supported only in multibyte buffers.
20152 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20153 it to initialize the frame_window_p member of struct bidi_it.
20154 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20155 (bidi_resolve_explicit, bidi_resolve_weak)
20156 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20157 bidi_it->nchars is non-positive.
20158 (bidi_level_of_next_char): Don't try to lookup the cache for the
20159 next/previous character if nothing is cached there yet, or if we
20160 were just reseat()'ed to a new position.
c40e2fb2 20161
0e14fe90
EZ
20162 * xdisp.c (set_cursor_from_row): Set start and stop points
20163 according to the row's direction when priming the loop that looks
20164 for the glyph on which to display cursor.
20165 (single_display_spec_intangible_p): Function deleted.
20166 (display_prop_intangible_p): Reimplement to call
20167 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20168 Accept 3 additional arguments needed by handle_display_spec.
20169 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20170 values: lists, `(when COND...)' forms, etc.
20171 (single_display_spec_string_p): Support property values that are
20172 lists with the argument STRING its top-level element.
20173 (display_prop_string_p): Fix the condition for processing a
20174 property that is a list to be consistent with handle_display_spec.
fec2107c 20175 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20176 last portion of handle_display_prop.
20177 (compute_display_string_pos): Accept additional argument
20178 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20179 value of a `display' property is a "replacing spec".
20180 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20181 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20182 the display property, but just return a value indicating whether
20183 the display property will replace the characters it covers.
20184 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20185 frame_window_p members of struct bidi_it.
d6d100dd
SM
20186 (compute_display_string_pos, compute_display_string_end):
20187 New functions.
fec2107c
EZ
20188 (push_it): Accept second argument POSITION, where pop_it should
20189 jump to continue iteration.
20190 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20191
fec2107c
EZ
20192 * keyboard.c (adjust_point_for_property): Adjust the call to
20193 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20194
20195 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20196 (bidi_init_it): Update prototypes.
20197 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20198 (compute_display_string_pos, compute_display_string_end):
20199 Declare prototypes.
fec2107c
EZ
20200 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20201 EMACS_INT.
fc6f18ce 20202
40087514 202032011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20204
57f53182
PE
20205 Malloc failure behavior now depends on size of allocation.
20206 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20207 * lisp.h: Change signatures accordingly.
20208 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20209 All callers changed. (Bug#8762)
20210
20211 * gnutls.c: Use Emacs's memory allocators.
20212 Without this change, the gnutls library would invoke malloc etc.
20213 directly, which causes problems on non-SYNC_INPUT hosts, and which
20214 runs afoul of improving memory_full behavior. (Bug#8761)
20215 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20216 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20217 xfree instead of the default malloc, realloc, free.
20218 (Fgnutls_boot): No need to check for memory allocation failure,
20219 since xmalloc does that for us.
20220
ac32cd99 20221 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20222 * category.c (hash_get_category_set):
20223 * ccl.c (ccl_driver):
20224 * charset.c (Fdefine_charset_internal):
20225 * charset.h (struct charset.hash_index):
20226 * composite.c (get_composition_id, gstring_lookup_cache)
20227 (composition_gstring_put_cache):
20228 * composite.h (struct composition.hash_index):
20229 * dispextern.h (struct image.hash):
20230 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20231 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20232 (hashfn_equal, hashfn_user_defined, make_hash_table)
20233 (maybe_resize_hash_table, hash_lookup, hash_put)
20234 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20235 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20236 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20237 * image.c (make_image, search_image_cache, lookup_image)
20238 (xpm_put_color_table_h):
20239 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20240 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20241 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20242 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20243 * alloc.c (allocate_vectorlike):
20244 Check for overflow in vector size calculations.
20245 * ccl.c (ccl_driver):
20246 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20247 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20248 need to be updated by these changes.
40087514
PE
20249 * fns.c (make_hash_table, maybe_resize_hash_table):
20250 Check for integer overflow with large hash tables.
0de4bb68
PE
20251 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20252 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20253 (SXHASH_REDUCE): New macro.
20254 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20255 Use it instead of discarding useful hash info with large hash values.
20256 (sxhash_float): New function.
20257 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20258 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20259 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20260 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20261 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20262 Adjust signatures to match updated version of code.
20263 (consing_since_gc): Now EMACS_INT, since a single hash table can
20264 use more than INT_MAX bytes.
20265
698d32e2
DN
202662011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20267
20268 Make it possible to build with GCC-4.6+ -O2 -flto.
20269
20270 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20271
fd6fa53f
SM
202722011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20273
20274 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20275 Call minibuffer-inactive-mode.
20276
864db017
JB
202772011-05-31 Juanma Barranquero <lekktu@gmail.com>
20278
20279 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20280 Update dependencies.
20281
2ad0baf4
DN
202822011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20283
20284 * data.c (init_data): Remove code for UTS, this system is not
20285 supported anymore.
20286
4fcc2638
DN
202872011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20288
20289 Don't force ./temacs to start in terminal mode.
20290
20291 * frame.c (make_initial_frame): Initialize faces in all cases, not
20292 only when CANNOT_DUMP is defined.
20293 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20294
c56e0fd5
DN
202952011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20296
20297 * dispnew.c (add_window_display_history): Use const for the string
20298 pointer. Remove declaration, not needed.
20299
333d54da 203002011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20301
55d4c1b2 20302 Use 'inline', not 'INLINE'.
333d54da 20303 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20304 * alloc.c, fontset.c (INLINE): Remove.
20305 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20306 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20307 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20308 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20309 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20310
738db178
DN
203112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20312
20313 Make it possible to run ./temacs.
20314
20315 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20316 syms_of_callproc does the same thing. Remove test for
20317 "initialized", do it in the caller.
20318 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20319
620c53a6
SM
203202011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20321
20322 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20323 (read_minibuf): Use get_minibuffer.
20324 (syms_of_minibuf): Use DEFSYM.
20325 (Qmetadata): New var.
20326 * data.c (Qbuffer): Don't make it static.
20327 (syms_of_data): Use DEFSYM.
20328
e003a292
PE
203292011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20330
20331 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20332 (CCL_CODE_MIN): New macro.
20333
ed008a6d
PE
203342011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20335
3687c2ef
PE
20336 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20337
ed008a6d
PE
20338 * eval.c (Qdebug): Now static.
20339 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20340 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20341 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20342
d66c4c7c
CY
203432011-05-29 Chong Yidong <cyd@stupidchicken.com>
20344
20345 * image.c: Various fixes to ImageMagick code comments.
20346 (Fimagemagick_types): Doc fix.
20347
5fbc2025
PE
203482011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20349
0196f88a
PE
20350 Minor fixes prompted by GCC 4.6.0 warnings.
20351
20352 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20353
5fbc2025
PE
20354 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20355 (x_clipboard_manager_save_all): Move extern decl to ...
20356 * xterm.h: ... here, so that it can be checked for consistency.
20357
1dd3c2d9
CY
203582011-05-29 Chong Yidong <cyd@stupidchicken.com>
20359
20360 * xselect.c (x_clipboard_manager_save_frame)
20361 (x_clipboard_manager_save_all): New functions.
20362 (Fx_clipboard_manager_save): Lisp function deleted.
20363
20364 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20365 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20366
20367 * xterm.h: Update prototype.
20368
5ba6571d
WX
203692011-05-28 William Xu <william.xwl@gmail.com>
20370
20371 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20372 exiting (Bug#8239).
20373
3eaff834
JM
203742011-05-28 Jim Meyering <meyering@redhat.com>
20375
e1900994 20376 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20377 * fns.c (to_uchar): Define.
20378 (crypto_hash_function): Use it to convert some newly-signed
20379 variables to unsigned, to avoid sign-extension bugs. For example,
20380 without this change, (md5 "truc") would evaluate to
20381 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20382 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20383 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20384
0f6990a7
PE
203852011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20386
20387 Integer overflow fixes.
c8a9ca5a 20388
08686060
PE
20389 * dbusbind.c: Serial number integer overflow fixes.
20390 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20391 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20392 to hold a serial number that is too large for a fixnum.
20393 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20394 Check for serial numbers out of range. Decode any serial number
59568bf0 20395 that was so large that it became a float. (Bug#8722)
08686060 20396
2d1fc3c7
PE
20397 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20398 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20399 Use XFASTINT rather than XUINT when numbers are nonnegative.
20400 (xd_append_arg, Fdbus_method_return_internal):
20401 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20402 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20403 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20404 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20405 (Bug#8722)
2d1fc3c7 20406
c8a9ca5a
PE
20407 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20408
519e1d69
PE
20409 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20410
6df6ae42 20411 ccl: Add integer overflow checks.
30569699
PE
20412 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20413 (IN_INT_RANGE): New macros.
20414 (ccl_driver): Use them to check for integer overflow when
20415 decoding a CCL program. Many of the new checks are whether XINT (x)
20416 fits in int; it doesn't always, on 64-bit hosts. The new version
20417 doesn't catch all possible integer overflows, but it's an
847044ea 20418 improvement. (Bug#8719)
30569699 20419
c11285dc
PE
20420 * alloc.c (make_event_array): Use XINT, not XUINT.
20421 There's no need for unsigned here.
20422
fdccd48e
PE
20423 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20424 This follows up to the 2011-05-06 change that substituted uintptr_t
20425 for EMACS_INT. This case wasn't caught back then.
20426
37910ab2
PE
20427 Rework Fformat to avoid integer overflow issues.
20428 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20429 now (part of C89). Include <verify.h>.
20430 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20431 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20432 (Fformat): Avoid the prepass trying to compute sizes; it was only
20433 approximate and thus did not catch overflow reliably. Instead, walk
20434 through the format just once, formatting and computing sizes as we go,
20435 checking for integer overflow at every step, and allocating a larger
20436 buffer as needed. Keep track separately whether the format is
20437 multibyte. Keep only the most-recently calculated precision, rather
20438 than them all. Record whether each argument has been converted to
20439 string. Use EMACS_INT, not int, for byte and char and arg counts.
20440 Support field widths and precisions larger than INT_MAX. Avoid
20441 sprintf's undefined behavior with conversion specifications such as %#d
20442 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20443 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20444 formatting out-of-range floating point numbers with int
9173deec 20445 formats. (Bug#8668)
37910ab2 20446
2e6578fb
PE
20447 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20448
0ae6bdee
PE
20449 * data.c: Avoid integer truncation in expressions involving floats.
20450 * data.c: Include <intprops.h>.
20451 (arith_driver): When there's an integer overflow in an expression
20452 involving floating point, convert the integers to floating point
20453 so that the resulting value does not suffer from catastrophic
20454 integer truncation. For example, on a 64-bit host (* 4
20455 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20456 Do not rely on undefined behavior after integer overflow.
20457
de883a70
PE
20458 merge count_size_as_multibyte, parse_str_to_multibyte
20459 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20460 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20461 Check for integer overflow.
20462 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20463 since it's now a duplicate of the other. This is more of
20464 a character than a buffer op, so better that it's in character.c.
20465 * fns.c, print.c: Adjust to above changes.
20466
2ff916cb
PE
204672011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20468
20469 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20470
f1b54466
PE
204712011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20472
fb1ac845
PE
20473 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20474 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20475 (x_clipboard_manager_save): Now static.
20476 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20477
f1b54466
PE
20478 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20479 (crypto_hash_function): Now static.
20480 Fix pointer signedness problems. Avoid unnecessary initializations.
20481
a9f737ee
CY
204822011-05-27 Chong Yidong <cyd@stupidchicken.com>
20483
20484 * termhooks.h (Vselection_alist): Make it terminal-local.
20485
20486 * terminal.c (create_terminal): Initialize it.
20487
20488 * xselect.c: Support for clipboard managers.
20489 (Vselection_alist): Move to termhooks.h as terminal-local var.
20490 (LOCAL_SELECTION): New macro.
20491 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20492 (symbol_to_x_atom): Remove gratuitous arg.
20493 (x_handle_selection_request, lisp_data_to_selection_data)
20494 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20495 (x_own_selection, x_get_local_selection, x_convert_selection):
20496 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20497 (some_frame_on_display): Delete unused function.
20498 (Fx_own_selection_internal, Fx_get_selection_internal)
20499 (Fx_disown_selection_internal, Fx_selection_owner_p)
20500 (Fx_selection_exists_p): New optional frame arg.
20501 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20502 (x_handle_selection_clear): Don't treat other terminals with the
20503 same keyboard specially. Use the terminal-local Vselection_alist.
20504 (x_clear_frame_selections): Use Frun_hook_with_args.
20505
20506 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20507
20508 * xterm.h: Add support for those atoms.
20509
e067f0c1
CY
205102011-05-26 Chong Yidong <cyd@stupidchicken.com>
20511
20512 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20513 (converted_selections, conversion_fail_tag): New global variables.
20514 (x_selection_request_lisp_error): Free the above.
20515 (x_get_local_selection): Remove unnecessary code.
20516 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20517 of converted selections stored in converted_selections.
20518 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20519 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20520 (x_convert_selection): New function.
20521 (x_handle_selection_event): Simplify.
20522 (x_get_foreign_selection): Don't ignore incoming requests while
20523 waiting for an answer; this will fail when we implement
20524 SAVE_TARGETS, and seems unnecessary anyway.
20525 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20526 (Vx_sent_selection_functions): Doc fix.
20527
0f4aebc0
LL
205282011-05-26 Leo Liu <sdl.web@gmail.com>
20529
20530 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20531
e61124cd
YM
205322011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20533
20534 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20535
20536 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20537 for fringe update if it has periodic bitmap.
ac389d0c 20538 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20539 and fringe_bitmap_periodic_p.
20540
20541 * fringe.c (get_fringe_bitmap_data): New function.
20542 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20543 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20544 row. Mark glyph row for fringe update if periodicity changed.
20545
20546 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20547 for fringe update unless it has periodic bitmap.
20548
f16d9837
KH
205492011-05-25 Kenichi Handa <handa@m17n.org>
20550
20551 * xdisp.c (get_next_display_element): Set correct it->face_id for
20552 a static composition.
20553
e1b90ef6
LL
205542011-05-24 Leo Liu <sdl.web@gmail.com>
20555
20556 * deps.mk (fns.o):
20557 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20558
20559 * fns.c (crypto_hash_function, Fsha1): New function.
20560 (Fmd5): Use crypto_hash_function.
20561 (syms_of_fns): Add Ssha1.
20562
7400048f
PE
205632011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20564
20565 * gnutls.c: Remove unused macros.
20566 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20567 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20568 Remove macros that are defined and never used.
20569 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20570
abb71cf4
CY
205712011-05-22 Chong Yidong <cyd@stupidchicken.com>
20572
20573 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20574 (Fx_get_selection_internal): Minor cleanup.
20575 (Fx_own_selection_internal): Rename arguments for consistency with
20576 select.el.
20577
6307db39
PE
205782011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20579
20580 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20581
f3d4e0a4
CY
205822011-05-22 Chong Yidong <cyd@stupidchicken.com>
20583
20584 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20585
4d8ade89
YM
205862011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20587
20588 * dispnew.c (scrolling_window): Don't exclude the case that the
20589 last enabled row in the desired matrix touches the bottom boundary.
20590
32078c8d
GM
205912011-05-21 Glenn Morris <rgm@gnu.org>
20592
20593 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20594 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20595 and add some more files.
32078c8d 20596
7285dc67
EZ
205972011-05-20 Eli Zaretskii <eliz@gnu.org>
20598
20599 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20600 report_file_error introduced by the change from 2011-05-07.
20601
89d1bd22
PE
206022011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20603
20604 * systime.h (Time): Define only if emacs is defined.
20605 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20606 where the include path doesn't have X11/X.h by default. See
20607 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20608
cd394be1 206092011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20610
20611 * composite.c (find_automatic_composition): Fix previous change.
20612
b9704ad9
GM
206132011-05-20 Glenn Morris <rgm@gnu.org>
20614
20615 * lisp.mk: New file, split from Makefile.in.
20616 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20617 (shortlisp): Remove.
20618 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20619
4a720484
GM
206202011-05-19 Glenn Morris <rgm@gnu.org>
20621
20622 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20623 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20624 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20625 (lisp): Set the order to that of loadup.el.
20626 (shortlisp): Make it a copy of $lisp.
20627 (SOME_MACHINE_LISP): Remove.
20628 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20629 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20630
a28d4396
KH
206312011-05-18 Kenichi Handa <handa@m17n.org>
20632
20633 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20634 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20635 (find_automatic_composition): Mostly rewrite for efficiency.
20636
a2b1fa8e
JB
206372011-05-18 Juanma Barranquero <lekktu@gmail.com>
20638
20639 * makefile.w32-in: Update dependencies.
20640
8e1f5610
CS
206412011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20642
20643 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20644 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20645
7025ee00 206462011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20647
cdfa6eab
PE
20648 Fix some integer overflow issues, such as string length overflow.
20649
06d6db33
PE
20650 * insdel.c (count_size_as_multibyte): Check for string overflow.
20651
2b4560a8
PE
20652 * character.c (lisp_string_width): Check for string overflow.
20653 Use EMACS_INT, not int, for string indexes and lengths; in
20654 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20655 the resulting string length overflows an EMACS_INT; instead,
20656 report a string overflow if no precision given. When checking for
20657 precision exhaustion, use a check that cannot possibly have
20658 integer overflow. (Bug#8675)
20659 * character.h (lisp_string_width): Adjust to new signature.
20660
cb93f9be
PE
20661 * alloc.c (string_overflow): New function.
20662 (Fmake_string): Use it. This doesn't change behavior, but saves
20663 a few bytes and will simplify future changes.
20664 * character.c (string_escape_byte8): Likewise.
20665 * lisp.h (string_overflow): New decl.
20666
1a1f3366
PE
20667 Fixups, following up to the user-interface timestamp change.
20668 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20669 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20670 * msdos.c (mouse_get_pos): Likewise.
20671 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20672 * w32gui.h (Time): Define by including "systime.h" rather than by
20673 declaring it ourselves. (Bug#8664)
20674
d4e3e4d3
PE
20675 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20676 * image.c (clear_image_cache): Likewise.
20677
f6a24d19
PE
20678 * term.c (term_mouse_position): Don't assume time_t wraparound.
20679
08dc5ae6
PE
20680 Be more systematic about user-interface timestamps.
20681 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20682 and sometimes 'EMACS_UINT', to represent these timestamps.
20683 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20684 This makes the code easier to follow, and makes it easier to catch
20685 integer overflow bugs such as Bug#8664.
20686 * frame.c (Fmouse_position, Fmouse_pixel_position):
20687 Use Time, not unsigned long, for user-interface timestamps.
20688 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20689 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20690 * keyboard.h (last_event_timestamp): Likewise.
20691 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20692 * menu.h (xmenu_show): Likewise.
20693 * term.c (term_mouse_position): Likewise.
20694 * termhooks.h (struct input_event.timestamp): Likewise.
20695 (struct terminal.mouse_position_hook): Likewise.
20696 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20697 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20698 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20699 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20700 what it was before.
20701 * menu.h, termhooks.h: Include "systime.h", for Time.
20702
8e55734a
PE
20703 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20704 Don't assume that the difference between two unsigned long values
20705 can fit into an integer. At this point, we know button_down_time
20706 <= event->timestamp, so the difference must be nonnegative, so
20707 there's no need to cast the result if double-click-time is
20708 nonnegative, as it should be; check that it's nonnegative, just in
20709 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20710 apart (about 25 days). (Bug#8664)
8e55734a 20711
841f1b75 20712 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20713 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20714
3e26f69c
PE
20715 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20716 that always fit in int. Use a sentinel instead of a counter, to
20717 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20718 * frame.h (struct frame): Use int for menu_bar_items_used
20719 instead of EMACS_INT, since it always fits in int.
3e26f69c 20720
5cc152c0
PE
20721 * menu.c (grow_menu_items): Check for int overflow.
20722
d89eb65e
PE
20723 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20724
5235bd3e
PE
20725 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20726 Before, the code was not consistent. These values cannot exceed
20727 2**31 - 1 so there's no need to make them unsigned.
20728 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20729 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20730 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20731 as modifiers.
20732 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20733
bc827e23
PE
20734 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20735 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20736 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20737 presumably because the widths might not match.
20738
78eb494e
PE
20739 * window.c (size_window): Avoid needless test at loop start.
20740
04f2d78b
CB
207412011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20742
20743 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20744
d2fc7e3d 207452011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20746
20747 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20748
d2fc7e3d 207492011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20750
20751 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20752 `width' to `bar_area_x' and `bar_area_width', respectively.
20753 (x_scroll_run): Take account of fringe background extension.
20754
04f2d78b
CB
20755 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20756 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20757 `bar_area_width', respectively.
20758 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20759 background extension.
20760
79b70037
GM
207612011-05-10 Jim Meyering <meyering@redhat.com>
20762
20763 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20764
2f142cc5
JB
207652011-05-10 Juanma Barranquero <lekktu@gmail.com>
20766
20767 * image.c (Finit_image_library): Return t for built-in image types,
20768 like pbm and xbm. (Bug#8640)
20769
57679c86
AS
207702011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20771
20772 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20773
888c9e86
EZ
207742011-05-07 Eli Zaretskii <eliz@gnu.org>
20775
b0512a1d
EZ
20776 * w32console.c (Fset_screen_color): Doc fix.
20777 (Fget_screen_color): New function.
20778 (syms_of_ntterm): Defsubr it.
20779
7285dc67
EZ
20780 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20781 unlink the temporary file if Fcall_process didn't create it in the
20782 first place.
20783 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20784 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20785 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20786 cue to call_process_cleanup not to close that handle.
20787
4d3fcc8e
BK
207882011-05-07 Ben Key <bkey76@gmail.com>
20789
20790 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20791 one of two shell specific rules, either bootstrap-temacs-CMD or
20792 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20793 to the previous implementation of the bootstrap-temacs rule.
20794 The bootstrap-temacs-CMD rule is similar to the previous
20795 implementation of the bootstrap-temacs rule except that it
20796 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20797 variable.
20798
20799 These changes, along with some changes to nt/configure.bat,
20800 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20801 earlier fix to add support for --cflags and --ldflags options
20802 that include quotes so that it works whether make uses cmd or
20803 sh as the shell.
20804
b4289b64
MA
208052011-05-06 Michael Albinus <michael.albinus@gmx.de>
20806
20807 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20808 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20809 is a constant.
20810 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20811 a string. Handle both cases.
20812 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20813 (Fdbus_register_method): Use Qinvalid_function.
20814
af4c0e28
JB
208152011-05-06 Juanma Barranquero <lekktu@gmail.com>
20816
20817 * makefile.w32-in: Update dependencies.
20818 (LISP_H): Add inttypes.h and stdin.h.
20819 (PROCESS_H): Add unistd.h.
20820
c51453d9
EZ
208212011-05-06 Eli Zaretskii <eliz@gnu.org>
20822
20823 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20824 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20825
8ff0ac3c 208262011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20827
4c4b566b
PE
20828 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20829
aab2b9b5
PE
20830 * term.c (vfatal): Remove stray call to va_end.
20831 It's not needed and the C Standard doesn't allow it here anyway.
20832
c378da0b
PE
20833 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20834 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20835
288b08c7
PE
20836 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20837 bytes.
20838
e3601888
PE
20839 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20840
db6c0e74
PE
20841 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20842
dd5963ea
PE
20843 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20844
88c9450f
PE
20845 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20846
2f9442b8
PE
20847 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20848
c032b5f8
PE
20849 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20850 * charset.c (Fdefine_charset_internal): Don't initialize
20851 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20852 32-bit int (Bug#8600).
a108c10b
PE
20853
20854 * lread.c (read_integer): Be more consistent with string-to-number.
20855 Use string_to_number to do the actual conversion; this avoids
20856 rounding errors and fixes some other screwups. Without this fix,
20857 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20858 (digit_to_number): Move earlier, for benefit of read_integer.
20859 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20860 not a digit in any supported base. (Bug#8602)
a108c10b 20861
ad5f9eea
PE
20862 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20863
aec1708a
PE
20864 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20865 to match comment at start of function. This also removes a
20866 GCC warning about overflow in a 32+64-bit port.
20867
47be4ab5
PE
20868 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20869
371cac43
PE
20870 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20871 Reported by Stefan Monnier in
20872 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20873 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20874 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20875
d01a7826
PE
20876 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20877 (EMACS_UINTPTR): Likewise, with uintptr_t.
20878
7fd47d5c
PE
20879 * lisp.h: Prefer 64-bit EMACS_INT if available.
20880 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20881 on 32-bit hosts that have 64-bit int, so that they can access
20882 large files.
122b0c86
PE
20883 However, temporarily disable this change unless the temporary
20884 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20885
8727937b
PE
20886 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20887
8ac068ac
PE
20888 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20889 This removes an assumption that EMACS_INT and long are the same
20890 width as pointers. The assumption is true for Emacs porting targets
20891 now, but we want to make other targets possible.
20892 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20893 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20894 In the rest of the code, change types of integers that hold casted
20895 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20896 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20897 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20898 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20899 No need to cast type when ORing.
20900 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20901 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20902 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20903 assume EMACS_INT is the same width as char *.
20904 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20905 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20906 Remove no-longer-needed casts.
20907 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20908 (xg_tool_bar_help_callback, xg_make_tool_item):
20909 Use EMACS_INTPTR to hold an integer
20910 that will be cast to void *; this can avoid a GCC warning
20911 if EMACS_INT is not the same width as void *.
20912 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20913 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20914 (current_message_1, set_message_1):
20915 Use a local to convert to proper width without a cast.
20916 * xmenu.c (dialog_selection_callback): Likewise.
20917
ede49d71
PE
20918 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20919 Also, don't assume VALBITS / RAND_BITS is less than 5,
20920 and don't rely on undefined behavior when shifting a 1 left into
20921 the sign bit.
20922 * lisp.h (get_random): Change signature to match.
20923
2f30ecd0
PE
20924 * lread.c (hash_string): Use size_t, not int, for hash computation.
20925 Normally we prefer signed values; but hashing is special, because
20926 it's better to use unsigned division on hash table sizes so that
20927 the remainder is nonnegative. Also, size_t is the natural width
20928 for hashing into memory. The previous code used 'int', which doesn't
20929 retain enough info to hash well into very large tables.
20930 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20931
2a866e7b
PE
20932 * dbusbind.c: Don't possibly lose pointer info when converting.
20933 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20934 Use XPNTR rather than XHASH, so that the high-order bits of
20935 the pointer aren't lost when converting through void *.
20936
51639eac
PE
20937 * eval.c (Fautoload): Don't double-shift a pointer.
20938
92394119
PE
20939 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20940
dbdb9a7c
JB
209412011-05-06 Juanma Barranquero <lekktu@gmail.com>
20942
20943 * gnutls.c (DEF_GNUTLS_FN):
20944 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20945
db7a0b4f
AS
209462011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20947
20948 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20949 marker. (Bug#8610)
20950
cd394be1 209512011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20952
20953 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20954 New version that can reserve upto 2GB of heap space.
20955
f7ff1b0f 209562011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20957
20958 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20959
639c109b
TZ
209602011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20961
20962 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20963 `gnutls_certificate_set_x509_key_file'.
20964
d2127135
JB
209652011-05-05 Juanma Barranquero <lekktu@gmail.com>
20966
20967 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20968 Update dependencies.
20969
e968f4f3
JB
209702011-05-04 Juanma Barranquero <lekktu@gmail.com>
20971
20972 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20973 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20974 Remove unused parameter `fildes'.
20975 * process.c (read_process_output, send_process): Don't pass it.
20976
84d358f0
JB
209772011-05-04 Juanma Barranquero <lekktu@gmail.com>
20978
20979 Fix previous change: the library cache is defined in w32.c.
20980 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20981 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20982
0898ca10
JB
209832011-05-04 Juanma Barranquero <lekktu@gmail.com>
20984
20985 Implement dynamic loading of GnuTLS on Windows.
20986
20987 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20988 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20989 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20990 Declare.
20991
20992 * gnutls.c (Qgnutls_dll): Define.
20993 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20994 (gnutls_*): Declare function pointers.
20995 (init_gnutls_functions): New function to initialize function pointers.
20996 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20997 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20998 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20999 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21000 (emacs_gnutls_write, emacs_gnutls_read)
21001 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21002 (Fgnutls_available_p): New function.
21003 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21004 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21005 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21006
21007 * image.c: Include w32.h.
21008 (Vimage_type_cache): Delete.
21009 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21010 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21011 (w32_delayed_load): Move to w32.c.
21012
21013 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21014
21015 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21016 (w32_delayed_load): Move from image.c. When loading a library, record
21017 its filename in the :loaded-from property of the library id.
21018 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21019 Initialize and staticpro them.
21020 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21021
21022 * process.c: Include lisp.h before w32.h, not after.
21023 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21024 instead of gnutls_record_check_pending.
21025
21026 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21027
ff4de4aa
TZ
210282011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21029
21030 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21031 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21032 as passed in.
21033
abe95abb
JD
210342011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21035
21036 * xterm.c (x_set_frame_alpha): Do not set property on anything
21037 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21038
e16e55d4
JB
210392011-05-02 Juanma Barranquero <lekktu@gmail.com>
21040
21041 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21042
bafcf6a5
JB
210432011-05-02 Juanma Barranquero <lekktu@gmail.com>
21044
21045 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21046 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21047 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21048 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21049 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21050 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21051 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21052 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21053 (Qgnutls_bootprop_callbacks_verify): Make static.
21054
e7a6747f
AS
210552011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21056
19ed11ba
AS
21057 * callproc.c: Indentation fixup.
21058
e7a6747f 21059 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
21060 (wait_for_termination, interruptible_wait_for_termination):
21061 Move after wait_for_termination_1.
e7a6747f 21062
1ef14cb4
LMI
210632011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21064
21065 * sysdep.c (interruptible_wait_for_termination): New function
21066 which is like wait_for_termination, but allows keyboard
21067 interruptions.
21068
21069 * callproc.c (Fcall_process): Add (:file "file") as an option for
21070 the STDOUT buffer.
21071 (Fcall_process_region): Ditto.
21072
330d880c
EZ
210732011-04-30 Eli Zaretskii <eliz@gnu.org>
21074
8db90b73
EZ
21075 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21076 rather than `XVECTOR (FOO)->size'.
21077
330d880c
EZ
21078 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21079 inttypes.h, as a gnulib replacement is used if it not available in
21080 system headers.
21081
15cbd324
EZ
210822011-04-21 Eli Zaretskii <eliz@gnu.org>
21083
21084 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21085 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21086 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21087
21088 * coding.c (coding_alloc_by_realloc): Error out if destination
21089 will grow beyond MOST_POSITIVE_FIXNUM.
21090 (decode_coding_emacs_mule): Abort if there isn't enough place in
21091 charbuf for the composition carryover bytes. Reserve an extra
21092 space for up to 2 characters produced in a loop.
21093 (decode_coding_iso_2022): Abort if there isn't enough place in
21094 charbuf for the composition carryover bytes.
21095
210962011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 21097
ae940cca
EZ
21098 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21099 aborting when %lld or %lll format is passed.
21100 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21101 %llo or %llx format is passed. (Bug#8545)
21102
03ab8921
EZ
21103 * window.c (window_scroll_line_based): Use a marker instead of
21104 simple variables to record original value of point. (Bug#7952)
21105
afda1437
EZ
21106 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21107 produced by %s or %c overflows available buffer space. (Bug#8545)
21108
f76dee0c
PE
211092011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21110
21111 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 21112 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 21113
fdc5744d
JB
211142011-04-28 Juanma Barranquero <lekktu@gmail.com>
21115
21116 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21117
638f053a
JB
211182011-04-28 Juanma Barranquero <lekktu@gmail.com>
21119
21120 * keyboard.c (Qdelayed_warnings_hook): Define.
21121 (command_loop_1): Run `delayed-warnings-hook'
21122 if Vdelayed_warnings_list is non-nil.
21123 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21124 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21125
d178f871
EZ
211262011-04-28 Eli Zaretskii <eliz@gnu.org>
21127
21128 * doprnt.c (doprnt): Don't return value smaller than the buffer
21129 size if the message was truncated. (Bug#8545).
21130
b124fd93
JB
211312011-04-28 Juanma Barranquero <lekktu@gmail.com>
21132
21133 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21134 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21135
e810457d
PE
211362011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21137
21138 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21139
ea51cceb
JB
211402011-04-27 Juanma Barranquero <lekktu@gmail.com>
21141
21142 * makefile.w32-in: Update dependencies.
21143
94dcfacf
EZ
211442011-04-27 Eli Zaretskii <eliz@gnu.org>
21145
21146 Improve `doprnt' and its usage. (Bug#8545)
21147 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21148 `format_end'. Remove support for %l as a conversion specifier.
21149 Don't use xrealloc. Improve diagnostics when the %l size modifier
21150 is used. Update the commentary.
21151
21152 * eval.c (verror): Simplify calculation of size_t.
21153
21154 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21155 messages.
21156
f61f41d7
PE
211572011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21158
21159 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21160 change.
21161
96fb4434
PE
211622011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21163
21164 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21165 This makes this file independent of the recent pseudovector change.
21166
671875da 211672011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21168
69e9b5a3
PE
21169 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21170
b5f869a7 21171 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21172 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21173 Remove unused local.
c8926152 21174 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21175
841a1577 21176 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21177 GCC 4.6.0 optimizes based on type-based alias analysis.
21178 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21179 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21180 != &v->size, and therefore "v->size = 1; b->size = 2; return
21181 v->size;" must therefore return 1. This assumption is incorrect
21182 for Emacs, since it type-puns struct Lisp_Vector * with many other
21183 types. To fix this problem, this patch adds a new type struct
f904488f 21184 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21185 and pseudovectors, and helps optimizing compilers not get fooled
21186 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21187 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21188 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21189 the size member.
eab3844f
PE
21190 (XSETPVECTYPE): Rewrite in terms of new macro.
21191 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21192 This is a bit clearer, and further avoids the possibility of
21193 undesirable aliasing.
21194 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21195 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21196 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21197 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21198 (ASIZE): Now uses header.size rather than size.
21199 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21200 to avoid the hassle of writing XVECTOR (foo)->header.size.
21201 (struct vectorlike_header): New type.
eab3844f
PE
21202 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21203 object, to help avoid aliasing.
21204 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21205 (SUBRP): Likewise, since Lisp_Subr is a special case.
21206 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21207 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21208 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21209 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21210 changed to be "header.size" and "header.next".
21211 * buffer.h (struct buffer): Likewise.
21212 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21213 * frame.h (struct frame): Likewise.
21214 * process.h (struct Lisp_Process): Likewise.
21215 * termhooks.h (struct terminal): Likewise.
21216 * window.c (struct save_window_data, struct saved_window): Likewise.
21217 * window.h (struct window): Likewise.
21218 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21219 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21220 * buffer.c (init_buffer_once): Likewise.
21221 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21222 special case.
21223 * process.c (Fformat_network_address): Use local var for size,
21224 for brevity.
21225
0df1eac5
PE
21226 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21227
847ab9d1 21228 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21229 * data.c (atof): Remove decl; no longer used or needed.
21230 (digit_to_number): Move to lread.c.
21231 (Fstring_to_number): Use new string_to_number function, to be
21232 consistent with how the Lisp reader treats infinities and NaNs.
21233 Do not assume that floating-point numbers represent EMACS_INT
21234 without losing information; this is not true on most 64-bit hosts.
21235 Avoid double-rounding errors, by insisting on integers when
21236 parsing non-base-10 numbers, as the documentation specifies.
21237 * lisp.h (string_to_number): New decl, replacing ...
21238 (isfloat_string): Remove.
bc0a5c13 21239 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21240 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21241 appears to have been a coding error. Similarly, do not accept
21242 strings like +-1e0 as floating point numbers. Do not report
21243 overflow for integer overflows unless the base is not 10 which
21244 means we have no simple and reliable way to continue.
21245 Break out the floating-point parsing into a new
21246 function string_to_number, so that Fstring_to_number parses
21247 floating point numbers consistently with the Lisp reader.
04f2d78b 21248 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21249 (E_CHAR, EXP_INT): Remove, replacing with ...
21250 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21251 (string_to_number): New function, replacing isfloat_string.
21252 This function checks for valid syntax and produces the resulting
21253 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21254 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21255 so that overflow for non-base-10 numbers is reported only when
21256 there's no portable and simple way to convert to floating point.
452f4150 21257
67769ffc
PE
21258 * textprop.c (set_text_properties_1): Rewrite for clarity,
21259 and to avoid GCC warning about integer overflow.
21260
c20db43f
PE
21261 * intervals.h (struct interval): Use EMACS_INT for members
21262 where EMACS_UINT might cause problems. See
21263 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21264 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21265 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21266 All uses changed.
37aa2f85
PE
21267 (offset_intervals): Tell GCC not to worry about length overflow
21268 when negating a negative length.
c20db43f 21269
2538aa2f
PE
21270 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21271 (overrun_check_free): Likewise.
21272
f2d3008d
PE
21273 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21274 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21275 word size.
21276
ec8df744
PE
21277 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21278 (gnutls_make_error): Rename local to avoid shadowing.
21279 (gnutls_emacs_global_deinit): ifdef out; not used.
21280 (Fgnutls_boot): Use const for pointer to readonly storage.
21281 Comment out unused local. Fix pointer signedness problems.
21282
640ee02d
PE
21283 * lread.c (openp): Don't stuff size_t into an 'int'.
21284 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21285 about possible signed overflow.
21286
6048fb2a
PE
21287 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21288 (GDK_KEY_g): Don't define if already defined.
21289 (xg_prepare_tooltip): Avoid pointer signedness problem.
21290 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21291
fa3c87e1
PE
21292 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21293 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21294
2172544b
PE
21295 * xfns.c (Fx_window_property): Simplify a bit,
21296 to make a bit faster and to avoid GCC 4.6.0 warning.
21297 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21298
9b821a21
PE
21299 * fns.c (internal_equal): Don't assume size_t fits in int.
21300
3c616cfa
PE
21301 * alloc.c (compact_small_strings): Tighten assertion a little.
21302
c2982e87
PE
21303 Replace pEd with more-general pI, and fix some printf arg casts.
21304 * lisp.h (pI): New macro, generalizing old pEd macro to other
21305 conversion specifiers. For example, use "...%"pI"d..." rather
21306 than "...%"pEd"...".
21307 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21308 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21309 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21310 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21311 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21312 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21313 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21314 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21315 64-bit hosts.
21316 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21317 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21318 * print.c (safe_debug_print, print_object): Likewise.
21319 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21320 to int.
6f04d126
PE
21321 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21322 avoiding the 0 flag, which is not portable.
c2982e87
PE
21323 * process.c (Fmake_network_process): Use pI to avoid cast.
21324 * region-cache.c (pp_cache): Likewise.
21325 * xdisp.c (decode_mode_spec): Likewise.
21326 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21327 behavior on 64-bit hosts with printf arg.
6f04d126 21328 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21329 (x_stop_queuing_selection_requests): Likewise.
21330 (x_get_window_property): Don't truncate byte count to an 'int'
21331 when tracing.
0b432f21 21332
5e073ec7
PE
21333 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21334 here, since it parses constructs like leading '-' and spaces,
21335 which are not wanted; and it overflows with large numbers.
21336 Instead, simply match F[0-9]+, which is what is wanted anyway.
21337
36372bf9
PE
21338 * alloc.c: Remove unportable assumptions about struct layout.
21339 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21340 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21341 (allocate_vectorlike, make_pure_vector): Use the new macros,
21342 plus offsetof, to remove unportable assumptions about struct layout.
21343 These assumptions hold on all porting targets that I know of, but
21344 they are not guaranteed, they're easy to remove, and removing them
21345 makes further changes easier.
21346
0b432f21
PE
21347 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21348 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21349 (string_overrun_cookie): Now const. Use initializers that
21350 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21351 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21352 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21353 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21354 multiple of sizeof (EMACS_INT); it need not be, if
21355 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21356 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21357
895009e1
JB
213582011-04-26 Juanma Barranquero <lekktu@gmail.com>
21359
21360 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21361
6a7a1b0b
TZ
213622011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21363
21364 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21365 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21366 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21367
841a1577 213682011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21369
21370 * lisp.h (Qdebug): List symbol.
895009e1 21371 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21372 * keyboard.c (debug-on-event): New variable.
21373 (handle_user_signal): Break into debugger when debug-on-event
21374 matches the current signal symbol.
21375
f2d3ba6f
DN
213762011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21377
21378 * alloc.c (check_sblock, check_string_bytes)
21379 (check_string_free_list): Convert to standard C.
21380
42ce4c63
TZ
213812011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21382
21383 * w32.c (emacs_gnutls_push): Fix typo.
21384
825cd63c
EZ
213852011-04-25 Eli Zaretskii <eliz@gnu.org>
21386
fb11d64d
EZ
21387 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21388 "cast to pointer from integer of different size".
21389
825cd63c
EZ
21390 Improve doprnt and its use in verror. (Bug#8545)
21391 * doprnt.c (doprnt): Document the set of format control sequences
21392 supported by the function. Use SAFE_ALLOCA instead of always
21393 using `alloca'.
21394
21395 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21396 is one byte too soon. Don't use xrealloc; instead xfree and
21397 xmalloc anew.
21398
e061a11b
TZ
213992011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21400
21401 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21402 callbacks stage.
21403
21404 * gnutls.c: Renamed global_initialized to
21405 gnutls_global_initialized. Added internals for the
21406 :verify-hostname-error, :verify-error, and :verify-flags
21407 parameters of `gnutls-boot' and documented those parameters in the
21408 docstring. Start callback support.
9173deec
JB
21409 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21410 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21411 on error. Return error code.
e061a11b
TZ
21412 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21413 (emacs_gnutls_read): Likewise.
21414 (Fgnutls_boot): Return handshake error code.
21415 (emacs_gnutls_handle_error): New function.
21416 (wsaerror_to_errno): Likewise.
21417
21418 * w32.h (emacs_gnutls_pull): Add prototype.
21419 (emacs_gnutls_push): Likewise.
21420
21421 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21422 (emacs_gnutls_push): Likewise.
21423
214242011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21425
21426 * process.c (wait_reading_process_output): Check if GnuTLS
21427 buffered some data internally if no FDs are set for TLS
21428 connections.
21429
21430 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21431 (LIBS): Link to USER_LIBS.
21432 ($(BLD)/gnutls.$(0)): New target.
21433
fa6996bc
EZ
214342011-04-24 Eli Zaretskii <eliz@gnu.org>
21435
eb35682e
EZ
21436 * xdisp.c (handle_single_display_spec): Rename the
21437 display_replaced_before_p argument into display_replaced_p, to
21438 make it consistent with the commentary. Fix typos in the
21439 commentary.
21440
e2ad650c
EZ
21441 * textprop.c (syms_of_textprop): Remove dead code.
21442 (copy_text_properties): Delete obsolete commentary about an
21443 interface that was deleted long ago. Fix typos in the description
21444 of arguments.
21445
1b2de274
EZ
21446 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21447 to changes in oldXMenu/XMenu.h from 2011-04-16.
21448 <menu_help_message, prev_menu_help_message>: Constify.
21449 (IT_menu_make_room): menu->help_text is now `const char **';
21450 adjust.
21451
21452 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21453 to changes in oldXMenu/XMenu.h from 2011-04-16.
21454 (struct XMenu): Declare `help_text' `const char **'.
21455
21456 * xfaces.c <Qunspecified>: Make extern again.
21457
21458 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21459 required by POSIX.
1b2de274 21460
762b15be
EZ
21461 * doc.c (get_doc_string): Improve the format passed to `error'.
21462
21463 * doprnt.c (doprnt): Improve commentary.
21464
21465 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21466
21467 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21468 them with etags.
21469
f1052e5d
EZ
21470 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21471 changes in globals.h immediately force recompilation.
762b15be
EZ
21472 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21473 $(CURDIR)/s/ms-w32.h.
21474 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21475
fa6996bc
EZ
21476 * character.c (Fchar_direction): Function deleted.
21477 (syms_of_character): Don't defsubr it.
21478 <char-direction-table>: Deleted.
21479
e6c3da20
EZ
214802011-04-23 Eli Zaretskii <eliz@gnu.org>
21481
21482 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21483 * doprnt.c: Include limits.h.
21484 (SIZE_MAX): New macro.
04f2d78b
CB
21485 (doprnt): Return a size_t value. 2nd arg is now size_t.
21486 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21487 Improve overflow protection. Support `l' modifier for integer
21488 conversions. Support %l conversion. Don't assume an EMACS_INT
21489 argument for integer conversions and for %c.
21490
21491 * lisp.h (doprnt): Restore prototype.
21492
21493 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21494 $(SRC)/character.h.
21495
21496 * Makefile.in (base_obj): Add back doprnt.o.
21497
21498 * deps.mk (doprnt.o): Add back prerequisites.
21499 (callint.o): Depend on character.h.
21500
21501 * eval.c (internal_lisp_condition_case): Include the handler
21502 representation in the error message.
21503 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21504 when breaking from the loop.
21505
21506 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21507
21508 * callint.c (Fcall_interactively): When displaying error message
21509 about invalid control letter, pass the character's codepoint, not
21510 a pointer to its multibyte form. Improve display of the character
21511 in octal and display also its hex code.
21512
21513 * character.c (char_string): Use %x to display the (unsigned)
21514 codepoint of an invalid character, to avoid displaying a bogus
21515 negative value.
21516
21517 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21518 `error', not SYMBOL_NAME itself.
21519
21520 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21521 character arguments to `error'.
21522
21523 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21524 to `error' in error message about FINAL_CHAR argument. Make sure
21525 FINAL_CHAR is a character, and use %c when it is passed as
21526 argument to `error'.
21527
4ffd0d6b 215282011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21529
21530 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21531
21532 * w32.c: Include <time.h>.
21533 (sys_localtime): New function.
21534
4ffd0d6b 215352011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21536
21537 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21538
4ffd0d6b 21539 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21540
4ffd0d6b 215412011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21542
4ffd0d6b
GM
21543 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21544 zombies (Bug#8467).
aac0c6e3 21545
04c56954
EZ
215462011-04-19 Eli Zaretskii <eliz@gnu.org>
21547
21548 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21549 gl_state.e_property when gl_state.object is Qt.
21550
21551 * insdel.c (make_gap_larger): Remove limitation of buffer size
21552 to <= INT_MAX.
21553
16a43933
CY
215542011-04-18 Chong Yidong <cyd@stupidchicken.com>
21555
21556 * xdisp.c (lookup_glyphless_char_display)
21557 (produce_glyphless_glyph): Handle cons cell entry in
21558 glyphless-char-display.
21559 (Vglyphless_char_display): Document it.
21560
21561 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21562 glyphless-char-display.
21563
4581706e
CY
215642011-04-17 Chong Yidong <cyd@stupidchicken.com>
21565
21566 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21567
21568 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21569
21570 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21571 definition for no-X builds.
21572
4887c6e2 215732011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21574
fd35b6f9
PE
21575 Static checks with GCC 4.6.0 and non-default toolkits.
21576
5c1ccb01
PE
21577 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21578
006c5daa
PE
21579 * process.c (keyboard_bit_set): Define only if SIGIO.
21580 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21581 (send_process): Repair possible setjmp clobbering.
21582
efc736d3
PE
21583 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21584
4e2fe2e6
PE
21585 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21586
f97334a2
PE
21587 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21588
4e75f29d
PE
21589 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21590 Define only if needed.
21591
90efadd1
PE
21592 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21593 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21594 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21595
3c647824
PE
21596 * dispextern.h (struct redisplay_interface): Rename param
21597 to avoid shadowing.
e264f262 21598 * termhooks.h (struct terminal): Likewise.
761383f4 21599 * xterm.c (xembed_send_message): Likewise.
3c647824 21600
b58c5c4a
PE
21601 * insdel.c (make_gap_smaller): Define only if
21602 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21603
cad59032
PE
21604 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21605 it.
21606
c339dc2e
PE
21607 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21608 so that we aren't warned about unused symbols.
21609
91a3e27b
PE
21610 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21611
399c71d3 21612 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21613
8ffc96f5
PE
21614 * xfns.c (x_real_positions): Mark locals as initialized.
21615
eef9bc79
PE
21616 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21617
098db9dd
PE
21618 * xterm.c: Fix problems found by static analysis with other toolkits.
21619 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21620 (x_dispatch_event): Declare static if USE_GTK, and
21621 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21622 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21623 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21624 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21625 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21626
eb18f6cc
PE
21627 * xmenu.c (menu_help_callback): Pointer type fixes.
21628 Use const pointers when pointing at readonly data. Avoid pointer
21629 signedness clashes.
21630 (FALSE): Remove unused macro.
21631 (update_frame_menubar): Remove unused decl.
21632
1fe72bf8
PE
21633 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21634
60d9e1db
PE
21635 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21636 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21637 (single_menu_item): Rename local to avoid shadowing.
21638
39261c26
PE
21639 * keyboard.c (make_lispy_event): Remove unused local var.
21640
018c5e19
PE
21641 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21642 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21643
63d2b86e
PE
21644 * bitmaps: Change bitmaps from unsigned char back to the X11
21645 compatible char. Avoid the old compiler warnings about
21646 out-of-range initializers by using, for example, '\xab' rather
21647 than 0xab.
21648
aefd87e1
PE
21649 * xgselect.c (xgselect_initialize): Check vs interface
21650 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21651
bf501fb9
PE
21652 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21653
e9829fdf
PE
21654 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21655 to read-only memory.
21656
1086c095
PE
21657 * fns.c (vector): Remove; this old hack is no longer needed.
21658
2baccd04 21659 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21660 Remove unused var.
dde42981 21661 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21662
72391843 21663 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21664
436c16df 21665 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21666 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21667 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21668
92bb796d 21669 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21670 (x_term_init): Remove local to avoid shadowing.
92bb796d 21671
764430a3 21672 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21673
21674 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21675 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21676
d1dfb56c
EZ
216772011-04-16 Eli Zaretskii <eliz@gnu.org>
21678
c4354cb4
EZ
21679 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21680
d1dfb56c
EZ
21681 Fix regex.c, syntax.c and friends for buffers > 2GB.
21682 * syntax.h (struct gl_state_s): Declare character position members
21683 EMACS_INT.
21684
21685 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21686
04f2d78b
CB
21687 * textprop.c (verify_interval_modification, interval_of):
21688 Declare arguments EMACS_INT.
d1dfb56c
EZ
21689
21690 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21691 EMACS_INT.
21692
21693 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21694
21695 * indent.c (Fvertical_motion): Local variable it_start is now
21696 EMACS_INT.
21697
21698 * regex.c (re_match, re_match_2, re_match_2_internal)
21699 (bcmp_translate, regcomp, regexec, print_double_string)
21700 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21701 (re_compile_pattern, re_exec): Declare arguments and local
21702 variables `size_t' and `ssize_t' and return values `regoff_t', as
21703 appropriate.
21704 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21705 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21706 <compile_stack_type>: `size' and `avail' are now `size_t'.
21707
21708 * regex.h <regoff_t>: Use ssize_t, not int.
21709 (re_search, re_search_2, re_match, re_match_2): Arguments that
21710 specify buffer/string position and length are now ssize_t and
21711 size_t. Return type is regoff_t.
21712
613052cd
BK
217132011-04-16 Ben Key <bkey76@gmail.com>
21714
21715 * nsfont.m: Fixed bugs in ns_get_family and
21716 ns_descriptor_to_entity that were caused by using free to
21717 deallocate memory blocks that were allocated by xmalloc (via
21718 xstrdup). This caused Emacs to crash when compiled with
21719 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21720 --enable-checking=xmallocoverrun). xfree is now used to
21721 deallocate these memory blocks.
21722
4170f62f 217232011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21724
71b41406
PE
21725 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21726
9587a89d
PE
21727 emacs_write: Accept and return EMACS_INT for sizes.
21728 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21729 et seq.
21730 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21731 Accept and return EMACS_INT.
21732 (emacs_gnutls_write): Return the number of bytes written on
21733 partial writes.
21734 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21735 (emacs_read, emacs_write): Remove check for negative size, as the
21736 Emacs source code has been audited now.
9587a89d
PE
21737 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21738 (emacs_read, emacs_write): Use it.
273a5f82
PE
21739 * process.c (send_process): Adjust to the new signatures of
21740 emacs_write and emacs_gnutls_write. Do not attempt to store
21741 a byte offset into an 'int'; it might overflow.
9587a89d 21742 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21743
3e047f51
PE
21744 * sound.c: Don't assume sizes fit in 'int'.
21745 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21746 Return EMACS_INT, not int.
3e047f51 21747 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21748 Accept EMACS_INT, not int.
21749 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21750 record read return values.
21751
cc39a9db
BK
217522011-04-15 Ben Key <bkey76@gmail.com>
21753
c9d0ec6d
JB
21754 * keyboard.c (Qundefined): Don't declare static since it is used
21755 in nsfns.m.
21756 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21757 static since they are used in nsfont.m.
cc39a9db 21758
6c60eb9f
SM
217592011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21760
21761 * process.c (Qprocessp): Don't declare static.
21762 * lisp.h (Qprocessp): Declare again.
21763
7990b61a
JB
217642011-04-15 Juanma Barranquero <lekktu@gmail.com>
21765
21766 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21767
5d4cb038
PE
217682011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21769
8bd7b830 21770 Improve C-level modularity by making more things 'static'.
cd64ea1d 21771
e3b27b31
PE
21772 Don't publish debugger-only interfaces to other modules.
21773 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21774 (verify_bytepos, count_markers): Move decls to the only modules
21775 that need them.
21776 * region-cache.h (pp_cache): Likewise.
21777 * window.h (check_all_windows): Likewise.
21778 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21779
5d4cb038
PE
21780 * sysdep.c (croak): Now static, if
21781 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21782 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21783
21784 * alloc.c (refill_memory_reserve): Now static if
21785 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21786 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21787
e87b6180
PE
21788 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21789 Define only if USE_LUCID.
21790
ac64929e
PE
21791 * xrdb.c (x_customization_string, x_rm_string): Now static.
21792
6f37259d
PE
21793 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21794 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21795
1683e3ab
PE
21796 * xdisp.c (draw_row_with_mouse_face): Now static.
21797 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21798
de9c2632
PE
21799 * window.h (check_all_windows): Mark externally visible.
21800
2b96acb7
PE
21801 * window.c (window_deletion_count): Now static.
21802
21803 * undo.c: Make symbols static if they're not exported.
21804 (last_undo_buffer, last_boundary_position, pending_boundary):
21805 Now static.
21806
50436f33
PE
21807 * textprop.c (interval_insert_behind_hooks): Now static.
21808 (interval_insert_in_front_hooks): Likewise.
21809
64520e5c
PE
21810 * term.c: Make symbols static if they're not exported.
21811 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21812 (max_frame_lines, tty_set_terminal_modes):
21813 (tty_reset_terminal_modes, tty_turn_off_highlight):
21814 (get_tty_terminal): Now static.
21815 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21816 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21817 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21818 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21819 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21820
1fa53021
PE
21821 * sysdep.c: Make symbols static if they're not exported.
21822 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21823 Now static.
21824 (sigprocmask_set, full_mask): Remove; unused.
21825 (wait_debugging): Mark as visible.
21826 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21827 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21828
d4b43b22
PE
21829 * syntax.c (syntax_temp): Define only if !__GNUC__.
21830
b7c513d0
PE
21831 * sound.c (current_sound_device, current_sound): Now static.
21832
989b29ad
PE
21833 * search.c (searchbufs, searchbuf_head): Now static.
21834
13a55a78
PE
21835 * scroll.c (scroll_cost): Remove; unused.
21836 * dispextern.h (scroll_cost): Remove decl.
21837
de68a1fc
PE
21838 * region-cache.h (pp_cache): Mark as externally visible.
21839
40ccffa6
PE
21840 * process.c: Make symbols static if they're not exported.
21841 (process_tick, update_tick, create_process, chan_process):
21842 (Vprocess_alist, proc_buffered_char, datagram_access):
21843 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21844 (deactivate_process): Mark defn as static, as well as decl.
21845 * lisp.h (create_process): Remove decl.
21846 * process.h (chan_process, Vprocess_alist): Remove decls.
21847
ad64fc97
PE
21848 * print.c: Make symbols static if they're not exported.
21849 (print_depth, new_backquote_output, being_printed, print_buffer):
21850 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21851 (print_interval, print_number_index, initial_stderr_stream):
21852 Now static.
21853 * lisp.h (Fprinc): Remove decl.
21854 (debug_output_compilation_hack): Mark as externally visible.
21855
adddb265
PE
21856 * sysdep.c (croak): Move decl from here to syssignal.h.
21857 * syssignal.h (croak): Put it here, so the API can be checked when
21858 'croak' is called from dissociate_if_controlling_tty.
21859
1717ede2
PE
21860 * minibuf.c: Make symbols static if they're not exported.
21861 (minibuf_save_list, choose_minibuf_frame): Now static.
21862 * lisp.h (choose_minibuf_frame): Remove decl.
21863
fa5fb2bc
PE
21864 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21865
1e3890d1
PE
21866 * lread.c: Make symbols static if they're not exported.
21867 (read_objects, initial_obarray, oblookup_last_bucket_number):
21868 Now static.
21869 (make_symbol): Remove; unused.
21870 * lisp.h (initial_obarray, make_symbol): Remove decls.
21871
8a1414fa
PE
21872 * keyboard.c: Make symbols static if they're not exported.
21873 (single_kboard, recent_keys_index, total_keys, recent_keys):
21874 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21875 (this_single_command_key_start, echoing, last_auto_save):
21876 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21877 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21878 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21879 (Vlispy_mouse_stem, double_click_count):
21880 Now static.
21881 (force_auto_save_soon): Define only if SIGDANGER.
21882 (ignore_mouse_drag_p): Now static if
21883 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21884 (print_help): Remove; unused.
21885 (stop_character, last_timer_event): Mark as externally visible.
21886 * keyboard.h (ignore_mouse_drag_p): Declare only if
21887 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21888 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21889 * lisp.h (echoing): Remove decl.
21890 (force_auto_save_soon): Declare only if SIGDANGER.
21891 * xdisp.c (redisplay_window): Simplify code, to make it more
21892 obvious that ignore_mouse_drag_p is not accessed if !defined
21893 USE_GTK && !defined HAVE_NS.
21894
93ea6e8f
PE
21895 * intervals.c: Make symbols static if they're not exported.
21896 (merge_properties_sticky, merge_interval_right, delete_interval):
21897 Now static.
21898 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21899
77382fcc
PE
21900 * insdel.c: Make symbols static if they're not exported.
21901 However, leave prepare_to_modify_buffer alone. It's never
21902 called from outside this function, but that appears to be a bug.
21903 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21904 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21905 (adjust_after_replace_noundo): Remove; unused.
21906 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21907 (signal_before_change): Remove decls.
77382fcc 21908
9306c32e
PE
21909 * indent.c (val_compute_motion, val_vmotion): Now static.
21910
cd44d2eb
PE
21911 * image.c: Make symbols static if they're not exported.
21912 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21913 if USE_GTK.
21914 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21915 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21916
ad9a7a06
PE
21917 * fringe.c (standard_bitmaps): Now static.
21918 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21919
81626931
PE
21920 * frame.c: Make symbols static if they're not exported.
21921 (x_report_frame_params, make_terminal_frame): Now static.
21922 (get_frame_param): Now static, unless HAVE_NS.
21923 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21924 (x_get_resource_string): Remove; not used.
21925 * frame.h (make_terminal_frame, x_report_frame_params):
21926 (x_get_resource_string); Remove decls.
21927 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21928 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21929
239f9db9
PE
21930 * font.c, fontset.c: Make symbols static if they're not exported.
21931 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21932 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21933 * font.c (font_close_object): Now static.
21934 * font.h (font_close_object): Remove.
21935 * fontset.c (FONTSET_OBJLIST): Remove.
21936 (free_realized_fontset) #if-0 the body, which does nothing.
21937 (face_suitable_for_char_p): #if-0, as it's never called.
21938 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21939 * xfaces.c (face_at_string_position):
21940 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21941 since 0 is always ASCII.
21942
dfcf3579
PE
21943 * fns.c (weak_hash_tables): Now static.
21944
5045092b
PE
21945 * fileio.c: Make symbols static if they're not exported.
21946 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21947 (Vwrite_region_annotation_buffers): Now static.
21948
57a96f5c
PE
21949 * eval.c: Make symbols static if they're not exported.
21950 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21951 * lisp.h (backtrace_list): Remove decl.
21952
35f08c38
PE
21953 * emacs.c: Make symbols static if they're not exported.
21954 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21955 (fatal_error_code, fatal_error_signal_hook, standard_args):
21956 Now static.
21957 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21958 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21959 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21960 * lisp.h (fatal_error_signal_hook): Remove decl.
21961 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21962
f44bd759
PE
21963 * editfns.c: Move a (normally-unused) function to its only use.
21964 * editfns.c, lisp.h (get_operating_system_release): Remove.
21965 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21966 worth the hassle of breaking this out.
21967
b532497d
PE
21968 * xterm.c: Make symbols static if they're not exported.
21969 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21970 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21971 (x_destroy_window, x_delete_display):
21972 Now static.
21973 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21974 (x_mouse_leave): Remove; unused.
21975 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21976 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21977 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21978 Remove decls.
21979 (x_mouse_leave): Declare only if WINDOWSNT.
21980 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21981 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21982 USE_X_TOOLKIT.
21983
1675728f
PE
21984 * ftxfont.c: Make symbols static if they're not exported.
21985 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21986 HAVE_FREETYPE.
21987 * font.h (ftxfont_driver): Likewise.
21988
e4cebfca
PE
21989 * xfns.c: Make symbols static if they're not exported.
21990 (x_last_font_name, x_display_info_for_name):
21991 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21992 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21993 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21994 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21995 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21996 (last_show_tip_args): Now static.
21997 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21998 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21999 (x_screen_planes): Remove; unused.
22000 * dispextern.h (x_screen_planes): Remove decl.
22001
5bf46f05
PE
22002 * dispnew.c: Make symbols static if they're not exported.
22003 * dispextern.h (redraw_garbaged_frames, scrolling):
22004 (increment_row_positions): Remove.
22005 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22006 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22007 Now static.
22008 (redraw_garbaged_frames): Remove; unused.
22009
435f4c28
PE
22010 * xfaces.c: Make symbols static if they're not exported.
22011 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22012 Remove decls.
22013 * xterm.h (defined_color): Remove decls.
22014 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22015 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22016 (menu_face_changed_default, defined_color, free_realized_face):
22017 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22018 (ascii_face_of_lisp_face): Remove; unused.
22019
8524aef3
PE
22020 * xdisp.c: Make symbols static if they're not exported.
22021 * dispextern.h (scratch_glyph_row, window_box_edges):
22022 (glyph_to_pixel_coords, set_cursor_from_row):
22023 (get_next_display_element, set_iterator_to_next):
22024 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22025 (show_mouse_face): Remove decls
22026 * frame.h (message_buf_print): Likewise.
22027 * lisp.h (pop_message, set_message, check_point_in_composition):
22028 Likewise.
22029 * xterm.h (set_vertical_scroll_bar): Likewise.
22030 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22031 (message_buf_print, scratch_glyph_row, displayed_buffer):
22032 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22033 (get_next_display_element, show_mouse_face, window_box_edges):
22034 (frame_to_window_pixel_xy, check_point_in_composition):
22035 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22036 (glyph_to_pixel_coords): Remove; unused.
22037
16390cd2
PE
22038 * dired.c (file_name_completion): Now static.
22039
22040 * dbusbind.c (xd_in_read_queued_messages): Now static.
22041
a25f4dfa
PE
22042 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22043 * data.c (circular_list_error): Remove.
22044
14a9c8df
PE
22045 * commands.h (last_point_position, last_point_position_buffer):
22046 (last_point_position_window): Remove decls.
22047 * keyboard.c: Make these variables static.
22048
04f2d78b
CB
22049 * coding.h (coding, code_convert_region, encode_coding_gap):
22050 Remove decls.
74ab6df5
PE
22051 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22052 (iso_code_class, detect_coding, code_convert_region): Now static.
22053 (encode_coding_gap): Remove; unused.
22054
38dfbee1
PE
22055 * chartab.c (chartab_chars, chartab_bits): Now static.
22056
a2cb4e63
PE
22057 * charset.h (charset_iso_8859_1): Remove decl.
22058 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22059 Now static.
22060
127198fd
PE
22061 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22062 * ccl.c (Vccl_program_table): Now static.
22063 (check_ccl_update): Remove; unused.
22064
d85b608f
PE
22065 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22066 * category.h: ... from here.
22067 * category.c (check_category_table, set_category_set): Now static.
22068
31cd66f3
PE
22069 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22070 * lisp.h: Remove these decls.
22071
c358e587
PE
22072 * buffer.c (buffer_count): Remove unused var.
22073
e78aecca
PE
22074 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22075 so that it's not optimized away.
22076 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22077 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22078 exported only to the debugger.
22079
e192d7d3 22080 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 22081 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 22082
92470028
PE
22083 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22084 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22085 was inaccessible from Lisp.
22086 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22087 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22088
244ed907
PE
22089 alloc.c: Import and export fewer symbols, and remove unused items.
22090 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22091 is defined.
22092 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22093 it's not optimized away by whole-program optimization.
22094 (message_enable_multibyte, free_misc): Remove.
22095 (catchlist, handlerlist, mark_backtrace):
22096 Declare only if BYTE_MARK_STACK.
22097 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22098 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22099 (message_enable_multibyte): Remove decl.
22100 (free_misc, interval_free_list, float_block, float_block_index):
22101 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22102 (cons_free_list, last_marked_index):
22103 Now static.
22104 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22105 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22106 (mark_backtrace): Define only if BYTE_MARK_STACK.
22107 * xdisp.c (message_enable_multibyte): Now static.
22108
61c2b50e 22109 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
22110 This makes it easier for human readers (and static analyzers)
22111 to see whether these variables are used from other modules.
22112 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22113 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22114 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22115 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22116 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22117 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22118 * xmenu.c, xselect.c:
22119 Declare Q* vars static if they are not used in other modules.
22120 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22121 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22122 Remove decls of unexported vars.
22123 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22124
95c82688
PE
22125 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22126
16a97296
PE
22127 Make Emacs functions such as Fatom 'static' by default.
22128 This makes it easier for human readers (and static analyzers)
22129 to see whether these functions can be called from other modules.
22130 DEFUN now defines a static function. To make the function external
22131 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
22132 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22133 (Finit_image_library):
16a97296
PE
22134 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22135 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22136 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22137 Remove decls, since these functions are now static.
22138 (Funintern, Fget_internal_run_time): New decls, since these functions
22139 were already external.
95c82688 22140
16a97296
PE
22141 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22142 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22143 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22144 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22145 * keyboard.c, keymap.c, lread.c:
22146 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22147 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22148 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22149 Mark functions with DEFUE instead of DEFUN,
22150 if they are used in other modules.
22151 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22152 decls for now-static functions.
22153 * buffer.h (Fdelete_overlay): Remove decl.
22154 * callproc.c (Fgetenv_internal): Mark as internal.
22155 * composite.c (Fremove_list_of_text_properties): Remove decl.
22156 (Fcomposition_get_gstring): New forward static decl.
22157 * composite.h (Fcomposite_get_gstring): Remove decl.
22158 * dired.c (Ffile_attributes): New forward static decl.
22159 * doc.c (Fdocumntation_property): New forward static decl.
22160 * eval.c (Ffetch_bytecode): New forward static decl.
22161 (Funintern): Remove extern decl; now in .h file where it belongs.
22162 * fileio.c (Fmake_symbolic_link): New forward static decl.
22163 * image.c (Finit_image_library): New forward static decl.
22164 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22165 * intervals.h (Fprevious_property_change):
22166 (Fremove_list_of_text_properties): Remove decls.
22167 * keyboard.c (Fthis_command_keys): Remove decl.
22168 (Fcommand_execute): New forward static decl.
22169 * keymap.c (Flookup_key): New forward static decl.
22170 (Fcopy_keymap): Now static.
22171 * keymap.h (Flookup_key): Remove decl.
22172 * process.c (Fget_process): New forward static decl.
22173 (Fprocess_datagram_address): Mark as internal.
22174 * syntax.c (Fsyntax_table_p): New forward static decl.
22175 (skip_chars): Remove duplicate decl.
22176 * textprop.c (Fprevious_property_change): New forward static decl.
22177 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22178 Now internal.
22179 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22180 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22181
785bbd42
PE
22182 * editfns.c (Fformat): Remove unreachable code.
22183
8b913b57
AS
221842011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22185
22186 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22187 change. (Bug#8496)
22188
a6744a35
EZ
221892011-04-13 Eli Zaretskii <eliz@gnu.org>
22190
22191 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22192 when at ZV. (Bug#8487)
22193
e7974947
AS
221942011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22195
baad03f0
AS
22196 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22197 (Bug#8437)
22198 * keyboard.c (parse_tool_bar_item): Likewise.
22199 * sound.c (sound_cleanup, alsa_close): Likewise.
22200 * termcap.c (tgetent): Likewise.
22201 * xfns.c (x_default_font_parameter): Likewise.
22202 * xsettings.c (read_and_apply_settings): Likewise.
22203
e7974947
AS
22204 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22205 (overrun_check_free): Protoize.
22206
28272684
PE
222072011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22208
22209 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22210 since callers should never pass a negative size.
22211 Change the signature to match that of plain 'read' and 'write'; see
22212 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22213 * lisp.h: Update prototypes of emacs_write and emacs_read.
22214
11997c76
EZ
222152011-04-11 Eli Zaretskii <eliz@gnu.org>
22216
22217 * xdisp.c (redisplay_window): Don't try to determine the character
22218 position of the scroll margin if the window start point w->startp
e896f03c 22219 is outside the buffer's accessible region. (Bug#8468)
11997c76 22220
8a2cbd72
EZ
222212011-04-10 Eli Zaretskii <eliz@gnu.org>
22222
22223 Fix write-region and its subroutines for buffers > 2GB.
22224 * fileio.c (a_write, e_write): Modify declaration of arguments and
22225 local variables to support buffers larger than 2GB.
22226 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22227
22228 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22229 argument, local variables, and return value.
22230
22231 * lisp.h: Update prototypes of emacs_write and emacs_read.
22232
22233 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22234
4073e537 222352011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22236
1ebfdcb6
PE
22237 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22238
b2ded58d
PE
22239 Fix more problems found by GCC 4.6.0's static checks.
22240
7d66342c
PE
22241 * xdisp.c (vmessage): Use a better test for character truncation.
22242
bbf47d44
PE
22243 * charset.c (load_charset_map): <, not <=, for optimization,
22244 and to avoid potential problems with integer overflow.
9248994d 22245 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22246 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22247 * editfns.c (Fformat): Likewise.
1e69125e 22248 * syntax.c (skip_chars): Likewise.
3befa583 22249
e3019616
PE
22250 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22251 This also lets GCC 4.6.0 generate slightly better loop code.
22252
becfa255
PE
22253 * callint.c (Fcall_interactively): <, not <=, for optimization.
22254 (Fcall_interactively): Count the number of arguments produced,
22255 not the number of arguments given. This is simpler and lets GCC
22256 4.6.0 generate slightly better code.
22257
dae0cd48
PE
22258 * ftfont.c: Distingish more carefully between FcChar8 and char.
22259 The previous code passed unsigned char * to a functions like
22260 strlen and xstrcasecmp that expect char *, which does not
22261 conform to the C standard.
22262 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22263 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22264 char * when the C standard requires it.
22265
76032d70
PE
22266 * keyboard.c (read_char): Remove unused var.
22267
eb3f1cc8
PE
22268 * eval.c: Port to Windows vsnprintf (Bug#8435).
22269 Include <limits.h>.
22270 (SIZE_MAX): Define if the headers do not.
22271 (verror): Do not give up if vsnprintf returns a negative count.
22272 Instead, grow the buffer. This ports to Windows vsnprintf, which
22273 does not conform to C99. Problem reported by Eli Zaretskii.
22274 Also, simplify the allocation scheme, by avoiding the need for
22275 calling realloc, and removing the ALLOCATED variable.
22276
70476b54
PE
22277 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22278
12020a9e
PE
22279 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22280 But keep the doprint source code for now, as we might revamp it
22281 and use it again (Bug#8435).
ea6c7ae6
PE
22282 * lisp.h (doprnt): Remove.
22283 * Makefile.in (base_obj): Remove doprnt.o.
22284 * deps.mk (doprnt.o): Remove.
22285
5fdb398c
PE
22286 error: Print 32- and 64-bit integers portably (Bug#8435).
22287 Without this change, on typical 64-bit hosts error ("...%d...", N)
22288 was used to print both 32- and 64-bit integers N, which relied on
22289 undefined behavior.
61bdb816 22290 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22291 * lisp.h (error, verror): Mark as printf-like functions.
22292 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22293 Report overflow in size calculations when allocating printf buffer.
22294 Do not truncate output string at its first null byte.
22295 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22296 Truncate the output at a character boundary, since vsnprintf does not
22297 do that.
22298 * charset.c (check_iso_charset_parameter): Convert internal
22299 character to string before calling 'error', since %c now has the
22300 printf meaning.
22301 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22302 overflow when computing char to be passed to 'error'. Do not
22303 pass Lisp_Object to 'error'; pass the integer instead.
22304 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22305 formatted with plain %d.
22306
b189fa66
PE
22307 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22308
bff87ef0
PE
22309 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22310
7e2cac20
PE
22311 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22312
ce4d90b5
PE
22313 * xterm.c (x_catch_errors): Remove duplicate declaration.
22314
266c9547
PE
22315 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22316
79c49ad2
PE
22317 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22318
368f4090
JM
223192011-04-10 Jim Meyering <meyering@redhat.com>
22320
22321 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22322 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22323 return ssize_t not "int", and use size_t as the buffer length.
22324 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22325 * gnutls.h: Update declarations.
22326 * process.c (read_process_output): Use ssize_t, to match.
22327 (send_process): Likewise.
22328
a32d4040
CY
223292011-04-09 Chong Yidong <cyd@stupidchicken.com>
22330
22331 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22332
8546720e 223332011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22334
04f2d78b
CB
22335 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22336 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22337
8546720e
GM
22338 * xterm.c (handle_one_xevent):
22339 * xmenu.c (create_and_show_popup_menu):
22340 * xselect.c (x_decline_selection_request)
22341 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22342
0a2f5c1a 223432011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22344
22345 Fix some uses of `int' instead of EMACS_INT.
22346 * search.c (string_match_1, fast_string_match)
22347 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22348 (scan_buffer, find_next_newline_no_quit)
22349 (find_before_next_newline, search_command, Freplace_match)
22350 (Fmatch_data): Make some `int' variables be EMACS_INT.
22351
22352 * xdisp.c (display_count_lines): 3rd argument and return value now
22353 EMACS_INT. All callers changed.
22354 (pint2hrstr): Last argument is now EMACS_INT.
22355
22356 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22357 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22358 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22359 (decode_coding_utf_16, decode_coding_emacs_mule)
22360 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22361 (decode_coding_ccl, decode_coding_charset)
22362 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22363 (decode_coding_iso_2022, decode_coding_emacs_mule)
22364 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22365 <char_offset, last_offset>: Declare EMACS_INT.
22366 (encode_coding_utf_8, encode_coding_utf_16)
22367 (encode_coding_emacs_mule, encode_invocation_designation)
22368 (encode_designation_at_bol, encode_coding_iso_2022)
22369 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22370 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22371 Declare EMACS_INT.
22372 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22373 (encode_invocation_designation): Last argument P_NCHARS is now
22374 EMACS_INT.
22375 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22376 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22377
22378 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22379 All users changed.
22380
22381 * ccl.c (Fccl_execute_on_string): Declare some variables
22382 EMACS_INT.
22383
8546720e 223842011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22385
22386 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22387
4e19a977
CS
223882011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22389
22390 * process.c (Fformat_network_address): Doc fix.
22391
87302331
R
223922011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22393
ee7683eb 22394 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22395
cbb59342
CY
223962011-04-08 Chong Yidong <cyd@stupidchicken.com>
22397
22398 * keyboard.c (read_char): Call Lisp function help-form-show,
22399 instead of using internal_with_output_to_temp_buffer.
22400 (Qhelp_form_show): New var.
e0d38eeb 22401 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22402
22403 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22404
22405 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22406
e67a13ab
CY
224072011-04-06 Chong Yidong <cyd@stupidchicken.com>
22408
04f2d78b
CB
22409 * process.c (Flist_processes): Remove to Lisp.
22410 (list_processes_1): Delete.
e67a13ab 22411
973f782d
EZ
224122011-04-06 Eli Zaretskii <eliz@gnu.org>
22413
7c106b1e
EZ
22414 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22415
973f782d
EZ
22416 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22417
41cf7d1a 224182011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22419
ca23cc88
PE
22420 Fix more problems found by GCC 4.6.0's static checks.
22421
f390e2d5
PE
22422 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22423
42eea0d0
PE
22424 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22425
b69769da 22426 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22427
f9541e84
PE
22428 * xdisp.c (vmessage): Mark as a printf-like function.
22429
13841b55
PE
22430 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22431
c136c10f
PE
22432 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22433
5e2d4a30
PE
22434 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22435 printf-like functions.
22436 (tiff_load): Add casts to remove these marks before passing them
22437 to system-supplied API.
22438
583f48b9
PE
22439 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22440
b25d760e
PE
22441 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22442 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22443 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22444 directly, rather than having caller test rule sign. This avoids
22445 some unnecessary tests.
22446 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22447 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22448 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22449
bc7b6697 22450 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22451 (xfont_open): Avoid unnecessary tests.
bc7b6697 22452
27ccc379
PE
22453 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22454
dcd5c89a
PE
22455 * composite.h, composite.c (composition_gstring_put_cache):
22456 Use EMACS_INT, not int, for length.
22457
b13a45c6
PE
22458 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22459 breaking out part of COMPOSITION_DECODE_RULE.
22460 (COMPOSITION_DECODE_RULE): Use it.
22461 * composite.c (get_composition_id): Remove unused local vars,
22462 by using the new macro.
22463
1e792e4d
PE
22464 * textprop.c (set_text_properties_1): Change while to do-while,
22465 since the condition is always true at first.
22466
dc6c6455 22467 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22468 (interval_deletion_adjustment): Return unsigned value.
22469 All uses changed.
dc6c6455 22470
aba7731a
PE
22471 * process.c (list_processes_1, create_pty, read_process_output):
22472 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22473 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22474 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22475 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22476 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22477
fdfc4bf3
PE
22478 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22479
fca8fe46 22480 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22481 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22482
06a0259a 22483 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22484 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22485 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22486
e7b9e80f
PE
22487 * print.c (print_error_message): Avoid int overflow.
22488
56201685
PE
22489 * font.c (font_list_entities): Redo for clarity,
22490 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22491
78834453 22492 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22493 (font_score): Avoid potential overflow in diff calculation.
78834453 22494
0bc0b309 22495 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22496 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22497
e610eaca
PE
22498 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22499
b895abce
PE
22500 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22501 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22502 can always succeed if overflow has undefined behavior.
22503
1f1d9321 22504 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22505 (wordify): Omit three unnecessary tests.
1f1d9321 22506
c59478bc
PE
22507 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22508 All callers changed. This avoids the need for an unused var.
22509
79b73827
PE
22510 * casefiddle.c (casify_region): Remove var that is set but not used.
22511
a4db5dfe
PE
22512 * dired.c (file_name_completion): Remove var that is set but not used.
22513
43aae36e
PE
22514 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22515
2a47c44d 22516 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22517 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22518
a37c69bf
PE
22519 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22520 Check for integer overflow on size calculations.
22521
328ab8e7
PE
22522 * buffer.c (Fprevious_overlay_change): Remove var that is set
22523 but not used.
22524
e5a2a5cb
PE
22525 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22526 Remove vars that are set but not used.
8d84a6eb 22527 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22528 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22529
a60e5f68
PE
22530 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22531
f661cb61 22532 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22533 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22534
f0397f5a
PE
22535 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22536 that are set but not used.
22537
8664db06 22538 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22539 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22540
6abdaa4a
PE
22541 * xselect.c (x_get_local_selection, x_handle_property_notify):
22542 Remove vars that are set but not used.
22543
0ce7538d 22544 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22545 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22546
9ae848fc
PE
22547 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22548 Remove var that is set but not used.
0b918413
PE
22549 (scroll_bar_windows_size): Now size_t, not int.
22550 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22551 Check for overflow.
9ae848fc 22552
a5a62657
PE
22553 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22554 (map_tty_color) [!defined MSDOS]: Likewise.
22555
5c5cdd39
PE
22556 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22557
66ebf983
PE
22558 * coding.c: Remove vars that are set but not used.
22559 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22560 All callers changed.
22561 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22562 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22563 (decode_coding_charset): Remove vars that are set but not used.
22564
1be4d761
PE
22565 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22566 that is set but not used.
22567
47553fa8
PE
22568 * print.c (print_object): Remove var that is set but not used.
22569
1f7196bf 22570 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22571 The gnulib version avoids calling malloc in the usual case,
22572 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22573 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22574 * filelock.c (current_lock_owner): Likewise.
22575 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22576 * sysdep.c: Include allocator.h, careadlinkat.h.
22577 (emacs_no_realloc_allocator): New static constant.
22578 (emacs_readlink): New function.
fdb61804
PE
22579 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22580 ../lib/careadlinkat.h.
d1fdcab7 22581
f84c17c7
SM
225822011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22583
22584 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22585 first non-nil return value).
22586
ef3862ad
JD
225872011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22588
22589 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22590 if not defined (Bug#8403).
22591
376a7006
JB
225922011-04-02 Juanma Barranquero <lekktu@gmail.com>
22593
22594 * xdisp.c (display_count_lines): Remove parameter `start',
22595 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22596 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22597 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22598 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22599 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22600 and thereabouts. All callers changed.
22601 (get_per_char_metric): Remove parameter `f', unused since
22602 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22603
6ca3801d
JM
226042011-04-02 Jim Meyering <meyering@redhat.com>
22605
22606 do not dereference NULL upon failed strdup
22607 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22608 (ns_get_family): Likewise.
22609
d8e2b5ba
JB
226102011-04-02 Juanma Barranquero <lekktu@gmail.com>
22611
22612 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22613
8c74fcbd
JD
226142011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22615
22616 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22617 later (Bug#8403).
22618
7200d79c
SM
226192011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22620
03408648 22621 Add lexical binding.
7200d79c 22622
03408648
SM
22623 * window.c (Ftemp_output_buffer_show): New fun.
22624 (Fsave_window_excursion):
22625 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22626
22627 * lread.c (lisp_file_lexically_bound_p): New function.
22628 (Fload): Bind Qlexical_binding.
22629 (readevalloop): Remove `evalfun' arg.
22630 Bind Qinternal_interpreter_environment.
22631 (Feval_buffer): Bind Qlexical_binding.
22632 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22633 Mark as dynamic.
22634 (syms_of_lread): Declare `lexical-binding'.
22635
22636 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22637
22638 * keyboard.c (eval_dyn): New fun.
22639 (menu_item_eval_property): Use it.
ca105506
SM
22640
22641 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22642
03408648
SM
22643 * fns.c (concat, mapcar1): Accept byte-code-functions.
22644
22645 * eval.c (Fsetq): Handle lexical vars.
22646 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22647 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22648 (FletX, Flet): Obey lexical binding.
22649 (Fcommandp): Handle closures.
22650 (Feval): New `lexical' arg.
22651 (eval_sub): New function extracted from Feval. Use it almost
22652 everywhere where Feval was used. Look up vars in lexical env.
22653 Handle closures.
22654 (Ffunctionp): Move from subr.el.
22655 (Ffuncall): Handle closures.
22656 (apply_lambda): Remove `eval_flags'.
22657 (funcall_lambda): Handle closures and new byte-code-functions.
22658 (Fspecial_variable_p): New function.
22659 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22660 but without exporting it to Lisp.
23aba0ea 22661
23aba0ea 22662 * doc.c (Fdocumentation, store_function_docstring):
03408648 22663 * data.c (Finteractive_form): Handle closures.
23aba0ea 22664
03408648
SM
22665 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22666 interactive spec.
ba83908c 22667
04f2d78b
CB
22668 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22669 New byte-codes.
03408648
SM
22670 (exec_byte_code): New function extracted from Fbyte_code to handle new
22671 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22672
03408648 22673 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22674
03408648 22675 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22676
e2abce01
JB
226772011-03-31 Juanma Barranquero <lekktu@gmail.com>
22678
22679 * xdisp.c (redisplay_internal): Fix prototype.
22680
63696a73 226812011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22682
63696a73 22683 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22684 (try_scrolling): Use it when setting scroll_limit.
22685 Limit scrolling to 100 screen lines.
63696a73
EZ
22686 (redisplay_window): Even when falling back on "recentering",
22687 position point in the window according to scroll-conservatively,
22688 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22689
22690 (try_scrolling): When point is above the window, allow searching
22691 as far as scroll_max, or one screenful, to compute vertical
22692 distance from PT to the scroll margin position. This prevents
22693 try_scrolling from unnecessarily failing when
22694 scroll-conservatively is set to a value slightly larger than the
22695 window height. Clean up the case of PT below the margin at bottom
22696 of window: scroll_max can no longer be INT_MAX. When aggressive
22697 scrolling is in use, don't let point enter the opposite scroll
22698 margin as result of the scroll.
22699 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22700 threshold of 100 lines for never-recentering scrolling.
22701
e4cc2dfc
JB
227022011-03-31 Juanma Barranquero <lekktu@gmail.com>
22703
22704 * dispextern.h (move_it_by_lines):
22705 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22706 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22707 (message_log_check_duplicate): Remove parameters `prev_bol' and
22708 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22709 (redisplay_internal): Remove parameter `preserve_echo_area',
22710 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22711
22712 * indent.c (Fvertical_motion):
22713 * window.c (window_scroll_pixel_based, Frecenter):
22714 Don't pass `need_y_p' to `move_it_by_lines'.
22715
1c470562
SM
227162011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22717
44f230aa
SM
22718 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22719 steal a few bits to be more compact.
22720 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22721 Remove unneeded casts.
22722
1c470562
SM
22723 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22724
888adce9
ZK
227252011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22726
22727 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22728 binding" message (bug#7967).
22729
f838ed7b
PE
227302011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22731
77861b95
PE
22732 Fix more problems found by GCC 4.6.0's static checks.
22733
de6dbc14
PE
22734 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22735 Remove unused local var.
22736
f838ed7b
PE
22737 * editfns.c (Fmessage_box): Remove unused local var.
22738
792c7b2b
PE
22739 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22740 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22741 Omit unused local vars.
c499e557 22742 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22743 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22744 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22745 Omit unused local var.
22746
ba0165e1
PE
22747 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22748 Don't assume string length fits in int.
32ad8845 22749 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22750 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22751
3c59b4c9
PE
22752 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22753 instead of alloca (Bug#8344).
22754
a3eed478 22755 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22756 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22757
eb4d412d
PE
22758 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22759
1658b401
PE
22760 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22761 concerns.
22762
22763 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22764
22765 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22766
9a2c6e05
PE
22767 * keyboard.c (syms_of_keyboard): Use the same style as later
22768 in this function when indexing through an array. This also
22769 works around GCC bug 48267.
22770
03d0a109
PE
22771 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22772
44f730c8
PE
22773 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22774
fe75f926
PE
22775 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22776 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22777
ffa8c828
PE
22778 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22779 This avoids undefined behavior on integer overflow, and is a bit
22780 more convenient anyway since it is compared to a size_t variable.
22781
c5101a77
PE
22782 Variadic C functions now count arguments with size_t, not int.
22783 This avoids an unnecessary limitation on 64-bit machines, which
22784 caused (substring ...) to crash on large vectors (Bug#8344).
22785 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22786 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22787 All variadic functions and their callers changed accordingly.
c5101a77
PE
22788 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22789 * data.c (arith_driver, float_arith_driver): Likewise.
22790 * editfns.c (general_insert_function): Likewise.
22791 * eval.c (struct backtrace.nargs, interactive_p)
22792 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22793 (funcall_lambda, mark_backtrace): Likewise.
22794 * fns.c (concat): Likewise.
22795 * frame.c (x_set_frame_parameters): Likewise.
22796 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22797 0 if not found, not -1. All callers changed.
22798
dd3f25f7
PE
22799 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22800 (stack_copy_size): Now size_t, not int.
22801 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22802
461c2ab9
JB
228032011-03-28 Juanma Barranquero <lekktu@gmail.com>
22804
22805 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22806 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22807 All callers changed.
22808
22809 * lisp.h (multibyte_char_to_unibyte):
22810 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22811 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22812 * character.h (CHAR_TO_BYTE8):
22813 * cmds.c (internal_self_insert):
22814 * editfns.c (general_insert_function):
22815 * keymap.c (push_key_description):
22816 * search.c (Freplace_match):
22817 * xdisp.c (message_dolog, set_message_1): All callers changed.
22818
f6d62986
SM
228192011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22820
22821 * keyboard.c (safe_run_hook_funcall): New function.
22822 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22823 don't set the hook to nil, but remove the offending function instead.
22824 (Qcommand_hook_internal): Remove, unused.
22825 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22826 Vcommand_hook_internal.
22827
22828 * eval.c (enum run_hooks_condition): Remove.
22829 (funcall_nil, funcall_not): New functions.
22830 (run_hook_with_args): Call each function through a `funcall' argument.
22831 Remove `cond' argument, now redundant.
22832 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22833 (Frun_hook_with_args_until_failure): Adjust accordingly.
22834 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22835
1db5b1ad
JB
228362011-03-28 Juanma Barranquero <lekktu@gmail.com>
22837
22838 * dispextern.h (string_buffer_position): Remove declaration.
22839
22840 * print.c (strout): Remove parameter `multibyte', unused since
22841 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22842
22843 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22844 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22845 All callers changed.
22846
22847 * w32.c (_wsa_errlist): Use braces for struct initializers.
22848
22849 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22850 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22851 All callers changed.
22852 (string_buffer_position): Likewise. Also, make static (it's never
22853 used outside xdisp.c).
22854 (cursor_row_p): Remove parameter `w', unused since
22855 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22856 (decode_mode_spec): Remove parameter `precision', introduced during
22857 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22858 All callers changed.
22859
5ffb62aa
JD
228602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22861
22862 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22863
461c2ab9 228642011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22865
22866 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22867 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22868 (ns_update_auto_hide_menu_bar): New functions.
22869 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22870 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22871 ns_constrain_all_frames.
22872 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22873 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22874
5c380ffb
JD
228752011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22876
22877 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22878
9af30bdf
GM
228792011-03-27 Glenn Morris <rgm@gnu.org>
22880
22881 * syssignal.h: Replace RETSIGTYPE with void.
22882 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22883 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22884 Replace SIGTYPE with void everywhere.
22885 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22886 * s/template.h (SIGTYPE): Remove commented out definition.
22887
e2abce01
JB
228882011-03-26 Eli Zaretskii <eliz@gnu.org>
22889
22890 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22891 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22892
f868cd8a
JB
228932011-03-26 Juanma Barranquero <lekktu@gmail.com>
22894
59eb0929
JB
22895 * w32.c (read_unc_volume): Use parameter `henum', instead of
22896 global variable `wget_enum_handle'.
22897
22898 * keymap.c (describe_vector): Remove parameters `indices' and
22899 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22900 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22901
f868cd8a
JB
22902 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22903
22904 * keyboard.c (timer_check): Remove parameter `do_it_now',
22905 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22906 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22907 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22908
22909 * keyboard.c (read_char):
22910 * w32menu.c (w32_menu_display_help):
22911 * xmenu.c (show_help_event, menu_help_callback):
22912 Adjust calls to `show_help_echo'.
22913
22914 * gtkutil.c (xg_maybe_add_timer):
22915 * keyboard.c (readable_events):
22916 * process.c (wait_reading_process_output):
22917 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22918
22919 * insdel.c (adjust_markers_gap_motion):
22920 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22921 (gap_left, gap_right): Don't call it.
22922
2ecf6fdb
CY
229232011-03-25 Chong Yidong <cyd@stupidchicken.com>
22924
22925 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22926 incurred during fontification.
22927
6b1f9ba4
JB
229282011-03-25 Juanma Barranquero <lekktu@gmail.com>
22929
22930 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22931 (DEFVAR_PER_BUFFER): Don't pass it.
22932
22933 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22934 (scrolling_window): Don't pass it.
22935
0f4a96b5
JB
229362011-03-25 Juanma Barranquero <lekktu@gmail.com>
22937
22938 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22939
22940 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22941 and `suffix'.
22942 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22943 of variables specific to SELinux and computation of `encoded_absname'.
22944
22945 * image.c (XPutPixel): Remove unused variable `height'.
22946
22947 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22948
22949 * unexw32.c (get_section_info): Remove unused variable `section'.
22950
22951 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22952 (system_process_attributes): Remove unused variable `sess'.
22953 (sys_read): Remove unused variable `err'.
22954
22955 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22956 (w32_wnd_proc): Remove unused variable `isdead'.
22957 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22958 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22959 (x_create_tip_frame): Remove unused variable `tem'.
22960
22961 * w32inevt.c (w32_console_read_socket):
22962 Remove unused variable `no_events'.
22963
22964 * w32term.c (x_draw_composite_glyph_string_foreground):
22965 Remove unused variable `width'.
22966
1149507c
JB
229672011-03-24 Juanma Barranquero <lekktu@gmail.com>
22968
22969 * w32term.c (x_set_glyph_string_clipping):
22970 Don't pass uninitialized region to CombineRgn.
22971
9c88f339
JB
229722011-03-23 Juanma Barranquero <lekktu@gmail.com>
22973
22974 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22975 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22976 (Fx_close_connection): Remove unused variable `i'.
22977
22978 * w32font.c (w32font_draw): Return number of glyphs.
22979 (w32font_open_internal): Remove unused variable `i'.
22980 (w32font_driver): Add missing initializer.
22981
22982 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22983 (fill_in_menu): Remove unused variable `items_added'.
22984
22985 * w32term.c (last_mouse_press_frame): Remove static global variable.
22986 (w32_clip_to_row): Remove unused variable `f'.
22987 (x_delete_terminal): Remove unused variable `i'.
22988
22989 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22990 (NOTHING): Remove unused static global variable.
22991 (uniscribe_check_otf): Remove unused variable `table'.
22992 (uniscribe_font_driver): Add missing initializers.
22993
dee091a3
JD
229942011-03-23 Julien Danjou <julien@danjou.info>
22995
22996 * term.c (Fsuspend_tty, Fresume_tty):
22997 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22998 * window.c (temp_output_buffer_show):
22999 * insdel.c (signal_before_change):
23000 * frame.c (Fhandle_switch_frame):
23001 * fileio.c (Fdo_auto_save):
23002 * emacs.c (Fkill_emacs):
23003 * editfns.c (save_excursion_restore):
23004 * cmds.c (internal_self_insert):
23005 * callint.c (Fcall_interactively):
23006 * buffer.c (Fkill_all_local_variables):
23007 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23008 Use Frun_hooks.
0f4a96b5 23009 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 23010 unconditionally since it does the check itself.
dee091a3 23011
2c520ab5 230122011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 23013
c9c49752
PE
23014 Fix more problems found by GCC 4.5.2's static checks.
23015
8abc3f12
PE
23016 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23017 the first time through the loop, since we know p0 < p1 then.
23018 This also avoids a gcc -Wstrict-overflow warning.
23019
a2d26660
PE
23020 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23021 leading to a memory leak, possible in functions like
23022 load_charset_map_from_file that can allocate an unbounded number
b12ef411 23023 of objects (Bug#8318).
a2d26660 23024
916c72e9
PE
23025 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23026 that could (at least in theory) be that large.
23027
19ab8a18
PE
23028 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23029 This is less likely to overflow, and avoids undefined behavior if
23030 overflow does occur. All callers changed. Use strtoul to scan
23031 for the unsigned long integer.
b7cbbd6f
PE
23032 (pint2hrstr): Simplify and tune code slightly.
23033 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 23034
f0641eff
PE
23035 * scroll.c (do_scrolling): Work around GCC bug 48228.
23036 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23037
7f650bb9
PE
23038 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23039 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
23040 (validate_x_resource_name): Simplify count usage.
23041 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 23042
37dd57d1
PE
23043 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23044 fail (Bug#8306).
81e56e61 23045
699979fc 23046 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 23047
401bf9b4
PE
23048 * process.c (Fmake_network_process): Use socklen_t, not int,
23049 where POSIX says socklen_t is required in portable programs.
23050 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 23051 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
23052 (Fmake_network_process, server_accept_connection):
23053 (wait_reading_process_output, read_process_output):
23054 Likewise.
23055
b93aacde
PE
23056 * process.c: Rename or move locals to avoid shadowing.
23057 (list_processes_1, Fmake_network_process):
23058 (read_process_output_error_handler, exec_sentinel_error_handler):
23059 Rename or move locals.
4dc343ee 23060 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 23061 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 23062 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 23063 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 23064 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 23065
af8a867c 23066 Make tparam.h and terminfo.c consistent.
44f230aa
SM
23067 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23068 Include tparam.h instead, since it declares them.
af8a867c
PE
23069 * cm.h (PC): Remove extern decl; tparam.h now does this.
23070 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23071 * terminfo.c: Include tparam.h, to check interfaces.
23072 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23073 (tparam): Adjust signature to match interface in tparam.h;
23074 this removes some undefined behavior. Check that outstring and len
23075 are zero, which they always are with Emacs.
23076 * tparam.h (PC, BC, UP): New extern decls.
23077
0248044d 23078 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 23079 (xftfont_open): Rename locals to avoid shadowing.
0248044d 23080
8ff096c1 23081 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
23082 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23083 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 23084 (ftfont_list): Remove unused local.
49eaafba
PE
23085 (get_adstyle_property, ftfont_pattern_entity):
23086 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23087 Rename locals to avoid shadowing.
8ff096c1 23088
e2be39f6
PE
23089 * xfont.c (xfont_list_family): Mark var as initialized.
23090
c9735e30
PE
23091 * xml.c (make_dom): Now static.
23092
8f5201ae
PE
23093 * composite.c (composition_compute_stop_pos): Rename local to
23094 avoid shadowing.
b246f932
PE
23095 (composition_reseat_it): Remove unused locals.
23096 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 23097 (composition_update_it): Mark var as initialized.
11b61122
PE
23098 (find_automatic_composition): Mark vars as initialized,
23099 with a FIXME (Bug#8290).
8f5201ae 23100
760fbc2c
PE
23101 character.h: Rename locals to avoid shadowing.
23102 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23103 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23104 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23105 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23106 to avoid shadowing.
23107
ff08eb85
PE
23108 * textprop.c (property_change_between_p): Remove; unused.
23109
fc7bf025
PE
23110 * intervals.c (interval_start_pos): Now static.
23111
235d7abc
PE
23112 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23113
44f230aa
SM
23114 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23115 Rename locals to avoid shadowing.
3e7d6594 23116
50060332
PE
23117 * sound.c (wav_play, au_play, Fplay_sound_internal):
23118 Fix pointer signedness.
d01f234b 23119 (alsa_choose_format): Remove unused local var.
c83b8872
PE
23120 (wav_play): Initialize a variable to 0, to prevent undefined
23121 behavior (Bug#8278).
50060332 23122
c4fc4e30
PE
23123 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23124
918436ed
PE
23125 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23126
c939f91b
PE
23127 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23128 clobbering (Bug#8298).
b9c7f648
PE
23129 * sysdep.c (sys_subshell): Likewise.
23130 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 23131
6bd8c144
PE
23132 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23133 This should get cleaned up, so that child_setup has the
23134 same signature on all platforms.
23135
7710357c 23136 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 23137 (relocate_fd): Rename locals to avoid shadowing.
7710357c 23138
c59da222
CY
231392011-03-22 Chong Yidong <cyd@stupidchicken.com>
23140
23141 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23142 not to be necessary, and produces flickering.
23143
66b87493
GM
231442011-03-20 Glenn Morris <rgm@gnu.org>
23145
23146 * config.in: Remove file.
23147
45b6f6d5
JB
231482011-03-20 Juanma Barranquero <lekktu@gmail.com>
23149
23150 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23151 are now in src/globals.h.
23152 (syms_of_minibuf): Remove spurious & from previous change.
23153
cd394be1 231542011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23155
23156 * minibuf.c (completing-read-function): New variable.
23157 (completing-read-default): Rename from completing-read.
23158 (completing-read): Call completing-read-function.
23159
b14e3e21
CY
231602011-03-19 Juanma Barranquero <lekktu@gmail.com>
23161
23162 * xfaces.c (Fx_load_color_file):
23163 Read color file from absolute filename (bug#8250).
23164
f2b726e6
JB
231652011-03-19 Juanma Barranquero <lekktu@gmail.com>
23166
23167 * makefile.w32-in: Update dependencies.
23168
09f6ff02
EZ
231692011-03-17 Eli Zaretskii <eliz@gnu.org>
23170
23171 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23172
29a6015a
PE
231732011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23174
a3a6c54e
PE
23175 Fix more problems found by GCC 4.5.2's static checks.
23176
b766f867
PE
23177 * process.c (make_serial_process_unwind, send_process_trap):
23178 (sigchld_handler): Now static.
23179
be02381c
PE
23180 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23181 That way, the code declares only the vars that it needs.
23182 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23183 * s/cygwin.h (PTY_ITERATION): Likewise.
23184 * s/darwin.h (PTY_ITERATION): Likewise.
23185 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23186
57048744
PE
23187 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23188 * process.c (allocate_pty): Don't declare stb unless it's needed.
23189
7914961c 23190 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23191 (CONSTANTLIM): Remove; unused.
23192 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23193 Define only if needed.
7914961c 23194
b3967b18
PE
23195 * unexelf.c (unexec): Name an expression,
23196 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23197 Use a different way to cause a compilation error if anyone uses
23198 n rather than nn, a way that does not involve shadowing.
73366a00 23199 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23200
29a6015a
PE
23201 * deps.mk (unexalpha.o): Remove; unused.
23202
43cfc33e 23203 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23204 * unexec.h: New file.
ce701a33
PE
23205 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23206 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23207 Depend on unexec.h.
23208 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23209 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23210 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23211 Change as necessary to match prototype in unexec.h.
ce701a33 23212
01f44d5a
PE
23213 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23214 shadowing.
4f63c6bb 23215 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23216
a6670b0b
PE
23217 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23218 Rename locals to avoid shadowing.
23219
cef2010d 23220 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23221 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23222
d4d7173a
PE
23223 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23224
f08b802a
PE
23225 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23226 warning when compiling print.c.
23227
3ddb0639
PE
23228 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23229 instead of using an uninitialized var.
5ad03b97 23230 (font_sort_entities): Mark var as initialized.
3ddb0639 23231
170a2692
PE
23232 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23233
e663c700
PE
23234 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23235 pointers to constants.
89bc529a 23236 (font_parse_fcname): Remove unused vars.
7b81e2d0 23237 (font_delete_unmatched): Now static.
ea838e10 23238 (font_get_spec): Remove; unused.
13a547c6
PE
23239 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23240 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23241 Rename or move locals to avoid shadowing.
e663c700 23242
2a80c887 23243 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23244 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23245
1384fa33 23246 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23247 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23248
8b2c52e9
PE
23249 * alloc.c (mark_backtrace): Move decl from here ...
23250 * lisp.h: ... to here, so that it can be checked.
23251
475545b5 23252 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23253 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23254 (lisp_indirect_variable): Name an expression,
23255 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23256 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23257
b1349114 23258 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23259 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23260 Use const pointer when appropriate.
b1349114 23261
a2928364
PE
23262 * lisp.h (get_system_name, get_operating_system_release):
23263 Move decls here, to check interfaces.
23264 * process.c (get_operating_system_release): Move decl to lisp.h.
23265 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23266 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23267 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23268 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23269 (Fformat_time_string, Fencode_time, Finsert_char):
23270 (Ftranslate_region_internal, Fformat):
23271 Rename or remove local vars to avoid shadowing.
9710023e 23272 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23273
a415e694
PE
23274 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23275 avoid shadowing.
23276
8ef4622d
PE
23277 * lisp.h (eassert): Check that the argument compiles, even if
23278 ENABLE_CHECKING is not defined.
23279
946f9a5b
PE
23280 * data.c (Findirect_variable): Name an expression, to avoid
23281 gcc -Wbad-function-cast warning.
112396d6 23282 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23283 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23284 (Fmake_variable_buffer_local, Fmake_local_variable):
23285 Mark variables as initialized.
52746918 23286 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23287
e5aab7e7 23288 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23289 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23290 Rename locals to avoid shadowing.
dff45157
PE
23291 (mark_stack): Move local variables into the #ifdef region where
23292 they're used.
7bc26fdb
PE
23293 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23294 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23295 needed otherwise.
23296 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23297 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23298 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23299
e5aab7e7
PE
23300 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23301 avoids undefined behavior in theory.
23302
4da60324
PE
23303 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23304
88043301
PE
23305 Use functions, not macros, for up- and down-casing (Bug#8254).
23306 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23307 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23308 to use the following functions instead of these macros.
23309 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23310 EMACS_INT, since callers assume the returned value fits in int.
23311 (upcase1): Likewise, for UPCASE_TABLE.
23312 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23313 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23314 the race-condition problem in the old DOWNCASE.
88043301 23315
19ed5445
PE
23316 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23317 Rename locals to avoid shadowing.
23318 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23319 (regex_compile, re_search_2, re_match_2_internal):
23320 Remove unused local vars.
952db0d7
PE
23321 (FREE_VAR): Rewrite so as not to use empty "else",
23322 which gcc can warn about.
da053e48 23323 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23324 (RETALLOC_IF): Define only if needed.
23325 (WORDCHAR_P): Likewise. This one is never needed, but is used
23326 only in a comment talking about a compiler bug, so put inside
23327 the #if 0 of that comment.
23328 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23329 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23330 Remove; unused.
19ed5445 23331
1f3561e4 23332 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23333 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23334 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23335
ded6f8f7
PE
23336 * search.c (simple_search): Remove unused var.
23337
dbd37a95
PE
23338 * dired.c (compile_pattern): Move decl from here ...
23339 * lisp.h: ... to here, so that it can be checked.
23340 (struct re_registers): New forward decl.
23341
7e47afad
PE
23342 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23343
85f24f61
PE
23344 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23345 All uses changed.
23346 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23347 Rename locals to avoid shadowing.
5671df8f 23348 (Fvertical_motion): Mark locals as initialized.
85f24f61 23349
181aa2be 23350 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23351 (casify_region): Mark local as initialized.
181aa2be 23352
930d429c
PE
23353 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23354
7082eac6
PE
23355 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23356 New macros, so that the caller can use some names other than
23357 gcpro1, gcpro2, etc.
23358 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23359 of the new macros.
23360 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23361 argument, for consistency with GCPRO2_VAR, etc: it is now the
23362 prefix of the variable, not the variable itself. All uses
23363 changed.
38b2c076
PE
23364 * dired.c (directory_files_internal, file_name_completion):
23365 Rename locals to avoid shadowing.
23366
15206ed9
PE
23367 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23368 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23369 dired.c's scmp function, had undefined behavior.
23370 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23371 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23372 * buffer.h: ... to here, because these macros use current_buffer,
23373 and the new implementation with inline functions needs to have
23374 current_buffer in scope now, rather than later when the macros
23375 are used.
23376 (downcase, upcase1): New static inline functions.
23377 (DOWNCASE, UPCASE1): Reimplement using these functions.
23378 This avoids undefined behavior in expressions like
23379 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23380 from race conditions in accessing the global variables
23381 case_temp1 and case_temp2.
23382 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23383 * lisp.h (case_temp1, case_temp2): Remove their decls.
23384 * character.h (ASCII_CHAR_P): Move from here ...
23385 * lisp.h: ... to here, so that the inline functions mentioned
23386 above can use them.
23387
4a6bea26
PE
23388 * dired.c (directory_files_internal_unwind): Now static.
23389
f14b7e14
PE
23390 * fileio.c (file_name_as_directory, directory_file_name):
23391 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23392 Now static.
2893f146
PE
23393 (file_name_as_directory): Use const pointers when appropriate.
23394 (Fexpand_file_name): Likewise. In particular, newdir might
23395 point at constant storage, so make it a const pointer.
fd4ead52 23396 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23397 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23398 signedness issues.
f839df0c
PE
23399 (Fset_file_times, Finsert_file_contents, auto_save_error):
23400 Rename locals to avoid shadowing.
f14b7e14 23401
5716756e 23402 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23403 (Ftry_completion, Fall_completions): Rename or remove locals
23404 to avoid shadowing.
5716756e 23405
b4c3046a
PE
23406 * marker.c (bytepos_to_charpos): Remove; unused.
23407
b45db522
PE
23408 * lisp.h (verify_bytepos, count_markers): New decls,
23409 so that gcc does not warn that these functions aren't declared.
23410
85876d07
PE
23411 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23412 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23413 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23414 (copy_text): Remove unused local var.
85876d07 23415
03d78a21 23416 * filelock.c (within_one_second): Now static.
b3dd38ab 23417 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23418
5df8f01b
PE
23419 * buffer.c (fix_overlays_before): Mark locals as initialized.
23420 (fix_start_end_in_overlays): Likewise. This function should be
23421 simplified by using pointers-to-pointers, but that's a different
23422 matter.
b1d876f1 23423 (switch_to_buffer_1): Now static.
8f54f30a
PE
23424 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23425 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23426
a70072c9 23427 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23428 Fix pointer signedness issue.
edced198
PE
23429 (sys_subshell): Mark local as volatile if checking for lint,
23430 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23431 (MAXPATHLEN): Define only if needed.
a70072c9 23432
a0977c44
PE
23433 * process.c (serial_open, serial_configure): Move decls from here ...
23434 * systty.h: ... to here, so that they can be checked.
23435
a884fdcc
PE
23436 * fns.c (get_random, seed_random): Move extern decls from here ...
23437 * lisp.h: ... to here, so that they can be checked.
23438
604efe86 23439 * sysdep.c (reset_io): Now static.
b8950c94 23440 (wait_for_termination_signal): Remove; unused.
604efe86 23441
38fc62d9
PE
23442 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23443 (copy_keymap_item, append_key, push_text_char_description):
23444 Now static.
1004a21a 23445 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23446 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23447 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23448 (describe_map_tree):
23449 Rename locals to avoid shadowing.
38fc62d9 23450
2f2650da
PE
23451 * keyboard.c: Declare functions static if they are not used elsewhere.
23452 (echo_char, echo_dash, cmd_error, top_level_2):
23453 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23454 (read_char, kbd_buffer_get_event, make_lispy_position):
23455 (make_lispy_event, make_lispy_movement, apply_modifiers):
23456 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23457 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23458 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23459 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23460 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23461
a053e86c 23462 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23463 (mark_kboards): Move decl here ...
23464 * alloc.c (mark_kboards): ... from here.
a053e86c 23465
4752793e
PE
23466 * lisp.h (force_auto_save_soon): New decl.
23467
74f10ca7 23468 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23469 (DEFINE_DUMMY_FUNCTION): New macro.
23470 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23471 Use it.
c03cd23f
PE
23472 (main): Add casts to avoid warnings
23473 if GCC considers string literals to be constants.
74f10ca7 23474
022e70d4
PE
23475 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23476
59d6fe83
PE
23477 * dbusbind.c: Pointer signedness fixes.
23478 (xd_signature, xd_append_arg, xd_initialize):
23479 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23480 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23481 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23482 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23483
78320123
PE
23484 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23485 if GCC considers string literals to be constants.
49cebcca 23486 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23487
35ac2a97
SM
234882011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23489
fb103ca9
SM
23490 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23491 (print_preprocess, print_object): New macro to fix last change.
23492
35ac2a97
SM
23493 * print.c (print_preprocess): Don't forget font objects.
23494
62973b41
JB
234952011-03-16 Juanma Barranquero <lekktu@gmail.com>
23496
23497 * emacs.c (USAGE3): Doc fixes.
23498
0e48bb22
AS
234992011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23500
23501 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23502 structure.
23503
7684e57b
JB
235042011-03-14 Juanma Barranquero <lekktu@gmail.com>
23505
23506 * lisp.h (VWindow_system, Qfile_name_history):
23507 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23508 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23509 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23510
23511 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23512 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23513
23514 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23515 * w32console.c (detect_input_pending, read_input_pending)
23516 (encode_terminal_code):
23517 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23518 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23519 (w32_system_caret_y, Qfile_name_history):
23520 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23521 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23522 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23523 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23524 * w32proc.c (Qlocal, report_file_error):
23525 * w32term.c (Vwindow_system, updating_frame):
23526 * w32uniscribe.c (initialized, uniscribe_font_driver):
23527 Remove unneeded extern declarations.
23528
2aa46d6c
CY
235292011-03-14 Chong Yidong <cyd@stupidchicken.com>
23530
c96bbc66 23531 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23532
cffc6f3b
CY
235332011-03-13 Chong Yidong <cyd@stupidchicken.com>
23534
23535 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23536 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23537 These macros can no longer be used for assignment.
23538
44f230aa
SM
23539 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23540 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23541 (record_buffer_markers, fetch_buffer_markers): New functions for
23542 recording and fetching special buffer markers.
23543 (set_buffer_internal_1, set_buffer_temp): Use them.
23544
23545 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23546
23547 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23548
23549 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23550 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23551
23552 * xdisp.c (hscroll_window_tree):
23553 (reconsider_clip_changes): Use PT instead of BUF_PT.
23554
d251f04b
EZ
235552011-03-13 Eli Zaretskii <eliz@gnu.org>
23556
23557 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23558 $(EMACS_ROOT)/lib/intprops.h.
23559
f0c77cd1
PE
235602011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23561
3eca4629
PE
23562 Fix more problems found by GCC 4.5.2's static checks.
23563
7c86ee98
PE
23564 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23565 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23566 (xg_free_frame_widgets): Make it clear that a local variable is
23567 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23568 (gdk_window_get_screen): Make it clear that this macro is needed
23569 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23570 (int_gtk_range_get_value): New function, which avoids a diagnostic
23571 from gcc -Wbad-function-cast.
23572 (xg_set_toolkit_scroll_bar_thumb): Use it.
23573 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23574 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23575 (get_utf8_string, xg_get_file_with_chooser):
23576 Rename locals to avoid shadowing.
23577 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23578
41729b81
PE
23579 * xgselect.c (xg_select): Remove unused var.
23580
f0c77cd1
PE
23581 * image.c (four_corners_best): Mark locals as initialized.
23582 (gif_load): Initialize transparent_p to zero (Bug#8238).
23583 Mark another local as initialized.
ec6cf4c6 23584 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23585
ce0ad53d 23586 * image.c (clear_image_cache): Now static.
d5d5a617 23587 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23588 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23589 (x_edge_detection): Remove unnecessary cast that
23590 gcc -Wbad-function-cast diagnoses.
2037898d 23591 (gif_load): Fix pointer signedness.
6ae141d6
PE
23592 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23593 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23594
33383987 235952011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23596
d32df629
PE
23597 Improve quality of tests for time stamp overflow.
23598 For example, without this patch (encode-time 0 0 0 1 1
23599 1152921504606846976) returns the obviously-bogus value (-948597
23600 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23601 reports time overflow. See
23602 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23603 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23604 * editfns.c: Include limits.h and intprops.h.
23605 (TIME_T_MIN, TIME_T_MAX): New macros.
23606 (time_overflow): Move earlier, to before first use.
23607 (hi_time, lo_time): New functions, for an accurate test for
23608 out-of-range times.
23609 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23610 (Fget_internal_run_time): Don't assume time_t fits in int.
23611 (make_time): Use list2 instead of Fcons twice.
23612 (Fdecode_time): More accurate test for out-of-range times.
23613 (check_tm_member): New function.
23614 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23615 (lisp_time_argument): Don't rely on undefined left-shift and
23616 right-shift behavior when checking for time stamp overflow.
8be6f318 23617
fe31d94c
PE
23618 * editfns.c (time_overflow): New function, refactoring common code.
23619 (Fformat_time_string, Fdecode_time, Fencode_time):
23620 (Fcurrent_time_string): Use it.
23621
8be6f318
PE
23622 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23623 * dired.c (make_time): Move to ...
23624 * editfns.c (make_time): ... here.
23625 * systime.h: Note the move.
23626
09d9db2c 236272011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23628
126bc0dc
YM
23629 * fringe.c (update_window_fringes): Remove unused variables.
23630
c47cbdfd
YM
23631 * unexmacosx.c (copy_data_segment): Also copy __got section.
23632 (Bug#8223)
23633
7ac80be9
EZ
236342011-03-12 Eli Zaretskii <eliz@gnu.org>
23635
c96bbc66 23636 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23637 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23638 Constify `char *' arguments and their references according to
23639 prototypes in tparam.h.
23640
ecb0f94d 23641 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23642
7ac80be9
EZ
23643 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23644 Adapt all references accordingly.
23645
23646 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23647
ef1fd07e
TT
236482011-03-11 Tom Tromey <tromey@redhat.com>
23649
23650 * buffer.c (syms_of_buffer): Remove obsolete comment.
23651
7ef4b50c
EZ
236522011-03-11 Eli Zaretskii <eliz@gnu.org>
23653
23654 * termhooks.h (encode_terminal_code): Declare prototype.
23655
23656 * msdos.c (encode_terminal_code): Don't declare prototype.
23657
23658 * term.c (encode_terminal_code): Now external again, used by
23659 w32console.c and msdos.c.
23660
44f230aa
SM
23661 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23662 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23663
4b1ec863 236642011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23665
1714f52b 23666 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23667
4b1ec863
PE
23668 * fringe.c (update_window_fringes): Mark locals as initialized
23669 (Bug#8227).
23670 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23671
524c7aa6
PE
23672 * alloc.c (mark_fringe_data): Move decl from here ...
23673 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23674 to check its interface.
23675 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23676
a5c0af81 23677 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23678 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23679 (fontset_font): Mark local as initialized.
a9a06e0b 23680 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23681
b4716021
PE
23682 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23683
811e9bac 23684 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23685 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23686 (x_own_selection, Fx_disown_selection_internal): Rename locals
23687 to avoid shadowing.
23688 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23689
7e3ab302
PE
23690 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23691 so that the caller can use some name other than gcpro1.
23692 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23693 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23694 (Fx_backspace_delete_keys_p):
23695 Use them to avoid shadowing, and rename vars to avoid shadowing.
23696 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23697 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23698 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23699 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23700 Remove unused locals.
7e3ab302
PE
23701 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23702 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23703 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23704 macros.
f78faa98 23705
e2b13473
PE
23706 * xterm.h (x_mouse_leave): New decl.
23707
77f23912
PE
23708 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23709 Remove unused functions.
cdf4ba58
PE
23710 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23711 (x_calc_absolute_position): Now static.
7411c686 23712 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23713 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23714 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23715 unless they are used.
38d0b34a
PE
23716 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23717 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23718 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23719 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23720 (x_error_catcher, x_connection_closed, x_error_handler):
23721 (x_error_quitter, xembed_send_message, x_iconify_frame):
23722 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23723 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23724 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23725
44f230aa
SM
23726 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23727 Rename or move locals to avoid shadowing.
6b463e58 23728 (tty_defined_color, merge_face_heights): Now static.
5967d051 23729 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23730 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23731 does not deduce is never used uninitialized.
73719eba
PE
23732 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23733 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23734
426994c3 23735 * terminal.c (store_terminal_param): Now static.
5489860b 23736
032f1620 23737 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23738 (set_frame_menubar): Remove unused local.
d4323972 23739 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23740 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23741 since they might point to immutable storage.
281585b0
PE
23742 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23743 since it's unused otherwise.
032f1620 23744
367c19e5 23745 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23746 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23747 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23748 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23749 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23750 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23751 does not deduce are never used uninitialized.
70739cbe 23752
07b48fa9
PE
23753 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23754
8868a238 23755 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23756 * window.c (window_loop, size_window):
23757 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23758
7e5cf297 23759 * window.c (display_buffer): Now static.
d6550a9f
PE
23760 (size_window): Mark variables that gcc -Wuninitialized
23761 does not deduce are never used uninitialized.
a586633d
PE
23762 * window.h (check_all_windows): New decl, to forestall
23763 gcc -Wmissing-prototypes diagnostic.
5b555da1 23764 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23765
f6095868
PE
23766 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23767 shadowing.
23768 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23769 Include <limits.h>.
23770 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23771 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23772 (load_charset_map): Mark variables that gcc -Wuninitialized
23773 does not deduce are never used uninitialized.
53df7c11 23774 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23775
f38b440c
PE
23776 * coding.c (coding_set_source, coding_set_destination):
23777 Use "else { /* comment */ }" rather than "else /* comment */;"
23778 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23779 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23780 a block, when the outer 'i' will do.
23781 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23782 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23783 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23784 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23785 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23786 Rename locals to avoid shadowing.
23787 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23788 * coding.c (emacs_mule_char, encode_invocation_designation):
23789 Now static, since they're not used elsewhere.
413bb2db 23790 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23791 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23792 (decode_coding_emacs_mule): Mark variables that gcc
23793 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23794 (detect_coding_iso_2022): Initialize a local variable that might
23795 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23796 this initialization is needed. (Bug#8211)
5f58e762
PE
23797 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23798 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23799 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23800 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23801 Remove unused macros.
f38b440c 23802
232b38b9 23803 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23804 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23805 * character.c (string_count_byte8): Likewise.
232b38b9 23806
fb90da1b
PE
23807 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23808 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23809
fb93dbc2
PE
23810 * chartab.c (copy_sub_char_table): Now static, since it's not used
23811 elsewhere.
5c156ace
PE
23812 (sub_char_table_ref_and_range, char_table_ref_and_range):
23813 Rename locals to avoid shadowing.
bbcd0949 23814 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23815
7d3b3862 23816 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23817 (BIDI_BOB): Remove unused macro.
7d3b3862 23818
6be7d3da
PE
23819 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23820 deduce are never used uninitialized.
c2ed9c8b 23821 * term.c (encode_terminal_code): Likewise.
6be7d3da 23822
75f8807f 23823 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23824
50938595
PE
23825 * tparam.h: New file.
23826 * term.c, tparam.h: Include it.
23827 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23828 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23829 Move these decls to tparam.h, and make them agree with what
23830 is actually in tparam.c. The previous trick of using incompatible
23831 decls in different modules does not conform to the C standard.
23832 All callers of tparam changed to use tparam's actual API.
23833 * tparam.c (tparam1, tparam, tgoto):
23834 Use const pointers where appropriate.
23835
fbceeba2
PE
23836 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23837 * cm.h (struct cm): Likewise.
23838 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23839 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23840 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23841 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23842 (turn_on_face, init_tty): Likewise.
23843 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23844
7f3f1250
PE
23845 * term.c (term_mouse_position): Rename local to avoid shadowing.
23846
e6ca6543
PE
23847 * alloc.c (mark_ttys): Move decl from here ...
23848 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23849
c40f8d15
AS
238502011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23851
23852 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23853
cfe0661d
JB
238542011-03-09 Juanma Barranquero <lekktu@gmail.com>
23855
23856 * search.c (compile_pattern_1): Remove argument regp, unused since
23857 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23858 (compile_pattern): Don't pass it.
23859
0afb4571
J
238602011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23861
23862 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23863 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23864 for ! HAVE_GTK3.
23865 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23866
23867 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23868
23869 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23870 gdk_window_get_screen, gdk_window_get_geometry,
23871 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23872 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23873 (xg_get_pixbuf_from_pixmap): New function.
23874 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23875 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23876 Call xg_get_pixbuf_from_pixmap instead of
23877 gdk_pixbuf_get_from_drawable.
23878 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23879 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23880 (xg_check_special_colors): Use GtkStyleContext and its functions
23881 for HAVE_GTK3.
23882 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23883 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23884 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23885 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23886 Call gtk_widget_get_preferred_size.
0afb4571
J
23887 (xg_frame_resized): gdk_window_get_geometry only takes 5
23888 parameters.
44f230aa
SM
23889 (xg_win_to_widget, xg_event_is_for_menubar):
23890 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23891 (xg_set_widget_bg): New function.
23892 (delete_cb): New function.
895009e1 23893 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23894 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23895 (xg_set_background_color): Call xg_set_widget_bg.
23896 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23897 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23898 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23899 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23900 if ! HAVE_GTK3.
23901 (update_frame_tool_bar): Call gtk_widget_hide.
23902 (xg_initialize): Use GDK_KEY_g.
23903
23904 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23905 if ! HAVE_GTK3
23906 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23907
23908 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23909 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23910 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23911
1c2cc4ef
JB
239122011-03-08 Juanma Barranquero <lekktu@gmail.com>
23913
23914 * w32xfns.c (select_palette): Check success of RealizePalette against
23915 GDI_ERROR, not zero.
23916
33383987 23917See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23918
23919;; Local Variables:
23920;; coding: utf-8
aac0c6e3
MR
23921;; End:
23922
ab422c4d 23923 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23924
23925 This file is part of GNU Emacs.
23926
23927 GNU Emacs is free software: you can redistribute it and/or modify
23928 it under the terms of the GNU General Public License as published by
23929 the Free Software Foundation, either version 3 of the License, or
23930 (at your option) any later version.
23931
23932 GNU Emacs is distributed in the hope that it will be useful,
23933 but WITHOUT ANY WARRANTY; without even the implied warranty of
23934 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23935 GNU General Public License for more details.
23936
23937 You should have received a copy of the GNU General Public License
23938 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.