* fns.c (Fcopy_sequence): Simplify XTYPE calculation.
[bpt/emacs.git] / src / ChangeLog
1 2013-06-15 Paul Eggert <eggert@cs.ucla.edu>
2
3 * fns.c (Fcopy_sequence): Simplify XTYPE calculation.
4
5 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * lread.c (syms_of_lread):
8 * fns.c (Fprovide): Adjust to new format of after-load-alist.
9
10 2013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
11
12 * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479)
13
14 2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
15
16 * fileio.c (expand_file_name): Doc fix.
17
18 2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
19
20 Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
21 * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
22 Wait for self, not for 0. This can't hurt on GNU or similar
23 system, and may help with Cygwin.
24
25 * keyboard.c: Don't use PROP (...) as an lvalue.
26 (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
27 Use set_prop (A, B), not PROP (A) = B.
28
29 2013-06-10 Eli Zaretskii <eliz@gnu.org>
30
31 * xdisp.c (get_it_property): Use it->window instead of generating
32 a Lisp object from it->w.
33
34 2013-06-09 Eli Zaretskii <eliz@gnu.org>
35
36 * xdisp.c (get_it_property): If it->object is a buffer, pass to
37 get-char-property the window that is being rendered, instead of
38 the buffer, to support window-specific overlays. (Bug#14575)
39 (compute_display_string_pos): When W is NULL, use the current
40 buffer as the object to pass to get-char-property.
41 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
42 pointer member of the bidi iterator, since no window is pertinent
43 to this function.
44
45 2013-06-08 Eli Zaretskii <eliz@gnu.org>
46
47 * bidi.c (bidi_fetch_char): Accept additional argument, the window
48 being displayed, and pass it to compute_display_string_pos.
49 (bidi_level_of_next_char, bidi_resolve_explicit_1)
50 (bidi_paragraph_init): All callers changed.
51
52 * xdisp.c (init_from_display_pos, init_iterator)
53 (handle_single_display_spec, next_overlay_string)
54 (get_overlay_strings_1, reseat_1, reseat_to_string)
55 (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
56 Set bidi_it.w member from it->w.
57 (compute_display_string_pos): Accept additional argument, the
58 window being displayed, and pass it to Fget_char_property.
59 (Bug#14575)
60
61 * dispextern.h (struct bidi_it): New member w, the window being
62 displayed.
63 (compute_display_string_pos): Adjust prototype.
64
65 2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
66
67 * xgselect.c: Remove unneeded include xterm.h.
68
69 * process.c (wait_reading_process_output): Check for NS before GLIB.
70 GLIB may be linked in due to rsvg, but ns_select must be called.
71
72 * xgselect.c (xg_select): Remove call to window_system_available
73 and g_main_context_pending at the top, so Gdk events (i.e. file
74 notify) are processed when Emacs is started with -nw.
75
76 2013-06-07 Eli Zaretskii <eliz@gnu.org>
77
78 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
79 (ctagsfiles3): New variable, includes only *.m files.
80 (TAGS): Use an explicit language name in the regular expressions,
81 to avoid transformation of '/SOMETHING' by MSYS to
82 'c:\MSYS\SOMETHING'.
83
84 2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
85
86 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
87
88 2013-06-06 Eli Zaretskii <eliz@gnu.org>
89
90 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
91 still need to set the mouse pointer shape and activate help-echo.
92 (Bug#14558)
93
94 2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
95
96 A few porting etc. fixes for the new file monitor code.
97 See the thread containing
98 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
99 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
100 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
101 (dir_monitor_callback, Fgfile_rm_watch):
102 Use assq_no_quit instead of Fassoc, for speed.
103 (dir_monitor_callback, Fgfile_rm_watch):
104 eassert that the monitor is a fixnum.
105 (dir_monitor_callback): No need for CDR_SAFE.
106 Simplify building of lisp with alternative tails.
107 (Fgfile_add_watch, Fgfile_rm_watch):
108 Do not assume glib functions set errno reliably on failure.
109 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
110 and signal an error otherwise.
111 (Fgfile_rm_watch): Prefer CONSP to !NILP.
112 Use Fdelq instead of Fdelete, for speed.
113
114 2013-06-05 Eli Zaretskii <eliz@gnu.org>
115
116 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
117 don't insist on being invoked on a highlighted tool-bar button.
118 Avoids losing tool-bar functionality when mouse-highlight is nil.
119 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
120 Don't highlight when mouse-highlight is nil.
121 (note_mouse_highlight): When mouse-highlight is nil, don't return
122 right away; instead, run tool-bar and mode-line highlight
123 subroutine, clear any existing highlight, and revert the mouse
124 pointer to its default shape. (Bug#14558)
125
126 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
127
128 * lisp.mk (lisp): Add prog-mode.el.
129
130 2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
131
132 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
133 * process.c (dummy_handler): New function.
134 (lib_child_handler): New static var.
135 (handle_child_signal): Invoke it.
136 (catch_child_signal): If a library has set up a signal handler,
137 save it into lib_child_handler.
138 (init_process_emacs): If using glib and not on Windows, tickle glib's
139 child-handling code so that it initializes its private SIGCHLD handler.
140 * syssignal.h (SA_SIGINFO): Default to 0.
141 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
142 31; it should no longer be needed now.
143
144 2013-06-05 Michael Albinus <michael.albinus@gmx.de>
145
146 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
147
148 * gfilenotify.c (globals_of_gfilenotify): New function.
149 (syms_of_gfilenotify): Move global initialization there.
150
151 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
152
153 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
154
155 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
156 * keyboard.c (menu_bar_items, tool_bar_items):
157 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
158 not override local keymaps any more.
159
160 2013-06-04 Eli Zaretskii <eliz@gnu.org>
161
162 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
163
164 2013-06-03 Eli Zaretskii <eliz@gnu.org>
165
166 * w32console.c (initialize_w32_display): Return the dimensions of
167 the console window via 2 additional arguments, not via the current
168 frame. This avoids crashes due to overrunning the bounds of
169 frame's decode_mode_spec_buffer, which is not resized following
170 the change of the frame dimensions from the initial 10x10.
171
172 * w32term.h (w32_initialize_display_info): Adjust prototype.
173
174 * term.c (init_tty): Take dimensions of the frame from the values
175 returned by initialize_w32_display.
176
177 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
178 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
179 (LIBES): Add $(GFILENOTIFY_LIBS).
180
181 * w32inevt.c (handle_file_notifications): Add dummy implementation
182 for !HAVE_W32NOTIFY.
183
184 * w32term.c: Wrap code with HAVE_W32NOTIFY.
185
186 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
187
188 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
189
190 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
191
192 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
193
194 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
195
196 Fix minor problems found by static checking.
197 * data.c (pure_write_error):
198 Use xsignal2, not Fsignal, as Fsignal might return.
199 * eval.c (set_backtrace_debug_on_exit): Now static.
200 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
201 No longer inline. EXTERN_INLINE is needed only for functions
202 defined in .h files. Reindent function header as per GNU style.
203 (backtrace_p, backtrace_top, backtrace_next):
204 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
205 compiler or linker. Add extern decls to pacify gcc -Wall.
206 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
207 Now static.
208 * frame.c (free_monitors): Define only on platforms that need it.
209 * nsterm.m (ns_term_init):
210 * process.c (catch_child_signal):
211 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
212 defined on all porting targets these days.
213 * process.c, process.h (catch_child_signal):
214 Make it extern only if NS_IMPL_GNUSTEP is defined.
215
216 2013-06-03 Eli Zaretskii <eliz@gnu.org>
217
218 * w32.c (gettimeofday): Make the signature identical to prototype
219 in nt/inc/sys/time.h.
220
221 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
222
223 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
224 .gdbinit.
225
226 * keyboard.c (safe_run_hooks_error): Improve error message.
227
228 * data.c (pure_write_error): Add `object' argument.
229 * puresize.h (CHECK_IMPURE): Use it.
230
231 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
232
233 * Makefile.in (NOTIFY_OBJ): New variable.
234 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
235
236 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
237 Call syms_of_gfilenotify.
238
239 * gfilenotify.c: New file.
240
241 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
242 and Qfile_w32notify.
243 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
244 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
245
246 * lisp.h: Declare syms_of_gfilenotify.
247
248 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
249
250 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
251
252 Merge the specpdl and backtrace stacks. Make the structure of the
253 specpdl entries more obvious via a tagged union of structs.
254 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
255 (enum specbind_tag): New enum.
256 (struct specbinding): Make it a tagged union of structs.
257 Add a case for backtrace records.
258 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
259 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
260 (backtrace_debug_on_exit): New accessors.
261 (struct backtrace): Remove.
262 (struct catchtag): Remove backlist field.
263 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
264 Move to eval.c.
265 (Flocal_variable_p): Speed up the common case where the binding is
266 already loaded.
267 * eval.c (backtrace_list): Remove.
268 (set_specpdl_symbol, set_specpdl_old_value): Remove.
269 (set_backtrace_args, set_backtrace_nargs)
270 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
271 (backtrace_next): New functions.
272 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
273 (unwind_to_catch, internal_lisp_condition_case)
274 (internal_condition_case, internal_condition_case_1)
275 (internal_condition_case_2, internal_condition_case_n): Don't bother
276 with backtrace_list any more.
277 (Fsignal): Adjust to new backtrace format.
278 (grow_specpdl): Move up.
279 (record_in_backtrace): New function.
280 (eval_sub, Ffuncall): Use it.
281 (apply_lambda): Adjust to new backtrace format.
282 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
283 data.c.
284 (specbind): Adjust to new specpdl format. Simplify.
285 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
286 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
287 backtrace format.
288 (mark_backtrace): Remove.
289 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
290 * xdisp.c (redisplay_internal): Use record_in_backtrace.
291 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
292 Use mark_specpdl.
293 * profiler.c (record_backtrace): Use get_backtrace.
294 (handle_profiler_signal): Use backtrace_top_function.
295 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
296 accessor functions.
297
298 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
299
300 * process.h (catch_child_signal): Declare.
301
302 * process.c (catch_child_signal): New function.
303 (init_process_emacs): Call it.
304
305 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
306 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
307 NS_IMPL_COCOA.
308 (x_set_cursor_type): Remove declaration.
309 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
310 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
311 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
312 (ns_get_color): Use F suffix on float.
313 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
314 (ns_get_rgb_color): Remove.
315 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
316 (note_mouse_movement): x and y are CGFloat.
317 (ns_draw_fringe_bitmap): Remove unused rowY.
318 Change #if to COCOA && >= 10_6.
319 (ns_draw_window_cursor): Remove unused overspill.
320 (ns_draw_underwave): width and x are EamcsCGFloat.
321 (ns_draw_box): thickness is CGFloat.
322 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
323 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
324 if not in main thread.
325 (ns_get_pending_menu_title, ns_check_menu_open)
326 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
327 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
328 (sendFromMainThread:): New method.
329 (changeFont:): size is CGFloat.
330 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
331 Disable warning about permanent text.
332 (characterIndexForPoint:): Adjust return type depending on GNUStep
333 version.
334 (mouseDown:): delta is CGFloat.
335 (updateFrameSize): Remove unised variable f.
336 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
337 Cast float to EmacsCGFloat.
338 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
339 also to -1 when restoring.
340 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
341 inside NS_IMPL_COCOA.
342 (toggleFullScreen:): Put call to toggleFullScreen inside
343 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
344 (setPosition:portion:whole:): por is CGFloat.
345 (getMouseMotionPart:window:x:y:): Add F suffix to float.
346 (mouseDown:): Use CGFloat.
347 (mouseDragged:): Remove unised variable edge.
348 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
349
350 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
351 of CGFloat differs.
352 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
353 when NS_IMPL_GNUSTEP.
354 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
355 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
356 (EmacsToolbar): Add clearAll. Add tag argument to
357 addDisplayItemWithImage.
358 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
359
360 * nsselect.m (ns_get_local_selection): Remove unused variable type.
361
362 * nsmenu.m (ns_update_menubar): Make static.
363 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
364 (fillWithWidgetValue:): Add cast to SEL for setAction.
365 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
366 (update_frame_tool_bar): Update code for GNUStep.
367 (clearAll): New method.
368 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
369 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
370 Move identifierToItem setObject and activeIdentifiers addObject before
371 call to insertItemWithItemIdentifier.
372 (validateVisibleItems): Fix indentation.
373 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
374 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
375 UtilityWindow to aStyle, remove call to setStyleMask.
376
377 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
378
379 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
380 (ns_charset_covers, ns_get_covering_families, nsfont_open):
381 Use F suffix on floats.
382 (ns_char_width): Returns CGFloat.
383 (ns_ascii_average_width): w is CGFloat instead of float.
384 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
385 DPSxshow.
386 (ns_glyph_metrics): CGFloat instead of float.
387
388 * nsfns.m (x_set_foreground_color, x_set_background_color):
389 Use EmacsCGFloat.
390 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
391 remove unused variables.
392 (Fns_read_file_name): Keep track if panel is for save.
393 Use ns_filename_from_panel/ns_directory_from_panel.
394 (Fns_list_services): delegate only used for COCOA.
395 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
396 Just return the input if GNUStep.
397 (x_screen_planes): Remove.
398 (Fxw_color_values): Use EmacsCGFloat
399 (Fns_display_monitor_attributes_list): Only get screen number for
400 Cocoa.
401 (getDirectory, getFilename): Removed from EmacsOpenPanel and
402 EmacsSavePanel.
403 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
404 ns_directory_from_panel.
405
406 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
407
408 * process.c (handle_child_signal): Also use WCONTINUED.
409 This is so that list-processes doesn't mistakenly list the process
410 as stopped, when the process has actually been continued and is
411 now running.
412
413 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
414
415 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
416 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
417 not already configured.
418
419 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
420
421 2013-05-29 Eli Zaretskii <eliz@gnu.org>
422
423 * Makefile.in (mostlyclean): Remove *.res files.
424
425 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
426
427 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
428 a buffer (bug#8447).
429
430 2013-05-27 Eli Zaretskii <eliz@gnu.org>
431
432 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
433 display vector, and we backtrack, handle the case that the
434 previous character position is also displayed from a display
435 vector or covered by a display string or image. (Bug#14476)
436
437 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
438
439 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
440 (struct MonitorInfo, free_monitors): Remove.
441 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
442 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
443 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
444 Qframes, Qsource.
445
446 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
447 (struct MonitorInfo, free_monitors): Remove.
448 (ns_screen_name): Make static.
449 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
450 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
451 Qframes, Qsource.
452
453 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
454 (struct MonitorInfo): New struct.
455 (free_monitors, make_monitor_attribute_list): Declare.
456
457 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
458 New Lisp_Object:s.
459 (free_monitors, make_monitor_attribute_list): New functions.
460 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
461 Qsource.
462
463 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
464
465 * callproc.c (call_process): Refine the doc string. (Bug#14045)
466
467 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
468
469 * keyboard.c: Apply keyboard decoding only to events that come directly
470 from the tty, not from unread-command-events (bug#14368).
471 (read_event_from_main_queue): New function, extracted from read_char).
472 (read_decoded_char): Remove.
473 (read_decoded_event_from_main_queue): New function to replace it.
474 (read_char): Use it.
475 (read_key_sequence): Use read_char rather than read_decoded_char.
476
477 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
478
479 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
480
481 * casetab.c (init_casetab_once): Fix last change (bug#14424).
482
483 2013-05-22 Kenichi Handa <handa@gnu.org>
484
485 The following changes are to fix the setting of
486 buffer-file-coding-system on, for instance, C-x RET c unix RET
487 _FILE_OF_DOS_EOL_TYPE_ RET.
488
489 * coding.h (struct coding_system): New member detected_utf8_chars.
490
491 * coding.c (detect_coding_utf_8): Count characters and check EOL
492 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
493 BOM is there.
494 (setup_coding_system): Do not initialize coding->head_ascii.
495 (check_ascii): Do not set coding->eol_seen but update it. Do not
496 call adjust_coding_eol_type here.
497 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
498 If the eol-type of CODING is already specified, adjust the eol type
499 of the found coding-system.
500 (decode_coding_gap): Cancel previous change. Utilize the
501 character numbers counted by detect_coding_utf_8. Fix detection
502 of BOM for utf-8.
503
504 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
505
506 * search.c (looking_at_1): Only set last_thing_searched if the match
507 changed the match-data (bug#14281).
508
509 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
510
511 * xdisp.c (reseat_at_previous_visible_line_start):
512 Already declared in dispextern.h, so remove it here.
513 (move_it_vertically_backward): Likewise.
514
515 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
516
517 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
518 (Fx_display_pixel_width, Fx_display_pixel_height)
519 (Fx_display_mm_width, Fx_display_mm_height):
520 Mention `display-monitor-attributes-list' in docstrings.
521
522 * nsfns.m (ns_get_screen): Remove function. All uses removed.
523 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
524 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
525 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
526 (Fx_display_backing_store, Fx_display_visual_class)
527 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
528 (Fx_display_grayscale_p, Fx_display_pixel_width)
529 (Fx_display_pixel_height, Fx_display_planes)
530 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
531 (Fx_display_screens): Don't confuse X11 screens with NS screens.
532 (Fx_display_mm_width, Fx_display_mm_height)
533 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
534 height for all physical monitors as in X11.
535
536 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
537 Return pixel width or height for all physical monitors as in X11.
538
539 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
540
541 Port --enable-gcc-warnings to clang.
542 * bytecode.c (exec_byte_code):
543 * regex.c:
544 Redo diagnostic pragmas to pacify clang, too.
545 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
546 * editfns.c (Fencode_time):
547 * fileio.c (file_accessible_directory_p):
548 * font.c (font_unparse_xlfd):
549 Use '&"string"[index]' instead of '"string" + (index)'.
550 * undo.c (user_error): Remove; unused.
551
552 2013-05-16 Eli Zaretskii <eliz@gnu.org>
553
554 * insdel.c (insert_1_both): Document the arguments, instead of
555 referring to insert_1, which no longer exists.
556
557 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
558 some window, increment windows_or_buffers_changed, so that
559 *Messages* display in that window is updated. (Bug#14408)
560
561 * w32.c: Include epaths.h.
562 (init_environment): Use cmdproxy.exe without leading directories.
563 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
564 case.
565 (gettimeofday): Adjust signature and return value to Posix
566 expectations.
567
568 * unexw32.c (open_output_file): Delete the existing emacs.exe
569 before creating it, to break the hard link to the versioned
570 executable.
571
572 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
573 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
574 (FIRSTFILE_OBJ): New variables.
575 (W32_RES): Rename to EMACSRES. All users changed.
576 (base_obj): Use $(CM_OBJ).
577 (ALLOBJS): Use $(FIRSTFILE_OBJ).
578 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
579 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
580 $(W32_RES_LINK) before $(LIBES).
581 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
582
583 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
584
585 * makefile.w32-in (DOC): Use just "DOC".
586
587 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
588
589 * process.c: Export default filters and sentinels to Elisp.
590 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
591 New constants.
592 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
593 (Fset_process_sentinel, Fformat_network_address):
594 Default to them instead of nil.
595 (server_accept_connection): Sentinels can't be nil any more.
596 (read_and_dispose_of_process_output): New function, extracted from
597 read_process_output.
598 (read_process_output): Use it; filters can't be nil.
599 (Finternal_default_process_filter): New function, extracted from
600 read_process_output.
601 (exec_sentinel_unwind): Remove function.
602 (exec_sentinel): Don't zilch sentinel while running.
603 (status_notify): Sentinels can't be nil.
604 (Finternal_default_process_sentinel): New function extracted from
605 status_notify.
606 (setup_process_coding_systems): Default filter is not nil any more.
607 (syms_of_process): Export new Elisp functions and initialize
608 new constants.
609 * lisp.h (make_lisp_proc): New function.
610
611 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
612
613 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
614
615 2013-05-14 Eli Zaretskii <eliz@gnu.org>
616
617 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
618 unless we know that the window w is a leaf window.
619 Another attempt at solving bug#14062.
620
621 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
622
623 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
624 fdesc (Bug#14375).
625
626 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
627
628 * image.c (gif_load): Check that subimages fit (Bug#14345).
629
630 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
631
632 * lread.c (skip_dyn_eof): New function.
633 (read1): Use it to skip the end of a file in response to #@00.
634
635 * doc.c (get_doc_string): Slightly relax the sanity checking.
636
637 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
638
639 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
640 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
641 (MonitorInfo): New struct.
642 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
643 (Fns_display_monitor_attributes_list): New functions.
644 (display-usable-bounds): Remove.
645 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
646 Qsource.
647
648 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
649
650 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
651 (GTK_CHECK_VERSION): New macro, if not already defined.
652 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
653 replaced by GTK_CHECK_VERSION.
654
655 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
656
657 * xterm.h (GTK_PREREQ): New macro.
658 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
659 to use this macro instead, for consistency and clarity.
660
661 2013-05-08 Eli Zaretskii <eliz@gnu.org>
662
663 * xdisp.c (row_for_charpos_p): New function, with code of
664 cursor_row_p, but accepts an additional argument CHARPOS instead
665 of using a hardcoded PT.
666 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
667 (row_containing_pos): Call row_for_charpos_p instead of partially
668 doing the same. Fixes cursor positioning under longlines-mode
669 when longlines-show-effect includes more than one newline, when
670 moving the cursor vertically up.
671
672 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
673
674 * makefile.w32-in (ACL_H): New macro.
675 ($(BLD)/fileio.$(O)): Update dependencies.
676
677 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
678
679 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
680 * Makefile.in (LIB_ACL): New macro.
681 (LIBACL_LIBS): Remove.
682 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
683 * fileio.c: Include <acl.h>.
684 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
685 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
686 !acl_errno_valid.
687 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
688 it ourselves.
689
690 * unexelf.c: Don't assume ElfW (Half) fits in int.
691 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
692 when dealing with ElfW (Half) values, since they can exceed 2**31
693 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
694 (entry_address): Omit unused NUM arg. All uses changed.
695
696 2013-05-07 Juri Linkov <juri@jurta.org>
697
698 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
699 to the string converted from number with `Fnumber_to_string'.
700 (Bug#14254)
701
702 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
703
704 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
705 This fixes a problem introduced by my previous change.
706
707 2013-05-07 Glenn Morris <rgm@gnu.org>
708
709 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
710
711 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
712
713 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
714
715 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
716
717 Static checking by GCC 4.8.0.
718 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
719 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
720 (x_get_monitor_attributes_fallback)
721 (x_get_monitor_attributes_xinerama)
722 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
723 Define only if USE_GTK.
724 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
725 (x_get_monitor_attributes_fallback): Omit unused locals.
726 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
727 Use double, not float, to avoid mixed-mode floating point arithmetic.
728
729 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
730 Jan Djärv <jan.h.d@swipnet.se>
731
732 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
733 (XINERAMA_CFLAGS): New macros.
734 (ALL_CFLAGS, LIBES): Use them.
735
736 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
737 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
738 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
739 (syms_of_xfns): DEFSYM them.
740 (struct MonitorInfo): New struct.
741 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
742 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
743 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
744 (x_get_monitor_attributes_xinerama): New functions.
745 (Fx_display_monitor_attributes_list): New primitive.
746 (syms_of_xfns): Defsubr it.
747
748 * xterm.h (x_display_info): Add Xatom_net_workarea and
749 Xatom_net_current_desktop.
750
751 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
752 and dpyinfo->Xatom_net_current_desktop.
753
754 2013-05-06 Eli Zaretskii <eliz@gnu.org>
755
756 * xdisp.c (pos_visible_p): Use the special code for finding the
757 beginning of a display property or overlay for any "replacing"
758 display property, not just for display strings. This solves
759 incorrect reporting of position by posn-at-point. (Bug#14241)
760
761 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
762
763 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
764 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
765 Verify that ElfW (Half) fits in int.
766 (fatal): Use same signature as lisp.h.
767 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
768 configure and build with -DUNEXELF_DEBUG without worrying about
769 other modules that use DEBUG.
770 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
771 possibly-wide integers now uses it instead of plain fprintf.
772 (entry_address): New function, which avoids problems with 32-bit
773 overflow on 64-bit hosts.
774 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
775 (round_up): Don't assume the remainder fits in int.
776 (find_section): Use bool for boolean. Simplify debug code.
777 (unexec): Don't assume file sizes fit in int or size_t.
778 Omit unnecessary trailing newline in 'fatal' format.
779 Use strerror rather than outputting decimal error number.
780 Remove unused code when emacs is not defined;
781 this file relies on Emacs now.
782 Don't assume e_phnum and e_shnum are positive.
783
784 * regex.c: Fix problems when DEBUG is defined.
785 (extract_number, extract_number_and_incr): Define regardless of
786 whether DEBUG is defined; that's simpler and makes the code less
787 likely to go stale in the normal case when DEBUG is not defined.
788 Return int rather than taking an int * arg. All callers changed.
789 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
790 Remove, replacing with ...
791 (DEBUG_PRINT): New macro. All callers changed.
792 (DEBUG_COMPILES_ARGUMENTS): New macro.
793 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
794 (print_compiled_pattern, print_double_string) [DEBUG]:
795 Use prototype rather than old-style definition.
796 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
797 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
798 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
799 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
800 Don't assume ptrdiff_t, size_t, and long are the same width as int.
801 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
802 This matters only when DEBUG is defined.
803
804 2013-05-05 Eli Zaretskii <eliz@gnu.org>
805
806 * xdisp.c (set_iterator_to_next): Set the
807 ignore_overlay_strings_at_pos_p flag only if we are _really_
808 iterating over an overlay string, as indicated by the
809 current.overlay_string_index member. (Bug#14306)
810
811 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
812
813 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
814 to where it is used, to avoid autorelease issues (Bug#14050).
815
816 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
817
818 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
819 * fileio.c (syms_of_fileio): Implement this.
820 * filelock.c (create_lock_file): If symbolic links don't work, so
821 we use a regular file as a lock file, do not fsync the lock file;
822 it's not needed.
823
824 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
825
826 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
827 (syms_of_minibuf): Adjust accodingly.
828 * lread.c (Fread):
829 * callint.c (Fcall_interactively): Adjust calls accordingly.
830
831 2013-05-04 Eli Zaretskii <eliz@gnu.org>
832
833 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
834 w->contents is a buffer before computing everything else.
835 Use parentheses to disambiguate last part of the condition.
836
837 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
838 assertion violations. (Bug#14062)
839
840 2013-05-01 David Reitter <david.reitter@gmail.com>
841
842 * nsfns.m (ns_tooltip): Initialize.
843
844 2013-04-28 Eli Zaretskii <eliz@gnu.org>
845
846 * coding.c (decode_coding_gap): Don't remove the character before
847 a newline unless it's a CR character. (Bug#14287)
848
849 2013-04-28 Dan Nicolaescu <dann@gnu.org>
850
851 * dispextern.h (struct face): Move enum face_underline_type
852 earlier so that bitfields can be in the same word.
853
854 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
855
856 * nsfns.m (handlePanelKeys): New function.
857 (EmacsOpenPanel:performKeyEquivalent:)
858 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
859 arrows/function/control and copy/paste keys (Bug#14296).
860
861 2013-04-27 Juri Linkov <juri@jurta.org>
862
863 * callint.c (Fcall_interactively): Call `Qread_number' for
864 interactive code letter `n' instead of using duplicate code.
865 (Bug#14254)
866
867 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
868
869 * systime.h (make_timeval): Declare as 'const'.
870
871 2013-04-27 Kenichi Handa <handa@gnu.org>
872
873 * font.c (font_open_entity): Always open a font of manageable
874 size.
875
876 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
877
878 Port better to AIX (Bug#14258).
879 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
880 to pacify AIX xlc.
881
882 2013-04-24 Kenichi Handa <handa@gnu.org>
883
884 * coding.c (decode_coding_iso_2022): When an invalid escape
885 sequence is encountered, reset the invocation and designation
886 status to the safest one.
887
888 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
889
890 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
891 Without this fix, "make distclean" leaves stamp-h1 behind.
892
893 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
894
895 * w32fns.c (w32_fullscreen_rect): New function to compute the
896 window rectangle for the given fullscreen mode.
897 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
898 longer tunes the window size. This keeps the window's edges flush
899 with the screen and allows the taskbar to hide itself in fullboth.
900
901 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
902 window decorations and uses the entire screen.
903
904 * w32term.h (w32_fullscreen_rect) Add prototype.
905 (struct w32_output): Replace normal_width, normal_height,
906 normal_top, and normal_left members with a single normal_placement
907 struct.
908 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
909 Remove macros.
910 (FRAME_NORMAL_PLACEMENT): New macro.
911
912 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
913
914 * minibuf.c (Ftest_completion): Silence compiler warning.
915
916 2013-04-15 Eli Zaretskii <eliz@gnu.org>
917
918 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
919 bug#14062.
920
921 * frame.h (WINDOW_FRAME): Protect macro and its argument with
922 parentheses.
923
924 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
925 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
926 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
927 parentheses where appropriate.
928
929 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
930
931 * keyboard.c (timer_start_idle): Remove no-longer-used local.
932
933 2013-04-14 Eli Zaretskii <eliz@gnu.org>
934
935 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
936 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
937 Mention in the doc string that setting these variables takes
938 effect only after a call to set-window-buffer. (Bug#14200)
939
940 2013-04-13 Eli Zaretskii <eliz@gnu.org>
941
942 * indent.c (Fvertical_motion): Don't consider display strings on
943 overlay strings as display strings on the buffer position we
944 started from. This prevents vertical cursor motion from jumping
945 more than one line when there's an overlay string with a display
946 property at end of line.
947 Reported by Karl Chen <Karl.Chen@quarl.org> in
948 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
949
950 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
951
952 * window.c (select_window): `record_buffer' even if window is
953 already selected (bug#14191).
954
955 2013-04-11 Eli Zaretskii <eliz@gnu.org>
956
957 * window.c (Fwindow_end): Test more flags, including the buffer's
958 last_overlay_modified flag, to determine whether the window's
959 display is really up-to-date. Prevents the function from
960 returning a stale value. (Bug#14170)
961 (Fwindow_line_height): Fix the test for up-to-date-ness of the
962 current matrix.
963
964 2013-04-10 Eli Zaretskii <eliz@gnu.org>
965
966 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
967 garbaged only if it is not already the top frame on its TTY.
968 This prevents flickering due to constant redrawing of TTY frames when
969 there are GUI frames open in the same session. (Bug#13864)
970
971 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
972
973 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
974 of marking the idle timers directly.
975
976 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
977
978 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
979 tables (bug#14054).
980
981 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
982
983 * window.c (select_window): Don't record_buffer while the invariant is
984 temporarily broken (bug#14161).
985
986 * fns.c (Fdelq): Don't assume !NILP => CONSP.
987
988 2013-04-07 Eli Zaretskii <eliz@gnu.org>
989
990 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
991
992 2013-04-07 Romain Francoise <romain@orebokech.com>
993
994 Ignore additional platform-specific ACL errors (Bug#13702).
995 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
996 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
997
998 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
999
1000 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
1001 f->output_data.ns.
1002
1003 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
1004
1005 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
1006 This bug was introduced by my 2013-02-25 change that simplified
1007 data_start configuration. Without this change, on GNU/Linux
1008 an Emacs configured with --enable-profiling fails immediately
1009 due to a profiler signal.
1010 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
1011 with these flags. On platforms where special flags are needed
1012 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
1013 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
1014 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
1015
1016 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
1017
1018 Get rid of some platform-specific functions examining window
1019 system and its capabilities. This is a partial rework of the
1020 2013-04-05 change.
1021 * lisp.h (have_menus_p): Remove prototype. This function is
1022 replaced with platform-independent window_system_available.
1023 (check_window_system): Move to...
1024 * frame.h (decode_window_system_frame, window_system_available):
1025 ...here, add new prototypes.
1026 * frame.c (window_system_available, decode_window_system_frame):
1027 New functions.
1028 (check_window_system): Platform-independent now.
1029 * xterm.h (x_in_use): Remove declaration.
1030 (check_x_frame):
1031 * w32term.h (check_x_frame):
1032 * nsterm.h (check_x_frame): Remove prototypes. This function
1033 is replaced with platform-independent decode_window_system_frame.
1034 * msdos.c (have_menus_p): Remove.
1035 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
1036 Remove platform-specific functions. Use check_window_system,
1037 decode_window_system_frame and check_ns_display_info where
1038 appropriate. Minor style and comment tweaks.
1039 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
1040 (check_x_frame): Likewise.
1041 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
1042 Likewise.
1043 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
1044 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
1045 * xmenu.c, xselect.c: All related users changed.
1046
1047 2013-04-03 Kenichi Handa <handa@gnu.org>
1048
1049 The following changes is to optimize the code for reading UTF-8
1050 files.
1051
1052 * coding.c (check_ascii): Rename from detect_ascii. Return value
1053 changed. Check EOL format. Do not call adjust_coding_eol_type
1054 here.
1055 (check_utf_8): New function.
1056 (adjust_coding_eol_type): Do nothing if already adjusted.
1057 (detect_coding): Compare the return value of check_ascii with
1058 coding->src_bytes. Call adjust_coding_eol_type if necessary.
1059 (decode_coding_gap): Optimize for valid UTF-8.
1060
1061 2013-03-21 Kenichi Handa <handa@gnu.org>
1062
1063 * coding.c (syms_of_coding): Cancel previous change.
1064
1065 * insdel.c (insert_from_gap): Fix previous change.
1066
1067 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
1068
1069 Consistently use platform-specific function to detect window system.
1070 * lisp.h (check_window_system): New prototype. This function is
1071 going to replace check_x, check_w32 and check_ns.
1072 (have_menus_p): Mention msdos.c in comment.
1073 * fontset.c (check_window_system_func): Remove. Adjust all users.
1074 * fontset.h (check_window_system_func): Remove prototype.
1075 * nsterm.h (check_ns):
1076 * xterm.h (check_x):
1077 * w32term.h (check_w32): Likewise.
1078 * menu.c (Fx_popup_menu): Use check_window_system.
1079 * msdos.c (check_window_system): Define for MS-DOS.
1080 * nsfns.m (check_window_system): Define for NS. Adjust all users.
1081 * w32fns.c (check_window_system): Likewise for MS-Windows.
1082 * xfns.c (check_window_system): Likewise for X.
1083 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
1084 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
1085
1086 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
1087
1088 Prefer < to > in range checks such as 0 <= i && i < N.
1089 This makes it easier to visualize quantities on a number line.
1090 This patch doesn't apply to all such range checks,
1091 only to the range checks affected by the 2013-03-24 change.
1092 This patch reverts most of the 2013-03-24 change.
1093 * alloc.c (xpalloc, Fgarbage_collect):
1094 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
1095 * character.c (string_escape_byte8):
1096 * charset.c (read_hex):
1097 * data.c (cons_to_unsigned):
1098 * dispnew.c (update_frame_1):
1099 * doc.c (Fsubstitute_command_keys):
1100 * doprnt.c (doprnt):
1101 * editfns.c (hi_time, decode_time_components):
1102 * fileio.c (file_offset):
1103 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1104 * font.c (font_intern_prop):
1105 * frame.c (x_set_alpha):
1106 * gtkutil.c (get_utf8_string):
1107 * indent.c (check_display_width):
1108 * keymap.c (Fkey_description):
1109 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
1110 * lread.c (read1):
1111 * minibuf.c (read_minibuf_noninteractive):
1112 * process.c (wait_reading_process_output):
1113 * search.c (Freplace_match):
1114 * window.c (get_phys_cursor_glyph):
1115 * xdisp.c (redisplay_internal):
1116 * xsmfns.c (smc_save_yourself_CB):
1117 Prefer < to > for range checks.
1118 * dispnew.c (sit_for): Don't mishandle NaNs.
1119 This fixes a bug introduced in the 2013-03-24 change.
1120 * editfns.c (decode_time_components): Don't hoist comparison.
1121 This fixes another bug introduced in the 2013-03-24 change.
1122
1123 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
1124
1125 * frame.h (struct frame): Drop scroll_bottom_vpos
1126 member becaue all real users are dead long ago.
1127 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
1128 * xdisp.c (redisplay_internal): Adjust user.
1129
1130 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
1131
1132 * nsmenu.m (showAtX:Y:for:): setLevel to
1133 NSPopUpMenuWindowLevel (Bug#13998).
1134
1135 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
1136
1137 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
1138 (ns_check_pending_open_menu): Declare.
1139
1140 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
1141 (x_activate_menubar): Update the menu with title that matches
1142 ns_get_pending_menu_title, and call
1143 ns_check_pending_openmenu (Bug#12698).
1144 (menuWillOpen:): New method.
1145 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
1146
1147 * nsterm.m (menu_will_open_state, menu_mouse_point)
1148 (menu_pending_title): New varaibles.
1149 (ns_get_pending_menu_title, ns_check_menu_open)
1150 (ns_check_pending_open_menu): New functions.
1151
1152 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
1153
1154 * indent.c (current_column_bol_cache): Remove leftover which is not
1155 used in Fmove_to_column any more.
1156 (current_column, scan_for_column): Adjust users.
1157 * keyboard.c (last_point_position_buffer, last_point_position_window):
1158 Remove leftovers which are not used for recording undo any more.
1159 (command_loop_1, syms_of_keyboard): Adjust users.
1160 * xdisp.c (last_max_ascent): Remove leftover which is not used in
1161 redisplay_window any more.
1162 (move_it_to): Adjust user.
1163
1164 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
1165
1166 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1167 Update dependencies.
1168
1169 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1170
1171 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1172 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1173 forward references.
1174
1175 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 * window.h (struct window): Replace hchild, vchild and buffer slots
1178 with the only contents slot. This is possible because each valid
1179 window may have either the child window (in vertical or horizontal
1180 combination) or buffer to display (for the leaf window). Using that,
1181 a lof of operations to traverse and/or change window hierarchies may
1182 be simplified. New member horizontal is used to distinguish between
1183 horizontal and vertical combinations of internal windows.
1184 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1185 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1186 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1187 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1188 Use contents slot, not buffer, where appropriate.
1189 (wset_combination): New function.
1190 (wset_buffer): Add eassert.
1191 (Fframe_first_window): Simplify the loop reaching first window.
1192 (Fwindow_buffer): Use WINDOW_LEAF_P.
1193 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1194 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1195 (unshow_buffer): Convert initial debugging check to eassert.
1196 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1197 (make_parent_window, window_resize_check, window_resize_apply)
1198 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1199 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1200 Adjust to match struct window changes.
1201 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1202 (mark_window_cursors_off, count_windows, get_leaf_windows)
1203 (foreach_window_1): Simplify the loop.
1204 * alloc.c (mark_object): Do not check for the leaf window because
1205 internal windows has no glyph matrices anyway.
1206 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1207 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1208 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1209 (build_frame_matrix_from_window_tree, mirror_make_current)
1210 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1211 (update_window_tree, set_window_update_flags): Simplify the loop.
1212 (sync_window_with_frame_matrix_rows): Enforce live window.
1213 Use contents slot, not buffer, where appropriate.
1214 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1215 and WINDOW_HORIZONTAL_COMBINATION_P.
1216 (make_frame_visible_1): Simplify the loop.
1217 Use contents slot, not buffer, where appropriate.
1218 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1219 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1220 (expose_window_tree): Likewise.
1221 Use contents slot, not buffer, where appropriate.
1222 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1223 to avoid deleted windows. Use contents slot instead of buffer.
1224 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1225 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1226 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1227 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1228
1229 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1230
1231 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1232 identify the reasons for assertion violations in bug#14062 and
1233 similar ones.
1234 (Fx_show_tip): Fix compilation error under
1235 "--enable-check-lisp-object-type". (Bug#14073)
1236
1237 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1238 Reported by <rzl24ozi@gmail.com>.
1239
1240 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1241
1242 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1243 start marker...
1244 (unwind_with_echo_area_buffer): ...to restore it here.
1245 This is needed to ensure that...
1246 (redisplay_window): ...both window markers are valid here,
1247 which is verified by eassert.
1248 * editfns.c (save_excursion_save): Do not assume that
1249 selected_window always displays the buffer.
1250 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1251 Fix comment.
1252
1253 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1254
1255 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1256 the upcase table.
1257
1258 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1259
1260 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1261
1262 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1263
1264 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1265 since MinGW's w32api headers do. This avoids compiler warnings.
1266
1267 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1268 if already defined.
1269
1270 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1271
1272 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1273
1274 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1275
1276 * gtkutil.c (style_changed_cb): Check if frame is live and an
1277 X frame (Bug#14038).
1278
1279 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1280
1281 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1282 Define only for _WIN32_WINNT less than 0x0500.
1283 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1284 MinGW64.
1285 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1286 see its own definitions of 'struct timeval' and 'struct timezone'.
1287
1288 Fix incompatibilities between MinGW.org and MinGW64 headers.
1289 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1290
1291 * w32.c (REPARSE_DATA_BUFFER): Guard with
1292 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1293
1294 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1295
1296 * xterm.c: Include X11/XKBlib.h
1297 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1298
1299 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1300
1301 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1302 written backwards.
1303 * blockinput.h (input_blocked_p): Likewise.
1304 * bytecode.c (exec_byte_code): Likewise.
1305 * callproc.c (call_process_kill, call_process_cleanup)
1306 (Fcall_process): Likewise.
1307 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1308 (Fccl_execute_on_string): Likewise.
1309 * character.c (string_escape_byte8): Likewise.
1310 * charset.c (read_hex): Likewise.
1311 * cm.c (calccost): Likewise.
1312 * data.c (cons_to_unsigned): Likewise.
1313 * dired.c (directory_files_internal, file_name_completion):
1314 Likewise.
1315 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1316 (sit_for): Likewise.
1317 * doc.c (Fsubstitute_command_keys): Likewise.
1318 * doprnt.c (doprnt): Likewise.
1319 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1320 * emacsgtkfixed.c: Likewise.
1321 * fileio.c (file_offset, Fwrite_region): Likewise.
1322 * floatfns.c (Fexpt, fmod_float): Likewise.
1323 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1324 Likewise.
1325 * font.c (font_intern_prop): Likewise.
1326 * frame.c (x_set_alpha): Likewise.
1327 * gtkutil.c (get_utf8_string): Likewise.
1328 * indent.c (check_display_width): Likewise.
1329 * intervals.c (create_root_interval, rotate_right, rotate_left)
1330 (split_interval_right, split_interval_left)
1331 (adjust_intervals_for_insertion, delete_node)
1332 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1333 (merge_interval_right, merge_interval_left, copy_intervals)
1334 (set_intervals_multibyte_1): Likewise.
1335 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1336 * keymap.c (Fkey_description): Likewise.
1337 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1338 * lread.c (openp, read_integer, read1, string_to_number):
1339 Likewise.
1340 * menu.c (ensure_menu_items): Likewise.
1341 * minibuf.c (read_minibuf_noninteractive): Likewise.
1342 * print.c (printchar, strout): Likewise.
1343 * process.c (create_process, Faccept_process_output)
1344 (wait_reading_process_output, read_process_output, send_process)
1345 (wait_reading_process_output): Likewise.
1346 * profiler.c (make_log, handle_profiler_signal): Likewise.
1347 * regex.c (re_exec): Likewise.
1348 * regex.h: Likewise.
1349 * search.c (looking_at_1, Freplace_match): Likewise.
1350 * sysdep.c (get_child_status, procfs_ttyname)
1351 (procfs_get_total_memory): Likewise.
1352 * systime.h (EMACS_TIME_VALID_P): Likewise.
1353 * term.c (dissociate_if_controlling_tty): Likewise.
1354 * window.c (get_phys_cursor_glyph): Likewise.
1355 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1356 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1357 Likewise.
1358 * xfns.c (Fx_window_property): Likewise.
1359 * xmenu.c (set_frame_menubar): Likewise.
1360 * xselect.c (x_get_window_property, x_handle_dnd_message):
1361 Likewise.
1362 * xsmfns.c (smc_save_yourself_CB): Likewise.
1363 * xterm.c (x_scroll_bar_set_handle): Likewise.
1364
1365 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1366
1367 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1368 to be optional or nil. Adjust comment and convert it to docstring.
1369 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1370 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1371
1372 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1373
1374 Static checking by GCC 4.8-20130319.
1375 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1376 * process.c (Fset_process_datagram_address)
1377 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1378 * xdisp.c (get_char_face_and_encoding):
1379 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1380 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1381 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1382
1383 2013-03-24 Ken Brown <kbrown@cornell.edu>
1384
1385 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1386 fix compilation on 64-bit Cygwin, where underscores are not
1387 automatically prepended.
1388
1389 * w32term.c (w32_initialize): Silence compiler warning.
1390
1391 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1392
1393 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1394 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1395 variables, to save and restore frame dimensions.
1396 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1397 after returning from a 'fullscreen' configuration.
1398 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1399 to avoid races between the main thread and the input thread.
1400
1401 * w32term.h (struct w32_output): New members normal_width,
1402 normal_height, normal_top, normal_left, and prev_fsmode.
1403 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1404 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1405 members of a frame.
1406
1407 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1408 'fullscreen' parameter. Always record previous width and height
1409 of the frame, except when switching out of maximized modes, so
1410 that they could be restored correctly, instead of resetting to the
1411 default frame dimensions. Send SC_RESTORE command to the frame,
1412 unless we are going to send SC_MAXIMIZE, to restore the frame
1413 resize hints in the mouse pointer shown by the window manager.
1414 (Bug#14032)
1415
1416 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1417
1418 * lisp.h (get_frame_param): Adjust conditions for prototype
1419 declaration.
1420
1421 2013-03-22 Ken Brown <kbrown@cornell.edu>
1422
1423 * unexcw.c: Drop unneeded inclusion of w32common.h.
1424 (report_sheap_usage): Declare.
1425 (read_exe_header): Add magic numbers for x86_64.
1426 (fixup_executable): Fix printf format specifier for unsigned long
1427 argument.
1428
1429 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1430
1431 * frame.h (struct frame): Put menu_bar_window under #ifdef
1432 because this member is not needed when X toolkit is in use.
1433 (fset_menu_bar_window):
1434 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1435 (free_glyphs, update_frame):
1436 * xdisp.c (expose_frame): Likewise.
1437 (display_menu_bar): Likewise. Remove redundant eassert.
1438 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1439 toolkit is in use.
1440
1441 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1442
1443 Use functions and constants to manipulate Lisp_Save_Value objects.
1444 This replaces code that used macros and strings and token-pasting.
1445 The change makes the C source a bit easier to follow,
1446 and shrinks the Emacs executable a bit.
1447 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1448 (make_save_value): Change 1st arg from string to enum. All callers
1449 changed.
1450 (INTX): Remove.
1451 (mark_object): Use if, not #if, for GC_MARK_STACK.
1452 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1453 (XSAVE_OBJECT): Now functions, not macros.
1454 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1455 the constant was never used.
1456 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1457 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1458 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1459 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1460 New constants.
1461 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1462 type3 with a single member save_type. All uses changed.
1463 (save_type, set_save_pointer, set_save_integer): New functions.
1464 * print.c (PRINTX): Remove.
1465
1466 * alloc.c: Remove redundant static declarations.
1467
1468 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1469
1470 * window.h (struct window): Convert left_col, top_line, total_lines
1471 and total_cols from Lisp_Objects to integers. Adjust comments.
1472 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1473 Remove.
1474 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1475 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1476 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1477 Adjust users where appropriate.
1478
1479 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1480
1481 * frame.h (struct frame): Drop resx and resy because the same data is
1482 available from window system-specific output context. Adjust users.
1483 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1484 New functions to provide defaults when no window system available.
1485 (FRAME_RES_X, FRAME_RES_Y): New macros.
1486 (NUMVAL): Move from xdisp.c.
1487 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1488 (Ffont_face_attributes, Fopen_font):
1489 * image.c (gs_load):
1490 * w32font.c (fill_in_logfont):
1491 * xdisp.c (calc_pixel_width_or_height):
1492 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1493 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1494
1495 2013-03-20 Kenichi Handa <handa@gnu.org>
1496
1497 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1498 to 1 (temporary workaround until a bug related to ASCII
1499 optimization is fixed).
1500
1501 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1502
1503 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1504 Signal error if window is not internal. Adjust docstring.
1505 (delete_all_child_windows): Use combination_limit to save the buffer.
1506 (Fset_window_configuration): Adjust accordingly.
1507 * print.c (syms_of_print): Initialize debugging output not here...
1508 (init_print_once): ...but in a new function here.
1509 * lisp.h (init_print_once): Add prototype.
1510 * emacs.c (main): Add call to init_print_once. Adjust comments.
1511
1512 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1513
1514 * window.c (window_resize_check, window_resize_apply)
1515 (window_from_coordinates, recombine_windows, set_window_buffer)
1516 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1517 (Fsplit_window_internal, Fdelete_window_internal)
1518 (freeze_window_starts): Use bool for booleans.
1519 * window.h (window_frame_coordinates, resize_frame_windows)
1520 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1521
1522 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1523
1524 * dispnew.c (bitch_at_user): Use `user-error'.
1525
1526 2013-03-17 Ken Brown <kbrown@cornell.edu>
1527
1528 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1529 as return type of image_background. (Bug#13981)
1530 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1531
1532 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1533
1534 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1535 (ns_select): Don't return with result uninitialized.
1536
1537 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1538 and getDirectory.
1539
1540 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1541 New functions.
1542 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1543 directories. If filename is nil, get directory name (Bug#13932).
1544 Use getFilename and getDirectory.
1545 (getFilename, getDirectory): New methods for EmacsSavePanel and
1546 EmacsOpenPanel.
1547 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1548
1549 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1550
1551 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1552
1553 2013-03-15 Kenichi Handa <handa@gnu.org>
1554
1555 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1556 (adjust_after_replace): Make it back to static. Delete the third
1557 arg text_at_gap_tail. Cancel the code for handling it.
1558
1559 * coding.h (struct coding_system): New member eol_seen.
1560
1561 * coding.c (detect_ascii): New function.
1562 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1563 when the source bytes are actually scanned. On detecting for
1564 coding_category_utf_8_auto, call detect_ascii instead of scanning
1565 source bytes directly.
1566 (produce_chars): Call insert_from_gap with the new arg 0.
1567 (encode_coding): Likewise.
1568 (decode_coding_gap): Control ASCII optimization by the variable
1569 disable_ascii_optimization instead of #ifndef .. #endif.
1570 Deccode EOL format according to coding->eol_seen.
1571 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1572 variable.
1573
1574 * lisp.h (adjust_after_replace): Cancel externing it.
1575 (insert_from_gap): Adjust prototype.
1576
1577 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1578
1579 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1580 FULLSCREEN_MAXIMIZED. (Bug#13935)
1581
1582 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1583
1584 * region-cache.c (find_cache_boundary, move_cache_gap)
1585 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1586 Simplify debugging check and convert to eassert. Adjust comment.
1587 (pp_cache): Put under ENABLE_CHECKING.
1588
1589 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1590
1591 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1592 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1593 and WM_ACTIVATEAPP.
1594 (w32fullscreen_hook): If the frame is visible, reset
1595 f->want_fullscreen flag after changing the frame size. If the
1596 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1597 (Bug#13953)
1598
1599 2013-03-13 Daniel Colascione <dancol@dancol.org>
1600
1601 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1602 too so that these builds can use Cygwin's file conversion
1603 functions. (We've been building and linking cygw32.o all along
1604 and just not using it.)
1605
1606 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1607
1608 File synchronization fixes (Bug#13944).
1609 * Makefile.in (LIB_FDATASYNC): New macro.
1610 (LIBES): Use it.
1611 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1612 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1613 Don't worry about HAVE_FSYNC, since a substitute fsync is
1614 available if the system lacks one.
1615 (Fwrite_regin): Retry fsync if interrupted.
1616
1617 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1618
1619 * w32term.c (w32_read_socket): If the Emacs frame is being
1620 activated, call w32fullscreen_hook, to make sure the new frame
1621 dimensions are in effect. (Bug#13937)
1622
1623 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1624
1625 * xdisp.c (init_iterator): Simplify because both character and byte
1626 positions are either specified or -1. Add eassert. Adjust comment.
1627 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1628 character and byte positions can be obtained from marker.
1629
1630 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1631
1632 Static checking by Sun C 5.12.
1633 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1634 * bytecode.c (exec_byte_code):
1635 * dispnew.c (init_display):
1636 * eval.c (error):
1637 * fileio.c (Fsubstitute_in_file_name):
1638 * keyboard.c (Fevent_convert_list):
1639 * keymap.c (Fsingle_key_description):
1640 * term.c (maybe_fatal, fatal):
1641 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1642 * xsmfns.c (Fhandle_save_session):
1643 Omit unreachable code.
1644 * keymap.c (map_keymap_char_table_item): Cast void * to
1645 a function pointer type; the C Standard requires this.
1646
1647 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1648 Include <sys/param.h> unconditionally, as that works elsewhere and
1649 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1650 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1651 and FreeBSD now.
1652
1653 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1654
1655 * insdel.c (adjust_after_replace): Use bool for boolean.
1656
1657 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1658
1659 * keyboard.c: Move keyboard decoding to read_key_sequence.
1660 (decode_keyboard_code): Remove.
1661 (tty_read_avail_input): Don't try to decode input.
1662 (read_decoded_char): New function.
1663 (read_key_sequence): Use it.
1664
1665 2013-03-10 Daniel Colascione <dancol@dancol.org>
1666
1667 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1668 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1669 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1670 w32fns.c.
1671
1672 * w32term.c (construct_drag_n_drop): Use the above macros to make
1673 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1674
1675 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1676 properly display non-ASCII frame titles in cygw32 builds.
1677
1678 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1679 call ShellExecute in cygw32 builds.
1680
1681 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1682 common file dialog code.
1683
1684 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1685 can just use du like other systems.
1686
1687 * coding.c (from_unicode_buffer): Declare.
1688 * coding.c (from_unicode_buffer): Implement.
1689
1690 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1691
1692 * lread.c: Minor cleanup.
1693 (FROM_FILE_P): New macro.
1694 (skip_dyn_bytes, unreadchar, read1): Use it.
1695 (read_list): Consolidate duplicated code.
1696
1697 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1698
1699 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1700
1701 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1702 (redisplay_internal, set_cursor_from_row, try_window)
1703 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1704 (display_line, notice_overwritten_cursor)
1705 (mouse_face_from_buffer_pos, note_mouse_highlight):
1706 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1707 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1708 (mouse_face_from_string_pos, fast_find_string_pos):
1709 Use MATRIX_ROW_VPOS.
1710
1711 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1712
1713 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1714
1715 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1716 MATRIX_MODE_LINE_ROW.
1717
1718 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1719
1720 2013-03-10 handa <handa@gnu.org>
1721
1722 * lisp.h (adjust_after_replace): Extern it.
1723
1724 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1725 case of detection for coding_category_utf_8_auto.
1726 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1727 Skip decoding if all bytes are ASCII.
1728
1729 * insdel.c (adjust_after_replace): Make it public. New arg
1730 text_at_gap_tail.
1731 (adjust_after_insert): Call adjust_after_replace with the new arg
1732 value 0.
1733
1734 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1735
1736 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1737 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1738 from Elisp via unread-command-events.
1739
1740 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1741 functions to mean "no change".
1742
1743 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1744
1745 region-cache.c, scroll.c, search.c: Use bool for booleans.
1746 * lisp.h (compile_pattern):
1747 * scroll.c (do_scrolling, do_direct_scrolling):
1748 * search.c (struct regexp_cache, compile_pattern_1)
1749 (compile_pattern, string_match_1, search_command)
1750 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1751 (search_regs_saved, Fregexp_quote):
1752 Use bool for boolean.
1753 * region-cache.c (region_cache_forward, region_cache_backward):
1754 Fix comments to match code: these functions return int, not boolean.
1755
1756 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1757
1758 * search.c (find_newline): Accept start and end byte positions
1759 as arguments and allow -1 if not known.
1760 (find_newline_no_quit): Likewise for start position.
1761 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1762 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1763 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1764 * editfns.c (Fconstrain_to_field): Break long line.
1765 Adjust call to find_newline.
1766 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1767 Use DEC_BOTH to start next search from the previous buffer
1768 position, where appropriate.
1769 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1770 (get_visually_first_element, move_it_vertically_backward): Likewise.
1771 Obtain byte position from the display iterator, where appropriate.
1772
1773 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1774
1775 print.c, process.c: Use bool for booleans.
1776 * lisp.h (wait_reading_process_output):
1777 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1778 (strout, debug_output_compilation_hack, float_to_string, print)
1779 (print_object):
1780 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1781 (decode_status, status_message, create_process, create_pty)
1782 (Fmake_network_process, Fnetwork_interface_info)
1783 (wait_reading_process_output, read_process_output)
1784 (write_queue_push, write_queue_pop, process_send_signal)
1785 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1786 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1787 Use bool for booleans.
1788 * process.c (Fnetwork_interface_list): Remove unused local.
1789 (connect_counter): Now EMACS_INT, not int.
1790
1791 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1792
1793 * bidi.c (bidi_fetch_char): Swap first and second arguments
1794 to match other functions accepting character and byte positions.
1795 Adjust comment.
1796 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1797 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1798 when you need just to move to the previous buffer position.
1799 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1800
1801 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1802
1803 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1804
1805 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1806
1807 Avoid character to byte conversions in motion subroutines.
1808 * indent.h (compute_motion, vmotion): Add byte position argument.
1809 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1810 Add eassert.
1811 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1812 Use list5 for return value.
1813 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1814 Adjust comments, style and calls to compute_motion.
1815 (Fvertical_motion): Adjust call to vmotion.
1816 * window.c (Fdelete_other_windows_internal): Record window start
1817 byte position and adjust call to vmotion.
1818 (window_scroll_line_based): Likewise with call to compute_motion.
1819 Use SET_PT_BOTH.
1820 (Frecenter): Adjust calls to vmotion.
1821
1822 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1823
1824 * lisp.h (list2i, list3i): New functions.
1825 (list4i): Move from window.c and make LISP_INLINE.
1826 * editfns.c (make_lisp_time):
1827 * fns.c (Flocale_info):
1828 * keyboard.c (parse_modifiers):
1829 * xterm.c (x_ewmh_activate_frame): Use list2i.
1830 * instel.c (signal_after_change):
1831 * nsfns.m (Fx_server_version, Fxw_color_values):
1832 * w32fns.c (Fxw_color_values, Fx_server_version):
1833 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1834 * fileio.c (Fvisited_file_modtime):
1835 * nsfns.m (Fns_display_usable_bounds):
1836 * w32.c (ltime): Use list4i.
1837
1838 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1839
1840 * search.c (find_newline_no_quit): Rename from find_next_newline.
1841 Add commentary.
1842
1843 * lisp.h (find_newline_no_quit): Rename prototype.
1844
1845 * xdisp.c (back_to_previous_line_start)
1846 (forward_to_next_line_start, get_visually_first_element)
1847 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1848 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1849 * bidi.c (bidi_find_paragraph_start): Callers of
1850 find_newline_no_quit changed.
1851
1852 * msdos.c: Change encoding to cp850. (Bug#13879)
1853 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1854
1855 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1856
1857 Coding system support cleanup and minor refactoring.
1858 * coding.h (enum coding_result_code): Remove
1859 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1860 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1861 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1862 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1863 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1864 (decode_coding_region, encode_coding_region, decode_coding_string):
1865 Remove unused compatibility macros.
1866 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1867 (record_conversion_result): Adjust user.
1868 (syms_of_coding): Likewise.
1869 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1870 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1871 (decode_coding_object): Simplify since xrealloc never returns NULL.
1872 Add eassert.
1873
1874 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1875
1876 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1877 * sysdep.c (list_system_processes)
1878 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1879 Make it a stub in this case; otherwise the build might fail,
1880 and this code hasn't been tested on such hosts anyway.
1881 Problem reported by Nelson H. F. Beebe in
1882 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1883 and analyzed by Jérémie Courrèges-Anglas in
1884 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1885
1886 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1887
1888 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1889 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1890 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1891 * bidi.c (bidi_find_paragraph_start): Likewise.
1892 * indent.c (vmotion): Likewise.
1893
1894 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1895
1896 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1897 * filelock.c: Include <c-ctype.h>.
1898 (MAX_LFINFO): New top-level constant.
1899 (lock_info_type): Remove members pid, boot_time. Add members at,
1900 dot, colon. Change user member to be the entire buffer, not a
1901 pointer. This allows us to handle the case where a foreign
1902 pid or boot time exceeds the local range. All uses changed.
1903 (LINKS_MIGHT_NOT_WORK): New constant.
1904 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1905 (defined_WINDOWSNT): Remove.
1906 (MAKE_LOCK_NAME, file_in_lock_file_name):
1907 Always use .#FILE (not .#-FILE) for the file lock,
1908 even if it is a regular file.
1909 (rename_lock_file): New function.
1910 (create_lock_file): Use it.
1911 (create_lock_file, read_lock_data):
1912 Prefer a symbolic link for the lock file, falling back on a
1913 regular file if symlinks don't work. Do not try to create
1914 symlinks on MS-Windows, due to security hassles. Stick with
1915 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1916 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1917 host may be using a Windowsish file system, and cannot use
1918 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1919 doesn't work. Don't fail merely because of a symlink-contents
1920 length limit in the current file system; fall back on regular
1921 files. Increase the symlink contents length limit to 8 KiB, this
1922 should be big enough for any real use and doesn't crunch the
1923 stack.
1924 (create_lock_file, lock_file_1, read_lock_data):
1925 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1926 (lock_file_1): Return error number, not bool. All callers changed.
1927 (ELOOP): New macro, if not already defined.
1928 (read_lock_data): Return size of lock file contents, not Lisp object.
1929 All callers changed. Handle a race condition if some other process
1930 replaces a regular-file lock with a symlink lock or vice versa,
1931 while we're trying to read the lock.
1932 (current_lock_owner): Parse contents more carefully, to help avoid
1933 confusing a regular-file lock with some other application's use
1934 of the file. Check for lock file contents being too long, or
1935 not parsing correctly.
1936 (current_lock_owner, lock_file):
1937 Allow foreign pid and boot times that exceed the local range.
1938 (current_lock_owner, lock_if_free, lock_file):
1939 Simplify allocation of lock file contents.
1940 * w32.c (sys_rename_replace): New function, containing most of
1941 the contents of the old sys_rename.
1942 (sys_rename): Use it.
1943 (fchmod): New dummy function.
1944 * w32.h (sys_rename_replace, fchmod): New decls.
1945
1946 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1947
1948 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1949 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1950 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1951 <dmantipov@yandex.ru>.
1952
1953 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1954
1955 * composite.c (get_composition_id, fill_gstring_header):
1956 Use make_uninit_vector where appropriate.
1957 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1958 * xselect.c (clean_local_selection_data): Likewise.
1959
1960 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1961
1962 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1963 * image.c (imagemagick_load_image): Calculate height and width
1964 after flattening the image, not before.
1965
1966 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1967
1968 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1969 * ftfont.c (ftfont_shape_by_flt): Likewise.
1970 * w32uniscribe.c (uniscribe_shape): Likewise.
1971
1972 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1973
1974 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1975 The old approach, which fell back on DIR/.#FILE.0 through
1976 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1977 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1978 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1979 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1980 because the locking mechanism was never reliable in that case).
1981 This patch fixes this and other bugs discovered by a code
1982 inspection that was prompted by
1983 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1984 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1985 to avoid interoperability problems between the MS-Windows and
1986 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1987 instances of Emacs now ignore each others' locks.
1988 * filelock.c (defined_WINDOWSNT): New constant.
1989 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1990 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1991 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1992 regular files on MS-Windows hosts.
1993 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1994 Use SAFE_ALLOCA to avoid problems with long file names.
1995 (MAX_LFINFO): Now a local constant, not a global macro.
1996 (IS_LOCK_FILE): Remove.
1997 (lock_file_1): Don't inspect errno if symlink call succeeds;
1998 that's not portable.
1999 (lock_file): Document that this function can return if lock
2000 creation fails.
2001 (lock_file): Don't access freed storage.
2002
2003 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
2004
2005 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
2006
2007 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
2008
2009 * textprop.c: Use bool for booleans.
2010 (validate_interval_range, Fadd_text_properties)
2011 (Fremove_text_properties): Prefer bool to int when either works.
2012
2013 2013-03-02 Eli Zaretskii <eliz@gnu.org>
2014
2015 * textprop.c (Fadd_text_properties, Fremove_text_properties):
2016 If the interval tree changes as a side effect of calling
2017 modify_region, re-do processing starting from the call to
2018 validate_interval_range. (Bug#13743)
2019
2020 2013-02-28 Eli Zaretskii <eliz@gnu.org>
2021
2022 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
2023 (Bug#13546).
2024
2025 2013-02-27 Eli Zaretskii <eliz@gnu.org>
2026
2027 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
2028 _SH_DENYRW flag, instead of emacs_open, to deny any other process
2029 access to the lock file until it is written and closed.
2030 (Bug#13807)
2031
2032 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 * callint.c (Qcall_interactively):
2035 * macros.c (Qexecute_kbd_macro):
2036 Now static.
2037
2038 2013-02-26 Bastien Guerry <bzg@gnu.org>
2039
2040 * window.c (Frecenter): Tiny docstring enhancement.
2041
2042 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 Minor textprop integer cleanup.
2045 * intervals.h, textprop.c (add_text_properties_from_list):
2046 Return void, not int, since nobody uses the return value.
2047 * textprop.c (validate_plist, add_properties, remove_properties)
2048 (Fadd_text_properties):
2049 Don't assume list length fits in int.
2050 (interval_has_all_properties, interval_has_some_properties)
2051 (interval_has_some_properties_list, add_properties, remove_properties)
2052 (Fadd_text_properties, Fremove_text_properties)
2053 (Fremove_list_of_text_properties, text_property_stickiness):
2054 Use bool for booleans.
2055 (Fadd_text_properties, Fremove_text_properties):
2056 (Fremove_list_of_text_properties):
2057 Reindent do-while as per GNU style.
2058
2059 2013-02-25 Eli Zaretskii <eliz@gnu.org>
2060
2061 Implement CLASH_DETECTION for MS-Windows.
2062
2063 * filelock.c [WINDOWSNT]: Include w32.h.
2064 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2065 function of that name. Up-case the macro arguments.
2066 (IS_LOCK_FILE): New macro.
2067 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2068 (create_lock_file): New function, with body extracted from
2069 lock_file_1.
2070 [WINDOWSNT]: Implement lock files by writing a regular file with
2071 the lock information as its contents.
2072 (read_lock_data): New function, on Posix platforms just calls
2073 emacs_readlinkat.
2074 [WINDOWSNT]: Read the lock info from the file.
2075 (current_lock_owner): Call read_lock_data instead of calling
2076 emacs_readlinkat directly.
2077 (lock_file) [WINDOWSNT]: Run the file name through
2078 dostounix_filename.
2079
2080 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2081 just check if the process by that PID exists.
2082
2083 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2084 also present, as doing so will fail to error out if the file
2085 already exists.
2086
2087 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2088
2089 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2090 (Fremove_list_of_text_properties): Skip all of the intervals in
2091 the region between START and END that already have resp. don't
2092 have the requested properties, not just the first one.
2093 Add assertions that the loop afterwards always modifies the
2094 properties. (Bug#13743)
2095
2096 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2097
2098 * callint.c (Fcall_interactively): Use the right lexical environment
2099 for `interactive' specs (bug#13811).
2100 * eval.c (Feval): Accept a lexical environment.
2101
2102 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 Simplify data_start configuration (Bug#13783).
2105 This is a followon simplification to the fix for Bug#13650.
2106 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2107 (START_FILES): Remove. All uses removed.
2108 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2109 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2110 (buildobj.h): Use it.
2111 ($(ALLOBJS)): Depend on globals.h.
2112 (temacs$(EXEEXT)): Use $(ALLOBJS).
2113 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2114 * deps.mk (vm-limit.o):
2115 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2116 Do not depend on mem-limits.h.
2117 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2118 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2119 [__GNUC__ && !ORDINARY_LINK]: Remove.
2120 * mem-limits.h, pre-crt0.c: Remove.
2121 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2122 * unexcoff.c (etext): New decl.
2123 (make_hdr): Use DATA_START instead of start_of_data.
2124 * vm-limit.c: Move most of mem-limits.h's contents here.
2125 (data_start): New decl. It's OK if this is approximate,
2126 so simplify-away some unnecessary exactness.
2127 (POINTER): Remove; all uses removed.
2128 (data_space_start): Now char *, to avoid casts.
2129 (exceeds_lisp_ptr): New function, replacing the old
2130 EXCEEDS_LISP_PTR macro. All uses changed.
2131 (check_memory_limits): Simplify and remove casts.
2132 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2133 (memory_warnings): Use data_start instead of start_of_data.
2134
2135 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2136
2137 * xdisp.c (set_message): Only check for debug-on-message if STRING
2138 is a string. (Bug#13797)
2139
2140 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2141
2142 Fix regression introduced by July 10 filelock.c patch.
2143 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2144 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2145 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2146 and diagnosed by Andreas Schwab in
2147 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2148
2149 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2150
2151 Assume C89 or better.
2152 * ralloc.c (SIZE, POINTER, NIL):
2153 * vm-limit.c (POINTER):
2154 Remove, replacing all uses with C89 equivalents. These old
2155 symbols were present only for porting to pre-C89 platforms.
2156
2157 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
2158
2159 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2160 This avoids warning messages reported as part of Bug#13546.
2161
2162 2013-02-21 Ken Brown <kbrown@cornell.edu>
2163
2164 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2165
2166 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2167
2168 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2169
2170 * keyboard.c (Qcommand_execute): New var.
2171 (command_loop_1, read_char): Use it.
2172 (Fcommand_execute): Remove, replace by an Elisp implementation.
2173 (syms_of_keyboard): Adjust accordingly.
2174
2175 2013-02-19 Daniel Colascione <dancol@dancol.org>
2176
2177 * sheap.c (report_sheap_usage): Use message, not message1, so
2178 that we don't try to create a buffer while we're in the middle
2179 of dumping Emacs. Explain why.
2180
2181 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 * search.c (find_newline): Return byte position in bytepos.
2184 Adjust comment.
2185 (find_next_newline_no_quit, find_before_next_newline):
2186 Add bytepos argument.
2187 * lisp.h (find_newline, find_next_newline_no_quit)
2188 (find_before_next_newline): Adjust prototypes.
2189 * bidi.c (bidi_find_paragraph_start):
2190 * editfns.c (Fconstrain_to_field, Fline_end_position):
2191 * indent.c (compute_motion, vmotion):
2192 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2193 (get_visually_first_element, move_it_vertically_backward):
2194 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2195
2196 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2197
2198 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2199 resources were not orderly released.
2200
2201 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2202
2203 * xdisp.c (x_draw_vertical_border): For a window that is neither
2204 the leftmost nor the rightmost, redraw both the left and the right
2205 vertical borders. (Bug#13723)
2206
2207 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2208
2209 * xml.c (init_libxml2_functions):
2210 * sound.c (sound_warning):
2211 * sheap.c (report_sheap_usage):
2212 * process.c (wait_reading_process_output):
2213 * msdos.c (XMenuActivate):
2214 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2215 * keyboard.c (top_level_1):
2216 * editfns.c (Fmessage, Fmessage_box):
2217 * callint.c (Fcall_interactively):
2218 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2219
2220 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2221
2222 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2223 * frame.c (syms_of_frame): ... to here.
2224
2225 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2226
2227 * w32.c (sys_chown): Remove unused function.
2228
2229 * w32term.c <input_signal_count>: Declare 'volatile'
2230 unconditionally. (Bug#9066)
2231
2232 * w32.c (set_errno): Reset h_errno and don't set it to any other
2233 value. Set errno instead.
2234 (check_errno): Reset h_errno.
2235 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2236 (sys_gethostname, sys_getservbyname, sys_getpeername)
2237 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2238 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2239 h_errno.
2240 (sys_gethostbyname): Set h_errno only errors detected.
2241
2242 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2243
2244 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2245
2246 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2247
2248 * keyboard.c (read_char): Fix calculation of auto-save time out
2249 when auto-save-timeout is less than 4. (Bug#13720)
2250
2251 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2252 time. Improve diagnostics in DebPrint. (Bug#13546)
2253
2254 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2255 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2256 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2257 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2258 make sure errno is set to an appropriate value. (Bug#13546)
2259 (socket_to_fd): Add assertion against indexing fd_info[] with a
2260 value that is out of bounds.
2261 (sys_accept): If fd is negative, do not set up the child_process
2262 structure for reading.
2263
2264 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2265
2266 * composite.c (fill_gstring_header): Remove useless prototype.
2267 Break long line.
2268 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2269 * print.c (PRINTDECLARE, print_object):
2270 * search.c (compile_pattern, fast_looking_at, search_buffer):
2271 (simple_search, boyer_moore, Freplace_match):
2272 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2273 (get_overlay_arrow_glyph_row, display_mode_element):
2274 (decode_mode_spec_coding, message3):
2275 * xfaces.c (face_at_string_position): Use bool for booleans.
2276 Adjust comments.
2277
2278 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2279
2280 Fix AIX port (Bug#13650).
2281 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2282 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2283 was #undeffed earlier, so it cannot be used as a macro here.
2284 Use the constant and not the macro.
2285
2286 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2287
2288 * w32proc.c (new_child): If no vacant slots are found in
2289 child_procs[], make another pass looking for slots whose process
2290 has exited or died. (Bug#13546)
2291
2292 * w32.c (sys_pipe): When failing due to file descriptors above
2293 MAXDESC, set errno to EMFILE.
2294 (_sys_read_ahead): Update cp->status when failing to read serial
2295 communications input, so that the status doesn't stay at
2296 STATUS_READ_IN_PROGRESS. (Bug#13546)
2297
2298 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2299
2300 * gtkutil.c (tb_size_cb): New function.
2301 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2302
2303 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2304
2305 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2306 an event.
2307
2308 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2309
2310 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2311
2312 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2313
2314 * font.c (font_range): Add pos_byte argument. Adjust comment
2315 and break long line.
2316 * font.h (font_range): Adjust prototype.
2317 * composite.c (autocmp_chars): Pass byte position to font_range.
2318 Break long line. Remove useless prototype and format comment.
2319
2320 2013-02-13 Glenn Morris <rgm@gnu.org>
2321
2322 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2323
2324 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2325
2326 Improve AIX port some more (Bug#13650).
2327 With this, it should be as good as it was in 23.3, though it's
2328 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2329 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2330 * unexaix.c (start_of_text): Remove.
2331 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2332 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2333 (orig_load_scnptr, orig_data_scnptr):
2334 Now off_t, not long, since they are file offsets.
2335 (make_hdr): Use _data, not start_of_data ().
2336 This is the key part of the fix.
2337 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2338 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2339
2340 * pre-crt0.c (data_start): Initialize to 1.
2341 This ports to compilers that optimize the external declaration
2342 'int x = 0;' as if it were 'int x;' to shrink the executable.
2343
2344 Improve AIX port (Bug#13650).
2345 This doesn't fix the bug, but it makes progress: Emacs builds now.
2346 * unexaix.c: Include inttypes.h, stdarg.h.
2347 (report_error, report_error_1): Mark as _Noreturn.
2348 (report_error): Don't report the wrong errno.
2349 (report_error_1): Now varargs. All callers changed.
2350 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2351 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2352 (write_ptr): Use %p to print address rather than %lx and a cast
2353 to unsigned long. Grow buffer a bit, to be safer.
2354
2355 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2356
2357 * bidi.c (bidi_resolve_neutral): After finding the next
2358 non-neutral character, accept NEUTRAL_ON type as well, because
2359 directional control characters, such as LRE and RLE, have their
2360 type converted to that by bidi_resolve_weak. This avoids aborts
2361 when LRE/RLE follows a run of neutrals.
2362 (bidi_move_to_visually_next): Assert that return value of
2363 bidi_peek_at_next_level is non-negative. Negative values will
2364 cause an infloop.
2365
2366 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 Minor getenv-related fixes.
2369 * callproc.c (Fcall_process_region) [!DOS_NT]:
2370 Avoid unnecessary duplicate call to getenv.
2371 * callproc.c (init_callproc):
2372 * dispnew.c (init_display):
2373 * sysdep.c (sys_subshell):
2374 Omit unnecessary cast of getenv or egetenv.
2375
2376 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2377
2378 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2379 Update dependencies.
2380
2381 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2382
2383 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2384 marker's position.
2385 (display_line): Set w->region_showing to the value of
2386 it->region_beg_charpos, not to -1. This fixes redisplay
2387 optimization when cursor is moved up after M->. (Bug#13623)
2388 (Bug#13626)
2389 (try_scrolling): Scroll text up more if point is too close to ZV
2390 and inside the scroll margin. This makes sure point is moved
2391 outside the scroll margin in these cases.
2392
2393 * window.h (struct window): region_showing can no longer be
2394 negative.
2395
2396 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2397
2398 Tune by using memchr and memrchr.
2399 * doc.c (Fsnarf_documentation):
2400 * fileio.c (Fsubstitute_in_file_name):
2401 * search.c (find_newline, scan_newline):
2402 * xdisp.c (pos_visible_p, display_count_lines):
2403 Use memchr and memrchr rather than scanning byte-by-byte.
2404 * search.c (find_newline): Rename from scan_buffer.
2405 Omit first arg TARGET, as it's always '\n'. All callers changed.
2406
2407 Clean up read_key_sequence a tiny bit more.
2408 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2409 (read_key_sequence): Remove unused locals.
2410
2411 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2412
2413 Clean up read_key_sequence a bit; reread active keymaps after first event.
2414 * keyboard.c (read_char, read_char_x_menu_prompt)
2415 (read_char_minibuf_menu_prompt):
2416 Replace nmaps+maps with a single `map' arg.
2417 (follow_key): Operate on a single map.
2418 (active_maps): New function.
2419 (test_undefined): Also return true for nil bindings.
2420 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2421 a single (composed) keymap. Remember `first_event' to choose the right
2422 set of active keymaps. Recompute the set of keymaps after receiving
2423 the first event. Remove GOBBLE_FIRST_EVENT.
2424 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2425 * keyboard.h (read_char): Update declaration.
2426 * lread.c (read_filtered_event): Adjust call to read_char.
2427
2428 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2429
2430 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2431 Don't use the limitation on backwards movement when lines are truncated
2432 in the window. (Bug#13675)
2433
2434 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2435
2436 * marker.c (set_marker_internal): If desired position is passed
2437 as a marker, avoid call to buf_charpos_to_bytepos.
2438 * window.c (Fset_window_point): Omit redundant type checking.
2439 (Fset_window_start): Likewise. Format comment.
2440 (window_scroll_pixel_based): Use set_marker_restricted_both
2441 with character and byte positions obtained from an iterator.
2442 (Fset_window_configuration): Use set_marker_restricted_both.
2443 * xdisp.c (message_dolog): Likewise.
2444
2445 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2446
2447 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2448 When text lines are longer than window's screen lines, don't move back
2449 too far. This speeds up some redisplay operations. (Bug#13675)
2450
2451 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2452
2453 * syntax.c (scan_sexps_forward): Fix byte position calculation
2454 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2455
2456 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2457
2458 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2459 that was not needed.
2460
2461 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2462
2463 Minor hashing refactoring.
2464 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2465 (sxhash_float): Return EMACS_UINT, for consistency with the other
2466 hash functions.
2467 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2468 non-static inline function and therefore can't use static vars.
2469 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2470 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2471 with the other hash functions.
2472
2473 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2474
2475 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2476 XXXXXX part of the temporary file pattern is not downcased even
2477 when w32-downcase-file-names is non-nil. (Bug#13661)
2478
2479 * xdisp.c (decode_mode_spec): Remove handling of %t.
2480
2481 * msdos.c (careadlinkatcwd): Remove.
2482
2483 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2484
2485 * lread.c (skip_dyn_bytes): New function (bug#12598).
2486 (read1): Use it. Use getc instead of READCHAR to read bytes.
2487 (load_each_byte): Remove. Update users.
2488
2489 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2490
2491 * search.c (scan_buffer): Calculate end byte position just once.
2492 (scan_newline): Do not recalculate start_byte.
2493 (search_command): Use eassert.
2494 * syntax.c (struct lisp_parse_state): New member location_byte.
2495 (scan_sexps_forward): Record from_byte and avoid redundant
2496 character to byte position calculation ...
2497 (Fparse_partial_sexp): ... here. Break too long line.
2498
2499 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2500
2501 * lisp.h (make_uninit_vector): New function.
2502 * alloc.c (Fvector, Fmake_byte_code):
2503 * ccl.c (Fregister_ccl_program):
2504 * charset.c (Fdefine_charset_internal, define_charset_internal):
2505 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2506 * composite.c (syms_of_composite):
2507 * font.c (Fquery_font, Ffont_info, syms_of_font):
2508 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2509 * ftfont.c (ftfont_shape_by_flt):
2510 * indent.c (recompute_width_table):
2511 * nsselect.m (clean_local_selection_data):
2512 * syntax.c (init_syntax_once):
2513 * w32unsubscribe.c (uniscribe_shape):
2514 * window.c (Fcurrent_window_configuration):
2515 * xfaces.c (Fx_family_fonts):
2516 * xselect.c (selection_data_to_lisp_data): Use it.
2517
2518 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 * coding.c (Fdefine_coding_system_internal): Use AREF where
2521 argument is known to be a vector.
2522 * fns.c (Flocale_info): Likewise for ASET.
2523 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2524 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2525
2526 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2527
2528 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2529 height.
2530
2531 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2532 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2533 updateCollectionBehaviour.
2534
2535 * nsterm.m (NEW_STYLE_FS): Remove.
2536 (ns_last_use_native_fullscreen): New variable.
2537 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2538 (x_set_window_size): Do not take title bar and tool bar into account
2539 if isFullscreen returns YES.
2540 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2541 (check_native_fs): New function.
2542 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2543 (ns_term_init): Remove NEW_STYLE_FS.
2544 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2545 and tool bar if isFullscreen returns NO.
2546 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2547 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2548 with HAVE_NATIVE_FS.
2549 (window:willUseFullScreenPresentationOptions:): New method.
2550 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2551 Hide toolbar if not enabled (Bug#13444).
2552 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2553 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2554 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2555 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2556 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2557 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2558 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2559 (syms_of_nsterm): Add ns-use-native-fullscreen.
2560
2561 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2562
2563 * fileio.c (Qchoose_write_coding_system): Now static.
2564
2565 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2566
2567 * xdisp.c (window_buffer_changed): region_showing can be negative,
2568 which still means region is being displayed.
2569 (redisplay_internal): Resurrect code that forced redisplay of the
2570 whole window when showing region and the mark has changed.
2571 Record the new mark position to allow redisplay optimizations.
2572 (display_line): If it->region_beg_charpos is non-zero, set the
2573 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2574
2575 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2576 not bitfield of 1 bit.
2577
2578 2013-02-03 Daniel Colascione <dancol@dancol.org>
2579
2580 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2581 daemon mode works on cygw32 when Emacs is installed and not just
2582 during development.
2583
2584 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2585
2586 Avoid file time stamp bug on MS-Windows (Bug#13149).
2587 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2588 as FAT32 doesn't update time stamps when truncating them.
2589 Also, check that a file time stamp is not a multiple of 100 ns;
2590 this should catch all instances of the problem on MS-Windows,
2591 as its native file system resolution is 100 ns or worse, and
2592 checking for a non-multiple of 100 ns should impose only a small
2593 overhead on systems with ns resolution.
2594
2595 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2596
2597 Avoid encoding file names on MS-Windows when they need to be run
2598 through dostounix_filename.
2599 * w32.c (normalize_filename): Accept an additional argument
2600 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2601 downcase it even if w32-downcase-file-names is non-nil.
2602 (dostounix_filename): Accept an additional argument MULTIBYTE and
2603 pass it to normalize_filename.
2604 (emacs_root_dir): Adjust.
2605
2606 * msdos.h (dostounix_filename): Adjust prototype.
2607
2608 * w32.h (dostounix_filename): Adjust prototype.
2609
2610 * msdos.c (dostounix_filename): Accept an additional argument and
2611 ignore it.
2612 (init_environment): Adjust callers of dostounix_filename.
2613
2614 * fileio.c (Ffile_name_directory, file_name_as_directory)
2615 (directory_file_name, Fexpand_file_name)
2616 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2617 dostounix_filename.
2618 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2619 non-nil.
2620 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2621 variables, as egetenv is case-insensitive for DOS_NT.
2622
2623 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2624 with an encoded file name.
2625
2626 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2627 Adjust calls to dostounix_filename.
2628
2629 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2630
2631 * unexw32.c (unexec): Adjust call to dostounix_filename.
2632
2633 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2634
2635 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2636 dostounix_filename.
2637
2638 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2639 dostounix_filename.
2640
2641 * callproc.c (Fcall_process): Make sure program name in PATH and
2642 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2643 is passed to exec/spawnve, which fails unless the file-name
2644 encoding is UTF-8.
2645
2646 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2647 even if w32-quote-process-args is nil.
2648
2649 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2650
2651 Fix timestamp bug when write-region appends nothing (Bug#13149).
2652 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2653 the file's time stamp doesn't change if Emacs happens to write nothing
2654 to the file, and on a buggy file system this could cause Emacs to
2655 incorrectly infer that the file system doesn't have the bug.
2656 Avoid this problem by inhibiting the inference in this case.
2657
2658 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 * window.h (struct window): Convert base_line_number, base_line_pos
2661 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2662 Convert region_showing member from Lisp_Object to bitfield.
2663 Remove sequence_number member. Adjust comments.
2664 * window.c (sequence_number): Remove.
2665 (make_window): Initialize column_number_displayed.
2666 * print.c (print_object): Follow the printed representation of
2667 frames and print window pointer to distinguish between windows.
2668 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2669 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2670 (wset_column_number_displayed, wset_region_showing): Remove.
2671 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2672 (try_scrolling, try_cursor_movement, redisplay_window)
2673 (try_window_reusing_current_matrix, try_window_id, display_line)
2674 (display_mode_lines, decode_mode_spec): Adjust users.
2675 * .gdbinit (pwinx): Do not print sequence_number.
2676
2677 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2678
2679 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2680 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2681 * dired.c: Include <fcntl.h>.
2682 (open_directory): New function, which uses open and fdopendir
2683 rather than opendir. DOS_NT platforms still use opendir, though.
2684 (directory_files_internal, file_name_completion): Use it.
2685 (file_attributes): New function, with most of the old Ffile_attributes.
2686 (directory_files_internal, Ffile_attributes): Use it.
2687 (file_attributes, file_name_completion_stat): First arg is now fd,
2688 not dir name. All uses changed. Use fstatat rather than lstat +
2689 stat.
2690 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2691 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2692 (emacs_readlinkat): New function, with much of the old
2693 Ffile_symlink_p, but with an fd argument for speed.
2694 It uses readlinkat rather than careadlinkatcwd, so that it
2695 need not assume the working directory.
2696 (Ffile_symlink_p): Use it.
2697 * filelock.c (current_lock_owner): Use emacs_readlinkat
2698 rather than emacs_readlink.
2699 * lisp.h (emacs_readlinkat): New decl.
2700 (READLINK_BUFSIZE, emacs_readlink): Remove.
2701 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2702 (emacs_norealloc_allocator, emacs_readlink): Remove.
2703 This stuff is moved to fileio.c.
2704 * w32.c (fstatat, readlinkat): New functions.
2705 (careadlinkat): Don't check that fd == AT_FDCWD.
2706 (careadlinkatcwd): Remove; no longer needed.
2707
2708 2013-01-31 Glenn Morris <rgm@gnu.org>
2709
2710 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2711 (Fwrite_region): Update for new choose_write_coding_system args.
2712 Move the last piece of choose_write_coding_system here. (Bug#13522)
2713 (syms_of_fileio): Add choose-write-coding-system.
2714
2715 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2716
2717 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2718 (sys_close): Zero out the flags for the file descriptor before
2719 closing it. (Bug#13546)
2720
2721 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2722 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2723 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2724 DBCS. (Bug#13553)
2725
2726 * w32.c (w32_get_long_filename, init_environment, readlink):
2727 Support file names encoded in DBCS codepages.
2728 (readlink): Use the current file-name-coding-system, not the ANSI
2729 codepage, to decode and handle targets of symlinks.
2730
2731 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2732
2733 * w32.c (opendir): Now accepts a 'const char *'.
2734
2735 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2736
2737 Remove obsolete redisplay code. See the discussion at
2738 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2739 * dispnew.c (preemption_period, preemption_next_check): Remove.
2740 (Vredisplay_preemption_period): Likewise.
2741 (update_frame, update_single_window, update_window, update_frame_1):
2742 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2743 used, following the 2012-06-22 change.
2744
2745 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2746
2747 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2748
2749 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2750
2751 * font.c (num_fonts): Remove the leftover from old
2752 debugging code. Adjust comment style here and there.
2753 * insdel.c (insert_1): Remove.
2754 * lisp.h (insert_1): Remove prototype.
2755 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2756
2757 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2758
2759 * w32.c (max_filename_mbslen): New function.
2760 (normalize_filename, readdir): Use it to detect locales where ANSI
2761 encoding of file names uses a double-byte character set (DBCS).
2762 If a DBCS encoding is used, advance by characters using
2763 CharNextExA, instead of incrementing a 'char *' pointer.
2764 Use _mbslwr instead of _strlwr. (Bug#13515)
2765
2766 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2767 request of memory reservation to 1.7GB. (Bug#13065)
2768
2769 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2770
2771 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2772 at check_extra_latin label. (Bug#13505)
2773
2774 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2775
2776 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2777 Avoid redundant calls to strlen.
2778
2779 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2780
2781 Drop async_visible and async_iconified fields of struct frame.
2782 This is possible because async input is gone; for details, see
2783 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2784 * frame.h (struct frame): Remove async_visible and async_iconified
2785 members, convert garbaged to unsigned bitfield. Adjust comments.
2786 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2787 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2788 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2789 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2790 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2791 * w32term.c: Ditto.
2792 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2793 properly. Likewise for obscured.
2794 * xterm.c: Ditto.
2795 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2796 properly.
2797 * nsterm.m: Ditto.
2798 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2799
2800 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2801
2802 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2803 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2804
2805 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2806
2807 * xdisp.c (message2, message2_nolog): Remove functions.
2808 (message3, message3_nolog): Extract nbytes and multibyteness directly
2809 from the string. Change all callers.
2810 (message3_nolog): Don't set message_enable_multibyte since set_message
2811 will reset it anyway.
2812 (message1, message1_nolog): Use message3.
2813 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2814 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2815 (set_message): Drop all but the second arg, which has to be a string.
2816 (set_message_1): Simplify now that we know that a1 is NULL and the
2817 second arg is a string.
2818 * frame.h (struct frame): Remove `message_buf' field.
2819 Use glyphs_initialized_p instead.
2820 (FRAME_MESSAGE_BUF): Remove macro.
2821 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2822 * lisp.h (message2, message2_nolog): Remove declarations.
2823 (message3, message3_nolog): Update declarations.
2824 * keyboard.c (read_char_minibuf_menu_text)
2825 (read_char_minibuf_menu_width): Remove vars.
2826 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2827 to correctly handle multibyte strings.
2828 * frame.c (delete_frame): Don't free message_buf any more.
2829 * editfns.c (message_text, message_length): Remove vars.
2830 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2831 * fileio.c (auto_save_error): Use message3 instead of message2.
2832 * dispnew.c (adjust_frame_message_buffer): Remove function.
2833
2834 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2835
2836 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2837 real estate used for the tool bar and the menu bar.
2838
2839 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2840
2841 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2842 hidden buffer is prepared to modification (Bug#13164).
2843
2844 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2845
2846 * window.h (struct window): Change window_end_valid member from
2847 Lisp_Object to a bitfield. Adjust comments.
2848 (wset_window_end_valid): Remove.
2849 * window.c (adjust_window_count): Clear window_end_valid.
2850 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2851 (Fwindow_line_height, set_window_buffer, Frecenter)
2852 (Fsplit_window_internal, Fdelete_other_windows_internal)
2853 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2854 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2855 * xdisp.c (check_window_end, reconsider_clip_changes)
2856 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2857 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2858 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2859
2860 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2861
2862 * xdisp.c (mark_window_display_accurate): Simplify the loop
2863 assuming that the only one of vchild, hchild or buffer window
2864 slots is non-nil. Call mark_window_display_accurate_1 for
2865 the leaf windows only.
2866 (mark_window_display_accurate_1): Always assume leaf window.
2867 Adjust comment.
2868
2869 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 * emacs.c (Qkill_emacs_hook): Now static.
2872
2873 * fileio.c (Finsert_file_contents): Simplify.
2874 Remove unnecessary assignments and tests.
2875
2876 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2877
2878 * w32.c (acl_set_file): Don't test for errors unless
2879 set_file_security returns FALSE. Avoids spurious errors when
2880 saving files.
2881
2882 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2883
2884 * fileio.c (Finsert_file_contents): Revert code introduced at
2885 2013-01-18 in favor of the simpler and generally better fix.
2886 Save stack space by removing 'buffer' and reusing 'read_buf'
2887 where appropriate.
2888
2889 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * lisp.h (eabs): Define unconditionally (Bug#13419).
2892 The old "#if !defined (eabs)" was an unnecessary revenant of back
2893 when this macro was called "abs". Document 'eabs' better.
2894
2895 2013-01-19 Glenn Morris <rgm@gnu.org>
2896
2897 * fns.c (Frandom): Doc fix.
2898
2899 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2900
2901 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2902 segfault when there are lots of overlays.
2903
2904 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2905 when there are lots of overlays.
2906 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2907 for the details and a way to reproduce.
2908
2909 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2910
2911 * fileio.c: Use O_APPEND to append.
2912 This corresponds better to the natural interpretation of "append",
2913 and avoids the need to open the output file twice, or to invoke
2914 lseek when APPEND is neither nil nor a number.
2915 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2916 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2917 file possibly twice, and lseeking to its end; this avoids the
2918 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2919 at the same time: the combination is never needed and apparently
2920 it doesn't work with DOS_NT.
2921
2922 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2923 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2924
2925 Allow floating-point file offsets.
2926 Problem reported by Vitalie Spinu in
2927 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2928 * fileio.c (emacs_lseek): Remove.
2929 (file_offset): New function.
2930 (Finsert_file_contents, Fwrite_region): Use it.
2931
2932 2013-01-19 Chong Yidong <cyd@gnu.org>
2933
2934 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2935 aborting on Fsignal (Bug#13289).
2936
2937 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2938
2939 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2940 set_file_security as failure due to insufficient privileges.
2941 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2942 (fstat): Return owner and group like 'stat' and 'lstat' do.
2943
2944 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2945
2946 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2947 The bug was observed on Ubuntu operating inside a virtual machine,
2948 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2949 The workaround introduces a race condition on non-buggy hosts,
2950 but it's an unlikely race and anyway there's a nearly identical
2951 nearby race that can't be fixed.
2952 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2953 New static vars.
2954 (Fwrite_region): Test for file system time stamp bug.
2955 (init_fileio): New function.
2956 * lisp.h (init_fileio): Declare it.
2957 * emacs.c (main): Call it.
2958
2959 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2960 and make it more consistent with other stat-failure diagnostics.
2961
2962 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2963
2964 Fix crash when inserting data from non-regular files.
2965 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2966 for the error description produced by valgrind.
2967 * fileio.c (read_non_regular): Rename to read_contents.
2968 Free Lisp_Save_Value object used to pass parameters.
2969 (read_non_regular_quit): Rename to read_contents_quit.
2970 (Finsert_file_contents): Redesign internal file reading loop to adjust
2971 gap and end positions after each read and so help make_gap to work
2972 properly. Do not signal an I/O error too early and so do not leave
2973 not yet decoded characters in a buffer, which was the reason of
2974 redisplay crash. Use list2 to build return value. Adjust comments.
2975
2976 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2977
2978 Close a race when statting and reading files (Bug#13149).
2979 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2980 This avoids a race if the file is renamed between stat and open.
2981 This race is not the problem originally noted in Bug#13149;
2982 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2983
2984 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2985
2986 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2987 objects, related functions and macros.
2988 (make_save_value): Adjust prototype.
2989 (make_save_pointer): New prototype.
2990 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2991 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2992 * alloc.c (format_save_value): Rename to make_save_value.
2993 (make_save_pointer): New function.
2994 (record_xmalloc): Use make_save_pointer.
2995 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2996 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2997 Change users of make_save_value to make_save_pointer.
2998 Likewise for format_save_value and make_save_value.
2999
3000 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
3001
3002 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
3003 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
3004 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
3005 debugging stubs.
3006
3007 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
3008
3009 * alloc.c (free_save_value): Now static.
3010
3011 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3012
3013 * keymap.c (map_keymap_internal): Use format_save_value.
3014 (map_keymap_char_table_item): Adjust accordingly.
3015 * fileio.c (non_regular_fd, non_regular_inserted)
3016 (non_regular_nbytes): Remove.
3017 (Finsert_file_contents): Convert trytry to ptrdiff_t.
3018 Use format_save_value to pass parameters to read_non_regular.
3019 (read_non_regular): Use XSAVE_ macros to extract parameters.
3020 Adjust comment.
3021 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
3022 format_save_value.
3023 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
3024
3025 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3026
3027 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
3028 extraction from any Lisp_Save_Value slot. Add type checking.
3029 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
3030 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
3031 * xselect.c: All users changed.
3032
3033 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Some convenient bits to deal with Lisp_Save_Values.
3036 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
3037 (allocate_misc): Remove prototype.
3038 (format_save_value): New prototype.
3039 * alloc.c (allocate_misc): Revert back to static.
3040 (format_save_value): New function to build Lisp_Save_Value
3041 object with the specified internal structure.
3042 (make_save_value): Reimplement using format_save_value.
3043 * editfns.c (save_excursion_save): Use format_save_value.
3044 (save_excursion_restore): Use XSAVE_OBJECT.
3045
3046 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3047
3048 Avoid needless casts with XSAVE_POINTER.
3049 * alloc.c (mark_object) [GC_MARK_STACK]:
3050 * dired.c (directory_files_internal_unwind):
3051 * fileio.c (do_auto_save_unwind):
3052 * gtkutil.c (pop_down_dialog):
3053 * keymap.c (map_keymap_char_table_item):
3054 * lread.c (load_unwind):
3055 * nsmenu.m (pop_down_menu):
3056 * print.c (print_object) [GC_MARK_STACK]:
3057 * xfns.c (clean_up_file_dialog):
3058 * xmenu.c (cleanup_widget_value_tree):
3059 Omit casts between XSAVE_POINTER and a pointer type.
3060
3061 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3062
3063 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3064 * eval.c (eval_sub): Protect `form' from being GCed before its
3065 car and cdr becomes protected with the backtrace entry.
3066
3067 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3068
3069 Make Lisp_Save_Value more versatile storage for up to four objects.
3070 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3071 (struct Lisp_Save_Value): New layout. Adjust comments.
3072 (XSAVE_POINTER): New macro.
3073 (XSAVE_INTEGER): Likewise.
3074 (allocate_misc): Add prototype.
3075 (free_misc): Likewise.
3076 * alloc.c (allocate_misc): Now global.
3077 (free_misc): Likewise. Adjust comment.
3078 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3079 (free_save_value): Likewise.
3080 (mark_object): Likewise.
3081 * editfns.c (save_excursion_save): Pack everything within
3082 Lisp_Save_Value and so avoid xmalloc.
3083 (save_excursion_restore): Adjust to match new layout. Use free_misc
3084 because we do not allocate extra memory any more. Add eassert.
3085 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3086 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3087 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3088 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3089 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3090
3091 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3092
3093 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3094 (nsfont_draw): Remove disabling of LCD smoothing.
3095 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3096 Bug#11484 with LCD smoothing on.
3097
3098 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 Fix SIGDANGER handlers, for AIX (Bug#13408).
3101 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3102 Move handlers here from emacs.c; they were out of place.
3103
3104 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3105
3106 * xterm.c (syms_of_xterm): Adjust documentation for
3107 scroll-bar-adjust-thumb-portion.
3108
3109 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3110
3111 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3112 determine whether scroll bar thumb size should be adjusted or not.
3113 Use variable for MOTIF.
3114
3115 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
3116
3117 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3118
3119 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3120 event is generated.
3121 (doCommandBySelector:): Set processingCompose to NO.
3122
3123 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3124 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3125 (nsfont_list_family): Add block/unblock_input calls.
3126 (nsfont_open): Move block_input earlier. Add unblock_input before early
3127 return.
3128 (nsfont_draw): Add block/unblock_input calls.
3129
3130 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3131
3132 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3133 for old_charpos and old_bytepos.
3134
3135 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3138 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3139 Clear tzvalbuf_in_environ if this workaround is in effect.
3140 Problem and fix reported by Kazuhiro Ito.
3141
3142 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3143
3144 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3145 Fix ambiguous doc string cross-reference(s).
3146
3147 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3148 doc string cross-reference(s).
3149
3150 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3151 string cross-reference(s).
3152
3153 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3154
3155 Avoid unnecessary byte position calculation for the gap movement.
3156 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3157 anyway, all of them should use move_gap_both instead.
3158 * lisp.h (move_gap): Remove prototype.
3159 * insdel.c (move_gap): Remove.
3160 (move_gap_both): Add eassert.
3161 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3162 * xml.c (parse_region): Likewise.
3163
3164 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3165
3166 emacsclient -t should not suspend Emacs server (Bug#13387)
3167 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3168 New functions.
3169 * term.c (init_tty): Use them instead of rolling our own code.
3170 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3171 switches from 'signal' to 'pthread_sigmask', which is safer in
3172 multithreaded applications.
3173 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3174 which has already arranged for that.
3175 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3176 This is the main part of the bug fix.
3177
3178 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3179
3180 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3181 x_last_font_name (Bug#13403).
3182
3183 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3186 the type of per-buffer values where appropriate.
3187 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3188 predicate, which is how it's really used now. Adjust comment.
3189 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3190 * buffer.c (buffer_slot_type_mismatch): Remove.
3191 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3192 predicate. Adjust comment.
3193 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3194 fill-column, left-margin, tab-width, buffer-saved-size,
3195 left-margin-width, right-margin-width, left-fringe-width,
3196 right-fringe-width, scroll-bar-width and buffer-display-count.
3197 Use Qstringp for default-directory, buffer-file-name,
3198 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3199 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3200 line-spacing.
3201 * data.c (store_symval_forwarding): Adjust to call the predicate.
3202
3203 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3204
3205 * w32.c (get_name_and_id, acl_set_file):
3206 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3207
3208 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3209
3210 * lisp.h (make_gap_1): New prototype.
3211 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3212 gap size values.
3213 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3214 naming convention.
3215 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3216 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3217 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3218 (make_gap_1): New function to adjust the gap of any buffer.
3219 * coding.c (coding_alloc_by_making_gap): Use it.
3220 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3221 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3222
3223 2013-01-08 Juri Linkov <juri@jurta.org>
3224
3225 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3226 of (supports :underline (:style wave)). (Bug#13000)
3227
3228 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3229
3230 * undo.c (Fprimitive_undo): Move to simple.el.
3231 (syms_of_undo): Remove declarations for Sprimitive_undo.
3232
3233 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3234
3235 * keyboard.c (echo_add_key): Rename from echo_add_char.
3236
3237 2013-01-06 Chong Yidong <cyd@gnu.org>
3238
3239 * keyboard.c (echo_add_char): New function, factored out from
3240 echo_char. Don't add a space if the previous echo string was
3241 empty (Bug#13255).
3242 (echo_char): Use it.
3243 (read_key_sequence): When echoing mock input, ensure that the
3244 trailing dash is properly added.
3245
3246 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3247
3248 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3249 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3250 digits for buffer positions, before misalignment starts.
3251 Display "0" for integer "object" field.
3252 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3253 Display the newline glyph more unambiguously.
3254
3255 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3256
3257 * nsterm.m (ns_draw_underwave):
3258 * w32term.c (w32_draw_underwave):
3259 * xterm.c (x_draw_underwave): Make underwave look more triangular
3260 and also degrade gracefully for small fonts. (Bug#13000)
3261
3262 * nsterm.m (ns_draw_text_decoration):
3263 * w32term.c (x_draw_glyph_string):
3264 * xterm.c (x_draw_glyph_string): Don't use previous underline
3265 thickness and position if previous underline type is underwave.
3266
3267 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3268
3269 * fileio.c (Ffile_acl): Undocument return format.
3270
3271 2013-01-02 Glenn Morris <rgm@gnu.org>
3272
3273 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3274
3275 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3276
3277 Simplify via eabs.
3278 * dired.c (file_name_completion):
3279 * doc.c (get_doc_string):
3280 * floatfns.c (round2):
3281 * font.c (font_score, font_delete_unmatched):
3282 * fringe.c (compute_fringe_widths):
3283 * lread.c (read_list):
3284 * minibuf.c (Ftry_completion):
3285 * term.c (tty_ins_del_lines):
3286 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3287 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3288
3289 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3290
3291 * w32.c (unsetenv): Set up the string passed to _putenv
3292 correctly.
3293 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3294 for the bug this caused.
3295
3296 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3297
3298 * coding.c (Qmac): Now static.
3299
3300 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3301
3302 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3303 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3304 handlebox_widget. Set toolbar_in_hbox to false/true, set
3305 toolbar_is_packed to true.
3306 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3307 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3308 Show all on TOOLBAR_TOP_WIDGET.
3309 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3310 by TOOLBAR_TOP_WIDGET.
3311 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3312 Check toolbar_is_packed.
3313 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3314 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3315 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3316 false.
3317 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3318 (xg_update_menubar): Update title only if
3319 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3320 (xg_update_submenu): Skip tearoff only if
3321 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3322 (xg_initialize): Initialize xg_detached_menus only if
3323 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3324
3325 * xterm.h (struct x_output): Surround handlebox_widget with
3326 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3327 toolbar_in_hbox is bool.
3328
3329 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3330
3331 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3332 (LIBS_GNUSTEP): Define.
3333 (LIBES): Add $(LIBS_GNUSTEP).
3334 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3335
3336 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3337
3338 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3339 continuation glyph on a TTY with an indication of an empty line.
3340 (Bug#13277)
3341
3342 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3343
3344 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3345 file's SELinux context or ACLs successfully set, nil otherwise.
3346 (Bug#13298)
3347 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3348
3349 * w32proc.c (reader_thread): Avoid passing NULL handles to
3350 SetEvent and WaitForSingleObject.
3351
3352 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 Port EXTERNALLY_VISIBLE to Clang 3.2.
3355 * conf_post.h (__has_attribute): New macro.
3356 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3357
3358 2012-12-27 Glenn Morris <rgm@gnu.org>
3359
3360 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3361 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3362
3363 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3364
3365 * fileio.c (file_name_as_directory, directory_file_name):
3366 Accept an additional argument MULTIBYTE to indicate whether the input C
3367 came from a multibyte or a unibyte Lisp string; all callers
3368 adjusted. Don't assume the input string is always multibyte.
3369 (Bug#13262)
3370 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3371 don't ENCODE_FILE them, and return a unibyte string if the input
3372 was unibyte.
3373 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3374 don't assume the input strings will always be multibyte. If the
3375 input strings are multibyte, decode strings obtained from C
3376 library functions.
3377
3378 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 * lisp.h (toplevel): Add two notices to the comment about
3381 defining a new Lisp data type.
3382 * print.c (print_object): If Lisp_Save_Value object's pointer
3383 is the address of a memory area containing Lisp_Objects, try
3384 to print them.
3385 * alloc.c (valid_lisp_object_p): Adjust comment.
3386
3387 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3388
3389 * keyboard.c (record_asynch_buffer_change): Initialize an event
3390 only if it's really needed.
3391 * frame.h (enum output_method): Remove output_mac member since
3392 it's a leftover from the deleted code.
3393 * frame.c (Fframep): Adjust user here ...
3394 * terminal.c (Fterminal_live_p): ... and here.
3395 * coding.c (Qmac): Now here because it's only used to denote
3396 end-of-line encoding type.
3397 (syms_of_coding): DEFSYM it.
3398 * frame.h (Qmac): Remove duplicated declaration.
3399
3400 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 * window.c (select_window_1): Now static, since it's used only here.
3403
3404 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3405
3406 * window.c (window_body_cols): Subtract display margins from the
3407 window body width on TTYs as well. See
3408 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3409 for the original report.
3410
3411 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3412
3413 * xdisp.c (redisplay_window): Remove inner local variable
3414 because the outer shadowed one has the same meaning.
3415 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3416 set but never used.
3417 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3418 (xg_create_tool_bar): Adjust users.
3419
3420 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3421
3422 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3423 * buffer.c (Fget_buffer_create): Use it to set compact field of
3424 struct buffer_text to avoid accessing an uninitialized value
3425 when compact_buffer is called for the first time.
3426 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3427 (Fset_buffer_modified_p): Use buffer_window_count to check
3428 whether the buffer is displayed in some window.
3429 * xdisp.c (message_dolog): Likewise.
3430
3431 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3432
3433 * w32.c (acl_set_file): If setting the file security descriptor
3434 fails, and the new DACL is identical to the existing one, silently
3435 return success. This fixes problems for users backing up their
3436 own files without having the necessary privileges for setting
3437 security descriptors.
3438
3439 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3440 values.
3441 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3442 after WaitForSingleObject returns normally. This expedites reader
3443 thread shutdown when delete_child triggers it.
3444 (reap_subprocess): More accurate commentary for why we call
3445 delete_child only when cp->fd is negative.
3446
3447 * w32.c (sys_close): Do not call delete_child on a subprocess
3448 whose handle is not yet closed. Instead, set its file descriptor
3449 to a negative value, so that reap_subprocess will call
3450 delete_child on that subprocess when its SIGCHLD arrives.
3451 This avoids closing handles used for communications between sys_select
3452 and reader_thread, which doesn't give sys_select a chance to
3453 notice that the process exited and invoke the SIGCHLD handler for
3454 it.
3455
3456 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3457
3458 * nsfns.m (Fns_do_applescript): Run event loop until script has
3459 been executed (Bug#12969).
3460 (ns_run_ascript): Chech as_script for nil, set to nil after
3461 executing script.
3462
3463 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3464
3465 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3466
3467 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3468
3469 * w32term.c (w32fullscreen_hook): New function.
3470 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3471
3472 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3473
3474 * fileio.c (Finsert_file_contents): Doc fix.
3475
3476 * w32proc.c (new_child, delete_child, find_child_pid): For a
3477 subprocess, consider its slot being in use as long as its process
3478 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3479 slot when a new process is started immediately after killing
3480 another one, without waiting enough time for the first process to
3481 be reaped and resources allocated for it be orderly freed.
3482 (Bug#13086)
3483 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3484
3485 2012-12-21 Chong Yidong <cyd@gnu.org>
3486
3487 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3488
3489 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3490
3491 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3492
3493 * w32.c (get_name_and_id): Always pass NULL as the first argument
3494 of lookup_account_sid. Avoids crashes with UNC file names that
3495 refer to DFS domains, not to specific machine names. (Bug#12621)
3496 Remove now unused argument FNAME; all callers changed.
3497 (get_file_owner_and_group): Remove now unused argument FNAME; all
3498 callers changed.
3499
3500 2012-12-21 Chong Yidong <cyd@gnu.org>
3501
3502 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3503 error for invalid chars, don't check for a nil return value.
3504
3505 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3506
3507 Avoid calls to CHAR_TO_BYTE if byte position is known.
3508 * editfns.c (make_buffer_string_both): Use move_gap_both.
3509 (Fbuffer_string): Use make_buffer_string_both.
3510 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3511 Adjust comment.
3512 (buf_bytepos_to_charpos): Likewise.
3513 (charpos_to_bytepos): Remove.
3514 * fileio.c (Finsert_file_contents): Use move_gap_both.
3515 * search.c (Freplace_match): Likewise.
3516 * process.c (process_send_region): Likewise. Use convenient
3517 names for byte positions.
3518 * lisp.h (charpos_to_bytepos): Remove prototype.
3519 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3520 * insdel.c (move_gap): Likewise.
3521
3522 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 * xdisp.c (redisplay_internal): Remove now-unused local.
3525
3526 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3527
3528 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3529 (redisplay_internal): Don't bother selecting the frame to get the
3530 proper value of frame-local variables (bug#13225).
3531
3532 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3535 Rename 4th argument since it may be buffer or string. Adjust comment.
3536 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3537
3538 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3539
3540 * coding.c (Fdetect_coding_region): Do not check start and end with
3541 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3542 (code_convert_region): Likewise.
3543
3544 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3545
3546 * w32.c (acl_get_file, acl_set_file): Run the file name through
3547 map_w32_filename, and resolve any symlinks in the file name, like
3548 Posix platforms do.
3549 (acl_set_file): Call revert_to_self, if any privileges were
3550 enabled.
3551
3552 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3553
3554 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3555 ($(BLD)/w32.$(O)): Update dependencies.
3556
3557 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3558
3559 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3560 propagate redisplay's scrolling (if any) to the right window.
3561 (redisplay_internal): Use ensure_selected_frame.
3562 (display_mode_lines): Complete last fix.
3563 * window.c (select_window_1): New func, extracted from select_window.
3564 (select_window): Use it.
3565 * window.h (select_window_1): Declare.
3566
3567 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3568
3569 Emulate Posix ACL APIs on MS-Windows.
3570 * w32.c: Include sddl.h and sys/acl.h.
3571 (SDDL_REVISION_1): Define if not already defined.
3572 (g_b_init_get_security_descriptor_dacl)
3573 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3574 (g_b_init_is_valid_security_descriptor)
3575 (g_b_init_set_file_security): New static flags.
3576 (globals_of_w32): Initialize them to zero.
3577 (SetFileSecurity_Name): New string constant.
3578 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3579 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3580 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3581 (IsValidSecurityDescriptor_Proc): New typedefs.
3582 (get_file_security, get_security_descriptor_owner)
3583 (get_security_descriptor_group): Set errno to ENOTSUP.
3584 (set_file_security, get_security_descriptor_dacl)
3585 (is_valid_security_descriptor, convert_sd_to_sddl)
3586 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3587 (acl_free, acl_get_file, acl_set_file): New functions.
3588
3589 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3590
3591 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3592
3593 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3594 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3595 for some of that bug's symptoms can now cause Emacs to abort.
3596 Remove the workaround.
3597 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3598 The bug that caused SIGCHLD to get lost has been fixed, and the
3599 workaround for it can now cause Emacs to abort.
3600
3601 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3602
3603 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3604 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3605 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3606
3607 2012-12-16 Romain Francoise <romain@orebokech.com>
3608
3609 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3610 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3611 and copy ACL entries of file in addition to SELinux context if set.
3612 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3613
3614 * Makefile.in (LIBACL_LIBS): New macro.
3615 (LIBES): Use it.
3616
3617 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3618
3619 * fileio.c (internal_delete_file): Use bool for boolean.
3620
3621 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3622
3623 Fix bug #13079 on MS-Windows with temp files not being deleted.
3624 * w32.h (_child_process): New members input_file and
3625 pending_deletion.
3626 (register_child): First argument is now pid_t.
3627 (record_infile, record_pending_deletion): New prototypes.
3628
3629 * w32proc.c (new_child): Initialize input_file and
3630 pending_deletion members of the child.
3631 (delete_child): Delete the child's temporary input file, if any,
3632 that is pending deletion.
3633 (register_child): First argument is now pid_t.
3634 (record_infile, record_pending_deletion): New functions.
3635 (reap_subprocess): Fix a typo in DebPrint string.
3636 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3637
3638 * fileio.c (internal_delete_file): Return an int again: non-zero
3639 if delete-file succeeds, zero otherwise.
3640
3641 * lisp.h (internal_delete_file): Adjust prototype.
3642
3643 * callproc.c (Fcall_process): Don't overwrite infile with result
3644 of DECODE_FILE.
3645 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3646 asynchronous subprocess, record the name of the input file name,
3647 if any.
3648 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3649 delete the file, record it as pending deletion when the subprocess
3650 exits.
3651
3652 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3653
3654 * editfns.c [HAVE_PWD_H]: Include grp.h.
3655
3656 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3657
3658 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 Fix permissions bugs with setgid directories etc. (Bug#13125)
3661 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3662 to mark it as a placeholder. The old value was often wrong.
3663 The only user of this attribute has been changed to use
3664 file-ownership-preserved-p instead, with its new group arg.
3665 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3666
3667 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3668
3669 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3670 Keep selected_window and selected_frame in sync.
3671
3672 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3673
3674 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3675 try to get accurate owner and group information from NT file
3676 security APIs. This is to make most callers of 'stat' and
3677 'lstat', which don't need that information, much faster.
3678
3679 * dired.c (Ffile_attributes) [WINDOWSNT]:
3680 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3681 owner and group information from 'lstat'.
3682
3683 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3684
3685 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3686 as that confuses set-auto-coding, so insist on the head-read
3687 returning the full 1024 bytes. Let lseek compute the tail offset;
3688 less work for us. Do not ignore I/O errors when reading the tail.
3689
3690 * xdisp.c: Minor style fixes.
3691 (init_iterator): Hoist assignment out of if-expression.
3692 (markpos_of_region): Callers now test for sign, not for -1.
3693
3694 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3695
3696 Minor redisplay optimization when the region length is zero.
3697 * xdisp.c (markpos_of_region): New function.
3698 (init_iterator): Do not highlight the region of zero length.
3699 (redisplay_window): Check whether the region is of non-zero length.
3700 (try_cursor_movement): Allow if the region length is zero.
3701 (try_window_reusing_current_matrix, try_window_id): Likewise.
3702
3703 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3704
3705 * search.c (search_buffer): Check the inverse translations of each
3706 character in pattern when the buffer being searched is unibyte.
3707 (Bug#13084)
3708
3709 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3710
3711 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3712 files, fixing a regression from 24.2.
3713 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3714
3715 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3716
3717 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3718 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3719 Remove unnecessary S_ISLNK test, as (contra the comments) this
3720 function can't copy symlinks. Improve quality of error message
3721 when attempting to copy files that are neither regular files nor
3722 directories.
3723
3724 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3725
3726 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3727 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3728 * window.c (Frecenter):
3729 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3730 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3731
3732 2012-12-12 Daniel Colascione <dancol@dancol.org>
3733
3734 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3735 the dumped Emacs is not a sparse file, greatly improving Cygwin
3736 "make bootstrap" performance.
3737
3738 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3739
3740 * inotify.c (inotify_callback): Generate an Emacs event for every
3741 incoming inotify event.
3742
3743 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3744
3745 * xdisp.c (handle_face_prop): Fix logic of computing
3746 it->start_of_box_run_p.
3747 (append_space_for_newline): If the glyph row is R2L, reset the
3748 iterator's end_of_box_run_p flag before prepending the space glyph.
3749 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3750 iterator's start_of_box_run_p flag before prepending the stretch.
3751 (append_glyph, produce_image_glyph, append_composite_glyph)
3752 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3753 left_box_line_p and right_box_line_p flags of the glyph for R2L
3754 glyph rows. (Bug#13011)
3755
3756 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3757
3758 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3759 if changed buffer is not shown in a window.
3760 * insdel.c (prepare_to_modify_buffer): Likewise.
3761 * window.c (replace_buffer_in_windows_safely): Do nothing
3762 if buffer is not shown in a window.
3763 (Fforce_window_update): Likewise if string or buffer argument
3764 is passed.
3765
3766 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3767
3768 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3769 encoded_file_name, which is what it is.
3770
3771 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3772
3773 Consistently use marker_position and marker_byte_position.
3774 * fringe.c (Ffringe_bitmaps_at_pos):
3775 * indent.c (Fvertical_motion):
3776 * insdel.c (prepare_to_modify_buffer):
3777 * keyboard.c (make_lispy_position):
3778 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3779 (window_scroll_pixel_based, displayed_window_lines)
3780 (Fset_window_configuration):
3781 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3782 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3783 Replace direct access to marker fields with calls
3784 to marker_position and/or marker_byte_position.
3785
3786 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3787
3788 * makefile.w32-in (SIG2STR_H): New macro.
3789 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3790 ($(BLD)/w32notify.$(O)): Update dependencies.
3791
3792 2012-12-10 Daniel Colascione <dancol@dancol.org>
3793
3794 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3795 Windows file notification functionality unless WINDOWSNT.
3796
3797 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3798 declarations.
3799
3800 * w32fns.c (cache_system_info): Initialize the global hinst
3801 variable here so various initialization calls DTRT.
3802
3803 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3804 (hinst): Remove unneeded extern declaration.
3805 (_start): Remove initialization of above variables; remove
3806 initialization of hinst, as cache_system_info now does that.
3807
3808 * emacs.c (main): Call cache_system_info early in startup; we
3809 previously weren't calling it in Cygwin builds.
3810
3811 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3812 Teach the autoconf build system how to compile a Windows resource file
3813 and link it to Emacs.
3814
3815 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3816
3817 Per-buffer window counters.
3818 * buffer.h (struct buffer): New member window_count.
3819 (buffer_window_count): New function.
3820 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3821 Initialize window_count.
3822 (Fkill_buffer): Verify window_count for the buffer being killed.
3823 (modify_overlay): Do not force redisplay if buffer is not shown
3824 in any window.
3825 (init_buffer_once): Initialize window_count for buffer_defaults
3826 and buffer_local_symbols.
3827 * window.h (buffer_shared): Remove declaration.
3828 (wset_buffer): Convert from inline ...
3829 * window.c (wset_buffer): ... to an ordinary function.
3830 (adjust_window_count): New function.
3831 (make_parent_window): Use it.
3832 * xdisp.c (buffer_shared): Remove.
3833 (redisplay_internal, redisplay_window): Adjust users.
3834 (buffer_shared_and_changed): Use per-buffer window counter.
3835
3836 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3837
3838 Support for filesystem notifications on MS-Windows.
3839 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3840 and this is a TTY frame, signal the caller that keyboard input is
3841 available.
3842
3843 * w32xfns.c (drain_message_queue): Now returns an int: an
3844 indication whether any WM_EMACS_FILENOTIFY messages were found in
3845 the queue.
3846
3847 * w32inevt.c (handle_file_notifications): New function.
3848 (w32_console_read_socket): Call it to process file notifications.
3849
3850 * w32console.c (initialize_w32_display): Record the main thread ID
3851 in dwMainThreadId.
3852
3853 * deps.mk (inotify.o): New dependency list.
3854
3855 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3856
3857 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3858 (WM_EMACS_END): Bump value by 1.
3859 (notification_buffer_in_use, file_notifications)
3860 (notifications_size, notifications_desc): Declare.
3861 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3862 Add prototypes.
3863
3864 * w32term.c (lispy_file_action, queue_notifications): New functions.
3865 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3866 <Qrenamed_to>: New symbols.
3867 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3868
3869 * w32notify.c: New file, implements file event notifications for
3870 MS-Windows.
3871
3872 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3873 by posting it to the w32_read_socket queue.
3874
3875 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3876
3877 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3878 (GLOBAL_SOURCES): Add w32notify.c
3879 ($(BLD)/w32notify.$(O)): New set of dependencies.
3880
3881 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3882
3883 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3884 Handle FILE_NOTIFY_EVENT.
3885 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3886 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3887 w32notify-handle-event by default.
3888
3889 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3890 syms_of_w32notify.
3891
3892 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3893
3894 Support for filesystem notifications on GNU/Linux via inotify.
3895 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3896
3897 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3898
3899 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3900 (syms_of_keyboard): DEFSYM it.
3901 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3902 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3903 Qfile_inotify events.
3904 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3905 special-event-map to inotify-handle-event.
3906
3907 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3908
3909 * Makefile.in (base_obj): Add inotify.o.
3910
3911 * inotify.c: New file.
3912
3913 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3914
3915 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3916
3917 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3918
3919 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3920 DWORD_PTR, for compatibility with 64-bit builds.
3921
3922 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3923 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3924 (system_process_attributes): Use SIZE_T rather than DWORD, for
3925 compatibility with 64-bit builds.
3926
3927 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3928
3929 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3930
3931 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3932
3933 * indent.c (Fvertical_motion): If a display string will be
3934 displayed on the left or the right margin, don't consider it as a
3935 factor in cursor positioning. (Bug#13108)
3936
3937 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3938
3939 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3940
3941 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3942
3943 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3944 for string length.
3945
3946 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3947
3948 * w32.c (unsetenv): Return 0 if the input string is too long.
3949
3950 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3951
3952 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3953 * alloc.c (xputenv): New function.
3954 * dbusbind.c (Fdbus_init_bus):
3955 * emacs.c (main):
3956 * xterm.c (x_term_init):
3957 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3958 * editfns.c (initial_tz): Move static var decl up.
3959 (tzvalbuf_in_environ): New static var.
3960 (init_editfns): Initialize these two static vars.
3961 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3962 Save old TZ value on stack, if it's small.
3963 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3964 instead, use xputenv+unsetenv to set and restore TZ.
3965 (environbuf): Remove static var. All uses removed.
3966 (Fset_time_zone_rule): Do not save TZ and environ;
3967 no longer needed here.
3968 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3969 Move to inside set_time_zone_rule; they don't need file scope any more.
3970 (set_time_zone_rule): Maintain the TZ=value string separately.
3971 (syms_of_editfns): Don't initialize initial_tz;
3972 init_editfns now does it.
3973 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3974 * lisp.h (xputenv): New decl.
3975
3976 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3977
3978 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3979
3980 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3981
3982 * w32.c (unsetenv, sys_putenv): New functions.
3983
3984 2012-12-08 Chong Yidong <cyd@gnu.org>
3985
3986 * editfns.c (Finsert_char): Make the error message more
3987 informative (Bug#12992).
3988
3989 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3990
3991 Simplify get_lim_data.
3992 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3993 Remove USG and vlimit methods; no longer used these days.
3994 Add #error catchall just in case.
3995
3996 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3997 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3998 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3999 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
4000 (deleted_pid_list, Fdelete_process, create_process)
4001 (record_child_status_change, handle_child_signal, deliver_child_signal)
4002 (init_process_emacs, syms_of_process):
4003 Assume SIGCHLD is defined.
4004 (parse_signal): Remove. All uses removed.
4005 (abbr_to_signal): New static function.
4006 (Fsignal_process): Use it to convert signal names to ints.
4007 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
4008 kill (getpgrp (), ...).
4009 (emacs_sigaction_init): Assume SIGCHLD is defined.
4010 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
4011 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
4012 * syssignal.h (EMACS_KILLPG): Remove.
4013 All uses replaced by 'kill' with a negative pid.
4014 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
4015 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
4016
4017 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
4018
4019 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
4020 This will cause a production Emacs to dump core instead of
4021 infinite-looping.
4022
4023 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4024
4025 * frame.c (make_frame): Do not set window's buffer to t.
4026 * window.c (Fsplit_window_internal): Likewise. Previously it was
4027 used to indicate that the window is being set up. Now we use
4028 set_window_buffer for all new windows, so the condition in ...
4029 (Fset_window_buffer): ... is always true and can be removed.
4030
4031 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4032
4033 Convenient macro to check whether the buffer is hidden.
4034 * buffer.h (BUFFER_HIDDEN_P): New macro.
4035 * frame.c (make_frame): Use it. Adjust comment.
4036 * buffer.c (candidate_buffer): New function.
4037 (Fother_buffer, other_buffer_safely): Use it.
4038
4039 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4040
4041 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4042 if the child process is still running. Instead, exit the wait
4043 loop and return zero. (Bug#13086)
4044
4045 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4046
4047 * frame.h (x_char_width, x_char_height): Remove prototypes.
4048 * w32term.h (x_char_width, x_char_height): Likewise.
4049 * xfns.c (x_char_width, x_char_height): Remove.
4050 * w32fns.c (x_char_width, x_char_height): Likewise.
4051 * nsfns.c (x_char_width, x_char_height): Likewise.
4052 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4053 all window frames.
4054 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4055 * keyboard.c (command_loop_1): Remove prototype.
4056 (command_loop_2, top_level_1): Add static to match prototype.
4057
4058 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4059
4060 Fix a recently-introduced delete-process race condition.
4061 * callproc.c, process.h (record_kill_process):
4062 New function, containing part of the old call_process_kill.
4063 (call_process_kill): Use it.
4064 This does not change call_process_kill's behavior.
4065 * process.c (Fdelete_process): Use record_kill_process to fix a
4066 race condition that could cause Emacs to lose track of a child.
4067
4068 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4069
4070 Avoid code duplication between prev_frame and next_frame.
4071 * frame.c (candidate_frame): New function. Add comment.
4072 (prev_frame, next_frame): Use it. Adjust comment.
4073
4074 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4075
4076 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4077 fails, signal an error instead of continuing with an empty
4078 string. (Bug#13079)
4079 Encode expanded temp file pattern before passing it to mkstemp or
4080 mktemp.
4081
4082 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4083 Encode the file name before passing it to dostounix_filename, in
4084 case it will downcase it (under w32-downcase-file-names).
4085 (Bug#12933)
4086
4087 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4088
4089 Minor call-process cleanups.
4090 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4091 at the same time as other platforms, to simplify analysis.
4092 No need for fd0_volatile since we have synch_process_fd.
4093 Avoid needless emacs_close; arg is always negative.
4094
4095 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4096
4097 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4098 processes.
4099
4100 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4101
4102 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4103 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4104 and mouse_face_hidden members to a bitfields.
4105 * frame.h (struct frame): Remove set-but-not-used space_width member.
4106 (FRAME_SPACE_WIDTH): Remove.
4107 * nsterm.m, w32term.c, xterm.c: Adjust users.
4108 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4109 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4110 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4111 members to a bitfields.
4112
4113 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 Don't let call-process be a zombie factory (Bug#12980).
4116 Fixing this bug required some cleanup of the signal-handling code.
4117 As a side effect, this change also fixes a longstanding rare race
4118 condition whereby Emacs could mistakenly kill unrelated processes,
4119 and it fixes a bug where a second C-g does not kill a recalcitrant
4120 synchronous process in GNU/Linux and similar platforms.
4121 The patch should also fix the last vestiges of Bug#9488,
4122 a bug which has mostly been fixed on the trunk by other changes.
4123 * callproc.c, process.h (synch_process_alive, synch_process_death)
4124 (synch_process_termsig, sync_process_retcode):
4125 Remove. All uses removed, to simplify analysis and so that
4126 less consing is done inside critical sections.
4127 * callproc.c (call_process_exited): Remove. All uses replaced
4128 with !synch_process_pid.
4129 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4130 These take the role of what used to be in unwind-protect arg.
4131 All uses changed.
4132 (block_child_signal, unblock_child_signal):
4133 New functions, to avoid races that could kill innocent-victim processes.
4134 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4135 (call_process_kill): Record killed processes as deleted, so that
4136 zombies do not clutter up the system. Do this inside a critical
4137 section, to avoid a race that would allow the clutter.
4138 (call_process_cleanup): Fix code so that the second C-g works again
4139 on common platforms such as GNU/Linux.
4140 (Fcall_process): Create the child process in a critical section,
4141 to fix a race condition. If creating an asynchronous process,
4142 record it as deleted so that zombies do not clutter up the system.
4143 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4144 light of these changes. Omit unnecessary call to emacs_close
4145 before failure, as the unwind-protect code does that.
4146 * callproc.c (call_process_cleanup):
4147 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4148 * process.c (record_deleted_pid): New function, containing
4149 code refactored out of Fdelete_process.
4150 (Fdelete_process): Use it.
4151 (process_status_retrieved): Remove. All callers changed to use
4152 child_status_change.
4153 (record_child_status_change): Remove, folding its contents into ...
4154 (handle_child_signal): ... this signal handler. Now, this
4155 function is purely a handler for SIGCHLD, and is not called after
4156 a synchronous waitpid returns; the synchronous code is moved to
4157 wait_for_termination. There is no need to worry about reaping
4158 more than one child now.
4159 * sysdep.c (get_child_status, child_status_changed): New functions.
4160 (wait_for_termination): Now takes int * status and bool
4161 interruptible arguments, too. Do not record child status change;
4162 that's now the caller's responsibility. All callers changed.
4163 Reimplement in terms of get_child_status.
4164 (wait_for_termination_1, interruptible_wait_for_termination):
4165 Remove. All callers changed to use wait_for_termination.
4166 * syswait.h: Include <stdbool.h>, for bool.
4167 (record_child_status_change, interruptible_wait_for_termination):
4168 Remove decls.
4169 (record_deleted_pid, child_status_changed): New decls.
4170 (wait_for_termination): Adjust to API changes noted above.
4171
4172 * bytecode.c, lisp.h (Qbytecode): Remove.
4173 No longer needed after 2012-11-20 interactive-p changes.
4174
4175 2012-12-03 Eli Zaretskii <eliz@gnu.org>
4176
4177 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4178 the scroll margin, move point outside the margin. (Bug#13055)
4179
4180 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4181
4182 * gtkutil.c (my_log_handler): New function.
4183 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4184
4185 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4186
4187 * lisp.h (modify_region): Rename to...
4188 (modify_region_1): ...new prototype.
4189 * textprop.c (modify_region): Now static. Adjust users.
4190 * insdel.c (modify_region): Rename to...
4191 (modify_region_1): ...new function to work with current buffer.
4192 Adjust comment and users. Use true and false for booleans.
4193
4194 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4195
4196 * alloc.c (free_save_value): New function.
4197 (safe_alloca_unwind): Use it.
4198 * lisp.h (free_save_value): New prototype.
4199 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4200 Add comment.
4201 (save_excursion_restore): Adjust to match saved data structure.
4202 Use free_save_value to offload some work from GC. Drop obsolete
4203 #if 0 code.
4204
4205 2012-12-03 Chong Yidong <cyd@gnu.org>
4206
4207 * fileio.c (Vauto_save_list_file_name): Doc fix.
4208
4209 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4210
4211 * w32fns.c: Remove prototype of atof.
4212 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4213 builds.
4214 (file_dialog_callback): Make it UINT_PTR.
4215
4216 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4217 with 64-bit builds.
4218
4219 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4220 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4221 defined.
4222
4223 2012-12-03 Glenn Morris <rgm@gnu.org>
4224
4225 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4226
4227 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4228
4229 Fix xpalloc confusion after memory is exhausted.
4230 * alloc.c (xpalloc): Comment fix.
4231 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4232 and signals an error, do not clear charset_table_size, as
4233 charset_table is still valid.
4234 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4235
4236 Use execve to avoid need to munge environ (Bug#13054).
4237 * callproc.c (Fcall_process):
4238 * process.c (create_process):
4239 Don't save and restore environ; no longer needed.
4240 * callproc.c (child_setup):
4241 Use execve, not execvp, to preserve environ.
4242
4243 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4246
4247 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4248
4249 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4250 display for sliced images (Bug#10500).
4251
4252 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4253
4254 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4255
4256 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4257 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4258
4259 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4260
4261 * xdisp.c (window_outdated): Remove eassert since it hits
4262 some suspicious corner cases (see Bug#13007 and Bug#13012).
4263 (mode_line_update_needed): New function.
4264 (redisplay_internal, redisplay_window): Use it.
4265 (ensure_selected_frame): New function.
4266 (redisplay_internal, unwind_redisplay): Use it.
4267 (redisplay_internal): Move comment about buffer_shared...
4268 (buffer_shared_and_changed): ...near to its real use.
4269
4270 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 * callproc.c (Fcall_process): Don't misreport vfork failure.
4273
4274 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4275
4276 * callproc.c (Fcall_process): Fix vfork portability problems.
4277 Do not assume that fd[0], count, filefd, and save_environ survive
4278 vfork. Fix bug whereby wrong errno value could be reported for
4279 pipe failure. Some minor cleanups, too, as follows. Move buf and
4280 bufsize to the context where they're needed. Change new_argv to
4281 be of type char **, as this is more convenient and avoids casts.
4282 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4283 Now local constants, not macros.
4284
4285 2012-11-18 Kenichi Handa <handa@gnu.org>
4286
4287 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4288 for the variable "f".
4289
4290 2012-11-13 Kenichi Handa <handa@gnu.org>
4291
4292 * font.c (font_unparse_xlfd): Exclude special characters from the
4293 generating XLFD name.
4294
4295 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4296
4297 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4298 * dired.c (stat_uname, stat_gname):
4299 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4300
4301 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4302 * dired.c (directory_files_internal, file_name_completion):
4303 Assume EAGAIN and EINTR are defined.
4304
4305 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4306 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4307 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4308 * lread.c (readbyte_from_file): Assume EINTR is defined.
4309 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4310 Assume EIO and EAGAIN are defined.
4311 * unexcoff.c (write_segment): Assume EFAULT is defined.
4312
4313 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4314
4315 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4316 (Bug#11964)
4317
4318 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4319 highlighting on the frame was cleared. Prevents assertion
4320 violations when repeatedly clicking on the "Top" link of the
4321 "bread-crumbs" in Info buffers.
4322
4323 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4324
4325 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4326
4327 2012-11-24 Ken Brown <kbrown@cornell.edu>
4328
4329 * keyboard.c (HAVE_MOUSE):
4330 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4331 were always defined.
4332
4333 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4334
4335 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4336 between bpos_covered and bpos_max. This fixes cursor display when
4337 several display strings follow each other.
4338
4339 * .gdbinit (pgx): If the glyph's object is a string, display the
4340 pointer to string data, rather than the value of the string object
4341 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4342
4343 * indent.c (Fvertical_motion): If the starting position is covered
4344 by a display string, return to one position before that, to avoid
4345 overshooting it inside move_it_to. (Bug#12930)
4346
4347 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4348
4349 * frame.h (struct frame): Remove display_preempted member
4350 since all users are dead long ago.
4351 * nsterm.h (struct x_output): Use the only dummy member.
4352 * w32menu.c (pending_menu_activation): Remove since not
4353 really used.
4354 (set_frame_menubar): Adjust user.
4355 * w32term.h (struct x_output): Drop outdated #if 0 code.
4356 (struct w32_output): Use bitfields for explicit_parent,
4357 asked_for_visible and menubar_active members.
4358 Drop unused pending_menu_activation member.
4359 * xterm.h (struct x_output): Drop outdated #if 0 code.
4360 Use bitfields for explicit_parent, asked_for_visible,
4361 has_been_visible and net_wm_state_hidden_seen members.
4362
4363 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4364
4365 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4366 of a literal "/". (Bug#12955)
4367 (gl-stamp): Invoke fc.exe directly, not through cmd.
4368
4369 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4370
4371 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4372 * dired.c: Assume HAVE_DIRENT_H.
4373 (NAMLEN): Remove, replacing with ...
4374 (dirent_namelen): New function. All uses changed. Use the GNU macro
4375 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4376 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4377 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4378 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4379 $(NT_INC)/dirent.h.
4380 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4381 * ndir.h: Rename to ../nt/inc/dirent.h.
4382 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4383 Do not include <dirent.h>; no longer needed.
4384 * w32.c: Include <dirent.h> rather than "ndir.h".
4385
4386 2012-11-23 Chong Yidong <cyd@gnu.org>
4387
4388 * xftfont.c (xftfont_open): Remove duplicate assignment.
4389
4390 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4391
4392 * alloc.c (Fgarbage_collect): Unblock input after clearing
4393 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4394 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4395 * msdos.c (IT_frame_up_to_date): Use it here...
4396 * w32term.c (w32_frame_up_to_date): ...here...
4397 * xterm.c (XTframe_up_to_date): ...and here...
4398 * nsterm.m (ns_frame_up_to_date): ...but not here.
4399 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4400 Adjust users.
4401 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4402 Do not check whether GC is in progress.
4403
4404 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4405
4406 * xdisp.c (window_buffer_changed): New function.
4407 (update_menu_bar, update_tool_bar): Use it to
4408 simplify large 'if' statements.
4409 (redisplay_internal): Generalize commonly used
4410 'tail' and 'frame' local variables.
4411
4412 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4413
4414 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4415 with Windows system header.
4416
4417 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4420 * alloc.c: Assume unistd.h exists.
4421 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4422 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4423 (getwd) [USG]: Remove; no longer needed.
4424 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4425 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4426 * w32.h (getcwd): Remove decl.
4427
4428 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4429
4430 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4431 Make it set selected_window as well.
4432 (update_tool_bar): Use it.
4433
4434 2012-11-21 Ken Brown <kbrown@cornell.edu>
4435
4436 * emacs.c (main): Set the G_SLICE environment variable for all
4437 Cygwin builds, not just GTK builds. See
4438 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4439
4440 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4441
4442 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4443 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4444 Define for the MSVC compiler.
4445
4446 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4447
4448 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4449 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4450 dostounix_filename. Prevents crashes down the road, because
4451 dostounix_filename assumes it gets a unibyte string.
4452 Reported by Michel de Ruiter <michel@sentient.nl>, see
4453 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4454
4455 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4456
4457 Conflate Qnil and Qunbound for `symbol-function'.
4458 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4459 * lread.c (init_obarray): Set `function' fields to Qnil.
4460 * eval.c (Fcommandp): Ignore Qunbound.
4461 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4462 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4463 Test NILP rather than Qunbound.
4464 (Ffmakunbound): Set to Qnil.
4465 (Fsymbol_function): Never signal an error.
4466 (Finteractive_form): Ignore Qunbound.
4467
4468 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4469
4470 * eval.c (interactive_p): Remove no-longer-used decl.
4471
4472 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4473
4474 * xdisp.c (buffer_shared): Adjust comment.
4475 (buffer_shared_and_changed): New function.
4476 (prepare_menu_bars, redisplay_internal): Use it to
4477 decide whether all windows or frames should be updated.
4478 (window_outdated): New function.
4479 (text_outside_line_unchanged_p, redisplay_window): Use it.
4480 (redisplay_internal): Likewise. Fix indentation.
4481
4482 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4483
4484 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4485 (syms_of_eval): Remove corresponding defsubr.
4486 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4487
4488 2012-11-19 Daniel Colascione <dancol@dancol.org>
4489
4490 * w32fns.c (Fx_file_dialog):
4491 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4492 cygwin_convert_file_name*.
4493
4494 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4495 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4496
4497 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4498
4499 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4500
4501 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4502
4503 * w32select.c: Include w32common.h before w32term.h, so that
4504 windows.h gets included before w32term.h uses some of its
4505 features, see below.
4506
4507 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4508 New typedefs.
4509 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4510 New prototypes.
4511 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4512
4513 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4514
4515 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4516 (ns_select): Return at once if events are held (Bug#12834).
4517
4518 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4519
4520 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4521 Needed following 2012-10-20 change. (Bug#12902)
4522
4523 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4524
4525 * w32proc.c (waitpid): Remove unused label get_result.
4526
4527 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4528
4529 * makefile.w32-in (SYSWAIT_H): New macro.
4530 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4531 ($(BLD)/sysdep.$(O)): Update dependencies.
4532
4533 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4536 * callproc.c (relocate_fd): Assume F_DUPFD.
4537 * emacs.c, term.c (O_RDWR): Remove.
4538 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4539 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4540 * nsterm.m: Assume <fcntl.h> exists.
4541 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4542 (create_pty, Fmake_network_process, server_accept_connection)
4543 (wait_reading_process_output, init_process_emacs):
4544 Assume O_NONBLOCK.
4545 (wait_reading_process_output): Put in a special case for WINDOWSNT
4546 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4547 It's not clear this is needed, but it's a more-conservative change.
4548 (create_process): Assume FD_CLOEXEC.
4549 (create_process, create_pty): Assume O_NOCTTY.
4550 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4551 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4552 Omit if not DOS_NT, since F_GETFL is not defined there.
4553 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4554 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4555 (O_NOCTTY): Remove.
4556 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4557 lack it, since gnulib guarantees this.
4558 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4559
4560 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4561
4562 * w32.c (faccessat): Pretend that directories have the execute bit
4563 set. Emacs expects that, e.g., in files.el:cd-absolute.
4564
4565 * w32proc.c (create_child): Don't clip the PID of the child
4566 process to fit into an Emacs integer, as this is no longer a
4567 restriction.
4568 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4569 reaping only the process specified by PID argument, if that is
4570 positive. Use PID instead of dead_child to know which process to
4571 reap. Wait for the child to die only if WNOHANG is not in
4572 OPTIONS.
4573 (sys_select): Don't set dead_child.
4574
4575 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4576 as it is no longer needed.
4577
4578 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4579 no longer needed.
4580 (record_child_status_change): Remove the setting of
4581 record_at_most_one_child for the !WNOHANG case.
4582
4583 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4584
4585 Fix problems in ns port found by static checking.
4586 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4587 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4588 not to process group.
4589 (ns_select): Use emacs_write, not write, as that's more robust
4590 in the presence of signals.
4591 (fd_handler:): Check for read errors.
4592
4593 2012-11-16 Glenn Morris <rgm@gnu.org>
4594
4595 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4596
4597 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4598
4599 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4600
4601 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4602
4603 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4604 use the same value of thread handle.
4605 (start_timer_thread): If the timer thread exited (due to error),
4606 clean up by closing the two handles it used. Duplicate the caller
4607 thread's handle here, so it gets duplicated only once, when
4608 launching the timer thread. Set priority of the timer thread, not
4609 the caller thread.
4610 (getitimer): Don't duplicate the caller thread's handle here.
4611 (Bug#12832)
4612
4613 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4614
4615 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4616 called (Bug#12834).
4617
4618 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4619
4620 Remove no-longer-used pty_max_bytes variable.
4621 * process.c (pty_max_bytes): Remove; unused.
4622 (send_process): Do not set it.
4623
4624 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4625
4626 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4627 Update dependencies.
4628
4629 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4630
4631 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4632 This follows up on the 2012-09-29 patch that removed indirection
4633 for the 'function' field. Reported by Sergey Vinokurov in
4634 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4635
4636 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4637
4638 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4639 different name, as the MS runtime does not have such a function,
4640 and probably never will.) All callers changed. Ignore DIRFD
4641 value if PATH is an absolute file name, to match Posix spec
4642 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4643 symlinks.
4644
4645 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4646
4647 * xdisp.c (echo_area_display, redisplay_internal):
4648 Omit redundant check whether frame_garbaged is set.
4649
4650 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 Use faccessat, not access, when checking file permissions (Bug#12632).
4653 This fixes a bug that has been present in Emacs since its creation.
4654 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4655 which must set some sort of record. (Torek's bug report was against
4656 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4657 same common flaw.) See Torek's Usenet posting
4658 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4659 Posted: Fri Apr 8 14:18:56 1983.
4660 * Makefile.in (LIB_EACCESS): New macro.
4661 (LIBES): Use it.
4662 * callproc.c (init_callproc):
4663 * charset.c (init_charset):
4664 * fileio.c (check_existing, check_executable, check_writable)
4665 (Ffile_readable_p):
4666 * lread.c (openp, load_path_check):
4667 * process.c (allocate_pty):
4668 * xrdb.c (file_p):
4669 Use effective UID when checking permissions, not real UID.
4670 * callproc.c (init_callproc):
4671 * charset.c (init_charset):
4672 * lread.c (load_path_check, init_lread):
4673 Test whether directories are accessible, not merely whether they exist.
4674 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4675 * fileio.c (check_existing, check_executable, check_writable)
4676 (Ffile_readable_p):
4677 Use symbolic names instead of integers for the flags, as they're
4678 portable now.
4679 (check_writable): New arg AMODE. All uses changed.
4680 Set errno on failure.
4681 (Ffile_readable_p): Use faccessat, not stat + open + close.
4682 (Ffile_writable_p): No need to call check_existing + check_writable.
4683 Just call check_writable and then look at errno. This saves a syscall.
4684 dir should never be nil; replace an unnecessary runtime check
4685 with an eassert. When checking the parent directory of a nonexistent
4686 file, check that the directory is searchable as well as writable, as
4687 we can't create files in unsearchable directories.
4688 (file_directory_p): New function, which uses 'stat' on most platforms
4689 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4690 (Ffile_directory_p, Fset_file_times): Use it.
4691 (file_accessible_directory_p): New function, which uses a single
4692 syscall for efficiency.
4693 (Ffile_accessible_directory_p): Use it.
4694 * xrdb.c (file_p): Use file_directory_p.
4695 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4696 * lread.c (openp): When opening a file, use fstat rather than
4697 stat, as that avoids a permissions race. When not opening a file,
4698 use file_directory_p rather than stat.
4699 (dir_warning): First arg is now a usage string, not a format.
4700 Use errno. All uses changed.
4701 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4702 that merely introduced a race.
4703 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4704 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4705 and similarly for the other O_* flags.
4706 * w32.c (sys_faccessat): Rename from sys_access and switch to
4707 faccessat's API. All uses changed.
4708 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4709 (magic_db): Rename from magic_file_p.
4710 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4711 char *, so that we don't have to test for file existence
4712 separately from opening the file for reading. This removes a race
4713 fixes a permission-checking problem, and simplifies the code.
4714 All uses changed.
4715 (file_p): Remove; no longer needed.
4716
4717 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4718
4719 Omit glyphs initialization at startup.
4720 * dispnew.c (glyphs_initialized_initially_p): Remove.
4721 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4722 (Fredraw_frame): Move actual code from here...
4723 (redraw_frame): ...to here. Add eassert. Adjust comment.
4724 (Fredraw_display): Use redraw_frame.
4725 * xdisp.c (clear_garbaged_frames): Likewise.
4726
4727 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4728
4729 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4730 passed to pint2str and pint2hrstr to be at most the size of the
4731 frame's decode_mode_spec_buffer. This avoids crashes with very
4732 large values of FIELD_WIDTH argument to decode_mode_spec.
4733 (Bug#12867)
4734
4735 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4736
4737 Fix a race with verify-visited-file-modtime (Bug#12863).
4738 Since at least 1991 Emacs has ignored an mtime difference of no
4739 more than one second, but my guess is that this was to work around
4740 file system bugs that were fixed long ago. Since the race is
4741 causing problems now, let's remove that code.
4742 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4743 whose time stamp is off by no more than a second. Insist that the
4744 file time stamps match exactly.
4745
4746 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4747
4748 * frame.h (struct frame): Convert external_tool_bar member to
4749 1-bit unsigned bitfield.
4750 * termhooks.h (struct terminal): Remove mouse_moved member since
4751 all users are long dead. Adjust comment on mouse_position_hook.
4752
4753 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4754
4755 Simplify by using FOR_EACH_FRAME here and there.
4756 * frame.c (next_frame, prev_frame, other_visible_frames)
4757 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4758 * w32term.c (x_window_to_scroll_bar): Likewise.
4759 * window.c (window_list): Likewise.
4760 * xdisp.c (x_consider_frame_title): Likewise.
4761 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4762 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4763 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4764 * xmenu.c (menubar_id_to_frame): Likewise.
4765 * xselect.c (frame_for_x_selection): Likewise.
4766 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4767 (x_window_to_menu_bar): Likewise.
4768 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4769
4770 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 * data.c (Qdefalias_fset_function): Now static.
4773
4774 Another tweak to vectorlike_header change.
4775 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4776 Remove, and replace all uses with ...
4777 (next_in_free_list, set_next_in_free_list):
4778 New functions, which respect C's aliasing rules better.
4779
4780 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4781
4782 * window.c (list4i): Rename from 'quad'. All uses changed.
4783 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4784
4785 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4786
4787 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4788 warning about mixing declarations and code in ISO C90.
4789
4790 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4791
4792 * window.c (Fsplit_window_internal): Set combination limit of
4793 new parent window to t iff Vwindow_combination_limit is t;
4794 fixing a regression introduced with the change from 2012-09-22.
4795 (Fset_window_combination_limit): Fix doc-string.
4796
4797 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4798
4799 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4800 amount when the scroll margins are too large. When scrolling
4801 backwards in the buffer, give up if cannot reach point or the
4802 scroll margin within a reasonable number of screen lines.
4803 Fixes point position in window under scroll-up/down-aggressively when
4804 point is positioned many lines beyond the window top/bottom.
4805 (Bug#12811)
4806
4807 * ralloc.c (relinquish): If real_morecore fails to return memory
4808 to the system, don't crash; instead, leave the last heap
4809 unchanged and return. (Bug#12774)
4810
4811 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4812
4813 * lisp.h (AUTOLOADP): New macro.
4814 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4815 * data.c (Ffset): Remove special ad-advice-info handling.
4816 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4817 (Fsubr_arity): CSE.
4818 (Finteractive_form): Simplify.
4819 (Fquo): Don't insist on having at least 2 arguments.
4820 (Qdefalias_fset_function): New var.
4821
4822 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4823
4824 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4825
4826 * nsfont.m (Qcondensed, Qexpanded): New variables.
4827 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4828 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4829
4830 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4831
4832 Fix recently introduced crash on MS-Windows (Bug#12839).
4833 * w32term.h (struct scroll_bar): Use convenient header.
4834 (SCROLL_BAR_VEC_SIZE): Remove.
4835 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4836
4837 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4838
4839 Tweak last vectorlike_header change.
4840 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4841 vectorlike object on the free list. This is introduced to avoid
4842 some (but not all) pointer casting and aliasing problems, see
4843 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4844 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4845 objects.
4846 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4847
4848 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4849
4850 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4851 been removed, so remove them here also.
4852
4853 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4854
4855 * doc.c (Fdocumentation): Handle new property
4856 dynamic-docstring-function to replace the old ad-advice-info.
4857
4858 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * fns.c (Qeql, hashtest_eq): Now static.
4861
4862 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4863
4864 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4865 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4866 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4867 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4868
4869 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 Use same hash function for hashfn_profiler as for hash_string etc.
4872 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4873 * lisp.h (sxhash_combine): New inline function, with the contents
4874 of the old SXHASH_COMBINE.
4875 * profiler.c (hashfn_profiler): Use it, instead of having a
4876 special hash function containing a comparison that always yields 1.
4877
4878 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4879
4880 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4881 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4882 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4883 Remove unused vars.
4884
4885 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4886
4887 * image.c (xpm_make_color_table_h): Fix compiler error because
4888 make_hash_table changed.
4889
4890 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4891
4892 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4893
4894 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4895
4896 Use ad-hoc comparison function for the profiler's hash-tables.
4897 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4898 (make_log): Use them.
4899 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4900 call Fequal any more.
4901 (Ffunction_equal): New function.
4902 (cmpfn_profiler, hashfn_profiler): New functions.
4903 (syms_of_profiler): Initialize them.
4904 * lisp.h (struct hash_table_test): New struct.
4905 (struct Lisp_Hash_Table): Use it.
4906 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4907 * fns.c (make_hash_table): Take a struct to describe the test.
4908 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4909 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4910 (hash_lookup, hash_remove_from_table): Move assertion checking of
4911 hashfn result here. Check hash-equality before calling cmpfn.
4912 (Fmake_hash_table): Adjust call to make_hash_table.
4913 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4914 (syms_of_fns): Initialize them.
4915 * emacs.c (main): Move syms_of_fns earlier.
4916 * xterm.c (syms_of_xterm):
4917 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4918 * print.c (print_object): Adjust to new hash-table struct.
4919 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4920
4921 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4922
4923 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4924 value of w32-scroll-lock-modifier is neither nil nor one of the
4925 known key modifiers. (Bug#12806)
4926
4927 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4928
4929 Shrink struct vectorlike_header to the only size field.
4930 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4931 Adjust comment.
4932 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4933 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4934 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4935 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4936 information from the vector header. Adjust comment.
4937 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4938 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4939 layout.
4940 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4941 (struct vectorlike_header): Remove next member. Adjust comment.
4942 (struct Lisp_Subr): Add convenient header. Adjust comment.
4943 (allocate_pseudovector): Adjust prototype.
4944 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4945 (sweep_string, lisp_malloc): Remove useless prototypes.
4946 (enum mem_type): Adjust comment.
4947 (NEXT_IN_FREE_LIST): New macro.
4948 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4949 (Fmake_bool_vector): Likewise.
4950 (struct large_vector): New type to represent allocation unit for
4951 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4952 (large_vectors): Change type to struct large_vector.
4953 (allocate_vector_from_block): Simplify.
4954 (PSEUDOVECTOR_NBYTES): Replace with...
4955 (vector_nbytes): ...new function. Adjust users.
4956 (sweep_vectors): Adjust processing of large vectors.
4957 (allocate_vectorlike): Likewise.
4958 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4959 Add easserts. Adjust XSETPVECTYPESIZE usage.
4960 (allocate_buffer): Use BUFFER_PVEC_INIT.
4961 (live_vector_p): Adjust to match large vector.
4962 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4963 * buffer.h (struct buffer): Add next member.
4964 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4965 New macros.
4966 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4967 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4968 (copy_hash_table): Adjust to match vector header change.
4969 * lread.c (defsubr): Use XSETPVECTYPE.
4970 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4971 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4972 (xvecsize): New command.
4973
4974 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4975
4976 * keyboard.c (event_to_kboard): Do not dereference
4977 frame_or_window field of SELECTION_REQUEST_EVENT
4978 and SELECTION_CLEAR_EVENT events (Bug#12814).
4979 * xterm.h (struct selection_input_event): Adjust comment.
4980
4981 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4982
4983 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4984 such as Scroll Lock, if the respective keys are treated as
4985 function keys, not as modifiers. This avoids destroying non-ASCII
4986 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4987
4988 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4989
4990 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4991
4992 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 Restore some duplicate definitions (Bug#12814).
4995 This undoes part of the 2012-11-03 changes. Some people build
4996 with plain -g rather than with -g3, and they need the duplicate
4997 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4998 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4999 Define as macros, as well as as enums or as constants.
5000
5001 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
5002
5003 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
5004 to keypad keys (Bug#12816).
5005
5006 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 Minor adjustments of recently-changed frame functions.
5009 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
5010 known to be a frame (we're in the FRAMEP branch).
5011 * lisp.h (Qframep): Remove decl. frame.h declares this.
5012 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
5013 since they're meant for Lisp fixnum values.
5014
5015 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 * window.c (Fwindow_combination_limit): Revert to the only
5018 required argument and adjust docstring as suggested in
5019 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
5020 by Martin Rudalics <rudalics@gmx.at>.
5021
5022 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5023
5024 Widely used frame validity and checking functions.
5025 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
5026 * frame.c (decode_live_frame, decode_any_frame): New functions.
5027 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
5028 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
5029 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
5030 (Fframe_pointer_visible_p): Use decode_any_frame.
5031 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
5032 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
5033 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
5034 (Fframe_focus): Likewise. Allow zero number of arguments.
5035 Adjust docstring.
5036 (frame_buffer_list, frame_buffer_predicate): Remove.
5037 * lisp.h (frame_buffer_predicate): Remove prototype.
5038 * buffer.c (Fother_buffer): Use decode_any_frame.
5039 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5040 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5041 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5042 (Fclose_font, Ffont_info): Use decode_live_frame.
5043 * fontset.c (check_fontset_name): Likewise.
5044 * terminal.c (Fframe_terminal): Likewise.
5045 * w32fns.c (check_x_frame): Likewise.
5046 * window.c (Fminibuffer_window, Fwindow_at)
5047 (Fcurrent_window_configuration): Likewise.
5048 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5049 Likewise. Allow zero number of arguments. Adjust docstring.
5050 * dispnew.c (Fredraw_frame): Likewise.
5051 * xfaces.c (frame_or_selected_frame): Remove.
5052 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5053 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5054 (Fframe_face_alist): Use decode_live_frame.
5055 * xfns.c (check_x_frame): Likewise.
5056
5057 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5058
5059 * window.c (quad): New function.
5060 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5061 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5062 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5063 (Fwindow_line_height): Use it.
5064 (Fwindow_fringes): Use list3.
5065 (Fwindow_scroll_bars): Use list4.
5066 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5067 (Fwindow_combination_limit): Allow zero number of arguments.
5068
5069 2012-11-05 Eli Zaretskii <eliz@gnu.org>
5070
5071 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5072
5073 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5074 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5075 file descriptor 2 for standard error. (Bug#12805)
5076
5077 2012-11-05 Chong Yidong <cyd@gnu.org>
5078
5079 * process.c (wait_reading_process_output): Revert previous change.
5080
5081 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5082
5083 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5084 This removes code that has been obsolete since around 1990.
5085 * callproc.c (Fcall_process):
5086 * emacs.c (main):
5087 * process.c (create_process):
5088 * term.c (dissociate_if_controlling_tty):
5089 Assume setsid exists.
5090 * callproc.c (child_setup): Assume setpgid exists and behaves as
5091 per POSIX.1-1988 or later.
5092 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5093 * emacs.c (shut_down_emacs):
5094 * sysdep.c (sys_suspend, init_foreground_group):
5095 Assume getpgrp behaves as per POSIX.1-1998 or later.
5096 * msdos.c (setpgrp): Remove.
5097 (tcgetpgrp, setpgid, setsid): New functions.
5098 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5099 * term.c (no_controlling_tty): Remove; unused.
5100 * w32proc.c (setpgrp): Remove.
5101 (setsid, tcgetpgrp): New functions.
5102
5103 Simplify by assuming __fpending.
5104 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5105 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5106 Do not assume that __fpending's result fits in int.
5107
5108 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5109
5110 Remove EMACS_OUTQSIZE+sleep hack.
5111 * dispnew.c (update_frame_1): Remove hack for terminals slower
5112 than 2400 bps, which throttled Emacs by having it sleep.
5113 This code hasn't worked since at least 2007, when the multi-tty stuff
5114 was added, and anyway those old terminals are long dead.
5115 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5116 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5117
5118 Fix data-loss with --version (Bug#9574).
5119 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5120 as we can't assume that emacs_strerror is initialized, and strerror
5121 is good enough here.
5122 (main): Invoke atexit earlier, to catch earlier instances of
5123 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5124
5125 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5126
5127 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5128 (keyDown): Remap keypad keys to X11 virtual key codes.
5129
5130 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5131
5132 Fix data-loss with --batch (Bug#9574).
5133 * emacs.c: Include <close-stream.h>.
5134 (close_output_streams): New function.
5135 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5136 and handles errors appropriately.
5137 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5138 does that now.
5139
5140 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5141 The symptom is a diagnostic "GLib-WARNING **: In call to
5142 g_spawn_sync(), exit status of a child process was requested but
5143 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5144 waitpid(), so exit status can't be returned." The diagnostic
5145 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5146 The real bug is a race condition between Emacs and glib: Emacs
5147 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5148 so that glib can't find it. Work around the bug by invoking
5149 waitpid only on subprocesses that Emacs itself creates.
5150 * process.c (create_process, record_child_status_change):
5151 Don't use special value -1 in pid field, as the caller now must
5152 know the pid rather than having the callee infer it.
5153 The inference was sometimes incorrect anyway, due to another race.
5154 (create_process): Set new 'alive' member if child is created.
5155 (process_status_retrieved): New function.
5156 (record_child_status_change): Use it.
5157 Accept negative 1st argument, which means to wait for the
5158 processes that Emacs already knows about. Move special-case code
5159 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5160 processes that have already been waited for, by testing and
5161 clearing new 'alive' member.
5162 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5163 now does this internally.
5164 (handle_child_signal): Let record_child_status_change do all
5165 the work, since we do not want to reap all exited child processes,
5166 only the child processes that Emacs itself created.
5167 * process.h (Lisp_Process): New boolean member 'alive'.
5168
5169 Omit duplicate definitions no longer needed with gcc -g3.
5170 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5171 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5172 Define only as macros. There's no longer any need to also define
5173 these symbols as enums or as constants, since we now assume
5174 gcc -g3 when debugging.
5175
5176 2012-11-03 Eli Zaretskii <eliz@gnu.org>
5177
5178 * lisp.mk: Adjust comments to the fact that term/internal is now
5179 loaded from loadup.el.
5180
5181 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5182 (msdos_fatal_signal): New function.
5183 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5184 its argument list.
5185
5186 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5187 for GCC versions before 4.
5188 (emacs_raise): Define to call msdos_fatal_signal.
5189
5190 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5191 iterator when starting in the middle of a display or overlay
5192 string. (Bug#12745)
5193
5194 2012-11-03 Chong Yidong <cyd@gnu.org>
5195
5196 * process.c (wait_reading_process_output): Clean up the last
5197 change.
5198
5199 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5200
5201 * process.c (wait_reading_process_output): Avoid a race condition
5202 with SIGIO delivery (Bug#11536).
5203
5204 2012-11-03 Chong Yidong <cyd@gnu.org>
5205
5206 * buffer.c (cursor_type): Untabify docstring.
5207
5208 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5209
5210 * frame.h (struct frame): Drop can_have_scroll_bars member
5211 which is meaningless for a long time. Adjust comments.
5212 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5213 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5214
5215 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5216
5217 * window.c (decode_next_window_args): Update window arg after
5218 calling decode_live_window and so fix crash reported at
5219 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5220 by Juanma Barranquero <lekktu@gmail.com>.
5221 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5222 * font.c (Ffont_at): Likewise.
5223
5224 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5225
5226 * widget.c (resize_cb): New function.
5227 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5228 (EmacsFrameResize): Check if all is up to date before changing frame
5229 size.
5230
5231 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5232
5233 Implement backtrace output for fatal errors on MS-Windows.
5234 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5235 (BACKTRACE_LIMIT_MAX): New macro.
5236 (w32_backtrace): New function.
5237 (emacs_abort): Use w32_backtrace when the user chooses not to
5238 attach a debugger. Update the text of the abort dialog.
5239
5240 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5241
5242 Window-related stuff cleanup here and there.
5243 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5244 Use decode_any_window.
5245 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5246 * xdisp.c (Fformat_mode_line): Likewise.
5247 * font.c (Ffont_at): Use decode_live_window.
5248 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5249 * window.c (decode_next_window_args): Likewise.
5250 (decode_any_window): Remove static.
5251 * window.h (decode_any_window): Add prototype.
5252 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5253 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5254 respectively.
5255
5256 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5257
5258 Remove pad from struct input_event.
5259 * termhooks.h (struct input_event): Remove padding field.
5260 Adjust comment.
5261 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5262 member is never cons for a long time. Adjust comment.
5263 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5264 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5265 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5266 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5267
5268 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5269
5270 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5271
5272 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5273
5274 Fix crash when using Emacs as commit editor for git (Bug#12697).
5275 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5276 and it is configured in conf_post.h.
5277 (Fcall_process): Don't invoke both setsid and setpgid; the former
5278 is enough, if it exists.
5279 * callproc.c (Fcall_process, child_setup):
5280 * process.c (create_process): Use setpgid.
5281 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5282 for the real thing.
5283 * dispnew.c (init_display): Initialize the foreground group
5284 if we are running a tty display.
5285 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5286 * lisp.h (init_foreground_group): New decl.
5287 * sysdep.c (inherited_pgroup): New static var.
5288 (init_foreground_group, tcsetpgrp_without_stopping)
5289 (narrow_foreground_group, widen_foreground_group): New functions.
5290 (init_sys_modes): Narrow foreground group.
5291 (reset_sys_modes): Widen foreground group.
5292
5293 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5294
5295 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5296
5297 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5298
5299 * minibuf.c (read_minibuf): Restore current buffer since
5300 choose_minibuf_frame calling Fset_frame_selected_window may
5301 change it (Bug#12766).
5302
5303 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5304
5305 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5306
5307 2012-10-30 Kenichi Handa <handa@gnu.org>
5308
5309 * font.c (Ffont_at): If WINDOW is specified and it is not
5310 displaying the current buffer, signal an error.
5311
5312 2012-10-29 Daniel Colascione <dancol@dancol.org>
5313
5314 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5315 In preparation for fixing bug#12739, move these functions from
5316 here...
5317
5318 * coding.h, coding.c: ... to here, and compile them only when
5319 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5320 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5321
5322 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5323
5324 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5325 (timer_loop, getitimer, setitimer): Use it instead of
5326 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5327 'clock'.
5328 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5329 literal 10000.
5330
5331 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5332
5333 * nsterm.m (NO_APPDEFINED_DATA): New define.
5334 (last_appdefined_event_data): New variable
5335 (last_appdefined_event): Remove.
5336 (ns_select): Initialize t from last_appdefined_event_data instead
5337 of [last_appdefined_event data1].
5338 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5339 remove last_appdefined_event (Bug#12698).
5340
5341 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5342
5343 * frame.c (x_set_font): Catch internal error.
5344
5345 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5346
5347 Avoid overflow in w32 implementation of interval timers.
5348 When possible, for ITIMER_PROF count only times the main thread
5349 actually executes.
5350 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5351 'volatile ULONGLONG' types. All the other data which was
5352 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5353 (GetThreadTimes_Proc): New typedef.
5354 (w32_get_timer_time): New function, returns a suitable time value
5355 for the timer.
5356 (timer_loop): Enter critical section when accessing ULONGLONG
5357 values of the itimer_data struct, as these accesses are no longer
5358 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5359 Remove unused variable.
5360 (init_timers): Initialize s_pfn_Get_Thread_Times.
5361 (start_timer_thread): Don't assign itimer->caller_thread here.
5362 (getitimer): Assign itimer->caller_thread here.
5363 (setitimer): Always call getitimer to get the value of ticks_now.
5364 (sys_spawnve): Avoid compiler warning about format mismatch.
5365
5366 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5367
5368 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5369 mouse movement events if the menu bar is active. This avoids
5370 producing a busy "hour-glass" cursor by Windows if the mouse
5371 pointer is positioned over a tooltip shown for some menu item.
5372
5373 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5374
5375 Don't assume process IDs fit in int.
5376 * emacs.c (shut_down_emacs) [!DOS_NT]:
5377 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5378 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5379 Use pid_t, not int, to store process IDs, as 'int'
5380 is not wide enough on a few platforms (e.g., AIX and IRIX).
5381
5382 2012-10-23 Kenichi Handa <handa@gnu.org>
5383
5384 The following change is to make face-font-rescale-alist work
5385 correctly for non-ASCII fonts.
5386
5387 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5388 (font_open_for_lface): Handle Vface_font_rescale_alist.
5389
5390 2012-10-23 Chong Yidong <cyd@gnu.org>
5391
5392 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5393
5394 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5395
5396 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5397 for screen font.
5398 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5399
5400 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5401 event (Bug#12681).
5402
5403 2012-10-21 Glenn Morris <rgm@gnu.org>
5404
5405 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5406
5407 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5408
5409 Port to OpenBSD 5.1.
5410 * frame.c (Fmouse_position, Fmouse_pixel_position):
5411 * xdisp.c (produce_stretch_glyph):
5412 Declare local vars only when they're needed.
5413 This is clearer and avoids a warning on OpenBSD about unused vars.
5414 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5415 This is safer, and avoids OpenBSD warnings about unused vars.
5416 * keyboard.c (record_menu_key): Remove unnecessary decl.
5417 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5418 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5419 as our definition clashes with OpenBSD's.
5420 * xfaces.c (load_face_colors, check_lface_attrs)
5421 (get_lface_attributes_no_remap, get_lface_attributes)
5422 (lface_fully_specified_p, x_supports_face_attributes_p)
5423 (tty_supports_face_attributes_p, face_fontset, realize_face)
5424 (realize_x_face, realize_tty_face):
5425 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5426 merely Lisp_Object *. This is more informative and avoids
5427 a warning on OpenBSD about accessing beyond an object's size.
5428
5429 2012-10-20 Chong Yidong <cyd@gnu.org>
5430
5431 * lread.c (Fload): Doc fix (Bug#12592).
5432
5433 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5434
5435 * font.c (Ffont_at): Fix previous change.
5436
5437 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5438
5439 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5440 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5441 for the reasons.
5442
5443 * alloc.c (NSTATICS): Decrease to 0x800.
5444
5445 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5446
5447 * fns.c (Fnreverse): Include the problem element when signaling an
5448 error (bug#12677).
5449
5450 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5451
5452 * nsterm.m (ns_select): Check writefds before call to
5453 FD_ISSET (Bug#12668).
5454
5455 2012-10-18 Daniel Colascione <dancol@dancol.org>
5456
5457 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5458 (staticpro): If we run out of staticpro slots, die with an
5459 informative error instead of just calling emacs_abort.
5460
5461 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5462
5463 Fix two flaws reported by Dmitry Antipov.
5464 * window.c (Ftemp_output_buffer_show): Remove.
5465 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5466 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5467
5468 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5469
5470 * makefile.w32-in ($(BLD)/w32.$(O)):
5471 ($(BLD)/vm-limit.$(O)):
5472 ($(BLD)/term.$(O)):
5473 ($(BLD)/unexw32.$(O)):
5474 ($(BLD)/fileio.$(O)):
5475 ($(BLD)/dispnew.$(O)): Update dependencies.
5476
5477 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5478 Add prototypes.
5479
5480 * w32proc.c: Include ctype.h.
5481
5482 * w32.h (init_environment, check_windows_init_file)
5483 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5484 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5485 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5486 (sys_link): Add prototypes.
5487
5488 * w32.c: Include w32select.h.
5489 (sys_access, e_malloc, sys_select): Add prototypes.
5490 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5491
5492 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5493
5494 * unexw32.c: Include lisp.h and w32.h.
5495
5496 * term.c [WINDOWSNT]: Include w32term.h.
5497
5498 * process.c [WINDOWSNT]: Add prototype of sys_select.
5499
5500 * fileio.c [WINDOWSNT]: Include w32.h.
5501
5502 * dispnew.c [WINDOWSNT]: Include w32.h.
5503
5504 * cygw32.c (Fcygwin_convert_path_to_windows)
5505 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5506 Lisp_Object values. (Bug#12661)
5507
5508 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5509 to Lisp_Object. (Bug#12661)
5510
5511 2012-10-17 Kenichi Handa <handa@gnu.org>
5512
5513 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5514 invalidate.
5515
5516 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5517
5518 * buffer.c (Fkill_buffer): When unchaining the marker,
5519 reset its buffer pointer to NULL (Bug#12652).
5520
5521 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5522
5523 Do not verify indirection counters of killed buffers (Bug#12579).
5524 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5525 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5526
5527 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5528
5529 * alloc.c (Fmake_byte_code): Fix typo in comment.
5530 * print.c (print_interval): Define as static to match prototype.
5531 * indent.c (disptab_matches_widthtab, recompute_width_table):
5532 Convert to eassert.
5533
5534 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5535
5536 * editfns.c (get_system_name): Remove.
5537 * lisp.h (get_system_name): Remove prototype.
5538 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5539 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5540
5541 2012-10-15 Daniel Colascione <dancol@dancol.org>
5542
5543 * dbusbind.c: Add comment explaining reason for previous change.
5544
5545 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5546
5547 * window.c (Fwindow_end): Rewrite check whether cached position
5548 can be used (Bug#12600).
5549 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5550 Set windows_or_buffers_changed.
5551
5552 2012-10-15 Daniel Colascione <dancol@dancol.org>
5553
5554 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5555 enabled by undefining the symbol "interface", which the platform
5556 headers define to something incompatible.
5557
5558 2012-10-14 Daniel Colascione <dancol@dancol.org>
5559
5560 * image.c (init_tiff_functions, init_imagemagick_functions)
5561 (init_svg_functions): Fix cygw32 build break by using these
5562 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5563
5564 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5565
5566 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5567
5568 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5569
5570 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5571
5572 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5573
5574 * coding.c (detect_coding): Set coding->id before calling
5575 this->detector.
5576
5577 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5578
5579 * fileio.c: Formatting fixes.
5580
5581 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5582
5583 Fix some stat-related races.
5584 * fileio.c (Fwrite_region): Avoid race condition if a file is
5585 removed or renamed by some other process immediately after Emacs
5586 writes it but before Emacs stats it. Do not assume that stat (or
5587 fstat) succeeds.
5588 * image.c (slurp_file): Resolve the file name with fopen + fstat
5589 rather than stat + fopen.
5590 (pbm_read_file) [0]: Remove unused code with stat race.
5591 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5592 Remove ineffective code with stat race.
5593
5594 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5595
5596 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5597
5598 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5599
5600 * nsterm.m (hold_event_q): New static variable.
5601 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5602 ! q_event_ptr.
5603 (hold_event): New function.
5604 (ns_read_socket): If hold_event_q have events, store them and
5605 return (Bug#12384).
5606 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5607 is zero (Bug#12384).
5608
5609 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5610
5611 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5612
5613 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5614
5615 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5616
5617 * fileio.c (check_existing): New function.
5618 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5619 instead of calling 'stat', when what's needed is to check whether
5620 a file exists. This avoids expensive system calls on MS-Windows.
5621 (Bug#12587)
5622
5623 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5624
5625 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5626 determine whether a file exists and is not a directory.
5627
5628 * lisp.h (check_existing): Add prototype.
5629
5630 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5631
5632 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5633
5634 2012-10-12 Glenn Morris <rgm@gnu.org>
5635
5636 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5637
5638 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5639
5640 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5641
5642 * eval.c (Fautoload): Remember previous autoload status in load-history.
5643
5644 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5647 * lread.c (load_each_byte, new_backquote_flag, readchar)
5648 (read_filtered_event, lisp_file_lexically_bound_p)
5649 (safe_to_load_version, Fload, complete_filename_p, openp)
5650 (build_load_history, readevalloop, read_escape, read1)
5651 (string_to_number, read_vector, read_list):
5652 * macros.c (Fstart_kbd_macro):
5653 * marker.c (CONSIDER):
5654 * menu.c (parse_single_submenu, digest_single_submenu)
5655 (find_and_return_menu_selection, Fx_popup_menu):
5656 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5657 (Ftry_completion):
5658 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5659 (ns_menu_show):
5660 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5661 (xmenu_show, xdialog_show):
5662 Use bool for booleans.
5663 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5664 as it's not a predicate. All uses changed. Omit unnecessary
5665 buffer termination.
5666
5667 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5668
5669 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5670 (save_excursion_restore): Do not restore mark if it was not saved.
5671
5672 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5673
5674 * marker.c (cached_modiff): EMACS_INT, not int.
5675
5676 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5677 instead of having a wrong decl.
5678 * nsmenu.m (waiting_for_input): Remove wrong decl.
5679
5680 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5681
5682 keyboard.c, keymap.c: Use bool for booleans.
5683 * dispnew.c (sit_for): Distinguish between 3-way display_option
5684 and boolean do_display.
5685 * keyboard.c (single_kboard, this_command_key_count_reset)
5686 (waiting_for_input, echoing, immediate_quit, input_pending)
5687 (interrupt_input, interrupts_deferred, pop_kboard)
5688 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5689 (command_loop_1, adjust_point_for_property)
5690 (safe_run_hooks_error, input_polling_used, read_char):
5691 (help_char_p, readable_events, kbd_buffer_events_waiting)
5692 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5693 (lucid_event_type_list_p, get_input_pending):
5694 (gobble_input, menu_separator_name_p, menu_bar_item)
5695 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5696 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5697 (keyremap_step, test_undefined, read_key_sequence)
5698 (detect_input_pending, detect_input_pending_ignore_squeezables)
5699 (detect_input_pending_run_timers, requeued_events_pending_p)
5700 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5701 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5702 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5703 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5704 (accessible_keymaps_1, Fkey_description, push_key_description):
5705 (shadow_lookup, struct where_is_internal_data)
5706 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5707 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5708 (describe_map, describe_vector):
5709 * menu.c (single_menu_item):
5710 * nsmenu.m (ns_update_menubar):
5711 * process.c (wait_reading_process_output):
5712 * search.c (scan_buffer, scan_newline):
5713 Use bool for boolean.
5714 * keyboard.c (timers_run, swallow_events)
5715 (detect_input_pending_run_timers):
5716 * process.c (wait_reading_process_output):
5717 Use unsigned for counter where wraparound-on-overflow is desired,
5718 since unsigned is guaranteed to have that behavior and signed is not.
5719 (read_char): Use ptrdiff_t for string length.
5720 (get_input_pending): Remove first argument, since it was always
5721 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5722 and behave as if it had that value. Return new value of
5723 input_pending. All callers changed.
5724 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5725 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5726 a string length.
5727 * keymap.c (push_key_description): Omit last arg, which was always 1.
5728 All callers changed.
5729
5730 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5731
5732 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5733
5734 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5735 ($(BLD)/term.$(O)): Update dependencies.
5736
5737 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5738
5739 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5740 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5741 initializer for PVEC_NORMAL_VECTOR.
5742
5743 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 Clean out old termopts cruft.
5746 * termopts.h (flow_control, meta_key): Remove unused decls.
5747 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5748 Don't include termopts.h.
5749
5750 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5751
5752 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5753
5754 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 * commands.h (immediate_quit): Remove duplicate decl.
5757
5758 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5759
5760 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5761 caching.
5762 (nsfont_open): Remove setting of Vfonts_in_cache.
5763 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5764
5765 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5766
5767 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5768 match what GetLastError returns. Explain why the function is
5769 needed.
5770
5771 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5772 'is_tooltip_frame', to avoid confusion with its global namesake.
5773
5774 2012-10-08 Daniel Colascione <dancol@dancol.org>
5775
5776 * xdisp.c (start_hourglass): Call w32_note_current_window when
5777 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5778 build that caused Emacs to display the hourglass cursor forever.
5779
5780 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5781 which is broken under remote desktop, calculate the number of
5782 colors available for a display based on the display's number of
5783 planes and number of bits per pixel per plane. (bug#10397).
5784
5785 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5786
5787 * nsfont.m (Vfonts_in_cache): New variable.
5788 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5789 are used. Add cached fonts to Vfonts_in_cache.
5790 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5791
5792 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5793
5794 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5795 in nt/config.nt.
5796 (FONT_H): Define after FRAME_H.
5797 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5798 Update dependencies.
5799
5800 * w32term.c: Remove leftover declaration of keyboard_codepage.
5801
5802 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5803
5804 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5805 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5806 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5807 (GLOBAL_SOURCES): Add cygw32.c.
5808 ($(BLD)/unexw32.$(O)):
5809 ($(BLD)/w32.$(O)):
5810 ($(BLD)/w32console.$(O)):
5811 ($(BLD)/w32fns.$(O)):
5812 ($(BLD)/w32heap.$(O)):
5813 ($(BLD)/w32menu.$(O)):
5814 ($(BLD)/w32proc.$(O)): Add w32common.h.
5815
5816 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5817 'const char *'.
5818 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5819
5820 2012-10-08 Daniel Colascione <dancol@dancol.org>
5821
5822 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5823 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5824 accidental message numbering hole. Change other messages to
5825 match.
5826
5827 * w32select.h (HAVE_W32SELECT): Remove.
5828
5829 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5830 w32common.h instead of w32heap.h.
5831
5832 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5833 (get_allocation_unit, get_processor_type, get_w32_major_version)
5834 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5835 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5836 (OS_NT, os_subtype, cache_system_info): Move declarations to
5837 w32common.
5838
5839 * w32heap.c: Include w32common.h.
5840 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5841 (w32_minor_version, w32_build_number, w32_subtype):
5842 Remove duplicate definitions.
5843
5844 * w32fns.c: Include w32common.h; include w32heap.h only in
5845 WINDOWSNT.
5846
5847 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5848 Use `report_file_error' instead of `error' in order to better
5849 inform users of what went wrong. Increase NTGUI_UNICODE file
5850 dialog box file name length to 32k, the maximum allowed by the NT
5851 kernel.
5852
5853 * w32common.h: New file.
5854 (ROUND_UP, ROUND_DOWN, get_page_size)
5855 (get_allocation_unit, get_processor_type, get_w32_major_version)
5856 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5857 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5858 (OS_NT, os_subtype, cache_system_info): Move here.
5859
5860 * unexw32.c, unexcw.c: Include w32common.h.
5861
5862 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5863 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5864 to call syms_of_w32select.
5865
5866 * cygw32.h: Remove obsolete EXFUN declarations.
5867
5868 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5869
5870 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5871 of w32inevt.o from SOME_MACHINE_OBJECTS.
5872
5873 2012-10-08 Daniel Colascione <dancol@dancol.org>
5874
5875 * image.c: Permanent fix for JPEG compilation issue --- limit
5876 jpeglib `boolean' redefinition to Cygwin builds.
5877
5878 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5879
5880 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5881
5882 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5883 Cygwin.
5884
5885 2012-10-08 Daniel Colascione <dancol@dancol.org>
5886
5887 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5888 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5889 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5890 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5891 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5892 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5893 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5894 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5895 now a supported configuration.
5896
5897 * Makefile.in: consolidate image variables into LIBIMAGE; add
5898 W32_OBJ and W32_LIBS. Compile new files.
5899
5900 * conf_post.h:
5901 (_DebPrint) declare tracing facility for W32 debugging. We need
5902 to unify tracing later.
5903
5904 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5905 unconditional use of W32 Unicode functions. Cygwin runs only on
5906 100% Unicode operating systems.
5907
5908 * cygw32.c: New file. Define Cygwin-specific facilities.
5909 (Fcygwin_convert_path_to_windows)
5910 (Fcygwin_convert_path_from_windows): New user functions for
5911 accessing Cygwin path-munging routines.
5912
5913 * cygw32.h: New file.
5914 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5915 UTF-16LE strings temporarily inside non-Lisp-visible string
5916 objects.
5917
5918 (w32_strerror): Just what it says on the tin.
5919
5920 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5921 also run for Cygwin; both systems have the same problem with using
5922 GUI facilities in a forked child. Also call syms_of_cygw32,
5923 syms_of_w32select in correct places.
5924
5925 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5926 needs fork-then-exec for daemon launching.
5927
5928 * font.h: Include frame.h.
5929
5930 * image.c: Use the image library cache machinery only when we're
5931 compiling for native WINDOWSNT; Cygwin can use shared libraries
5932 like any other Unixlike system.
5933
5934 * keyboard.c: Clarify a comment regarding the input loop.
5935
5936 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5937 functions directly instead of trying to detect at runtime that our
5938 host operating system supports them. We make this change for two
5939 reasons: Cygwin lacks support for the multibyte character
5940 conversion functions used by the legacy menu code, and Cygwin
5941 never needs to rely on non-Unicode APIs.
5942
5943 * unexw32.c (hinst): Declare extern.
5944
5945 * w32.c: Change header order;
5946 (w32_strerror): Move to w32fns.c because we need it for
5947 non-WINDOWSNT builds.
5948
5949 * w32.h: Add #error macro to make sure we don't include w32.h for
5950 Cygwin builds. Remove w32select declarations.
5951
5952 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5953 w32fns.c. w32console.c is WINDOWSNT-only.
5954
5955 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5956 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5957 POSIXy alternative.
5958 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5959 (w32_major_version, w32_minor_version, w32_build_number)
5960 (os_subtype, sound_type): Define here
5961 (w32_defined_color): Make color parameter const for consistency
5962 with other _defined_color functions.
5963 (w32_createwindow): Unconditionally call w32_init_class instead of
5964 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5965 through the code is complex and unnecessary because class
5966 registration is practically free.
5967 (w32_name_of_message): New EMACSDEBUG-only function.
5968 (Fset_message_beep): Move here
5969 (Fx_open_connection): Require that the display name for Windows be
5970 "w32" for consistency, emacsclient disambiguation, and maybe, one
5971 day, multi-window-system support.
5972 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5973 Cygwin files for W32 GUI facilities, since these clearly don't
5974 expect Cygwin names.
5975 (_DebPrint): Define.
5976 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5977 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5978 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5979 (w32_last_error): Remove.
5980
5981 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5982
5983 * w32heap.c (syspage_mask): Declare here.
5984 (cache_system_info): Remove.
5985
5986 * w32inevt.c (faked_key): Define globally, not statically.
5987 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5988 (w32_console_toggle_lock_key): Move to w32fns.c.
5989
5990 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5991
5992 * w32proc.c (_DebPrint): Move to w32fns.c.
5993 * w32select.c: Include string.h, stdio.h for Cygwin.
5994 * w32select.h: New File.
5995
5996 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5997 get_osfhandle.
5998 (w32_message_fd): New variable. Under Cygwin, holds the file
5999 descriptor the system used to tell us about pending thread
6000 messages.
6001
6002 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
6003 that prevented compilation under non-WINDOWSNT systems.
6004
6005 (w32_initialize): Open /dev/windows and assign it to
6006 w32_message_fd. Provide w32 feature.
6007
6008 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
6009 (WM_EMACS_INPUT_READY): add.
6010 (prepend_msg, w32_message_fd): Declare globally.
6011
6012 * w32xfns.c:
6013 (keyboard_handle): Use only when WINDOWSNT.
6014 (notify_msg_ready): New function. Posts a message to the main
6015 thread's message queue under CYGWIN, which wakes up the main
6016 thread from select(2) by making the /dev/windows file descriptor
6017 ready. Under WINDOWSNT, it sets an event the same way the old
6018 code did.
6019
6020 (post, prepend_msg): Actually call notify_msg_ready instead of
6021 setting the input event directly.
6022
6023 2012-10-07 Eli Zaretskii <eliz@gnu.org>
6024
6025 * ralloc.c (relinquish): If a heap is ready to be relinquished,
6026 but it still has blocs in it, don't return it to the system,
6027 instead of aborting. (Bug#12402)
6028
6029 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
6030
6031 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
6032
6033 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6034 MAC_OS_X_VERSION_10_6.
6035 (syms_of_nsterm): Remove comment about Panther and above for
6036 ns-antialias-text.
6037 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6038 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6039 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6040
6041 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6042 MAC_OS_X_VERSION_10_4.
6043
6044 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6045 MAC_OS_X_VERSION_10_2.
6046
6047 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6048
6049 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6050 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6051
6052 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6053 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6054 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6055 Remove ns_in_resize check.
6056 (ns_clear_frame_area): Remove resize handle code.
6057
6058 * nsfns.m (ns_in_resize): Remove.
6059 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6060 Remove ns_in_resize check.
6061
6062 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6063
6064 Improve sys_siglist detection.
6065 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6066 defined as a macro, as is done in Solaris.
6067 (sys_siglist_entries): New macro.
6068 (save_strsignal): Use it.
6069 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6070 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6071
6072 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6073
6074 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6075 fullscreen/Fullscreen.
6076
6077 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6078 tobar_height is new.
6079
6080 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6081 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6082 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6083 (windowDidResize:): Check for correct window if old style fullscreen.
6084 Capitalize word in comment. Remove incorrect comment.
6085 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6086 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6087 error in drawing background.
6088 (toggleFullScreen:): Remove comment. Rearrange calls.
6089 Set toolbar values to zero, save old height in tobar_height.
6090 Restore tool bar height when leaving fullscreen.
6091 (canBecomeMainWindow): New function.
6092
6093 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6096
6097 2012-10-05 Eli Zaretskii <eliz@gnu.org>
6098
6099 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6100
6101 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6102 that time stamps of directories could also be changed.
6103 Don't request the too broad GENERIC_WRITE, only the more restrictive
6104 FILE_WRITE_ATTRIBUTES access rights.
6105
6106 * fileio.c (Fset_file_times): Special-case ignoring errors for
6107 directories only on MSDOS, not on MS-Windows.
6108
6109 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6110
6111 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6112
6113 2012-10-04 Eli Zaretskii <eliz@gnu.org>
6114
6115 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6116 see whether CreateFile failed.
6117
6118 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6119
6120 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6121 to avoid similar races.
6122 * keyboard.c (pending_signals): Now bool, not int.
6123
6124 Port timers to OpenBSD, plus check for timer failures.
6125 OpenBSD problem reported by Han Boetes.
6126 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6127 and/or setitimer.
6128 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6129 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6130 like OpenBSD, which has timer_settime but does not declare it.
6131 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6132 whether to use itimerspec-related primitives. All uses of
6133 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6134
6135 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * profiler.c (handle_profiler_signal): Fix a malloc race
6138 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6139
6140 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6141
6142 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6143
6144 2012-10-02 Eli Zaretskii <eliz@gnu.org>
6145
6146 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6147 consistent with the change in return value of 'safe_strsignal'.
6148
6149 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6150
6151 Prefer plain 'static' to 'static inline' (Bug#12541).
6152 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6153 (bidi_set_sor_type, bidi_push_embedding_level)
6154 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6155 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6156 (bidi_cache_search, bidi_cache_ensure_space)
6157 (bidi_cache_iterator_state, bidi_cache_find)
6158 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6159 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6160 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6161 Now 'static', not 'static inline'.
6162
6163 Count overruns when profiling; change units to ns.
6164 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6165 Give extra weight to samples after overruns, to attempt to count
6166 the time more accurately.
6167 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6168 the underlying primitives nominally do ns.
6169 (Fprofiler_cpu_start): Document the change. Mention that
6170 the sampling intervals are only approximate.
6171
6172 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6173
6174 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6175
6176 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6177 case for the special 0 coding-system.
6178
6179 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6180 (Fmake_overlay): Remove redundant tests.
6181 (fix_start_end_in_overlays): Remove redundant recentering.
6182
6183 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
6184
6185 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6186 Update dependencies.
6187
6188 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 Fix a malloc race condition involving strsignal.
6191 A signal can arrive in the middle of a malloc, and Emacs's signal
6192 handler can invoke strsignal, which can invoke malloc, which is
6193 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6194 Fix it by altering the signal handler so that it does not invoke
6195 strsignal.
6196 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6197 * process.c (status_message): Use const pointer, in case strsignal
6198 is #defined to safe_strsignal.
6199 * sysdep.c (sys_siglist, init_signals): Always define and
6200 initialize a substitute sys_siglist if the system does not define
6201 one, even if HAVE_STRSIGNAL.
6202 (safe_strsignal): Rename from strsignal. Always define,
6203 using sys_siglist. Return a const pointer.
6204 * syssignal.h (safe_strsignal): New decl.
6205 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6206
6207 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6208
6209 * w32proc.c (timer_loop): Fix code that waits for timer
6210 expiration, to avoid high CPU usage.
6211
6212 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6213
6214 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6215 (sweep_weak_table): Remove redundant prototypes.
6216
6217 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6218
6219 * emacs.c: Move the inclusion of TERM_HEADER after including
6220 windows.h on WINDOWSNT. This avoids compilation problems with
6221 MSVC.
6222
6223 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6224
6225 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6226 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6227 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6228 as the previous version used 'void *'.
6229
6230 * ralloc.c (ROUNDUP): Fix last change.
6231 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6232 'size_t'.
6233
6234 * w32proc.c <disable_itimers>: New static flag.
6235 (init_timers): Initialize it to zero, after creating the critical
6236 sections used by the timer threads.
6237 (term_timers): Set to 1 before deleting the critical sections.
6238 (getitimer, setitimer): If disable_itimers is non-zero, return an
6239 error indication without doing anything. Reported by Fabrice
6240 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6241 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6242 return results.
6243 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6244 support timers.
6245
6246 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6247 term_ntproc after all the other bookkeeping, to get timers working
6248 as long as possible.
6249
6250 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6253 Suggested by Juri Linkov in
6254 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6255
6256 Prefer plain 'static' to 'static inline' (Bug#12541).
6257 With static functions, modern compilers inline pretty well by
6258 themselves; advice from programmers often hurts as much as it helps.
6259 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6260 this change shrinks the text size of the Emacs executable by 1.1%
6261 without affecting CPU significantly in my benchmark.
6262 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6263 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6264 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6265 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6266 (bset_auto_fill_function, bset_auto_save_file_format)
6267 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6268 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6269 (bset_cache_long_line_scans, bset_case_fold_search)
6270 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6271 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6272 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6273 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6274 (bset_header_line_format, bset_indicate_buffer_boundaries)
6275 (bset_indicate_empty_lines, bset_invisibility_spec)
6276 (bset_left_fringe_width, bset_major_mode, bset_mark)
6277 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6278 (bset_name, bset_overwrite_mode, bset_pt_marker)
6279 (bset_right_fringe_width, bset_save_length)
6280 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6281 (bset_scroll_up_aggressively, bset_selective_display)
6282 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6283 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6284 (set_buffer_overlays_after):
6285 * category.c (bset_category_table):
6286 * charset.c (read_hex):
6287 * coding.c (produce_composition, produce_charset)
6288 (handle_composition_annotation, handle_charset_annotation)
6289 (char_encodable_p):
6290 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6291 (assign_row, set_frame_matrix_frame, make_current)
6292 (add_row_entry):
6293 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6294 * fns.c (maybe_resize_hash_table):
6295 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6296 * gmalloc.c (register_heapinfo):
6297 * image.c (lookup_image_type):
6298 * intervals.c (set_interval_object, set_interval_left)
6299 (set_interval_right, copy_interval_parent, rotate_right)
6300 (rotate_left, balance_possible_root_interval):
6301 * keyboard.c (kset_echo_string, kset_kbd_queue)
6302 (kset_keyboard_translate_table, kset_last_prefix_arg)
6303 (kset_last_repeatable_command, kset_local_function_key_map)
6304 (kset_overriding_terminal_local_map, kset_real_last_command)
6305 (kset_system_key_syms, clear_event, set_prop):
6306 * lread.c (digit_to_number):
6307 * marker.c (attach_marker, live_buffer, set_marker_internal):
6308 * nsterm.m (ns_compute_glyph_string_overhangs):
6309 * process.c (pset_buffer, pset_command)
6310 (pset_decode_coding_system, pset_decoding_buf)
6311 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6312 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6313 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6314 * syntax.c (bset_syntax_table, dec_bytepos):
6315 * terminal.c (tset_param_alist):
6316 * textprop.c (interval_has_some_properties)
6317 (interval_has_some_properties_list):
6318 * window.c (wset_combination_limit, wset_dedicated)
6319 (wset_display_table, wset_hchild, wset_left_fringe_width)
6320 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6321 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6322 (wset_right_fringe_width, wset_right_margin_cols)
6323 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6324 (wset_vertical_scroll_bar_type, wset_window_parameters):
6325 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6326 (wset_column_number_displayed, wset_region_showing)
6327 (window_box_edges, run_window_scroll_functions)
6328 (append_glyph_string_lists, prepend_glyph_string_lists)
6329 (append_glyph_string, set_glyph_string_background_width)
6330 (append_glyph, append_composite_glyph)
6331 (take_vertical_position_into_account):
6332 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6333 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6334 (lface_hash, lface_same_font_attributes_p, lookup_face):
6335 * xml.c (libxml2_loaded_p):
6336 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6337 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6338 Now 'static', not 'static inline'.
6339
6340 * bidi.c: Tune.
6341 (bidi_copy_it): Do the whole copy with a single memcpy.
6342 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6343
6344 Revert the FOLLOW-SYMLINKS change for file-attributes.
6345 Doing it right would require several changes to Tramp, and there's
6346 not enough time to get that tested before the freeze today.
6347 * dired.c (directory_files_internal, Ffile_attributes):
6348 Undo last change.
6349
6350 * frame.c (x_report_frame_params): Port better to wider ints.
6351 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6352 or that pointers can be printed in 15 decimal digits.
6353 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6354
6355 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6356
6357 Support x64 build on MS-Windows.
6358 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6359 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6360 compatibility with x64.
6361 (x_get_focus_frame): Add prototype.
6362
6363 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6364 defining an XRectangle structure.
6365
6366 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6367 arithmetics for compatibility with x64.
6368
6369 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6370 compatibility with x64.
6371
6372 * w32heap.h: Adjust prototypes and declarations.
6373
6374 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6375 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6376 DWORD, long, and unsigned long, for compatibility with x64.
6377 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6378 (sbrk): Argument is now of type ptrdiff_t.
6379
6380 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6381 less than 0x0500.
6382 (w32_msg_pump): Use WPARAM type for 'result'.
6383
6384 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6385 architecture.
6386 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6387 compatibility with x64.
6388
6389 * vm-limit.c (lim_data): Now size_t.
6390 (check_memory_limits): Adjust prototypes of real_morecore and
6391 __morecore to receive argument of type ptrdiff_t. Use size_t for
6392 five_percent and data_size.
6393
6394 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6395 variables, for compatibility with x64.
6396 (rva_to_section, offset_to_section, relocate_offset)
6397 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6398 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6399 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6400 for compatibility with x64.
6401
6402 * sysdep.c (STDERR_FILENO): Define if not already defined.
6403
6404 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6405 (__morecore): Argument type is now ptrdiff_t.
6406 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6407 (relinquish): Use ptrdiff_t type for 'excess'.
6408 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6409
6410 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6411 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6412 instead of a literal number.
6413
6414 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6415 (min): Define only if not already defined.
6416
6417 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6418 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6419 hosts.
6420
6421 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6422 'bitmaps' is a pointer.
6423
6424 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6425
6426 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6427
6428 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6429
6430 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6431 * dired.c (directory_files_internal, Ffile_attributes):
6432 New arg follow_symlinks. All uses changed.
6433
6434 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6435
6436 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6437
6438 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6439
6440 Support atimers and CPU profiler via profile.c on MS-Windows.
6441 * w32proc.c (sig_mask, crit_sig): New static variables.
6442 (sys_signal): Support SIGALRM and SIGPROF.
6443 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6444 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6445 sigfillset, and sigprocmask are no longer no-ops.
6446 (sigismember): New function.
6447 (struct itimer_data): New definition.
6448 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6449 (crit_prof): New static variables.
6450 (MAX_SINGLE_SLEEP): New definition.
6451 (timer_loop, stop_timer_thread, term_timers, init_timers)
6452 (start_timer_thread, getitimer, setitimer): New functions.
6453 (alarm): No longer a no-op, calls setitimer.
6454
6455 * w32.c (term_ntproc): Call term_timers.
6456 (init_ntproc): Make sure all signals are unblocked at startup, to
6457 erase any traces of dumping. Call init_timers.
6458
6459 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6460 Windows-specific code to display the hourglass mouse pointer is no
6461 longer used.
6462 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6463 to hourglass timer expiration.
6464 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6465 Remove, no longer used.
6466 (w32_note_current_window, show_hourglass, hide_hourglass):
6467 New functions, in support of hourglass cursor display similar to other
6468 window systems.
6469 (syms_of_w32fns): Don't initialize hourglass_timer.
6470
6471 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6472 WINDOWSNT as well.
6473 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6474
6475 * w32.h (init_timers, term_timers): Add prototypes.
6476
6477 2012-09-30 Kenichi Handa <handa@gnu.org>
6478
6479 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6480 to the buffer relocation which may be caused by ccl_driver.
6481
6482 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6483
6484 * xfns.c (Fx_file_dialog): Update comment.
6485
6486 * w32fns.c (Fx_file_dialog): Update comment.
6487
6488 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6489 Initialize panel name field if OSX >= 10.6.
6490
6491 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6492
6493 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6494
6495 * nsterm.m (NEW_STYLE_FS): New define.
6496 (ns_fullscreen_hook, windowWillEnterFullScreen)
6497 (windowDidEnterFullScreen, windowWillExitFullScreen)
6498 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6499 (setFSValue): New functions.
6500 (EmacsFSWindow): New implementation.
6501 (canBecomeKeyWindow): New function for EmacsFSWindow.
6502 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6503 (dealloc): Release nonfs_window if in fullscreen.
6504 (updateFrameSize:): Call windowDidMove to update top/left.
6505 (windowWillResize:toSize:): Check if frame is still maximized.
6506 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6507 next_maximized, maximized_width, maximized_height and nonfs_window.
6508 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6509 tbar_height.
6510 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6511 fullscreen. Set maximized_width/height. Act on next_maximized.
6512
6513 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6514 (EmacsView): Add variables for fullscreen.
6515 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6516 (EmacsFSWindow): New interface for fullscreen.
6517
6518 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6519
6520 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6521
6522 2012-09-30 Chong Yidong <cyd@gnu.org>
6523
6524 * fns.c (Frandom): Doc fix.
6525
6526 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6527
6528 * window.c (Vwindow_combination_limit): New default value.
6529 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6530
6531 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6532
6533 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6534 Suggested by Eli Zaretskii in
6535 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6536
6537 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6538
6539 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6540 HAVE_TIMER_SETTIME is defined.
6541
6542 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 Profiler improvements: more-accurate timers, overflow checks.
6545 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6546 signal.h, setjmp.h. Include systime.h instead.
6547 (saturated_add): New function.
6548 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6549 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6550 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6551 New static vars.
6552 (enum profiler_cpu_running): New enum.
6553 (profiler_cpu_running): Now of that enum type, not bool.
6554 All uses changed to store the new value.
6555 (handle_profiler_signal): Rename from sigprof_handler_1,
6556 for consistency with other handlers. Do not check whether
6557 cpu_log is a hash-table if garbage collecting, since it
6558 doesn't matter in that case.
6559 (deliver_profiler_signal): Rename from sigprof_handler,
6560 for consistency with other handlers.
6561 (setup_cpu_timer): New function, with much of what used to be in
6562 Fprofiler_cpu_start. Check for out-of-range argument.
6563 Prefer timer_settime if available, and prefer
6564 thread cputime clocks, then process cputime clocks, then
6565 monotonic clocks, to the old realtime clock. Use make_timeval
6566 to round more-correctly when falling back to setitimer.
6567 (Fprofiler_cpu_start): Use it.
6568 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6569 Don't assume that passing NULL as the 2nd argument of setitimer
6570 is the same as passing a pointer to all-zero storage.
6571 Ignore SIGPROF afterwards.
6572 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6573 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6574 non-fatal signal handlers. Ignore SIGPROF on startup.
6575 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6576 in profiler.c, since sysdep.c now uses it.
6577
6578 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6579 Suggested by Eli Zaretskii in
6580 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6581
6582 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6583
6584 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6585
6586 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6587
6588 * lisp.h (struct backtrace): Remove indirection for `function' field.
6589 * xdisp.c (redisplay_internal):
6590 * profiler.c (record_backtrace, sigprof_handler_1):
6591 * alloc.c (Fgarbage_collect):
6592 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6593 (Fbacktrace_frame): Adjust accordingly.
6594
6595 2012-09-28 Glenn Morris <rgm@gnu.org>
6596
6597 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6598 (Frun_hook_with_args_until_failure): Doc fixes.
6599
6600 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6601
6602 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6603 Qautomatic_redisplay and change the symbol name. All users changed.
6604
6605 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6606
6607 * profiler.c (sigprof_handler): Fix race condition.
6608
6609 2012-09-28 Glenn Morris <rgm@gnu.org>
6610
6611 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6612
6613 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 Check more robustly for timer_settime.
6616 * Makefile.in (LIB_TIMER_TIME): New macro.
6617 (LIBES): Add it.
6618 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6619 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6620 call timer_settime.
6621
6622 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6623
6624 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6625
6626 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6627
6628 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6629
6630 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 * character.h (MAYBE_UNIFY_CHAR): Remove.
6633 * charset.c, charset.h (maybe_unify_char): Now static.
6634 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6635 Since this stuff is now private to charset.c, there's no need for
6636 a public macro and no need to inline by hand.
6637
6638 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6639 Stefan Monnier <monnier@iro.umontreal.ca>
6640 Juanma Barranquero <lekktu@gmail.com>
6641
6642 * profiler.c: New file.
6643 * Makefile.in (base_obj): Add profiler.o.
6644 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6645 ($(BLD)/profiler.$(O)): New target.
6646 * emacs.c (main): Call syms_of_profiler.
6647 * alloc.c (Qautomatic_gc): New constant.
6648 (MALLOC_PROBE): New macro.
6649 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6650 (total_bytes_of_live_objects): New function.
6651 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6652 Call malloc_probe for the memory profiler.
6653 (syms_of_alloc): Define Qautomatic_gc.
6654 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6655 race condition.
6656 (struct backtrace): Move definition...
6657 * lisp.h (struct backtrace): ..here.
6658 (Qautomatic_gc, profiler_memory_running): Declare vars.
6659 (malloc_probe, syms_of_profiler): Declare functions.
6660 * xdisp.c (Qautomatic_redisplay): New constant.
6661 (redisplay_internal): Record itself in backtrace_list.
6662 (syms_of_xdisp): Define Qautomatic_redisplay.
6663
6664 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6665 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6666
6667 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6668
6669 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 Prefer POSIX timers if available.
6672 They avoid a race if the timer is too close to the current time.
6673 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6674 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6675 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6676
6677 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6678
6679 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6680 CHAR_STRING_ADVANCE.
6681 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6682 STRING_CHAR_ADVANCE.
6683
6684 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6685
6686 Move Vlibrary_cache to emacs.c and reset before dumping.
6687
6688 * lisp.h (reset_image_types): Declare.
6689 [WINDOWSNT] (Vlibrary_cache): Declare.
6690
6691 * image.c (reset_image_types): New function.
6692
6693 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6694 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6695 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6696
6697 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6698 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6699
6700 * w32.h (Vlibrary_cache): Do not declare.
6701
6702 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6703
6704 * w32proc.c (sys_signal): Handle all signals defined by the
6705 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6706 handlers for signals supported by Windows. Don't override
6707 term_ntproc as the handler for SIGABRT.
6708 (sigaction): Rewrite to call sys_signal instead of duplicating its
6709 code.
6710 (sys_kill): Improve commentary.
6711
6712 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6713 consistency with a signature of a signal handler. All callers
6714 changed.
6715 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6716 install term_ntproc as a signal handler for SIGABRT, as that
6717 should be done by the dumped Emacs.
6718
6719 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6720
6721 * w32select.c (term_w32select): Protect against repeated
6722 invocation by setting clipboard_owner to NULL after calling
6723 DestroyWindow.
6724
6725 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6726 and term_ntproc to their modified signatures.
6727
6728 * character.c (char_string, string_char): Remove calls to
6729 MAYBE_UNIFY_CHAR. See the discussion starting at
6730 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6731 for the details.
6732
6733 2012-09-25 Chong Yidong <cyd@gnu.org>
6734
6735 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6736
6737 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6738
6739 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6740 when encountering an unknown bytecode.
6741
6742 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6743
6744 image.c, indent.c: Use bool for booleans.
6745 * dispextern.h (struct image_type): Members valid_p, load, init
6746 now return bool, not int. All uses changed.
6747 * image.c: Omit unnecessary static decls.
6748 (x_create_bitmap_mask, x_build_heuristic_mask):
6749 Return void, not int, since callers don't care about the return value.
6750 (x_create_bitmap_mask, define_image_type, valid_image_p)
6751 (struct image_keyword, parse_image_spec, image_spec_value)
6752 (check_image_size, image_background)
6753 (image_background_transparent, x_clear_image_1)
6754 (postprocess_image, lookup_image, x_check_image_size)
6755 (x_create_x_image_and_pixmap, xbm_image_p)
6756 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6757 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6758 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6759 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6760 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6761 (png_image_p, init_png_functions, png_load_body, png_load)
6762 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6763 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6764 (init_gif_functions, gif_load, imagemagick_image_p)
6765 (imagemagick_load_image, imagemagick_load, svg_image_p)
6766 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6767 (gs_load):
6768 * nsimage.m (ns_load_image):
6769 * nsterm.m (ns_defined_color):
6770 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6771 * xfns.c (x_defined_color):
6772 * xterm.c (x_alloc_lighter_color_for_widget)
6773 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6774 (x_alloc_lighter_color):
6775 * indent.c (disptab_matches_widthtab, current_column)
6776 (scan_for_column, string_display_width, indented_beyond_p)
6777 (compute_motion, vmotion, Fvertical_motion):
6778 Use bool for booleans.
6779
6780 2012-09-24 Chong Yidong <cyd@gnu.org>
6781
6782 * chartab.c (Fset_char_table_default): Obsolete function removed.
6783
6784 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 Move pid_t related decls out of lisp.h.
6787 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6788 (interruptible_wait_for_termination):
6789 Move these decls from lisp.h to syswait.h, since they use pid_t.
6790 Needed on FreeBSD; see Herbert J. Skuhra in
6791 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6792 * callproc.c: Include syswait.h.
6793
6794 gnutls.c, gtkutil.c: Use bool for boolean.
6795 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6796 (emacs_gnutls_handle_error):
6797 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6798 (xg_hide_tooltip, xg_create_frame_widgets)
6799 (create_dialog, xg_uses_old_file_dialog)
6800 (xg_get_file_with_chooser, xg_get_file_with_selection)
6801 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6802 (xg_item_label_same_p, xg_update_menubar)
6803 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6804 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6805 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6806 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6807 (update_frame_tool_bar, free_frame_tool_bar):
6808 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6809 * nsmenu.m (ns_update_menubar):
6810 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6811 * xfns.c (Fx_show_tip) [USE_GTK]:
6812 Use bool for boolean.
6813 * gtkutil.c (xg_update_frame_menubar):
6814 * xmenu.c (update_frame_menubar):
6815 Return void, not int, since caller ignores return value.
6816 * gtkutil.c (xg_change_toolbar_position):
6817 Return void, not 1.
6818
6819 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6820
6821 * makefile.w32-in (BLOCKINPUT_H): Remove.
6822 (SYSSIGNAL_H): New macro.
6823 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6824 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6825 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6826 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6827 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6828 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6829 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6830 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6831 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6832 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6833 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6834 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6835 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6836 ($(BLD)/w32xfns.$(O)): Update dependencies.
6837
6838 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6839
6840 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6841 fatal_error_backtrace.
6842
6843 * w32proc.c (sys_kill): Undo last change: don't do anything when
6844 invoked to deliver SIGABRT to our own process. This is now
6845 handled by emacs_raise.
6846
6847 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6848
6849 * w32term.c (w32_read_socket): Remove leftover reference to
6850 interrupt_input_pending.
6851
6852 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 Do not use SA_NODEFER.
6855 Problem reported by Dani Moncayo in
6856 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6857 * alloc.c (die):
6858 * sysdep.c (emacs_abort): Do not reset signal handler.
6859 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6860 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6861 wanted even on POSIXish hosts, and it doesn't work on Windows.
6862
6863 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6864
6865 * xterm.c (x_term_init): Call fixup_locale before and after calling
6866 gtk_init (Bug#12392).
6867
6868 2012-09-23 Chong Yidong <cyd@gnu.org>
6869
6870 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6871 Vdynamic_library_alist.
6872
6873 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6874 (Fgnutls_available_p): Caller changed.
6875
6876 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6877 (Flibxml_parse_xml_region): Likewise.
6878
6879 * dispextern.h (struct image_type): Remove arg from init function.
6880
6881 * image.c (Finit_image_library, lookup_image_type)
6882 (define_image_type): Remove now-unneeded second arg.
6883 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6884 (init_tiff_functions, init_gif_functions, init_svg_functions):
6885 Arglist and w32_delayed_load calling convention changed.
6886 (gs_type): Remove init_gs_functions; there is no such function.
6887 (valid_image_p, make_image): Fix caller to lookup_image_type.
6888
6889 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6890
6891 Simplify and avoid signal-handling races (Bug#12471).
6892 * alloc.c (die):
6893 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6894 Avoid recursive loop if there's a fatal error in the function itself.
6895 * atimer.c (pending_atimers):
6896 * blockinput.h: Don't include "atimer.h"; no longer needed.
6897 (interrupt_input_pending): Remove. All uses removed.
6898 pending_signals now counts both atimers and ordinary interrupts.
6899 This is less racy than having three separate pending-signal flags.
6900 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6901 (input_blocked_p):
6902 Rename from their upper-case counterparts BLOCK_INPUT,
6903 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6904 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6905 This makes it easier to access volatile variables more accurately.
6906 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6907 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6908 that's more reliable if the code is buggy and sets
6909 interrupt_input_blocked to a negative value. All uses changed.
6910 * atimer.c (deliver_alarm_signal):
6911 Remove. No need to deliver this to the parent; any thread can
6912 handle this signal now. All uses replaced by underlying handler.
6913 * atimer.c (turn_on_atimers):
6914 * dispnew.c (handle_window_change_signal):
6915 * emacs.c (handle_danger_signal):
6916 * keyboard.c (kbd_buffer_get_event):
6917 Don't reestablish signal handler; not needed with sigaction.
6918 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6919 (UNBLOCK_INPUT_TO):
6920 Rework to avoid unnecessary accesses to volatile variables.
6921 (UNBLOCK_INPUT_TO): Now a function.
6922 (totally_unblock_input, unblock_input): New decls.
6923 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6924 (init_data): Remove. Necessary stuff now done in init_signal.
6925 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6926 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6927 (fatal_error_code): Remove; no longer needed.
6928 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6929 it doesn't always backtrace. All uses changed. No need to reset
6930 signal to default, since sigaction and/or die does that for us now.
6931 Use emacs_raise (FOO), not kill (getpid (), FOO).
6932 (main): Check more-accurately whether we're dumping.
6933 Move fatal-error setup to sysdep.c
6934 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6935 * gtkutil.c (xg_get_file_name, xg_get_font):
6936 Remove no-longer-needed signal-mask manipulation.
6937 * keyboard.c, process.c (POLL_FOR_INPUT):
6938 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6939 * keyboard.c (read_avail_input): Remove.
6940 All uses replaced by gobble_input.
6941 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6942 (kbd_buffer_store_event_hold, gobble_input):
6943 (record_asynch_buffer_change) [USABLE_SIGIO]:
6944 (store_user_signal_events):
6945 No need to mess with signal mask.
6946 (gobble_input): If blocking input and there are terminals, simply
6947 set pending_signals to 1 and return. All hooks changed to not
6948 worry about whether input is blocked.
6949 (process_pending_signals): Clear pending_signals before processing
6950 them, in case a signal comes in while we're processing.
6951 By convention callers now test pending_signals before calling us.
6952 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6953 New functions, to support changes to blockinput.h.
6954 (handle_input_available_signal): Now extern.
6955 (reinvoke_input_signal): Remove. All uses replaced by
6956 handle_async_input.
6957 (quit_count): Now volatile, since a signal handler uses it.
6958 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6959 All callers changed. Block SIGINT only if not already blocked.
6960 Clear sigmask reliably, even if Fsignal returns, which it can.
6961 Omit unnecessary accesses to volatile var.
6962 (quit_throw_to_read_char): No need to restore sigmask.
6963 * keyboard.c (gobble_input, handle_user_signal):
6964 * process.c (wait_reading_process_output):
6965 Call signal-handling code rather than killing ourselves.
6966 * lisp.h: Include <float.h>, for...
6967 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6968 (pending_signals): Now volatile.
6969 (syms_of_data): Now const if IEEE floating point.
6970 (handle_input_available_signal) [USABLE_SIGIO]:
6971 (terminate_due_to_signal, record_child_status_change): New decls.
6972 * process.c (create_process): Avoid disaster if memory is exhausted
6973 while we're processing a vfork, by tightening the critical section
6974 around the vfork.
6975 (send_process_frame, process_sent_to, handle_pipe_signal)
6976 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6977 ignores SIGPIPE.
6978 (send_process): No need for setjmp/longjmp any more, since the
6979 SIGPIPE stuff is now gone. Instead, report an error if errno
6980 is EPIPE.
6981 (record_child_status_change): Now extern. PID and W are now args.
6982 Return void, not bool. All callers changed.
6983 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6984 Remove. All uses removed. This bug should be fixed now in a
6985 different way.
6986 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6987 and record the child status change directly. This avoids the
6988 need to futz with the signal mask.
6989 (process_fatal_action): Move here from emacs.c.
6990 (emacs_sigaction_flags): New function, containing
6991 much of what used to be in emacs_sigaction_init.
6992 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6993 caught by emacs, to make races less likely.
6994 (deliver_process_signal): Rename from handle_on_main_thread.
6995 All uses changed.
6996 (BACKTRACE_LIMIT_MAX): Now at top level.
6997 (thread_backtrace_buffer, threadback_backtrace_pointers):
6998 New static vars.
6999 (deliver_thread_signal, deliver_fatal_thread_signal):
7000 New functions, for more-accurate delivery of thread-specific signals.
7001 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
7002 (deliver_arith_signal): Handle in this thread, not
7003 in the main thread, since it's triggered by this thread.
7004 (maybe_fatal_sig): New function.
7005 (init_signals): New arg DUMPING so that we can be more accurate
7006 about whether we're dumping. Caller changed.
7007 Treat thread-specific signals differently from process-general signals.
7008 Block all signals while handling fatal error; that's safer.
7009 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
7010 on IEEE hosts.
7011 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
7012 Ignore SIGPIPE unless batch.
7013 (emacs_backtrace): Output backtrace for the appropriate thread,
7014 which is not necessarily the main thread.
7015 * syssignal.h: Include <stdbool.h>.
7016 (emacs_raise): New macro.
7017 * xterm.c (x_connection_signal): Remove; no longer needed
7018 now that we use sigaction.
7019 (x_connection_closed): No need to mess with sigmask now.
7020 (x_initialize): No need to reset SIGPIPE handler here, since
7021 init_signals does this for us now.
7022
7023 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7024
7025 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
7026 background rect may be larger (Bug#12245).
7027
7028 2012-09-23 Chong Yidong <cyd@gnu.org>
7029
7030 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
7031
7032 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 * .gdbinit: Just stop at fatal_error_backtrace.
7035 See Stefan Monnier's request in
7036 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7037 Remove no-longer-used query of system type.
7038
7039 2012-09-22 Chong Yidong <cyd@gnu.org>
7040
7041 * search.c (Freplace_match): Doc fix (Bug#12325).
7042
7043 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7044
7045 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7046 (Fline_end_position): Doc fix.
7047
7048 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7049
7050 2012-09-22 Chong Yidong <cyd@gnu.org>
7051
7052 * dispextern.h (struct image_type): Add new slot, storing a type
7053 initialization function.
7054
7055 * image.c (define_image_type): Call the image initializer function
7056 if it is defined. Arguments and return value changed.
7057 (valid_image_p, make_image): Callers changed.
7058 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7059 (gif_type, imagemagick_type, svg_type, gs_type):
7060 Add initialization functions.
7061 (Finit_image_library): Call lookup_image_type.
7062 (CHECK_LIB_AVAILABLE): Macro deleted.
7063 (lookup_image_type): Call define_image_type here, rather than via
7064 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7065 (syms_of_image): Move define_image_type calls for xbm_type and
7066 pbm_type to lookup_image_type.
7067
7068 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7069
7070 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7071 'idle_timers' from here ...
7072 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7073 lists, to avoid infloops when the timer does something stupid,
7074 like reinvoke itself with the same or smaller time-out.
7075 (Bug#12447)
7076
7077 2012-09-22 Martin Rudalics <rudalics@gmx.at>
7078
7079 * window.c (Fsplit_window_internal): Handle only Qt value of
7080 Vwindow_combination_limit separately.
7081 (Qtemp_buffer_resize): New symbol.
7082 (Vwindow_combination_limit): New default value.
7083 Rewrite doc-string.
7084
7085 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7086
7087 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7088 the new overlay string. (Bug#10159)
7089
7090 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7091
7092 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7093 or that fprintf is async-signal-safe. POSIX doesn't require
7094 either assumption.
7095
7096 2012-09-22 Chong Yidong <cyd@gnu.org>
7097
7098 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7099 (Bug#8207).
7100
7101 2012-09-22 Kenichi Handa <handa@gnu.org>
7102
7103 * composite.c (composition_reseat_it): Handle the case that a
7104 grapheme cluster is not covered by a single font (Bug#12352).
7105
7106 2012-09-21 Chong Yidong <cyd@gnu.org>
7107
7108 * image.c (define_image_type): Avoid adding duplicate types to
7109 image_types (Bug#12463). Suggested by Jörg Walter.
7110
7111 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7112
7113 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7114 (print_load_command_name): Add case LC_DATA_IN_CODE.
7115 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7116
7117 2012-09-21 Glenn Morris <rgm@gnu.org>
7118
7119 * eval.c (Frun_hook_with_args_until_success)
7120 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7121
7122 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7123
7124 * fileio.c (Ffile_selinux_context): Only call freecon when
7125 lgetfilecon succeeded.
7126 (Fset_file_selinux_context): Likewise. (Bug#12444)
7127
7128 2012-09-21 Eli Zaretskii <eliz@gnu.org>
7129
7130 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7131 reordering, locate the cursor by calling set_cursor_from_row; if
7132 that fails, clear the desired glyph matrix before returning a
7133 failure indication to the caller. Fixes leaving garbled display
7134 when fast scrolling with a down-key. (Bug#12403)
7135 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7136 scrolling through multibyte text.
7137
7138 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7139
7140 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7141 calling mark_vectorlike since that's the one that marks the window.
7142 (mark_discard_killed_buffers): Mark the final cdr.
7143 * window.h (struct window): Move prev/next_buffers to the
7144 non-standard fields.
7145 * window.c (make_window): Initialize prev/next_buffers manually.
7146
7147 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 Omit unused arg EXPECTED from socket hooks.
7150 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7151 * nsterm.m (ns_term_init):
7152 * termhooks.h (struct terminal.read_socket_hook):
7153 * w32inevt.c (w32_console_read_socket):
7154 * w32term.c (w32_read_socket):
7155 * xterm.c (XTread_socket):
7156 Omit unused arg EXPECTED. All callers changed.
7157 (store_user_signal_events): Return void, not int, since callers no
7158 longer care about the return value. All uses changed.
7159
7160 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
7161
7162 * w32gui.h (XParseGeometry): Do not declare.
7163
7164 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7167 Ignore 'expected'. See Eli Zaretskii in
7168 <http://bugs.gnu.org/12471#8> (last line).
7169
7170 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7171 (XParseGeometry): Now static. Substitute extremal values for
7172 values that are out of range.
7173
7174 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7175
7176 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7177
7178 * nsfns.m (XParseGeometry): Remove.
7179 (Fx_create_frame): Call x_set_offset to correctly interpret
7180 top_pos in geometry.
7181
7182 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7183 (Fx_parse_geometry): If there is a space in string, call
7184 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7185
7186 2012-09-17 Eli Zaretskii <eliz@gnu.org>
7187
7188 * search.c (scan_buffer): Use character positions in calls to
7189 region_cache_forward and region_cache_backward, not byte
7190 positions. (Bug#12196)
7191
7192 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7193 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7194
7195 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7196 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7197 emacs_blocked_malloc, now deleted.
7198
7199 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7200
7201 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7202 The workaround was for improving performance on Solaris 2.4, but
7203 is getting in the way now. Emacs will still work if someone is
7204 still running Solaris 2.4 in a museum somewhere; Sun dropped
7205 support for Solaris 2.4 in 2003.
7206 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7207 * process.c (create_process) [HAVE_WORKING_VFORK]:
7208 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7209 since Emacs no longer uses vfork on that platform.
7210
7211 2012-09-17 Glenn Morris <rgm@gnu.org>
7212
7213 * emacs.c: Use COPYRIGHT.
7214
7215 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7216
7217 Remove configure's --without-sync-input option (Bug#12450).
7218 When auditing signal-handling in preparation for cleaning it up,
7219 I found that SYNC_INPUT has race conditions and would be a real
7220 pain to fix. Since it's an undocumented and deprecated
7221 configure-time option, now seems like a good time to remove it.
7222 Also see <http://bugs.gnu.org/11080#16>.
7223 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7224 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7225 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7226 (malloc_hysteresis):
7227 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7228 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7229 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7230 (dont_register_blocks, bytes_used_when_reconsidered)
7231 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7232 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7233 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7234 Remove. All uses removed.
7235 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7236 implementation, one that depends on whether the new macro
7237 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7238 is defined.
7239 * atimer.c (run_timers, handle_alarm_signal):
7240 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7241 (handle_async_input, process_pending_signals)
7242 (handle_input_available_signal, init_keyboard):
7243 * nsterm.m (ns_read_socket):
7244 * process.c (wait_reading_process_output):
7245 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7246 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7247 (emacs_write):
7248 * xterm.c (XTread_socket):
7249 Assume SYNC_INPUT.
7250 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7251 * eval.c (handling_signal): Remove. All uses removed.
7252 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7253 All uses replaced with the SYNC_INPUT version.
7254 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7255 Remove decls.
7256 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7257 Now static.
7258
7259 * font.c (Ffont_shape_gstring): Remove unused local.
7260
7261 2012-09-16 Glenn Morris <rgm@gnu.org>
7262
7263 * Makefile.in (clean): No longer run nextstep's clean.
7264
7265 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7266 (ns_frag): Remove.
7267 (ns-app): Move here from ns.mk, and simplify.
7268 (clean): Simplify nextstep entry.
7269 * ns.mk: Remove file.
7270
7271 2012-09-17 Kenichi Handa <handa@gnu.org>
7272
7273 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7274 not covert the last few charactes.
7275
7276 2012-09-16 Kenichi Handa <handa@gnu.org>
7277
7278 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7279 here, but just check the validity of glyphs in the glyph-string.
7280
7281 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7282
7283 * window.c (Fwindow_parameter, Fset_window_parameter):
7284 Accept any window as argument (Bug#12452).
7285
7286 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7287
7288 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7289 to ns_term_init to avoid memory leak.
7290
7291 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7292 explicit retain/release.
7293 (ns_term_init): Only allow one display. Initialize outerpool and
7294 ns_*_types.
7295
7296 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7297
7298 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7299 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7300 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7301 the Microsoft problem in a different way, by altering ../nt/config.nt.
7302
7303 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7304
7305 * w32xfns.c:
7306 * w32uniscribe.c:
7307 * w32term.c:
7308 * w32select.c:
7309 * w32reg.c:
7310 * w32proc.c:
7311 * w32menu.c:
7312 * w32inevt.c:
7313 * w32heap.c:
7314 * w32font.c:
7315 * w32fns.c:
7316 * w32console.c:
7317 * w32.c:
7318 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7319 by lisp.h. This completes removal of setjmp.h inclusion
7320 erroneously announced in the previous commit. (Bug#12446)
7321
7322 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7323 more accurate.
7324
7325 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7326 not defined as a macro. The latter happens on MS-Windows.
7327 (Bug#12446)
7328
7329 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7332 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7333 Some instances of '#include <setjmp.h>' removed, if the
7334 only reason for the instance was because "lisp.h" was included.
7335 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7336 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7337 and _longjmp with the new symbols. Emacs already uses _setjmp if
7338 available, so this change affects only POSIXish hosts that have
7339 sigsetjmp but not _setjmp, such as some versions of Solaris and
7340 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7341 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7342 (png_load_body) [HAVE_PNG]:
7343 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7344 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7345 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7346 since PNG requires jmp_buf. This is the only exception to the
7347 general rule that we now use sys_setjmp and sys_longjmp.
7348 This exception is OK since this code does not change the signal
7349 mask or longjmp out of a signal handler.
7350
7351 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7352
7353 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7354 Include "syssignal.h", for 'main_thread'.
7355
7356 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7357
7358 Avoid out-of-range marker position (Bug#12426).
7359 * insdel.c (replace_range, replace_range_2):
7360 Adjust markers before overlays, as suggested by comments.
7361 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7362 Remove redundant check before calling offset_intervals.
7363
7364 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7365
7366 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7367 current buffer (Bug#12387).
7368
7369 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7370
7371 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7372
7373 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 Use a more backwards-compatible timer format (Bug#12430).
7376 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7377 vector element, not from the 4th, since PSECS is now at the end.
7378 (Fcurrent_idle_time): Doc fix.
7379
7380 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7381
7382 Function to mark objects and remove killed buffers at once.
7383 * alloc.c (discard_killed_buffers): Rename to ...
7384 (mark_discard_killed buffers) ... new name. Add marking
7385 of remaining objects. Fix comment. Adjust users.
7386 (mark_object): Do not touch frame buffer lists here.
7387 * frame.c (delete_frame): Reset frame buffer lists here.
7388
7389 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 Better workaround for GNOME bug when --enable-gcc-warnings.
7392 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7393 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7394 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7395
7396 Simplify SIGIO usage (Bug#12408).
7397 The code that dealt with SIGIO was crufty and confusing, e.g., it
7398 played tricks like "#undef SIGIO" but these tricks were not used
7399 consistently. Simplify mostly by not #undeffing standard symbols,
7400 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7401 or not as we please) rather than "defined SIGIO" (standard symbol
7402 that we probably shouldn't #undef).
7403 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7404 Modules that need it can include it.
7405 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7406 * dispextern.h (ignore_sigio): New decl.
7407 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7408 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7409 * emacs.c (shut_down_emacs):
7410 * keyboard.c (kbd_buffer_store_event_hold):
7411 Use ignore_sigio rather than invoking 'signal' directly.
7412 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7413 for FIONREAD.
7414 (FIONREAD, SIGIO): Do not #undef.
7415 (tty_read_avail_input): Use #error rather than a syntax error.
7416 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7417 for I_PIPE, used by SETUP_SLAVE_PTY.
7418 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7419 * sysdep.c (croak): Remove; no longer needed. This bit of
7420 temporary code, with Fred N. Fish's comment that it's temporary,
7421 has been in Emacs since at least 1992!
7422 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7423 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7424 * syssignal.h (croak): Remove decl.
7425 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7426 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7427 now that we're termios-only.
7428 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7429 * term.c (dissociate_if_controlling_tty): Use #error rather than
7430 a run-time error.
7431
7432 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7433 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7434 to work around GNOME bug 683906.
7435 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7436 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7437 This works around GCC bug 54561.
7438
7439 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7440
7441 More fixes for 'volatile' and setjmp/longjmp.
7442 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7443 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7444 (png_load_body) [HAVE_PNG]:
7445 (jpeg_load_body) [HAVE_JPEG]:
7446 New function, with most of the old parent function's body.
7447 (png_load) [HAVE_PNG]:
7448 (jpeg_load) [HAVE_JPEG]:
7449 Invoke the new function, to avoid longjmp munging our locals.
7450 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7451 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7452 longjmp is passed 2, as the C standard doesn't guarantee this.
7453 Instead, store the failure code into mgr->failure_code.
7454
7455 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7456
7457 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7458 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7459 (syms_of_keyboard): Remove support for unread-command-char.
7460
7461 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7462
7463 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7464 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7465 violation. (Bug#12426)
7466
7467 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7468
7469 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7470
7471 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7472
7473 * eval.c: Add `inhibit-debugger'.
7474 (Qinhibit_debugger): New symbol.
7475 (call_debugger): Bind it instead of Qdebug_on_error.
7476 (maybe_call_debugger): Test Vinhibit_debugger.
7477 (syms_of_eval): Define inhibit-debugger.
7478 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7479 (syms_of_xdisp): Remove inhibit-debug-on-message.
7480
7481 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7482
7483 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7484 If a nonvolatile local variable is written before a _longjmp to
7485 the frame containing the variable, and is read after the _longjmp,
7486 the value read is indeterminate. Some local variables of type
7487 'struct handler' and 'struct catchtag' are used in this way, so
7488 mark each of their slots as volatile if the slot can be set before
7489 _longjmp and read afterwards.
7490 * lisp.h (struct handler): var and chosen_clause are now volatile.
7491 (struct catchtag): val, next, and pdlcount are now volatile.
7492
7493 * bidi.c (bidi_push_it, bidi_pop_it):
7494 * fns.c (copy_hash_table):
7495 * image.c (define_image_type):
7496 * keyboard.c (kbd_buffer_store_event_hold):
7497 * process.c (Fprocess_send_eof):
7498 * xfaces.c (x_create_gc) [HAVE_NS]:
7499 * xgselect.c (xg_select):
7500 Prefer assignment to memcpy when either will do.
7501
7502 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7503 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7504 time an item is removed. No need to mark this function 'inline';
7505 the compiler knows better than we do.
7506
7507 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7508
7509 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7510 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7511 to change_frame_size (Bug#12388).
7512 (windowDidResize:): Pass YES to updateFrameSize.
7513
7514 * nsterm.h: Add delay parameter to updateFrameSize.
7515
7516 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7517
7518 Discard killed buffers from deleted window and frame objects.
7519 This reduces an amount of references to killed buffers and
7520 helps GC to reclaim them faster.
7521 * alloc.c (discard_killed_buffers): New function.
7522 (mark_object): Use it for deleted windows and frames.
7523 (mark_object): If symbol's value is set up for a killed buffer
7524 or deleted frame, restore its global binding.
7525 * data.c (swap_in_global_binding): Add GC notice.
7526 (swap_in_symval_forwarding): Use convenient set_blv_where.
7527 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7528 * window.h: ... to here.
7529
7530 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7531
7532 Convenient macro to check whether the buffer is live.
7533 * buffer.h (BUFFER_LIVE_P): New macro.
7534 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7535 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7536
7537 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7538
7539 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7540 composition cases (Bug#12364).
7541
7542 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7543 overhang of succeeding glyphs overlapping box cursor.
7544
7545 * w32term.c (x_draw_glyph_string): Likewise.
7546
7547 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7548
7549 Simplify, document, and port floating-point (Bug#12381).
7550 The porting part of this patch fixes bugs on non-IEEE platforms
7551 with frexp, ldexp, logb.
7552 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7553 Now static.
7554 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7555 support, by removing commented-out code and briefly listing the
7556 C89 functions excluded. The commented-out stuff was confusing
7557 maintenance, e.g., we thought we needed cbrt but it was commented out.
7558 (logb): Remove decl; no longer needed.
7559 (isfinite): New macro, if not already supplied.
7560 (isnan): Don't replace any existing macro.
7561 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7562 are present on all C89 platforms.
7563 (Ffrexp): Do not special-case zero, as frexp does the right thing
7564 for that case.
7565 (Flogb): Do not use logb, as it doesn't have the desired meaning
7566 on hosts that use non-base-2 floating point. Instead, stick with
7567 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7568 frexp, to avoid getting an unspecified result.
7569
7570 * xdisp.c (Qinhibit_debug_on_message): Now static.
7571
7572 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7573
7574 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7575 NSBezierPath (Bug#12131).
7576
7577 2012-09-10 Chong Yidong <cyd@gnu.org>
7578
7579 * fns.c (Fdelq, Fdelete): Doc fix.
7580
7581 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7582
7583 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7584 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7585
7586 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7587
7588 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7589 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7590 Use it.
7591
7592 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7593
7594 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7595 left fringe if the window has a left margin. This avoids leaving
7596 traces of the cursor because its leftmost pixel is not drawn over.
7597
7598 * dispnew.c (update_window_line): When the left margin area of a
7599 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7600 that screen line. (Bug#12277)
7601
7602 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7603
7604 Assume C89 or later for math functions (Bug#12381).
7605 This simplifies the code, and makes it a bit smaller and faster,
7606 and (most important) makes it easier to clean up signal handling
7607 since we can stop worring about floating-point exceptions in
7608 library code. That was a problem before C89, but the problem
7609 went away many years ago on all practical Emacs targets.
7610 * data.c, image.c, lread.c, print.c:
7611 Don't include <math.h>; no longer needed.
7612 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7613 might be autoconfigured, as that never happens.
7614 * data.c (fmod):
7615 * doprnt.c (DBL_MAX_10_EXP):
7616 * print.c (DBL_DIG):
7617 Remove. C89 or later always defines these.
7618 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7619 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7620 (arith_error, domain_error, domain_error2):
7621 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7622 no longer needed -- we simply return what C returns. All uses removed.
7623 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7624 the wrapped code.
7625 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7626 Remove. All uses expanded, as these macros are no longer used
7627 more than once and are now more trouble than they're worth.
7628 (Ftan): Use tan, not sin / cos.
7629 (Flogb): Assume C89 frexp.
7630 (fmod_float): Assume C89 fmod.
7631 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7632 (init_floatfns): Remove. All uses removed.
7633
7634 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7635
7636 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7637 compositeToPoint for OSX < 10.6 (Bug#12390).
7638
7639 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7640
7641 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7642 This produces more-accurate results.
7643
7644 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7645
7646 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7647 changes (Bug#12088).
7648
7649 2012-09-08 Chong Yidong <cyd@gnu.org>
7650
7651 * syntax.c (Fstring_to_syntax): Doc fix.
7652
7653 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7654
7655 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7656 in the internal border.
7657 (x_set_window_size): Remove static variables and their usage.
7658 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7659 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7660 Remove fringe/internal border adjustment (Bug#11052).
7661 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7662 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7663 (ns_fix_rect_ibw): Remove.
7664 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7665 (ns_dumpglyphs_box_or_relief): Ditto.
7666 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7667 adjustment.
7668 (ns_dumpglyphs_image): Ditto.
7669 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7670 border adjustment.
7671 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7672 their usage. Add fringe_extended_p and its use as in other terms.
7673 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7674 scroll bar was removed.
7675 (updateFrameSize): New function.
7676 (windowDidResize): Move code to updateFrameSize and call it.
7677
7678 * nsterm.h (EmacsView): Add updateFrameSize.
7679
7680 2012-09-07 Chong Yidong <cyd@gnu.org>
7681
7682 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7683
7684 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7685
7686 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7687
7688 More signal-handler cleanup (Bug#12327).
7689 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7690 Problem introduced when merging patches. Noted by Eli Zaretskii in
7691 <http://bugs.gnu.org/12327#67>.
7692 * floatfns.c: Comment fix.
7693 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7694 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7695 and anyway the declaration is harmless even if SIGDANGER is not defined.
7696 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7697 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7698 source files not surprisingly expected syssignal.h to define, or
7699 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7700 Include <sys/ioctl.h>, for FIONREAD.
7701 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7702 This eliminates a problem whereby other files mysteriously had
7703 to include "syssignal.h" before including "systty.h" if they
7704 wanted to use "#ifdef SIGIO".
7705
7706 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7707
7708 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7709
7710 * w32.c (sigemptyset): Empty the set.
7711 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7712
7713 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7714
7715 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7716
7717 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7718 (mark_object): Likewise for frame objects.
7719
7720 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7721
7722 * syssignal.h (handle_on_main_thread): Always declare,
7723 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7724 This ports to platforms without HAVE_PTHREAD.
7725
7726 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 Signal-handler cleanup (Bug#12327).
7729 Emacs's signal handlers were written in the old 4.2BSD style with
7730 sigblock and sigmask and so forth, and this led to some
7731 inefficiencies and confusion. Rewrite these to use
7732 pthread_sigmask etc. without copying signal sets around. Also,
7733 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7734 'signal', and instead use functions that do not attempt to take
7735 over the system name space. This patch causes Emacs's text
7736 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7737 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7738 Do not include <signal.h> or "syssignal.h", as these
7739 modules do not use signals.
7740 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7741 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7742 Do not include <signal.h>, as "syssignal.h" does that for us now.
7743 * atimer.c (sigmask_atimers): New function.
7744 (block_atimers, unblock_atimers): New functions,
7745 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7746 All uses replaced.
7747 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7748 no longer needed here.
7749 * emacs.c (main): Inspect existing signal handler with sigaction,
7750 so that there's no need to block and unblock SIGHUP.
7751 * sysdep.c (struct save_signal): New member 'action', replacing
7752 old member 'handler'.
7753 (save_signal_handlers, restore_signal_handlers):
7754 Use sigaction instead of 'signal' to save and restore.
7755 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7756 New function. All users of 'signal' modified to use set_sighandler
7757 if they're writeonly, and to use sys_signal if they're read+write.
7758 (emacs_sigaction_init, forwarded_signal): New functions.
7759 (sys_signal): Remove. All uses replaced by calls to sigaction
7760 and emacs_sigaction_init, or by direct calls to 'signal'.
7761 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7762 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7763 all uses replaced by pthread_sigmask etc. calls.
7764 * syssignal.h: Include <signal.h>.
7765 (emacs_sigaction_init, forwarded_signal): New decls.
7766 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7767 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7768 (sigmask, sys_sigmask): Remove; no longer needed.
7769 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7770 (sigblock, sigunblock, sigfree):
7771 (sigsetmask) [!defined sigsetmask]:
7772 Remove. All uses replaced by pthread_sigmask.
7773 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7774 no longer need to be replaced, and its typical old uses
7775 are now done via emacs_sigaction_init and sigaction.
7776 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7777 (sys_sigdel): Remove; unused.
7778 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7779
7780 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7781
7782 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7783 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7784
7785 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7786
7787 Explicitly mark buffer_defaults and buffer_local_symbols.
7788 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7789 mark_local_symbols here.
7790 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7791 since special buffers aren't marked here any more.
7792 (allocate_buffer): Chain new buffer with all_buffers here...
7793 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7794 not here.
7795 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7796 (syms_of_buffer): Remove staticpro of the above.
7797 (init_buffer_once): Set names for buffer_defaults and
7798 buffer_local_symbols.
7799
7800 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 Use bool for booleans in font-related modules.
7803 * font.c (font_intern_prop, font_style_to_value)
7804 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7805 (generate_otf_features, font_check_otf_features, font_check_otf)
7806 (font_match_p, font_list_entities, font_at):
7807 * fontset.c (fontset_id_valid_p, reorder_font_vector
7808 (fontset_find_font, Fset_fontset_font)
7809 (face_suitable_for_char_p) [0]:
7810 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7811 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7812 (m17n_flt_initialized, ftfont_shape_by_flt):
7813 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7814 * nsfont.m (nsfont_draw):
7815 * w32font.c (w32font_draw):
7816 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7817 Use bool for booleans.
7818 * font.h: Adjust to above API changes.
7819 (struct font, struct font_driver, struct font_driver_list):
7820 Use bool for booleans.
7821 (struct font): Remove useless member encoding_type.
7822 All users removed.
7823 * fontset.c, xftfont.c: Omit unnecessary static decls.
7824
7825 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7826
7827 * alloc.c (mark_object): Revert window marking code
7828 since it's unsafe for the Fset_window_configuration.
7829
7830 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 Fix race conditions with signal handlers and errno (Bug#12327).
7833 Be more systematic about preserving errno whenever a signal
7834 handler returns, even if it's not in the main thread. Do this by
7835 renaming signal handlers to distinguish between signal delivery
7836 and signal handling. All uses changed.
7837 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7838 * data.c (deliver_arith_signal): Rename from arith_error.
7839 * dispnew.c (deliver_window_change_signal): Rename from
7840 window_change_signal.
7841 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7842 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7843 * keyboard.c (deliver_input_available_signal): Rename from
7844 input_available_signal.
7845 (deliver_user_signal): Rename from handle_user_signal.
7846 (deliver_interrupt_signal): Rename from interrupt_signal.
7847 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7848 (deliver_child_signal): Rename from sigchld_handler.
7849 * atimer.c (handle_alarm_signal):
7850 * data.c (handle_arith_signal):
7851 * dispnew.c (handle_window_change_signal):
7852 * emacs.c (handle_fatal_signal, handle_danger_signal):
7853 * keyboard.c (handle_input_available_signal):
7854 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7855 * process.c (handle_pipe_signal, handle_child_signal):
7856 New functions, with the actual signal-handling code taken from the
7857 original respective signal handlers, sans the sporadic attempts to
7858 preserve errno, since that's now done by handle_on_main_thread.
7859 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7860 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7861 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7862 Move to sysdep.c.
7863 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7864 Move initialization of main_thread to sysdep.c's init_signals.
7865 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7866 our usage, and simplifies the mainline code.
7867 (record_child_status_change): New static function, as a helper
7868 for handle_child_signal, and with most of the old child handler's
7869 contents.
7870 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7871 (handle_child_signal): Use the above.
7872 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7873 Moved here from emacs.c.
7874 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7875 code moved here from emacs.c's main function.
7876 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7877 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7878 This lets callers save and restore errno properly.
7879
7880 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7881
7882 Remove redundant or unused things here and there.
7883 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7884 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7885 * editfns.c (Fcompare_buffer_substrings): Likewise.
7886 * frame.h (struct terminal, struct font_driver_list):
7887 Remove redundant declarations.
7888 * window.h (Qleft, Qright): Likewise.
7889
7890 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7891
7892 Do not mark objects from deleted buffers, windows and frames.
7893 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7894 (mark_object): Likewise for windows and frames.
7895
7896 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7897
7898 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7899 buffer_defaults and buffer_local_symbols as valid objects.
7900 Return special value to denote them.
7901
7902 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7905 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7906 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7907 (file_name_absolute_p, Fsubstitute_in_file_name):
7908 (check_executable, check_writable, Ffile_accessible_directory_p)
7909 (Fset_file_selinux_context, Fdefault_file_modes)
7910 (Finsert_file_contents, choose_write_coding_system)
7911 (Fwrite_region, build_annotations, a_write, e_write)
7912 (Fdo_auto_save):
7913 * filelock.c (boot_time_initialized, get_boot_time)
7914 (get_boot_time_1, lock_file_1, within_one_second):
7915 * floatfns.c (in_float):
7916 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7917 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7918 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7919 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7920 * window.c (compare_window_configurations):
7921 Use bool for booleans.
7922 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7923 (Fdefault_file_modes): Now mode_t, not int, for modes.
7924 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7925 (internal_delete_file): Now returns void, not a (boolean) int,
7926 since nobody was looking at the return value.
7927 * lisp.h, window.h: Adjust to above API changes.
7928
7929 * xdisp.c (set_message): Simplify and reindent last change.
7930
7931 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7932
7933 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7934
7935 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7936
7937 * eval.c (call_debugger): Make the function non-static so that we
7938 can call it from set_message.
7939
7940 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7941 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7942
7943 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7944
7945 Give more-useful info on a fatal error (Bug#12328).
7946 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7947 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7948 of doing the work ourselves.
7949 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7950 do most of the work.
7951 (fatal_error_backtrace): New function, taken from the guts
7952 of the old fatal_error_signal, but with a new option to output
7953 a backtrace.
7954 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7955 info about the signal than just its number.
7956 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7957 * sysdep.c: Include <execinfo.h>
7958 (emacs_backtrace): New function, taken partly from the previous
7959 code of the 'die' function.
7960 (emacs_abort): Call fatal_error_backtrace rather than abort.
7961
7962 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7963
7964 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7965 eager (load-time) macro-expansion.
7966 * lisp.mk (lisp): Add macroexp.
7967
7968 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7969
7970 Simplify redefinition of 'abort' (Bug#12316).
7971 Do not try to redefine the 'abort' function. Instead, redo
7972 the code so that it calls 'emacs_abort' rather than 'abort'.
7973 This removes the need for the NO_ABORT configure-time macro
7974 and makes it easier to change the abort code to do a backtrace.
7975 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7976 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7977 Remove; sysdep.c's emacs_abort now takes its place.
7978 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7979 'abort' changed to use 'emacs_abort'.
7980 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7981 (abort) [!defined abort]: Rename to ...
7982 (emacs_abort): ... new name.
7983 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7984 the place of the old 'abort' in emacs.c.
7985 * w32.c, w32fns.c (abort): Do not #undef.
7986 * w32.c (emacs_abort): Rename from w32_abort.
7987
7988 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7989
7990 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7991 offsets[j].dv, since the y axis of the screen coordinates points
7992 down, while the y axis of the font definition coordinates points
7993 up. This fixes display of Arabic diacritics such as KASRA and
7994 KASRATAN. (Bug#11860)
7995
7996 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7997
7998 Be more systematic about _setjmp vs setjmp.
7999 * alloc.c (test_setjmp, mark_stack):
8000 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
8001 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
8002 (png_load, my_error_exit, jpeg_load):
8003 * process.c (send_process_trap, send_process):
8004 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
8005 The underscored versions are up to 30x faster on some hosts.
8006 Formerly, the code used setjmp+longjmp sometimes and
8007 _setjmp+_longjmp at other times, with no particular reason to
8008 prefer setjmp+longjmp.
8009
8010 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 Fix minor problem found by static checking.
8013 * buffer.c (Fdelete_all_overlays): Return nil.
8014
8015 2012-09-03 Martin Rudalics <rudalics@gmx.at>
8016
8017 * buffer.c (Fdelete_all_overlays): New function.
8018
8019 2012-09-03 Chong Yidong <cyd@gnu.org>
8020
8021 * gtkutil.c: Add extern decl for Qxft.
8022
8023 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8024
8025 * emacs.c, eval.c: Use bool for boolean.
8026 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
8027 (malloc_using_checking) [DOUG_LEA_MALLOC]:
8028 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
8029 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8030 (main, decode_env_path, Fdaemon_initialized):
8031 * eval.c (call_debugger, Finteractive_p, interactive_p):
8032 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
8033 (maybe_call_debugger, Fbacktrace):
8034 * process.c (read_process_output, exec_sentinel):
8035 Use bool for booleans.
8036 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8037 All callers changed.
8038 * eval.c (interactive_p): Omit always-true boolean argument
8039 EXCLUDE_SUBRS_P. All callers changed.
8040 * dispextern.h, lisp.h: Reflect above API changes.
8041 * firstfile.c (dummy): Use the address of 'main', whose signature
8042 won't change, instead of the address of 'initialize', whose
8043 signature just changed from int to bool.
8044 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8045 * msdos.c (fatal_error_in_progress): ... from here.
8046 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8047 of incrementing it.
8048 (redisplay_internal, unwind_redisplay): Simply clear
8049 REDISPLAYING_P when unwinding, instead of saving its previous,
8050 always-false value and then restoring it.
8051
8052 Clean up some extern decls.
8053 Mostly, this hoists extern decls out of .c files and into .h files.
8054 That way, we're more likely to catch errors if the interfaces change.
8055 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8056 declare xg_mark_data.
8057 * dispextern.h (x_frame_parm_handlers):
8058 * font.h (Qxft):
8059 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8060 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8061 (Qultra_bold, Qoblique, Qitalic):
8062 Move extern decl here from .c file.
8063 * alloc.c (xg_mark_data) [USE_GTK]:
8064 * doc.c (Qclosure):
8065 * eval.c (Qlexical_binding):
8066 * fns.c (time) [!HAVE_UNISTD_H]:
8067 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8068 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8069 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8070 * lread.c (Qinternal_interpreter_environment):
8071 * minibuf.c (Qbuffer):
8072 * process.c (QCfamily, QCfilter):
8073 * widget.c (free_frame_faces):
8074 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8075 * xfont.c (x_clear_errors):
8076 * xterm.c (x_frame_parm_handlers):
8077 Remove now-redundant extern decls.
8078 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8079 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8080 Now static.
8081 * xfaces.c: Remove unnecessary static decls.
8082 * xterm.c (updating_frame): Remove decl of nonexistent object.
8083
8084 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8085 when building globals.h, as the objects that are not built on
8086 this host are not needed to compile C files on this host.
8087
8088 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8089
8090 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8091
8092 * frame.h: Add missing prototype for x_wm_set_size_hint.
8093
8094 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8095
8096 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8097 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8098 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8099 (Fsubstitute_command_keys):
8100 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8101 (save_excursion_save, save_excursion_restore)
8102 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8103 (format_time_string, general_insert_function)
8104 (make_buffer_string, make_buffer_string_both)
8105 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8106 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8107 (copy_text, insert_1, insert_1_both, insert_from_string)
8108 (insert_from_string_before_markers, insert_from_string_1)
8109 (insert_from_buffer, insert_from_buffer_1, replace_range)
8110 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8111 (del_range_2, modify_region):
8112 * intervals.c (intervals_equal, balance_possible_root_interval)
8113 (adjust_intervals_for_insertion, merge_properties_sticky)
8114 (graft_intervals_into_buffer, lookup_char_property)
8115 (adjust_for_invis_intang, set_point_both)
8116 (get_property_and_range, compare_string_intervals)
8117 (set_intervals_multibyte_1, set_intervals_multibyte):
8118 * keyboard.c (decode_timer):
8119 Use bool for boolean.
8120 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8121 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8122
8123 2012-09-02 Chong Yidong <cyd@gnu.org>
8124
8125 * keymap.c (push_key_description): Print M-TAB as C-M-i
8126 (Bug#11758).
8127
8128 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
8129
8130 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8131 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8132 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8133 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8134 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8135 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8136 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8137
8138 2012-09-01 Eli Zaretskii <eliz@gnu.org>
8139
8140 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8141 more than one grapheme cluster passed to the shaper: compute the
8142 offset adjustment values separately for each cluster. (Bug#11860)
8143
8144 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8145 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8146 about implicit conversions from integer to pointer.
8147
8148 2012-09-01 Daniel Colascione <dancol@dancol.org>
8149
8150 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8151 system used too early.
8152
8153 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 Better seed support for (random).
8156 * emacs.c (main): Call init_random.
8157 * fns.c (Frandom): Set the seed from a string argument, if given.
8158 Remove long-obsolete Gentzel cruft.
8159 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8160 (init_random): New function.
8161
8162 2012-09-01 Daniel Colascione <dancol@dancol.org>
8163
8164 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8165 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8166 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8167 x_wm_set_size_hint, x_query_colors, x_real_positions,
8168 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8169 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8170 all of which have been moved to common code.
8171
8172 * xfaces.c: Include TERM_HEADER instead of listing all possible
8173 window-system headers.
8174
8175 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8176 to match header.
8177
8178 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8179 directly accessing frame internals.
8180
8181 * w32font.h: Include font.h. Define syms_of_w32font and
8182 globals_of_w32font.
8183
8184 * process.c: Include TERM_HEADER instead of listing all possible
8185 window-system headers.
8186
8187 * nsterm.h: Remove declarations now in frame.h.
8188 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8189
8190 * menu.c: Include TERM_HEADER instead of listing all possible
8191 window-system headers.
8192
8193 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8194 window system.
8195
8196 * keyboard.c: Include TERM_HEADER instead of listing all possible
8197 window-system headers.
8198
8199 * image.c: Include TERM_HEADER instead of listing all possible
8200 window-system headers. Declare Vlibrary_cache when compiling for
8201 Windows.
8202
8203 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8204 window system declarations.
8205
8206 * frame.h: Move common functions here: set_frame_menubar,
8207 x_set_window_size, x_sync, x_get_focus_frame,
8208 x_set_mouse_position, x_set_mouse_pixel_position,
8209 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8210 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8211 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8212 x_activate_menubar, x_real_positions, x_bitmap_icon,
8213 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8214 and x_query_colors.
8215
8216 * frame.c: Include TERM_HEADER instead of listing all possible
8217 window-system headers.
8218
8219 * font.c: Include TERM_HEADER instead of listing all possible
8220 window-system headers.
8221
8222 * emacs.c: Include TERM_HEADER.
8223
8224 * dispnew.c: Include TERM_HEADER instead of listing all possible
8225 window-system headers.
8226
8227 * ccl.h: Include character.h.
8228
8229 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8230 the current window system; include in list of objects to link into
8231 Emacs.
8232
8233 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8234
8235 Remove mark_ttys function and fix tty_display_info initialization.
8236 * lisp.h (mark_ttys): Remove prototype.
8237 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8238 to mark_ttys because all possible values of 'top_frame' slot are
8239 the frames which are reachable from Vframe_list.
8240 * term.c (mark_ttys): Remove.
8241 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8242
8243 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8244
8245 Change struct frame bitfields from unsigned char to unsigned.
8246 * frame.h (struct frame): Change type of 'display_preempted',
8247 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8248 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8249 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8250 bitfields from unsigned char to unsigned.
8251
8252 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8253
8254 Remove unused member of struct x_output and struct w32_output.
8255 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8256 * w32term.h (struct w32_output): Likewise.
8257
8258 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8259
8260 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8261 does not become zero (Bug#12234).
8262
8263 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8264
8265 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8266 for GCC 4.7.1 x86-64.
8267
8268 2012-08-30 Glenn Morris <rgm@gnu.org>
8269
8270 * lread.c (init_lread): For out-of-tree builds, only add the
8271 source directory's site-lisp dir to the load-path if it exists,
8272 consistent with in-tree builds. (Bug#12302)
8273
8274 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8275
8276 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8277 button_values to NULL. Call setStykeMask so dialogs get a close button.
8278 (windowShouldClose:): Set window_closed.
8279 (dealloc): New member, free button_values.
8280 (process_dialog:): Make member function. Remove window argument,
8281 replace window with self. Count buttons and allocate and store values
8282 in button_values.
8283 (addButton:value:row:): value is int with the name tag. Call setTag
8284 with tag. Remove return self, declare return value as void.
8285 (addString:row:): Remove return self, declare return value as void.
8286 (addSplit): Remove return self, declare return value as void.
8287 (clicked:): Remove return self, declare return value as void.
8288 Set dialog_return to button_values[seltag]. Code formatting change.
8289 (initFromContents:isQuestion:): Adjust call to process_dialog.
8290 Code formatting change.
8291 (timeout_handler:): Set timer_fired to YES.
8292 (runDialogAt:): Set timer_fired to NO.
8293 Handle click on close button as quit.
8294
8295 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8296 Add window_closed and button_values. Add void as return value for
8297 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8298 Add process_dialog as new member.
8299
8300 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8301
8302 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8303 is not one of the heaps we manage. (Bug#12242)
8304
8305 2012-08-28 Glenn Morris <rgm@gnu.org>
8306
8307 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8308
8309 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8310
8311 * window.c (Fset_window_configuration): Remove handling of
8312 auto-buffer-name window parameter. Install revision of reverted
8313 fix.
8314
8315 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8316
8317 Do not allow to set major mode for a dead buffer.
8318 * buffer.c (Fset_buffer_major_mode): Signal an error
8319 if the buffer is dead.
8320 (Fother_buffer, other_buffer_safely): Remove redundant
8321 nested declaration.
8322
8323 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8324
8325 Always use set_buffer_if_live to restore original buffer at unwind.
8326 * buffer.h (record_unwind_current_buffer): New function.
8327 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8328 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8329 * undo.c, window.c: Adjust users.
8330 * buffer.c (set_buffer_if_live): Fix comment.
8331
8332 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8333
8334 Fix usage of set_buffer_internal.
8335 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8336 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8337 * coding.c (decode_coding): Omit redundant test.
8338 * fileio.c (decide_coding_unwind): Likewise.
8339 * fns.c (secure_hash): Likewise.
8340 * insdel.c (modify_region): Likewise.
8341 * keyboard.c (command_loop_1): Likewise.
8342 * print.c (PRINTFINISH): Likewise.
8343 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8344
8345 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8346
8347 * dispnew.c: Use bool for boolean.
8348 (frame_garbaged, display_completed, delayed_size_change)
8349 (fonts_changed_p, add_window_display_history)
8350 (add_frame_display_history, verify_row_hash)
8351 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8352 (row_equal_p, realloc_glyph_pool)
8353 (allocate_matrices_for_frame_redisplay)
8354 (showing_window_margins_p)
8355 (adjust_frame_glyphs_for_frame_redisplay)
8356 (build_frame_matrix_from_leaf_window, make_current)
8357 (mirrored_line_dance, mirror_line_dance, update_frame)
8358 (update_window_tree, update_single_window)
8359 (check_current_matrix_flags, update_window, update_text_area)
8360 (update_window_line, set_window_update_flags, scrolling_window)
8361 (update_frame_1, scrolling, buffer_posn_from_coords)
8362 (do_pending_window_change, change_frame_size)
8363 (change_frame_size_1, sit_for):
8364 Use bool for boolean.
8365 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8366 and remove last int (actually boolean) argument, which was always 0.
8367 All callers changed.
8368 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8369 * dispextern.h (struct composition_it): Use bool for boolean.
8370 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8371 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8372 * dired.c (file_name_completion):
8373 Use bool for boolean. (This was missed in an earlier change.)
8374
8375 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8376
8377 * window.c (Fset_window_configuration): Revert first part of
8378 last change.
8379
8380 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8381
8382 * nsterm.h (NSPanel): New class variable dialog_return.
8383
8384 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8385 Initialize dialog_return.
8386 (windowShouldClose:): Use stop instead of stopModalWithCode.
8387 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8388 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8389 event.
8390 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8391 modal loop returns.
8392
8393 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8394
8395 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8396 * composite.c (find_composition, composition_gstring_p)
8397 (composition_reseat_it, find_automatic_composition):
8398 * data.c (let_shadows_buffer_binding_p)
8399 (let_shadows_global_binding_p, set_internal, make_blv)
8400 (Fmake_variable_buffer_local, Fmake_local_variable)
8401 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8402 (cons_to_signed, arith_driver):
8403 * dbusbind.c (xd_in_read_queued_messages):
8404 * dired.c (directory_files_internal, file_name_completion):
8405 Use bool for booleans.
8406 * dired.c (file_name_completion):
8407 * process.h (fd_callback):
8408 Omit int (actually boolean) argument. It wasn't being used.
8409 All uses changed.
8410 * composite.h, lisp.h: Reflect above API changes.
8411
8412 * cmds.c, coding.c: Use bool for booleans.
8413 * cmds.c (move_point, Fself_insert_command):
8414 * coding.h (struct composition status, struct coding_system):
8415 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8416 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8417 (emacs_mule_char, decode_coding_emacs_mule)
8418 (encode_coding_emacs_mule, detect_coding_iso_2022)
8419 (decode_coding_iso_2022, encode_invocation_designation)
8420 (encode_designation_at_bol, encode_coding_iso_2022)
8421 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8422 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8423 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8424 (encode_coding_raw_text, detect_coding_charset)
8425 (decode_coding_charset, encode_coding_charset, detect_eol)
8426 (detect_coding, get_translation_table, produce_chars)
8427 (consume_chars, reused_workbuf_in_use)
8428 (make_conversion_work_buffer, code_conversion_save)
8429 (decode_coding_object, encode_coding_object)
8430 (detect_coding_system, char_encodable_p)
8431 (Funencodable_char_position, code_convert_region)
8432 (code_convert_string, code_convert_string_norecord)
8433 (Fset_coding_system_priority):
8434 * fileio.c (Finsert_file_contents):
8435 Use bool for booleans.
8436 * coding.h, lisp.h: Reflect above API changes.
8437 * coding.c: Remove unnecessary static function decls.
8438 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8439 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8440 not a boolean 'int', since callers never look at the return value.
8441 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8442 * coding.h (decoding_buffer_size, encoding_buffer_size)
8443 (emacs_mule_string_char): Remove unused extern decls.
8444 (struct iso_2022_spec, struct coding_system):
8445 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8446 (struct emacs_mule_spec): Remove unused field 'full_support'.
8447 All initializations removed.
8448 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8449
8450 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8451
8452 Fix spare memory change (Bug#12286).
8453 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8454 (valid_lisp_object_p): Likewise.
8455
8456 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8457
8458 * window.c (Fset_window_configuration): Record any window's old
8459 buffer if it's replaced (see Bug#8789). If the new current
8460 buffer doesn't appear in the selected window, go to its old
8461 point (Bug#12208).
8462
8463 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8464
8465 Special MEM_TYPE_SPARE to denote reserved memory.
8466 * alloc.c (enum mem_type): New memory type.
8467 (refill_memory_reserve): Use new type for spare memory.
8468 This prevents live_cons_p and live_string_p from incorrect
8469 detection of uninitialized objects from spare memory as live.
8470
8471 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8472
8473 Spelling fixes.
8474 * Makefile.in (.PHONY): versioclean -> versionclean.
8475
8476 Remove unused external symbols.
8477 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8478 * window.c (Qwindow_valid_p, decode_valid_window):
8479 Now static, not extern.
8480 * data.c (Qinterval): Remove; unused.
8481 (syms_of_data): Do not define 'interval'.
8482 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8483 * window.h (decode_valid_window):
8484 Remove decls.
8485
8486 * character.c, charset.c, chartab.c: Use bool for booleans.
8487 * character.c (lisp_string_width, string_count_byte8)
8488 (string_escape_byte8):
8489 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8490 (load_charset_map_from_file, map_charset_chars)
8491 (Fdefine_charset_internal, define_charset_internal)
8492 (Fdeclare_equiv_charset, find_charsets_in_text)
8493 (Ffind_charset_region, char_charset, Fiso_charset):
8494 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8495 (sub_char_table_set, sub_char_table_set_range)
8496 (char_table_set_range, optimize_sub_char_table)
8497 (map_sub_char_table):
8498 Use bool for boolean.
8499 * character.c (str_to_unibyte): Omit last boolean argument; it was
8500 always 0. All callers changed.
8501 * character.h, charset.h: Adjust to match previous changes.
8502 * character.h (char_printable_p): Remove decl of nonexistent function.
8503 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8504 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8505 are all boolean, so make them single-bit bitfields.
8506
8507 * lisp.h (ASET): Remove attempt to detect side effects.
8508 It was meant to be temporary and it often doesn't work,
8509 because when IDX has side effects the behavior of IDX==IDX
8510 is undefined. See Stefan Monnier in
8511 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8512
8513 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8514
8515 * lisp.h (functionp): New function (extracted from Ffunctionp).
8516 (FUNCTIONP): Use it.
8517 * eval.c (Ffunctionp): Use it.
8518
8519 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8522 as that's faster and simpler than static storage. Don't bother
8523 with the g_main_context_query overhead if g_main_context_pending
8524 says no events are pending.
8525 (gfds, gfds_size): Remove these static vars.
8526 (xgselect_initialize): Remove; no longer needed.
8527 All uses and decls removed.
8528
8529 * emacs.c (fatal_error_signal_hook): Remove.
8530 All uses removed. This leftover from old code was always 0.
8531
8532 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8533 * casefiddle.c (casify_object, casify_region):
8534 * casetab.c (set_case_table):
8535 * category.c, category.h (word_boundary_p):
8536 * category.h (CHAR_HAS_CATEGORY):
8537 Use bool for booleans, instead of int.
8538
8539 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8540
8541 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8542
8543 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8544
8545 On assertion failure, print backtrace if available.
8546 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8547 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8548 * Makefile.in (LIB_EXECINFO): New macro.
8549 (LIBES): Use it.
8550
8551 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8552 * bytecode.c (exec_byte_code):
8553 * callint.c (check_mark, Fcall_interactively):
8554 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8555 (getenv_internal, sync_process_alive, call_process_exited):
8556 * lisp.h (USE_SAFE_ALLOCA):
8557 Use bool for booleans, instead of int.
8558 * lisp.h, process.h: Adjust prototypes to match above changes.
8559 * callint.c (Fcall_interactively): Don't assume the mark's
8560 offset fits in 'int'.
8561
8562 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 * buffer.c, buffer.h: Use bool for boolean.
8565 * buffer.c (reset_buffer_local_variables)
8566 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8567 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8568 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8569 (overlay_touches_p, overlay_strings, Foverlay_put)
8570 (report_overlay_modification, call_overlay_mod_hooks):
8571 (mmap_enlarge, mmap_set_vars):
8572 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8573 Use bool for booleans, instead of int.
8574 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8575 since the 1-or-0 return value is always ignored anyway.
8576 (mmap_initialized_p):
8577 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8578 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8579
8580 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8581
8582 * bidi.c: Use bool for boolean.
8583 This is a bit more readable, and makes the text segment of bidi.o
8584 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8585 Presumably it's faster too.
8586 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8587 Now bool.
8588 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8589 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8590 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8591 (bidi_explicit_dir_char, bidi_level_of_next_char)
8592 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8593 Use bool for booleans, instead of int.
8594 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8595 (bidi_unshelve_cache): Adjust decls to match code.
8596
8597 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8598
8599 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8600 argument.
8601
8602 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8603
8604 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8605 * atimer.h: Include <stdbool.h>.
8606
8607 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8608
8609 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8610 compile time tests instead of run time tests on systems that do
8611 not use them.
8612 (FRAME_MAC_P): Remove leftover from deleted code.
8613 * frame.c (syms_of_frame): Remove leftover from deleted code.
8614
8615 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8616
8617 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8618
8619 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8620
8621 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8622 Otherwise, the compiler complains about (A?B:C) where B is void
8623 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8624 (fontset_add): Return void, for FONTSET_ADD.
8625
8626 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 * alloc.c: Use bool for booleans.
8629 (gc_in_progress, abort_on_gc)
8630 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8631 (dont_register_blocks) [GC_MALLOC_CHECK]:
8632 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8633 (check_string_bytes, make_specified_string, memory_full)
8634 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8635 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8636 (mark_stack, valid_pointer_p, make_pure_string)
8637 (Fgarbage_collect, survives_gc_p, gc_sweep):
8638 Use bool for booleans, instead of int.
8639 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8640 Remove unused local.
8641 * alloc.c (PURE_POINTER_P):
8642 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8643 * editfns.c (Fformat):
8644 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8645 (Fdo_auto_save):
8646 * fns.c (sweep_weak_table):
8647 * lisp.h (suppress_checking, push_message, survives_gc_p)
8648 (make_pure_string, gc_in_progress, abort_on_gc):
8649 * lread.c (readchar, read1):
8650 * print.c (Fprin1_to_string):
8651 * xdisp.c (push_message):
8652 Use bool for booleans affected directly or indirectly by
8653 alloc.c's changes.
8654
8655 Make recently-introduced setters macros.
8656 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8657 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8658 (set_fontset_default, set_fontset_fallback): Rename from their
8659 upper-case counterparts, and make them functions rather than macros.
8660 This is more consistent with the other recently-introduced setters.
8661 These don't need to be inline, since they're local.
8662
8663 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8664
8665 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8666 the loop (Bug#12247).
8667
8668 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8669
8670 * lisp.h (vcopy): Use memcpy rather than our own loop.
8671 This fixes a performance regression introduced by the recent
8672 addition of vcopy. This means 'vcopy' will need to be modified
8673 for a copying collector, but that's OK. Also, tighten the
8674 checking in the assertion.
8675
8676 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8677
8678 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8679 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8680 non-base glyph for the width of the base character, according to
8681 what x_draw_composite_glyph_string_foreground expects.
8682 Generate WADJUST value according to composition_gstring_width's
8683 expectations, to produce correct width of the composed character.
8684 Reverse the sign of the DU offset produced by ScriptPlace.
8685
8686 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8687
8688 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8689
8690 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8691
8692 Avoid direct writes to contents member of struct Lisp_Vector.
8693 * lisp.h (vcopy): New function to copy data into vector.
8694 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8695 * fns.c (Ffillarray): Use ASET.
8696 * keyboard.c (timer_check_2): Use AREF and ASET.
8697 (append_tool_bar_item, Frecent_keys): Use vcopy.
8698 * lread.c (read_vector): Use ASET.
8699 * msdos.c (Frecent_doskeys): Use vcopy.
8700 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8701 (Finternal_merge_in_global_face): Use ASET and vcopy.
8702 * xfont.c (xfont_list_pattern): Likewise.
8703
8704 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8705
8706 * window.c (Fwindow_point): For the selected window always return
8707 the position of its buffer's point.
8708 (Fset_window_point): For the selected window always go in its
8709 buffer to the specified position.
8710
8711 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8712
8713 Setter macros for fontsets.
8714 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8715 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8716 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8717 Adjust users.
8718
8719 2012-08-20 Glenn Morris <rgm@gnu.org>
8720
8721 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8722 Don't assume that `ln -f' works.
8723
8724 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8725
8726 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8727 and later about non-assignments with no effect. See discussion at
8728 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8729 details.
8730
8731 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8732
8733 Inline setter functions for Lisp_Objects slots of struct specbinding.
8734 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8735 Adjust users.
8736
8737 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8738
8739 * window.c (select_window): Always make selected window's buffer
8740 current.
8741
8742 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8743
8744 Use AREF and ASET for docstrings of category tables.
8745 * category.h (CATEGORY_DOCSTRING): Use AREF.
8746 (SET_CATEGORY_DOCSTRING): Use ASET.
8747 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8748
8749 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8750
8751 Inline setter functions for hash table members.
8752 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8753 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8754 (set_hash_key_and_value, set_hash_index, set_hash_next)
8755 (set_hash_hash): New functions.
8756 * charset.c, fns.c: Adjust users.
8757
8758 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8759
8760 Inline getter and setter functions for per-buffer values.
8761 * buffer.h (per_buffer_default, set_per_buffer_default)
8762 (per_buffer_value, set_per_buffer_value): New functions.
8763 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8764 * buffer.c, data.c: Adjust users.
8765
8766 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8767
8768 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8769
8770 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8771
8772 Rely on <config.h> + <unistd.h> to declare 'environ',
8773 as gnulib does this if the system doesn't.
8774 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8775 Remove declaration. MS-Windows declares it on stdlib.h which is
8776 included by conf_post.h.
8777 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8778 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8779 * vm-limit.c: Include <unistd.h>, for 'environ'.
8780
8781 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8782 (start_of_data): Remove decl; mem-limits.h provides it.
8783
8784 * xdisp.c (handle_invisible_prop): Make it a bit faster
8785 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8786
8787 2012-08-19 Chong Yidong <cyd@gnu.org>
8788
8789 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8790 ends (Bug#3874).
8791
8792 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8793
8794 * .gdbinit: Use call instead of set when calling a function in the
8795 inferior.
8796
8797 * data.c (set_internal): Don't use set_blv_found.
8798 (Fkill_local_variable): Likewise.
8799
8800 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8801
8802 * nsfont.m (ns_ascii_average_width): Ensure the string
8803 ascii_printable is initialized with a null-terminated character
8804 array. Otherwise, it can contain undesired extra characters.
8805
8806 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8807
8808 port new setting code to Sun C 5.8 2005/10/13
8809 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8810 Return void, not Lisp_Object. Otherwise, the compiler
8811 complains about (A?B:C) where B is void and C is Lisp_Object
8812 when compiling CHAR_TABLE_SET, due to the recent change to
8813 the API of sub_char_table_set_contents.
8814
8815 2012-08-18 Chong Yidong <cyd@gnu.org>
8816
8817 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8818 for the string case (Bug#3874).
8819
8820 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8821
8822 * buffer.h (BSET): Remove (Bug#12215).
8823 Replace all uses with calls to new setter functions.
8824 (bset_bidi_paragraph_direction, bset_case_canon_table)
8825 (bset_case_eqv_table, bset_directory, bset_display_count)
8826 (bset_display_time, bset_downcase_table)
8827 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8828 (bset_last_selected_window, bset_local_var_alist)
8829 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8830 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8831 (bset_width_table):
8832 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8833 (bset_auto_fill_function, bset_auto_save_file_format)
8834 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8835 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8836 (bset_cache_long_line_scans, bset_case_fold_search)
8837 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8838 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8839 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8840 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8841 (bset_header_line_format, bset_indicate_buffer_boundaries)
8842 (bset_indicate_empty_lines, bset_invisibility_spec)
8843 (bset_left_fringe_width, bset_major_mode, bset_mark)
8844 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8845 (bset_name, bset_overwrite_mode, bset_pt_marker)
8846 (bset_right_fringe_width, bset_save_length)
8847 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8848 (bset_scroll_up_aggressively, bset_selective_display)
8849 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8850 (bset_word_wrap, bset_zv_marker):
8851 * category.c (bset_category_table):
8852 * syntax.c (bset_syntax_table):
8853 New setter functions.
8854
8855 * process.h (PSET): Remove (Bug#12215).
8856 Replace all uses with calls to new setter functions.
8857 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8858 (PROCESS_INLINE): New macro.
8859 (pset_childp): New setter function.
8860 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8861 * process.c (PROCESS_INLINE):
8862 Define to EXTERN_INLINE, so that the corresponding functions
8863 are compiled into code.
8864 (pset_buffer, pset_command, pset_decode_coding_system)
8865 (pset_decoding_buf, pset_encode_coding_system)
8866 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8867 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8868 (pset_type, pset_write_queue): New setter functions.
8869
8870 * window.h (WSET): Remove (Bug#12215).
8871 Replace all uses with calls to new setter functions.
8872 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8873 (WINDOW_INLINE): New macro.
8874 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8875 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8876 (wset_total_lines, wset_vertical_scroll_bar)
8877 (wset_window_end_pos, wset_window_end_valid)
8878 (wset_window_end_vpos): New setter functions.
8879 * window.c (WINDOW_INLINE):
8880 Define to EXTERN_INLINE, so that the corresponding functions
8881 are compiled into code.
8882 (wset_combination_limit, wset_dedicated, wset_display_table)
8883 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8884 (wset_new_normal, wset_new_total, wset_next_buffers)
8885 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8886 (wset_prev_buffers, wset_right_fringe_width)
8887 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8888 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8889 (wset_window_parameters):
8890 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8891 (wset_column_number_displayed, wset_region_showing):
8892 New setter functions.
8893
8894 * termhooks.h (TSET): Remove (Bug#12215).
8895 Replace all uses with calls to new setter functions.
8896 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8897 (TERMHOOKS_INLINE): New macro.
8898 (tset_charset_list, tset_selection_alist): New setter functions.
8899 * terminal.c (TERMHOOKS_INLINE):
8900 Define to EXTERN_INLINE, so that the corresponding functions
8901 are compiled into code.
8902 (tset_param_alist): New setter function.
8903
8904 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8905
8906 * keyboard.h (KSET): Remove (Bug#12215).
8907 Replace all uses with calls to new setter functions.
8908 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8909 (KEYBOARD_INLINE): New macro.
8910 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8911 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8912 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8913 New setter functions.
8914 * keyboard.c (KEYBOARD_INLINE):
8915 Define to EXTERN_INLINE, so that the corresponding functions
8916 are compiled into code.
8917 (kset_echo_string, kset_kbd_queue)
8918 (kset_keyboard_translate_table, kset_last_prefix_arg)
8919 (kset_last_repeatable_command, kset_local_function_key_map)
8920 (kset_overriding_terminal_local_map, kset_real_last_command)
8921 (kset_system_key_syms): New setter functions.
8922
8923 * frame.h (FSET): Remove (Bug#12215).
8924 Replace all uses with calls to new setter functions.
8925 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8926 (FRAME_INLINE): New macro.
8927 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8928 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8929 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8930 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8931 (fset_param_alist, fset_root_window, fset_scroll_bars)
8932 (fset_selected_window, fset_title, fset_tool_bar_items)
8933 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8934 * frame.c (FRAME_INLINE):
8935 Define to EXTERN_INLINE, so that the corresponding functions
8936 are compiled into code.
8937 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8938
8939 A few more naming-convention fixes for getters and setters.
8940 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8941 and rename from buffer_overlays_set_before.
8942 (set_buffer_overlays_after): Move here from buffer.h, and rename
8943 from buffer_overlays_set_after.
8944 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8945 All uses changed.
8946 (set_buffer_intervals): Rename from buffer_set_intervals.
8947 * intervals.c (set_interval_object): Move here from intervals.h,
8948 and rename from interval_set_object.
8949 (set_interval_left): Move here from intervals.h, and rename from
8950 interval_set_left.
8951 (set_interval_right): Move here from intervals.h, and rename from
8952 interval_set_right.
8953 (copy_interval_parent): Move here from intervals.h, and rename from
8954 interval_copy_parent.
8955 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8956 (set_interval_plist): Rename from interval_set_plist.
8957 Return void, not Lisp_Object, since no caller uses the result.
8958 * lisp.h (string_intervals): Rename from string_get_intervals.
8959 (set_string_intervals): Rename from string_set_intervals.
8960
8961 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8962 (set_char_table_contents): Rename from char_table_set_contents.
8963 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8964 All uses changed. See the end of
8965 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8966
8967 * lisp.h (CSET): Remove (Bug#12215).
8968 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8969 (set_char_table_purpose): New functions,
8970 replacing CSET. All uses changed. For example, replace
8971 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8972 "set_char_table_parent (char_table, parent);".
8973 The old version was confusing because it used the same name
8974 'parent' for two different things.
8975
8976 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8977
8978 Functions to get and set Lisp_Object fields of buffer-local variables.
8979 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8980 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8981 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8982 * data.c, eval.c, frame.c: Adjust users.
8983
8984 2012-08-17 Chong Yidong <cyd@gnu.org>
8985
8986 * xfaces.c (merge_face_vectors): If the target font specfies a
8987 font spec, make the font's attributes take precedence over
8988 directly-specified attributes.
8989 (merge_face_ref): Recognize :font.
8990
8991 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8992
8993 Do not use memcpy for copying intervals.
8994 * intervals.c (reproduce_interval): New function.
8995 (reproduce_tree, reproduce_tree_obj): Use it.
8996 (reproduce_tree_obj): Remove prototype.
8997
8998 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8999
9000 * lisp.h (duration_to_sec_usec): Remove unused decl.
9001
9002 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
9003
9004 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
9005 to an allocated instance of NSString, not to the class itself.
9006
9007 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
9008
9009 * makefile.w32-in (C_CTYPE_H): New macro.
9010 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
9011 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
9012 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
9013
9014 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
9015
9016 Use ASCII tests for character types.
9017 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
9018 * xfns.c, xterm.c:
9019 Don't include <ctype.h>; was not needed.
9020 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
9021 * sysdep.c, xfaces.c:
9022 Include <c-ctype.h> instead of <ctype.h>.
9023 * nsterm.m: Include <c-ctype.h>.
9024 * charset.c (read_hex):
9025 * doc.c (Fsnarf_documentation):
9026 * fileio.c (IS_DRIVE) [WINDOWSNT]:
9027 (DRIVE_LETTER) [DOS_NT]:
9028 (Ffile_name_directory, Fexpand_file_name)
9029 (Fsubstitute_in_file_name):
9030 * font.c (font_parse_xlfd, font_parse_fcname):
9031 * frame.c (x_set_font_backend):
9032 * gtkutil.c (xg_get_font):
9033 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
9034 * nsimage.m (hexchar):
9035 * nsterm.m (ns_xlfd_to_fontname):
9036 * sysdep.c (system_process_attributes):
9037 * xfaces.c (hash_string_case_insensitive):
9038 Use C-locale tests instead of locale-specific tests for character
9039 types, since we want the ASCII interpretation here, not the
9040 interpretation suitable for whatever happens to be the current locale.
9041
9042 2012-08-16 Martin Rudalics <rudalics@gmx.at>
9043
9044 Consistently check windows for validity/liveness
9045 (Bug#11984, Bug#12025, Bug#12026).
9046 * lisp.h (CHECK_VALID_WINDOW): New macro.
9047 * window.c (decode_window): Rename to decode_live_window.
9048 (decode_valid_window, Fwindow_valid_p): New functions.
9049 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9050 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9051 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9052 (Fwindow_prev_sibling, Fwindow_combination_limit)
9053 (Fset_window_combination_limit, Fwindow_use_time)
9054 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9055 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9056 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9057 (Fwindow_hscroll, Fset_window_hscroll)
9058 (Fwindow_redisplay_end_trigger)
9059 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9060 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9061 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9062 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9063 (Fwindow_end, Fset_window_point, Fset_window_start)
9064 (Fpos_visible_in_window_p, Fwindow_line_height)
9065 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9066 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9067 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9068 (Fset_window_parameter, Fwindow_display_table)
9069 (Fset_window_display_table, Fdelete_other_windows_internal)
9070 (Fset_window_buffer, Fset_window_new_total)
9071 (Fset_window_new_normal, Fdelete_window_internal)
9072 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9073 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9074 (Fwindow_scroll_bars): Check whether argument window is a valid or
9075 live window. Update doc-strings.
9076 (syms_of_window): New symbol Qwindow_valid_p.
9077 * keyboard.c (Fposn_at_x_y): Check whether argument
9078 frame_or_window denotes a valid window.
9079
9080 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9081
9082 Fix previous char table change.
9083 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9084 * chartab.c (optimize_sub_char_table): Likewise.
9085
9086 2012-08-16 Chong Yidong <cyd@gnu.org>
9087
9088 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9089
9090 * xfont.c (xfont_open):
9091 * xftfont.c (xftfont_open): Set the font's max_width field.
9092
9093 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9094 min_width to space_width and average_width to the average over
9095 printable ASCII characters.
9096 (ns_char_width): Code cleanup.
9097 (ns_ascii_average_width): New utility function.
9098
9099 * font.h (struct font): Update comments.
9100
9101 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9102
9103 Simple interface to set Lisp_Object fields of character tables.
9104 * lisp.h (CSET): New macro.
9105 (char_table_set_extras, char_table_set_contents)
9106 (sub_char_table_set_contents): New function.
9107 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9108 * syntax.c: Adjust users.
9109
9110 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9111
9112 * eval.c (eval_sub): Bind lexical-binding.
9113 * lread.c (Qlexical_binding): Make non-static.
9114
9115 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9116
9117 * nsmenu.m (popupSession): Remove.
9118 (pop_down_menu): Remove endModalSession.
9119 (timeout_handler:): New method.
9120 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9121 Call runModalForWindow. Check timer_fired when it returns.
9122 If not set, cancel timer and break out of loop.
9123 Otherwise loop again, with a new timeout.
9124
9125 * nsterm.m: Include fcntl.h if present.
9126 (fd_entry, t_readfds, inNsSelect): Remove.
9127 (select_writefds, select_valid, select_timeout, selfds)
9128 (select_mutex, apploopnr): Add.
9129 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9130 Otherwise call kbd_buffer_store_event.
9131 (ns_send_appdefined): Remove release of fd_entry.
9132 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9133 Increment and decrement apploopnr.
9134 (ns_select): If no file descriptors, just do a NSTimer.
9135 Otherwise copy read/write masks and start select thread (fd_handler).
9136 Start main loop and wait for application defined event.
9137 Inform select thread to stop selecting after main loop is exited.
9138 (ns_term_init): Create selfds pipe and set non-blocking.
9139 Initialize select_mutex. Start the select thread (fd_handler).
9140 (fd_handler:): Loop forever, wait for info from the main thread
9141 to either start or stop selecting. When select returns, send
9142 and appdefined event.
9143 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9144 If not call kbd_buffer_store_event.
9145
9146 * nsterm.h (EmacsApp): fd_handler takes id argument.
9147 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9148
9149 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9150
9151 2012-08-15 Eli Zaretskii <eliz@gnu.org>
9152
9153 * region-cache.c (move_cache_gap): Update gap_len using the actual
9154 growth of the boundaries array. Do not change cache_len.
9155 (Bug#12196)
9156
9157 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9158
9159 Generalize and cleanup font subsystem checks.
9160 * font.h (FONT_DEBUG, font_assert): Remove.
9161 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9162 Change font_assert to eassert. Use eassert where appropriate.
9163
9164 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9165
9166 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9167
9168 2012-08-15 Chong Yidong <cyd@gnu.org>
9169
9170 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9171 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9172 extract the font descriptor instead of just the font name.
9173 In that case, return a font spec instead of a string.
9174 (x_last_font_name): Move to this file from xfns.c.
9175
9176 * xfns.c (Fx_select_font): The return value can also be a font
9177 spec. Move x_last_font_name management to gtkutil.c.
9178
9179 * xfaces.c: Make font weight and style symbols non-static.
9180
9181 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9182
9183 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9184 (bug#12117).
9185
9186 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9187
9188 * alloc.c (Fgarbage_collect): Use plural form consistently.
9189
9190 2012-08-14 Eli Zaretskii <eliz@gnu.org>
9191
9192 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9193 iteration through the command loop. Fixes a problem whereby mouse
9194 movements are ignored until the first mouse click.
9195
9196 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9197
9198 Use bool, not int, for Lisp booleans.
9199 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9200 makes Emacs a bit smaller and presumably a bit faster.
9201 * lisp.h: Include <stdbool.h>.
9202 (struct Lisp_Boolfwd, defvar_bool):
9203 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9204 * regex.c [!emacs]: Include <stdbool.h>.
9205 (false, true): Remove; <stdbool.h> does this for us now.
9206
9207 2012-08-14 Chong Yidong <cyd@gnu.org>
9208
9209 * character.c (Fcharacterp): Doc fix (Bug#12076).
9210
9211 * data.c (Findirect_variable): Doc fix (Bug#11040).
9212
9213 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9214
9215 * editfns.c (Fformat): Doc fix (Bug#12059).
9216 (Fsave_current_buffer): Doc fix (Bug#11542).
9217
9218 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9219
9220 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9221 (bug#12022).
9222
9223 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9224
9225 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9226 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9227 * minibuf.c (choose_minibuf_frame, read_minibuf):
9228 * w32fns.c (x_create_tip_frame):
9229 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9230 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9231
9232 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9233
9234 * intervals.c (offset_intervals): Remove obsolete comment.
9235
9236 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9237
9238 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9239
9240 2012-08-14 Gergely Risko <gergely@risko.hu>
9241
9242 * coding.c (decode_coding): Record buffer modification before
9243 disabling undo_list (Bug#11773).
9244
9245 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9246
9247 Revert and cleanup some recent overlay changes.
9248 * buffer.h (enum overlay_type): Remove.
9249 (buffer_get_overlays, buffer_set_overlays): Likewise.
9250 (buffer_set_overlays_before, buffer_set_overlays_after):
9251 New function. Adjust users.
9252 (unchain_both): Add eassert.
9253
9254 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9255
9256 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9257
9258 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 * gtkutil.c (xg_mark_data): Don't assume C99.
9261
9262 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9263
9264 * gtkutil.c (xg_frame_tb_info): New struct.
9265 (TB_INFO_KEY): New define.
9266 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9267 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9268 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9269 if not present.
9270 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9271 is up to date. Otherwise store new data.
9272 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9273
9274 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9275
9276 Use KSET for write access to Lisp_Object members of struct kboard.
9277 * keyboard.h (KSET): New macro.
9278 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9279 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9280 * xterm.c: Adjust users.
9281
9282 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9283
9284 Use BSET for write access to Lisp_Object members of struct buffer.
9285 * buffer.h (BSET): New macro.
9286 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9287 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9288 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9289 * window.c, xdisp.c, xfns.c: Adjust users.
9290
9291 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9292
9293 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9294
9295 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9296
9297 * nsterm.m (not_in_argv): New function.
9298 (application:openFile, application:openTempFile:):
9299 (application:openFileWithoutUI:, application:openFiles:): Open file
9300 if not_in_argv returns non-zero (bug#12171).
9301
9302 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9303 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9304 Define for Gtk+ versions less than 3.2.
9305 (xg_get_font_name): Use those functions/macros here.
9306 Reported by Frans Oilinki <moilinki@gmail.com>.
9307
9308 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9309
9310 * unexmacosx.c (copy_data_segment): Copy initialized data in
9311 statically linked libraries from input file rather than memory.
9312
9313 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9314 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9315 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9316
9317 2012-08-10 Glenn Morris <rgm@gnu.org>
9318
9319 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9320 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9321
9322 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9323
9324 Fix last change to allow compilation with low optimization levels.
9325 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9326 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9327
9328 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9329
9330 Use common inline syntax in intervals.h.
9331 * intervals.h (INTERVALS_INLINE): New macro.
9332 Change all users from LISP_INLINE.
9333
9334 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9335
9336 Define Qnone once for all platforms.
9337 * frame.c (Qnone): Define here.
9338 (syms_of_frame): DEFSYM it.
9339 * lisp.h (Qnone): New declaration.
9340 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9341 * xfns.c: Remove duplication. Adjust users.
9342
9343 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9344
9345 Remove unused macros from intervals.h.
9346 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9347 * intervals.c: Adjust comment.
9348
9349 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9350
9351 * w32fns.c <w32_unicode_gui>: New static variable.
9352 (globals_of_w32fns): Initialize it according to os_subtype.
9353 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9354 testing os_subtype.
9355
9356 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9357 Eli Zaretskii <eliz@gnu.org>
9358
9359 Fix bug #10299 with Unicode characters sent by customized
9360 keyboards created by MSKLC.
9361 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9362 (w32_init_class): Use it to initialize the Emacs class with either
9363 ANSI or Unicode API calls.
9364 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9365 later.
9366 (w32_wnd_proc): If the character code sent by WM_CHAR or
9367 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9368 original message. Call DefWindowProcW on NT and later.
9369
9370 2012-08-10 Glenn Morris <rgm@gnu.org>
9371
9372 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9373
9374 * lisp.h (DIRECTORY_SEP): Let configure set it.
9375
9376 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9377
9378 Use TSET for write access to Lisp_Object slots of struct terminal.
9379 * termhooks.h (TSET): New macro.
9380 * coding.c, terminal.c, xselect.c: Adjust users.
9381
9382 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9383
9384 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9385 the failing expression, include them in the error message.
9386 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9387 * lisp.h (internal_condition_case_n): Update declaration.
9388
9389 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9390
9391 Inline functions to examine and change buffer overlays.
9392 * buffer.c (unchain_both): New function.
9393 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9394 (buffer_has_overlays): New function.
9395 (enum overlay_type): New enum.
9396 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9397 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9398
9399 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9400
9401 Inline functions to examine and change buffer intervals.
9402 * alloc.c (mark_interval_tree): Remove.
9403 (MARK_INTERVAL_TREE): Simplify.
9404 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9405 * intervals.c (buffer_balance_intervals): New function.
9406 (graft_intervals_into_buffer): Adjust indentation.
9407 (set_intervals_multibyte): Simplify.
9408 * buffer.h (BUF_INTERVALS): Remove.
9409 (buffer_get_intervals, buffer_set_intervals): New function.
9410 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9411 * intervals.c, textprop.c: Adjust users.
9412
9413 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9414
9415 Inline functions to examine and change string intervals.
9416 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9417 (string_get_intervals, string_set_intervals): New function.
9418 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9419 * lread.c, print.c, textprop.c: Adjust users.
9420
9421 2012-08-08 Glenn Morris <rgm@gnu.org>
9422
9423 * lisp.mk (lisp): Remove language/persian.elc.
9424
9425 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9426
9427 Cleanup intervals.
9428 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9429 (NULL_INTERVAL_P): Likewise. Adjust users.
9430 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9431 Adjust comment. Move under #if 0.
9432 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9433 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9434
9435 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9436
9437 Check total length of intervals with eassert.
9438 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9439 * intervals.c: Change all users to eassert.
9440
9441 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9442
9443 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9444 Rename fields to match removal of FGET and WGET and disuse of
9445 INTERNAL_FIELD in Lisp_Cons.
9446
9447 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9448
9449 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9450 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9451 name since all xname users are fixed long time ago. Do not
9452 use INTERNAL_FIELD.
9453 (set_symbol_name, set_symbol_function, set_symbol_plist):
9454 (set_symbol_next, set_overlay_plist): New function.
9455 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9456 (struct Lisp_Overlay): Likewise.
9457 (CVAR, MVAR, SVAR): Remove.
9458 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9459 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9460 * xterm.c: Adjust users.
9461 * .gdbinit: Change to use name field of struct Lisp_Symbol
9462 where appropriate.
9463
9464 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9465
9466 Basic functions to set Lisp_Object and pointer slots of intervals.
9467 * intervals.h (interval_set_parent, interval_set_object):
9468 (interval_set_left, interval_set_right, interval_set_plist):
9469 (interval_copy_parent): New function.
9470 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9471 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9472 Adjust indentation.
9473 (INTERVAL_SIZE): Remove. Adjust users.
9474 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9475
9476 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9477
9478 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9479 * process.h (PGET): Remove.
9480 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9481 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9482
9483 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9484
9485 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9486 * window.h (WGET): Remove.
9487 (struct window): Do not use INTERNAL_FIELD.
9488 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9489 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9490 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9491 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9492 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9493 Adjust users.
9494
9495 2012-08-07 Chong Yidong <cyd@gnu.org>
9496
9497 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9498 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9499 (Fdelete_window_internal): Signal an error if the window is not on
9500 a live frame (Bug#12025).
9501
9502 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9503
9504 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9505 * frame.h (FGET): Remove.
9506 (struct frame): Do not use INTERNAL_FIELD.
9507 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9508 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9509 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9510 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9511
9512 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9513
9514 * w32.c: Silence compiler warnings.
9515 (map_w32_filename): Remove unused variable `is_fat'.
9516 (chase_symlinks): Add parentheses around expression.
9517
9518 2012-08-06 Glenn Morris <rgm@gnu.org>
9519
9520 * sysdep.c: Respect BROKEN_GETWD.
9521
9522 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9523 Let configure handle it.
9524 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9525
9526 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9527
9528 Use GCALIGNMENT where appropriate.
9529 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9530 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9531 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9532
9533 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9534
9535 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9536 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9537
9538 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9539
9540 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9541 that should be sufficient for everyone.
9542
9543 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9544
9545 * keyboard.c (timer_check_2): Add break so timer_check returns next
9546 timeout.
9547
9548 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9549
9550 Fix Windows build errors introduced after converting to WGET and WSET.
9551 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9552 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9553
9554 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9555
9556 * nsterm.m (ns_frame_rehighlight): Use FSET.
9557
9558 * nsmenu.m (ns_update_menubar): Use FSET.
9559
9560 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9561
9562 Separate read and write access to Lisp_Object slots of Lisp_Process.
9563 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9564 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9565
9566 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9567
9568 Separate read and write access to Lisp_Object slots of struct window.
9569 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9570 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9571 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9572 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9573 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9574 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9575 Adjust users.
9576
9577 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9578
9579 Fix Windows build errors introduced after converting to FGET and FSET.
9580 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9581 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9582 (w32_judge_scroll_bars): Change to use FSET.
9583 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9584
9585 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9586
9587 Fix replacement typo.
9588 * window.c (replace_window): Set root_window instead of
9589 selected_window. This fixes a total window subsystem
9590 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9591
9592 2012-08-06 Glenn Morris <rgm@gnu.org>
9593
9594 * lisp.mk (lisp): Add language/persian.elc.
9595
9596 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9597
9598 Separate read and write access to Lisp_Object slots of struct frame.
9599 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9600 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9601 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9602 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9603 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9604
9605 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9606
9607 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9608
9609 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9610
9611 Generalize common compile-time constants.
9612 * lisp.h (header_size, bool_header_size, word_size): Now here.
9613 (struct Lisp_Vector): Add comment.
9614 (struct Lisp_Bool_Vector): Move up to define handy constants.
9615 (VECSIZE, PSEUDOVECSIZE): Simplify.
9616 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9617 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9618 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9619 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9620 * xfont.c, xmenu.c: Use word_size where appropriate.
9621
9622 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9623
9624 * search.c (Freplace_match): Treat \? in the replacement text
9625 literally (Bug#8161).
9626
9627 2012-08-05 Chong Yidong <cyd@gnu.org>
9628
9629 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9630 * frame.c (Vdelete_frame_functions):
9631 * emacs.c (Vkill_emacs_hook): Doc fix.
9632
9633 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9634
9635 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9636 --with-x-toolkit=no builds.
9637 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9638
9639 2012-08-04 Chong Yidong <cyd@gnu.org>
9640
9641 * syntax.c (Fmodify_syntax_entry): Doc fix.
9642
9643 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9644
9645 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9646 * w32.c (init_environment): Change the default values of many
9647 environment variables in dflt_envvars[] to NULL, to avoid pushing
9648 them into environment when they were not already defined.
9649 Remove the code that deletes site-lisp subdirectories from the default
9650 value of EMACSLOADPATH, as it is no longer needed.
9651 (check_windows_init_file): Now external, not static.
9652 Use Vload_path as is, without adding anything, as this function is now
9653 called when Vload_path is already set up.
9654
9655 * w32.h (check_windows_init_file): Add prototype.
9656
9657 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9658 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9659 compatibility with Posix platforms.
9660 (main): Move the call to check_windows_init_file to here from
9661 w32.c.
9662 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9663 any, in the DEFALT argument into the root of the Emacs build or
9664 installation tree, as appropriate.
9665
9666 * callproc.c (init_callproc_1): Call decode_env_path instead of
9667 doing its equivalent by hand.
9668 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9669 the code that sets Vexec_path run on MS-Windows.
9670
9671 * lread.c (init_lread): Add comments to #ifdef's.
9672
9673 * msdos.c (dos_set_window_size, IT_update_begin)
9674 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9675 instead of direct references.
9676
9677 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9678
9679 Export DEFAULT_REHASH_* to GDB.
9680 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9681 Now constants, not macros.
9682
9683 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9684
9685 Remove unnecessary casts involving pointers.
9686 These casts are no longer needed now that we assume C89 or later,
9687 since they involve casting to or from void *.
9688 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9689 (make_pure_float, make_pure_vector):
9690 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9691 * macros.c (Fstart_kbd_macro):
9692 * menu.c (find_and_return_menu_selection):
9693 * minibuf.c (read_minibuf_noninteractive):
9694 * sysdep.c (closedir):
9695 * xdisp.c (x_produce_glyphs):
9696 * xfaces.c (compare_fonts_by_sort_order):
9697 * xfns.c (x_real_positions, select_visual):
9698 * xselect.c (x_stop_queuing_selection_requests)
9699 (x_get_window_property, x_get_window_property_as_lisp_data):
9700 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9701 Remove unnecessary pointer casts.
9702 * alloc.c (record_xmalloc): New function.
9703 * lisp.h (record_xmalloc): New decl.
9704 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9705 more like a function. This is because the pointer cast is not
9706 needed. All uses changed.
9707 * print.c (print_string, print_error_message): Avoid length recalc.
9708
9709 Improve fix for macroexp crash with debugging (Bug#12118).
9710 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9711 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9712 not supposed to be invoked from the garbage collector.
9713 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9714 (gc_aset): New function, which is like ASET but can be
9715 used in the garbage collector.
9716 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9717 (set_hash_index): Use it instead of ASET.
9718
9719 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9720
9721 Support symlinks on latest versions of MS-Windows.
9722 * w32.c: Include winioctl.h and aclapi.h.
9723 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9724 (revert_to_self): Forward declarations of static functions.
9725 <static BOOL g_b_init_get_security_info>:
9726 <g_b_init_create_symbolic_link>: New static flags.
9727 (globals_of_w32): Initialize them to zero.
9728 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9729 (map_w32_filename): Improve commentary. Simplify switch.
9730 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9731 headers (most versions of MinGW w32api don't).
9732 (get_security_info, create_symbolic_link)
9733 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9734 New functions.
9735 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9736 in the argument file name.
9737 (sys_access): Call unc_volume_file_attributes only if
9738 GetFileAttributes fails with network-related error codes.
9739 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9740 have the required privileges.
9741 (get_file_security_desc_by_name): Rename from
9742 get_file_security_desc.
9743 (stat_worker): New function, with most of the guts of 'stat', and
9744 with addition of handling of symlinks and support for 'lstat'.
9745 If possible, get file's attributes and security information by
9746 handle, not by name. Produce S_IFLNK bit for symlinks, when
9747 called from 'lstat'.
9748 (stat, lstat): New functions, call 'stat_worker'.
9749 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9750 symlinks when the underlying filesystem supports them.
9751
9752 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9753
9754 Fix macroexp crash on Windows with debugging (Bug#12118).
9755 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9756 checking subscripts; problem introduced with the recent
9757 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9758 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9759 since it's used in non-static inline functions now.
9760
9761 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9762 Don't assume buffer size fits in 'int'. Remove unused local.
9763
9764 Use C99-style 'extern inline' if available.
9765 * buffer.h (BUFFER_INLINE):
9766 * category.h (CATEGORY_INLINE):
9767 * character.h (CHARACTER_INLINE):
9768 * charset.h (CHARSET_INLINE):
9769 * composite.h (COMPOSITE_INLINE):
9770 * dispextern.h (DISPEXTERN_INLINE):
9771 * lisp.h (LISP_INLINE):
9772 * systime.h (SYSTIME_INLINE):
9773 New macro, replacing 'static inline' in this header.
9774 * buffer.h, category.h, character.h, charset.h, composite.h:
9775 * dispextern.h, lisp.h, systime.h:
9776 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9777 * alloc.c (LISP_INLINE):
9778 * buffer.c (BUFFER_INLINE):
9779 * category.c (CATEGORY_INLINE):
9780 * character.c (CHARACTER_INLINE):
9781 * charset.c (CHARSET_INLINE):
9782 * composite.c (COMPOSITE_INLINE):
9783 * dispnew.c (DISPEXTERN_INLINE):
9784 * sysdep.c (SYSTIME_INLINE):
9785 Define to EXTERN_INLINE, so that the corresponding functions
9786 are compiled into code.
9787 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9788 (INLINE_HEADER_END): New macros.
9789 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9790 since it's used in non-static inline functions now.
9791 (VALMASK) [!USE_LSB_TAG]: Likewise.
9792
9793 2012-08-02 Glenn Morris <rgm@gnu.org>
9794
9795 * s/: Remove empty directory.
9796
9797 * s/ms-w32.h: Move to ../nt/inc.
9798 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9799 Update for new ms-w32.h location.
9800
9801 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9802
9803 Port to Solaris 8.
9804 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9805
9806 2012-08-02 Glenn Morris <rgm@gnu.org>
9807
9808 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9809 hard-coding the path separator.
9810
9811 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9812
9813 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9814 This how ASET and AREF are supposed to work, and makes
9815 it easier to think about future improvements. See
9816 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9817 * charset.h (set_charset_attr): New function.
9818 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9819 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9820 (aref_addr): New function. All uses of &AREF(...) changed.
9821 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9822 (set_hash_index): New functions. All lvalue-style uses of
9823 HASH_KEY etc. changed.
9824 * keyboard.c (set_prop): New function. All lvalue-style uses
9825 of PROP changed.
9826
9827 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9828
9829 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9830 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9831 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9832 * nsfns.m (ns_set_name_as_filename): Likewise.
9833 * nsmenu.m (ns_update_menubar): Likewise.
9834 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9835
9836 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9837
9838 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9839 Adapt to latest changes in field names of the corresponding Lisp
9840 objects.
9841
9842 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9843
9844 2012-08-01 Glenn Morris <rgm@gnu.org>
9845
9846 * s/msdos.h: Remove file.
9847 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9848 * Makefile.in (S_FILE): Remove.
9849 (config_h): Remove S_FILE.
9850
9851 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9852
9853 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9854 Remove; moved to nt/config.nt.
9855
9856 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9857
9858 Use INTERNAL_FIELD for conses and overlays.
9859 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9860 Remove obsolete comment.
9861 (MVAR): New macro.
9862 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9863 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9864
9865 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9866
9867 Use INTERNAL_FIELD for symbols.
9868 * lisp.h (SVAR): New macro. Adjust users.
9869 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9870 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9871
9872 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9873
9874 Use INTERNAL_FIELD for processes.
9875 * process.h (PVAR): New macro. Adjust style.
9876 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9877 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9878
9879 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9880
9881 Use INTERNAL_FIELD for windows.
9882 * window.h (WVAR): New macro.
9883 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9884 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9885 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9886 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9887 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9888 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9889
9890 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9893
9894 2012-08-01 Glenn Morris <rgm@gnu.org>
9895
9896 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9897 Move to configure.ac.
9898
9899 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9900
9901 * makefile.w32-in (CONFIG_H): Update dependencies.
9902 (CONF_POST_H): New macro.
9903
9904 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9905
9906 2012-07-31 Glenn Morris <rgm@gnu.org>
9907
9908 * Makefile.in (S_FILE): No longer set by configure.
9909
9910 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9911 is available.
9912 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9913
9914 * process.h (NULL_DEVICE):
9915 * emacs.c (SEPCHAR):
9916 * editfns.c (USER_FULL_NAME): Let configure set them.
9917
9918 * s/README, s/template.h: Remove files.
9919
9920 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9921
9922 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9923 Move to configure.ac.
9924
9925 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9926
9927 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9928 resulting renaming of 'struct frame' members.
9929
9930 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9931
9932 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9933 after introduction of FVAR.
9934
9935 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9936
9937 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9938
9939 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9940 instead of compositeToPoint.
9941 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9942
9943 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9944
9945 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9946
9947 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9948 * lisp.h (INTERNAL_FIELD): New macro.
9949 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9950 (BVAR): Change to use INTERNAL_FIELD.
9951 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9952 (KVAR): Change to use INTERNAL_FIELD.
9953 * frame.h (FVAR): New macro.
9954 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9955 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9956 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9957 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9958 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9959
9960 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9961
9962 Miscellaneous fixes for non-default X toolkits.
9963 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9964 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9965 Move under #ifdef USE_LUCID.
9966 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9967 definition and usage to avoid warnings.
9968
9969 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9970
9971 * nsterm.m (openFiles): Fix previous checkin.
9972
9973 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9974
9975 * indent.c (compute_motion): Remove unused local.
9976
9977 2012-07-31 Glenn Morris <rgm@gnu.org>
9978
9979 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9980
9981 * conf_post.h [USG5_4]:
9982 Move remaining contents of s/usg5-4-common.h here.
9983 * s/usg5-4-common.h: Remove file.
9984
9985 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9986 * s/irix6-5.h: Remove file.
9987
9988 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9989 * s/darwin.h: Remove file.
9990
9991 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9992 * s/hpux10-20.h: Remove file, which is now empty.
9993
9994 2012-07-30 Glenn Morris <rgm@gnu.org>
9995
9996 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9997 * Makefile.in (config_h): Add conf_post.h.
9998 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9999
10000 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
10001
10002 * nsterm.m (ns_do_open_file): New variable.
10003 (ns_term_init): Set ns_do_open_file to YES after run returns.
10004 (openFile, openTempFile, openFileWithoutUI, openFiles):
10005 Open files only if ns_do_open_file.
10006
10007 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10008
10009 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
10010 This no-op macro hasn't been needed for many years.
10011 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
10012
10013 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
10014 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
10015 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
10016 gdb_make_enums_visible.
10017 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
10018 (DIRECTORY_SEP): Now a constant, not a macro.
10019
10020 2012-07-30 Eli Zaretskii <eliz@gnu.org>
10021
10022 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
10023 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
10024
10025 * w32term.c <w32_keyboard_codepage>: Renamed from
10026 keyboard_codepage and now external. All users changed.
10027
10028 * w32term.h: Add declaration of w32_keyboard_codepage.
10029
10030 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
10031 the codepage to translate keys to Unicode. If this argument is
10032 -1, use the value returned by GetConsoleCP. All callers changed.
10033
10034 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 Update .PHONY listings in makefiles.
10037 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10038 bootstrap-clean, distclean, maintainer-clean, versioclean,
10039 extraclean, frc.
10040
10041 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10042 This is a bit clearer. Fix some commentary typos.
10043
10044 2012-07-30 Glenn Morris <rgm@gnu.org>
10045
10046 * s/netbsd.h: Let configure include signal.h if needed.
10047 Remove file, which is now empty.
10048
10049 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10050 Let configure set them.
10051 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10052 No more need to undefine.
10053
10054 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10055
10056 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10057 non-single-byte char when adding meta modifier. (Bug#12090)
10058
10059 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10060
10061 Convert safe_call to use variable number of arguments.
10062 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10063 (safe_call2): Fix comment.
10064 * lisp.h (safe_call): Adjust prototype.
10065 * coding.c (encode_coding_object): Change to use safe_call2.
10066 * xfaces.c (merge_face_heights): Change to use safe_call1.
10067
10068 2012-07-30 Glenn Morris <rgm@gnu.org>
10069
10070 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10071 does that unconditionally. Remove file, which is now empty.
10072
10073 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10074 Remove empty files.
10075
10076 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10077
10078 Export to GDB most of lisp.h's remaining object-like macros.
10079 * lisp.h (min, max): Move earlier, because they're used earlier now.
10080 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10081 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10082 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10083 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10084 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10085 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10086 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10087 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10088 Now constants, for GDB. They need not be macros.
10089 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10090 Now constants, for GDB, as well as macros, for static initializers.
10091 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10092 Move to after the definition of struct Lisp_Char_Table,
10093 since the former now needs that type defined.
10094 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10095 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10096 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10097 New enums, for gdb_make_enums_visible.
10098 (GLYPH_MODE_LINE_FACE): Remove; unused.
10099 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10100 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10101 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10102 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10103 enum maxargs, enum MAX_ALLOCA.
10104 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10105 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10106 no longer needed, now that they are done in lisp.h.
10107
10108 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10109
10110 Cleanup string bytes checking.
10111 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10112 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10113 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10114 (check_sblock, compact_small_strings): Simplify.
10115
10116 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10117
10118 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10119 These macros are confusing and no longer need to be defined, as
10120 the enum values now suffice. All uses replaced with definiens.
10121 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10122
10123 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
10124
10125 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10126 ($(BLD)/w32console.$(O)): Update dependencies.
10127
10128 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10129
10130 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10131 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10132 time. Adjust users.
10133 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10134
10135 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10136
10137 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10138 setting sitelisp (Bug#12010).
10139
10140 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10141
10142 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10143
10144 * w32heap.c (cache_system_info):
10145 * w32.c (sys_rename):
10146 * w32proc.c (find_child_console, sys_kill): All users changed.
10147
10148 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10149
10150 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10151
10152 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10153
10154 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10155
10156 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10157
10158 Cleanup statistics calculation in Fgarbage_collect.
10159 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10160 Fix zombies percentage calculation. Simplify elapsed time calculation.
10161
10162 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10163
10164 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10165 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10166 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10167 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10168 (replace_range, replace_range_2, del_range_2): Change to eassert.
10169 * marker.c (byte_char_debug_check): Adjust style.
10170
10171 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10172
10173 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10174 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10175 long-ago-commented-out code that talks about "WIN32".
10176 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10177 All uses changed.
10178
10179 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10180
10181 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10182 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10183 Simplify by using alignof.
10184 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10185 * lisp.h: Include <stdalign.h>.
10186 (GCALIGNMENT): New macro and constant.
10187 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10188 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10189 (stdalign): New macro, if not already defined.
10190
10191 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10192
10193 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10194 * w32inevt.c: Include w32inevt.h.
10195 (w32_read_console_input): New inline function, calls either
10196 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10197 w32_console_unicode_input.
10198 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10199 (w32_kbd_patch_key, key_event): Use the codepage returned by
10200 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10201 (key_event): use uChar.UnicodeChar only if
10202 w32_console_unicode_input is non-zero.
10203
10204 * w32console.c: Include w32heap.h.
10205 <w32_console_unicode_input>: New global variable.
10206 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10207 family of Windows, zero otherwise.
10208
10209 * w32inevt.h: Declare w32_console_unicode_input.
10210
10211 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10212 --without-x. (Bug#11742)
10213
10214 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10215
10216 Adjust GDB to reflect pvec_type changes (Bug#12036).
10217 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10218 2012-07-04 changes to pseudovector representation.
10219 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10220
10221 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10222
10223 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10224 bus address.
10225 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10226
10227 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10228
10229 * alloc.c (listn): Fix the order the arguments are consed onto the
10230 list.
10231
10232 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10233 enumeration constants, as PURE and HEAP are too general, and clash
10234 with other headers and sources, such as gmalloc.c and the
10235 MS-Windows system headers. All users changed.
10236
10237 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10238
10239 Revert last save_excursion_save and save_excursion_restore changes.
10240 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10241 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10242
10243 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10244
10245 Fix recently-introduced typos in Windows port.
10246 Reported by Martin Rudalics <rudalics@gmx.at>.
10247 * w32.c (init_environment): Replace comma with semicolon.
10248 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10249
10250 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10251
10252 Improve GDB symbol export (Bug#12036).
10253 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10254 arms of an 'if', not using conditional expressions; otherwise GDB
10255 complains about the types in the unevaluated arm when the argument
10256 is an integer literal.
10257 (xgetint): Simplify expression.
10258 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10259 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10260 Zaretskii in <http://bugs.gnu.org/12036#13>.
10261 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10262 needed now that we have gdb_make_enums_visible.
10263 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10264 (enum enum_USE_LSB_TAG):
10265 New enum types, packaging up enums that need to be exported to GDB.
10266
10267 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10268
10269 Utility function to make a list from specified amount of objects.
10270 * lisp.h (enum constype): New datatype.
10271 (listn): New prototype.
10272 * alloc.c (listn): New function.
10273 (Fmemory_use_count, syms_of_alloc): Use it.
10274 * buffer.c (syms_of_buffer): Likewise.
10275 * callint.c (syms_of_callint): Likewise.
10276 * charset.c (define_charset_internal): Likewise.
10277 * coding.c (syms_of_coding): Likewise.
10278 * keymap.c (syms_of_keymap): Likewise.
10279 * search.c (syms_of_search): Likewise.
10280 * syntax.c (syms_of_syntax): Likewise.
10281 * w32.c (init_environment): Likewise.
10282 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10283 * xdisp.c (syms_of_xdisp): Likewise.
10284 * xfns.c (syms_of_xfns): Likewise.
10285
10286 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10287
10288 Fast save_excursion_save and save_excursion_restore.
10289 * lisp.h (struct Lisp_Excursion): New data type.
10290 (PVEC_EXCURSION): New pseudovector type.
10291 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10292 to deal with it. Adjust comments.
10293 (init_marker, attach_marker): New prototype.
10294 (unchain_marker): Adjust prototype.
10295 * marker.c (attach_marker): Change to global.
10296 (init_marker): New function.
10297 * alloc.c (Fmake_marker, build_marker): Use it.
10298 (build_marker): More easserts.
10299 (mark_object): Handle struct Lisp_Excursion.
10300 * editfns.c (save_excursion_save, save_excursion_restore):
10301 Reimplement to use struct Lisp_Excursion. Add comments.
10302
10303 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10304
10305 Fix export of symbols to GDB (Bug#12036).
10306 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10307 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10308 emacs.c, as this is a more-suitable home. Had this been done earlier
10309 the fix for 12036 would have avoided some of the problems noted in
10310 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10311 would have been more obvious.
10312 * emacs.c: Do not include <verify.h>; no longer needed.
10313 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10314 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10315 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10316 Remove; now done in lisp.h.
10317 * lisp.h (PUBLISH_TO_GDB): New macro.
10318 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10319 (DATA_SEG_BITS): Use it.
10320 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10321 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10322 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10323 not be usable in #if. This simplifies things.
10324
10325 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10326
10327 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10328
10329 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10330
10331 Simplify export of symbols to GDB (Bug#12036).
10332 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10333 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10334 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10335 Adjust to changes in lisp.h and emacs.c, by using
10336 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10337 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10338 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10339 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10340 instead of gdb_valbits.
10341 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10342 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10343 instead of gdb_array_mark_flag.
10344 (xboolvector): Get size from $->size, not $->header.size.
10345 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10346 (xreload, hook-run, hookpost-run): Remove.
10347 * emacs.c: Include <verify.h>.
10348 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10349 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10350 Remove.
10351 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10352 (gdb_USE_LSB_TAG): New enum constants.
10353 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10354 Also define these as enum constants, so they're visible to GDB.
10355 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10356 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10357 as constants, so they're visible to GDB.
10358 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10359 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10360 Now enum constants, not macros, so they're visible to GDB.
10361 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10362 more convenient now. All uses changed.
10363 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10364 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10365
10366 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10367
10368 Explicitly free restriction data that are not needed anymore.
10369 * editfns.c (save_restriction_restore): Free restriction data.
10370
10371 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10372
10373 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10374 add argument, tune behavior, and adjust all callers.
10375
10376 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10377
10378 Use typedef for EMACS_INT, EMACS_UINT.
10379 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10380 than macros. This simplifies debugging in the usual case, since
10381 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10382 and it allows expressions involving EMACS_INT casts.
10383 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10384
10385 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10386
10387 * nsterm.m (ns_read_socket): Return early if there is a modal
10388 window (Bug#12043).
10389
10390 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10391
10392 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10393 that FOCUS-FRAME can be omitted.
10394
10395 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10396
10397 Adjust buffer text indirection counters at the end of Fkill_buffer.
10398 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10399 buffer is definitely dead. This should really fix an issue reported
10400 by Christoph Scholtes again. (Bug#12007).
10401 (init_buffer_once): Initialize indirection counters of
10402 buffer_defaults and buffer_local_symbols (for sanity and safety).
10403
10404 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10405
10406 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10407 and continuation glyphs on tooltip frames, leave them at zero.
10408 Avoids continued lines in tooltips. (Bug#11832)
10409
10410 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10411
10412 Simplify copy_overlay.
10413 * buffer.c (copy_overlay): Simplify. Use build_marker.
10414 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10415
10416 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10417
10418 * print.c (print_object): Don't crash when a frame's name is nil
10419 or invalid. (Bug#12025)
10420
10421 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10422 it signals an error when a tooltip frame is being created.
10423
10424 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10425
10426 Cleanup miscellaneous objects allocation and initialization.
10427 * alloc.c (allocate_misc): Change to static. Add argument to
10428 specify the subtype. Adjust comment and users.
10429 (build_overlay): New function.
10430 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10431 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10432 (allocate_misc): Remove prototype.
10433 (build_overlay): Add prototype.
10434
10435 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10436
10437 Swap buffer text indirection counters in Fbuffer_swap_text.
10438 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10439 This avoids crash reported by Christoph Scholtes at
10440 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10441
10442 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10443
10444 * nsmenu.m (Popdown_data): New struct.
10445 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10446 free Popdown_data.
10447 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10448 (initWithContentRect): Make imgView and contentView non-static
10449 and autorelease them. Also autorelease img and matrix (Bug#12005).
10450 (dealloc): Remove (Bug#12005).
10451
10452 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10453
10454 Adjust consing_since_gc when objects are explicitly freed.
10455 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10456 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10457 (free_cons, free_misc): Subtract object size from consing_since_gc.
10458
10459 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10460
10461 Simplify and cleanup markers positioning code.
10462 * marker.c (attach_marker): More useful eassert.
10463 (live_buffer, set_marker_internal): New function.
10464 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10465 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10466
10467 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10470 as it's limited by the amount of memory, not by INT_MAX.
10471
10472 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10473
10474 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10475 in special-event-map. See the discussion at
10476 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10477 for the reasons.
10478
10479 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10480 info.dwItemData. Fixes crashes on 64-bit Windows.
10481 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10482
10483 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10484
10485 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10486 (conversationIdentifier): Return value is NSInteger.
10487 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10488
10489 2012-07-21 Chong Yidong <cyd@gnu.org>
10490
10491 * window.c (decode_any_window): Signal an error if the window is
10492 on a dead frame (Bug#11984).
10493
10494 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10495
10496 Add indirection counting to speed up Fkill_buffer.
10497 * buffer.h (struct buffer): New member.
10498 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10499 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10500 base buffer indirection counter.
10501 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10502 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10503 through buffer list if indirection counter is 0.
10504
10505 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10506
10507 Extend the value returned by Fgarbage_collect with heap statistics.
10508 * alloc.c (Qheap): New symbol.
10509 (syms_of_alloc): DEFSYM it.
10510 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10511 (Fmemory_free): Remove.
10512 (syms_of_alloc): Don't defsubr it.
10513 * buffer.c (Fcompact_buffer): Remove.
10514 (syms_of_buffer): Don't defsubr it.
10515
10516 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10517
10518 Make maybe_gc inline.
10519 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10520 * lisp.h (consing_since_gc, gc_relative_threshold)
10521 (memory_full_cons_threshold): Revert declaration.
10522 (maybe_gc): Remove prototype, define as inline.
10523 * alloc.c: Remove old commented-out code.
10524 (consing_since_gc, gc_relative_threshold)
10525 (memory_full_cons_threshold): Revert to global.
10526 (maybe_gc): Remove.
10527
10528 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10529
10530 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10531 * lisp.h (build_unibyte_string): New function.
10532 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10533 * sysdep.c, w32fns.c, xfns.c: Use it.
10534 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10535 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10536 Adjust users accordingly.
10537 * font.h (font_open_by_name): Adjust prototype.
10538
10539 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10540
10541 Cleanup calls to Fgarbage_collect.
10542 * lisp.h (maybe_gc): New prototype.
10543 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10544 Remove declarations.
10545 * alloc.c (maybe_gc): New function.
10546 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10547 Make them static.
10548 * bytecode.c (MAYBE_GC): Use maybe_gc.
10549 * eval.c (eval_sub, Ffuncall): Likewise.
10550 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10551 to avoid dependency from auto-save feature.
10552
10553 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10554
10555 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10556 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10557 'for_each_per_buffer_object_at'.
10558 All uses changed. It's better to use upper-case for macros that
10559 cannot be implemented as functions, to give the reader a clue
10560 that they're special.
10561
10562 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10563
10564 * alloc.c (Fgarbage_collect): Tweak docstring.
10565
10566 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10567
10568 Tweak the value returned from Fgarbage_collect again.
10569 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10570 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10571 Adjust documentation.
10572 (total_vector_bytes): Rename to total_vector_slots, adjust
10573 accounting.
10574 (total_free_vector_bytes): Rename to total_free_vector_slots,
10575 adjust accounting.
10576 (Qstring_bytes, Qvector_slots): New symbols.
10577 (syms_of_alloc): DEFSYM them.
10578
10579 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10580
10581 Buffer compaction primitive which may be used from Lisp.
10582 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10583 (syms_of_buffer): Register Fcompact_buffer.
10584 * alloc.c (Fgarbage_collect): Use compact_buffer.
10585 * buffer.h (compact_buffer): New prototype.
10586 (struct buffer_text): New member.
10587
10588 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10589
10590 New macro to iterate over all buffers, miscellaneous cleanups.
10591 * lisp.h (all_buffers): Remove declaration.
10592 * buffer.h (all_buffers): Add declaration, with comment.
10593 (for_each_buffer): New macro.
10594 * alloc.c (Fgarbage_collect, mark_object): Use it.
10595 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10596 (init_buffer): Likewise.
10597 * data.c (Fset_default): Likewise.
10598 * coding.c (code_conversion_restore): Remove redundant check
10599 for dead buffer.
10600 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10601
10602 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10603
10604 Fix bug that created negative-length intervals.
10605 * intervals.c (merge_interval_right, merge_interval_left):
10606 Do not zero out this interval if it is absorbed by its children,
10607 as this interval's total length doesn't change in that case. See
10608 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10609
10610 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10611
10612 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10613 when invoking (make-bool-vector N t) and N is a positive
10614 multiple of 8 -- the last 8 bits were mistakenly cleared.
10615
10616 Remove some struct layout assumptions in bool vectors.
10617 * alloc.c (bool_header_size): New constant.
10618 (header_size, word_size): Move earlier, as they're now used earlier.
10619 Use 'word_size' in a few more places, where it's appropriate.
10620 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10621 padding before the data member of a bool vector.
10622 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10623 than doing the check by hand with an abort ().
10624
10625 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10626
10627 * eval.c (Fdefvar): Don't check constants since we only set the var if
10628 it's not yet defined anyway (bug#11904).
10629
10630 * lisp.h (last_undo_boundary): Declare new var.
10631 * keyboard.c (command_loop_1): Set it.
10632 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10633 were auto-added by the command loop (bug#11774).
10634
10635 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10636
10637 * w32font.c (Qsymbol): Remove local definition.
10638 (syms_of_w32font): Don't DEFSYM it.
10639
10640 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10641
10642 Fix sweep_vectors to handle large bool vectors correctly.
10643 * alloc.c (sweep_vectors): Account total_vector_bytes for
10644 bool vectors larger than VBLOCK_BYTES_MAX.
10645
10646 2012-07-18 Chong Yidong <cyd@gnu.org>
10647
10648 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10649 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10650
10651 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10652
10653 Return more descriptive data from Fgarbage_collect.
10654 Suggested by Stefan Monnier in
10655 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10656 * alloc.c (bounded_number): New function.
10657 (total_buffers, total_vectors): New variable.
10658 (total_string_size): Rename to total_string_bytes, adjust users.
10659 (total_vector_size): Rename to total_vector_bytes, adjust users.
10660 (sweep_vectors): Account total_vectors and total_vector_bytes.
10661 (Fgarbage_collect): New return value. Adjust documentation.
10662 (gc_sweep): Account total_buffers.
10663 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10664 (VECTOR_SIZE): Remove.
10665 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10666 (Qinterval, Qmisc): New symbols.
10667 (syms_of_data): Initialize them.
10668 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10669 (Qcons, Qbuffer): New declarations.
10670
10671 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10672
10673 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10674 Round up, not down. Improve doc.
10675
10676 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10677
10678 Restore old code in allocate_string_data to avoid Faset breakage.
10679 Reported by Julien Danjou <julien@danjou.info> in
10680 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10681 * alloc.c (allocate_string_data): Restore old code with minor
10682 adjustments, fix comment to explain this subtle issue.
10683
10684 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10685
10686 Remove FILE_SYSTEM_CASE.
10687 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10688
10689 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10690 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10691 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10692 call-process-region passes it through expand-file-name.
10693
10694 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10695
10696 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10697
10698 Fix crash when creating indirect buffer (Bug#11917)
10699 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10700 Don't handle unbound variables specially if non-zero.
10701 (Fbuffer_local_variables): Pass zero.
10702 (clone_per_buffer_values): Pass non-zero.
10703
10704 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10705
10706 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10707 to make the loop interruptible.
10708
10709 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10710
10711 * gnutls.c (emacs_gnutls_handshake): Only retry if
10712 GNUTLS_E_INTERRUPTED.
10713
10714 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10715
10716 Cleanup and convert miscellaneous checks to eassert.
10717 * alloc.c (mark_interval): Fix comment, partially rephrase
10718 old comment from intervals.h (see below).
10719 * intervals.c (find_interval, adjust_intervals_for_insertion)
10720 (delete_interval, adjust_intervals_for_deletion)
10721 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10722 Convert to eassert.
10723 (adjust_intervals_for_insertion, make_new_interval):
10724 Remove obsolete and unused code.
10725 * intervals.h (struct interval): Remove obsolete comment.
10726 * textprotp.c (erase_properties): Remove unused code.
10727 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10728 (Fremove_list_of_text_properties): Convert to eassert.
10729
10730 2012-07-17 Chong Yidong <cyd@gnu.org>
10731
10732 * editfns.c (Finsert_char): Doc fix.
10733
10734 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10735
10736 Fix previous change to make Fmemory_free always accurate.
10737 * alloc.c (make_interval): Update total_free_intervals.
10738 (make_float): Likewise for total_free_floats.
10739 (free_cons, Fcons): Likewise for total_free_conses.
10740 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10741 Likewise for total_free_vector_bytes.
10742 (Fmake_symbol): Likewise for total_free_symbols.
10743 (bytes_free): Remove.
10744
10745 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10746
10747 Simple free memory accounting feature.
10748 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10749 (sweep_vectors): Accumulate size of free vectors.
10750 (Fgarbage_collect): Setup bytes_free.
10751 (Fmemory_free): New function.
10752 (syms_of_alloc): Register it.
10753
10754 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10755
10756 Cleanup overlays checking.
10757 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10758 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10759 eassert and OVERLAYP.
10760 (sort_overlays): Change to use OVERLAYP.
10761
10762 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10763
10764 * editfns.c (Finsert_char): Make it interactive, and make the
10765 second arg optional. Copy interactive spec and docstring from
10766 ucs-insert.
10767
10768 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10769
10770 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10771 Unlike the other wrapped functions, fabs has an unspecified
10772 effect on errno.
10773
10774 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10775
10776 * nsterm.m (keyDown): Interpret flags without left/right bits
10777 as the left key (Bug#11670).
10778
10779 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10780
10781 Remove empty and useless init functions.
10782 * lisp.h (init_character_once, init_fns, init_image)
10783 (init_filelock, init_sound): Remove prototype.
10784 * character.c (init_character_once): Remove.
10785 * filelock.c (init_filelock): Likewise.
10786 * fns.c (init_fns): Likewise.
10787 * image.c (init_image): Likewise.
10788 * sound.c (init_sound): Likewise.
10789 * emacs.c (main): Adjust accordingly.
10790
10791 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10792
10793 * gtkutil.h: Tiny cleanups.
10794 (use_old_gtk_file_dialog): Remove useless declaration.
10795 (xg_uses_old_file_dialog): Add suggested const attribute.
10796
10797 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10798
10799 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10800 (bidi_paragraph_init): Use it to limit search forward for a strong
10801 directional character in abnormally large paragraphs full of
10802 neutral or weak characters. (Bug#11943)
10803
10804 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10805
10806 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10807 the toolbar (Bug#9451).
10808 (xg_make_tool_item): Give the widget event box a transparent
10809 background.
10810
10811 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10812
10813 Cleanup basic allocation variables and functions.
10814 * alloc.c (ignore_warnings, init_intervals, init_float)
10815 (init_cons, init_symbol, init_marker): Remove.
10816 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10817 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10818 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10819 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10820 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10821 (staticidx, init_alloc_once, init_strings, free_ablock):
10822 Remove redundant initialization.
10823 * fns.c (init_weak_hash_tables): Remove.
10824 * lisp.h (init_weak_hash_tables): Remove prototype.
10825
10826 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10827
10828 Use zero_vector where appropriate.
10829 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10830 accordingly.
10831 * lisp.h (zero_vector): New declaration.
10832 * font.c (null_vector): Remove.
10833 (syms_of_font): Remove initialization and staticpro.
10834 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10835 * keymap.c (Faccessible_keymaps): Likewise.
10836
10837 2012-07-15 Leo Liu <sdl.web@gmail.com>
10838
10839 * fringe.c: Fix typo in comments.
10840
10841 2012-07-14 Leo Liu <sdl.web@gmail.com>
10842
10843 * fringe.c: Add a new bitmap exclamation-mark.
10844
10845 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10846
10847 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10848
10849 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10850 (HAVE_MENUS): Don't define, defined by editing config.in with
10851 msdos/sed2v2.inp.
10852 (GMALLOC_INHIBIT_VALLOC): Don't define.
10853 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10854
10855 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10856
10857 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10858
10859 2012-07-14 Glenn Morris <rgm@gnu.org>
10860
10861 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10862 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10863 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10864
10865 2012-07-13 Glenn Morris <rgm@gnu.org>
10866
10867 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10868
10869 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10870 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10871
10872 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10873
10874 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10875 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10876 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10877 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10878 where appropriate.
10879 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10880 as boolean expression.
10881 (x_set_window_size): Remove unused variable toolbar.
10882 (ns_get_color_default, ns_mod_to_lisp): Remove.
10883 (ns_mouse_position): Remove unused variables xchar and ychar.
10884 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10885 (ns_set_vertical_scroll_bar): Remove unused variable count.
10886 (ns_delete_terminal): Remove unused variable i.
10887 (ns_term_init): Remove unused variables r, g and b.
10888 (mouseDown): Remove unused variable window.
10889 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10890 (initFrameFromEmacs): Remove unused variable vbextra.
10891 (mouseEntered): Remove unused variables p and dpyinfo.
10892 (mouseExited): Remove unused variables p and r.
10893 (ns_define_frame_cursor, ns_clear_frame_area)
10894 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10895 (menuDown): Assign [sender tag] to variable and cast the variable.
10896
10897 * nsterm.h (menuDown): Add id as type to argument sender.
10898 (ns_display_info_for_name): Add Lisp_Object argument.
10899 (ns_term_init): Add Lisp_Object argument.
10900 (ns_map_event_to_object): Add void argument.
10901 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10902 prototype with arguments and only declare if __OBJC__.
10903 (nxatoms_of_nsselect): Add void argument.
10904 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10905 (ns_alloc_autorelease_pool): Add void argument.
10906 (ns_release_autorelease_pool): Add void* argument.
10907 (ns_get_defaults_value): Add const char* argument.
10908
10909 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10910 (initFromContents): Use SSDATA where appropriate.
10911 (ns_update_menubar): Add braces to ambigous if-else.
10912 (initWithTitle): Put () around assignment in if statement.
10913 (ns_menu_show): Remove unused variables window and keymap.
10914 (update_frame_tool_bar): Remove unused variable selected_p.
10915 (initWithContentRect): Remove unused variable this_cmd_name.
10916
10917 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10918 appropriate.
10919 (setXBMColor): Remove unused variable len.
10920 (setPixmapData): Put () around assignment in loop statement.
10921
10922 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10923 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10924 where appropriate.
10925 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10926 around assignment in loop statement.
10927 (nsfont_open): Remove unused variable i.
10928 (nsfont_open): Remove unused variable len.
10929 (nsfont_draw): Remove unused variable cs.
10930
10931 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10932 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10933 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10934 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10935 (Fns_font_name, Fns_perform_service)
10936 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10937 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10938 (ns_set_name): Remove unused variable view.
10939 (x_set_menu_bar_lines): Remove unused variable olines.
10940 (x_set_tool_bar_lines): Remove unused variable root_window.
10941 (Fns_list_colors): Put () around assignment in while statement.
10942 (Fns_perform_service): Remove unused variable len.
10943 (Fns_display_usable_bounds): Remove unused variable top.
10944 (syms_of_nsfns): Remove unused variable i.
10945
10946 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10947 memcpy (Bug#11907).
10948
10949 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10950
10951 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10952 and free it with DestroyExceptionInfo (Bug#11558).
10953
10954 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10955
10956 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10957 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10958 Set here, not in nt/config.nt.
10959
10960 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10961
10962 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10963 cursor overflow into the last glyph on display line when the right
10964 fringe is off. (Bug#11832)
10965
10966 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10967
10968 * xdisp.c (produce_special_glyphs): Now static.
10969 * dispextern.h (produce_special_glyphs): Remove decl.
10970
10971 2012-07-13 Glenn Morris <rgm@gnu.org>
10972
10973 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10974 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10975
10976 * s/usg5-4-common.h (USG, USG5):
10977 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10978 * s/sol2-6.h (SOLARIS2):
10979 * s/irix6-5.h (IRIX6_5):
10980 * s/hpux10-20.h (USG, USG5, HPUX):
10981 * s/gnu-linux.h (USG, GNU_LINUX):
10982 * s/freebsd.h (BSD_SYSTEM):
10983 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10984 * s/cygwin.h (CYGWIN):
10985 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10986 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10987
10988 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10989
10990 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10991
10992 2012-07-13 Glenn Morris <rgm@gnu.org>
10993
10994 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10995
10996 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10997
10998 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10999 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
11000
11001 2012-07-12 Glenn Morris <rgm@gnu.org>
11002
11003 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
11004
11005 * process.c (init_process_emacs): Rename from init_process.
11006 The old name is also the name of a Mach system call.
11007 * lisp.h, emacs.c: Update for this name change.
11008 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
11009 longer needed.
11010
11011 2012-07-12 Eli Zaretskii <eliz@gnu.org>
11012
11013 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
11014 memmove call that removes glyphs covered by the left truncation
11015 glyph. Improve commentary.
11016 (display_line): Fix display of continuation glyphs on GUI frames
11017 when the right fringe is turned off and variable-size fonts are
11018 used in the window. Move the code that appends a stretch glyph to
11019 produce_special_glyphs, so that it could be used for truncation
11020 and continuation glyphs alike.
11021 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
11022 glyph of a suitably computed width, to align the special glyphs at
11023 the window margin. Code moved from display_line. (Bug#11832)
11024
11025 2012-07-12 Glenn Morris <rgm@gnu.org>
11026
11027 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
11028
11029 * s/gnu-linux.h, s/hpux10-20.h:
11030 Do not unconditionally define HAVE_XRMSETDATABASE.
11031
11032 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
11033
11034 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
11035
11036 Fix typos that broke OS X build.
11037 Reported by Randal L. Schwartz in
11038 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11039 * nsterm.m (ns_timeout): Add missing local decl.
11040 (ns_get_color): snprintf -> sprintf, to fix typo.
11041
11042 2012-07-12 Glenn Morris <rgm@gnu.org>
11043
11044 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11045 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11046 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11047 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11048
11049 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11050 Move PTY_OPEN to configure.
11051
11052 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11053 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11054 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11055
11056 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11057
11058 Use empty_unibyte_string where applicable.
11059 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11060 * lread.c (read1): Likewise.
11061 * xsettings.c (syms_of_xsettings): Likewise.
11062
11063 2012-07-12 Glenn Morris <rgm@gnu.org>
11064
11065 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11066 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11067 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11068 * s/hpux10-20.h (RUN_TIME_REMAP):
11069 * s/bsd-common.h (TABDLY): Move to configure.
11070
11071 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11072
11073 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11074
11075 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11076 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11077
11078 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11079
11080 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11081 * s/template.h: Move NARROWPROTO to configure.
11082
11083 2012-07-11 Glenn Morris <rgm@gnu.org>
11084
11085 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11086 unused since 2011-01-17 change to systty.h.
11087
11088 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11089 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11090 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11091
11092 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11093
11094 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11095
11096 2012-07-11 Glenn Morris <rgm@gnu.org>
11097
11098 * s/darwin.h, s/gnu-linux.h, s/template.h:
11099 Move INTERRUPT_INPUT to configure.
11100
11101 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11102
11103 Minor adjustments to interning code.
11104 * lisp.h (intern, intern_c_string): Redefine as static inline
11105 wrappers for intern_1 and intern_c_string_1, respectively.
11106 (intern_1, intern_c_string_1): Rename prototypes.
11107 * lread.c (intern_1, intern_c_string_1, oblookup):
11108 Simplify Vobarray checking.
11109 * font.c (font_intern_prop): Likewise. Adjust comment.
11110 * w32font.c (intern_font_name): Likewise.
11111
11112 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11113
11114 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11115
11116 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11117 of Fcar/Fcdr if possible.
11118 * font.c (check_otf_features): Likewise.
11119 * fontset.c (Fnew_fontset): Likewise.
11120 * gnutls.c (Fgnutls_boot): Likewise.
11121 * minibuf.c (read_minibuf): Likewise.
11122 * msdos.c (IT_set_frame_parameters): Likewise.
11123 * xmenu.c (Fx_popup_dialog): Likewise.
11124 * w32menu.c (Fx_popup_dialog): Likewise.
11125
11126 2012-07-11 Glenn Morris <rgm@gnu.org>
11127
11128 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11129 since nothing has defined it on these platforms.
11130
11131 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11132 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11133
11134 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11135 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11136 Move CLASH_DETECTION to configure.
11137
11138 * s/gnu.h: Remove file, which is now empty.
11139
11140 * s/gnu.h, s/gnu-linux.h:
11141 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11142
11143 2012-07-11 John Wiegley <johnw@newartisans.com>
11144
11145 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11146 function attribute, so we only use it if it exists in the
11147 compiler.
11148
11149 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11150
11151 Avoid call to strlen in fast_c_string_match_ignore_case.
11152 * search.c (fast_c_string_match_ignore_case): Change to use
11153 length argument. Adjust users accordingly.
11154 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11155
11156 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 Assume mkdir, rmdir.
11159 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11160 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11161
11162 Assume rename.
11163 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11164
11165 Assume perror.
11166 * s/hpux10-20.h (HAVE_PERROR): Remove.
11167 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11168 Remove dummy definition, as this problem was obsolete long ago.
11169
11170 Assume strerror.
11171 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11172
11173 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11174
11175 Avoid calls to strlen in font processing functions.
11176 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11177 (font_open_by_name): Change to use length argument.
11178 Adjust users accordingly.
11179 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11180 Adjust prototypes.
11181 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11182 Change to return ptrdiff_t.
11183 (xfont_list_pattern, xfont_match): Use length returned by
11184 xfont_decode_coding_xlfd.
11185 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11186
11187 2012-07-11 Glenn Morris <rgm@gnu.org>
11188
11189 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11190 Move DONT_REOPEN_PTY to configure.
11191
11192 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11193 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11194
11195 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11196
11197 Remove "#define unix" that is no longer needed (Bug#11905).
11198 * s/aix4-2.h (unix): Remove; no longer needed.
11199
11200 EMACS_TIME simplification (Bug#11875).
11201 This replaces macros (which typically do not work in GDB)
11202 with functions, typedefs and enums, making the code easier to debug.
11203 The functional style also makes code easier to read and maintain.
11204 * systime.h: Include <sys/time.h> on all hosts, not just if
11205 WINDOWSNT, since 'struct timeval' is needed in general.
11206 (EMACS_TIME): Now a typedef, not a macro.
11207 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11208 not macros.
11209 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11210 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11211 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11212 (EMACS_TIME_LE): Now functions, not macros.
11213 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11214 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11215 which are not functions. All uses rewritten to use:
11216 (make_emacs_time): New function.
11217 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11218 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11219 not functions. All uses rewritten to use the following, respectively:
11220 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11221 (add_emacs_time, sub_emacs_time): New functions.
11222 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11223 * fileio.c (Fcopy_file):
11224 * xterm.c (XTflash): Get the current time closer to when it's used.
11225 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11226
11227 * bytecode.c (targets): Suppress -Woverride-init warnings.
11228
11229 Simplify by avoiding confusing use of strncpy etc.
11230 * doc.c (Fsnarf_documentation):
11231 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11232 * frame.c (Fmake_terminal_frame):
11233 * gtkutil.c (get_utf8_string):
11234 * lread.c (openp):
11235 * nsmenu.m (ns_update_menubar):
11236 * regex.c (regerror):
11237 Prefer memcpy to strncpy and strncat when either will do.
11238 * fileio.c (Fsubstitute_in_file_name):
11239 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11240 (menu_separator_name_p):
11241 * nsmenu.m (ns_update_menubar):
11242 Prefer memcmp to strncmp when either will do.
11243 * nsterm.m: Include <ftoastr.h>.
11244 (ns_get_color):
11245 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11246 Prefer snprintf to strncpy.
11247 * nsterm.m (ns_term_init):
11248 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11249 * nsterm.m (ns_term_init):
11250 Avoid the need for strncpy, by using build_string or
11251 make_unibyte_string directly. Use dtoastr, not snprintf.
11252 * process.c (Fmake_network_process): Diagnose service names that
11253 are too long, rather than silently truncating them or creating
11254 non-null-terminated names.
11255 (Fnetwork_interface_info): Likewise, for interface names.
11256 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11257 Prefer sprintf to strncat.
11258 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11259 Prefer vsnprintf to vsprintf + strncpy.
11260
11261 2012-07-10 Glenn Morris <rgm@gnu.org>
11262
11263 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11264 Clarify fallback case.
11265
11266 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11267
11268 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11269 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11270 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11271 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11272 where argument type is known to be a Lisp_Cons.
11273
11274 2012-07-10 Tom Tromey <tromey@redhat.com>
11275
11276 * bytecode.c (BYTE_CODE_THREADED): New macro.
11277 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11278 (enum byte_code_op): New type.
11279 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11280 (exec_byte_code): Use them. Use token threading when applicable.
11281
11282 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11283
11284 Optimize pure C strings initialization.
11285 * lisp.h (make_pure_string): Fix prototype.
11286 (build_pure_c_string): New function, defined as static inline. This
11287 provides a better opportunity to optimize away calls to strlen when
11288 the function is called with compile-time constant argument.
11289 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11290 argument, adjust users accordingly. Use build_pure_c_string where
11291 appropriate.
11292 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11293 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11294 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11295
11296 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11297
11298 Avoid calls to strlen in miscellaneous functions.
11299 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11300 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11301 * lread.c (openp): Likewise.
11302
11303 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11304
11305 Avoid calls to strlen in path processing functions.
11306 * fileio.c (file_name_as_directory): Add comment. Change to add
11307 srclen argument and return the length of result. Adjust users
11308 accordingly.
11309 (directory_file_name): Fix comment. Change to add srclen argument,
11310 swap 1st and 2nd arguments to obey the common convention.
11311 Adjust users accordingly.
11312 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11313
11314 2012-07-10 Glenn Morris <rgm@gnu.org>
11315
11316 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11317 Move PENDING_OUTPUT_COUNT definition to configure.
11318
11319 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11320 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11321 * s/gnu.h (DATA_START): Move definitions to configure.
11322
11323 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11324 We include usg5-4-common.h, which defines them both.
11325
11326 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11327 O_RDONLY already includes it).
11328
11329 Stop ns builds setting the EMACSLOADPATH environment variable.
11330 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11331 Now it does not set EMACSLOADPATH, just returns the load-path string.
11332 * nsterm.h: Update accordingly.
11333 * lread.c [HAVE_NS]: Include nsterm.h.
11334 (init_lread) [HAVE_NS]: Use ns_load_path.
11335 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11336
11337 2012-07-09 Glenn Morris <rgm@gnu.org>
11338
11339 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11340 since the included bsd-common.h does so.
11341
11342 Stop ns builds setting the EMACSPATH environment variable.
11343 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11344 (ns_init_paths): Do not set EMACSPATH.
11345 * nsterm.h (ns_exec_path): Add it.
11346 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11347 Use ns_exec_path.
11348
11349 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11350
11351 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11352
11353 * process.c (wait_reading_process_output): 'waitchannels' was unset
11354 when read_kbd || !NILP (wait_for_cell); fix this.
11355
11356 Add GCC-style 'const' attribute to functions that can use it.
11357 * character.h (char_resolve_modifier_mask):
11358 * keyboard.h (make_ctrl_char):
11359 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11360 (init_character_once, next_almost_prime, init_fns, init_image)
11361 (flush_pending_output, init_sound):
11362 * mem-limits.h (start_of_data):
11363 * menu.h (finish_menu_items):
11364 Add ATTRIBUTE_CONST.
11365 * emacs.c (DEFINE_DUMMY_FUNCTION):
11366 Declare the dummy function with ATTRIBUTE_CONST.
11367 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11368 Add decls with ATTRIBUTE_CONST.
11369
11370 Minor improvements to make_formatted_string.
11371 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11372 where int is good enough, as vsprintf returns an int.
11373 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11374
11375 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11376
11377 Use make_formatted_string to avoid double length calculation.
11378 * lisp.h (make_formatted_string): New prototype.
11379 * alloc.c (make_formatted_string): New function.
11380 * buffer.c (Fgenerate_new_buffer_name): Use it.
11381 * dbusbind.c (syms_of_dbusbind): Likewise.
11382 * editfns.c (Fcurrent_time_zone): Likewise.
11383 * filelock.c (get_boot_time): Likewise.
11384 * frame.c (make_terminal_frame, set_term_frame_name)
11385 (x_report_frame_params): Likewise.
11386 * image.c (gs_load): Likewise.
11387 * minibuf.c (get_minibuffer): Likewise.
11388 * msdos.c (dos_set_window_size): Likewise.
11389 * process.c (make_process): Likewise.
11390 * xdisp.c (ensure_echo_area_buffers): Likewise.
11391 * xsettings.c (apply_xft_settings): Likewise.
11392
11393 2012-07-09 Glenn Morris <rgm@gnu.org>
11394
11395 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11396 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11397 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11398 * nsterm.h (ns_etc_directory): Add it.
11399 * callproc.c [HAVE_NS]: Include nsterm.h.
11400 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11401
11402 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11403
11404 Move marker debugging code under MARKER_DEBUG.
11405 * marker.c (MARKER_DEBUG): Move marker debugging code under
11406 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11407 for bootstrap with --enable-checking (~3x slowdown reported
11408 by Juanma Barranquero <lekktu@gmail.com>).
11409 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11410
11411 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11412
11413 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11414 See <http://bugs.gnu.org/11825#29>.
11415
11416 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11417
11418 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11419 has no font, use the frame's font. (Bug#11813)
11420 (display_line): Add commentary about displaying truncation glyphs
11421 on GUI frames.
11422 (produce_special_glyphs): Move here from term.c.
11423
11424 * term.c (produce_special_glyphs): Move to xdisp.c.
11425
11426 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11427 section.
11428
11429 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11430
11431 * xdisp.c (display_line): Avoid warning about implicit declaration
11432 of FRAME_FONT.
11433
11434 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11435
11436 * lisp.h: Remove empty conditional.
11437
11438 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * lread.c (load_path_check): Now static.
11441
11442 Fix some minor --with-ns problems found by static checking.
11443 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11444 (x_set_font) [!HAVE_X_WINDOWS]:
11445 * image.c (xpm_load_image) [HAVE_NS]:
11446 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11447 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11448 Remove unused local.
11449 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11450 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11451 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11452 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11453 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11454 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11455 Fix pointer signedness problem.
11456 * xfaces.c (FRAME_X_FONT_TABLE):
11457 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11458
11459 2012-07-07 Glenn Morris <rgm@gnu.org>
11460
11461 * lread.c (load_path_check): New function, split from init_lread.
11462 (init_lread): Reorganize. Motivation:
11463 If EMACSLOADPATH is set, check/warn about that rather than the
11464 defaults, which we are not going to use. Hence we can remove
11465 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11466 Don't warn if site-lisp directories are missing.
11467 If not installed, start from a blank load-path, since
11468 PATH_LOADSEARCH refers to the eventual installation directories.
11469
11470 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11471
11472 Support truncation and continuation glyphs on GUI frames, when
11473 fringes are disabled. (Bug#11832)
11474 * xdisp.c (init_iterator): Get dimensions of truncation and
11475 continuation glyphs even if on GUI frames.
11476 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11477 or both, are absent.
11478 (start_display, move_it_in_display_line_to): Handle the case of a
11479 GUI frame without a fringe to display continuation or truncation
11480 glyphs.
11481 (insert_left_trunc_glyphs): Support GUI frames: make sure
11482 truncation glyphs overwrite enough glyphs from the current line to
11483 have sufficient space in pixels.
11484 (display_line): Support truncation and continuation glyphs on GUI
11485 frames. If some spare pixels are left on the line after inserting
11486 the truncation glyphs, fill that space with a stretch glyph of a
11487 suitably computed width.
11488
11489 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11490 produce_glyphs, to support GUI sessions.
11491
11492 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11493
11494 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11495
11496 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11497
11498 Do not require float-time's arg to fit in time_t (Bug#11825).
11499 This works better on hosts where time_t is unsigned, and where
11500 float-time is applied to the (negative) difference between two times.
11501 * editfns.c (decode_time_components): Last arg is now double *,
11502 not int *, and means to store all the result as a double, without
11503 worrying about whether the seconds part fits in time_t.
11504 All callers changed.
11505 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11506 All callers changed.
11507 (Ffloat_time): Do not fail merely because the specified time falls
11508 outside of time_t range.
11509
11510 2012-07-07 Glenn Morris <rgm@gnu.org>
11511
11512 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11513 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11514 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11515
11516 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11517
11518 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11519 Update dependencies.
11520
11521 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11522
11523 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11526 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11527 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11528 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11529 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11530 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11531
11532 * xfont.c (compare_font_names): Redo to omit the need for casts.
11533
11534 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11535
11536 * xfns.c (Fx_change_window_property): Doc fix.
11537 * w32fns.c (Fx_change_window_property): Doc fix.
11538
11539 * w32fns.c (Fx_window_property): Accept the same arguments as the
11540 X Windows version. Doc fix.
11541 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11542
11543 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11544 Eli Zaretskii <eliz@gnu.org>
11545
11546 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11547 Windows-specific code from nt/config.nt moved here.
11548 Obsolete settings removed.
11549
11550 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11551
11552 * process.c: Avoid unnecessary calls to gettime.
11553 (wait_reading_process_output): Don't get the time of day
11554 when gobbling data immediately and not waiting, as there's no need
11555 for it in that case. This removes a FIXME.
11556
11557 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11558
11559 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11560 is defined (Bug#11768).
11561
11562 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11563
11564 Fix marker debugging code.
11565 * marker.c (byte_char_debug_check): Do not perform the check
11566 if buffer is not multibyte.
11567 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11568 Call byte_char_debug_check with correct arguments.
11569
11570 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11571
11572 Compile marker debugging code only if ENABLE_CHECKING is defined.
11573 * marker.c (byte_char_debug_check, count_markers):
11574 Use only if ENABLE_CHECKING is defined.
11575 (byte_debug_flag): Remove.
11576 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11577 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11578
11579 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11580
11581 Avoid code repetition in marker-related functions.
11582 * marker.c (attach_marker): New function.
11583 (Fset_marker, set_marker_restricted, set_marker_both)
11584 (set_marker_restricted_both): Use it.
11585 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11586 Consistently rename charno to charpos.
11587 (marker_position): Add eassert.
11588 (marker_byte_position): Convert to eassert.
11589
11590 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11591
11592 Simplify list operations in unchain_overlay and unchain_marker.
11593 * buffer.c (unchain_overlay): Simplify. Add comment.
11594 * marker.c (unchain_marker): Simplify. Fix comments.
11595
11596 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11597
11598 Introduce fast path for the widely used marker operation.
11599 * alloc.c (build_marker): New function.
11600 * lisp.h (build_marker): New prototype.
11601 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11602 * composite.c (autocmp_chars): Likewise.
11603 * editfns.c (buildmark): Remove.
11604 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11605 (save_restriction_save): Use build_marker.
11606 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11607 * window.c (save_window_save): Likewise.
11608
11609 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11610
11611 Do not use Fdelete_overlay in delete_all_overlays
11612 to avoid redundant calls to unchain_overlay.
11613 * buffer.c (drop_overlay): New function.
11614 (delete_all_overlays, Fdelete_overlay): Use it.
11615 * minibuf.c (get_minibuffer): Fix comment.
11616
11617 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11618
11619 Port to OpenBSD 5.1 amd64.
11620 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11621 This is needed for OpenBSD, and should be harmless on all BSD systems.
11622 Also, include <sys/sysctl.h>, as it should be available on all
11623 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11624 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11625 use p_pid member, not kp_proc.pid.
11626
11627 2012-07-06 Glenn Morris <rgm@gnu.org>
11628
11629 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11630
11631 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11632
11633 More xmalloc and related cleanup.
11634 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11635 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11636 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11637 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11638 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11639 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11640 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11641 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11642 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11643 * xterm.c:
11644 Omit needless casts involving void * pointers and allocation.
11645 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11646 as the former is more robust if P's type is changed.
11647 Prefer xzalloc to xmalloc + memset 0.
11648 Simplify malloc-or-realloc to realloc.
11649 Don't worry about xmalloc returning a null pointer.
11650 Prefer xstrdup to xmalloc + strcpy.
11651 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11652 growing it.
11653 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11654 alloca of a constant.
11655
11656 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11657
11658 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11659 hscroll is larger than the line width. Fixes long and futile
11660 looping inside extend_face_to_end_of_line (on a TTY) producing
11661 glyphs that are not needed and thrown away.
11662
11663 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11664
11665 * marker.c (set_marker_restricted_both): Simplify by using
11666 clip_to_bounds.
11667
11668 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11669
11670 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11671
11672 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11673
11674 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11675 not defined (Bug#11768).
11676 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11677 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11678 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11679 followed by gtk_box_set_homogeneous (Bug#11768).
11680 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11681 (update_theme_scrollbar_width, xg_create_scroll_bar):
11682 Use gtk_scrollbar_new (Bug#11768).
11683 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11684 (is_box_type): New function (Bug#11768).
11685 (xg_tool_item_stale_p): Call is_box_type.
11686 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11687 with default display (Bug#11768).
11688
11689 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11690
11691 * xdisp.c (window_hscroll_limited): New function.
11692 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11693 coordinates when window's hscroll is set to insanely large
11694 values. (Bug#11857)
11695
11696 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11697
11698 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11699 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11700
11701 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11702
11703 Cleanup xmalloc.
11704 * lisp.h (xzalloc): New prototype. Omit needless casts.
11705 * alloc.c (xzalloc): New function. Omit needless casts.
11706 * charset.c: Omit needless casts. Convert all calls to
11707 xmalloc with following memset to xzalloc.
11708 * dispnew.c: Likewise.
11709 * fringe.c: Likewise.
11710 * image.c: Likewise.
11711 * sound.c: Likewise.
11712 * term.c: Likewise.
11713 * w32fns.c: Likewise.
11714 * w32font.c: Likewise.
11715 * w32term.c: Likewise.
11716 * xfaces.c: Likewise.
11717 * xfns.c: Likewise.
11718 * xterm.c: Likewise.
11719 * atimer.c: Omit needless casts.
11720 * buffer.c: Likewise.
11721 * callproc.c: Likewise.
11722 * ccl.c: Likewise.
11723 * coding.c: Likewise.
11724 * composite.c: Likewise.
11725 * doc.c: Likewise.
11726 * doprnt.c: Likewise.
11727 * editfns.c: Likewise.
11728 * emacs.c: Likewise.
11729 * eval.c: Likewise.
11730 * filelock.c: Likewise.
11731 * fns.c: Likewise.
11732 * gtkutil.c: Likewise.
11733 * keyboard.c: Likewise.
11734 * lisp.h: Likewise.
11735 * lread.c: Likewise.
11736 * minibuf.c: Likewise.
11737 * msdos.c: Likewise.
11738 * print.c: Likewise.
11739 * process.c: Likewise.
11740 * region-cache.c: Likewise.
11741 * search.c: Likewise.
11742 * sysdep.c: Likewise.
11743 * termcap.c: Likewise.
11744 * terminal.c: Likewise.
11745 * tparam.c: Likewise.
11746 * w16select.c: Likewise.
11747 * w32.c: Likewise.
11748 * w32reg.c: Likewise.
11749 * w32select.c: Likewise.
11750 * w32uniscribe.c: Likewise.
11751 * widget.c: Likewise.
11752 * xdisp.c: Likewise.
11753 * xmenu.c: Likewise.
11754 * xrdb.c: Likewise.
11755 * xselect.c: Likewise.
11756
11757 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11758
11759 * fileio.c (time_error_value): Check the right error number.
11760 Problem reported by Troels Nielsen in
11761 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11762
11763 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11764
11765 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11766 This should be fixed in a better way; see Eli Zaretskii in
11767 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11768 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11769
11770 * fileio.c (time_error_value): Rename from special_mtime.
11771 The old name's problems were noted by Eli Zaretskii in
11772 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11773
11774 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11775 This variable's comment says Emacs needs at least one GDB-visible
11776 symbol of type enum pvec_type, to work around GDB problems.
11777 The symbol's value doesn't matter.
11778
11779 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11780 that causes compilation to fail on pre-C99 compilers.
11781
11782 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11783
11784 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11785 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11786
11787 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11788
11789 * buffer.c (init_buffer_once): Fix initialization of
11790 headers for buffer_defaults and buffer_local_symbols.
11791 Reported by Juanma Barranquero <lekktu@gmail.com>.
11792
11793 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11794
11795 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11796 * lisp.h (enum pvec_type): Use fewer bits.
11797 (PSEUDOVECTOR_SIZE_BITS): New constant.
11798 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11799 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11800 change in pvec_type.
11801 (PSEUDOVECTOR_TYPEP): New macro.
11802 (TYPED_PSEUDOVECTORP): Use it.
11803 * fns.c (internal_equal): Adapt code to extract pvectype.
11804 * emacs.c (gdb_pvec_type): Update type.
11805 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11806 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11807 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11808 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11809 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11810 abusing vector->header.next.nbytes.
11811 (live_vector_p): Use PVEC_TYPE.
11812 (mark_object): Adapt code to extract pvectype. Use switch.
11813
11814 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11815
11816 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11817 Tighten new eassert a bit.
11818
11819 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11820
11821 Fix compilation with --enable-gcc-warnings and -O1
11822 optimization level.
11823 * doprnt.c (doprnt): Change type of tem to int, initialize
11824 to avoid compiler warning. Add eassert.
11825 * search.c (simple_search): Initialize match_byte to avoid
11826 compiler warning. Add eassert.
11827
11828 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11829
11830 Avoid weird behavior with large horizontal scrolls.
11831 Without this change, for example, large hscroll values would
11832 mess up Emacs's display on Fedora 15 x86, presumably due to
11833 overflows in int calculations in the display code.
11834 Also, if buffers had long lines, Emacs would freeze.
11835 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11836 (set_window_hscroll): New function, containing the old guts of
11837 Fset_window_hscroll. Return the clipped value.
11838 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11839 This avoids the need to check against PTRDIFF_MAX.
11840
11841 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11842
11843 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11844
11845 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11846
11847 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11848
11849 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11850 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11851 since GCC 4.4.6 issues a bogus warning for them.
11852
11853 Fix bugs in file timestamp newness comparisons.
11854 * fileio.c (Ffile_newer_than_file_p):
11855 * lread.c (Fload): Use full timestamp resolution of files,
11856 not just the 1-second resolution, so that files that are only
11857 slightly newer still count as newer.
11858 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11859 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11860
11861 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 * fileio.c: Improve handling of file time marker. (Bug#11852)
11864 (special_mtime): New function.
11865 (Finsert_file_contents, Fverify_visited_file_modtime):
11866 Use it to set special mtime values consistently.
11867
11868 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11869
11870 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11871 marker for non-existing file. (Bug#11852)
11872
11873 2012-07-03 Glenn Morris <rgm@gnu.org>
11874
11875 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11876 and did not make it into globals.h).
11877
11878 2012-07-03 Tom Tromey <tromey@redhat.com>
11879
11880 * window.c (Fset_window_margins, Fset_window_fringes)
11881 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11882 * textprop.c (Fprevious_property_change): No longer static.
11883 * syntax.c (Fsyntax_table_p): No longer static.
11884 * process.c (Fget_process, Fprocess_datagram_address): No longer
11885 static.
11886 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11887 * keyboard.c (Fcommand_execute): No longer static.
11888 Remove EXFUN.
11889 * insdel.c (Fcombine_after_change_execute): No longer static.
11890 * image.c (Finit_image_library): No longer static.
11891 * fileio.c (Fmake_symbolic_link): No longer static.
11892 * eval.c (Ffetch_bytecode): No longer static.
11893 * editfns.c (Fuser_full_name): No longer static.
11894 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11895 No longer static.
11896 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11897 static.
11898 * dired.c (Ffile_attributes): No longer static.
11899 * composite.c (Fcomposition_get_gstring): No longer static.
11900 * callproc.c (Fgetenv_internal): No longer static.
11901
11902 * ccl.h: Remove EXFUNs.
11903 * buffer.h: Remove EXFUNs.
11904 * dispextern.h: Remove EXFUNs.
11905 * intervals.h: Remove EXFUNs.
11906 * fontset.h: Remove EXFUN.
11907 * font.h: Remove EXFUNs.
11908 * dosfns.c (system_process_attributes): Remove EXFUN.
11909 * keymap.h: Remove EXFUNs.
11910 * lisp.h: Remove EXFUNs.
11911 * w32term.h: Remove EXFUNs.
11912 * window.h: Remove EXFUNs.
11913 * xsettings.h: Remove EXFUN.
11914 * xterm.h: Remove EXFUN.
11915
11916 2012-07-03 Glenn Morris <rgm@gnu.org>
11917
11918 * lisp.h (Frandom): Make it visible to C.
11919 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11920 buffer for invisible buffers. (Bug#1229)
11921
11922 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11923
11924 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11925 values which aren't power of 2.
11926 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11927 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11928 accordingly.
11929
11930 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11931
11932 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11933
11934 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11935
11936 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11937
11938 * alloc.c (allocate_vector_block): Remove redundant
11939 calls to mallopt if DOUG_LEA_MALLOC is defined.
11940 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11941 avoid calls to mallopt if zero_vector is returned.
11942
11943 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11944
11945 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11946 is enabled, avoid dereferencing NULL current_sblock if
11947 running undumped.
11948
11949 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11950
11951 Cleanup basic buffer management.
11952 * buffer.h (struct buffer): Change layout to use generic vector
11953 marking code. Fix some comments. Change type of 'clip_changed'
11954 to bitfield. Remove unused #ifndef old.
11955 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11956 (GET_OVERLAYS_AT): Fix indentation.
11957 (for_each_per_buffer_object_at): New macro.
11958 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11959 (Fbuffer_local_variables): Use it.
11960 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11961 * alloc.c (allocate_buffer): Adjust to match new layout of
11962 struct buffer. Fix comment.
11963 (mark_overlay): New function.
11964 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11965 Lisp area of struct buffer.
11966 (mark_object): Use it. Adjust marking of misc objects
11967 and related comments.
11968
11969 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11970
11971 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11972 wrapper that is not needed because the wrapped code is a no-op (zero
11973 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11974 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11975
11976 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11977
11978 * alloc.c (mark_buffer): Simplify. Remove prototype.
11979 (mark_object): Add comment. Reorganize marking of vector-like
11980 objects. Use CHECK_LIVE for all vector-like objects except buffers
11981 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11982 Avoid redundant calls to mark_vectorlike for bool vectors.
11983
11984 2012-06-30 Glenn Morris <rgm@gnu.org>
11985
11986 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11987
11988 * epaths.in (PATH_SITELOADSEARCH): New.
11989 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11990 This is rather than relying on --enable-locallisppath elements
11991 having "site-lisp" in their names. (Bug#10208#25, 11658)
11992
11993 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11994
11995 * w32proc.c (sys_select): Accept and ignore one more argument.
11996
11997 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11998
11999 * sysselect.h [DOS_NT]: Don't include sys/select.h.
12000 (pselect) [!MS_DOS]: Redirect to sys_select.
12001
12002 * sysdep.c: Don't include dos.h and dosfns.h.
12003
12004 * process.c (sys_select):
12005 * msdos.c (sys_select): Accept one more argument and ignore it.
12006
12007 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
12008 adapt data types and code to that.
12009
12010 * dosfns.c:
12011 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
12012 which clashes with the gnulib function of the same name.
12013
12014 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
12015
12016 * font.c (font_style_to_value, font_style_symbolic)
12017 (font_prop_validate_style): Add type checks for values in
12018 font_style_table.
12019
12020 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
12021 argument.
12022 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
12023 uses.
12024
12025 2012-06-29 Eli Zaretskii <eliz@gnu.org>
12026
12027 * xdisp.c (try_window_id): Undo last change.
12028
12029 * w32.c (getwd): Adjust commentary about startup_dir.
12030 (init_environment): Always call sys_access, even in non-MSVC
12031 builds. Don't chdir to the directory of the Emacs executable.
12032 This undoes code from 1997 which was justified by the need to
12033 "avoid conflicts when removing and renaming directories". But its
12034 downside was that every relative file name was being interpreted
12035 relative to the directory of the Emacs executable, which can never
12036 be TRT. In particular, it broke sys_access when called with
12037 relative file names.
12038 (sys_access): Map GetLastError to errno.
12039
12040 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12041
12042 * window.h (struct window): Change type of 'fringes_outside_margins'
12043 to bitfield. Fix comment. Adjust users accordingly.
12044 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12045 Adjust comment.
12046 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12047 to ptrdiff_t.
12048
12049 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12050
12051 * gnutls.c (emacs_gnutls_handshake):
12052 Add QUIT to make the loop interruptible.
12053
12054 2012-06-29 Glenn Morris <rgm@gnu.org>
12055
12056 * charset.c (init_charset): Make lack of etc/charsets fatal.
12057
12058 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12059
12060 * editfns.c (region_limit): Fix type mismatch.
12061
12062 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12063
12064 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12065 undefined. Convert from xassert to eassert.
12066 * nsmenu.m: Convert from xassert to eassert.
12067 * nsterm.m: Likewise.
12068
12069 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12070
12071 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12072
12073 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12074
12075 Avoid integer overflow on scroll-left and scroll-right.
12076 * window.c (HSCROLL_MAX): New macro.
12077 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12078 overflow when requested scroll falls outside ptrdiff_t range.
12079
12080 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12081
12082 * window.h (struct window): Change type of 'hscroll',
12083 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12084 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12085 Adjust users accordingly.
12086 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12087 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12088 from EMACS_INT to ptrdiff_t.
12089 (make_window): Omit redundant initialization.
12090
12091 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
12092
12093 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12094
12095 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12096
12097 * window.h (struct window): Change type of 'use_time' and
12098 'sequence_number' from Lisp_Object to int.
12099 * frame.c (make_frame): Adjust users accordingly.
12100 * print.c (print_object): Likewise.
12101 * window.c (select_window, Fwindow_use_time, make_parent_window)
12102 (make_window): Likewise.
12103
12104 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12105
12106 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12107 enabled with --enable-checking=[all,glyphs] configure option.
12108 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12109 adjust comments accordingly.
12110 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12111 undefined, adjust comments accordingly.
12112 * image.c: Likewise.
12113 * scroll.c: Likewise.
12114 * w32fns.c: Likewise.
12115 * w32term.c: Likewise.
12116 * xdisp.c: Likewise.
12117 * xfaces.c: Likewise.
12118 * xfns.c: Likewise.
12119 * xterm.c: Likewise.
12120
12121 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12122
12123 Generalize run-time debugging checks.
12124 * dispextern.h (XASSERTS): Remove.
12125 * fontset.c (xassert): Remove.
12126 Convert from xassert to eassert.
12127 * alloc.c: Convert from xassert to eassert.
12128 * bidi.c: Likewise.
12129 * dispnew.c: Likewise.
12130 * fns.c: Likewise.
12131 * fringe.c: Likewise.
12132 * ftfont.c: Likewise.
12133 * gtkutil.c: Likewise.
12134 * image.c: Likewise.
12135 * keyboard.c: Likewise.
12136 * menu.c: Likewise.
12137 * process.c: Likewise.
12138 * scroll.c: Likewise.
12139 * sound.c: Likewise.
12140 * term.c: Likewise.
12141 * w32console.c: Likewise.
12142 * w32fns.c: Likewise.
12143 * w32term.c: Likewise.
12144 * window.c: Likewise.
12145 * xdisp.c: Likewise.
12146 * xfaces.c: Likewise.
12147 * xfns.c: Likewise.
12148 * xselect.c: Likewise.
12149 * xterm.c: Likewise.
12150
12151 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12152
12153 * fns.c (maybe_resize_hash_table): Output message when growing the
12154 purify-hashtable.
12155
12156 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12157
12158 * alloc.c (allocate_string_data): Remove dead code.
12159 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12160 avoid GCC warning about unused macro.
12161
12162 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12163
12164 * alloc.c (allocate_string): Omit intervals initialization.
12165 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12166 as in make_pure_string and make_pure_c_string.
12167
12168 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12169
12170 * alloc.c (allocate_string): Fix last change.
12171
12172 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12173
12174 * alloc.c (allocate_string): Remove two redundant calls
12175 to memset, add explicit initialization where appropriate.
12176
12177 2012-06-27 Glenn Morris <rgm@gnu.org>
12178
12179 * lisp.mk (lisp): Remove paths.elc.
12180
12181 2012-06-27 Chong Yidong <cyd@gnu.org>
12182
12183 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12184
12185 2012-06-26 John Wiegley <johnw@newartisans.com>
12186
12187 * unexmacosx.c (copy_data_segment): Add two section names used
12188 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12189
12190 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12191 when building with Clang.
12192
12193 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12194
12195 * eval.c (Fapply): Allow calling it with a single argument.
12196
12197 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12198
12199 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12200 _stricmp and _strnicmp.
12201 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12202
12203 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12204
12205 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12206 allocated window.
12207 (allocate_process): Likewise for new process.
12208 (allocate_terminal): Change to use offsetof.
12209 (allocate_frame): Likewise.
12210 * frame.c (make_frame): Omit redundant initialization.
12211 * window.c (make_parent_window): Use memset.
12212 (make_window): Omit redundant initialization.
12213 * process.c (make_process): Omit redundant initialization.
12214 * terminal.c (create_terminal): Likewise.
12215
12216 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12217
12218 * term.c (delete_tty): Remove redundant call to memset.
12219
12220 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12221
12222 * alloc.c: Remove build_string.
12223 * lisp.h: Define build_string as static inline. This provides
12224 a better opportunity to optimize away calls to strlen when the
12225 function is called with compile-time constant argument.
12226 * image.c (imagemagick_error): Convert to build_string.
12227 * w32proc.c (sys_spawnve): Likewise.
12228 * xterm.c (x_term_init): Likewise.
12229
12230 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12231
12232 Use sprintf return value instead of invoking strlen on result.
12233 In the old days this wasn't portable, since some sprintf
12234 implementations returned char *. But they died out years ago and
12235 Emacs already assumes sprintf returns int.
12236 Similarly for float_to_string.
12237 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12238 * ccl.c (ccl_driver):
12239 * character.c (string_escape_byte8):
12240 * data.c (Fnumber_to_string):
12241 * doprnt.c (doprnt):
12242 * print.c (print_object):
12243 * xdisp.c (message_dolog):
12244 * xfns.c (syms_of_xfns):
12245 Use sprintf or float_to_string result to avoid need to call strlen.
12246 * data.c (Fnumber_to_string):
12247 Use make_unibyte_string, since the string must be ASCII.
12248 * lisp.h, print.c (float_to_string): Now returns int length.
12249 * term.c (produce_glyphless_glyph):
12250 Use sprintf result rather than recomputing it.
12251
12252 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12253 * Makefile.in (ALL_CFLAGS):
12254 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12255 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12256
12257 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12258
12259 * dispextern.h (xstrcasecmp): Define to library function
12260 strcasecmp if available.
12261 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12262
12263 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12264
12265 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12266 Avoid comma operator.
12267 * menu.c (push_submenu_start, push_submenu_end)
12268 (push_left_right_boundary, push_menu_pane): Likewise.
12269 * msdos.c (dos_rawgetc): Likewise.
12270
12271 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12272
12273 * xfns.c (xic_create_fontsetname): Remove redundant calls
12274 to memset.
12275
12276 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12277
12278 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12279 sprintf already null-terminates its output.
12280
12281 * xfns.c (x_window): Remove redundant cast.
12282
12283 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12284
12285 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12286 `const char *' to `char *' to avoid compiler warning.
12287
12288 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12289
12290 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12291 instead of truncating it to 63 (admittedly a generous limit).
12292
12293 * process.c: Fix spelling and caps in comments.
12294
12295 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12296
12297 * emacs.c (setpgrp): Remove definition, unused.
12298 * sysdep.c (setpgrp): Remove definition, not used in this file.
12299
12300 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12301
12302 * makefile.w32-in: Update dependencies.
12303
12304 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12305
12306 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12307 (SYSTIME_H): Add nt/inc/sys/time.h.
12308
12309 * systime.h [WINDOWSNT]: Include sys/time.h.
12310
12311 * s/ms-w32.h (struct timespec): Definition moved from
12312 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12313
12314 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12315
12316 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12317 * buffer.h (buffer_slot_type_mismatch):
12318 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12319 * eval.c (unwind_to_catch):
12320 * image.c (my_png_error, my_error_exit):
12321 * keyboard.c (quit_throw_to_read_char, user_error)
12322 (Fexit_recursive_edit, Fabort_recursive_edit):
12323 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12324 (wrong_type_argument, buffer_overflow, __executable_start)
12325 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12326 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12327 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12328 (fatal):
12329 (child_setup) [!DOS_NT]:
12330 * lread.c (end_of_file_error, invalid_syntax):
12331 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12332 * puresize.h (pure_write_error):
12333 * search.c (matcher_overflow):
12334 * sound.c (sound_perror, alsa_sound_perror):
12335 * sysdep.c, syssignal.h (croak):
12336 * term.c (maybe_fatal, vfatal):
12337 * textprop.c (text_read_only):
12338 * undo.c (user_error):
12339 * unexmacosx.c (unexec_error):
12340 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12341 Use _Noreturn rather than NO_RETURN.
12342 No need for separate decl merely because of _Noreturn.
12343 * sound.c (sound_warning, parse_sound):
12344 Remove unnecessary forward decls.
12345
12346 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12347
12348 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12349 * lisp.h (WAIT_READING_MAX): New macro.
12350 * dispnew.c (Fsleep_for, sit_for):
12351 * keyboard.c (kbd_buffer_get_event):
12352 * process.c (Faccept_process_output):
12353 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12354 This improves on the previous patch, which introduced a bug
12355 when time_t is unsigned and as wide as intmax_t.
12356 See <http://bugs.gnu.org/9000#51>.
12357
12358 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12359
12360 * dispnew.c (sit_for, Fsleep_for):
12361 * keyboard.c (kbd_buffer_get_event):
12362 * process.c (Faccept_process_output): Avoid compiler warnings when
12363 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12364
12365 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12366
12367 * makefile.w32-in: Update dependencies.
12368
12369 * w32.c (ltime): Add return type and declare static.
12370 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12371
12372 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12373
12374 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12375 Privately reported by Herbert J. Skuhra.
12376 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12377 All uses changed.
12378 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12379 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12380
12381 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12382
12383 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12384 last argument of make_unibyte_string.
12385
12386 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12387 language ID in the event parameters.
12388
12389 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12390 event.code, not the obscure "character set ID".
12391
12392 2012-06-23 Chong Yidong <cyd@gnu.org>
12393
12394 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12395
12396 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12397
12398 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12399 * w32.c (fdutimens): New function.
12400
12401 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12402
12403 * s/ms-w32.h (pselect): Redirect to sys_select.
12404
12405 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12406
12407 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12408 in the logic of incrementing and decrementing the value of
12409 use_relocatable_buffers.
12410
12411 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12412
12413 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12414 Privately reported by Herbert J. Skuhra.
12415 [__FreeBSD__]: Remove "*/" typo after "#include".
12416 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12417 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12418 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12419 Don't assume EMACS_TIME and struct timeval are the same type.
12420
12421 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12422
12423 Support higher-resolution time stamps (Bug#9000).
12424 The time stamps are only nanosecond-resolution at the C level,
12425 since that's the best that any real-world system supports now.
12426 But they are picosecond-resolution at the Lisp level, as that's
12427 easy, and leaves room for future OS improvements.
12428
12429 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12430 (LIBES): Use it.
12431
12432 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12433 Don't get current time unless it's needed.
12434
12435 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12436 now provides it if it's absent.
12437 (start_atimer): Port to higher-res time stamps.
12438 Check for time stamp overflow. Don't get current time more
12439 often than is needed.
12440
12441 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12442 Include systime.h, not time.h.
12443 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12444
12445 * dired.c: Include stat-time.h.
12446 (Ffile-attributes): File times now have higher resolution.
12447
12448 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12449 (struct image): Timestamp now has higher resolution.
12450
12451 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12452 has at least microseconds now. All uses removed.
12453 (update_frame, update_single_window, update_window, update_frame_1)
12454 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12455 (duration_to_sec_usec): Remove; no longer needed.
12456
12457 * editfns.c (time_overflow): Now extern.
12458 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12459 (float-time, Fformat_time_string, Fcurrent_time_string)
12460 (Fcurrent_time_zone): Accept and generate higher-resolution
12461 time stamps.
12462 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12463 (decode_time_components, lisp_seconds_argument): New functions.
12464 (make_time): Now static.
12465 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12466 Report an error if the time is invalid, rather than having the caller
12467 do that.
12468
12469 * fileio.c: Include <stat-time.h>
12470 (Fcopy_file): Copy higher-resolution time stamps.
12471 Prefer to set the time stamp via a file descriptor if that works.
12472 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12473 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12474 (Fvisited_file_modtime, Fset_visited_file_modtime):
12475 Support higher-resolution time stamps.
12476
12477 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12478
12479 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12480
12481 * image.c (prepare_image_for_display, clear_image_cache)
12482 (lookup_image): Port to higer-resolution time stamps.
12483
12484 * keyboard.c (start_polling, bind_polling_period):
12485 Check for time stamp overflow.
12486 (read_char, kbd_buffer_get_event, timer_start_idle)
12487 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12488 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12489 Port to higher-resolution time stamps. Do not assume time_t is signed.
12490 (decode_timer): New function. Timers are now vectors of length 9,
12491 not 8, to accommodate the picosecond component.
12492 (timer_check_2): Use it.
12493
12494 * nsterm.m (select_timeout, timeval_subtract): Remove.
12495 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12496 as they're a bit more accurate and handle overflow better.
12497 (ns_select): Change prototype to be compatible with pselect.
12498 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12499 * nsterm.h (ns_select): Adjust prototype.
12500
12501 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12502 us-resolution time stamps.
12503 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12504
12505 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12506
12507 * lisp.h (time_overflow): New decl.
12508 (wait_reading_process_output): First arg is now intmax_t, not int,
12509 to accommodate larger waits.
12510
12511 * process.h (struct Lisp_Process.read_output_delay):
12512 Now counts nanoseconds, not microseconds.
12513 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12514 EMACS_HAS_USECS.
12515 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12516 (wait_reading_process_output):
12517 Port to ns-resolution time stamps.
12518 (Faccept_process_output, wait_reading_process_output):
12519 Check for time stamp overflow. Do not assume time_t is signed.
12520 (select_wrapper): Remove; we now use pselect.
12521 (Fprocess_attributes): Now generates ns-resolution time stamps.
12522
12523 * sysdep.c: Include utimens.h. Don't include utime.h
12524 or worry about struct utimbuf; gnulib does that for us now.
12525 (gettimeofday): Remove; gnulib provides a substitute.
12526 (make_timeval): New function.
12527 (set_file_times): Now sets ns-resolution time stamps.
12528 New arg FD; all uses changed.
12529 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12530 (system_process_attributes):
12531 Now returns ns-resolution time stamp. All uses changed.
12532 Check for time stamp overflow.
12533
12534 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12535 provides a substitute now.
12536
12537 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12538 since it guarantees struct timespec.
12539 (EMACS_TIME): Now struct timespec, so that we can support
12540 ns-resolution time stamps.
12541 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12542 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12543 (EMACS_USECS): Remove.
12544 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12545 so multiply the arg by 1000 before storing it.
12546 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12547 New macros.
12548 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12549 Port to ns-resolution time stamps.
12550 (EMACS_TIME_NEG_P): Remove; replaced by....
12551 (EMACS_TIME_SIGN): New macro.
12552 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12553 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12554 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12555 (make_timeval, make_lisp_time, decode_time_components): New decls.
12556 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12557 that it mishandled time_t overflow. You can't compare by subtracting!
12558 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12559 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12560
12561 * term.c: Include <sys/time.h>.
12562 (timeval_to_Time): New function, for proper overflow wraparound.
12563 (term_mouse_position, term_mouse_click): Use it.
12564
12565 * undo.c (record_first_change): Support higher-resolution time stamps
12566 in the undo buffer.
12567 (Fprimitive_undo): Use them when restoring time stamps.
12568
12569 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12570 (w32_get_internal_run_time):
12571 Port to higher-resolution Emacs time stamps.
12572 (ltime): Now accepts single 64-bit integer, as that's more convenient
12573 for callers.
12574
12575 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12576
12577 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12578 for compatibility with pselect. Support ns-resolution time stamps.
12579
12580 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12581
12582 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12583 Check for time stamp overflow, and support ns-resolution time stamps.
12584
12585 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12586 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12587 (timeval_subtract): Remove; no longer needed.
12588 (XTflash, XTring_bell, x_wait_for_event):
12589 Port to ns-resolution time stamps. Don't assume time_t is signed.
12590
12591 2012-06-22 Chong Yidong <cyd@gnu.org>
12592
12593 * xdisp.c (x_consider_frame_title): Revert last change.
12594
12595 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12596
12597 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12598 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12599 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12600 staticidx goes up to 1597 out of 1600 = 0x640.)
12601
12602 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12603
12604 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12605 Otherwise, the umask might be mistakenly 0 while handling input signals.
12606
12607 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12608
12609 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12610
12611 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12612
12613 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12614 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12615 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12616 access to `contents' member of Lisp_Vector objects with AREF and ASET
12617 where appropriate.
12618
12619 2012-06-19 Chong Yidong <cyd@gnu.org>
12620
12621 * frame.c (delete_frame): When selecting a frame on a different
12622 text terminal, do not alter the terminal's top-frame.
12623
12624 * xdisp.c (format_mode_line_unwind_data): Record the target
12625 frame's selected window and its terminal's top-frame.
12626 (unwind_format_mode_line): Restore them.
12627 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12628 Callers changed.
12629 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12630 since tty frames can be explicitly named.
12631 (prepare_menu_bars): Likewise.
12632
12633 * term.c (Ftty_top_frame): New function.
12634
12635 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12636
12637 Port byte-code-meter to modern targets.
12638 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12639 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12640 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12641 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12642 (METER_1, METER_2): Simplify.
12643
12644 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12645
12646 * data.c (Fdefalias): Return `symbol' (bug#11686).
12647
12648 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12649
12650 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12651 gets killed during executing of this function (Bug#11665).
12652 Try to always return Qt when the buffer has been actually killed.
12653 (Vkill_buffer_query_functions): In doc-string say that functions
12654 run by this hook should not change the current buffer.
12655
12656 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12657
12658 Fix recently-introduced process.c problems found by static checking.
12659 * process.c (write_queue_push, write_queue_pop, send_process):
12660 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12661 (write_queue_pop): Fix pointer signedness problem.
12662 (send_process): Remove unused local.
12663
12664 2012-06-17 Chong Yidong <cyd@gnu.org>
12665
12666 * xdisp.c (redisplay_internal): No need to redisplay terminal
12667 frames that are not on top.
12668
12669 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12670
12671 * process.c (make_process): Initialize write_queue.
12672 (write_queue_push, write_queue_pop): New functions.
12673 (send_process): Use them to maintain correct ordering of process
12674 writes (Bug#10815).
12675
12676 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12677
12678 * lisp.h (eassert): Assume C89 or later.
12679 This removes the need for CHECK.
12680 (CHECK): Remove. Its comments about always evaluating its
12681 argument were confusing, as 'eassert' typically does not evaluate
12682 its argument.
12683
12684 * coding.c (produce_chars): Use ptrdiff_t, not int.
12685
12686 * xterm.c (x_draw_underwave): Check for integer overflow.
12687 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12688
12689 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12690
12691 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12692 referenced (Bug#11583).
12693
12694 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12695
12696 Implement wave-style variant of underlining.
12697 * dispextern.h (face_underline_type): New enum.
12698 (face): Add field for underline type.
12699 * nsterm.m (ns_draw_underwave): New function.
12700 (ns_draw_text_decoration): Use it.
12701 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12702 New functions.
12703 (x_draw_glyph_string): Use them.
12704 * xfaces.c (Qline, Qwave): New Lisp objects.
12705 (check_lface_attrs, merge_face_ref)
12706 (Finternal_set_lisp_face_attribute, realize_x_face):
12707 Handle wave-style underline face attributes.
12708 * xterm.c (x_draw_underwave): New function.
12709 (x_draw_glyph_string): Use it.
12710
12711 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12712
12713 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12714 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12715 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12716 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12717 ($(BLD)/w32select.$(O)): Update dependencies.
12718
12719 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12720
12721 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12722 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12723 * character.c (_fetch_multibyte_char_p): Remove.
12724 * alloc.c: Include "character.h" before "buffer.h".
12725 * bidi.c: Likewise.
12726 * buffer.c: Likewise.
12727 * bytecode.c: Likewise.
12728 * callint.c: Likewise.
12729 * callproc.c: Likewise.
12730 * casefiddle.c: Likewise.
12731 * casetab.c: Likewise.
12732 * category.c: Likewise.
12733 * cmds.c: Likewise.
12734 * coding.c: Likewise.
12735 * composite.c: Likewise.
12736 * dired.c: Likewise.
12737 * dispnew.c: Likewise.
12738 * doc.c: Likewise.
12739 * dosfns.c: Likewise.
12740 * editfns.c: Likewise.
12741 * emacs.c: Likewise.
12742 * fileio.c: Likewise.
12743 * filelock.c: Likewise.
12744 * font.c: Likewise.
12745 * fontset.c: Likewise.
12746 * fringe.c: Likewise.
12747 * indent.c: Likewise.
12748 * insdel.c: Likewise.
12749 * intervals.c: Likewise.
12750 * keyboard.c: Likewise.
12751 * keymap.c: Likewise.
12752 * lread.c: Likewise.
12753 * macros.c: Likewise.
12754 * marker.c: Likewise.
12755 * minibuf.c: Likewise.
12756 * nsfns.m: Likewise.
12757 * nsmenu.m: Likewise.
12758 * print.c: Likewise.
12759 * process.c: Likewise.
12760 * regex.c: Likewise.
12761 * region-cache.c: Likewise.
12762 * search.c: Likewise.
12763 * syntax.c: Likewise.
12764 * term.c: Likewise.
12765 * textprop.c: Likewise.
12766 * undo.c: Likewise.
12767 * unexsol.c: Likewise.
12768 * w16select.c: Likewise.
12769 * w32fns.c: Likewise.
12770 * w32menu.c: Likewise.
12771 * window.c: Likewise.
12772 * xdisp.c: Likewise.
12773 * xfns.c: Likewise.
12774 * xmenu.c: Likewise.
12775 * xml.c: Likewise.
12776 * xselect.c: Likewise.
12777
12778 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12779
12780 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12781 If all the glyphs of the glyph row came from strings, and we have no
12782 cursor positioning clues, put the cursor on the first glyph of the
12783 row.
12784 (handle_face_prop): Use chunk-relative overlay string index when
12785 indexing into it->string_overlays array. (Bug#11653)
12786 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12787 the rightmost. (Bug#11720)
12788
12789 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12790
12791 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12792 (CATEGORY_MEMBER): Enforce 1/0 value.
12793 * category.c (_temp_category_set): Remove.
12794
12795 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12796
12797 * window.c (Fdelete_other_windows_internal)
12798 (Fdelete_window_internal): Don't access frame's mouse highlight
12799 info of the initial frame. (Bug#11677)
12800
12801 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12802
12803 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12804 Assume USE_2_TAGS_FOR_INTS.
12805 (xreload): Adjust $tagmask width to match recent lisp.h change.
12806
12807 Simplify lisp.h in minor ways that should not affect code.
12808 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12809 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12810 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12811 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12812 (INTTYPEBITS): New macro, for clarity.
12813 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12814 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12815 Simplify now that USE_LSB_TAG is always defined.
12816 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12817 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12818
12819 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12820
12821 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12822
12823 2012-06-13 Glenn Morris <rgm@gnu.org>
12824
12825 * s/bsd-common.h (BSD4_3):
12826 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12827
12828 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12829
12830 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12831 instead of union.
12832 (XLI, XIL): Define.
12833 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12834 Use them.
12835 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12836 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12837 * alloc.c (widen_to_Lisp_Object): Remove.
12838 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12839 * frame.c (delete_frame): Remove outdated comment.
12840 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12841 USE_LISP_UNION_TYPE.
12842 (Fw32_unregister_hot_key): Likewise.
12843 (Fw32_toggle_lock_key): Likewise.
12844 * w32menu.c (add_menu_item): Likewise.
12845 (w32_menu_display_help): Use XIL instead of checking
12846 USE_LISP_UNION_TYPE.
12847 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12848 (init_heap): Likewise.
12849 * w32term.c (w32_read_socket): Update comment.
12850
12851 2012-06-13 Glenn Morris <rgm@gnu.org>
12852
12853 * s/usg5-4-common.h, src/s/unixware.h:
12854 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12855
12856 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12857
12858 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12859
12860 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12861 * alloc.c (make_number) [!defined make_number]:
12862 Remove, as lisp.h always defines this now.
12863 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12864 (roundup_size): Verify that it is a power of 2.
12865 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12866 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12867 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12868 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12869 USE_LSB_TAG now is always defined to be either 0 or 1.
12870 All uses changed.
12871 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12872 code works fine either way, and efficiency is not a concern here,
12873 as the union type is for debugging, not for production.
12874 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12875 Use an inline function on all platforms when using the union type,
12876 since this is simpler and 'static inline' can be used portably
12877 within Emacs now.
12878 (LISP_INITIALLY_ZERO): New macro.
12879 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12880 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12881
12882 2012-06-12 Glenn Morris <rgm@gnu.org>
12883
12884 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12885
12886 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12887
12888 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12889 Move BROKEN_SIGIO to configure.
12890
12891 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12892 Move NO_TERMIO to configure.
12893
12894 2012-06-12 Chong Yidong <cyd@gnu.org>
12895
12896 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12897 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12898 MagickExportImagePixels is undefined.
12899
12900 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12901
12902 * image.c (imagemagick_load_image): Remove unused label.
12903
12904 2012-06-11 Glenn Morris <rgm@gnu.org>
12905
12906 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12907 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12908 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12909 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12910
12911 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12912
12913 * alloc.c (make_byte_code): New function.
12914 (Fmake_byte_code): Use it. Don't purify here.
12915 * lread.c (read1): Use it as well to avoid extra allocation.
12916
12917 2012-06-11 Chong Yidong <cyd@gnu.org>
12918
12919 * image.c (imagemagick_load_image): Implement transparency.
12920
12921 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12922
12923 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12924 account for preceding backslashes. (Bug#11663)
12925
12926 2012-06-09 Chong Yidong <cyd@gnu.org>
12927
12928 * term.c: Support italics in capable terminals (Bug#9652).
12929 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12930 (turn_on_face): Output using TS_enter_italic_mode if available.
12931 Don't handle unused blinking and alt-charset cases.
12932 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12933 and tty_alt_charset_p cases.
12934 (tty_capable_p, init_tty): Support italics.
12935
12936 * termchar.h (struct tty_display_info): Add field for italics.
12937 Remove unused blink field.
12938
12939 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12940 Handle slant.
12941
12942 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12943 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12944 tty_alt_charset_p. Add tty_italic_p.
12945
12946 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12947
12948 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12949 dbus_type_is_basic if available.
12950 (xd_extract_signed, xd_extract_unsigned): Rename from
12951 extract_signed and extract_unsigned, respectively. Adapt callers.
12952
12953 2012-06-09 Chong Yidong <cyd@gnu.org>
12954
12955 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12956
12957 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12958 case (Bug#9752).
12959
12960 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12961
12962 * xdisp.c (vmessage): Treat frame message as multibyte.
12963 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12964 would generate the diagnostic "Making \302\247 buffer-local while
12965 let-bound!".
12966
12967 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12968
12969 * dispnew.c (showing_window_margins_p): Undo last change, which
12970 was done due to an inadvertent commit.
12971 (adjust_frame_glyphs_for_frame_redisplay): Do call
12972 showing_window_margins_p.
12973
12974 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12975
12976 * eval.c (Fmake_var_non_special): New primitive.
12977 (syms_of_eval): Defsubr it.
12978 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12979
12980 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12981
12982 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12983 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12984
12985 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12986
12987 * alloc.c (allocate_vectorlike): Fix last change.
12988
12989 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12990
12991 Block-based vector allocation of small vectors.
12992 * lisp.h (struct vectorlike_header): New field `nbytes',
12993 adjust comment accordingly.
12994 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12995 to denote vector blocks. Adjust users (live_vector_p,
12996 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12997 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12998 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12999 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
13000 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
13001 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
13002 (roundup_size): New constant.
13003 (struct vector_block): New data type.
13004 (vector_blocks, vector_free_lists, zero_vector): New variables.
13005 (all_vectors): Rename to `large_vectors'.
13006 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
13007 (sweep_vectors): New functions.
13008 (allocate_vectorlike): Return `zero_vector' as the only vector of
13009 0 items. Allocate new vector from block if vector size is less than
13010 or equal to VBLOCK_BYTES_MAX.
13011 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
13012 (init_alloc_once): Add call to init_vectors.
13013
13014 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13015
13016 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
13017
13018 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
13019
13020 * doprnt.c (doprnt): Truncate multibyte char correctly.
13021 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
13022 would mishandle a string argument "Xc" if X was a multibyte
13023 character of length 2: it would truncate after X's first byte
13024 rather than including all of X.
13025
13026 2012-06-06 Chong Yidong <cyd@gnu.org>
13027
13028 * buffer.c (word_wrap): Doc fix.
13029
13030 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
13031
13032 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
13033
13034 2012-06-03 Glenn Morris <rgm@gnu.org>
13035
13036 * xdisp.c (tool-bar-style): Doc fix.
13037
13038 2012-06-03 Ulrich Müller <ulm@gentoo.org>
13039
13040 * Makefile.in (PAXCTL): Define.
13041 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13042 binary via PaX flags if the paxctl utility is available.
13043 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13044 Restore PaX flags to their default. (Bug#11398)
13045
13046 2012-06-03 Chong Yidong <cyd@gnu.org>
13047
13048 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13049 buffer (Bug#11226).
13050
13051 2012-06-03 Chong Yidong <cyd@gnu.org>
13052
13053 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13054 (note_mode_line_or_margin_highlight): If there is no help echo,
13055 use mode-line-default-help-echo. Handle the case where the mouse
13056 position is past the end of the mode line string.
13057
13058 * buffer.c (buffer_local_value_1): New function, split from
13059 Fbuffer_local_value; can return Qunbound.
13060 (Fbuffer_local_value): Use it.
13061 (Vmode_line_format): Docstring tweaks.
13062
13063 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13064
13065 * sysdep.c (system_process_attributes): Improve comment.
13066
13067 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13068
13069 * keyboard.c: Export real-this-command to Elisp.
13070 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13071 and DEFVAR it. Update all users.
13072
13073 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13074
13075 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13076
13077 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13078 Convert pctcpu and pctmem to Lisp float properly.
13079 Let the compiler fold better, as 100.0/0x8000 is exact.
13080
13081 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13082
13083 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13084 cons_block.
13085
13086 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13087
13088 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13089
13090 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13091
13092 For a 'struct window', replace some Lisp_Object fields to
13093 bitfields where appropriate, remove unused fields.
13094 * window.h (struct window): Remove unused 'last_mark_x' and
13095 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13096 change its type from Lisp_Object to bitfield.
13097 Change type of 'force_start', 'optional_new_start',
13098 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13099 fields from Lisp_Object to bitfield. Adjust users accordingly.
13100
13101 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13102
13103 Pacify gcc -Wdouble-precision when using Xaw.
13104 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13105 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13106 Use 'float' consistently, rather than 'float' in most places
13107 and 'double' in a couple of places.
13108
13109 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13110
13111 * xdisp.c (handle_stop): Detect whether we have overlay strings
13112 loaded by testing it->current.overlay_string_index to be
13113 non-negative, instead of checking whether n_overlay_strings is
13114 positive. (Bug#11587)
13115
13116 2012-05-31 Chong Yidong <cyd@gnu.org>
13117
13118 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13119
13120 * doc.c (Fsubstitute_command_keys): Doc fix.
13121
13122 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13123
13124 * search.c (search_buffer): Remove calls to
13125 r_alloc_inhibit_buffer_relocation, as it is now called by
13126 maybe_unify_char, which was the cause of relocation of buffer text
13127 in bug#11519.
13128
13129 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13130
13131 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13132 for the duration of call to load_charset, to avoid problems with
13133 callers of maybe_unify_char that access buffer text through C
13134 pointers.
13135
13136 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13137 decrement the inhibition flag, instead of just setting or
13138 resetting it.
13139
13140 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13141
13142 Remove obsolete '#define static' cruft.
13143 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13144 This #undef was "temporary" in 2000; it is no longer needed
13145 now that '#define static' has gone away.
13146 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13147 (gray_bitmap_bits): Remove; no longer needed.
13148 All uses replaced with definiens.
13149 * xterm.c: Include "bitmaps/gray.xbm".
13150
13151 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13152
13153 Clean up __executable_start, monstartup when --enable-profiling.
13154 The following changes affect the code only when profiling.
13155 * dispnew.c (__executable_start): Rename from safe_bcopy.
13156 Define only on platforms that need it.
13157 * emacs.c: Include <sys/gmon.h> when profiling.
13158 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13159 (__executable_start): Remove decl, since lisp.h does it now.
13160 (safe_bcopy): Remove decl; no longer has that name.
13161 (main): Coalesce #if into single bit of code, for simplicity.
13162 Cast pointers to uintptr_t, since standard libraries want integers
13163 and not pointers.
13164 * lisp.h (__executable_start): New decl.
13165
13166 2012-05-31 Glenn Morris <rgm@gnu.org>
13167
13168 * image.c (Fimagemagick_types): Doc fix.
13169
13170 2012-05-30 Jim Meyering <meyering@redhat.com>
13171
13172 * callproc.c (Fcall_process_region): Include directory component
13173 in mkstemp error message (Bug#11586).
13174
13175 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13176
13177 * alloc.c, lisp.h (make_pure_vector): Now static.
13178
13179 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13180
13181 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13182 Move to byte-run.el.
13183 (Fautoload): Do the hash-doc more carefully.
13184 * data.c (Fdefalias): Purify definition, except for keymaps.
13185 (Qdefun): Move from eval.c.
13186 * lisp.h (Qdefun): Remove.
13187 * lread.c (read1): Tiny simplification.
13188
13189 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
13190
13191 Do not create empty overlays with the evaporate property (Bug#9642).
13192 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13193 Bug#9642, but explicitly check that the buffer the overlay would
13194 be moved to is live and rearrange lines to make sure that errors
13195 will not put the overlay in an inconsistent state.
13196 (Fdelete_overlay): Cosmetics.
13197
13198 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13199
13200 * w32term.c (my_bring_window_to_top): New function.
13201 (x_raise_frame): Use handle returned by DeferWindowPos, which
13202 could be different from the original one.
13203 Call my_bring_window_to_top instead of my_set_foreground_window.
13204 (Bug#11513)
13205
13206 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13207 by calling BringWindowToTop.
13208
13209 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13210 (WM_EMACS_END): Increase by one.
13211
13212 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13213
13214 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13215 This avoids undefined behavior that might cause the eassert
13216 to not catch an out-of-range value.
13217
13218 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13219
13220 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13221 Update dependencies.
13222
13223 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13224
13225 * bidi.c (bidi_mirror_char): Fix last change.
13226
13227 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13228
13229 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13230 when referring to sectname field in printf format.
13231
13232 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13233
13234 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13235 Only r_alloc_inhibit_buffer_relocation needed to be added;
13236 the others were already declared.
13237
13238 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13239 before checking whether it's out of range. Put the check inside
13240 eassert. See
13241 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13242
13243 2012-05-27 Ken Brown <kbrown@cornell.edu>
13244
13245 * callproc.c (Fcall_process): Restore a line that was accidentally
13246 commented out in the 2011-02-13 change (bug#11547).
13247
13248 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13249
13250 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13251 defined on ralloc.c.
13252
13253 * buffer.c [REL_ALLOC]: Remove prototypes of
13254 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13255 they are now on lisp.h.
13256
13257 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13258
13259 * search.c (search_buffer): Use it to inhibit relocation of buffer
13260 text while re_search_2 is doing its job, because re_search_2 is
13261 passed C pointers to buffer text. (Bug#11519)
13262
13263 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13264 Update value to 24.
13265
13266 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13267 state after an additional call to move_it_in_display_line_to, keep
13268 the values of it->max_ascent and it->max_descent found for the
13269 entire line.
13270 (pos_visible_p): Revert the comparison against bottom_y to what it
13271 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13272 (Bug#11464)
13273
13274 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13275
13276 Fix coding-related core dumps with gcc -ftrapv.
13277 The code was computing A - B, where A and B are pointers, and B is
13278 random garbage. This can lead to core dumps on platforms that
13279 have special pointer registers, and it also leads to core dumps on
13280 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13281 A - B only when B is initialized properly.
13282 * coding.c (coding_set_source, coding_set_destination): Return void.
13283 (coding_change_source, coding_change_destinations): New functions,
13284 with the old behaviors of coding_set_source and coding_set_destination.
13285 All callers that need an offset changed to use these new functions.
13286
13287 2012-05-26 Glenn Morris <rgm@gnu.org>
13288
13289 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13290
13291 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13292
13293 Extend mouse support on W32 text-mode console.
13294 * xdisp.c (draw_row_with_mouse_face):
13295 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13296
13297 * w32console.c: Include window.h.
13298 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13299 New functions.
13300 (initialize_w32_display): Initialize mouse-highlight data.
13301
13302 * w32inevt.c: Include termchar.h and window.h.
13303 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13304 moves, call note_mouse_highlight. If help_echo changed, call
13305 gen_help_event to produce help-echo message in the echo area.
13306 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13307 highlight info.
13308
13309 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13310
13311 * lread.c (read1): Simplify slightly to avoid an overflow warning
13312 with GCC 4.7.0 on x86-64.
13313
13314 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13315
13316 * bidi.c (bidi_mirror_char): Revert last change: an int is
13317 definitely wide enough here.
13318
13319 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13320
13321 Fix integer width and related bugs (Bug#9874).
13322 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13323 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13324 (string_bytes, check_sblock, allocate_string_data):
13325 (compact_small_strings, Fmake_bool_vector, make_string)
13326 (make_unibyte_string, make_multibyte_string)
13327 (make_string_from_bytes, make_specified_string)
13328 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13329 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13330 (mark_vectorlike):
13331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13332 (allocate_pseudovector):
13333 Use int, not EMACS_INT, where int is wide enough.
13334 (inhibit_garbage_collection, Fgarbage_collect):
13335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13336 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13337 int might not be wide enough.
13338 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13339 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13340 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13341 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13342 (bidi_level_of_next_char, bidi_move_to_visually_next):
13343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13344 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13345 (Fkill_buffer, Fset_buffer_major_mode)
13346 (advance_to_char_boundary, Fbuffer_swap_text)
13347 (Fset_buffer_multibyte, overlays_at, overlays_in)
13348 (overlay_touches_p, struct sortvec, record_overlay_string)
13349 (overlay_strings, recenter_overlay_lists)
13350 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13351 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13352 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13353 (Foverlay_recenter, last_overlay_modification_hooks_used)
13354 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13356 (validate_region): Omit unnecessary test for b <= e,
13357 since that's guaranteed by the previous test.
13358 (adjust_overlays_for_delete): Avoid pos + length overflow.
13359 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13360 (report_overlay_modification):
13361 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13362 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13363 Omit pointer cast, which isn't needed anyway, and doesn't work
13364 after the EMACS_INT -> ptrdiff_t change.
13365 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13366 * buffer.h: Adjust decls to match defn changes elsewhere.
13367 (struct buffer_text, struct buffer):
13368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13369 Use EMACS_INT, not int, where int might not be wide enough.
13370 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13371 not int, to avoid needless 32-bit limit on 64-bit hosts.
13372 (exec_byte_code): Use tighter memory-full test, one that checks
13373 for alloca overflow. Don't compute the address of the object just
13374 before an array, as that's not portable. Use EMACS_INT, not
13375 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13376 * callint.c (Fcall_interactively):
13377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13378 * callproc.c (call_process_kill, Fcall_process):
13379 Don't assume pid_t fits into an Emacs fixnum.
13380 (call_process_cleanup, Fcall_process, child_setup):
13381 Don't assume pid_t fits into int.
13382 (call_process_cleanup, Fcall_process, delete_temp_file)
13383 (Fcall_process_region):
13384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13385 (Fcall_process): Simplify handling of volatile integers.
13386 Use int, not EMACS_INT, where int will do.
13387 * casefiddle.c (casify_object, casify_region, operate_on_word)
13388 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13390 (casify_object): Avoid integer overflow when overallocating buffer.
13391 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13392 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13393 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13394 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13395 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13396 integers are now checked earlier. All uses replaced with XINT.
13397 (ccl_driver):
13398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13399 For CCL_MapSingle, check that content and value are in int range.
13400 (ccl_driver, Fregister_code_conversion_map):
13401 Check that Vcode_version_map_vector is a vector.
13402 (resolve_symbol_ccl_program): Check that vector header is in range.
13403 Always copy the vector, so that we can check its contents reliably
13404 now rather than having to recheck each instruction as it's being
13405 executed. Check that vector words fit in 'int'.
13406 (ccl_get_compiled_code, Fregister_ccl_program)
13407 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13408 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13409 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13410 contents are in range.
13411 (Fccl_execute_on_string): Check that status is in range.
13412 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13413 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13414 Accept and return EMACS_INT, not int, because callers can pass values
13415 out of 'int' range.
13416 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13417 (multibyte_chars_in_text, parse_str_as_multibyte)
13418 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13419 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13420 (string_escape_byte8, Fget_byte):
13421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13422 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13423 avoid mishandling large integers.
13424 * character.h: Adjust decls to match defn changes elsewhere.
13425 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13426 (Ffind_charset_region):
13427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13428 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13429 (load_charset_map_from_vector, Fdefine_charset_internal):
13430 Don't assume fixnum fits in int.
13431 (load_charset_map_from_vector, Fmap_charset_chars):
13432 Remove now-unnecessary CHECK_NATNUMs.
13433 (Fdefine_charset_internal): Check ranges here, more carefully.
13434 Don't rely on undefined behavior with signed left shift overflow.
13435 Don't assume unsigned int fits into fixnum, or that fixnum fits
13436 into unsigned int. Don't require max_code to be a valid fixnum;
13437 that's not true for gb10830 4-byte on a 32-bit host. Allow
13438 invalid_code to be a cons, for the same reason. Require code_offset
13439 to be a character. Avoid int overflow if max_char is close
13440 to INT_MAX.
13441 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13442 this is intended anyway and avoids some undefined behavior.
13443 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13444 INDEX_TO_CODE_POINT, as that's what it expects.
13445 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13446 * charset.h (DECODE_CHAR): Return int, not unsigned;
13447 this is what was intended anyway, and it avoids undefined behavior.
13448 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13449 integer-overflow issues.
13450 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13451 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13452 where the argument is EMACS_INT, and this behavior is not intended.
13453 * chartab.c (Fmake_char_table, Fset_char_table_range)
13454 (uniprop_get_decoder, uniprop_get_encoder):
13455 Don't assume fixnum fits in int.
13456 * cmds.c (move_point): New function, that does the gist of
13457 Fforward_char and Fbackward_char, but does so while checking
13458 for integer overflow more accurately.
13459 (Fforward_char, Fbackward_char): Use it.
13460 (Fforward_line, Fend_of_line, internal_self_insert)
13461 (internal_self_insert):
13462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13463 Fix a FIXME, by checking for integer overflow when calculating
13464 target_clm and actual_clm.
13465 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13466 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13467 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13468 (coding_alloc_by_making_gap, alloc_destination)
13469 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13470 (encode_coding_utf_16, detect_coding_emacs_mule)
13471 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13472 (detect_coding_iso_2022, decode_coding_iso_2022)
13473 (encode_invocation_designation, encode_designation_at_bol)
13474 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13475 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13476 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13477 (encode_coding_ccl, encode_coding_raw_text)
13478 (detect_coding_charset, decode_coding_charset)
13479 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13480 (produce_composition, produce_charset, produce_annotation)
13481 (decode_coding, handle_composition_annotation)
13482 (handle_charset_annotation, consume_chars, decode_coding_gap)
13483 (decode_coding_object, encode_coding_object, detect_coding_system)
13484 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13485 (code_convert_region, code_convert_string)
13486 (Fdefine_coding_system_internal)
13487 (coding_set_source, coding_set_destination):
13488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13489 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13490 (Fdefine_coding_system_internal):
13491 Don't assume fixnums fit in int.
13492 (decode_coding_gap, decode_coding_object, encode_coding_object)
13493 (Fread_coding_system, Fdetect_coding_region)
13494 (Funencodable_char_position, Fcheck_coding_systems_region)
13495 (get_translation, handle_composition_annotation, consume_chars):
13496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13497 (consume_chars): Rewrite to not calculate an address outside buffer.
13498 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13499 Don't access memory outside of the args array.
13500 (Fdefine_coding_system_internal): Check for charset-id overflow.
13501 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13502 result of ENCODE_CHAR.
13503 * coding.h: Adjust decls to match defn changes elsewhere.
13504 (struct coding_system):
13505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13506 * composite.c (get_composition_id, find_composition)
13507 (run_composition_function, update_compositions)
13508 (compose_text, composition_gstring_put_cache)
13509 (composition_gstring_p, composition_gstring_width)
13510 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13511 (composition_compute_stop_pos, composition_reseat_it)
13512 (composition_update_it, struct position_record)
13513 (find_automatic_composition, composition_adjust_point)
13514 (Fcomposition_get_gstring, Ffind_composition_internal):
13515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13516 (update_compositions):
13517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13518 * composite.h: Adjust decls to match defn changes elsewhere.
13519 (struct composition):
13520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13521 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13522 Do not attempt to compute the address of the object just before a
13523 buffer; this is not portable.
13524 (Faref, Faset):
13525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13526 (Faset): Use int, not EMACS_INT, where int is wide enough.
13527 (Fstring_to_number): Don't assume fixnums fit in int.
13528 (Frem): Don't assume arg is nonnegative.
13529 * dbusbind.c (xd_append_arg): Check for integers out of range.
13530 (Fdbus_call_method): Don't overflow the timeout int.
13531 (extract_signed, extract_unsigned): New functions.
13532 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13533 (xd_get_connection_references): Return ptrdiff_t, not int.
13534 All uses changed.
13535 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13536 (xd_read_message_1):
13537 Use int, not unsigned, where the dbus API uses int.
13538 (Fdbus_message_internal): Don't overflow mtype.
13539 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13540 * dired.c (directory_files_internal, file_name_completion, scmp)
13541 (file_name_completion_stat):
13542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13543 (file_name_completion): Don't overflow matchcount.
13544 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13545 * dispextern.h: Adjust decls to match defn changes elsewhere.
13546 (struct text_pos, struct glyph, struct bidi_saved_info)
13547 (struct bidi_string_data, struct bidi_it, struct composition_it)
13548 (struct it):
13549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13550 (struct display_pos, struct composition_it, struct it):
13551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13552 * dispnew.c (increment_matrix_positions)
13553 (increment_row_positions, mode_line_string)
13554 (marginal_area_string):
13555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13556 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13557 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13558 (duration_to_sec_usec): New function, to check for overflow better.
13559 (Fsleep_for, sit_for): Use it.
13560 * doc.c (get_doc_string, store_function_docstring):
13561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13562 (get_doc_string, Fsnarf_documentation):
13563 Use int, not EMACS_INT, where int is wide enough.
13564 (get_doc_string):
13565 Use SAFE_ALLOCA, not alloca.
13566 Check for overflow when converting EMACS_INT to off_t.
13567 * doprnt.c (doprnt):
13568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13569 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13570 Don't assume uid_t fits into fixnum.
13571 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13572 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13573 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13574 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13575 (general_insert_function)
13576 (Finsert_char, make_buffer_string, make_buffer_string_both)
13577 (update_buffer_properties, Fbuffer_substring)
13578 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13579 (Fsubst_char_in_region, check_translation)
13580 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13581 (transpose_markers, Ftranspose_regions):
13582 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13583 (clip_to_bounds): Move to lisp.h as an inline function).
13584 (Fconstrain_to_field): Don't assume integers are nonnegative.
13585 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13586 (Fsubst_char_in_region, Fsave_restriction):
13587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13588 (Femacs_pid): Don't assume pid_t fits into fixnum.
13589 (lo_time): Use int, not EMACS_INT, when int suffices.
13590 (lisp_time_argument): Check for usec out of range.
13591 (Fencode_time): Don't assume fixnum fits in int.
13592 (Fuser_login_name, Fuser_full_name): Signal an error
13593 if a uid argument is out of range, rather than relying on
13594 undefined behavior.
13595 (Fformat_time_string): Remove now-unnecessary check.
13596 lisp_time_argument checks for out-of-range usec now.
13597 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13598 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13599 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13600 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13601 (init_cmdargs, Fdump_emacs):
13602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13603 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13604 the bottom (typically) 32 bits of the fixnum.
13605 * eval.c (specpdl_size, call_debugger):
13606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13607 (when_entered_debugger, Fbacktrace_debug):
13608 Don't assume fixnum can fit in int.
13609 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13610 the object just before a buffer; this is not portable.
13611 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13612 (grow_specpdl, unbind_to):
13613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13614 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13615 (grow_specpdl): Simplify allocation by using xpalloc.
13616 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13617 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13618 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13620 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13621 (a_write, e_write):
13622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13623 (Fcopy_file, non_regular_nbytes, read_non_regular)
13624 (Finsert_file_contents):
13625 Use int, not EMACS_INT, where int is wide enough.
13626 (READ_BUF_SIZE): Verify that it fits in int.
13627 (Finsert_file_contents): Check that counts are in proper range,
13628 rather than assuming fixnums fit into ptrdiff_t etc.
13629 Don't assume fixnums fit into int.
13630 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13631 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13632 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13633 (string_char_to_byte, string_byte_to_char)
13634 (string_make_multibyte, string_to_multibyte)
13635 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13636 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13637 (substring_both, Fdelete, internal_equal, Ffillarray)
13638 (Fclear_string, mapcar1)
13639 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13640 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13641 (larger_vector, make_hash_table, maybe_resize_hash_table)
13642 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13643 (Fmaphash, secure_hash):
13644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13645 (concat): Check for string index and length overflow.
13646 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13647 (Frequire):
13648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13649 (larger_vector): New API (vec, incr_min, size_max) replaces old
13650 one (vec, new_size, init). This catches size overflow.
13651 INIT was removed because it was always Qnil.
13652 All callers changed.
13653 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13654 the upper bound on a hash table index size.
13655 (make_hash_table, maybe_resize_hash_table): Use it.
13656 (secure_hash): Computer start_byte and end_byte only after
13657 they're known to be in ptrdiff_t range.
13658 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13659 (Ffont_get_glyphs, Ffont_at):
13660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13661 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13662 (Flist_fonts, Fopen_font):
13663 Don't assume fixnum can fit in int.
13664 (check_gstring): Don't assume index can fit in int.
13665 (font_match_p): Check that fixnum is a character, not a nonnegative
13666 fixnum, since the later code needs to stuff it into an int.
13667 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13668 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13669 conversion overflow issues.
13670 (Fopen_font): Check for integer out of range.
13671 (Ffont_get_glyphs): Don't assume index can fit in int.
13672 * font.h: Adjust decls to match defn changes elsewhere.
13673 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13674 integer overflow.
13675 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13676 printmax_t, where ptrdiff_t is wide enough.
13677 (Finternal_char_font):
13678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13679 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13680 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13681 (Fset_frame_position, x_set_frame_parameters)
13682 (x_set_line_spacing, x_set_border_width)
13683 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13684 Check that fixnums are in proper range for system types.
13685 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13686 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13687 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13688 Use SAFE_ALLOCA_LISP, not alloca.
13689 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13690 intptr_t is wide enough.
13691 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13692 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13693 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13694 Check for fixnum out of range.
13695 * ftfont.c (ftfont_list): Don't assume index fits in int.
13696 Check that fixnums are in proper range for system types.
13697 (ftfont_shape_by_flt):
13698 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13699 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13700 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13701 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13702 Check that fixnums are in proper range for system types.
13703 * gnutls.h: Adjust decls to match defn changes elsewhere.
13704 * gtkutil.c (xg_dialog_run):
13705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13706 (update_frame_tool_bar):
13707 Check that fixnums are in proper range for system types.
13708 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13709 (lookup_image): Check that fixnums are in range for system types.
13710 * indent.c (last_known_column, last_known_column_point):
13711 (current_column_bol_cache):
13712 (skip_invisible, current_column, check_display_width):
13713 (check_display_width, scan_for_column, current_column_1)
13714 (Findent_to, Fcurrent_indentation, position_indentation)
13715 (indented_beyond_p, Fmove_to_column, compute_motion):
13716 (Fcompute_motion, Fvertical_motion):
13717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13718 (last_known_column_modified): Use EMACS_INT, not int.
13719 (check_display_width):
13720 (Fcompute_motion):
13721 Check that fixnums and floats are in proper range for system types.
13722 (compute_motion): Don't assume index or fixnum fits in int.
13723 (compute_motion, Fcompute_motion):
13724 Use int, not EMACS_INT, when it is wide enough.
13725 (vmotion): Omit local var start_hpos that is always 0; that way
13726 we don't need to worry about overflow in expressions involving it.
13727 * indent.h: Adjust decls to match defn changes elsewhere.
13728 (struct position):
13729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13730 Use int, not EMACS_INT, where int is wide enough.
13731 Remove unused members ovstring_chars_done and tab_offset;
13732 all uses removed.
13733 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13734 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13735 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13736 (make_gap, copy_text, insert, insert_and_inherit)
13737 (insert_before_markers, insert_before_markers_and_inherit)
13738 (insert_1, count_combining_before, count_combining_after)
13739 (insert_1_both, insert_from_string)
13740 (insert_from_string_before_markers, insert_from_string_1)
13741 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13742 (adjust_after_replace, adjust_after_insert, replace_range)
13743 (replace_range_2, del_range, del_range_1, del_range_byte)
13744 (del_range_both, del_range_2, modify_region)
13745 (prepare_to_modify_buffer, signal_before_change)
13746 (signal_after_change, Fcombine_after_change_execute):
13747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13748 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13749 (balance_an_interval, split_interval_right, split_interval_left)
13750 (find_interval, next_interval, update_interval)
13751 (adjust_intervals_for_insertion, delete_node, delete_interval)
13752 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13753 (static_offset_intervals, offset_intervals)
13754 (merge_interval_right, merge_interval_left, make_new_interval)
13755 (graft_intervals_into_buffer, temp_set_point_both)
13756 (temp_set_point, set_point, adjust_for_invis_intang)
13757 (set_point_both, move_if_not_intangible, get_property_and_range)
13758 (get_local_map, copy_intervals, copy_intervals_to_string)
13759 (compare_string_intervals, set_intervals_multibyte_1):
13760 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13761 * intervals.h: Adjust decls to match defn changes elsewhere.
13762 (struct interval):
13763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13764 * keyboard.c (this_command_key_count, this_single_command_key_start)
13765 (before_command_key_count, before_command_echo_length, echo_now)
13766 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13767 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13768 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13769 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13771 (last_non_minibuf_size, last_point_position, echo_truncate)
13772 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13773 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13774 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13775 (stuff_buffered_input):
13776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13777 (last_auto_save, command_loop_1, read_char):
13778 Use EMACS_INT, not int, to avoid integer overflow.
13779 (record_char): Avoid overflow in total_keys computation.
13780 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13781 * keyboard.h: Adjust decls to match defn changes elsewhere.
13782 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13783 (Fkey_description, Fdescribe_vector, Flookup_key):
13784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13785 (click_position): New function, to check that positions are in range.
13786 (Fcurrent_active_maps):
13787 (describe_command):
13788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13789 (Faccessible_keymaps, Fkey_description):
13790 (preferred_sequence_p):
13791 Don't assume fixnum can fit into int.
13792 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13793 Check for integer overflow in size calculations.
13794 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13795 avoid mishandling large integers.
13796 * lisp.h: Adjust decls to match defn changes elsewhere.
13797 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13798 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13799 (struct Lisp_Marker):
13800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13801 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13802 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13803 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13804 All callers changed.
13805 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13806 Assume the arg has valid form, since it always does.
13807 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13808 unsigned integer system type.
13809 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13810 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13812 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13813 (duration_to_sec_usec): New decl.
13814 * lread.c (read_from_string_index, read_from_string_index_byte)
13815 (read_from_string_limit, readchar, unreadchar, openp)
13816 (read_internal_start, read1, oblookup):
13817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13818 (Fload, readevalloop, Feval_buffer, Feval_region):
13819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13820 (openp): Check for out-of-range argument to 'access'.
13821 (read1): Use int, not EMACS_INT, where int is wide enough.
13822 Don't assume fixnum fits into int.
13823 Fix off-by-one error that can read outside a buffer.
13824 (read_filtered_event): Use duration_to_sec_usec
13825 to do proper overflow checking on durations.
13826 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13827 in size calculation.
13828 (Fexecute_kbd_macro):
13829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13830 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13831 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13832 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13833 (set_marker_both, set_marker_restricted_both, marker_position)
13834 (marker_byte_position, Fbuffer_has_markers_at):
13835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13836 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13837 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13838 It now merely ensures that the menu is large enough, without
13839 necessarily growing it, as this avoids some integer overflow issues.
13840 All callers changed.
13841 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13843 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13844 Use SAFE_ALLOCA_LISP, not alloca.
13845 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13846 to EMACS_INT. Check that fixnums are in proper range for system types.
13847 * minibuf.c (minibuf_prompt_width, string_to_object)
13848 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13849 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13851 (get_minibuffer, read_minibuf_unwind):
13852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13853 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13854 this simplifies overflow checking. All callers changed.
13855 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13856 (Ftest_completion):
13857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13858 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13859 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13860 Check that fixnums are in proper range for system types.
13861 (Fx_create_frame, Fx_show_tip):
13862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13863 * nsfont.m (ns_findfonts, nsfont_list_family):
13864 Don't assume fixnum fits in long.
13865 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13867 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13868 wide enough.
13869 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13871 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13872 (PRINTDECLARE, PRINTPREPARE):
13873 (strout, print_string):
13874 (print, print_preprocess, print_check_string_charset_prop)
13875 (print_object):
13876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13877 (PRINTDECLARE):
13878 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13879 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13880 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13881 (printchar, strout): Use xpalloc to catch size calculation overflow.
13882 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13883 (print_error_message): Use SAFE_ALLOCA, not alloca.
13884 (print_object): Use int, not EMACS_INT, where int is wide enough.
13885 (print_depth, new_backquote_output, print_number_index):
13886 Use ptrdiff_t, not int, where int might not be wide enough.
13887 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13888 (Fset_process_window_size, Fformat_network_address)
13889 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13890 (sigchld_handler):
13891 Check that fixnums are in proper range for system types.
13892 (Fsignal_process): Simplify by avoiding a goto.
13893 Check for process-ids out of pid_t range rather than relying on
13894 undefined behavior.
13895 (process_tick, update_tick): Use EMACS_INT, not int.
13896 (Fformat_network_address, read_process_output, send_process)
13897 (Fprocess_send_region, status_notify):
13898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13899 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13900 (wait_reading_process_output, read_process_output, exec_sentinel):
13901 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13902 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13903 (Faccept_process_output): Use duration_to_sec_usec to do proper
13904 overflow checking on durations.
13905 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13906 Don't assume pid_t fits in int.
13907 * process.h (struct Lisp_Process): Members tick and update_tick
13908 are now of type EMACS_INT, not int.
13909 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13910 configured --with-wide-int.
13911 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13912 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13913 * search.c (looking_at_1, string_match_1):
13914 (fast_string_match, fast_c_string_match_ignore_case)
13915 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13916 (scan_newline, find_before_next_newline, search_command)
13917 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13918 (set_search_regs, wordify):
13919 (Freplace_match):
13920 (Fmatch_data):
13921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13922 (string_match_1, search_buffer, set_search_regs):
13923 (Fmatch_data):
13924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13925 (wordify): Check for overflow in size calculation.
13926 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13927 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13928 Check that fixnums are in proper range for system types.
13929 * sound.c (struct sound_device)
13930 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13932 (Fplay_sound_internal):
13933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13934 * syntax.c (struct lisp_parse_state, find_start_modiff)
13935 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13936 (Fparse_partial_sexp):
13937 Don't assume fixnums can fit in int.
13938 (struct lisp_parse_state, find_start_pos, find_start_value)
13939 (find_start_value_byte, find_start_begv)
13940 (update_syntax_table, char_quoted, dec_bytepos)
13941 (find_defun_start, prev_char_comend_first, back_comment):
13942 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13943 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13944 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13945 (Finternal_describe_syntax_value): Check that match_lisp is a
13946 character, not an integer, since the code stuffs it into int.
13947 (scan_words, scan_sexps_forward):
13948 Check that fixnums are in proper range for system types.
13949 (Fforward_word):
13950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13951 (scan_sexps_forward):
13952 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13953 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13954 * syntax.h: Adjust decls to match defn changes elsewhere.
13955 (struct gl_state_s):
13956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13957 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13958 MOST_POSITIVE_FIXNUM.
13959 * sysdep.c (wait_for_termination_1, wait_for_termination)
13960 (interruptible_wait_for_termination, mkdir):
13961 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13962 (emacs_read, emacs_write):
13963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13964 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13965 and double all fit in int.
13966 * term.c (set_tty_color_mode):
13967 Check that fixnums are in proper range for system types.
13968 * termhooks.h (struct input_event):
13969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13970 * textprop.c (validate_interval_range, interval_of)
13971 (Fadd_text_properties, set_text_properties_1)
13972 (Fremove_text_properties, Fremove_list_of_text_properties)
13973 (Ftext_property_any, Ftext_property_not_all)
13974 (copy_text_properties, text_property_list, extend_property_ranges)
13975 (verify_interval_modification):
13976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13977 (Fnext_single_char_property_change)
13978 (Fprevious_single_char_property_change):
13979 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13980 (copy_text_properties):
13981 Check for integer overflow in index calculation.
13982 * undo.c (last_boundary_position, record_point, record_insert)
13983 (record_delete, record_marker_adjustment, record_change)
13984 (record_property_change):
13985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13986 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13988 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13989 (Fx_hide_tip, Fx_file_dialog):
13990 * w32menu.c (set_frame_menubar):
13991 Use ptrdiff_t, not int, for consistency with rest of code.
13992 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13993 (select_window, Fdelete_other_windows_internal)
13994 (window_scroll_pixel_based, window_scroll_line_based)
13995 (Frecenter, Fset_window_configuration):
13996 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13997 (Fset_window_hscroll, run_window_configuration_change_hook)
13998 (set_window_buffer, temp_output_buffer_show, scroll_command)
13999 (Fscroll_other_window, Frecenter):
14000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14001 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
14002 Don't assume fixnum fits in int.
14003 (Fset_window_scroll_bars):
14004 Check that fixnums are in proper range for system types.
14005 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
14006 (string_pos, c_string_pos, number_of_chars, init_iterator)
14007 (in_ellipses_for_invisible_text_p, init_from_display_pos)
14008 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
14009 (compute_display_string_end, handle_face_prop)
14010 (face_before_or_after_it_pos, handle_invisible_prop)
14011 (handle_display_prop, handle_display_spec, handle_single_display_spec)
14012 (display_prop_intangible_p, string_buffer_position_lim)
14013 (string_buffer_position, handle_composition_prop, load_overlay_strings)
14014 (get_overlay_strings_1, get_overlay_strings)
14015 (iterate_out_of_display_property, forward_to_next_line_start)
14016 (back_to_previous_visible_line_start, reseat, reseat_to_string)
14017 (get_next_display_element, set_iterator_to_next)
14018 (get_visually_first_element, compute_stop_pos_backwards)
14019 (handle_stop_backwards, next_element_from_buffer)
14020 (move_it_in_display_line_to, move_it_in_display_line)
14021 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14022 (add_to_log, message_dolog, message_log_check_duplicate)
14023 (message2, message2_nolog, message3, message3_nolog
14024 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
14025 (current_message_1, truncate_echo_area, truncate_message_1)
14026 (set_message, set_message_1, store_mode_line_noprop)
14027 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
14028 (text_outside_line_unchanged_p, check_point_in_composition)
14029 (reconsider_clip_changes)
14030 (redisplay_internal, set_cursor_from_row, try_scrolling)
14031 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
14032 (redisplay_window, find_last_unchanged_at_beg_row)
14033 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
14034 (trailing_whitespace_p, find_row_edges, display_line)
14035 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
14036 (display_mode_element, store_mode_line_string)
14037 (pint2str, pint2hrstr, decode_mode_spec)
14038 (display_count_lines, display_string, draw_glyphs)
14039 (x_produce_glyphs, x_insert_glyphs)
14040 (rows_from_pos_range, mouse_face_from_buffer_pos)
14041 (fast_find_string_pos, mouse_face_from_string_pos)
14042 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14043 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14044 (safe_call, init_from_display_pos, handle_fontified_prop)
14045 (handle_single_display_spec, load_overlay_strings)
14046 (with_echo_area_buffer, setup_echo_area_for_printing)
14047 (display_echo_area, echo_area_display)
14048 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14049 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14050 (redisplay_window, dump_glyph_row, display_mode_line)
14051 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14052 (handle_display_spec, display_prop_string_p):
14053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14054 (handle_single_display_spec, build_desired_tool_bar_string)
14055 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14056 (get_specified_cursor_type):
14057 Check that fixnums are in proper range for system types.
14058 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14059 (Flookup_image_map):
14060 Don't assume fixnums fit in int.
14061 (compare_overlay_entries):
14062 Avoid mishandling comparisons due to subtraction overflow.
14063 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14064 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14065 (handle_tool_bar_click):
14066 Use int, not unsigned, since we prefer signed and the signedness
14067 doesn't matter here.
14068 (get_next_display_element, next_element_from_display_vector):
14069 Use int, not EMACS_INT, when int is wide enough.
14070 (start_hourglass): Use duration_to_sec_usec to do proper
14071 overflow checking on durations.
14072 * xfaces.c (Fbitmap_spec_p):
14073 Check that fixnums are in proper range for system types.
14074 (compare_fonts_by_sort_order):
14075 Avoid mishandling comparisons due to subtraction overflow.
14076 (Fx_family_fonts, realize_basic_faces):
14077 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14078 (Fx_family_fonts):
14079 Don't assume fixnum fits in int.
14080 Use SAFE_ALLOCA_LISP, not alloca.
14081 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14082 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14083 (face_at_buffer_position, face_for_overlay_string)
14084 (face_at_string_position):
14085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14086 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14087 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14088 (Fx_show_tip):
14089 Check that fixnums are in proper range for system types.
14090 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14091 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14093 (Fx_change_window_property): Don't assume fixnums fit in int.
14094 * xfont.c (xfont_chars_supported):
14095 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14096 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14097 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14099 * xml.c (parse_region):
14100 * xrdb.c (magic_file_p):
14101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14102 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14103 (x_get_local_selection, x_reply_selection_request)
14104 (x_handle_selection_request, wait_for_property_change):
14105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14106 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14107 short is wide enough.
14108 (x_send_client_event): Don't assume fixnum fits in int.
14109 * xterm.c (x_x_to_emacs_modifiers):
14110 Don't assume EMACS_INT overflows nicely into int.
14111 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14112 may come from Lisp.
14113 (handle_one_xevent): NATNUMP can eval its arg twice.
14114 (x_connection_closed):
14115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14116 * xterm.h: Adjust decls to match defn changes elsewhere.
14117 (struct scroll_bar): Use struct vectorlike_header
14118 rather than rolling our own approximation.
14119 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14120
14121 2012-05-25 Glenn Morris <rgm@gnu.org>
14122
14123 * lisp.mk (lisp): Update for more files being compiled now.
14124
14125 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14126
14127 * lread.c: Remove `read_pure' which makes no difference.
14128 (read_pure): Remove var.
14129 (unreadpure): Remove function.
14130 (readevalloop): Don't call read_list with -1 flag.
14131 (read1, read_vector): Don't test read_pure any more.
14132 (read_list): Simplify.
14133
14134 * fileio.c, character.h: Minor style tweaks.
14135
14136 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14137
14138 * window.h (clip_changed): Remove useless declaration.
14139
14140 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
14141
14142 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14143 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14144
14145 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14146
14147 Remove src/m/*.
14148 This directory predates autoconf and is no longer needed nowadays.
14149 Move its few remaining bits of functionality to where they're needed.
14150 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14151 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14152 * m/template.h: Remove.
14153 * Makefile.in (M_FILE): Remove. All uses removed.
14154 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14155 * lisp.h (USE_LSB_TAG):
14156 * mem-limits.h (EXCEEDS_LISP_PTR):
14157 Use VAL_MAX, not VALBITS, in #if.
14158 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14159 (EMACS_UINT): Define unconditionally now.
14160 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14161 (BITS_PER_EMACS_INT): New constants, replacing
14162 what used to be in config.h, but not useful in #if.
14163 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14164 define them any more.
14165 (VAL_MAX): New macro.
14166 (VALMASK): Use it.
14167 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14168 BITS_PER_EMACS_INT, in #if.
14169 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14170 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14171 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14172 * s/ms-w32.h (DATA_START):
14173 Move here from removed file m/intel386.h.
14174 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14175 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14176
14177 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14178
14179 Assume C89 or later.
14180 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14181 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14182 (xrealloc):
14183 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14184 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14185 * textprop.c, tparam.c (NULL): Remove.
14186 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14187 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14188 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14189 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14190 * xterm.c (input_signal_count): Assume volatile works.
14191
14192 2012-05-21 Ken Brown <kbrown@cornell.edu>
14193
14194 * xgselect.c (xg_select): Fix first argument in call to 'select'
14195 (bug#11508).
14196
14197 2012-05-20 Ken Brown <kbrown@cornell.edu>
14198
14199 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14200 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14201
14202 2012-05-19 Ken Brown <kbrown@cornell.edu>
14203
14204 * xfns.c (x_in_use): Remove `static' qualifier.
14205 * xterm.h (x_in_use): Declare.
14206 * xgselect.c: Include xterm.h.
14207 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14208 and `display_arg' (bug#9754).
14209
14210 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14211
14212 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14213
14214 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14215 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14216
14217 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14218
14219 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14220
14221 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14222 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14223
14224 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14225 reference to image_cache->refcount.
14226 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14227
14228 2012-05-17 Juri Linkov <juri@jurta.org>
14229
14230 * search.c (Fword_search_regexp, Fword_search_backward)
14231 (Fword_search_forward, Fword_search_backward_lax)
14232 (Fword_search_forward_lax): Move functions to isearch.el
14233 (bug#10145, bug#11381).
14234
14235 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14236
14237 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14238
14239 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14240
14241 * lread.c (init_obarray): Declare Qt and Qnil as special.
14242
14243 2012-05-14 Glenn Morris <rgm@gnu.org>
14244
14245 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14246 Put "libexec" before "bin", for the sake of init_callproc_1.
14247
14248 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14249
14250 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14251
14252 * unexaix.c: Port to more-recent AIX compilers.
14253 (report_error, report_error_1, make_hdr, copy_sym)
14254 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14255 Make arguments const char *, not char *, to avoid violations of C
14256 standard and to fix some AIX warnings reported by Gilles Pion.
14257
14258 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14259
14260 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14261 already have overlays loaded.
14262 (handle_single_display_spec): Before returning without displaying
14263 fringe bitmap, synchronize the bidi iterator with the main display
14264 iterator, by calling iterate_out_of_display_property.
14265 (iterate_out_of_display_property): Detect buffer iteration by
14266 testing that it->string is a Lisp string.
14267 (get_next_display_element): When the current object is exhausted,
14268 and there's something on it->stack, call set_iterator_to_next to
14269 proceed with what's on the stack, instead of returning zero.
14270 (set_iterator_to_next): If called at the end of a Lisp string,
14271 proceed to consider_string_end without incrementing string
14272 position. Don't increment display vector index past the end of
14273 the display vector. (Bug#11417)
14274 (pos_visible_p): Don't report a position visible when move_it_to
14275 stopped at the last line of window, which happens to be scanned
14276 backwards by the bidi iteration. (Bug#11464)
14277
14278 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14279
14280 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14281 and right-margin display specs even if the spec is invalid or we
14282 are on a TTY, and thus unable to display on the fringes.
14283 That's because the text with the property will not be displayed anyway,
14284 so we need to signal to the caller that this is a "replacing"
14285 display spec. This fixes display when the spec is invalid or we
14286 are on a TTY.
14287
14288 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14289
14290 * unexaix.c (make_hdr): Fix typo in prototype.
14291 This bug broke the build on AIX. Problem reported by Gilles Pion.
14292
14293 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14294
14295 * keyboard.c (kbd_buffer_get_event): Read special events also in
14296 batch mode. (Bug#11415)
14297
14298 2012-05-12 Glenn Morris <rgm@gnu.org>
14299
14300 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14301
14302 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14303
14304 * lisp.mk (lisp): Add newcomment.elc.
14305
14306 2012-05-12 Glenn Morris <rgm@gnu.org>
14307
14308 * Makefile.in (MKDIR_P): New, set by configure.
14309 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14310
14311 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14312
14313 Remove unused function hourglass_started.
14314 * dispextern.h (hourglass_started):
14315 * w32fns.c (hourglass_started):
14316 * xdisp.c (hourglass_started): Remove.
14317
14318 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14319
14320 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14321 Update dependencies.
14322
14323 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14324
14325 * xgselect.c (xg_select): Put maxfds+1 into a var.
14326 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14327
14328 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14329
14330 2012-05-10 Dave Abrahams <dave@boostpro.com>
14331
14332 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14333 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14334
14335 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14336
14337 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14338 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14339 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14340 Initialize xd_registered_buses.
14341
14342 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14343
14344 Untag more efficiently if USE_LSB_TAG.
14345 This is based on a proposal by YAMAMOTO Mitsuharu in
14346 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14347 For an admittedly artificial (nth 8000 longlist) benchmark on
14348 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14349 Emacs's overall text size by 1%.
14350 * lisp.h (XUNTAG): New macro.
14351 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14352 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14353 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14354 * eval.c (Fautoload):
14355 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14356 * frame.h (XFRAME): Use XUNTAG.
14357
14358 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14359 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14360 Remove unportable assumptions about print widths of types like
14361 dbus_uint32_t.
14362 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14363 intptr_t when converting between pointer and integer, to avoid GCC
14364 warnings about wrong width.
14365
14366 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14367
14368 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14369 stack for each reader_thread, instead of defaulting to 8MB
14370 determined by the linker. This avoids failures in creating
14371 subprocesses on Windows 7, see the discussion in this thread:
14372 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14373
14374 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14375
14376 Fix up display of the *Minibuf-0* buffer in the mini window.
14377 * keyboard.c (read_char): Don't clear the echo area if there's no
14378 message to clear.
14379 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14380 contents of *Minibuf-0*) if there's no message displayed in its stead.
14381
14382 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14383
14384 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14385 batch mode.
14386
14387 2012-05-06 Chong Yidong <cyd@gnu.org>
14388
14389 * lisp.mk (lisp): Update.
14390
14391 2012-05-05 Jim Meyering <meyering@redhat.com>
14392
14393 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14394
14395 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14396
14397 * data.c (PUT_ERROR): New macro.
14398 (syms_of_data): Use it. Add new error type `user-error'.
14399 * undo.c (user_error): New function.
14400 (Fprimitive_undo): Use it.
14401 * print.c (print_error_message): Adjust print style for `user-error'.
14402 * keyboard.c (user_error): New function.
14403 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14404
14405 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14406
14407 Do not limit current-time-string to years 1000..9999.
14408 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14409 (Fcurrent_time_string): Support any year that is supported by the
14410 underlying localtime representation. Don't use asctime, as it
14411 has undefined behavior for years outside the range -999..9999.
14412
14413 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14414
14415 Fix race conditions involving setenv, gmtime, localtime, asctime.
14416 Without this fix, interrupts could mess up code that uses these
14417 nonreentrant functions, since setting TZ invalidates existing
14418 tm_zone or tzname values, and since most of these functions return
14419 pointers to static storage.
14420 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14421 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14422 Grow the critical sections to include not just invoking
14423 localtime/gmtime, but also accessing these functions' results
14424 including their tm_zone values if any, and any related TZ setting.
14425 (format_time_string): Last arg is now struct tm *, not struct tm **,
14426 so that the struct tm is saved in the critical section.
14427 All callers changed. Simplify allocation of initial buffer, partly
14428 motivated by the fact that memory allocation needs to be outside
14429 the critical section.
14430
14431 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14432
14433 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14434 with RESET_INTERVAL.
14435
14436 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14437 Remove duplicated buffer name initialization.
14438
14439 2012-05-02 Jim Meyering <jim@meyering.net>
14440
14441 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14442
14443 * xfns.c (x_window): Use xstrdup (Bug#11375).
14444
14445 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14446
14447 * xdisp.c (pos_visible_p): If already at a newline from the
14448 display string before the 'while' loop, don't walk back the glyphs
14449 from it3.glyph_row. Solves assertion violation when the display
14450 string begins with a newline (egg.el). (Bug#11367)
14451
14452 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14453
14454 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14455 Move to simple.el.
14456
14457 2012-05-01 Glenn Morris <rgm@gnu.org>
14458
14459 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14460 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14461 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14462 All were removed before 23.1.
14463
14464 * dispnew.c: Remove HAVE_LIBNCURSES test;
14465 it is always true on relevant platforms.
14466
14467 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14468 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14469
14470 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14471
14472 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14473
14474 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14475 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14476 Remove.
14477
14478 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14479
14480 Do not avoid creating empty evaporating overlays (Bug#9642).
14481 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14482 That is, do not delete an evaporating overlay if it becomes
14483 empty after its bounds are adjusted to fit within its buffer.
14484 This fix caused other problems, and I'm reverting it until we get
14485 to the bottom of them.
14486
14487 2012-04-27 Chong Yidong <cyd@gnu.org>
14488
14489 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14490
14491 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14492
14493 * xdisp.c (pos_visible_p): If the window start position is beyond
14494 ZV, start the display from buffer beginning. Prevents assertion
14495 violation in init_iterator when the minibuffer window is scrolled
14496 via the scroll bar.
14497
14498 * window.c (window_scroll_pixel_based): Likewise.
14499
14500 2012-04-27 Chong Yidong <cyd@gnu.org>
14501
14502 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14503
14504 2012-04-27 Glenn Morris <rgm@gnu.org>
14505
14506 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14507 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14508
14509 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14510
14511 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14512 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14513
14514 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14515
14516 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14517 display element, check also the underlying string or buffer
14518 character. (Bug#11341)
14519
14520 * w32menu.c: Include w32heap.h.
14521 (add_menu_item): If the call to AppendMenuW (via
14522 unicode_append_menu) fails, disable Unicode menus only if we are
14523 running on Windows 9X/Me.
14524
14525 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14526
14527 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14528 (xgetint): Add missing shift for LSB tags.
14529
14530 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14531
14532 * keyboard.c (read_char): Don't wipe echo area for select window
14533 events: These might get delayed via `mouse-autoselect-window'
14534 (Bug#11304).
14535
14536 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14537
14538 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14539 manipulation of :loaded-from data.
14540
14541 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14542
14543 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14544 now a cons (bug#11311).
14545
14546 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14547
14548 Do not create empty overlays with the evaporate property (Bug#9642).
14549 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14550 if it becomes empty after its bounds are adjusted to fit within
14551 its buffer. Without this fix, in a nonempty buffer (let ((o
14552 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14553 yields an empty overlay that has the evaporate property, which is
14554 not supposed to happen.
14555
14556 Fix minor GTK3 problems found by static checking.
14557 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14558 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14559 (struct _EmacsFixedClass, emacs_fixed_get_type):
14560 Move decls here from emacsgtkfixed.h, since they needn't be public.
14561 (emacs_fixed_get_type): Now static.
14562 (emacs_fixed_class_init): Omit unused local.
14563 (emacs_fixed_child_type): Remove; unused.
14564 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14565 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14566 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14567 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14568 (EMACS_FIXED_GET_CLASS): Remove; unused.
14569 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14570
14571 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14572 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14573
14574 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14575
14576 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14577 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14578 (__malloc_size_t, __malloc_ptrdiff_t):
14579 Remove. All uses removed, replaced by the definiens if needed,
14580 since we can assume C89 or better now.
14581 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14582 (protect_malloc_state, align, get_contiguous_space)
14583 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14584 (malloc_atfork_handler_child, malloc_enable_thread)
14585 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14586 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14587 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14588 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14589 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14590 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14591 Define using prototypes, not old style.
14592 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14593 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14594 (align): Don't assume that signed integer overflow wraps around.
14595 Omit unused local var.
14596 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14597 (_free_internal_nolock, memalign, mallochook, reallochook):
14598 Omit no-longer-needed casts.
14599 (valloc): Use getpagesize, not __getpagesize.
14600 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14601 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14602
14603 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14604
14605 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14606
14607 Move functions from C to Lisp. Make non-blocking method calls
14608 the default. Implement further D-Bus standard interfaces.
14609
14610 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14611 (QCdbus_request_name_allow_replacement)
14612 (QCdbus_request_name_replace_existing)
14613 (QCdbus_request_name_do_not_queue)
14614 (QCdbus_request_name_reply_primary_owner)
14615 (QCdbus_request_name_reply_in_queue)
14616 (QCdbus_request_name_reply_exists)
14617 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14618 (QCdbus_registered_serial, QCdbus_registered_method)
14619 (QCdbus_registered_signal): New Lisp objects.
14620 (XD_DEBUG_MESSAGE): Use sizeof.
14621 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14622 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14623 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14624 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14625 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14626 (xd_signature, xd_append_arg): Allow float for integer types.
14627 (xd_get_connection_references): New function.
14628 (xd_get_connection_address): Rename from xd_initialize.
14629 Return cached address.
14630 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14631 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14632 level.
14633 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14634 Return number of refcounts.
14635 (Fdbus_get_unique_name): Make stronger parameter check.
14636 (Fdbus_message_internal): New defun.
14637 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14638 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14639 (Fdbus_send_signal, Fdbus_register_service)
14640 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14641 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14642 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14643 (Vdbus_compiled_version, Vdbus_runtime_version)
14644 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14645 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14646 (Vdbus_message_type_signal): New defvars.
14647 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14648 Adapt docstring.
14649
14650 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14651
14652 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14653 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14654 Do not assume ptrdiff_t is the same width as 'int'.
14655
14656 * alloc.c: Handle unusual debugging option combinations.
14657 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14658 since the two debugging options are incompatible.
14659 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14660 is defined.
14661 (mem_init, mem_insert, mem_insert_fixup):
14662 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14663 (NEED_MEM_INSERT): Remove; no longer needed.
14664
14665 2012-04-22 Leo Liu <sdl.web@gmail.com>
14666
14667 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14668
14669 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14670
14671 * sysdep.c [__FreeBSD__]: Minor cleanups.
14672 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14673 Use Emacs indenting style more consistently. Avoid some casts.
14674 Use 'double' consistently rather than mixing 'float' and 'double'.
14675
14676 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14677
14678 * sysdep.c (list_system_processes, system_process_attributes):
14679 Add implementation for FreeBSD (Bug#5243).
14680
14681 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14682
14683 * lisp.mk (lisp): Update.
14684
14685 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14686
14687 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14688 It is never used otherwise.
14689
14690 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14691
14692 * print.c (print_preprocess): Only check print_depth if print-circle
14693 is nil.
14694 (print_object): Check for cycles even when print-circle is nil and
14695 print-gensym is t, but only check print_depth if print-circle is nil.
14696
14697 2012-04-20 Chong Yidong <cyd@gnu.org>
14698
14699 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14700 set the status to "failed" and ensure that sentinel is run.
14701
14702 2012-04-20 Glenn Morris <rgm@gnu.org>
14703
14704 * process.c (Fset_process_inherit_coding_system_flag)
14705 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14706 (Fmake_network_process, Fmake_serial_process): Doc fix.
14707
14708 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14709
14710 * xdisp.c (string_buffer_position_lim): Limit starting position to
14711 BEGV.
14712 (set_cursor_from_row): If called for a mode-line or header-line
14713 row, return zero immediately.
14714 (try_cursor_movement): If inside continuation line, don't back up
14715 farther than the first row after the header line, if any.
14716 Don't consider the header-line row as "partially visible", even if
14717 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14718
14719 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14720
14721 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14722 (bug#11238).
14723
14724 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14725 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14726
14727 configure: new option --enable-gcc-warnings (Bug#11207)
14728 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14729 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14730 (ALL_CFLAGS): Use new macros rather than old.
14731 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14732 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14733 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14734 -Wunused-result, -Wunused-variable. This should go away once
14735 the Emacs and Gnulib regex code is merged.
14736 (xmalloc, xrealloc): Now static.
14737
14738 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14739
14740 * dired.c (Fsystem_groups): Remove unused local.
14741
14742 2012-04-17 Glenn Morris <rgm@gnu.org>
14743
14744 * dired.c (Fsystem_users): Doc fix.
14745
14746 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14747
14748 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14749 (syms_of_dired): Add them.
14750
14751 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14752
14753 Fix minor alloc.c problems found by static checking.
14754 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14755 New extern decls, to avoid calling undeclared functions.
14756 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14757 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14758 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14759 (NEED_MEM_INSERT): New macro.
14760 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14761 Remove one incorrect comment and fix another.
14762
14763 Fix minor ralloc.c problems found by static checking.
14764 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14765 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14766 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14767 (r_alloc_sbrk): Now static.
14768
14769 Improve ralloc.c interface checking.
14770 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14771 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14772 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14773 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14774 [REL_ALLOC]: ... to here, to check interface.
14775 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14776 Remove decls. This fixes an "It stinks!".
14777
14778 * alloc.c (which_symbols): Fix alignment issue / type clash.
14779
14780 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14781
14782 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14783 (struct Lisp_Misc_Any): Likewise.
14784 (struct Lisp_Free): Likewise.
14785 * alloc.c (union aligned_Lisp_Symbol): Define.
14786 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14787 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14788 (union aligned_Lisp_Misc): Define.
14789 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14790 aligned_Lisp_Misc instead of union Lisp_Misc.
14791 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14792
14793 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14794
14795 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14796 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14797 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14798 * s/netbsd.h, s/sol2-6.h:
14799 Remove definition of GC_MARK_STACK, since the default now works.
14800 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14801 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14802 no longer the default.
14803 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14804
14805 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14806
14807 * lread.c (lisp_file_lexically_bound_p):
14808 Fix hang at ";-*-\n" (bug#11238).
14809
14810 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14811
14812 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14813 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14814
14815 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14816
14817 * nsterm.m (constrainFrameRect): Always constrain when there is only
14818 one screen (Bug#10962).
14819
14820 2012-04-13 Ken Brown <kbrown@cornell.edu>
14821
14822 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14823
14824 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14825
14826 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14827
14828 2012-04-11 Daniel Colascione <dancol@dancol.org>
14829
14830 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14831 against is gone. It's better to use vfork now so that when Cygwin
14832 gains a new, working vfork, we use it automatically (bug#10398).
14833
14834 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14835
14836 * window.c (save_window_save): Obey window-point-insertion-type.
14837
14838 2012-04-11 Glenn Morris <rgm@gnu.org>
14839
14840 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14841
14842 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14843
14844 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14845
14846 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14847
14848 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14849 (force_quit_count): New var.
14850 (handle_interrupt): Use it.
14851
14852 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14853
14854 * w32.c (w32_delayed_load): Record the full path of the library
14855 being loaded (bug#10424).
14856
14857 2012-04-09 Glenn Morris <rgm@gnu.org>
14858
14859 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14860 not just in the obarray, before snarfing them. (Bug#11036)
14861
14862 * Makefile.in ($(leimdir)/leim-list.el):
14863 Pass EMACS rather than BUILT_EMACS.
14864
14865 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14866
14867 * process.c (make_process):
14868 * process.h: Add integer `gnutls_handshakes_tried' member to
14869 process struct.
14870
14871 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14872 Add convenience `GNUTLS_LOG2i' macro.
14873
14874 * gnutls.c (gnutls_log_function2i): Convenience log function.
14875 (emacs_gnutls_read): Use new log functions,
14876 `gnutls_handshakes_tried' process member, and
14877 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14878 attempts per process (connection).
14879
14880 2012-04-09 Chong Yidong <cyd@gnu.org>
14881
14882 * eval.c (Fuser_variable_p, user_variable_p_eh)
14883 (lisp_indirect_variable): Functions deleted.
14884 (Fdefvar): Caller changed.
14885
14886 * callint.c (Finteractive, Fcall_interactively):
14887 * minibuf.c (Fread_variable): Callers changed.
14888
14889 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14890
14891 * xdisp.c (set_cursor_from_row): If the display string appears in
14892 the buffer at position that is closer to point than the position
14893 after the display string, display the cursor on the first glyph of
14894 the display string. Fixes cursor display when a 'display' text
14895 property immediately follows invisible text. (Bug#11094)
14896
14897 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14898
14899 composite.c: use 'double' consistently
14900 * composite.c (get_composition_id): Use 'double' consistently
14901 instead of converting 'float' to 'double' and vice versa; this is
14902 easier to understand and avoids a GCC warning.
14903
14904 2012-04-09 Glenn Morris <rgm@gnu.org>
14905
14906 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14907 preparation for dumping it with emacs. (Bug#4789)
14908 (leimdir): New variable.
14909 ($(leimdir)/leim-list.el): New rule.
14910 (emacs$(EXEEXT)): Depend on leim-list.el.
14911
14912 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14913 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14914 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14915
14916 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14917
14918 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14919 proper alignment.
14920
14921 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14922
14923 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14924 Remove unused local variable.
14925
14926 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14927
14928 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14929 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14930 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14931 objects, as mark_maybe_pointer will catch them otherwise.
14932 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14933 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14934
14935 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14936
14937 Fix typo that broke non-Windows builds.
14938 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14939
14940 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14941
14942 Support building on MS-Windows with libxml2.
14943
14944 * makefile.w32-in (OBJ2): Add xml.$(O).
14945 (GLOBAL_SOURCES): Add xml.c.
14946 ($(BLD)/xml.$(O)): New dependency list.
14947
14948 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14949 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14950 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14951 [!WINDOWSNT]: New macros.
14952 (init_libxml2_functions, libxml2_loaded_p): New functions.
14953 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14954 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14955 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14956 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14957 linked in).
14958 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14959 Call init_libxml2_functions before calling libxml2 functions.
14960 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14961
14962 * emacs.c: Don't include libxml/parser.h.
14963 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14964 xmlCleanupParser directly.
14965
14966 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14967
14968 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14969
14970 * indent.c (Fvertical_motion): If there is a display string at
14971 point, use it.vpos to compute how many lines to backtrack after
14972 move_it_to point. (Bug#11133)
14973
14974 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14975
14976 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14977 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14978 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14979 macros related to unification of CJK characters. For the details,
14980 see the discussion following the message here:
14981 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14982
14983 2012-04-04 Chong Yidong <cyd@gnu.org>
14984
14985 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14986
14987 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14988
14989 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14990 instead of alloca. (Bug#11138)
14991
14992 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14993
14994 * w32menu.c (is_simple_dialog): Properly check lisp types.
14995 (Bug#11141)
14996
14997 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14998
14999 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
15000 position we get to after a call to move_it_to fails the
15001 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
15002 only if we wind up in a string from display property. (Bug#11063)
15003
15004 * window.c (Fdelete_other_windows_internal): Invalidate the row
15005 and column information about mouse highlight, so that redisplay
15006 restores it after reallocating the glyph matrices. (Bug#7464)
15007
15008 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
15009 string comes from a `display' text property, use the buffer
15010 position of that property as if we actually saw that position in
15011 the row's glyphs.
15012 (move_it_by_lines): Remove the assertion that
15013 "it->current_x == 0 && it->hpos == 0" which can be legitimately
15014 violated when there's a before-string at the beginning of a line.
15015 (Bug#11063)
15016
15017 2012-03-30 Eli Zaretskii <eliz@gnu.org>
15018
15019 * xdisp.c (append_space_for_newline): If the default face was
15020 remapped, use the remapped face for the appended newline.
15021 (extend_face_to_end_of_line): Use the remapped default face for
15022 extending the face to the end of the line.
15023 (display_line): Call extend_face_to_end_of_line when the default
15024 face was remapped. (Bug#11068)
15025
15026 2012-03-29 Eli Zaretskii <eliz@gnu.org>
15027
15028 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
15029
15030 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15031
15032 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
15033
15034 2012-03-27 Glenn Morris <rgm@gnu.org>
15035
15036 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15037 Doc fixes.
15038
15039 2012-03-26 Kenichi Handa <handa@m17n.org>
15040
15041 * dispextern.h (struct glyph): Fix previous change. Change the
15042 bit length of glyphless.ch to 25 (Bug#11082).
15043
15044 2012-03-26 Chong Yidong <cyd@gnu.org>
15045
15046 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15047 (command_loop_1): Use it; inhibit selection update for
15048 handle-select-window too (Bug#8996).
15049
15050 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15051
15052 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15053
15054 2012-03-25 Kenichi Handa <handa@m17n.org>
15055
15056 * dispextern.h (struct glyph): Change the bit length of
15057 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15058
15059 2012-03-24 Eli Zaretskii <eliz@gnu.org>
15060
15061 * s/ms-w32.h (tzname): Include time.h before redirecting to
15062 _tzname. Fixes the MSVC build. (Bug#9960)
15063
15064 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15065
15066 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15067 characters.
15068
15069 * xterm.c (XTread_socket): Only modify handling_signal if
15070 !SYNC_INPUT. (Bug#11080)
15071
15072 2012-03-23 Eli Zaretskii <eliz@gnu.org>
15073
15074 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15075 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15076 when fetching a multibyte character consumes more bytes than
15077 CHAR_BYTES returns, due to unification of CJK characters in
15078 string_char. (Bug#11073)
15079
15080 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15081
15082 * process.c (wait_reading_process_output): Handle pty disconnect
15083 by refraining from sending oneself a SIGCHLD (bug#10933).
15084
15085 2012-03-22 Chong Yidong <cyd@gnu.org>
15086
15087 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15088
15089 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15090 Mark string as coming from a prefix property.
15091 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15092 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15093
15094 2012-03-21 Chong Yidong <cyd@gnu.org>
15095
15096 * xfaces.c (Vface_remapping_alist): Doc fix.
15097
15098 2012-03-20 Eli Zaretskii <eliz@gnu.org>
15099
15100 * w32proc.c (Fw32_set_console_codepage)
15101 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15102 Doc fixes.
15103
15104 2012-03-20 Chong Yidong <cyd@gnu.org>
15105
15106 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15107 to reflect default non-nil value of redisplay-dont-pause.
15108
15109 2012-03-19 Kenichi Handa <handa@m17n.org>
15110
15111 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15112 it fit in a valid range (Bug#11003).
15113
15114 2012-03-18 Eli Zaretskii <eliz@gnu.org>
15115
15116 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15117 that is not from display property, accept the row as a "cursor
15118 row" if one of the string's character has a non-nil `cursor'
15119 property. Fixes cursor positioning when there are newlines in
15120 overlay strings, e.g. in icomplete.el. (Bug#11035)
15121
15122 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15123
15124 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15125
15126 2012-03-12 Chong Yidong <cyd@gnu.org>
15127
15128 * eval.c (inhibit_lisp_code): Rename from
15129 inhibit_window_configuration_change_hook; move from window.c.
15130
15131 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15132 * window.c (run_window_configuration_change_hook)
15133 (syms_of_window): Callers changed.
15134
15135 2012-03-11 Chong Yidong <cyd@gnu.org>
15136
15137 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15138
15139 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15140
15141 2012-03-10 Chong Yidong <cyd@gnu.org>
15142
15143 * frame.c (other_visible_frames): Don't assume the selected frame
15144 is visible (Bug#10955).
15145
15146 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15147
15148 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15149
15150 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15151
15152 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15153 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15154 zero (Bug#10954).
15155
15156 2012-03-03 Glenn Morris <rgm@gnu.org>
15157
15158 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15159
15160 2012-03-02 Eli Zaretskii <eliz@gnu.org>
15161
15162 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15163 position past the first glyph_row that ends at ZV. (Bug#10902)
15164 (redisplay_window, next_element_from_string): Fix typos in
15165 comments.
15166 (redisplay_window): Pass to move_it_vertically the margin in
15167 pixels, not in screen lines.
15168
15169 2012-03-02 Glenn Morris <rgm@gnu.org>
15170
15171 * buffer.c (buffer-list-update-hook): Doc fix.
15172
15173 2012-02-29 Eli Zaretskii <eliz@gnu.org>
15174
15175 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15176 push_it before setting up the iterator for the first overlay
15177 string, even if we have an empty string loaded.
15178 (next_overlay_string): If there's an empty string on the iterator
15179 stack, pop the stack. (Bug#10903)
15180
15181 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15182
15183 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15184 Suggested by Stefan Monnier in
15185 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15186 * alloc.c (widen_to_Lisp_Object): New static function.
15187 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15188 and widening them to Lisp_Objects. This would work even if
15189 USE_LSB_TAG is defined and wide integers are used, which might
15190 happen in a future version of Emacs.
15191
15192 2012-02-25 Chong Yidong <cyd@gnu.org>
15193
15194 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15195 Doc fix.
15196
15197 * xselect.c (Fx_selection_exists_p): Doc fix.
15198 (x_clipboard_manager_save_all): Print an informative message
15199 before saving to clipboard manager.
15200
15201 2012-02-24 Chong Yidong <cyd@gnu.org>
15202
15203 * keyboard.c (process_special_events): Handle all X selection
15204 requests in kbd_buffer, not just the next one (Bug#8869).
15205
15206 2012-02-23 Chong Yidong <cyd@gnu.org>
15207
15208 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15209 call when setting menu-bar-lines and tool-bar-lines parameters.
15210 (unwind_create_frame_1): New helper function.
15211
15212 * window.c (inhibit_window_configuration_change_hook): New var.
15213 (run_window_configuration_change_hook): Obey it.
15214 (syms_of_window): Initialize it.
15215
15216 2012-02-22 Chong Yidong <cyd@gnu.org>
15217
15218 * xterm.c (x_draw_image_relief): Add missing type check for
15219 Vtool_bar_button_margin (Bug#10743).
15220
15221 2012-02-21 Chong Yidong <cyd@gnu.org>
15222
15223 * fileio.c (Vfile_name_handler_alist): Doc fix.
15224
15225 * buffer.c (Fget_file_buffer): Protect against invalid file
15226 handler return value.
15227
15228 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15229
15230 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15231 when computing $valmask.
15232
15233 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15234 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15235 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15236 It's useless in that case, and it can cause problems on hosts
15237 that allocate halves of EMACS_INT values separately.
15238 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15239 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15240 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15241 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15242 it avoids undefined behavior on hosts where shifting right by more
15243 than the word width has undefined behavior.
15244
15245 2012-02-19 Chong Yidong <cyd@gnu.org>
15246
15247 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15248 (Funhandled_file_name_directory, Ffile_name_as_directory)
15249 (Fdirectory_file_name, Fexpand_file_name)
15250 (Fsubstitute_in_file_name): Protect against invalid file handler
15251 return values (Bug#10845).
15252
15253 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15254
15255 * .gdbinit (pitx): Fix incorrect references to fields of the
15256 iterator stack.
15257
15258 2012-02-17 Chong Yidong <cyd@gnu.org>
15259
15260 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15261
15262 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15263
15264 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15265 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15266
15267 2012-02-15 Chong Yidong <cyd@gnu.org>
15268
15269 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15270 marked as special. Also, starting docstrings with * is obsolete.
15271
15272 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15273
15274 * gnutls.c (emacs_gnutls_write): Fix last change.
15275
15276 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15277
15278 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15279 send_process.
15280
15281 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15282
15283 * keymap.c (Fsingle_key_description): Handle char ranges.
15284
15285 2012-02-12 Chong Yidong <cyd@gnu.org>
15286
15287 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15288 as that creates a dangerous corner case.
15289
15290 * window.c (Fdelete_window_internal): Invalidate the mouse
15291 highlight (Bug#9904).
15292
15293 2012-02-12 Glenn Morris <rgm@gnu.org>
15294
15295 * xselect.c (Fx_own_selection_internal)
15296 (Fx_get_selection_internal, Fx_disown_selection_internal)
15297 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15298 * nsselect.m (Fx_own_selection_internal)
15299 (Fx_disown_selection_internal, Fx_selection_exists_p)
15300 (Fx_selection_owner_p, Fx_get_selection_internal):
15301 Sync docs and argument specs with the xselect.c versions.
15302
15303 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15304
15305 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15306
15307 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15308
15309 * w32select.c (Fx_selection_exists_p): Sync doc string and
15310 argument list with xselect.c. (Bug#10783)
15311
15312 * w16select.c (Fx_selection_exists_p): Sync doc string and
15313 argument list with xselect.c. (Bug#10783)
15314
15315 2012-02-10 Glenn Morris <rgm@gnu.org>
15316
15317 * fns.c (Fsecure_hash): Doc fix.
15318
15319 2012-02-09 Kenichi Handa <handa@m17n.org>
15320
15321 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15322
15323 2012-02-07 Chong Yidong <cyd@gnu.org>
15324
15325 * buffer.c (Fbuffer_local_variables)
15326 (buffer_lisp_local_variables): Handle unbound vars correctly;
15327 don't let Qunbound leak into Lisp.
15328
15329 2012-02-07 Glenn Morris <rgm@gnu.org>
15330
15331 * image.c (Fimagemagick_types): Doc fix.
15332
15333 * image.c (imagemagick-render-type): Change it from a lisp object
15334 to an integer. Move the doc here from the lisp manual.
15335 Treat all values not equal to 0 the same.
15336
15337 2012-02-06 Chong Yidong <cyd@gnu.org>
15338
15339 * doc.c (store_function_docstring): Avoid applying docstring of
15340 alias to base function (Bug#2603).
15341
15342 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15343
15344 * .gdbinit (pp1, pv1): Remove redundant defines.
15345 (pr): Use pp.
15346
15347 2012-02-04 Chong Yidong <cyd@gnu.org>
15348
15349 * nsterm.m: Declare a global (Bug#10694).
15350
15351 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15352
15353 * w32.c (get_emacs_configuration_options):
15354 Include --enable-checking, if specified, in the return value.
15355
15356 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15357
15358 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15359 after rounding frame sizes. (Bug#9723)
15360
15361 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15362
15363 * keyboard.c (adjust_point_for_property): Don't position point
15364 before BEGV. (Bug#10696)
15365
15366 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15367
15368 Handle overflow when computing char display width (Bug#9496).
15369 * character.c (char_width): Return EMACS_INT, not int.
15370 (char_width, c_string_width): Check for overflow when
15371 computing the width; this is possible now that individual
15372 characters can have unbounded width. Problem introduced
15373 by merge from Emacs 23 on 2012-01-19.
15374
15375 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15376
15377 * dbusbind.c (Fdbus_register_method): Mention the return value
15378 :ignore in the docstring.
15379
15380 2012-02-02 Glenn Morris <rgm@gnu.org>
15381
15382 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15383
15384 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15385 Unconditionally set to t. (Bug#10673)
15386 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15387 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15388 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15389
15390 2012-02-02 Kenichi Handa <handa@m17n.org>
15391
15392 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15393 0, do not call append_composite_glyph.
15394
15395 2012-02-02 Kenichi Handa <handa@m17n.org>
15396
15397 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15398 NULL (Bug#6988).
15399 (x_produce_glyphs): If the component of a composition is a null
15400 string, set it->pixel_width to 1 to avoid zero-width glyph.
15401
15402 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15403
15404 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15405 first 2 arguments are identical. This makes inserting large
15406 output from a subprocess an order of magnitude faster on
15407 MS-Windows, where all sbrk'ed memory is always contiguous.
15408
15409 2012-01-31 Glenn Morris <rgm@gnu.org>
15410
15411 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15412 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15413 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15414
15415 2012-01-29 Glenn Morris <rgm@gnu.org>
15416
15417 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15418
15419 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15420
15421 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15422
15423 2012-01-28 Chong Yidong <cyd@gnu.org>
15424
15425 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15426
15427 2012-01-26 Chong Yidong <cyd@gnu.org>
15428
15429 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15430
15431 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15432 repeat counts (Bug#10507).
15433
15434 2012-01-26 Glenn Morris <rgm@gnu.org>
15435
15436 * lread.c (syms_of_lread): Doc fix.
15437
15438 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15439
15440 * coding.c (encode_designation_at_bol): Change return value to
15441 EMACS_INT.
15442
15443 2012-01-25 Chong Yidong <cyd@gnu.org>
15444
15445 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15446
15447 2012-01-21 Chong Yidong <cyd@gnu.org>
15448
15449 * floatfns.c (Fcopysign): Make the second argument non-optional,
15450 since nil is not allowed anyway.
15451
15452 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15453
15454 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15455 (send_process): Likewise.
15456
15457 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15458
15459 * window.c (save_window_save, Fcurrent_window_configuration)
15460 (Vwindow_persistent_parameters): Do not use Qstate.
15461 Rewrite doc-strings.
15462
15463 2012-01-19 Kenichi Handa <handa@m17n.org>
15464
15465 * character.c (char_width): New function.
15466 (Fchar_width, c_string_width, lisp_string_width):
15467 Use char_width (Bug#9496).
15468
15469 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15470
15471 * window.c (Vwindow_persistent_parameters): New variable.
15472 (Fset_window_configuration, save_window_save): Handle persistent
15473 window parameters.
15474
15475 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15476
15477 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15478 thrashing the stack of the thread. (Bug#9087)
15479
15480 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15481
15482 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15483
15484 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15485
15486 * xdisp.c (rows_from_pos_range): Handle the case where the
15487 highlight ends on a newline. (Bug#10464)
15488 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15489 he end column for display of highlight that ends on a newline
15490 before a R2L line.
15491
15492 2012-01-11 Glenn Morris <rgm@gnu.org>
15493
15494 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15495 from load-path also when installation-directory is nil. (Bug#10208)
15496
15497 2012-01-10 Glenn Morris <rgm@gnu.org>
15498
15499 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15500
15501 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15502 Update template values to be closer to their typical values these days.
15503
15504 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15505
15506 * xdisp.c (rows_from_pos_range): Accept additional argument
15507 DISP_STRING, and accept any glyph in a row whose object is that
15508 string as eligible for mouse highlight. Fixes mouse highlight of
15509 display strings from overlays. (Bug#10464)
15510
15511 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15512
15513 emacs: fix an auto-save permissions race condition (Bug#10400)
15514 * fileio.c (auto_saving_dir_umask): New static var.
15515 (Fmake_directory_internal): Use it.
15516 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15517 creating the directory. The old code temporarily assigns
15518 too-generous permissions to the directory.
15519 (do_auto_save_eh): Clear it.
15520 (Fdo_auto_save): Catch all errors, not just file errors, so
15521 that the var is always cleared.
15522
15523 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15524
15525 * search.c (scan_buffer): Pass character positions to
15526 know_region_cache, not byte positions. (Bug#6540)
15527
15528 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15529
15530 * w32.c (sys_rename): Report EXDEV when rename of a directory
15531 fails because the target is on another logical disk. (Bug#10284)
15532
15533 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15534
15535 * xterm.c (x_embed_request_focus): New function.
15536
15537 * xterm.h: Add prototype.
15538
15539 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15540
15541 2012-01-05 Glenn Morris <rgm@gnu.org>
15542
15543 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15544
15545 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15546
15547 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15548 Load gnutls_transport_set_lowat only if GnuTLS version is below
15549 2.11.1.
15550 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15551 GnuTLS versions below 2.11.1.
15552
15553 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15554
15555 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15556 to the doc string advising against its use for altering the way
15557 windows are scrolled.
15558
15559 2011-12-28 Kenichi Handa <handa@m17n.org>
15560
15561 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15562 coding-system ASCII compatible only when it does not produce BOM
15563 on encoding (Bug#10383).
15564
15565 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15566
15567 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15568 can scroll.
15569 (create_and_show_popup_menu): Always use menu_position_func for
15570 Gtk3 (Bug#10361).
15571
15572 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15573
15574 * callint.c (Fcall_interactively): Don't truncate prompt string.
15575
15576 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15577
15578 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15579 property that ends at ZV, so that the bidi iteration could be
15580 resumed from there (after widening). (Bug#10360)
15581
15582 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15583
15584 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15585
15586 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15587
15588 * nsterm.m (x_free_frame_resources):
15589 Release f->output_data.ns->miniimage.
15590 (ns_index_color): Fix indentation. Do not retain
15591 color_table->colors[i].
15592
15593 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15594 before returning.
15595
15596 * nsfns.m (x_set_background_color): Assign return value from
15597 ns_index_color to face-background instead of NSColor*.
15598 (ns_implicitly_set_icon_type): Fix indentation.
15599 Change assignment in for loop to comparison.
15600
15601 * emacs.c (ns_pool): New variable.
15602 (main): Assign ns_pool.
15603 (Fkill_emacs): Call ns_release_autorelease_pool.
15604
15605 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15606 autorelease fdesc, release fdAttrs and tdict.
15607 (ns_get_covering_families): Release charset.
15608 (ns_findfonts): Release NSFontDescriptor created with new.
15609 (ns_uni_to_glyphs): Fix indentation.
15610 (setString): Release attrStr before assigning new value.
15611
15612 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15613
15614 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15615 and NS_IMPL_COCOA.
15616 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15617 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15618
15619 2011-12-18 David Reitter <reitter@cmu.edu>
15620
15621 * nsterm.m (ns_term_init): Subscribe for notifications
15622 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15623 to method trackingNotification in EmacsMenu.
15624
15625 * nsmenu.m (trackingMenu): New variable.
15626 (trackingNotification): New method (from Aquamacs).
15627 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15628 from Aquamacs (Bug#7030).
15629
15630 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15631
15632 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15633 (symbol_to_nsstring): Fix indentation.
15634 (ns_symbol_to_pb): New function.
15635 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15636 (Fns_rotate_cut_buffers_internal): Remove.
15637 (Fns_store_selection_internal): Rename from
15638 Fns_store_cut_buffer_internal.
15639 (ns_get_foreign_selection, Fx_own_selection_internal)
15640 (Fx_disown_selection_internal, Fx_selection_exists_p)
15641 (Fns_get_selection_internal, Fns_store_selection_internal):
15642 Use ns_symbol_to_pb and check if return value is nil.
15643 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15644 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15645 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15646 renamed to Sns_store_selection_internal.
15647 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15648 and remove this function.
15649 (ns_handle_selection_clear): Remove, never used.
15650 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15651 here.
15652
15653 2011-12-17 Ken Brown <kbrown@cornell.edu>
15654
15655 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15656 GID is unknown (Bug#10257).
15657
15658 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15659
15660 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15661 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15662 which caused a build failure on GNU/Linux IA-64. This problem was
15663 introduced by my 2011-10-07 patch.
15664
15665 2011-12-15 Juri Linkov <juri@jurta.org>
15666
15667 * image.c (imagemagick_error): New function. (Bug#10112)
15668 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15669 Use `imagemagick_error' where ImageMagick functions return
15670 `MagickFalse'.
15671 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15672 proper order.
15673
15674 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15675
15676 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15677 fill background (Bug#8992).
15678
15679 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15680
15681 * window.c (Vwindow_combination_resize)
15682 (Vwindow_combination_limit): Use t instead of non-nil in
15683 doc-strings.
15684 (Vrecenter_redisplay): Add first sentence of doc-string on
15685 separate line.
15686 (Frecenter): Fix doc-string typo.
15687
15688 2011-12-11 Kenichi Handa <handa@m17n.org>
15689
15690 * coding.c (Funencodable_char_position): Pay attention to the
15691 buffer text relocation (Bug#9389).
15692
15693 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15694
15695 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15696 gtk_init (Bug#10100).
15697
15698 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15699
15700 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15701 IT->string is nil. (Bug#10263)
15702
15703 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15704
15705 * nsterm.h (x_free_frame_resources): Declare.
15706
15707 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15708 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15709
15710 * nsterm.h (ns_get_defaults_value): Declare.
15711
15712 * nsterm.m (ns_default): Call ns_get_defaults_value.
15713
15714 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15715
15716 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15717 (Bug#10170)
15718
15719 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15720
15721 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15722 that where the value of an _OBJC_* symbol points to is in the .bss
15723 section (Bug#10240).
15724
15725 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15726
15727 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15728 after the loop to call ccl_driver at least once (Bug#8619).
15729
15730 2011-12-08 Kenichi Handa <handa@m17n.org>
15731
15732 * ftfont.c (get_adstyle_property): Fix previous change
15733 (Bug#10233).
15734
15735 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15736
15737 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15738 dirs from the default value of EMACSLOADPATH (bug#10208).
15739
15740 2011-12-07 Glenn Morris <rgm@gnu.org>
15741
15742 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15743 installation and source directories as well. (Bug#10208)
15744
15745 2011-12-06 Chong Yidong <cyd@gnu.org>
15746
15747 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15748
15749 2011-12-06 Glenn Morris <rgm@gnu.org>
15750
15751 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15752 as an error, not just -1. (Bug#10217)
15753
15754 2011-12-05 Chong Yidong <cyd@gnu.org>
15755
15756 * keyboard.c (process_special_events): New function.
15757 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15758
15759 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15760
15761 * coding.c (encode_designation_at_bol): Don't use uninitialized
15762 local variable (Bug#9318).
15763
15764 2011-12-05 Kenichi Handa <handa@m17n.org>
15765
15766 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15767 return Qnil (Bug#8046, Bug#10193).
15768
15769 2011-12-05 Kenichi Handa <handa@m17n.org>
15770
15771 * coding.c (encode_designation_at_bol): New args charbuf_end and
15772 dst. Return the number of produced bytes. Callers changed.
15773 (coding_set_source): Return how many bytes coding->source was
15774 relocated.
15775 (coding_set_destination): Return how many bytes
15776 coding->destination was relocated.
15777 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15778 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15779
15780 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15781
15782 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15783 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15784 macro (Bug#9318).
15785
15786 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15787
15788 The following changes are to fix Bug#9318.
15789
15790 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15791 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15792 (encode_coding_iso_2022, encode_coding_sjis)
15793 (encode_coding_big5, encode_coding_charset): Use the above macros.
15794
15795 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15796
15797 * lisp.h (process_quit_flag): Fix external declaration.
15798
15799 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15800
15801 Don't macro-inline non-performance-critical code.
15802 * eval.c (process_quit_flag): New function.
15803 * lisp.h (QUIT): Use it.
15804
15805 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15806
15807 * nsfns.m (get_geometry_from_preferences): New function.
15808 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15809
15810 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15811
15812 * emacs.c (Qkill_emacs): Define.
15813 (syms_of_emacs): Initialize it.
15814 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15815 Qquit_flag to `kill-emacs' instead.
15816 (quit_throw_to_read_char): Add parameter `from_signal'.
15817 All callers changed. Call Fkill_emacs if requested and safe.
15818 * lisp.h (QUIT): Call Fkill_emacs if requested.
15819
15820 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15821
15822 * widget.c (update_wm_hints): Return if wmshell is null.
15823 (widget_update_wm_size_hints): New function.
15824
15825 * widget.h (widget_update_wm_size_hints): Declare.
15826
15827 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15828 widget_update_wm_size_hints (Bug#10104).
15829
15830 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15831
15832 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15833 before a newline, prepare the bidi iterator for consuming the
15834 newline, and keep the current paragraph direction. (Bug#10183)
15835 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15836
15837 2011-12-02 Juri Linkov <juri@jurta.org>
15838
15839 * search.c (Fword_search_regexp): New Lisp function created from
15840 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15841 (Fword_search_backward, Fword_search_forward)
15842 (Fword_search_backward_lax, Fword_search_forward_lax):
15843 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15844 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15845
15846 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15847
15848 * fileio.c (Finsert_file_contents): Move after-change-function call
15849 to before the "handled:" label, since all "goto handled" appear in
15850 cases where the *-change-functions have already been properly called
15851 (bug#10117).
15852
15853 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15854
15855 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15856 waiting for input. (Bug#10169)
15857
15858 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15859
15860 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15861 verifies glyph row's hash code--we have just reallocated the
15862 glyphs, so their contents can be complete garbage. (Bug#10164)
15863
15864 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15865
15866 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15867
15868 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15869
15870 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15871 attributes are tested _before_ calling verify_row_hash, to protect
15872 against GCC re-ordering of the tests. (Bug#10164)
15873
15874 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15875
15876 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15877
15878 * xterm.c (handle_one_xevent): Only set async_visible and friends
15879 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15880 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15881 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15882
15883 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15886 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15887 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15888 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15889 All uses changed to use GCPRO1 etc.
15890 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15891 Revert to old implementation (i.e., before 2011-03-11).
15892
15893 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15894
15895 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15896 of scroll runs so as to avoid assigning disabled bogus rows and
15897 unnecessary graphics copy operations.
15898
15899 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15900
15901 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15902 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15903 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15904 (malloc, free, realloc, calloc): Redirect to e_* only when
15905 compiling Emacs.
15906
15907 * lisp.h (GCTYPEBITS): Move before first use.
15908 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15909 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15910 this macro definition.
15911
15912 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15913 _MSC_VER.
15914
15915 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15916
15917 * gtkutil.c (xg_create_frame_widgets):
15918 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15919 present with Gtk+ 2.0.
15920
15921 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15922
15923 * fileio.c (Finsert_file_contents): Undo previous change; see
15924 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15925
15926 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15927
15928 Rename locals to avoid shadowing.
15929 * fileio.c (Finsert_file_contents):
15930 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15931 * process.c (wait_reading_process_output):
15932 Rename inner 'proc' to 'p' to avoid shadowing.
15933 Indent for consistency with usual Emacs style.
15934
15935 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15936
15937 * xdisp.c (redisplay_window): If cursor row is not fully visible
15938 after recentering, and scroll-conservatively is set to a large
15939 number, scroll window by a few more lines to make the cursor fully
15940 visible and out of scroll-margin. (Bug#10105)
15941 (start_display): Don't move to the next line if the display should
15942 start at a newline that is part of a display vector or an overlay
15943 string. (Bug#10119)
15944
15945 2011-11-24 Juri Linkov <juri@jurta.org>
15946
15947 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15948 after the `MagickPingImage' call. (Bug#10112)
15949
15950 2011-11-23 Chong Yidong <cyd@gnu.org>
15951
15952 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15953
15954 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15955
15956 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15957 making another buffer current. (Bug#10114)
15958
15959 2011-11-23 Glenn Morris <rgm@gnu.org>
15960
15961 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15962
15963 2011-11-23 Chong Yidong <cyd@gnu.org>
15964
15965 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15966 using it (Bug#5984).
15967
15968 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15969
15970 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15971 and header-lines, as they don't have one computed for them.
15972 (Bug#10098)
15973
15974 * .gdbinit (prow): Make displayed values more self-explaining.
15975 Add row's hash code.
15976
15977 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15978
15979 * process.c (wait_reading_process_output): Fix asynchrounous
15980 GnuTLS socket handling on some versions of the GnuTLS library.
15981 (wait_reading_process_output): Add comment and URL.
15982
15983 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15984
15985 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15986
15987 2011-11-21 Chong Yidong <cyd@gnu.org>
15988
15989 * window.c (Fnext_window, Fprevious_window): Doc fix.
15990
15991 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15992
15993 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15994
15995 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15996
15997 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15998
15999 2011-11-20 Martin Rudalics <rudalics@gmx.at>
16000
16001 * window.c (Fset_window_combination_limit): Rename argument
16002 STATUS to LIMIT.
16003 (Vwindow_combination_limit): Remove "status" from doc-string.
16004
16005 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
16006
16007 * m/ibms390.h: Remove.
16008 * m/ibms390x.h: Don't include "ibms390.h".
16009
16010 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
16011
16012 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
16013 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
16014
16015 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
16016
16017 * casetab.c (Fset_case_table):
16018 * charset.c (Fcharset_after): Fix typos.
16019
16020 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
16021
16022 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
16023 Otherwise, valgrind does not work on some platforms.
16024 Problem reported by Andreas Schwab in
16025 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
16026 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
16027 is set, removing the need for VIRT_ADDRESS_VARIES.
16028 (PURE_P): Use a more-efficient implementation that needs just one
16029 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16030 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
16031 to 4 (xorl, subq, cmpq, setbe).
16032 * alloc.c (pure): Always extern now, since that's the
16033 VIRT_ADDR_VARIES behavior.
16034 (PURE_POINTER_P): Use a single comparison, not two, for
16035 consistency with the new puresize.h.
16036 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16037 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16038 Remove VIRT_ADDR_VARIES no longer needed.
16039
16040 2011-11-19 Eli Zaretskii <eliz@gnu.org>
16041
16042 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16043 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16044 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16045 behave as if the cursor position were at the window margin.
16046
16047 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16048 and the cursor position is out of bounds, behave as if the cursor
16049 position were at the window margin. (Bug#10075)
16050
16051 2011-11-18 Chong Yidong <cyd@gnu.org>
16052
16053 * window.c (Fwindow_combination_limit): Make first argument
16054 non-optional, since it is meaningless for live windows like the
16055 selected window.
16056
16057 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16058
16059 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16060
16061 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16062
16063 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16064 (graft_intervals_into_buffer): Simplify.
16065
16066 2011-11-18 Eli Zaretskii <eliz@gnu.org>
16067
16068 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16069 hash values of the two rows.
16070 (copy_row_except_pointers): Preserve the used[] arrays and the
16071 hash values of the two rows. (Bug#10035)
16072 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16073
16074 * xdisp.c (row_hash): New function, body extracted from
16075 compute_line_metrics.
16076 (compute_line_metrics): Call row_hash, instead of computing the
16077 hash code inline.
16078
16079 * dispnew.c (verify_row_hash): Call row_hash for computing the
16080 hash code of a row, instead of duplicating code from xdisp.c.
16081
16082 * dispextern.h (row_hash): Add prototype.
16083
16084 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16085
16086 * frame.c (delete_frame): Don't delete the terminal when the last
16087 X frame is closed if emacs is built with GTK toolkit.
16088
16089 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
16090
16091 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16092
16093 2011-11-17 Martin Rudalics <rudalics@gmx.at>
16094
16095 * window.c (Vwindow_splits): Rename to
16096 Vwindow_combination_resize. Suggested by Juri Linkov.
16097 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16098 of Vwindow_splits.
16099
16100 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
16101
16102 * nsfns.m (Fns_font_name):
16103 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16104
16105 2011-11-16 Martin Rudalics <rudalics@gmx.at>
16106
16107 * window.h (window): Rename slot "nest" to "combination_limit".
16108 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16109 (Fset_window_nest): Rename to Fset_window_combination_limit.
16110 (Vwindow_nest): Rename to Vwindow_combination_limit.
16111 (recombine_windows, make_parent_window, make_window)
16112 (Fsplit_window_internal, saved_window)
16113 (Fset_window_configuration, save_window_save): Rename all
16114 occurrences of window_nest to window_combination_limit.
16115
16116 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
16117
16118 * image.c (imagemagick_load_image): Fix typo.
16119
16120 2011-11-14 Eli Zaretskii <eliz@gnu.org>
16121
16122 * xdisp.c (display_line): Move the call to
16123 highlight_trailing_whitespace before the call to
16124 compute_line_metrics, since the latter needs to see the final
16125 faces of all the glyphs to compute ROW's hash value.
16126 Fixes assertion violations in row_equal_p. (Bug#10035)
16127
16128 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
16129
16130 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16131 just return (bug#10044).
16132
16133 2011-11-12 Eli Zaretskii <eliz@gnu.org>
16134
16135 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16136 with user-defined heap size. Bump the default size of the temacs
16137 heap to 27MB, to avoid memory warning when running temacs.
16138 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16139
16140 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16141 current_matrix and desired_matrix. (Bug#9990)
16142 (verify_row_hash) [XASSERTS]: New function.
16143 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16144 that the hash value of glyph rows is correct.
16145
16146 2011-11-12 Martin Rudalics <rudalics@gmx.at>
16147
16148 * window.h (window): Remove splits slot.
16149 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16150 (Fdelete_other_windows_internal, make_parent_window)
16151 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16152 (Fset_window_configuration, save_window_save): Don't deal with
16153 split status of windows.
16154 (saved_window): Remove splits slot.
16155 (Vwindow_splits): Rewrite doc-string.
16156
16157 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16158
16159 * xfns.c (unwind_create_frame):
16160 * nsfns.m (unwind_create_frame):
16161 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16162 Vframe_list (Bug#9999).
16163
16164 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16165
16166 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16167
16168 2011-11-11 Kenichi Handa <handa@m17n.org>
16169
16170 * callproc.c (Fcall_process): Set the member dst_multibyte of
16171 process_coding.
16172
16173 2011-11-11 Johan Bockgård <bojohan@gnu.org>
16174
16175 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16176 avoid a crash (bug#9496).
16177
16178 2011-11-09 Chong Yidong <cyd@gnu.org>
16179
16180 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16181 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16182
16183 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16184
16185 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16186
16187 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16188
16189 Avoid some portability problems by eschewing 'extern inline' functions.
16190 The trivial performance wins aren't worth the portability hassles; see
16191 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16192 et seq.
16193 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16194 (window_box_width, window_box_left, window_box_left_offset)
16195 (window_box_right, window_box_right_offset): Undo previous change,
16196 by removing the "extern"s.
16197 * intervals.c (adjust_intervals_for_insertion)
16198 (adjust_intervals_for_deletion): Undo previous change,
16199 making these static again.
16200 (offset_intervals, temp_set_point_both, temp_set_point)
16201 (copy_intervals_to_string): No longer inline.
16202 * xdisp.c (window_text_bottom_y, window_box_width)
16203 (window_box_height, window_box_left_offset)
16204 (window_box_right_offset, window_box_left, window_box_right)
16205 (window_box): No longer inline.
16206
16207 2011-11-08 Chong Yidong <cyd@gnu.org>
16208
16209 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16210 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16211 Signal an error if not a live window.
16212 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16213 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16214
16215 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16216
16217 * lisp.h (syms_of_abbrev): Remove declaration.
16218 Reported by CHENG Gao <chenggao@royau.me>.
16219
16220 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16221
16222 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16223 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16224 of temacs in GUI mode.
16225
16226 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16227
16228 * window.h: Declare delete_all_child_windows instead of
16229 delete_all_subwindows.
16230 * window.c (Fwindow_nest, Fset_window_nest)
16231 (Fset_window_new_total, Fset_window_new_normal)
16232 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16233 (delete_all_subwindows): Rename to delete_all_child_windows.
16234 (Fdelete_other_windows_internal, Fset_window_configuration):
16235 Call delete_all_child_windows instead of delete_all_subwindows.
16236 * frame.c (delete_frame): Call delete_all_child_windows instead
16237 of delete_all_subwindows.
16238
16239 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16240
16241 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16242 This is also needed for porting to any host where GC_MARK_STACK is
16243 not GC_MAKE_GCPROS_NOOPS.
16244 (which_symbols): Use it.
16245
16246 2011-11-07 Kenichi Handa <handa@m17n.org>
16247
16248 * coding.c (coding_set_destination): Check coding->src_pos only
16249 when coding->src_object is a buffer (bug#9910).
16250
16251 * process.c (send_process): Set the member src_multibyte of coding
16252 to 0 (bug#9911) when sending a unibyte text.
16253
16254 * callproc.c (Fcall_process): Set the member src_multibyte of
16255 process_coding to 0 (bug#9912).
16256
16257 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16258
16259 * xmenu.c (cleanup_widget_value_tree): New function.
16260 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16261 calling free_menubar_widget_value_tree directly (Bug#9830).
16262
16263 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16264
16265 Fix some portability problems with 'inline'.
16266 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16267 (window_box_width, window_box_left, window_box_left_offset)
16268 (window_box_right, window_box_right_offset): Declare extern.
16269 Otherwise, these inline functions do not conform to C99 and
16270 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16271 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16272 * intervals.c (adjust_intervals_for_insertion)
16273 (adjust_intervals_for_deletion): Now extern, because otherwise the
16274 extern inline functions 'offset_intervals' couldn't refer to it.
16275 (static_offset_intervals): Remove.
16276 (offset_intervals): Rewrite using the old contents of
16277 static_offset_intervals. The old version didn't conform to C99
16278 because an extern inline function contained a reference to an
16279 identifier with static linkage.
16280
16281 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16282
16283 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16284 GC.
16285
16286 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16287
16288 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16289 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16290 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16291 return Qleft_to_right.
16292
16293 2011-11-06 Chong Yidong <cyd@gnu.org>
16294
16295 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16296 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16297 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16298 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16299 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16300 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16301 (Fwindow_vscroll): Doc fix.
16302 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16303 argument, since it makes no sense to pass a live window and for
16304 consistency with window-child.
16305
16306 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16307
16308 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16309 support MSVC.
16310
16311 2011-11-05 Jason Rumney <jasonr@gnu.org>
16312
16313 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16314 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16315 fonts (Bug#6029).
16316 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16317 bitwise arithmetic preventing use of unicode-sip and non-truetype
16318 opentype fonts.
16319
16320 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16321
16322 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16323 "emacs"-only part.
16324
16325 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16326 initialization code to keep similarity to xfns.c after changes
16327 from 2011-11-05.
16328
16329 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16330
16331 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16332 (unwind_create_frame): New function (Bug#9943).
16333 (Fx_create_frame): Restructure code to be more similar to the one in
16334 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16335 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16336 Move terminal->reference_count++ just before making the frame official
16337 (Bug#9943).
16338
16339 * nsterm.m (x_free_frame_resources): New function.
16340 (x_destroy_window): Move code to x_free_frame_resources.
16341
16342 * xfns.c (unwind_create_frame): Fix comment.
16343 (Fx_create_frame, x_create_tip_frame):
16344 Move terminal->reference_count++ just before making the frame
16345 official. Move initialization of image_cache_refcount and
16346 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16347
16348 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16349
16350 Support MSVC build with newer versions of Visual Studio.
16351 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16352 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16353 nt/gmake.defs.
16354
16355 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16356 which are not supported by MSVC.
16357 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16358 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16359 bitfields.
16360 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16361 types in bitfields.
16362 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16363
16364 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16365
16366 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16367
16368 Support MSVC build with newer versions of Visual Studio.
16369 * w32.c: Don't include w32api.h for MSVC.
16370 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16371
16372 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16373 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16374 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16375 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16376 e_* cousins.
16377 (alloca) [_MSC_VER]: Define to _alloca.
16378
16379 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16380
16381 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16382
16383 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16384
16385 * xdisp.c (note_mouse_highlight): If either of
16386 previous/next-single-property-change returns nil, treat that as
16387 the beginning or the end of the buffer. (Bug#9955)
16388
16389 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16390
16391 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16392 label is not null (Bug#9951).
16393 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16394 may be NULL.
16395
16396 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16397
16398 * window.c (Fwindow_body_size): Mention in the doc string that the
16399 return value is in frame's canonical units. (Bug#9949)
16400
16401 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16402
16403 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16404
16405 * w32fns.c (unwind_create_frame): If needed, free the glyph
16406 matrices of the partially constructed frame. (Bug#9943)
16407 * xfns.c (unwind_create_frame): Likewise.
16408
16409 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16410
16411 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16412 Don't stop backward scan on the continuation glyph, even though
16413 its CHARPOS is positive.
16414 (mouse_face_from_buffer_pos, note_mouse_highlight):
16415 Rename cover_string to disp_string.
16416
16417 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16418
16419 * window.c (temp_output_buffer_show): Don't use
16420 Vtemp_buffer_show_specifiers.
16421 (Vtemp_buffer_show_specifiers): Remove unused variable.
16422
16423 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16424
16425 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16426 past the beginning of the current glyph matrix.
16427
16428 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16429
16430 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16431 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16432 HAVE_GTK3 (Bug#9869).
16433
16434 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16435 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16436
16437 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16438
16439 * xterm.c: Declare x_handle_net_wm_state to return int.
16440 (handle_one_xevent): Check if we are iconified but don't have
16441 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16442 (get_current_wm_state): Return non-zero if not hidden,
16443 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16444 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16445 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16446 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16447
16448 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16449
16450 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16451 so that this new function doesn't get optimized away by a
16452 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16453
16454 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16455
16456 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16457
16458 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16459
16460 Fix the `xbytecode' command.
16461 * .gdbinit (xprintbytestr): New command.
16462 (xwhichsymbols): Rename from `which'; all callers changed.
16463 (xbytecode): Print the byte-code string as well.
16464
16465 2011-10-29 Kim Storm <storm@cua.dk>
16466
16467 * alloc.c (which_symbols): New function.
16468
16469 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16470
16471 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16472 line. (Bug#9903)
16473
16474 2011-10-29 Glenn Morris <rgm@gnu.org>
16475
16476 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16477 Not clear what it was for, and it causes various bugs. (Bug#9839)
16478
16479 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16480
16481 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16482 possible random value that matches one of those tested as
16483 condition to clear the mouse face.
16484
16485 2011-10-28 Chong Yidong <cyd@gnu.org>
16486
16487 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16488
16489 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16490
16491 * window.c (make_window): Initialize phys_cursor_on_p.
16492
16493 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16494
16495 * lisp.h (struct Lisp_Symbol): Update comments.
16496
16497 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16498
16499 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16500
16501 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16502
16503 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16504 <oslsachem@gmail.com> for helping to debug this.
16505
16506 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16507 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16508 (g_b_init_get_glyph_outline_w): New static variables.
16509 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16510 (GetGlyphOutlineW_Proc): New typedefs.
16511 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16512 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16513 New functions.
16514 (w32font_open_internal, compute_metrics):
16515 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16516 instead of calling the "wide" APIs directly.
16517
16518 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16519
16520 * w32.h (syms_of_w32font): Add prototype.
16521
16522 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16523
16524 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16525 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16526 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16527 (Fmove_to_window_line): Doc fix.
16528
16529 2011-10-27 Chong Yidong <cyd@gnu.org>
16530
16531 * process.c (make_process): Set gnutls_state to NULL.
16532
16533 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16534 non-NULL, regardless of GNUTLS_INITSTAGE.
16535 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16536 an error. Set process slots as soon as we allocate them.
16537
16538 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16539
16540 2011-10-27 Chong Yidong <cyd@gnu.org>
16541
16542 * gnutls.c (emacs_gnutls_deinit): New function.
16543 Deallocate credentials structures as well as calling gnutls_deinit.
16544 (Fgnutls_deinit, Fgnutls_boot): Use it.
16545
16546 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16547 (deactivate_process): Call emacs_gnutls_deinit.
16548
16549 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16550
16551 * image.c (x_create_x_image_and_pixmap):
16552 * w32.c (sys_rename, w32_delayed_load):
16553 * w32font.c (fill_in_logfont):
16554 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16555
16556 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16557
16558 * w32fns.c (w32_default_color_map): New function,
16559 extracted from Fw32_default_color_map.
16560 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16561
16562 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16563
16564 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16565
16566 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16567
16568 * keyboard.c (test_undefined): New function (bug#9751).
16569 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16570
16571 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16572
16573 * sysdep.c (init_sys_modes): Fix the check for the controlling
16574 terminal (Bug#6649).
16575
16576 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16577
16578 * dispextern.h (struct bidi_it): New member next_en_type.
16579
16580 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16581 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16582 current character, check also for next_en_type being WEAK_EN.
16583 (bidi_resolve_weak): Don't enter the expensive loop if the current
16584 position is before next_en_pos. Record the bidi type of the first
16585 non-ET, non-BN character we find, in addition to its position.
16586 (bidi_level_of_next_char): Invalidate next_en_type when
16587 next_en_pos is over-stepped.
16588
16589 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16590
16591 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16592 * editfns.c: Rewrite current-time-zone so that it invokes
16593 the equivalent of (format-time-string "%Z") to get the time zone name.
16594 This fixes a bug when the time zone name contains characters that
16595 need converting from the system time locale to Emacs internal format.
16596 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16597 that patch fixed format-time-string to do the conversion, but
16598 I forgot to fix current-time-zone.
16599 (format_time_string): New function, containing most of
16600 what Fformat_time_string used to contain.
16601 (Fformat_time_string): Rewrite in terms of format_time_string.
16602 This doesn't change this function's behavior.
16603 (current-time-zone): Rewrite to use format_time_string.
16604 This fixes the bug reported by Michael Schierl in
16605 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16606 Jason Rumney's 2007-06-07 change worked around this bug, but
16607 didn't fix it.
16608 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16609
16610 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16611
16612 * xdisp.c (start_display): If the character at POS is displayed
16613 via a display vector, reset IT->current.dpvec_index to zero.
16614 (try_window_reusing_current_matrix): If a line ends in a display
16615 vector or the next line starts in a display vector, continue
16616 redrawing the window even though the character position of
16617 start_row was reached.
16618 (Bug#9771, part 2)
16619
16620 2011-10-18 Chong Yidong <cyd@gnu.org>
16621
16622 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16623 with nobreak-char-display too.
16624
16625 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16626
16627 Fix part 3 of bug#9771.
16628 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16629 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16630 non-neutral characters if the current character is a paragraph
16631 separator (a.k.a. Newline). This avoids running the same
16632 expensive loop twice, once when we consume the preceding newline
16633 and the other time when the line actually needs to be displayed.
16634 Avoid the loop when we see neutrals on the base embedding level
16635 following a character whose directionality is the same as the
16636 paragraph's. This avoids running the expensive loop when a line
16637 ends in a long sequence of neutrals, like control characters.
16638 Add assertion against STRONG_AL type. Slightly rearrange code
16639 that determines the type of a neutral given the first non-neutral
16640 that follows it.
16641 (bidi_level_of_next_char): Set next_en_pos to zero when
16642 invalidating its info.
16643
16644 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16645
16646 * xdisp.c (push_display_prop): Determine whether to record string
16647 or buffer position by IT->string, not by IT->method. Allow
16648 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16649 (move_it_vertically_backward): Don't look for character position
16650 immediately after the newline when in a continuation line.
16651 (Bug#9771, part 1)
16652
16653 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16654
16655 * window.c (coordinates_in_window): Rewrite and delabelize
16656 vertical border check. (Bug#5357) (Bug#9618)
16657
16658 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16659
16660 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16661 errors in XSetWindowBorder (bug#9310).
16662
16663 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16664
16665 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16666 avoid crash when xmalloc overrun checking is enabled.
16667
16668 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16669
16670 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16671 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16672 cursor motion with <left> and <right> arrow keys.
16673
16674 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16675 some callers set that themselves.
16676
16677 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16678
16679 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16680 display string and the previous row comes from the same string and
16681 is empty. (Bug#9739) (Bug#9738)
16682
16683 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16684
16685 * doc.c (get_doc_string): Encode file name (bug#9735).
16686
16687 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16688
16689 * bidi.c (bidi_level_of_next_char):
16690 * xdisp.c (get_visually_first_element): Remove old incorrect
16691 comments regarding the Unicode Line Separator character.
16692
16693 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16694
16695 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16696
16697 * alloc.c (Fgc_status): Do not access beyond zombies array
16698 boundary if nzombies > MAX_ZOMBIES.
16699 * alloc.c (dump_zombies): Add missing format specifier.
16700
16701 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16702
16703 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16704 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16705
16706 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16707 Some packages use them to denote characters with modifiers.
16708
16709 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16710
16711 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16712 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16713 matching a pp-number. Rename parameter var to var1.
16714
16715 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16716
16717 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16718
16719 2011-10-08 Glenn Morris <rgm@gnu.org>
16720
16721 * callint.c (Fcall_interactively): Give a more explicit error for the
16722 'c' case with a non-character input. (Bug#8479)
16723
16724 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16725
16726 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16727 lines.
16728 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16729 lines that are hscrolled on the left.
16730
16731 * dispnew.c (buffer_posn_from_coords): Account for a possible
16732 presence of header-line. (Bug#4426)
16733
16734 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16735
16736 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16737 Don't advertise functionality which we discourage or doesn't work.
16738
16739 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16740
16741 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16742 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16743 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16744 this makes Emacs dump core during garbage collection on rare
16745 occasions. sizeof is obviously inferior to offsetof here, so
16746 stick with offsetof.
16747 (GC_POINTER_ALIGNMENT): New macro.
16748 (mark_memory): Omit 3rd (offset) arg; caller changed.
16749 Don't assume EMACS_INT alignment is the same as pointer alignment.
16750
16751 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16752
16753 * keyboard.c (read_key_sequence_remapped): New var.
16754 (read_key_sequence): Compute remapping in the right buffer.
16755 (command_loop_1): Use read_key_sequence's remapping directly.
16756
16757 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16758
16759 * dired.c (file_name_completion): Don't expand file name.
16760 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16761 before checking file name handler.
16762
16763 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16764 they've been requested explicitly (bug#9591).
16765
16766 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16767
16768 * keymap.c (Fsingle_key_description): Use make_specified_string
16769 instead of build_string to build string from push_key_description.
16770 (Bug#5193)
16771
16772 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16773
16774 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16775 This fixes a Y2038 bug on 64-bit hosts.
16776 * buffer.c (reset_buffer):
16777 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16778 (Fclear_buffer_auto_save_failure):
16779 Use 0, not -1, to represent an unset failure time, since time_t
16780 might not be signed.
16781
16782 Remove dependency on glibc malloc internals.
16783 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16784 Move back here from lisp.h, but with their new implementations.
16785 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16786 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16787 * charset.c (charset_table_init): New static var.
16788 (syms_of_charset): Use it instead of xmalloc. This removes a
16789 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16790 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16791 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16792 Move back to alloc.c.
16793 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16794 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16795
16796 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16797
16798 * nsterm.m (windowDidResize): Call x_set_window_size only when
16799 ns_in_resize is true. Otherwise set pixelwidth/height and
16800 call change_frame_size (Bug#9628).
16801
16802 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16803
16804 Port --enable-checking=all to Fedora 14 x86-64.
16805 * charset.c (syms_of_charset): Also account for glibc malloc's
16806 internal overhead when calculating the initial malloc maximum.
16807
16808 Port --enable-checking=all to Fedora 14 x86.
16809 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16810 Move to lisp.h.
16811 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16812 (overrun_check_realloc, overrun_check_free):
16813 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16814 That way, xmalloc returns a properly-aligned pointer even if
16815 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16816 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16817 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16818 into account when calculating the initial malloc maximum.
16819 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16820 Move here from alloc.c, so that charset.c can use it too.
16821 Properly align; the old code wasn't right for common 32-bit hosts
16822 when configured with --enable-checking=all.
16823 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16824 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16825
16826 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16827
16828 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16829 use EDOM.
16830
16831 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16832
16833 * xdisp.c (compute_display_string_end): If there's no display
16834 string at CHARPOS, return -1.
16835
16836 * bidi.c (bidi_fetch_char): When compute_display_string_end
16837 returns a negative value, treat the character as a normal
16838 character not covered by a display string. (Bug#9624)
16839
16840 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16841
16842 * lread.c (Fread_from_string): Fix typo in docstring.
16843
16844 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16845
16846 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16847 newline, reseat the iterator instead of bidi-iterating there one
16848 character at a time. (Bug#9610)
16849 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16850 TO_CHARPOS if the bidi iterator is at base embedding level.
16851
16852 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16853
16854 * lread.c (readevalloop): Use correct code for NBSP.
16855 (read1): Likewise. (Bug#9608)
16856
16857 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16858
16859 * dbusbind.c (Fdbus_register_signal): When service is not
16860 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16861
16862 2011-09-25 Glenn Morris <rgm@gnu.org>
16863
16864 * buffer.c (truncate-lines): Doc fix.
16865
16866 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16867
16868 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16869 (Fset_window_next_buffers): Doc fix.
16870
16871 2011-09-24 Glenn Morris <rgm@gnu.org>
16872
16873 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16874
16875 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16876
16877 Fix minor problems found by static checking.
16878 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16879 * indent.c (Fvertical_motion): Fix == vs = typo.
16880
16881 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16882
16883 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16884 Default value is now t. Doc fix.
16885
16886 * indent.c (Fvertical_motion): Compute and apply the overshoot
16887 logic when moving up, not only when moving down. Fix the
16888 confusing name and values of the it_overshoot_expected variable;
16889 logic changes accordingly. (Bug#9254) (Bug#9549)
16890
16891 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16892 CHARPOS is covered by a display string which includes newlines.
16893 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16894 is covered by a display string with embedded newlines.
16895
16896 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16897
16898 * dbusbind.c (Fdbus_register_signal): Add match rule to
16899 Vdbus_registered_objects_table. (Bug#9581)
16900 (Fdbus_register_method, Vdbus_registered_objects_table):
16901 Fix docstring.
16902
16903 2011-09-24 Jim Meyering <meyering@redhat.com>
16904
16905 do not ignore write error for any output size
16906 The previous change was incomplete.
16907 While it makes emacs --batch detect the vast majority of stdout
16908 write failures, errors were still ignored whenever the output size is
16909 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16910 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16911 && echo FAIL: ignored write error
16912 FAIL: ignored write error
16913 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16914 && echo FAIL: ignored write error
16915 FAIL: ignored write error
16916 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16917
16918 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16919
16920 * emacs.c (Fkill_emacs): In noninteractive mode exit
16921 non-successfully if a write error occurred on stdout. (Bug#9574)
16922
16923 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16924
16925 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16926 the xassert test.
16927
16928 * dispextern.h (struct it): Update the comment documenting what
16929 can it->OBJECT be.
16930
16931 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16932
16933 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16934 a display string, extend search for cursor position to end of row.
16935 (find_row_edges): If the row ends in a newline from a display
16936 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16937 Handle the case of a display string with multiple newlines.
16938 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16939 non-empty line. Fixes confusing cursor motion with arrow keys at
16940 the beginning of a line that starts with whitespace.
16941
16942 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16943
16944 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16945 (bug#9493).
16946
16947 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16948
16949 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16950 boolean (Bug#9154).
16951
16952 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16953
16954 * xdisp.c (display_line): Record maximum and minimum buffer
16955 positions even if no glyphs were produced (e.g., by a zero-width
16956 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16957 buffer positions that will be removed from the glyph row because
16958 they don't fit.
16959 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16960 column is beyond frame width: don't subtract 1 "pixel" when
16961 computing width of the stretch.
16962 (reseat_at_next_visible_line_start): Undo the change made on
16963 2011-09-17 that saved paragraph information and restored it after
16964 the call to `reseat'. (Bug#9545)
16965
16966 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16967
16968 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16969 and turn window cursor on if cleared (Bug#9415).
16970
16971 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16972
16973 * search.c (boyer_moore): Take unibyte characters from pattern
16974 literally. (Bug#9458)
16975
16976 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16977
16978 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16979
16980 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16981
16982 Fix minor problem found by static checking.
16983 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16984 initialized, to pacify gcc -Wuninitialized.
16985
16986 * fileio.c: Report proper errno when syscall falls.
16987 (Finsert_file_contents): Save and restore errno,
16988 so that report_file_error outputs the correct diagnostic.
16989 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16990
16991 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16992
16993 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16994
16995 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16996
16997 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16998 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16999
17000 2011-09-17 Eli Zaretskii <eliz@gnu.org>
17001
17002 * xdisp.c (reseat_at_next_visible_line_start): Keep information
17003 about the current paragraph and restore it after the call to reseat.
17004
17005 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
17006 (bidi_find_paragraph_start): Search back for paragraph beginning
17007 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
17008 (bidi_move_to_visually_next): Only trigger paragraph-related
17009 computations when the last character is a newline or at EOB, not
17010 just any NEUTRAL_B. (Bug#9470)
17011
17012 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
17013 truncated lines if point is covered by a display string. (Bug#9524)
17014
17015 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
17016
17017 * xselect.c: Relax test for outgoing X longs (Bug#9498).
17018 (cons_to_x_long): New function.
17019 (lisp_data_to_selection_data): Use it. Correct the test for
17020 short-versus-long data; it was negated. Break out of vector
17021 loop, for efficiency, when a long datum is discovered.
17022
17023 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
17024
17025 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
17026
17027 2011-09-16 Eli Zaretskii <eliz@gnu.org>
17028
17029 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
17030 GCC PR/17406) by declaring this function with external scope.
17031
17032 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17033
17034 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
17035 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17036
17037 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17038
17039 * editfns.c (Fformat): Correctly handle text properties on "%%".
17040
17041 2011-09-15 Eli Zaretskii <eliz@gnu.org>
17042
17043 * xterm.c (x_draw_composite_glyph_string_foreground):
17044 * w32term.c (x_draw_composite_glyph_string_foreground):
17045 * term.c (encode_terminal_code):
17046 * composite.c (composition_update_it, get_composition_id):
17047 * xdisp.c (get_next_display_element)
17048 (fill_composite_glyph_string): Add comments about special meaning
17049 of TAB characters in a composition.
17050
17051 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17052
17053 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17054 This occurs when processing a multibyte format.
17055 Problem reported by Wolfgang Jenker.
17056
17057 2011-09-15 Johan Bockgård <bojohan@gnu.org>
17058
17059 * xdisp.c (try_cursor_movement): Only check for exact match if
17060 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17061
17062 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17063
17064 Remove unused external symbols.
17065 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17066 * xdisp.c (calc_pixel_width_or_height): Now static.
17067 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17068 * indent.c (check_display_width):
17069 * w32term.c: Fix comment to match code.
17070 * xterm.c, xterm.h (x_catching_errors): Remove.
17071
17072 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17073
17074 * xselect.c: Use signed conversions more consistently (Bug#9498).
17075 (selection_data_to_lisp_data): Assume incoming selection data are
17076 signed integers, not unsigned. This is to be consistent with
17077 outgoing selection data, which was modified to use signed integers
17078 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17079 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17080 expects long, not unsigned long.
17081
17082 2011-09-14 Eli Zaretskii <eliz@gnu.org>
17083
17084 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17085 computation of loop end. Reported by Johan Bockgård
17086 <bojohan@gnu.org>.
17087
17088 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
17089
17090 * frame.c (Fother_visible_frames_p): Function deleted.
17091
17092 2011-09-12 Eli Zaretskii <eliz@gnu.org>
17093
17094 * indent.c (compute_motion): Process display vector front to back
17095 rather than the other way around. (Bug#2496)
17096
17097 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17098
17099 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17100
17101 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
17102
17103 * minibuf.c (Fread_from_minibuffer): Doc fix.
17104
17105 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17106
17107 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17108 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17109
17110 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17111
17112 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17113 value for non-existent files.
17114
17115 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17116
17117 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17118 set its "size" to -1. This will set the modtime_size field of
17119 the corresponding buffer to -1, which is what
17120 verify-visited-file-modtime expects for files that do not exist.
17121 (Bug#9139)
17122
17123 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17124
17125 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17126 here ...
17127 * lisp.h: ... from here. push_key_description is no longer
17128 defined in keyboard.c, so its declaration should not be in
17129 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17130 logically belongs with push_key_description.
17131
17132 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17133
17134 * buffer.h: Include <sys/types.h> instead of <time.h>.
17135 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17136 Problem reported by Herbert J. Skuhra.
17137
17138 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17139
17140 * xml.c (parse_region): Make the parsing work for
17141 non-comment-starting XML files again (bug#9144).
17142
17143 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17144
17145 * image.c (gif_load): Fix calculation of bottom and right corner.
17146 (Bug#9468)
17147
17148 2011-09-10 Eli Zaretskii <eliz@gnu.org>
17149
17150 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17151 redisplay in small windows.
17152
17153 2011-09-09 Eli Zaretskii <eliz@gnu.org>
17154
17155 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17156
17157 2011-09-08 Martin Rudalics <rudalics@gmx.at>
17158
17159 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17160 Operate on live windows only.
17161
17162 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
17163
17164 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17165
17166 2011-09-07 Eli Zaretskii <eliz@gnu.org>
17167
17168 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17169 only under bidi iteration.
17170
17171 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17172
17173 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17174
17175 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17176
17177 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17178 Without this fix, the command to link temacs failed due to an
17179 undefined symbol __builtin_isnan. This is because
17180 /usr/include/iso/math_c99.h #defines isnan(x) to
17181 __builtin_isnan(x), but the bundled gcc, which identifies itself
17182 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17183 a __builtin_isnan.
17184 * floatfns.c (isnan): #undef, and then #define to a clone of
17185 what's in data.c.
17186 (Fisnan): Always define, since it's always available now.
17187 (syms_of_floatfns): Always define isnan at the Lisp level.
17188
17189 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17190
17191 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17192
17193 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17194
17195 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17196 The previous code assumed that file offsets (off_t values) fit in
17197 EMACS_INT variables, which is not true on typical 32-bit hosts.
17198 The code messed up by falsely reporting buffer overflow in cases
17199 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17200 when "big" contains more than 2**29 bytes, even though this
17201 inserts just one byte and does not overflow the buffer.
17202 (Finsert_file_contents): Store file offsets as off_t
17203 values, not as EMACS_INT values. Check for overflow when
17204 converting between EMACS_INT and off_t. When checking for
17205 buffer overflow or for overlap, take the offsets into account.
17206 Don't use EMACS_INT for small values where int suffices.
17207 When checking for overlap, fix a typo: ZV was used where
17208 ZV_BYTE was intended.
17209 (Fwrite_region): Don't assume off_t fits into 'long'.
17210 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17211
17212 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17213
17214 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17215
17216 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17217
17218 sprintf-related integer and memory overflow issues (Bug#9412).
17219
17220 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17221 (esprintf, exprintf, evxprintf): New functions.
17222 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17223 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17224 (modify_event_symbol): Do not assume that the length of
17225 name_alist_or_stem is safe to alloca and fits in int.
17226 (Fexecute_extended_command): Likewise for function name and binding.
17227 (Frecursion_depth): Wrap around reliably on integer overflow.
17228 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17229 since some callers pass EMACS_INT values.
17230 (Fsingle_key_description): Don't crash if symbol name contains more
17231 than MAX_ALLOCA bytes.
17232 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17233 (get_minibuffer): Arg is now EMACS_INT, not int.
17234 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17235 (esprintf, exprintf, evxprintf): New decls.
17236 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17237
17238 * dbusbind.c (signature_cat): New function.
17239 (xd_signature, Fdbus_register_signal):
17240 Do not overrun buffer; instead, report string overflow.
17241
17242 * dispnew.c (add_window_display_history): Don't overrun buffer.
17243 Truncate instead; this is OK since it's just a log.
17244
17245 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17246 even if the time zone offset is outlandishly large.
17247 Don't mishandle offset == INT_MIN.
17248
17249 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17250 when creating daemon; the previous buffer-overflow check was incorrect.
17251
17252 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17253 which has the guts of the old verror function.
17254
17255 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17256 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17257
17258 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17259 (font_unparse_xlfd): Don't blindly alloca long strings.
17260 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17261 fits in int, when using sprintf. Use single snprintf to count
17262 length of string rather than counting it via multiple sprintfs;
17263 that's simpler and more reliable.
17264 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17265 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17266 sprintf, in case result does not fit in int.
17267
17268 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17269 (fontset_from_font): Print it.
17270
17271 * frame.c (tty_frame_count): Now printmax_t, not int.
17272 (make_terminal_frame, set_term_frame_name): Print it.
17273 (x_report_frame_params): In X, window IDs are unsigned long,
17274 not signed long, so print them as unsigned.
17275 (validate_x_resource_name): Check for implausibly long names,
17276 and don't assume name length fits in 'int'.
17277 (x_get_resource_string): Don't blindly alloca invocation name;
17278 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17279 not fit in int.
17280
17281 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17282 (xg_check_special_colors, xg_set_geometry):
17283 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17284
17285 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17286 Use esprintf, not sprintf, in case result does not fit in int.
17287
17288 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17289 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17290 it as a large positive number.
17291 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17292 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17293
17294 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17295 in case result does not fit in int.
17296
17297 * print.c (float_to_string): Detect width overflow more reliably.
17298 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17299 buffer overrun. Don't assume list length fits in 'int'. Treat
17300 print length of 0 as 0, not as infinity; to be consistent with other
17301 uses of print length in this function. Don't overflow print length
17302 index. Don't assume hash table size fits in 'long', or that
17303 vectorlike size fits in 'unsigned long'.
17304
17305 * process.c (make_process): Use printmax_t, not int, to format
17306 process-name gensyms.
17307
17308 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17309
17310 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17311 to avoid potential buffer overrun.
17312
17313 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17314 if X resource line is longer than 512 bytes.
17315
17316 * xfns.c (x_window): Make sprintf buffer a bit bigger
17317 to avoid potential buffer overrun.
17318
17319 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17320
17321 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17322
17323 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17324
17325 Integer overflow fixes for scrolling, etc.
17326 Without these, Emacs silently mishandles large integers sometimes.
17327 For example, "C-u 4294967297 M-x recenter" was treated as if
17328 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17329
17330 * xdisp.c (try_window_id): Check Emacs fixnum range before
17331 converting to 'int'.
17332
17333 * window.c (window_scroll_line_based, Frecenter):
17334 Check that an Emacs fixnum is in range before assigning it to 'int'.
17335 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17336 values converted from Emacs fixnums.
17337 (Frecenter): Don't wrap around a line count if it is out of 'int'
17338 range; instead, treat it as an extreme value.
17339 (Fset_window_configuration, compare_window_configurations):
17340 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17341
17342 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17343 that can exceed INT_MAX. Check that EMACS_INT value is in range
17344 before assigning it to the (possibly-narrower) index.
17345 (match_limit): Don't assume that a fixnum can fit in 'int'.
17346
17347 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17348 exceed INT_MAX.
17349
17350 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17351 (Fvertical_motion): Don't wrap around LINES values that don't fit
17352 in 'int'. Instead, treat them as extreme values. This is good
17353 enough for windows, which can't have more than INT_MAX lines anyway.
17354
17355 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17356
17357 * Require libxml/parser.h to avoid compilation warning.
17358
17359 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17360
17361 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17362 since this reportedly can destroy thread storage.
17363
17364 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17365
17366 * syntax.c (find_defun_start): Update all cache variables if
17367 exiting early (Bug#9401).
17368
17369 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17370
17371 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17372
17373 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17374 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17375 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17376
17377 * term.c (tty_append_glyph): New function.
17378 (produce_stretch_glyph): Static function and its prototype deleted.
17379
17380 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17381 Add prototypes.
17382
17383 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17384
17385 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17386 when checking :margin (Bug#9390).
17387 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17388 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17389 so that the name doesn't mislead. All uses changed.
17390
17391 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17392
17393 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17394 set_tty_hooks.
17395
17396 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17397
17398 * xdisp.c (move_it_to): Don't bail out early when reaching
17399 position beyond to_charpos, if we are scanning backwards.
17400 (move_it_vertically_backward): When DY == 0, make sure we get to
17401 the first character in the line after the newline.
17402
17403 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17404
17405 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17406 (ccl_driver): Do not generate an out-of-range pointer.
17407 (Fccl_execute_on_string): Remove unnecessary check for
17408 integer overflow, noted by Stefan Monnier in
17409 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17410 Remove a FIXME that didn't need fixing.
17411 Simplify the newly-introduced buffer reallocation code.
17412
17413 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17414
17415 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17416
17417 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17418
17419 Integer and memory overflow issues (Bug#9196).
17420
17421 * doc.c (get_doc_string): Rework so that
17422 get_doc_string_buffer_size is the actual buffer size, rather than
17423 being 1 less than the actual buffer size; this makes xpalloc more
17424 convenient.
17425
17426 * image.c (x_allocate_bitmap_record, cache_image):
17427 * xselect.c (Fx_register_dnd_atom):
17428 Simplify previous changes by using xpalloc.
17429
17430 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17431 since either will do and ptrdiff_t is convenient with xpalloc.
17432
17433 * charset.c (charset_table_size)
17434 (struct charset_sort_data.priority): Now ptrdiff_t.
17435 (charset_compare): Don't overflow if priorities differ greatly.
17436 (Fsort_charsets): Don't assume list length fits in int.
17437 Check for size-calculation overflow when allocating sort data.
17438 (syms_of_charset): Allocate an initial charset table that is
17439 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17440
17441 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17442
17443 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17444 The actual value is always <= INT_MAX, and leaving it unsigned made
17445 overflow checking harder.
17446
17447 * dispextern.h (struct glyph_matrix.rows_allocated)
17448 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17449 with xpalloc. The values are still always <= INT_MAX.
17450
17451 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17452
17453 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17454 (SAFE_NALLOCA): New macro.
17455
17456 * region-cache.c (struct boundary.pos, find_cache_boundary)
17457 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17458 (set_cache_region, invalidate_region_cache)
17459 (revalidate_region_cache, know_region_cache, region_cache_forward)
17460 (region_cache_backward, pp_cache):
17461 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17462 so that ptrdiff_t * can be passed to xpalloc.
17463 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17464 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17465 (pp_cache): Don't assume cache_len fits in int.
17466 * region-cache.h: Adjust extern decls to match.
17467
17468 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17469 EMACS_INT, since either will do, for xpalloc.
17470
17471 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17472 (xnmalloc, xnrealloc, xpalloc): New functions.
17473
17474 * bidi.c (bidi_shelve_header_size): New constant.
17475 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17476 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17477
17478 * bidi.c (bidi_cache_shrink):
17479 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17480 (overlay_strings):
17481 Don't update size of array until after memory allocation succeeds,
17482 because xmalloc/xrealloc may not return.
17483 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17484 now that we have proper integer overflow checking.
17485 (record_overlay_string, overlay_strings): Catch overflows when
17486 calculating size of overlay_str_buf.
17487
17488 * callproc.c (Fcall_process): Check for size overflow when
17489 calculating size of args2.
17490 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17491 Normally we prefer signed values, but sticking with ptrdiff_t would
17492 require adding more-complicated checks.
17493
17494 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17495 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17496 Redo buffer-overflow calculations to avoid integer overflow.
17497 Add a FIXME comment where memory seems to be over-allocated.
17498
17499 * character.c (Fstring): Check for size-calculation overflow.
17500
17501 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17502 unnecessary integer overflow. Check for size overflow.
17503 (encode_coding_object): Don't update size until xmalloc succeeds.
17504
17505 * composite.c (get_composition_id): Check for overflow in glyph
17506 length calculations.
17507
17508 Integer and memory overflow fixes for display code.
17509 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17510 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17511 (scrolling_window): Check for overflow in size calculations.
17512 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17513 Don't assume glyph table len fits in int.
17514 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17515 (row_table_size): Now ptrdiff_t, not int.
17516 (scrolling_window): Avoid overflow in size calculations.
17517 Don't update size until allocation succeeds.
17518 * fns.c (concat): Check for overflow in size calculations.
17519 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17520 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17521 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17522
17523 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17524 (get_doc_string): Check for size calculation overflow.
17525 Don't update size until allocation succeeds.
17526 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17527 EMACS_INT, where ptrdiff_t will do.
17528 (Fsubstitute_command_keys): Check for string overflow.
17529
17530 * editfns.c (set_time_zone_rule): Don't assume environment length
17531 fits in int.
17532 (message_length): Now ptrdiff_t, not int.
17533 (Fmessage_box): Don't update size until allocation succeeds.
17534 Don't assume message length fits in int.
17535 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17536
17537 * emacs.c (main): Do not reallocate argv, since there is a null at
17538 the end that can be overwritten, and this way there's no need to
17539 worry about size-calculation overflow.
17540 (sort_args): Check for size-calculation overflow.
17541
17542 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17543 alloc succeeds.
17544 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17545
17546 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17547 (x_set_scroll_bar_width, x_figure_window_size):
17548 Check for integer overflow.
17549 (x_set_alpha): Do not assume XINT fits in int.
17550
17551 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17552 This is for the members text_lines, text_cols, total_lines, total_cols,
17553 where the system imposes an 'int' limit.
17554
17555 * fringe.c (Fdefine_fringe_bitmap):
17556 Don't update size until alloc works.
17557
17558 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17559 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17560
17561 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17562 Check for size-calculation overflow.
17563 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17564 do, as we prefer signed integers.
17565 (id_to_widget.max_size, id_to_widget.used)
17566 (xg_store_widget_in_map, xg_remove_widget_from_map)
17567 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17568 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17569 Use and return ptrdiff_t, not int.
17570 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17571 * gtkutil.h: Change prototypes to match the above.
17572
17573 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17574 are duplicate now that they've been promoted to lisp.h.
17575 (x_allocate_bitmap_record, x_alloc_image_color)
17576 (make_image_cache, cache_image, xpm_load):
17577 Don't update size until alloc is done.
17578 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17579 (x_detect_edges):
17580 Check for size calculation overflow.
17581 (ct_colors_allocated_max): New constant.
17582 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17583 overflow.
17584
17585 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17586 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17587 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17588 Use ptrdiff_t, not int, to count maps.
17589 (read_char_minibuf_menu_prompt): Check for overflow in size
17590 calculations. Don't update size until allocation succeeds.
17591 Redo calculations to avoid overflow.
17592 * keyboard.h: Change prototypes to match the above.
17593
17594 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17595 to count maps.
17596 (current_minor_maps): Check for size calculation overflow.
17597 * keymap.h: Change prototypes to match the above.
17598
17599 * lread.c (read1, init_obarray): Don't update size until alloc done.
17600
17601 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17602 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17603
17604 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17605 Now ptrdiff_t, not int.
17606 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17607 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17608
17609 * process.c (Fnetwork_interface_list): Check for overflow
17610 in size calculation.
17611
17612 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17613
17614 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17615 overflow. Don't bother calling xmalloc when xrealloc will do.
17616
17617 * search.c (Freplace_match): Check for size calculation overflow.
17618 (Fset_match_data): Don't assume list lengths fit in 'int'.
17619
17620 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17621 for command line length. Do not attempt to address one before the
17622 beginning of an array, as that's not portable.
17623
17624 * term.c (max_frame_lines): Remove; unused.
17625 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17626 not int.
17627 (encode_terminal_code, calculate_costs): Check for size
17628 calculation overflow.
17629 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17630 table lengths and related sizes. Don't update size until alloc
17631 done. Redo calculations to avoid overflow.
17632 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17633
17634 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17635 subtracting pointers.
17636 (gobble_line): Check for overflow more carefully. Don't update size
17637 until alloc done.
17638
17639 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17640 Don't update size until alloc done.
17641 Redo size calculations to avoid overflow.
17642 Check for size calculation overflow.
17643 (main) [DEBUG]: Fix typo in invoking tparam1.
17644
17645 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17646 Use ptrdiff_t, not int, for sizes.
17647 (store_mode_line_noprop_char): Don't update size until alloc done.
17648
17649 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17650 Use ptrdiff_t, not int, for sizes.
17651 (Finternal_make_lisp_face, cache_face):
17652 Check for size calculation overflow.
17653 (cache_face): Treat size calculation overflows as if they were
17654 memory exhaustion (the usual treatment), rather than aborting.
17655
17656 * xfns.c (x_encode_text, x_set_name_internal)
17657 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17658 sizes, since they can exceed INT_MAX in size. Check for size
17659 calculation overflow.
17660
17661 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17662 (xg_select): Check for size calculation overflow.
17663 Don't update size until alloc done.
17664
17665 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17666 as sprintf is limited to int lengths.
17667
17668 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17669 (X_LONG_MIN): New macros.
17670 Use them to make the following changes clearer.
17671 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17672 This change doesn't affect the value now, but it may help remind
17673 future maintainers not to raise the value too much later.
17674 (SELECTION_QUANTUM): Remove, replacing with ...
17675 (selection_quantum): ... new function, which avoids overflow.
17676 All uses changed.
17677 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17678 assumption that selection length fits in 'int'.
17679 (x_reply_selection_request, x_handle_selection_request)
17680 (x_get_window_property, receive_incremental_selection)
17681 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17682 (lisp_data_to_selection_data, clean_local_selection_data):
17683 Use ptrdiff_t, not int, to record length of selection.
17684 (x_reply_selection_request, x_get_window_property)
17685 (receive_incremental_selection, x_property_data_to_lisp):
17686 Redo calculations to avoid overflow.
17687 (x_reply_selection_request): When sending hint, ceiling it at
17688 X_LONG_MAX rather than relying on wraparound overflow to send
17689 something.
17690 (x_get_window_property, receive_incremental_selection)
17691 (lisp_data_to_selection_data, x_property_data_to_lisp):
17692 Check for size-calculation overflow.
17693 (x_get_window_property, receive_incremental_selection)
17694 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17695 Don't store size until memory allocation succeeds.
17696 (x_get_window_property): Plug memory leak on memory exhaustion.
17697 Don't double-block input; malloc is safe here. Don't assume 2**34
17698 - 4 fits in unsigned long. Add an xassert to check
17699 XGetWindowProperty overflow. Be more careful about overflow
17700 calculations, and distinguish size from memory overflow better.
17701 (receive_incremental_selection): When tracing, don't assume
17702 unsigned int is less than INT_MAX.
17703 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17704 harmful) conversions of unsigned short to int.
17705 (lisp_data_to_selection_data): Don't assume that integers
17706 in the range -65535 through -1 fit in an X unsigned short.
17707 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17708 result parameters unless successful. Rely on cons_to_unsigned
17709 to report problems with elements; the old code wasn't right anyway.
17710 (x_check_property_data): Check for int overflow; we cannot use
17711 a wider type due to X limits.
17712 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17713
17714 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17715
17716 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17717 (x_term_init): Check for size calculation overflow.
17718 (x_color_cells): Don't store size until memory allocation succeeds.
17719 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17720 Don't assume alloca size is less than MAX_ALLOCA.
17721 (x_term_init): Don't assume length fits in int (sprintf is limited
17722 to int size).
17723
17724 Use ptrdiff_t for composition IDs.
17725 * character.c (lisp_string_width):
17726 * composite.c (composition_table_size, n_compositions)
17727 (get_composition_id, composition_gstring_from_id):
17728 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17729 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17730 * window.c (Frecenter):
17731 Use ptrdiff_t, not int, for composition IDs.
17732 * composite.c (get_composition_id): Check for integer overflow.
17733 * composite.h: Adjust prototypes to match the above changes.
17734
17735 Use ptrdiff_t for hash table indexes.
17736 * category.c (hash_get_category_set):
17737 * ccl.c (ccl_driver):
17738 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17739 * coding.c (coding_system_charset_list, detect_coding_system):
17740 * coding.h (struct coding_system.id):
17741 * composite.c (get_composition_id, gstring_lookup_cache):
17742 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17743 * image.c (xpm_get_color_table_h):
17744 * lisp.h (hash_lookup, hash_put):
17745 * minibuf.c (Ftest_completion):
17746 Use ptrdiff_t for hash table indexes, not int (which is too
17747 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17748 32-bit --with-wide-int hosts).
17749
17750 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17751 Add a FIXME comment about memory leaks.
17752 (syms_of_charset): Don't assume xmalloc returns.
17753
17754 Don't assume that stated character widths fit in int.
17755 * character.c (Fchar_width, c_string_width, lisp_string_width):
17756 * character.h (CHAR_WIDTH):
17757 * indent.c (MULTIBYTE_BYTES_WIDTH):
17758 Use sanitize_char_width to avoid undefined and/or bad behavior
17759 with outlandish widths.
17760 * character.h (sanitize_tab_width): Rename from sanitize_width,
17761 now that we have two such functions. All uses changed.
17762 (sanitize_char_width): New inline function.
17763
17764 Don't assume that tab-width fits in int.
17765 * character.h (sanitize_width): New inline function.
17766 (SANE_TAB_WIDTH): New macro.
17767 (ASCII_CHAR_WIDTH): Use it.
17768 * indent.c (sane_tab_width): Remove. All uses replaced by
17769 SANE_TAB_WIDTH (current_buffer).
17770 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17771
17772 * fileio.c: Integer overflow issues with file modes.
17773 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17774
17775 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17776 Remove unreachable code.
17777 (read_hex, load_charset_map_from_file): Check for integer overflow.
17778
17779 * xterm.c: Don't go over XClientMessageEvent limit.
17780 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17781 (x_send_scroll_bar_event): Likewise. Check that the size does not
17782 exceed limits imposed by XClientMessageEvent, as well as the usual
17783 ptrdiff_t and size_t limits.
17784
17785 * keyboard.c: Overflow, signedness and related fixes.
17786 (make_lispy_movement): Use same integer type in forward decl
17787 that is used in the definition.
17788 (read_key_sequence, keyremap_step):
17789 Change bufsize argument back to int, undoing my 2011-03-30 change.
17790 We prefer signed types, and int is wide enough here.
17791 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17792 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17793 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17794 length, not size_t. Use ptrdiff_t for index, not int.
17795 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17796 possibility of integer overflow.
17797
17798 Overflow, signedness and related fixes for images.
17799
17800 * dispextern.h (struct it.stack[0].u.image.image_id)
17801 (struct_it.image_id, struct image.id, struct image_cache.size)
17802 (struct image_cache.used, struct image_cache.ref_count):
17803 * gtkutil.c (update_frame_tool_bar):
17804 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17805 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17806 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17807 * nsmenu.m (update_frame_tool_bar):
17808 * xdisp.c (calc_pixel_width_or_height):
17809 * xfns.c (image_cache_refcount):
17810 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17811 on typical 64-bit hosts.
17812
17813 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17814 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17815 Omit unnecessary casts to int.
17816 (parse_image_spec): Check that integers fall into 'int' range
17817 when the callers expect that.
17818 (image_ascent): Redo ascent calculation to avoid int overflow.
17819 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17820 (lookup_image): Remove unnecessary tests.
17821 (xbm_image_p): Locals are now of int, not EMACS_INT,
17822 since parse_image_check makes sure they fit into int.
17823 (png_load, gif_load, svg_load_image):
17824 Prefer int to unsigned where either will do.
17825 (tiff_handler): New function, combining the cores of the
17826 old tiff_error_handler and tiff_warning_handler.
17827 This function is rewritten to use vsnprintf and thereby avoid
17828 stack buffer overflows. It uses only the features of vsnprintf
17829 that are common to both POSIX and native Microsoft.
17830 (tiff_error_handler, tiff_warning_handler): Use it.
17831 (tiff_load, gif_load, imagemagick_load_image):
17832 Don't assume :index value fits in 'int'.
17833 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17834 (imagemagick_load_image): Check that crop parameters fit into
17835 the integer types that MagickCropImage accepts. Don't assume
17836 Vimagemagick_render_type has a nonnegative value. Don't assume
17837 size_t fits in 'long'.
17838 (gs_load): Use printmax_t to print the widest integers possible.
17839 Check for integer overflow when computing image height and width.
17840
17841 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17842
17843 * xdisp.c (redisplay_window): Don't force window start if point
17844 will be invisible in the resulting window. (Bug#9324)
17845
17846 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17847
17848 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17849 the display spec is of the form `(space ...)'.
17850 (handle_display_spec): Return the value returned by
17851 handle_single_display_spec, not just 1 or zero.
17852 (handle_single_display_spec): If the display spec is of the form
17853 `(space ...)', and specifies display in the text area, return 2
17854 rather than 1.
17855 (try_cursor_movement): Check for the need to scroll more
17856 accurately, and prefer exact match for point under bidi.
17857 Don't advance `row' beyond the last row of the window.
17858
17859 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17860 into disp_prop; all users changed.
17861
17862 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17863 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17864 for the text covered by the display property.
17865
17866 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17867
17868 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17869 Change return value to nil.
17870 (Frecord_buffer): Delete unused function.
17871
17872 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17873
17874 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17875 buffers, return left-to-right.
17876 (set_cursor_from_row): Consider candidate row a win if its glyph
17877 represents a newline and point is on that newline. Fixes cursor
17878 positioning on the newline at EOL of R2L text within L2R
17879 paragraph, and vice versa.
17880 (try_cursor_movement): Check continued rows, in addition to
17881 continuation rows. Fixes unwarranted scroll when point enters a
17882 continued line of R2L text within an L2R paragraph, or vice versa.
17883 (cursor_row_p): Consider the case of point being equal to
17884 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17885 from the end of a short line to the beginning of a continued line
17886 of R2L text within L2R paragraph.
17887 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17888 composed characters.
17889
17890 * bidi.c (bidi_check_type): Use xassert.
17891 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17892 members.
17893
17894 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17895
17896 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17897 a character.
17898
17899 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17900
17901 * nsfont.m (ns_otf_to_script): Fix typo.
17902
17903 2011-08-22 Kenichi Handa <handa@m17n.org>
17904
17905 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17906 extra slot even if the purpose is char-code-property-table.
17907
17908 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17909
17910 * xdisp.c (redisplay_window): When computing centering_position,
17911 account for the height of the header line. (Bug#8874)
17912
17913 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17914 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17915 candidate is selected by the mouse, and that candidate has a
17916 composed character under the mouse.
17917
17918 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17919 coordinates reported by pos-visible-in-window-p for a composed
17920 character in column zero.
17921
17922 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17923
17924 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17925
17926 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17927
17928 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17929 consider it a hit if to_charpos is anywhere in the range of the
17930 composed buffer positions.
17931
17932 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17933
17934 * image.c (gif_load): Don't assume that each subimage has the same
17935 dimensions as the base image. Handle disposal method that is
17936 "undefined" by the gif spec (Bug#9335).
17937
17938 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17939
17940 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17941 (Fcondition_case): Document `debug' symbol in error handler.
17942
17943 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17944
17945 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17946 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17947 from an Org mode buffer to a Speedbar frame.
17948
17949 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17950 a composition, take its buffer position from IT->cmp_it.charpos.
17951 Fixes cursor positioning at the beginning of a line that begins
17952 with a composed character.
17953
17954 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17955
17956 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17957 character bidirectional type, use STRONG_L instead. Fixes crashes
17958 in a buffer produced by `describe-categories'.
17959
17960 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17961 members before the level stack, so they would be saved and
17962 restored when copying iterator state. Fixes incorrect reordering
17963 around TABs covered by display properties.
17964
17965 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17966
17967 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17968
17969 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17970
17971 * eval.c (internal_condition_case, internal_condition_case_1)
17972 (internal_condition_case_2, internal_condition_case_n):
17973 Remove unnecessary aborts (Bug#9081).
17974
17975 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17976
17977 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17978 has no `load' handler, try opening the file locally. (Bug#9311)
17979
17980 2011-08-16 Ken Brown <kbrown@cornell.edu>
17981
17982 * gmalloc.c: Expand comment.
17983
17984 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17985
17986 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17987 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17988
17989 2011-08-16 Ken Brown <kbrown@cornell.edu>
17990
17991 Fix memory allocation problems in Cygwin build (Bug#9273).
17992
17993 * unexcw.c (__malloc_initialized): Declare external variable.
17994 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17995
17996 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17997 New variables.
17998 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17999 dumped emacs.
18000 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
18001 in the static heap.
18002 [CYGWIN] (special_realloc): New function.
18003 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
18004 requests to realloc storage in the static heap.
18005
18006 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
18007
18008 * bidi.c (bidi_initialize): Remove unused local.
18009
18010 2011-08-15 Eli Zaretskii <eliz@gnu.org>
18011
18012 * bidimirror.h:
18013 * biditype.h: Remove file.
18014 * makefile.w32-in ($(BLD)/bidi.$(O)):
18015 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
18016
18017 * dispextern.h: Fix a typo in the comment to bidi_type_t.
18018
18019 * chartab.c: Improve commentary for the uniprop_table API.
18020
18021 * bidi.c (bidi_paragraph_init): Support zero value of
18022 bidi_ignore_explicit_marks_for_paragraph_level.
18023 (bidi_initialize): Use uniprop_table instead of including
18024 biditype.h and bidimirror.h.
18025
18026 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
18027 coordinates of the iterator when restoring from ppos_it.
18028 (Bug#9296)
18029
18030 2011-08-14 Kenichi Handa <handa@m17n.org>
18031
18032 * process.c (create_process): Call setup_process_coding_systems
18033 after the pid of the process is set to -1 (Bug#8162).
18034
18035 2011-08-14 Eli Zaretskii <eliz@gnu.org>
18036
18037 * xdisp.c (move_it_in_display_line_to): Don't invoke
18038 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18039 ppos_it. Fixes vertical cursor motion when line beginning is
18040 covered by an image. (Bug#9296)
18041
18042 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18043
18044 * nsterm.h (ns_run_ascript): Declare.
18045 (NSAPP_DATA2_RUNASSCRIPT): Define.
18046
18047 * nsfns.m (as_script, as_result, as_status): New static variables.
18048 (ns_run_ascript): New function.
18049 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18050 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18051 the event loop. Get status from as_status (Bug#7276).
18052
18053 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18054 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18055 the event loop (Bug#7276).
18056
18057 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18058
18059 * gnutls.c (QCgnutls_bootprop_priority)
18060 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18061 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18062 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18063 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18064 (QCgnutls_bootprop_verify_hostname_error)
18065 (QCgnutls_bootprop_callbacks_verify): Rename from
18066 Qgnutls_bootprop_..., all uses changed.
18067
18068 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18069 uses changed.
18070
18071 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18072
18073 * xfaces.c (Qframe_set_background_mode): Now static.
18074 * dispextern.h (Qframe_set_background_mode): Remove decl.
18075
18076 * process.c (Fnetwork_interface_info): Declare local only if needed.
18077
18078 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18079
18080 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18081 (Fnetwork_interface_list): Allocate in increments of bytes instead
18082 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18083 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18084 sockaddr.
18085 (struct ifflag_def): notrailers is smart on OSX.
18086 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18087 Get hardware address with getifaddrs if available.
18088
18089 2011-08-12 Eli Zaretskii <eliz@gnu.org>
18090
18091 * xdisp.c (iterate_out_of_display_property): xassert that
18092 IT->position is set to within IT->object's boundaries. Break from
18093 the loop as soon as EOB is reached; avoids infloops in redisplay
18094 when IT->position is set up wrongly due to some bug.
18095 Set IT->current to match the bidi iterator unconditionally.
18096 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18097 entry. Force push_it to save on the stack the current
18098 buffer/string position, to be restored by pop_it. Fix flags in
18099 the iterator structure wrt the object coming from a display
18100 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18101 properties. (Bug#9284)
18102
18103 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18104
18105 * fontset.c (fontset_get_font_group): Add proper type checks.
18106 (Bug#9172)
18107
18108 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18109
18110 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18111 and LC_VERSION_MIN_MACOSX.
18112 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18113 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18114
18115 2011-08-08 Eli Zaretskii <eliz@gnu.org>
18116
18117 * xdisp.c (forward_to_next_line_start): Allow to use the
18118 no-display-properties-and-no-overlays under bidi display.
18119 Set disp_pos in the bidi iterator to avoid searches for display
18120 properties and overlays.
18121
18122 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
18123
18124 * editfns.c (Fset_time_zone_rule): Document relationship with the
18125 setenv function.
18126
18127 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18128 the font entity extracted from the cache (Bug#8109).
18129
18130 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
18131
18132 * composite.c (autocmp_chars): Don't reset point. That is done by
18133 restore_point_unwind (Bug#5984).
18134
18135 2011-08-07 Juri Linkov <juri@jurta.org>
18136
18137 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18138 to show the arg `TIME' instead of `TIMEVAL'.
18139
18140 2011-08-06 Eli Zaretskii <eliz@gnu.org>
18141
18142 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18143 display property strides EOL and includes a newline, as in
18144 longlines-mode. (Bug#9254)
18145 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18146 word-wrap under bidirectional display. (Bug#9224)
18147
18148 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18149 is non-zero, even if the data buffer is NULL. Fixes a crash in
18150 vertical-motion with longlines-mode. (Bug#9254)
18151
18152 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18153
18154 * bidi.c <bidi_cache_total_alloc>: Now static.
18155 (bidi_initialize): Initialize bidi_cache_total_alloc.
18156
18157 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18158 cache. (Bug#9221)
18159
18160 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18161 amount allocated this far in `bidi_cache_total_alloc'.
18162 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18163 non-zero, only free the data buffer without restoring the cache
18164 contents. All callers changed.
18165
18166 * dispextern.h (bidi_unshelve_cache): Update prototype.
18167
18168 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18169 (move_it_in_display_line, move_it_to)
18170 (move_it_vertically_backward, move_it_by_lines): Replace the call
18171 to xfree to an equivalent call to bidi_unshelve_cache.
18172 (move_it_in_display_line_to): Fix logic of returning
18173 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18174
18175 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18176
18177 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18178 came from a string character with a `cursor' property. (Bug#9229)
18179
18180 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18181
18182 * Makefile.in (LIB_PTHREAD): New variable.
18183 (LIBES): Add LIB_PTHREAD (Bug#9216).
18184
18185 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18186 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18187
18188 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18189
18190 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18191
18192 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18193
18194 * xterm.c (x_find_topmost_parent): New function.
18195 (x_set_frame_alpha): Find topmost parent window with
18196 x_find_topmost_parent and set the property there also (bug#9181).
18197 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18198
18199 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18200
18201 * callproc.c (Fcall_process): Avoid vfork clobbering
18202 the local vars buffer, coding_systems, current_dir.
18203
18204 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18205
18206 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18207
18208 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18209
18210 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18211 so that it is not optimized away.
18212
18213 * xdisp.c (compute_display_string_pos): Remove unused local.
18214
18215 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18216
18217 Fix slow cursor motion and scrolling in large buffers with
18218 selective display, like Org Mode buffers. (Bug#9218)
18219
18220 * dispextern.h (struct bidi_it): New member disp_prop_p.
18221
18222 * xdisp.c: Remove one-slot cache of display string positions.
18223 (compute_display_string_pos): Accept an additional argument
18224 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18225 for a display string or property. If found, set DISP_PROP_P
18226 non-zero.
18227
18228 * bidi.c (bidi_fetch_char): Accept an additional argument
18229 DISP_PROP_P, and pass it to compute_display_string_pos.
18230 Only handle text covered by a display string if DISP_PROP_P is returned
18231 non-zero. All callers of bidi_fetch_char changed.
18232
18233 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18234
18235 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18236
18237 2010-12-03 Don March <don@ohspite.net>
18238
18239 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18240 last character M-[char] is translated to ESC [char] (bug#7541).
18241
18242 2011-08-02 Kenichi Handa <handa@m17n.org>
18243
18244 * lisp.h (uniprop_table): Extern it.
18245
18246 * chartab.c (uniprop_table): Make it non-static.
18247
18248 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18249
18250 * xdisp.c (forward_to_next_line_start): Accept additional argument
18251 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18252 on the newline.
18253 (reseat_at_next_visible_line_start): Use the bidi iterator state
18254 returned by forward_to_next_line_start to restore the state of
18255 it->bidi_it after backing up to previous newline. (Bug#9212)
18256
18257 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18258
18259 * regex.c (re_comp): Protoize.
18260 (re_exec): Fix return type.
18261 (regexec): Fix type of `ret'. (Bug#9203)
18262
18263 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18264
18265 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18266 This is needed if max-image-size is a floating-point number.
18267
18268 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18269
18270 * print.c (print_object): Print empty symbol as ##.
18271
18272 * lread.c (read1): Read ## as empty symbol.
18273
18274 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18275
18276 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18277 setting frame foreground color (Bug#9175).
18278 (x_set_background_color): Likewise.
18279
18280 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18281 contents (Bug#9176).
18282 (EmacsTooltip -init): Remove bezels and add shadows to
18283 tooltip windows.
18284
18285 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18286 or scroll bar (Bug#8470).
18287
18288 * nsfont.m (nsfont_open): Remove assignment to voffset and
18289 unnecessary vars hshink, expand, hd, full_height, min_height.
18290 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18291
18292 * nsterm.h (nsfont_info): Remove voffset field.
18293
18294 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18295
18296 Implement strike-through and overline on NextStep (Bug#8863).
18297
18298 * nsfont.m (nsfont_open): Use underline position provided by font,
18299 instead of hard-coded value of 2.
18300 (nsfont_draw): Call ns_draw_text_decoration instead.
18301
18302 * nsterm.h: Add declaration for ns_draw_text_decoration.
18303
18304 * nsterm.m (ns_draw_text_decoration): New function for drawing
18305 underline, overline, and strike-through.
18306 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18307 ns_draw_text_decoration. Change treatment of cursor drawing to
18308 accommodate underlining, etc.
18309
18310 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18311
18312 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18313 default.
18314
18315 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18316
18317 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18318 Without this fix, if a signal arrives just after memory fills up,
18319 'malloc' might be invoked reentrantly.
18320
18321 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18322 In other words, assume that every image size is allowed, on non-X
18323 hosts. This assumption is probably wrong, but it lets Emacs compile.
18324
18325 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18326
18327 * regex.c (re_iswctype): Convert return values to boolean.
18328
18329 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18330
18331 * xdisp.c (compute_display_string_pos): Don't use cached display
18332 string position if the buffer had its restriction changed.
18333 (Bug#9184)
18334
18335 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18336
18337 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18338
18339 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18340
18341 Integer signedness and overflow and related fixes. (Bug#9079)
18342
18343 * bidi.c: Integer size and overflow fixes.
18344 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18345 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18346 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18347 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18348 (bidi_find_other_level_edge):
18349 Use ptrdiff_t instead of EMACS_INT where either will do.
18350 This works better on 32-bit hosts configured --with-wide-int.
18351 (bidi_cache_ensure_space): Check for size-calculation overflow.
18352 Use % rather than repeated addition, for better worst-case speed.
18353 Don't set bidi_cache_size until after xrealloc returns, because it
18354 might not return.
18355 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18356 (bidi_cache_ensure_space): Also check that the bidi cache size
18357 does not exceed that of the largest Lisp string or buffer. See Eli
18358 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18359
18360 * alloc.c (__malloc_size_t): Remove.
18361 All uses replaced by size_t. See Andreas Schwab's note
18362 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18363
18364 * image.c: Improve checking for integer overflow.
18365 (check_image_size): Assume that f is nonnull, since
18366 it is always nonnull in practice. This is one less thing to
18367 worry about when checking for integer overflow later.
18368 (x_check_image_size): New function, which checks for integer
18369 overflow issues inside X.
18370 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18371 This removes the need for a memory_full check.
18372 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18373 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18374 (xbm_read_bitmap_data): Change locals back to 'int', since
18375 their values must fit in 'int'.
18376 (xpm_load_image, png_load, tiff_load):
18377 Invoke x_create_x_image_and_pixmap earlier,
18378 to avoid much needless work if the image is too large.
18379 (tiff_load): Treat overly large images as if
18380 x_create_x_image_and_pixmap failed, not as malloc failures.
18381 (gs_load): Use x_check_image_size.
18382
18383 * gtkutil.c: Omit integer casts.
18384 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18385 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18386
18387 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18388
18389 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18390 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18391 would wrongly return t on a 64-bit host.
18392
18393 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18394 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18395 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18396 and therefore cause GCC to emit a bogus diagnostic in some cases.
18397
18398 * image.c: Integer signedness and overflow and related fixes.
18399 This is not an exhaustive set of fixes, but it's time to
18400 record what I've got.
18401 (lookup_pixel_color, check_image_size): Remove redundant decls.
18402 (check_image_size): Don't assume that arbitrary EMACS_INT values
18403 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18404 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18405 (tiff_load, imagemagick_load_image):
18406 Check for overflow in size calculations.
18407 (x_create_x_image_and_pixmap): Remove unnecessary test for
18408 xmalloc returning NULL; that can't happen.
18409 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18410 (xpm_color_bucket): Use better integer hashing function.
18411 (xpm_cache_color): Don't possibly over-allocate memory.
18412 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18413 (gif_memory_source):
18414 Use ptrdiff_t, not int or size_t, to record sizes.
18415 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18416 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18417 either works, as we prefer signed integers.
18418 (tiff_read_from_memory, tiff_write_from_memory):
18419 Return tsize_t, not size_t, since that's what the TIFF API wants.
18420 (tiff_read_from_memory): Don't fail simply because the read would
18421 go past EOF; instead, return a short read.
18422 (tiff_load): Omit no-longer-needed casts.
18423 (Fimagemagick_types): Don't assume size fits into 'int'.
18424
18425 Improve hashing quality when configured --with-wide-int.
18426 * fns.c (hash_string): New function, taken from sxhash_string.
18427 Do not discard information about ASCII character case; this
18428 discarding is no longer needed.
18429 (sxhash-string): Use it. Change sig to match it. Caller changed.
18430 * lisp.h: Declare it.
18431 * lread.c (hash_string): Remove, since we now use fns.c's version.
18432 The fns.c version returns a wider integer if --with-wide-int is
18433 specified, so this should help the quality of the hashing a bit.
18434
18435 * emacs.c: Integer overflow minor fix.
18436 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18437 Define only if GNU_LINUX.
18438 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18439
18440 * dispnew.c: Integer signedness and overflow fixes.
18441 Remove unnecessary forward decls, that were a maintenance hassle.
18442 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18443 All uses changed.
18444 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18445 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18446 (prepare_desired_row, line_draw_cost):
18447 Use int, not unsigned, where either works.
18448 (save_current_matrix, restore_current_matrix):
18449 Use ptrdiff_t, not size_t, where either works.
18450 (init_display): Check for overflow more accurately, and without
18451 relying on undefined behavior.
18452
18453 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18454 Remove, replacing with the new symbols in lisp.h. All uses changed.
18455 * fileio.c (make_temp_name):
18456 * filelock.c (lock_file_1, lock_file):
18457 * xdisp.c (message_dolog):
18458 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18459 Use pMd etc. instead.
18460 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18461 replacing the pWIDE etc. symbols removed from editfns.c.
18462
18463 * keyboard.h (num_input_events): Now uintmax_t.
18464 This is (very slightly) less likely to mess up due to wraparound.
18465 All uses changed.
18466
18467 * buffer.c: Integer signedness fixes.
18468 (alloc_buffer_text, enlarge_buffer_text):
18469 Use ptrdiff_t rather than size_t when either will do, as we prefer
18470 signed integers.
18471
18472 * alloc.c: Integer signedness and overflow fixes.
18473 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18474 (__malloc_size_t): Default to size_t, not to int.
18475 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18476 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18477 Prefer ptrdiff_t to size_t when either would do, as we prefer
18478 signed integers.
18479 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18480 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18481 Now const. Initialize with values that are in range even if char
18482 is signed.
18483 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18484 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18485 These functions do the right thing with sizes > 2**32.
18486 (check_depth): Now ptrdiff_t, not int.
18487 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18488 Adjust to new way of storing sizes. Check for size overflow bugs
18489 in rest of code.
18490 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18491 slightly wrong anyway, as it missed one instance of
18492 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18493 (refill_memory_reserve): Omit needless cast to size_t.
18494 (mark_object_loop_halt): Mark as externally visible.
18495
18496 * xselect.c: Integer signedness and overflow fixes.
18497 (Fx_register_dnd_atom, x_handle_dnd_message):
18498 Use ptrdiff_t, not size_t, since we prefer signed.
18499 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18500 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18501 x_dnd_atoms_size and x_dnd_atoms_length.
18502
18503 * doprnt.c: Prefer signed to unsigned when either works.
18504 * eval.c (verror):
18505 * doprnt.c (doprnt):
18506 * lisp.h (doprnt):
18507 * xdisp.c (vmessage):
18508 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18509 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18510 prefer signed arithmetic to avoid comparison confusion.
18511 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18512 but is a bit tricky.
18513
18514 Assume freestanding C89 headers, string.h, stdlib.h.
18515 * data.c, doprnt.c, floatfns.c, print.c:
18516 Include float.h unconditionally.
18517 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18518 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18519 * regex.c: Likewise for stddef.h, string.h.
18520 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18521 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18522 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18523 (STDC_HEADERS): Remove obsolete defines.
18524 * sysdep.c: Include limits.h unconditionally.
18525
18526 Assume support for memcmp, memcpy, memmove, memset.
18527 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18528 * regex.c (memcmp, memcpy):
18529 Remove; we assume C89 now.
18530
18531 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18532 (__malloc_safe_bcopy): Remove; no longer needed.
18533
18534 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18535 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18536 well either way, and we prefer signed to unsigned.
18537
18538 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18539
18540 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18541 closes the connection while we're reading (bug#9182).
18542
18543 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18544
18545 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18546 are specified (Bug#9168).
18547
18548 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18549
18550 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18551 Found by GCC static checking and --with-wide-int on a 32-bit host.
18552
18553 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18554
18555 * xdisp.c (compute_display_string_pos): Fix logic of caching
18556 previous display string position. Initialize cached_prev_pos to
18557 -1. Fixes slow-down at the beginning of a buffer.
18558
18559 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18560
18561 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18562 for attrs[LFACE_FONTSET_INDEX].
18563
18564 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18565
18566 * xml.c (parse_region): Remove unused local
18567 that was recently introduced.
18568
18569 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18570
18571 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18572 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18573
18574 * xdisp.c (move_it_in_display_line_to): Record the best matching
18575 position for TO_CHARPOS while scanning the line, and restore it on
18576 exit if none of the characters scanned was an exact match.
18577 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18578 when exact match is impossible due to invisible text, and the
18579 lines are truncated.
18580
18581 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18582
18583 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18584 for OSX >= 10.7.
18585
18586 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18587
18588 Fix a significant slow-down of cursor motion with C-n, C-p,
18589 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18590 auto-repeat under bidi redisplay in fontified buffers.
18591 * xdisp.c (compute_stop_pos_backwards): New function.
18592 (next_element_from_buffer): Call compute_stop_pos_backwards to
18593 find a suitable prev_stop when we find ourselves before
18594 base_level_stop.
18595 (reseat): Don't look for prev_stop, as that could mean a very long
18596 run.
18597 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18598 <cached_disp_overlay_modiff>: Cache for last found display string
18599 position.
18600 (compute_display_string_pos): Return the cached position if asked
18601 about the same buffer in the same area of character positions, and
18602 the buffer wasn't changed since the time the display string
18603 position was cached.
18604
18605 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18606
18607 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18608 is an integer, which is important for empty lines. (Bug#9149)
18609
18610 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18611
18612 * frame.c (Fmodify_frame_parameters): In tty case, update the
18613 default face if necessary (Bug#4238).
18614
18615 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18616
18617 * editfns.c (Fstring_to_char): No need to explain what a character
18618 is in the docstring (Bug#6576).
18619
18620 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18621
18622 * xml.c (parse_region): Make sure we always return a tree.
18623
18624 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18625
18626 * xml.c (parse_region): If a document contains only comments,
18627 return that, too.
18628
18629 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18630
18631 * xml.c (make_dom): Return comments, too.
18632
18633 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18634
18635 Port to OpenBSD.
18636 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18637 and the surrounding thread.
18638 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18639 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18640 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18641 timer goes off.
18642 * s/openbsd.h (BROKEN_SIGIO): Define.
18643 * unexelf.c (unexec) [__OpenBSD__]:
18644 Don't update the .mdebug section of the Alpha COFF symbol table.
18645
18646 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18647
18648 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18649 (bug#8460).
18650
18651 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18652
18653 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18654 This fixes some race conditions on the permissions of any newly
18655 created file.
18656
18657 * alloc.c (valid_pointer_p): Use pipe, not open.
18658 This fixes some permissions issues when debugging.
18659
18660 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18661 If fchown fails to set both uid and gid, try to set just gid,
18662 as that is sometimes allowed. Adjust the file's mode to eliminate
18663 setuid or setgid bits that are inappropriate if fchown fails.
18664
18665 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18666
18667 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18668 to compare Lisp_Objects.
18669 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18670 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18671 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18672
18673 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18674
18675 * lread.c (read_integer): Unread even EOF character.
18676 (read1): Likewise. Properly record start position of symbol.
18677
18678 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18679 symbol character follows.
18680
18681 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18682
18683 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18684 This works around a problem with the previous change to Fcopy_file.
18685 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18686 and without this change, GCC might complain about discarding
18687 fchown's return value.
18688
18689 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18690
18691 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18692
18693 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18694
18695 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18696
18697 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18698
18699 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18700 it's used from the C level.
18701
18702 * process.c: Use the same condition for POLL_FOR_INPUT in both
18703 keyboard.c and process.c (bug#1858).
18704
18705 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18706
18707 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18708 (Fgnutls_boot): Use it.
18709
18710 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18711
18712 * doc.c (Fsubstitute_command_keys): Revert last change.
18713
18714 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18715
18716 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18717 quotes the next character, and doesn't affect other longer
18718 sequences (bug#8935).
18719
18720 * lread.c (syms_of_lread): Clarify that is isn't only
18721 `eval-buffer' and `eval-defun' that's affected by
18722 `lexical-binding' (bug#8460).
18723
18724 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18725
18726 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18727 bidi redisplay when a line includes both an image and is truncated.
18728
18729 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18730
18731 Fix minor problems found by static checking.
18732 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18733 (elsz): Now a signed constant, not a size_t var. We prefer signed
18734 types to unsigned, to avoid integer comparison confusion. Without
18735 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18736 "cannot optimize loop, the loop counter may overflow", a symptom
18737 of the confusion.
18738 * indent.c (Fvertical_motion): Mark locals as initialized.
18739 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18740
18741 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18742
18743 * search.c (Fre_search_backward): Mention `case-fold-search' in
18744 all the re_search_* functions (bug#8138).
18745
18746 * keyboard.c (Fopen_dribble_file): Document when the file is
18747 closed (bug#8056).
18748
18749 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18750
18751 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18752 bidi_cache_idx.
18753
18754 Support bidi reordering of display and overlay strings.
18755 * xdisp.c (compute_display_string_pos)
18756 (compute_display_string_end): Accept additional argument STRING.
18757 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18758 (reseat_to_string): Initialize bidi_it->string.s and
18759 bidi_it->string.schars.
18760 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18761 NULL (avoids a crash in bidi_paragraph_init).
18762 Initialize itb.string.lstring.
18763 (init_iterator): Call bidi_init_it only of a valid
18764 buffer position was specified. Initialize paragraph_embedding to
18765 L2R.
18766 (reseat_to_string): Initialize the bidi iterator.
18767 (display_string): If we need to ignore text properties of
18768 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18769 original value of -1 will not work with bidi.)
18770 (compute_display_string_pos): First arg is now struct
18771 `text_pos *'; all callers changed. Support display properties on
18772 Lisp strings.
18773 (compute_display_string_end): Support display properties on Lisp
18774 strings.
18775 (init_iterator, reseat_1, reseat_to_string): Initialize the
18776 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18777 when iterating on a string not from display properties).
18778 (compute_display_string_pos, compute_display_string_end):
18779 Fix calculation of the object to scan. Fixes an error when using
18780 arrow keys.
18781 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18782 base_level_stop; instead, set base_level_stop to BEGV.
18783 Fixes crashes in vertical-motion.
18784 (next_element_from_buffer): Improve commentary for when
18785 the iterator is before prev_stop.
18786 (init_iterator): Initialize bidi_p from the default value of
18787 bidi-display-reordering, not from buffer-local value. Use the
18788 buffer-local value only if initializing for buffer iteration.
18789 (handle_invisible_prop): Support invisible properties on strings
18790 that are being bidi-reordered.
18791 (set_iterator_to_next): Support bidi reordering of C strings and
18792 Lisp strings.
18793 (next_element_from_string): Support bidi reordering of Lisp
18794 strings.
18795 (handle_stop_backwards): Support Lisp strings as well.
18796 (display_string): Support display of R2L glyph rows.
18797 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18798 (init_iterator): Don't initialize it->bidi_p for strings
18799 here.
18800 (reseat_to_string): Initialize it->bidi_p for strings here.
18801 (next_element_from_string, next_element_from_c_string)
18802 (next_element_from_buffer): Add xassert's for correspondence
18803 between IT's object being iterated and it->bidi_it.string
18804 structure.
18805 (face_before_or_after_it_pos): Support bidi iteration.
18806 (next_element_from_c_string): Handle the case of the first string
18807 character that is not the first one in the visual order.
18808 (get_visually_first_element): New function, refactored from common
18809 parts of next_element_from_buffer, next_element_from_string, and
18810 next_element_from_c_string.
18811 (tool_bar_lines_needed, redisplay_tool_bar)
18812 (display_menu_bar): Force left-to-right direction. Add a FIXME
18813 comment for making that be controlled by a user option.
18814 (push_it, pop_it): Save and restore the state of the
18815 bidi iterator. Save and restore the bidi_p flag.
18816 (pop_it): Iterate out of display property for string iteration as
18817 well.
18818 (iterate_out_of_display_property): Support iteration over strings.
18819 (handle_single_display_spec): Set up it->bidi_it for iteration
18820 over a display string, and call bidi_init_it.
18821 (handle_single_display_spec, next_overlay_string)
18822 (get_overlay_strings_1, push_display_prop): Set up the bidi
18823 iterator for displaying display or overlay strings.
18824 (forward_to_next_line_start): Don't use the shortcut if
18825 bidi-iterating.
18826 (back_to_previous_visible_line_start): If handle_display_prop
18827 pushed the iterator stack, restore the internal state of the bidi
18828 iterator by calling bidi_pop_it same number of times.
18829 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18830 and we are bidi-iterating, don't decrement the iterator position;
18831 instead, set the first_elt flag in the bidi iterator, to produce
18832 the same effect.
18833 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18834 (push_display_prop): xassert that we are iterating a buffer.
18835 (push_it, pop_it): Save and restore paragraph_embedding member.
18836 (handle_single_display_spec, next_overlay_string)
18837 (get_overlay_strings_1, reseat_1, reseat_to_string)
18838 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18839 correctly. Don't assume unibyte strings are not bidi-reordered.
18840 (compute_display_string_pos)
18841 (compute_display_string_end): Fix handling the case of C string.
18842 (push_it, pop_it): Save and restore from_disp_prop_p.
18843 (handle_single_display_spec, push_display_prop): Set the
18844 from_disp_prop_p flag.
18845 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18846 (pop_it): Call iterate_out_of_display_property only if we are
18847 popping after iteration over a string that came from a display
18848 property. Fix a typo in popping stretch info. Add an assertion
18849 for verifying that the iterator position is in sync with the bidi
18850 iterator.
18851 (handle_single_display_spec, get_overlay_strings_1)
18852 (push_display_prop): Fix initialization of paragraph direction for
18853 string when that of the parent object is not yet determined.
18854 (reseat_1): Call bidi_init_it to resync the bidi
18855 iterator with IT's position. (Bug#7616)
18856 (find_row_edges): If ROW->start.pos gives position
18857 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18858 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18859 Reset the from_disp_prop_p flag.
18860 (SAVE_IT, RESTORE_IT): New macros.
18861 (pos_visible_p, face_before_or_after_it_pos)
18862 (back_to_previous_visible_line_start)
18863 (move_it_in_display_line_to, move_it_in_display_line)
18864 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18865 (try_scrolling, redisplay_window, display_line): Use them when
18866 saving a temporary copy of the iterator and restoring it back.
18867 (back_to_previous_visible_line_start, reseat_1)
18868 (init_iterator): Empty the bidi cache "stack".
18869 (move_it_in_display_line_to): If iterator ended up at
18870 EOL, but we never saw any buffer positions smaller than
18871 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18872 motion in bidi-reordered lines.
18873 (move_it_in_display_line_to): Record prev_method and prev_pos
18874 immediately before the call to set_iterator_to_next. Fixes cursor
18875 motion in bidi-reordered lines with stretch glyphs and strings
18876 displayed in margins. (Bug#8133) (Bug#8867)
18877 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18878 TO_CHARPOS.
18879 (pos_visible_p): Support positions in bidi-reordered lines.
18880 Save and restore bidi cache.
18881
18882 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18883 (bidi_paragraph_info): Delete unused struct.
18884 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18885 (bidi_cache_start): New variable.
18886 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18887 to zero.
18888 (bidi_cache_fetch_state, bidi_cache_search)
18889 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18890 (bidi_cache_find, bidi_peek_at_next_level)
18891 (bidi_level_of_next_char, bidi_find_other_level_edge)
18892 (bidi_move_to_visually_next): Compare cache index with
18893 bidi_cache_start rather than with zero.
18894 (bidi_fetch_char): Accept new argument STRING; all callers
18895 changed. Support iteration over a string. Support strings with
18896 display properties. Support unibyte strings. Fix the type of
18897 `len' according to what STRING_CHAR_AND_LENGTH expects.
18898 (bidi_paragraph_init, bidi_resolve_explicit_1)
18899 (bidi_resolve_explicit, bidi_resolve_weak)
18900 (bidi_level_of_next_char, bidi_move_to_visually_next):
18901 Support iteration over a string.
18902 (bidi_set_sor_type, bidi_resolve_explicit_1)
18903 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18904 can now be zero (for strings); special values 0 and -1 were
18905 changed to -1 and -2, respectively.
18906 (bidi_char_at_pos): New function.
18907 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18908 Call it instead of FETCH_MULTIBYTE_CHAR.
18909 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18910 initialized to valid values.
18911 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18912 values.
18913 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18914 the test for valid cached positions. Fix the logic for looking up
18915 the sentinel state in the cache. GCPRO the Lisp string we are
18916 iterating.
18917 (bidi_push_it, bidi_pop_it): New functions.
18918 (bidi_initialize): Initialize the bidi cache start stack pointer.
18919 (bidi_cache_ensure_space): New function, refactored from part of
18920 bidi_cache_iterator_state. Don't assume the required size is just
18921 one BIDI_CACHE_CHUNK away.
18922 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18923 (bidi_count_bytes, bidi_char_at_pos): New functions.
18924 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18925 always valid if bidi_cache_idx is valid.
18926 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18927 is valid if it's going to be used.
18928 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18929 (bidi_cache_fetch_state, bidi_cache_search)
18930 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18931 (bidi_cache_iterator_state, bidi_cache_find)
18932 (bidi_find_other_level_edge, bidi_cache_start_stack):
18933 All variables related to cache indices are now EMACS_INT.
18934
18935 * dispextern.h (struct bidi_string_data): New structure.
18936 (struct bidi_it): New member `string'. Make flag members be 1-bit
18937 fields, and put them last in the struct.
18938 (compute_display_string_pos, compute_display_string_end):
18939 Update prototypes.
18940 (bidi_push_it, bidi_pop_it): Add prototypes.
18941 (struct iterator_stack_entry): New members bidi_p,
18942 paragraph_embedding, and from_disp_prop_p.
18943 (struct it): Member bidi_p is now a bit field 1 bit wide.
18944 (bidi_shelve_cache, bidi_unshelve_cache):
18945 Declare prototypes.
18946
18947 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18948 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18949 and vector-like objects.
18950
18951 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18952 cache around display iteration.
18953
18954 * window.c (Fwindow_end, window_scroll_pixel_based)
18955 (displayed_window_lines, Frecenter): Save and restore the bidi
18956 cache around display iteration.
18957
18958 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18959
18960 * editfns.c (Fdelete_region): Clarify the use of the named
18961 parameters (bug#6788).
18962
18963 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18964
18965 * indent.c (Fvertical_motion): Set and restore w->pointm when
18966 saving and restoring the window's buffer (Bug#9006).
18967
18968 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18969
18970 * editfns.c (Fstring_to_char): Clarify just what is returned
18971 (bug#6576). Text by Eli Zaretskii.
18972
18973 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18974
18975 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18976
18977 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18978
18979 * buffer.c (mmap_find): Fix a typo.
18980
18981 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18982
18983 Fix execution of x selection hooks.
18984 * xselect.c (Qx_lost_selection_functions)
18985 (Qx_sent_selection_functions): New vars.
18986 (syms_of_xselect): DEFSYM them.
18987 (x_handle_selection_request): Pass Qx_sent_selection_functions
18988 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18989 (x_handle_selection_clear,x_clear_frame_selections):
18990 Pass Qx_lost_selection_functions rather than
18991 Vx_lost_selection_functions to Frun_hook_with_args.
18992
18993 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18994
18995 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18996 The old code sometimes used this field without initializing it.
18997
18998 * alloc.c (gc_sweep): Don't read past end of array.
18999 In theory, the old code could also have corrupted Emacs internals,
19000 though it'd be very unlikely.
19001
19002 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
19003
19004 * character.c (Fcharacterp): Don't advertise optional ignored
19005 argument. (Bug#4026)
19006
19007 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
19008
19009 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
19010 key" (bug#4257).
19011
19012 * window.c (Fset_window_start): Doc fix (bug#4199).
19013 (Fset_window_hscroll): Ditto.
19014
19015 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
19016
19017 Fix minor new problems caught by GCC 4.6.1.
19018 * term.c (init_tty): Remove unused local.
19019 * xsettings.c (store_monospaced_changed): Define this function only
19020 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
19021 not used otherwise.
19022
19023 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
19024
19025 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
19026
19027 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
19028
19029 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
19030 are the mini-buffer and the echo area (bug#3320).
19031
19032 * term.c (init_tty): Remove support for supdup, c10 and perq
19033 terminals, which are no longer supported (bug#1482).
19034
19035 2011-07-10 Johan Bockgård <bojohan@gnu.org>
19036
19037 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19038
19039 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19040
19041 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19042 for non-popups (Bug#3642).
19043
19044 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19045
19046 * alloc.c (reset_malloc_hooks): Protoize.
19047 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19048 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19049 * cm.c (losecursor): Likewise.
19050 * data.c (fmod): Likewise.
19051 * dispnew.c (swap_glyphs_in_rows): Likewise.
19052 * emacs.c (memory_warning_signal): Likewise.
19053 * floatfns.c (float_error): Likewise.
19054 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19055 (otf_open, font_otf_capability, generate_otf_features)
19056 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19057 Likewise.
19058 * image.c (pbm_read_file): Likewise.
19059 * indent.c (string_display_width): Likewise.
19060 * intervals.c (check_for_interval, search_for_interval)
19061 (inc_interval_count, count_intervals, root_interval)
19062 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19063 * lread.c (defalias): Likewise.
19064 * ralloc.c (r_alloc_check): Likewise.
19065 * regex.c (set_image_of_range_1, set_image_of_range)
19066 (regex_grow_registers): Likewise.
19067 * sysdep.c (strerror): Likewise.
19068 * termcap.c (valid_filename_p, tprint, main): Likewise.
19069 * tparam.c (main): Likewise.
19070 * unexhp9k800.c (run_time_remap, save_data_space)
19071 (update_file_ptrs, read_header, write_header, calculate_checksum)
19072 (copy_file, copy_rest, display_header): Likewise.
19073 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19074 Likewise.
19075 * xdisp.c (check_it): Likewise.
19076 * xfaces.c (register_color, unregister_color, unregister_colors):
19077 Likewise.
19078 * xfns.c (print_fontset_result): Likewise.
19079 * xrdb.c (member, fatal, main): Likewise.
19080
19081 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19082
19083 Fix minor problems found by static checking (Bug#9031).
19084 * chartab.c (char_table_set_range, map_sub_char_table):
19085 Remove unused locals.
19086 (uniprop_table): Now static.
19087 * composite.c (_work_char): Remove unused static var.
19088
19089 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
19090
19091 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19092
19093 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19094
19095 * gtkutil.c (qttip_cb): Remove code without function.
19096
19097 2011-07-09 Eli Zaretskii <eliz@gnu.org>
19098
19099 * w32.c (pthread_sigmask): New stub.
19100
19101 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19102
19103 Use pthread_sigmask, not sigprocmask (Bug#9010).
19104 sigprocmask is portable only for single-threaded applications, and
19105 Emacs can be multi-threaded when it uses GTK.
19106 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19107 (LIBES): Use it.
19108 * callproc.c (Fcall_process):
19109 * process.c (create_process):
19110 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19111 Use pthread_sigmask, not sigprocmask.
19112
19113 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19114
19115 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19116 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19117 wrong (Bug#8591).
19118
19119 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19120
19121 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19122 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19123 (xg_hide_tooltip): Fix comment.
19124
19125 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19126 in registerServicesMenuSendTypes.
19127 (validRequestorForSendType): Don't check ns_return_types.
19128
19129 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19130 ns_return_type.
19131
19132 2011-07-08 Jason Rumney <jasonr@gnu.org>
19133
19134 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19135 SH_SHOW for hidden windows (Bug#5482).
19136
19137 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19138 frame struct members of non-existent frames (Bug#6284).
19139
19140 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19141
19142 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19143 variable firstTime not needed on OSX >= 10.6.
19144 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19145 >= 10.5. Use setKnobProportion, setDoubleValue.
19146
19147 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19148 (MAC_OS_X_VERSION_10_5): Define if not defined.
19149 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19150 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19151 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19152
19153 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19154 cString and lossyCString on OSX >= 10.4.
19155
19156 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19157 sizeToFit on OSX >= 10.2.
19158
19159 * nsimage.m (allocInitFromFile): Don't use deprecated method
19160 bestRepresentationForDevice on OSX >= 10.6.
19161
19162 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19163 to avoid warning.
19164
19165 * emacs.c: Declare unexec_init_emacs_zone.
19166
19167 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19168
19169 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19170
19171 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19172 on svcsMenu (Bug#8842).
19173
19174 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19175 ns_return_types.
19176 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19177
19178 * nsterm.m (QUTF8_STRING): Declare.
19179 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19180 (validRequestorForSendType): Return type is (id).
19181 Change indexOfObjectIdenticalTo to indexOfObject.
19182 Check if we have local selection before returning self (Bug#8842).
19183 (writeSelectionToPasteboard): Put local selection into paste board
19184 if we have a local selection (Bug#8842).
19185 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19186
19187 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19188 (ns_get_local_selection): Declare.
19189
19190 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19191
19192 * keymap.c (describe_map_tree): Don't insert a double newline at
19193 the end of the buffer (bug#1169) and return whether we inserted
19194 something.
19195
19196 * callint.c (Fcall_interactively): Change "reading args" to
19197 "providing args" to try to clarify what it does (bug#1010).
19198
19199 2011-07-07 Kenichi Handa <handa@m17n.org>
19200
19201 * composite.c (composition_compute_stop_pos): Ignore a static
19202 composition starting before CHARPOS (Bug#8915).
19203
19204 * xdisp.c (handle_composition_prop): Likewise.
19205
19206 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19207
19208 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19209 (Bug#9015)
19210
19211 2011-07-07 Kenichi Handa <handa@m17n.org>
19212
19213 * character.h (unicode_category_t): New enum type.
19214
19215 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19216 (Qchar_code_property_table): New variable.
19217 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19218 (UNIPROP_COMPRESSED_FORM_P): New macros.
19219 (char_table_ascii): Uncompress the compressed values.
19220 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19221 Uncompress the compressed values.
19222 (sub_char_table_ref_and_range): Likewise.
19223 (char_table_ref_and_range): Uncompress the compressed values.
19224 (sub_char_table_set): New arg is_uniprop. Callers changed.
19225 Uncompress the compressed values.
19226 (sub_char_table_set_range): Args changed. Callers changed.
19227 (char_table_set_range): Adjuted for the above change.
19228 (map_sub_char_table): Delete args default_val and parent. Add arg
19229 top. Give decoded values to a Lisp function.
19230 (map_char_table): Adjust for the above change. Give decoded
19231 values to a Lisp function. Gcpro more variables.
19232 (uniprop_table_uncompress)
19233 (uniprop_decode_value_run_length): New functions.
19234 (uniprop_decoder, uniprop_decoder_count): New variables.
19235 (uniprop_get_decoder, uniprop_encode_value_character)
19236 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19237 New functions.
19238 (uniprop_encoder, uniprop_encoder_count): New variables.
19239 (uniprop_get_encoder, uniprop_table)
19240 (Funicode_property_table_internal, Fget_unicode_property_internal)
19241 (Fput_unicode_property_internal): New functions.
19242 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19243 Sunicode_property_table_internal, Sget_unicode_property_internal,
19244 and Sput_unicode_property_internal. Defvar_lisp
19245 char-code-property-alist.
19246
19247 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19248 Vunicode_category_table.
19249
19250 * font.c (font_range): Adjust for the change of
19251 Vunicode_category_table.
19252
19253 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19254
19255 * m/iris4d.h: Remove file, move contents ...
19256 * s/irix6-5.h: ... here.
19257
19258 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19259
19260 Remove unportable assumption about struct layout (Bug#8884).
19261 * alloc.c (mark_buffer):
19262 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19263 (clone_per_buffer_values): Don't assume that
19264 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19265 This isn't true in general, and it's particularly not true
19266 if Emacs is configured with --with-wide-int.
19267 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19268 New macros, used in the buffer.c change.
19269
19270 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19271
19272 * xsettings.c: Use both GConf and GSettings if both are available.
19273 (store_config_changed_event): Add comment.
19274 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19275 (store_tool_bar_style_changed): New functions.
19276 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19277 (struct xsettings): Move font inside HAVE_XFT.
19278 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19279 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19280 Move inside HAVE_XFT.
19281 (something_changed_gsettingsCB): Rename from something_changedCB.
19282 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19283 also.
19284 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19285 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19286 (something_changed_gconfCB): Rename from something_changedCB.
19287 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19288 (parse_settings): Move check for font inside HAVE_XFT.
19289 (read_settings, apply_xft_settings): Add comment.
19290 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19291 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19292 call store_font_name_changed.
19293 (xft_settings_event): Add comment.
19294 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19295 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19296 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19297 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19298 (xsettings_initialize): Call init_gsettings last.
19299 (xsettings_get_system_font, xsettings_get_system_normal_font):
19300 Add comment.
19301
19302 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19303
19304 Random fixes. E.g., (random) never returned negative values.
19305 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19306 subseconds part to the entropy, as that's a bit more random.
19307 Prefer signed to unsigned, since the signedness doesn't matter and
19308 in general we prefer signed. When given a limit, use a
19309 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19310 latter isn't right if USE_2_TAGS_FOR_INTS.
19311 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19312 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19313
19314 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19315
19316 * textprop.c (text_property_stickiness):
19317 Obey Vtext_property_default_nonsticky.
19318 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19319 * w32fns.c (syms_of_w32fns):
19320 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19321
19322 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19323
19324 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19325 This is more efficient than Ffile_directory_p and avoids a minor race.
19326
19327 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19328
19329 * buffer.c (Foverlay_put): Say what the return value is
19330 (bug#7835).
19331
19332 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19333 is a directory before asking whether to use the file name
19334 (bug#7564).
19335 (barf_or_query_if_file_exists): Make the "File is a directory"
19336 error be more correct.
19337
19338 * fns.c (Frequire): Remove the mention of the .gz files, since
19339 that's installation-specific, but keep the mention of
19340 `get-load-suffixes'.
19341
19342 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19343
19344 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19345 Report string overflow if the output is too long.
19346
19347 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19348
19349 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19350 (syms_of_gnutls): Remove duplicate DEFSYM for
19351 Qgnutls_bootprop_verify_hostname_error, an error for
19352 Qgnutls_bootprop_verify_error (which is no longer used).
19353
19354 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19355 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19356 Also (re)move comments that are misplaced or no longer relevant.
19357
19358 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19359
19360 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19361
19362 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19363
19364 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19365 and background color parameters if they have been changed.
19366
19367 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19368
19369 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19370
19371 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19372
19373 * xsettings.c (SYSTEM_FONT): Define only when used.
19374 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19375
19376 * keymap.c (access_keymap_1): Now static.
19377
19378 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19379
19380 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19381 leave any prefix arg for the up event (Bug#1586).
19382
19383 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19384
19385 * lread.c (syms_of_lread): Mention single symbols defined by
19386 `defvar' or `defconst' (bug#7154).
19387
19388 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19389 (Frequire): Mention get-load-suffixes.
19390
19391 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19392
19393 * window.h (window): Remove clone_number slot.
19394 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19395 Remove.
19396 (make_parent_window, make_window, saved_window)
19397 (Fset_window_configuration, save_window_save): Don't deal with
19398 clone numbers.
19399 * buffer.c (Qclone_number): Remove declaration.
19400 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19401
19402 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19403
19404 Add multiple inheritance to keymaps.
19405 * keymap.c (Fmake_composed_keymap): New function.
19406 (Fset_keymap_parent): Simplify.
19407 (fix_submap_inheritance): Remove.
19408 (access_keymap_1): New function extracted from access_keymap to handle
19409 embedded parents and handle lists of maps.
19410 (access_keymap): Use it.
19411 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19412 (Fcopy_keymap): Handle embedded parents.
19413 (Fcommand_remapping, define_as_prefix): Simplify.
19414 (Fkey_binding): Simplify.
19415 (syms_of_keymap): Move minibuffer-local-completion-map,
19416 minibuffer-local-filename-completion-map,
19417 minibuffer-local-must-match-map, and
19418 minibuffer-local-filename-must-match-map to Elisp.
19419 (syms_of_keymap): Defsubr make-composed-keymap.
19420 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19421 (parse_menu_item): Trivial simplification.
19422
19423 2011-07-01 Glenn Morris <rgm@gnu.org>
19424
19425 * Makefile.in (SETTINGS_LIBS): Fix typo.
19426
19427 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19428
19429 * coding.c (Fencode_coding_string): Record the last coding system
19430 used, as the function doc string says (bug#8738).
19431
19432 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19433
19434 * xsettings.c (store_monospaced_changed): Take new font as arg and
19435 check for change against current_mono_font.
19436 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19437 (emacs_settings_constructor, emacs_settings_get_property)
19438 (emacs_settings_set_property, emacs_settings_class_init)
19439 (emacs_settings_init, gsettings_obj): Remove.
19440 (something_changedCB): New function for HAVE_GSETTINGS.
19441 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19442 with value as argument.
19443 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19444 g_settings_new (Bug#8967). Do not create gsettings_obj.
19445 Remove calls to g_settings_bind. Connect something_changedCB to
19446 "changed".
19447
19448 * xgselect.c: Add defined (HAVE_GSETTINGS).
19449 (xgselect_initialize): Ditto.
19450
19451 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19452 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19453 xg_select.
19454
19455 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19456
19457 * eval.c (struct backtrace): Simplify and port the data structure.
19458 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19459 signed bit field, as this assumption is not portable and it makes
19460 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19461 "char debug_on_exit : 1" as this is not portable either; instead,
19462 use the portable "unsigned int debug_on_exit : 1". Remove unused
19463 member evalargs. Remove obsolete comments about cc bombing out.
19464
19465 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19466
19467 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19468 Let HAVE_GSETTINGS override HAVE_GCONF.
19469 (store_monospaced_changed): New function.
19470 (EMACS_SETTINGS): A new type derived from GObject to handle
19471 GSettings notifications.
19472 (emacs_settings_constructor, emacs_settings_get_property)
19473 (emacs_settings_set_property, emacs_settings_class_init):
19474 New functions.
19475 (gsettings_client, gsettings_obj): New variables.
19476 (GSETTINGS_SCHEMA): New define.
19477 (something_changedCB): Call store_monospaced_changed.
19478 (init_gsettings): New function.
19479 (xsettings_initialize): Call init_gsettings.
19480 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19481 to NULL.
19482
19483 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19484 GCONF_CFLAGS/LIBS.
19485
19486 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19487
19488 * window.c (resize_root_window, grow_mini_window)
19489 (shrink_mini_window): Rename Qresize_root_window to
19490 Qwindow_resize_root_window and Qresize_root_window_vertically to
19491 Qwindow_resize_root_window_vertically.
19492
19493 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19494
19495 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19496
19497 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19498
19499 * makefile.w32-in: Redesign dependencies so they reflect more
19500 clearly which files are directly included by each source file,
19501 and not through other includes.
19502
19503 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19504
19505 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19506 (sort_overlays, overlay_strings): When an overlay's clone number
19507 matches the window's clone number process the overlay even if
19508 the overlay's window property doesn't match the current window.
19509
19510 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19511 (Fwindow_hchild): Rename to Fwindow_left_child.
19512 (Fwindow_next): Rename to Fwindow_next_sibling.
19513 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19514 (resize_window_check): Rename to window_resize_check.
19515 (resize_window_apply): Rename to window_resize_apply.
19516 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19517 (Fdelete_other_windows_internal, resize_frame_windows)
19518 (Fsplit_window_internal, Fdelete_window_internal)
19519 (grow_mini_window, shrink_mini_window)
19520 (Fresize_mini_window_internal): Fix callers accordingly.
19521
19522 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19523
19524 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19525 (emacs_fixed_set_min_size): Remove.
19526 (emacs_fixed_new): Take frame as argument.
19527
19528 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19529 (_EmacsFixedPrivate): Remove minwidth/height.
19530 Add struct frame *f.
19531 (emacs_fixed_init): Initialize priv->f.
19532 (get_parent_class, emacs_fixed_set_min_size): Remove.
19533 (emacs_fixed_new): Set priv->f to argument.
19534 (emacs_fixed_get_preferred_width)
19535 (emacs_fixed_get_preferred_height): Use min_width/height from
19536 frames size_hint to set minimum and natural (Bug#8919).
19537 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19538 and use min_width/height from frames size_hint to set
19539 min_width/height (Bug#8919).
19540
19541 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19542 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19543 Fix indentation.
19544
19545 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19546
19547 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19548 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19549 called at ZV.
19550
19551 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19552
19553 * process.c (wait_reading_process_output): Bypass select if
19554 waiting for a cell while ignoring keyboard input, and input is
19555 pending. Suggested by Jan Djärv (Bug#8869).
19556
19557 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19558
19559 Use gnulib's dup2 module instead of rolling our own.
19560 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19561
19562 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19563
19564 * dispnew.c (scrolling_window): Before scrolling, turn off a
19565 mouse-highlight in the window being scrolled.
19566
19567 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19568
19569 Move DEFSYM to lisp.h and use everywhere.
19570
19571 * character.h (DEFSYM): Move declaration...
19572 * lisp.h (DEFSYM): ...here.
19573
19574 * gnutls.c:
19575 * minibuf.c:
19576 * w32menu.c:
19577 * w32proc.c:
19578 * w32select.c: Don't include character.h.
19579
19580 * alloc.c (syms_of_alloc):
19581 * buffer.c (syms_of_buffer):
19582 * bytecode.c (syms_of_bytecode):
19583 * callint.c (syms_of_callint):
19584 * casefiddle.c (syms_of_casefiddle):
19585 * casetab.c (init_casetab_once):
19586 * category.c (init_category_once, syms_of_category):
19587 * ccl.c (syms_of_ccl):
19588 * cmds.c (syms_of_cmds):
19589 * composite.c (syms_of_composite):
19590 * dbusbind.c (syms_of_dbusbind):
19591 * dired.c (syms_of_dired):
19592 * dispnew.c (syms_of_display):
19593 * doc.c (syms_of_doc):
19594 * editfns.c (syms_of_editfns):
19595 * emacs.c (syms_of_emacs):
19596 * eval.c (syms_of_eval):
19597 * fileio.c (syms_of_fileio):
19598 * fns.c (syms_of_fns):
19599 * frame.c (syms_of_frame):
19600 * fringe.c (syms_of_fringe):
19601 * insdel.c (syms_of_insdel):
19602 * keymap.c (syms_of_keymap):
19603 * lread.c (init_obarray, syms_of_lread):
19604 * macros.c (syms_of_macros):
19605 * msdos.c (syms_of_msdos):
19606 * print.c (syms_of_print):
19607 * process.c (syms_of_process):
19608 * search.c (syms_of_search):
19609 * sound.c (syms_of_sound):
19610 * syntax.c (init_syntax_once, syms_of_syntax):
19611 * terminal.c (syms_of_terminal):
19612 * textprop.c (syms_of_textprop):
19613 * undo.c (syms_of_undo):
19614 * w32.c (globals_of_w32):
19615 * window.c (syms_of_window):
19616 * xdisp.c (syms_of_xdisp):
19617 * xfaces.c (syms_of_xfaces):
19618 * xfns.c (syms_of_xfns):
19619 * xmenu.c (syms_of_xmenu):
19620 * xsettings.c (syms_of_xsettings):
19621 * xterm.c (syms_of_xterm): Use DEFSYM.
19622
19623 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19624
19625 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19626
19627 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19628
19629 Integer and buffer overflow fixes (Bug#8873).
19630
19631 * print.c (printchar, strout): Check for string overflow.
19632 (PRINTPREPARE, printchar, strout):
19633 Don't set size unless allocation succeeds.
19634
19635 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19636 for sizes. Check for string overflow more accurately.
19637 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19638
19639 * macros.c: Integer and buffer overflow fixes.
19640 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19641 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19642 Use ptrdiff_t, not int, for sizes.
19643 Don't increment bufsize until after realloc succeeds.
19644 Check for size-calculation overflow.
19645 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19646
19647 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19648
19649 * lread.c: Integer overflow fixes.
19650 (read_integer): Radix is now EMACS_INT, not int,
19651 to improve quality of diagnostics for out-of-range radices.
19652 Calculate buffer size correctly for out-of-range radices.
19653 (read1): Check for integer overflow in radices, and in
19654 read-circle numbers.
19655 (read_escape): Avoid int overflow.
19656 (Fload, openp, read_buffer_size, read1)
19657 (substitute_object_recurse, read_vector, read_list, map_obarray):
19658 Use ptrdiff_t, not int, for sizes.
19659 (read1): Use EMACS_INT, not int, for sizes.
19660 Check for size overflow.
19661
19662 * image.c (cache_image): Check for size arithmetic overflow.
19663
19664 * lread.c: Integer overflow issues.
19665 (saved_doc_string_size, saved_doc_string_length)
19666 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19667 Now ptrdiff_t, not int.
19668 (read1): Don't assume doc string length fits in int. Check for
19669 out-of-range doc string lengths.
19670 (read_list): Don't assume file position fits in int.
19671 (read_escape): Check for hex character overflow.
19672
19673 2011-06-22 Leo Liu <sdl.web@gmail.com>
19674
19675 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19676 Move to minibuffer.el.
19677
19678 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19679
19680 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19681 The following patches are for when GLYPH_DEBUG && !XASSERT.
19682 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19683 * dispnew.c (flush_stdout):
19684 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19685 Mark as externally visible.
19686 * dispnew.c (check_window_matrix_pointers): Now static.
19687 * dispnew.c (window_to_frame_vpos):
19688 * xfns.c (unwind_create_frame):
19689 * xterm.c (x_check_font): Remove unused local.
19690 * scroll.c (CHECK_BOUNDS):
19691 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19692 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19693 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19694 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19695 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19696 Now static.
19697 (debug_method_add): Use va_list and vsprintf rather than relying
19698 on undefined behavior with wrong number of arguments.
19699 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19700 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19701 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19702 since we're not interested in debugging glyphs with old libraries.
19703 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19704 GCC 4.6.0's static checking.
19705
19706 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19707
19708 Integer overflow and signedness fixes (Bug#8873).
19709 A few related buffer overrun fixes, too.
19710
19711 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19712
19713 * dispextern.h (struct face.stipple):
19714 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19715 (x_bitmap_mask, x_allocate_bitmap_record)
19716 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19717 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19718 (x_create_bitmap_from_xpm_data):
19719 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19720 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19721 (.bitmaps_last):
19722 * xfaces.c (load_pixmap):
19723 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19724 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19725 (.bitmaps_last, struct x_output.icon_bitmap):
19726 Use ptrdiff_t, not int, for bitmap indexes.
19727 (x_allocate_bitmap_record): Check for size overflow.
19728 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19729
19730 Use ptrdiff_t, not int, for overlay counts.
19731 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19732 * editfns.c (overlays_around, get_pos_property):
19733 * textprop.c (get_char_property_and_overlay):
19734 * xdisp.c (next_overlay_change, note_mouse_highlight):
19735 * xfaces.c (face_at_buffer_position):
19736 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19737 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19738 (Fnext_overlay_change, Fprevious_overlay_change)
19739 (mouse_face_overlay_overlaps, Foverlays_in):
19740 Use ptrdiff_t, not int, for sizes.
19741 (overlays_at, overlays_in): Check for size-calculation overflow.
19742
19743 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19744
19745 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19746 (x_session_initialize): Do not assume string length fits in int.
19747
19748 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19749 This is unlikely, but can occur if DPI is outlandish.
19750
19751 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19752 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19753
19754 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19755 * xrdb.c (magic_file_p, search_magic_path):
19756 Omit last arg SUFFIX; it was always 0. All callers changed.
19757 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19758
19759 * xfont.c (xfont_match): Avoid need for strlen.
19760
19761 * xfns.c: Don't assume strlen fits in int.
19762 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19763
19764 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19765 not unsigned long, as we prefer signed integers. All callers changed.
19766 Detect integer overflow in repeat count.
19767 (message_dolog): Don't assume print length fits in 39 bytes.
19768 (display_mode_element): Don't assume strlen fits in int.
19769
19770 * termcap.c: Don't assume sizes fit in int and never overflow.
19771 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19772 (gobble_line): Check for size-calculation overflow.
19773
19774 * minibuf.c (Fread_buffer):
19775 * lread.c (intern, intern_c_string):
19776 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19777 Don't assume string length fits in int.
19778
19779 * keyboard.c (parse_tool_bar_item):
19780 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19781
19782 * font.c: Don't assume string length fits in int.
19783 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19784 Use ptrdiff_t, not int.
19785 (font_intern_prop): Don't assume string length fits in int.
19786 Don't assume integer property fits in fixnum.
19787 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19788
19789 * filelock.c: Fix some buffer overrun and integer overflow issues.
19790 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19791 Reformulate so as not to need the command string.
19792 Invoke gzip -cd rather than gunzip, as it's more portable.
19793 (lock_info_type, lock_file_1, lock_file):
19794 Don't assume pid_t and time_t fit in unsigned long.
19795 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19796 (current_lock_owner): Prefer signed type for sizes.
19797 Use memcpy, not strncpy, where memcpy is what is really wanted.
19798 Don't assume (via atoi) that time_t and pid_t fit in int.
19799 Check for time_t and/or pid_t out of range, e.g., via a network share.
19800 Don't alloca where an auto var works fine.
19801
19802 * fileio.c: Fix some integer overflow issues.
19803 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19804 Don't assume string length fits in int.
19805 (directory_file_name): Don't assume string length fits in long.
19806 (make_temp_name): Don't assume pid fits in int, or that its print
19807 length is less than 20.
19808
19809 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19810
19811 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19812
19813 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19814
19815 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19816 We prefer signed integers, even for size calculations.
19817
19818 * emacs.c: Don't assume string length fits in 'int'.
19819 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19820 (main): Don't invoke strlen when not needed.
19821
19822 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19823 (XD_DEBUG_MESSAGE): Don't waste a byte.
19824
19825 * callproc.c (getenv_internal_1, getenv_internal)
19826 (Fgetenv_internal):
19827 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19828
19829 * lread.c (invalid_syntax): Omit length argument.
19830 All uses changed. This doesn't fix a bug, but it simplifies the
19831 code away from its former Hollerith-constant appearance, and it's
19832 one less 'int' to worry about when looking at integer-overflow issues.
19833 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19834
19835 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19836 This didn't break anything, but it didn't help either.
19837 It's confusing to put a bogus integer in a place where the actual
19838 value does not matter.
19839 (LIST_END_P): Remove unused macro and its bogus comment.
19840 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19841
19842 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19843 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19844 implementation.
19845 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19846 We prefer signed types, and the value cannot exceed the EMACS_INT
19847 range anyway (because otherwise the length would not be representable).
19848 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19849 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19850 This avoids a GCC warning when WIDE_EMACS_INT.
19851
19852 * indent.c (sane_tab_width): New function.
19853 (current_column, scan_for_column, Findent_to, position_indentation)
19854 (compute_motion): Use it. This is just for clarity.
19855 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19856
19857 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19858
19859 * lisp.h (lint_assume): New macro.
19860 * composite.c (composition_gstring_put_cache):
19861 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19862
19863 * editfns.c, insdel.c:
19864 Omit unnecessary forward decls, to simplify future changes.
19865
19866 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19867
19868 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19869
19870 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19871 Use much-faster test for byte-length change.
19872 Don't assume string byte-length fits in 'int'.
19873 Check that character arg fits in 'int'.
19874 (mapcar1): Declare byte as byte, for clarity.
19875
19876 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19877
19878 * fns.c (concat): Catch string overflow earlier.
19879 Do not rely on integer wraparound.
19880
19881 * dispextern.h (struct it.overlay_strings_charpos)
19882 (struct it.selective): Now EMACS_INT, not int.
19883 * xdisp.c (forward_to_next_line_start)
19884 (back_to_previous_visible_line_start)
19885 (reseat_at_next_visible_line_start, next_element_from_buffer):
19886 Don't arbitrarily truncate the value of 'selective' to int.
19887
19888 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19889
19890 * composite.c: Don't truncate sizes to 'int'.
19891 (composition_gstring_p, composition_reseat_it)
19892 (composition_adjust_point): Use EMACS_INT, not int.
19893 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19894 not EMACS_UINT, for indexes.
19895
19896 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19897
19898 * buffer.c: Include <verify.h>.
19899 (struct sortvec.priority, struct sortstr.priority):
19900 Now EMACS_INT, not int.
19901 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19902 (struct sortstr.size, record_overlay_string)
19903 (struct sortstrlist.size, struct sortlist.used):
19904 Don't truncate size to int.
19905 (record_overlay_string): Check for size-calculation overflow.
19906 (init_buffer_once): Check at compile-time, not run-time.
19907
19908 2011-06-22 Jim Meyering <meyering@redhat.com>
19909
19910 Don't leak an XBM-image-sized buffer
19911 * image.c (xbm_load): Free the image buffer after using it.
19912
19913 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19914
19915 Port to Sun C.
19916 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19917 that Sun C diagnosed.
19918 * fns.c (secure_hash): Fix pointer signedness issue.
19919 * intervals.c (static_offset_intervals): New function.
19920 (offset_intervals): Use it.
19921
19922 2011-06-21 Leo Liu <sdl.web@gmail.com>
19923
19924 * deps.mk (fns.o):
19925 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19926 sha512.h.
19927
19928 * fns.c (secure_hash): Rename from crypto_hash_function and change
19929 the first arg to accept symbols.
19930 (Fsecure_hash): New primitive.
19931 (syms_of_fns): New symbols.
19932
19933 2011-06-20 Deniz Dogan <deniz@dogan.se>
19934
19935 * process.c (Fset_process_buffer): Clarify return value in
19936 docstring.
19937
19938 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19939
19940 * dispnew.c (add_window_display_history): Use BVAR.
19941
19942 * xdisp.c (debug_method_add): Use BVAR.
19943 (check_window_end, dump_glyph_matrix, dump_glyph)
19944 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19945
19946 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19947 Likewise.
19948
19949 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19950 check till after the cache is created in init_frame_faces.
19951
19952 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19953
19954 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19955
19956 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19957
19958 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19959 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19960 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19961
19962 Improve buffer-overflow checking (Bug#8873).
19963 * fileio.c (Finsert_file_contents):
19964 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19965 Remove the old (too-loose) buffer overflow checks.
19966 They weren't needed, since make_gap checks for buffer overflow.
19967 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19968 The old code merely checked for Emacs fixnum overflow, and relied
19969 on undefined (wraparound) behavior. The new code avoids undefined
19970 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19971
19972 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19973 Tune. Don't use wider integers than needed. Don't use alloca.
19974 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19975
19976 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19977
19978 * insdel.c, lisp.h (buffer_overflow): New function.
19979 (insert_from_buffer_1, replace_range, replace_range_2):
19980 * insdel.c (make_gap_larger):
19981 * editfns.c (Finsert_char):
19982 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19983
19984 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19985
19986 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19987
19988 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19989
19990 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19991 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19992
19993 * fileio.c: Don't assume EMACS_INT fits in off_t.
19994 (emacs_lseek): New static function.
19995 (Finsert_file_contents, Fwrite_region): Use it.
19996 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19997
19998 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19999
20000 * fns.c: Don't overflow int when computing a list length.
20001 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
20002 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
20003 truncation on 64-bit hosts. Check for QUIT every
20004 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
20005 faster and is responsive enough.
20006 (Flength): Report an error instead of overflowing an integer.
20007 (Fsafe_length): Return a float if the value is not representable
20008 as a fixnum. This shouldn't happen except in contrived situations.
20009 (Fnthcdr, Fsort): Don't assume list length fits in int.
20010 (Fcopy_sequence): Don't assume vector length fits in int.
20011
20012 * alloc.c: Check that resized vectors' lengths fit in fixnums.
20013 (header_size, word_size): New constants.
20014 (allocate_vectorlike): Don't check size overflow here.
20015 (allocate_vector): Check it here instead, since this is the only
20016 caller of allocate_vectorlike that could cause overflow.
20017 Check that the new vector's length is representable as a fixnum.
20018
20019 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
20020 The previous code was bogus. For example, next_almost_prime (32)
20021 returned 39, which is undesirable as it is a multiple of 3; and
20022 next_almost_prime (24) returned 25, which is a multiple of 5 so
20023 why was the code bothering to check for multiples of 7?
20024
20025 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
20026
20027 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
20028
20029 Variadic C functions now count arguments with ptrdiff_t.
20030 This partly undoes my 2011-03-30 change, which replaced int with size_t.
20031 Back then I didn't know that the Emacs coding style prefers signed int.
20032 Also, in the meantime I found a few more instances where arguments
20033 were being counted with int, which may truncate counts on 64-bit
20034 machines, or EMACS_INT, which may be unnecessarily wide.
20035 * lisp.h (struct Lisp_Subr.function.aMANY)
20036 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20037 Arg counts are now ptrdiff_t, not size_t.
20038 All variadic functions and their callers changed accordingly.
20039 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20040 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20041 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20042 * callint.c (Fcall_interactively): Check arg count for overflow,
20043 to avoid potential buffer overrun. Use signed char, not 'int',
20044 for 'varies' array, so that we needn't bother to check its size
20045 calculation for overflow.
20046 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20047 * eval.c (apply_lambda):
20048 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20049 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20050 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20051
20052 * callint.c (Fcall_interactively): Don't use index var as event count.
20053
20054 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20055 * mem-limits.h (SIZE): Remove; no longer used.
20056
20057 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20058
20059 Remove unnecessary casts.
20060 * xterm.c (x_term_init):
20061 * xfns.c (x_set_border_pixel):
20062 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20063 These aren't needed now that we assume ANSI C.
20064
20065 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20066 It's more likely to cause problems (due to unsigned overflow)
20067 than to cure them.
20068
20069 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20070
20071 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20072
20073 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20074
20075 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20076
20077 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20078
20079 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20080
20081 GLYPH_CODE_FACE returns EMACS_INT, not int.
20082 * dispextern.h (merge_faces):
20083 * xfaces.c (merge_faces):
20084 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20085 Don't assume EMACS_INT fits in int.
20086
20087 * character.h (CHAR_VALID_P): Remove unused parameter.
20088 * fontset.c, lisp.h, xdisp.c: All uses changed.
20089
20090 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20091
20092 * fns.c (concat): Minor tuning based on overflow analysis.
20093 This doesn't fix any bugs. Use int to hold character, instead
20094 of constantly refetching from Emacs object. Use XFASTINT, not
20095 XINT, for value known to be a character. Don't bother comparing
20096 a single byte to 0400, as it's always less.
20097
20098 * floatfns.c (Fexpt):
20099 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20100
20101 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20102 for characters.
20103
20104 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20105
20106 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20107 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20108 incorrectly succeed when S was a string, because 4294967386 was
20109 truncated before it was used.
20110
20111 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20112 Otherwise, an out-of-range integer could cause undefined behavior
20113 on a 64-bit host.
20114
20115 * composite.c: Use int, not EMACS_INT, for characters.
20116 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20117 EMACS_INT, for values that are known to be in character range.
20118 This doesn't fix any bugs but is the usual style inside Emacs and
20119 may generate better code on 32-bit machines.
20120
20121 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20122 This is for reasons similar to the recent CHAR_STRING fix.
20123 * charset.c (Fencode_char): Check that character arg is actually
20124 a character. Pass an int to ENCODE_CHAR.
20125 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20126 wider than 'int', as a compile-time check to prevent future regressions
20127 in this area.
20128
20129 * character.c (char_string): Remove unnecessary casts.
20130
20131 Make sure a 64-bit char is never passed to CHAR_STRING.
20132 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20133 by silently ignoring the top 32 bits, allowing some values
20134 that were far too large to be valid characters.
20135 * character.h: Include <verify.h>.
20136 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20137 arguments are no wider than unsigned, as a compile-time check
20138 to prevent future regressions in this area.
20139 * data.c (Faset):
20140 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20141 (Fsubst_char_in_region):
20142 * fns.c (concat):
20143 * xdisp.c (decode_mode_spec_coding):
20144 Adjust to CHAR_STRING's new requirement.
20145 * editfns.c (Finsert_char, Fsubst_char_in_region):
20146 * fns.c (concat): Check that character args are actually
20147 characters. Without this test, these functions did the wrong
20148 thing with wildly out-of-range values on 64-bit hosts.
20149
20150 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20151 These casts should not be needed on 32-bit hosts, either.
20152 * keyboard.c (read_char):
20153 * lread.c (Fload): Remove casts to unsigned.
20154
20155 * lisp.h (UNSIGNED_CMP): New macro.
20156 This fixes comparison bugs on 64-bit hosts.
20157 (ASCII_CHAR_P): Use it.
20158 * casefiddle.c (casify_object):
20159 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20160 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20161 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20162 * dispextern.h (FACE_FROM_ID):
20163 * keyboard.c (read_char): Use UNSIGNED_CMP.
20164
20165 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20166 not to EMACS_INT, to avoid GCC warning.
20167
20168 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20169
20170 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20171 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20172 isn't needed on 32-bit machines.
20173
20174 * buffer.c (Fgenerate_new_buffer_name):
20175 Use EMACS_INT for count, not int.
20176 (advance_to_char_boundary): Return EMACS_INT, not int.
20177
20178 * data.c (Qcompiled_function): Now static.
20179
20180 * window.c (window_body_lines): Now static.
20181
20182 * image.c (gif_load): Rename local to avoid shadowing.
20183
20184 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20185 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20186 * alloc.c (make_save_value): Integer argument is now of type
20187 ptrdiff_t, not int.
20188 (mark_object): Use ptrdiff_t, not int.
20189 * lisp.h (pD): New macro.
20190 * print.c (print_object): Use it.
20191
20192 * alloc.c: Use EMACS_INT, not int, to count objects.
20193 (total_conses, total_markers, total_symbols, total_vector_size)
20194 (total_free_conses, total_free_markers, total_free_symbols)
20195 (total_free_floats, total_floats, total_free_intervals)
20196 (total_intervals, total_strings, total_free_strings):
20197 Now EMACS_INT, not int. All uses changed.
20198 (Fgarbage_collect): Compute overall total using a double, so that
20199 integer overflow is less likely to be a problem. Check for overflow
20200 when converting back to an integer.
20201 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20202 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20203 These were 'int' variables that could overflow on 64-bit hosts;
20204 they were never used, so remove them instead of repairing them.
20205 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20206 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20207 Previously, this ceilinged at INT_MAX, but that doesn't work on
20208 64-bit machines.
20209 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20210
20211 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20212 (allocate_vectorlike): Check for ptrdiff_t overflow.
20213 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20214 when a (possibly-narrower) signed value would do just as well.
20215 We prefer using signed arithmetic, to avoid comparison confusion.
20216
20217 * alloc.c: Catch some string size overflows that we were missing.
20218 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20219 for convenience in STRING_BYTES_MAX.
20220 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20221 The definition here is exact; the one in lisp.h was approximate.
20222 (allocate_string_data): Check for string overflow. This catches
20223 some instances we weren't catching before. Also, it catches
20224 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20225 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20226 and ptrdiff_t and EMACS_INT are both 64 bits.
20227
20228 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20229 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20230 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20231
20232 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20233
20234 * alloc.c (Fmake_string): Check for out-of-range init.
20235
20236 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20237
20238 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20239
20240 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20241
20242 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20243 xg_get_default_scrollbar_width.
20244
20245 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20246 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20247 (style_changed_cb): Call update_theme_scrollbar_width and call
20248 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20249 all frames (Bug#8505).
20250 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20251 Call gtk_window_set_resizable if HAVE_GTK3.
20252 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20253 and height if HAVE_GTK3 (Bug#8505).
20254 (scroll_bar_width_for_theme): New variable.
20255 (update_theme_scrollbar_width): New function.
20256 (xg_get_default_scrollbar_width): Move code to
20257 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20258 (xg_initialize): Call update_theme_scrollbar_width.
20259
20260 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20261
20262 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20263
20264 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20265
20266 * frame.c (make_frame): Call other_buffer_safely instead of
20267 other_buffer.
20268
20269 * window.c (temp_output_buffer_show): Call display_buffer with
20270 second argument Vtemp_buffer_show_specifiers and reset latter
20271 immediately after the call.
20272 (Vtemp_buffer_show_specifiers): New variable.
20273 (auto_window_vscroll_p, next_screen_context_lines)
20274 (Vscroll_preserve_screen_position): Remove leading asterisks from
20275 doc-strings.
20276
20277 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20278
20279 Fix minor problems found by GCC 4.6.0 static checking.
20280 * buffer.c (Qclone_number): Remove for now, as it's unused.
20281 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20282 (record_buffer): Remove unused local.
20283 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20284 (set_frame_buffer_list): Remove; unused.
20285 * frame.h (other_visible_frames): Remove decl.
20286 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20287 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20288 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20289 if HAVE_GPM.
20290 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20291 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20292 Define only if HAVE_GPM.
20293 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20294 (update_hints_inhibit): Remove; never set. All uses removed.
20295 * widgetprv.h (emacsFrameClassRec): Remove decl.
20296 * window.c (delete_deletable_window): Now returns void, since it
20297 wasn't returning anything.
20298 (compare_window_configurations): Remove unused locals.
20299 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20300 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20301 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20302 the same widths as pointers. This follows up on the 2011-05-06 patch.
20303 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20304 * xterm.h: Likewise.
20305 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20306
20307 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20308
20309 * makefile.w32-in: Update dependencies.
20310 (LISP_H): Add lib/intprops.h.
20311
20312 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20313
20314 * image.c (gif_load): Add animation frame delay to the metadata.
20315 (syms_of_image): Use DEFSYM. New symbol `delay'.
20316
20317 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20318
20319 * window.c (delete_deletable_window): Re-add.
20320 (Fset_window_configuration): Rewrite to handle dead buffers and
20321 consequently deletable windows.
20322 (window_tree, Fwindow_tree): Remove. Supply functionality in
20323 window.el.
20324 (compare_window_configurations): Simplify code.
20325
20326 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20327
20328 * image.c (imagemagick_load_image): Fix type mismatch.
20329 (Fimagemagick_types): Likewise.
20330
20331 * window.h (replace_buffer_in_windows): Declare.
20332
20333 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20334
20335 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20336 Qclone_number. Remove external declaration of Qdelete_window.
20337 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20338 code.
20339 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20340 Run Qbuffer_list_update_hook if allowed.
20341 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20342 buffer list implementation.
20343 (other_buffer_safely): New function.
20344 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20345 calls to replace_buffer_in_windows and
20346 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20347 if allowed.
20348 (record_buffer): Inhibit quitting and rewrite using quittable
20349 functions. Run Qbuffer_list_update_hook if allowed.
20350 (Frecord_buffer, Funrecord_buffer): New functions.
20351 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20352 Move switch-to-buffer to window.el.
20353 (bury-buffer): Move to window.el.
20354 (Vbuffer_list_update_hook): New variable.
20355
20356 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20357 section.
20358
20359 * window.h (resize_frame_windows): Move up in code.
20360 (Fwindow_frame): Remove EXFUN.
20361 (replace_buffer_in_all_windows): Remove prototype.
20362 (replace_buffer_in_windows_safely): Add prototype.
20363
20364 * window.c: Declare Qdelete_window static again. Move down
20365 declaration of select_count.
20366 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20367 (Fother_window): Move to window.el.
20368 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20369 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20370 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20371 window.el.
20372 (replace_buffer_in_windows): Implement by calling
20373 Qreplace_buffer_in_windows.
20374 (replace_buffer_in_all_windows): Remove with some functionality
20375 moved into replace_buffer_in_windows_safely.
20376 (replace_buffer_in_windows_safely): New function.
20377 (select_window_norecord, select_frame_norecord): Move in front
20378 of run_window_configuration_change_hook. Remove now obsolete
20379 declarations.
20380 (Fset_window_buffer): Rewrite doc-string.
20381 Call Qrecord_window_buffer.
20382 (keys_of_window): Move binding for other-window to window.el.
20383
20384 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20385
20386 * dispextern.h (struct image): Replace data member, whose int_val
20387 and ptr_val fields were not used by anything, with a single
20388 lisp_val object.
20389
20390 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20391 (gif_clear_image, gif_load, imagemagick_load_image)
20392 (gs_clear_image, gs_load): Callers changed.
20393
20394 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20395
20396 * buffer.h: Include <time.h>, for time_t.
20397 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20398
20399 Fix minor problems found by static checking.
20400
20401 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20402
20403 Make identifiers static if they are not used in other modules.
20404 * data.c (Qcompiled_function, Qframe, Qvector):
20405 * image.c (QimageMagick, Qsvg):
20406 * minibuf.c (Qmetadata):
20407 * window.c (resize_window_check, resize_root_window): Now static.
20408 * window.h (resize_window_check, resize_root_window): Remove decls.
20409
20410 * window.c (window_deletion_count, delete_deletable_window):
20411 Remove; unused.
20412 (window_body_lines): Now static.
20413 (Fdelete_other_windows_internal): Mark vars as initialized.
20414 Make sure 'resize_failed' is initialized.
20415 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20416 (resize_window_apply): Remove unused local.
20417 * window.h (delete_deletable_window): Remove decl.
20418
20419 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20420 (imagemagick_load_image): Fix pointer signedness problem by changing
20421 last arg from unsigned char * to char *. All uses changed.
20422 Also, fix a local for similar reasons.
20423 Remove unused locals. Remove locals to avoid shadowing.
20424 (fn_rsvg_handle_free): Remove; unused.
20425 (svg_load, svg_load_image): Fix pointer signedness problem.
20426 (imagemagick_load_image): Don't use garbage pointer image_wand.
20427
20428 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20429
20430 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20431
20432 * image.c (gif_load): Fix omitted cast error introduced by
20433 2011-06-06 change.
20434
20435 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20436
20437 * window.h (resize_proportionally, orig_total_lines)
20438 (orig_top_line): Remove from window structure.
20439 (set_window_height, set_window_width, change_window_heights)
20440 (Fdelete_window): Remove prototypes.
20441 (resize_frame_windows): Remove duplicate declaration.
20442
20443 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20444
20445 * window.h (resize_frame_windows, resize_window_check)
20446 (delete_deletable_window, resize_root_window)
20447 (resize_frame_windows): Declare prototypes.
20448
20449 * window.c (resize_window_apply): Make definition be "static" to
20450 match the prototype.
20451
20452 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20453
20454 * window.c: Remove declarations of Qwindow_size_fixed,
20455 window_min_size_1, window_min_size_2, window_min_size,
20456 size_window, window_fixed_size_p, enlarge_window, delete_window.
20457 Remove static from declaration of Qdelete_window, it's
20458 temporarily needed by Fbury_buffer.
20459 (replace_window): Don't assign orig_top_line and
20460 orig_total_lines.
20461 (Fdelete_window, delete_window): Remove. Window deletion is
20462 handled by window.el.
20463 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20464 Replace Fdelete_window calls with calls to Qdelete_window.
20465 (Fdelete_other_windows): Remove. Deleting other windows is
20466 handled by window.el.
20467 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20468 handled in window.el.
20469 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20470 Window minimum sizes are handled in window.el.
20471 (shrink_windows, size_window, set_window_height)
20472 (set_window_width, change_window_heights, window_height)
20473 (window_width, CURBEG, CURSIZE, enlarge_window)
20474 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20475 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20476 handled in window.el.
20477 (make_dummy_parent): Rename to make_parent_window and give it a
20478 second argument horflag.
20479 (make_window): Don't set resize_proportionally any more.
20480 (Fsplit_window): Remove. Windows are split in window.el.
20481 (save_restore_action, save_restore_orig_size)
20482 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20483 Resize mini windows in window.el.
20484 (grow_mini_window, shrink_mini_window): Implement by calling
20485 Qresize_root_window_vertically, resize_window_check and
20486 resize_window_apply.
20487 (saved_window, Fset_window_configuration, save_window_save):
20488 Do not handle orig_top_line, orig_total_lines, and
20489 resize_proportionally.
20490 (window_min_height, window_min_width): Move to window.el.
20491 (keys_of_window): Move bindings for delete-other-windows,
20492 split-window, delete-window and enlarge-window to window.el.
20493
20494 * buffer.c: Temporarily extern Qdelete_window.
20495 (Fbury_buffer): Temporarily call Qdelete_window instead of
20496 Fdelete_window (Fbury_buffer will move to window.el soon).
20497
20498 * frame.c (set_menu_bar_lines_1): Remove code handling
20499 orig_top_line and orig_total_lines.
20500
20501 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20502 set_window_height but set heights directly.
20503 (change_frame_size_1): Use resize_frame_windows.
20504
20505 * xdisp.c (init_xdisp): Don't use set_window_height but set
20506 heights directly.
20507
20508 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20509 Use resize_frame_windows instead of change_window_heights and run
20510 run_window_configuration_change_hook.
20511
20512 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20513 instead of change_window_heights and run
20514 run_window_configuration_change_hook.
20515
20516 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20517
20518 * window.c (replace_window): Rename second argument REPLACEMENT to
20519 NEW. New third argument SETFLAG. Rewrite.
20520 (delete_window, make_dummy_parent): Call replace_window with
20521 third argument 1.
20522 (window_list_1): Move down in code.
20523 (run_window_configuration_change_hook): Move set_buffer part
20524 before select_frame_norecord part in order to unwind correctly.
20525 Rename count1 to count.
20526 (recombine_windows, delete_deletable_window, resize_root_window)
20527 (Fdelete_other_windows_internal)
20528 (Frun_window_configuration_change_hook, make_parent_window)
20529 (resize_window_check, resize_window_apply, Fresize_window_apply)
20530 (resize_frame_windows, Fsplit_window_internal)
20531 (Fdelete_window_internal, Fresize_mini_window_internal):
20532 New functions.
20533 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20534
20535 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20536
20537 * window.h (window): Add some new members to window structure -
20538 normal_lines, normal_cols, new_total, new_normal, clone_number,
20539 splits, nest, prev_buffers, next_buffers.
20540 (WINDOW_TOTAL_SIZE): Move here from window.c.
20541 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20542
20543 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20544 Remove.
20545 (make_dummy_parent): Set new members of windows structure.
20546 (make_window): Move down in code. Handle new members of window
20547 structure.
20548 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20549 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20550 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20551 (Fset_window_prev_buffers, Fwindow_next_buffers)
20552 (Fset_window_next_buffers, Fset_window_clone_number):
20553 New functions.
20554 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20555 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20556 Doc-string fixes.
20557 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20558 Argument WINDOW can be now internal window too.
20559 (Fwindow_use_time): Move up in code.
20560 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20561 Rewrite doc-string.
20562 (Fset_window_configuration, saved_window)
20563 (Fcurrent_window_configuration, save_window_save): Handle new
20564 members of window structure.
20565 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20566 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20567 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20568 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20569 Qget_mru_window, Qresize_root_window,
20570 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20571 Qauto_buffer_name; staticpro them.
20572
20573 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20574
20575 * window.c (Fwindow_total_size, Fwindow_left_column)
20576 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20577 (Fwindow_list_1): New functions.
20578 (window_box_text_cols): Replace with window_body_cols.
20579 (Fwindow_width, Fscroll_left, Fscroll_right):
20580 Use window_body_cols instead of window_box_text_cols.
20581 (delete_window, Fset_window_configuration):
20582 Call delete_all_subwindows with window as argument.
20583 (delete_all_subwindows): Take a window as argument and not a
20584 structure. Rewrite.
20585 (window_loop): Remove handling of GET_LRU_WINDOW and
20586 GET_LARGEST_WINDOW.
20587 (Fget_lru_window, Fget_largest_window): Move to window.el.
20588
20589 * window.h: Extern window_body_cols instead of
20590 window_box_text_cols. delete_all_subwindows now takes a
20591 Lisp_Object as argument.
20592
20593 * indent.c (compute_motion, Fcompute_motion):
20594 Use window_body_cols instead of window_box_text_cols.
20595
20596 * frame.c (delete_frame): Call delete_all_subwindows with root
20597 window as argument.
20598
20599 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20600
20601 * fns.c (Fputhash): Document return value.
20602
20603 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20604
20605 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20606
20607 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20608
20609 Cons<->int and similar integer overflow fixes (Bug#8794).
20610
20611 Check for overflow when converting integer to cons and back.
20612 * charset.c (Fdefine_charset_internal, Fdecode_char):
20613 Use cons_to_unsigned to catch overflow.
20614 (Fencode_char): Use INTEGER_TO_CONS.
20615 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20616 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20617 * data.c (long_to_cons, cons_to_long): Remove.
20618 (cons_to_unsigned, cons_to_signed): New functions.
20619 These signal an error for invalid or out-of-range values.
20620 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20621 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20622 * font.c (Ffont_variation_glyphs):
20623 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20624 * lisp.h: Include <intprops.h>.
20625 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20626 (cons_to_signed, cons_to_unsigned): New decls.
20627 (long_to_cons, cons_to_long): Remove decls.
20628 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20629 (Fprimitive_undo): Use CONS_TO_INTEGER.
20630 * xfns.c (Fx_window_property): Likewise.
20631 * xselect.c: Include <limits.h>.
20632 (x_own_selection, selection_data_to_lisp_data):
20633 Use INTEGER_TO_CONS.
20634 (x_handle_selection_request, x_handle_selection_clear)
20635 (x_get_foreign_selection, Fx_disown_selection_internal)
20636 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20637 (lisp_data_to_selection_data): Use cons_to_unsigned.
20638 (x_fill_property_data): Use cons_to_signed.
20639 Report values out of range.
20640
20641 Check for buffer and string overflow more precisely.
20642 * buffer.h (BUF_BYTES_MAX): New macro.
20643 * lisp.h (STRING_BYTES_MAX): New macro.
20644 * alloc.c (Fmake_string):
20645 * character.c (string_escape_byte8):
20646 * coding.c (coding_alloc_by_realloc):
20647 * doprnt.c (doprnt):
20648 * editfns.c (Fformat):
20649 * eval.c (verror):
20650 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20651 since they may not be the same number.
20652 * editfns.c (Finsert_char):
20653 * fileio.c (Finsert_file_contents):
20654 Likewise for BUF_BYTES_MAX.
20655
20656 * image.c: Use ptrdiff_t, not int, for sizes.
20657 (slurp_file): Switch from int to ptrdiff_t.
20658 All uses changed.
20659 (slurp_file): Check that file size fits in both size_t (for
20660 malloc) and ptrdiff_t (for sanity and safety).
20661
20662 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20663 if b->modtime has its maximal value.
20664
20665 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20666
20667 Don't assume time_t can fit into int.
20668 * buffer.h (struct buffer.modtime): Now time_t, not int.
20669 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20670 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20671
20672 Minor fixes for signed vs unsigned integers.
20673 * character.h (MAYBE_UNIFY_CHAR):
20674 * charset.c (maybe_unify_char):
20675 * keyboard.c (read_char, reorder_modifiers):
20676 XINT -> XFASTINT, since the integer must be nonnegative.
20677 * ftfont.c (ftfont_spec_pattern):
20678 * keymap.c (access_keymap, silly_event_symbol_error):
20679 XUINT -> XFASTINT, since the integer must be nonnegative.
20680 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20681 since it makes no difference and we prefer signed.
20682 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20683 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20684 nonnegative.
20685
20686 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20687
20688 * window.h (Fwindow_frame): Declare.
20689
20690 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20691
20692 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20693 (SPARE_MEMORY): Always define.
20694 (LARGE_REQUEST): Remove.
20695 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20696
20697 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20698
20699 * lisp.h: Move EXFUNS for Fframe_root_window,
20700 Fframe_first_window and Fset_frame_selected_window to window.h.
20701
20702 * window.h: Move EXFUNS for Fframe_root_window,
20703 Fframe_first_window and Fset_frame_selected_window here from
20704 lisp.h.
20705
20706 * frame.c (Fwindow_frame, Fframe_first_window)
20707 (Fframe_root_window, Fframe_selected_window)
20708 (Fset_frame_selected_window): Move to window.c.
20709 (Factive_minibuffer_window): Move to minibuf.c.
20710 (Fother_visible_frames_p): New function.
20711
20712 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20713
20714 * window.c (decode_window, decode_any_window): Move up in code.
20715 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20716 (inhibit_frame_unsplittable): Remove unused variable.
20717 (Fwindow_buffer): Move up and rewrite doc-string.
20718 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20719 (Fwindow_prev): New functions.
20720 (Fwindow_frame): Move here from frame.c. Accept any window as
20721 argument.
20722 (Fframe_root_window, Fframe_first_window)
20723 (Fframe_selected_window): Move here from frame.c. Accept frame
20724 or arbitrary window as argument. Update doc-strings.
20725 (Fminibuffer_window): Move up in code.
20726 (Fwindow_minibuffer_p): Move up in code and simplify.
20727 (Fset_frame_selected_window): Move here from frame.c.
20728 Marginal rewrite.
20729 (Fselected_window, select_window, Fselect_window): Move up in
20730 code. Minor doc-string fixes.
20731
20732 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20733
20734 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20735 Do not assume that spare memory exists; that assumption is valid
20736 only if SYSTEM_MALLOC.
20737 (LARGE_REQUEST): New macro, so that the issue of large requests
20738 is separated from the issue of spare memory.
20739
20740 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20741
20742 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20743 format. (Bug#8806)
20744
20745 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20746
20747 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20748 before statements.
20749
20750 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20751
20752 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20753
20754 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20755
20756 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20757 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20758
20759 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20760
20761 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20762
20763 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20764
20765 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20766 (x_clipboard_manager_save): Add return value.
20767 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20768 New error handlers.
20769 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20770 Obey Vx_select_enable_clipboard_manager. Catch errors in
20771 x_clipboard_manager_save (Bug#8779).
20772 (Vx_select_enable_clipboard_manager): New variable.
20773 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20774
20775 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20776
20777 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20778
20779 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20780
20781 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20782 in the current matrix if keep_current_p is non-zero.
20783
20784 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20785
20786 * bidi.c (bidi_level_of_next_char): Fix last change.
20787
20788 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20789
20790 Support bidi reordering of text covered by display properties.
20791
20792 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20793 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20794 (bidi_cache_search, bidi_cache_iterator_state)
20795 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20796 (bidi_level_of_next_char, bidi_move_to_visually_next):
20797 Support character positions inside a run of characters covered by a
20798 display string.
20799 (bidi_paragraph_init, bidi_resolve_explicit_1)
20800 (bidi_level_of_next_char): Call bidi_fetch_char and
20801 bidi_fetch_char_advance instead of FETCH_CHAR and
20802 FETCH_CHAR_ADVANCE.
20803 (bidi_init_it): Initialize new members.
20804 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20805 definitions.
20806 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20807 instead of using explicit *_CHAR codes.
20808 (bidi_resolve_explicit, bidi_resolve_weak):
20809 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20810 bidirectional text is supported only in multibyte buffers.
20811 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20812 it to initialize the frame_window_p member of struct bidi_it.
20813 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20814 (bidi_resolve_explicit, bidi_resolve_weak)
20815 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20816 bidi_it->nchars is non-positive.
20817 (bidi_level_of_next_char): Don't try to lookup the cache for the
20818 next/previous character if nothing is cached there yet, or if we
20819 were just reseat()'ed to a new position.
20820
20821 * xdisp.c (set_cursor_from_row): Set start and stop points
20822 according to the row's direction when priming the loop that looks
20823 for the glyph on which to display cursor.
20824 (single_display_spec_intangible_p): Function deleted.
20825 (display_prop_intangible_p): Reimplement to call
20826 handle_display_spec instead of single_display_spec_intangible_p.
20827 Accept 3 additional arguments needed by handle_display_spec.
20828 This fixes incorrect cursor motion across display property with complex
20829 values: lists, `(when COND...)' forms, etc.
20830 (single_display_spec_string_p): Support property values that are
20831 lists with the argument STRING its top-level element.
20832 (display_prop_string_p): Fix the condition for processing a
20833 property that is a list to be consistent with handle_display_spec.
20834 (handle_display_spec): New function, refactored from the
20835 last portion of handle_display_prop.
20836 (compute_display_string_pos): Accept additional argument
20837 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20838 value of a `display' property is a "replacing spec".
20839 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20840 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20841 the display property, but just return a value indicating whether
20842 the display property will replace the characters it covers.
20843 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20844 frame_window_p members of struct bidi_it.
20845 (compute_display_string_pos, compute_display_string_end):
20846 New functions.
20847 (push_it): Accept second argument POSITION, where pop_it should
20848 jump to continue iteration.
20849 (reseat_1): Initialize bidi_it.disp_pos.
20850
20851 * keyboard.c (adjust_point_for_property): Adjust the call to
20852 display_prop_intangible_p to its new signature.
20853
20854 * dispextern.h (struct bidi_it): New member frame_window_p.
20855 (bidi_init_it): Update prototypes.
20856 (display_prop_intangible_p): Update prototype.
20857 (compute_display_string_pos, compute_display_string_end):
20858 Declare prototypes.
20859 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20860 EMACS_INT.
20861
20862 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20863
20864 Malloc failure behavior now depends on size of allocation.
20865 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20866 * lisp.h: Change signatures accordingly.
20867 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20868 All callers changed. (Bug#8762)
20869
20870 * gnutls.c: Use Emacs's memory allocators.
20871 Without this change, the gnutls library would invoke malloc etc.
20872 directly, which causes problems on non-SYNC_INPUT hosts, and which
20873 runs afoul of improving memory_full behavior. (Bug#8761)
20874 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20875 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20876 xfree instead of the default malloc, realloc, free.
20877 (Fgnutls_boot): No need to check for memory allocation failure,
20878 since xmalloc does that for us.
20879
20880 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20881 * category.c (hash_get_category_set):
20882 * ccl.c (ccl_driver):
20883 * charset.c (Fdefine_charset_internal):
20884 * charset.h (struct charset.hash_index):
20885 * composite.c (get_composition_id, gstring_lookup_cache)
20886 (composition_gstring_put_cache):
20887 * composite.h (struct composition.hash_index):
20888 * dispextern.h (struct image.hash):
20889 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20890 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20891 (hashfn_equal, hashfn_user_defined, make_hash_table)
20892 (maybe_resize_hash_table, hash_lookup, hash_put)
20893 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20894 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20895 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20896 * image.c (make_image, search_image_cache, lookup_image)
20897 (xpm_put_color_table_h):
20898 * lisp.h (struct Lisp_Hash_Table):
20899 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20900 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20901 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20902 * alloc.c (allocate_vectorlike):
20903 Check for overflow in vector size calculations.
20904 * ccl.c (ccl_driver):
20905 Check for overflow when converting EMACS_INT to int.
20906 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20907 need to be updated by these changes.
20908 * fns.c (make_hash_table, maybe_resize_hash_table):
20909 Check for integer overflow with large hash tables.
20910 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20911 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20912 (SXHASH_REDUCE): New macro.
20913 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20914 Use it instead of discarding useful hash info with large hash values.
20915 (sxhash_float): New function.
20916 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20917 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20918 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20919 Rewrite to use FIXNUM_BITS, as this simplifies things.
20920 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20921 Adjust signatures to match updated version of code.
20922 (consing_since_gc): Now EMACS_INT, since a single hash table can
20923 use more than INT_MAX bytes.
20924
20925 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20926
20927 Make it possible to build with GCC-4.6+ -O2 -flto.
20928
20929 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20930
20931 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20932
20933 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20934 Call minibuffer-inactive-mode.
20935
20936 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20937
20938 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20939 Update dependencies.
20940
20941 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20942
20943 * data.c (init_data): Remove code for UTS, this system is not
20944 supported anymore.
20945
20946 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20947
20948 Don't force ./temacs to start in terminal mode.
20949
20950 * frame.c (make_initial_frame): Initialize faces in all cases, not
20951 only when CANNOT_DUMP is defined.
20952 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20953
20954 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20955
20956 * dispnew.c (add_window_display_history): Use const for the string
20957 pointer. Remove declaration, not needed.
20958
20959 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20960
20961 Use 'inline', not 'INLINE'.
20962 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20963 * alloc.c, fontset.c (INLINE): Remove.
20964 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20965 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20966 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20967 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20968 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20969
20970 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20971
20972 Make it possible to run ./temacs.
20973
20974 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20975 syms_of_callproc does the same thing. Remove test for
20976 "initialized", do it in the caller.
20977 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20978
20979 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20980
20981 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20982 (read_minibuf): Use get_minibuffer.
20983 (syms_of_minibuf): Use DEFSYM.
20984 (Qmetadata): New var.
20985 * data.c (Qbuffer): Don't make it static.
20986 (syms_of_data): Use DEFSYM.
20987
20988 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20989
20990 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20991 (CCL_CODE_MIN): New macro.
20992
20993 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20994
20995 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20996
20997 * eval.c (Qdebug): Now static.
20998 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20999 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
21000 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
21001
21002 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
21003
21004 * image.c: Various fixes to ImageMagick code comments.
21005 (Fimagemagick_types): Doc fix.
21006
21007 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
21008
21009 Minor fixes prompted by GCC 4.6.0 warnings.
21010
21011 * xselect.c (converted_selections, conversion_fail_tag): Now static.
21012
21013 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
21014 (x_clipboard_manager_save_all): Move extern decl to ...
21015 * xterm.h: ... here, so that it can be checked for consistency.
21016
21017 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
21018
21019 * xselect.c (x_clipboard_manager_save_frame)
21020 (x_clipboard_manager_save_all): New functions.
21021 (Fx_clipboard_manager_save): Lisp function deleted.
21022
21023 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
21024 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
21025
21026 * xterm.h: Update prototype.
21027
21028 2011-05-28 William Xu <william.xwl@gmail.com>
21029
21030 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
21031 exiting (Bug#8239).
21032
21033 2011-05-28 Jim Meyering <meyering@redhat.com>
21034
21035 Avoid a sign-extension bug in crypto_hash_function.
21036 * fns.c (to_uchar): Define.
21037 (crypto_hash_function): Use it to convert some newly-signed
21038 variables to unsigned, to avoid sign-extension bugs. For example,
21039 without this change, (md5 "truc") would evaluate to
21040 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21041 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21042 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21043
21044 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21045
21046 Integer overflow fixes.
21047
21048 * dbusbind.c: Serial number integer overflow fixes.
21049 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21050 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21051 to hold a serial number that is too large for a fixnum.
21052 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21053 Check for serial numbers out of range. Decode any serial number
21054 that was so large that it became a float. (Bug#8722)
21055
21056 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21057 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21058 Use XFASTINT rather than XUINT when numbers are nonnegative.
21059 (xd_append_arg, Fdbus_method_return_internal):
21060 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21061 arguments, check that Lisp number is nonnegative, rather than
21062 silently wrapping negative numbers around. (Bug#8722)
21063 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21064 (Bug#8722)
21065
21066 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21067
21068 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21069
21070 ccl: Add integer overflow checks.
21071 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21072 (IN_INT_RANGE): New macros.
21073 (ccl_driver): Use them to check for integer overflow when
21074 decoding a CCL program. Many of the new checks are whether XINT (x)
21075 fits in int; it doesn't always, on 64-bit hosts. The new version
21076 doesn't catch all possible integer overflows, but it's an
21077 improvement. (Bug#8719)
21078
21079 * alloc.c (make_event_array): Use XINT, not XUINT.
21080 There's no need for unsigned here.
21081
21082 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21083 This follows up to the 2011-05-06 change that substituted uintptr_t
21084 for EMACS_INT. This case wasn't caught back then.
21085
21086 Rework Fformat to avoid integer overflow issues.
21087 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21088 now (part of C89). Include <verify.h>.
21089 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21090 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21091 (Fformat): Avoid the prepass trying to compute sizes; it was only
21092 approximate and thus did not catch overflow reliably. Instead, walk
21093 through the format just once, formatting and computing sizes as we go,
21094 checking for integer overflow at every step, and allocating a larger
21095 buffer as needed. Keep track separately whether the format is
21096 multibyte. Keep only the most-recently calculated precision, rather
21097 than them all. Record whether each argument has been converted to
21098 string. Use EMACS_INT, not int, for byte and char and arg counts.
21099 Support field widths and precisions larger than INT_MAX. Avoid
21100 sprintf's undefined behavior with conversion specifications such as %#d
21101 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21102 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21103 formatting out-of-range floating point numbers with int
21104 formats. (Bug#8668)
21105
21106 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21107
21108 * data.c: Avoid integer truncation in expressions involving floats.
21109 * data.c: Include <intprops.h>.
21110 (arith_driver): When there's an integer overflow in an expression
21111 involving floating point, convert the integers to floating point
21112 so that the resulting value does not suffer from catastrophic
21113 integer truncation. For example, on a 64-bit host (* 4
21114 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21115 Do not rely on undefined behavior after integer overflow.
21116
21117 merge count_size_as_multibyte, parse_str_to_multibyte
21118 * character.c, character.h (count_size_as_multibyte):
21119 Rename from parse_str_to_multibyte; all uses changed.
21120 Check for integer overflow.
21121 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21122 since it's now a duplicate of the other. This is more of
21123 a character than a buffer op, so better that it's in character.c.
21124 * fns.c, print.c: Adjust to above changes.
21125
21126 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21127
21128 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21129
21130 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21131
21132 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21133 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21134 (x_clipboard_manager_save): Now static.
21135 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21136
21137 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21138 (crypto_hash_function): Now static.
21139 Fix pointer signedness problems. Avoid unnecessary initializations.
21140
21141 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
21142
21143 * termhooks.h (Vselection_alist): Make it terminal-local.
21144
21145 * terminal.c (create_terminal): Initialize it.
21146
21147 * xselect.c: Support for clipboard managers.
21148 (Vselection_alist): Move to termhooks.h as terminal-local var.
21149 (LOCAL_SELECTION): New macro.
21150 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21151 (symbol_to_x_atom): Remove gratuitous arg.
21152 (x_handle_selection_request, lisp_data_to_selection_data)
21153 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21154 (x_own_selection, x_get_local_selection, x_convert_selection):
21155 New arg, specifying work frame. Use terminal-local Vselection_alist.
21156 (some_frame_on_display): Delete unused function.
21157 (Fx_own_selection_internal, Fx_get_selection_internal)
21158 (Fx_disown_selection_internal, Fx_selection_owner_p)
21159 (Fx_selection_exists_p): New optional frame arg.
21160 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21161 (x_handle_selection_clear): Don't treat other terminals with the
21162 same keyboard specially. Use the terminal-local Vselection_alist.
21163 (x_clear_frame_selections): Use Frun_hook_with_args.
21164
21165 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21166
21167 * xterm.h: Add support for those atoms.
21168
21169 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
21170
21171 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21172 (converted_selections, conversion_fail_tag): New global variables.
21173 (x_selection_request_lisp_error): Free the above.
21174 (x_get_local_selection): Remove unnecessary code.
21175 (x_reply_selection_request): Args changed; handle arbitrary array
21176 of converted selections stored in converted_selections.
21177 Separate the XChangeProperty and SelectionNotify steps.
21178 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21179 (x_convert_selection): New function.
21180 (x_handle_selection_event): Simplify.
21181 (x_get_foreign_selection): Don't ignore incoming requests while
21182 waiting for an answer; this will fail when we implement
21183 SAVE_TARGETS, and seems unnecessary anyway.
21184 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21185 (Vx_sent_selection_functions): Doc fix.
21186
21187 2011-05-26 Leo Liu <sdl.web@gmail.com>
21188
21189 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21190
21191 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21192
21193 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21194
21195 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21196 for fringe update if it has periodic bitmap.
21197 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21198 and fringe_bitmap_periodic_p.
21199
21200 * fringe.c (get_fringe_bitmap_data): New function.
21201 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21202 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21203 row. Mark glyph row for fringe update if periodicity changed.
21204
21205 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21206 for fringe update unless it has periodic bitmap.
21207
21208 2011-05-25 Kenichi Handa <handa@m17n.org>
21209
21210 * xdisp.c (get_next_display_element): Set correct it->face_id for
21211 a static composition.
21212
21213 2011-05-24 Leo Liu <sdl.web@gmail.com>
21214
21215 * deps.mk (fns.o):
21216 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21217
21218 * fns.c (crypto_hash_function, Fsha1): New function.
21219 (Fmd5): Use crypto_hash_function.
21220 (syms_of_fns): Add Ssha1.
21221
21222 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21223
21224 * gnutls.c: Remove unused macros.
21225 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21226 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21227 Remove macros that are defined and never used.
21228 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21229
21230 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21231
21232 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21233 (Fx_get_selection_internal): Minor cleanup.
21234 (Fx_own_selection_internal): Rename arguments for consistency with
21235 select.el.
21236
21237 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21238
21239 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21240
21241 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21242
21243 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21244
21245 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21246
21247 * dispnew.c (scrolling_window): Don't exclude the case that the
21248 last enabled row in the desired matrix touches the bottom boundary.
21249
21250 2011-05-21 Glenn Morris <rgm@gnu.org>
21251
21252 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21253 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21254 and add some more files.
21255
21256 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21257
21258 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21259 report_file_error introduced by the change from 2011-05-07.
21260
21261 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21262
21263 * systime.h (Time): Define only if emacs is defined.
21264 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21265 where the include path doesn't have X11/X.h by default. See
21266 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21267
21268 2011-05-20 Kenichi Handa <handa@m17n.org>
21269
21270 * composite.c (find_automatic_composition): Fix previous change.
21271
21272 2011-05-20 Glenn Morris <rgm@gnu.org>
21273
21274 * lisp.mk: New file, split from Makefile.in.
21275 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21276 (shortlisp): Remove.
21277 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21278
21279 2011-05-19 Glenn Morris <rgm@gnu.org>
21280
21281 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21282 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21283 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21284 (lisp): Set the order to that of loadup.el.
21285 (shortlisp): Make it a copy of $lisp.
21286 (SOME_MACHINE_LISP): Remove.
21287 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21288 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21289
21290 2011-05-18 Kenichi Handa <handa@m17n.org>
21291
21292 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21293 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21294 (find_automatic_composition): Mostly rewrite for efficiency.
21295
21296 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21297
21298 * makefile.w32-in: Update dependencies.
21299
21300 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21301
21302 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21303 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21304
21305 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21306
21307 Fix some integer overflow issues, such as string length overflow.
21308
21309 * insdel.c (count_size_as_multibyte): Check for string overflow.
21310
21311 * character.c (lisp_string_width): Check for string overflow.
21312 Use EMACS_INT, not int, for string indexes and lengths; in
21313 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21314 the resulting string length overflows an EMACS_INT; instead,
21315 report a string overflow if no precision given. When checking for
21316 precision exhaustion, use a check that cannot possibly have
21317 integer overflow. (Bug#8675)
21318 * character.h (lisp_string_width): Adjust to new signature.
21319
21320 * alloc.c (string_overflow): New function.
21321 (Fmake_string): Use it. This doesn't change behavior, but saves
21322 a few bytes and will simplify future changes.
21323 * character.c (string_escape_byte8): Likewise.
21324 * lisp.h (string_overflow): New decl.
21325
21326 Fixups, following up to the user-interface timestamp change.
21327 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21328 for UI timestamps, instead of unsigned long.
21329 * msdos.c (mouse_get_pos): Likewise.
21330 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21331 * w32gui.h (Time): Define by including "systime.h" rather than by
21332 declaring it ourselves. (Bug#8664)
21333
21334 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21335 * image.c (clear_image_cache): Likewise.
21336
21337 * term.c (term_mouse_position): Don't assume time_t wraparound.
21338
21339 Be more systematic about user-interface timestamps.
21340 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21341 and sometimes 'EMACS_UINT', to represent these timestamps.
21342 This change causes it to use 'Time' uniformly, as that's what X uses.
21343 This makes the code easier to follow, and makes it easier to catch
21344 integer overflow bugs such as Bug#8664.
21345 * frame.c (Fmouse_position, Fmouse_pixel_position):
21346 Use Time, not unsigned long, for user-interface timestamps.
21347 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21348 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21349 * keyboard.h (last_event_timestamp): Likewise.
21350 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21351 * menu.h (xmenu_show): Likewise.
21352 * term.c (term_mouse_position): Likewise.
21353 * termhooks.h (struct input_event.timestamp): Likewise.
21354 (struct terminal.mouse_position_hook): Likewise.
21355 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21356 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21357 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21358 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21359 what it was before.
21360 * menu.h, termhooks.h: Include "systime.h", for Time.
21361
21362 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21363 Don't assume that the difference between two unsigned long values
21364 can fit into an integer. At this point, we know button_down_time
21365 <= event->timestamp, so the difference must be nonnegative, so
21366 there's no need to cast the result if double-click-time is
21367 nonnegative, as it should be; check that it's nonnegative, just in
21368 case. This bug is triggered when events are more than 2**31 ms
21369 apart (about 25 days). (Bug#8664)
21370
21371 * xselect.c (last_event_timestamp): Remove duplicate decl.
21372 (x_own_selection): Remove needless cast to unsigned long.
21373
21374 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21375 that always fit in int. Use a sentinel instead of a counter, to
21376 avoid a temp and to allay GCC's concerns about possible int overflow.
21377 * frame.h (struct frame): Use int for menu_bar_items_used
21378 instead of EMACS_INT, since it always fits in int.
21379
21380 * menu.c (grow_menu_items): Check for int overflow.
21381
21382 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21383
21384 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21385 Before, the code was not consistent. These values cannot exceed
21386 2**31 - 1 so there's no need to make them unsigned.
21387 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21388 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21389 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21390 as modifiers.
21391 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21392
21393 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21394 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21395 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21396 presumably because the widths might not match.
21397
21398 * window.c (size_window): Avoid needless test at loop start.
21399
21400 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21401
21402 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21403
21404 2011-05-12 Drew Adams <drew.adams@oracle.com>
21405
21406 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21407
21408 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21409
21410 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21411 `width' to `bar_area_x' and `bar_area_width', respectively.
21412 (x_scroll_run): Take account of fringe background extension.
21413
21414 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21415 Rename local vars `left' and `width' to `bar_area_x' and
21416 `bar_area_width', respectively.
21417 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21418 background extension.
21419
21420 2011-05-10 Jim Meyering <meyering@redhat.com>
21421
21422 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21423
21424 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21425
21426 * image.c (Finit_image_library): Return t for built-in image types,
21427 like pbm and xbm. (Bug#8640)
21428
21429 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21430
21431 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21432
21433 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21434
21435 * w32console.c (Fset_screen_color): Doc fix.
21436 (Fget_screen_color): New function.
21437 (syms_of_ntterm): Defsubr it.
21438
21439 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21440 unlink the temporary file if Fcall_process didn't create it in the
21441 first place.
21442 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21443 child process will be redirected to a file specified with `:file'.
21444 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21445 cue to call_process_cleanup not to close that handle.
21446
21447 2011-05-07 Ben Key <bkey76@gmail.com>
21448
21449 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21450 one of two shell specific rules, either bootstrap-temacs-CMD or
21451 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21452 to the previous implementation of the bootstrap-temacs rule.
21453 The bootstrap-temacs-CMD rule is similar to the previous
21454 implementation of the bootstrap-temacs rule except that it
21455 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21456 variable.
21457
21458 These changes, along with some changes to nt/configure.bat,
21459 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21460 earlier fix to add support for --cflags and --ldflags options
21461 that include quotes so that it works whether make uses cmd or
21462 sh as the shell.
21463
21464 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21465
21466 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21467 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21468 is a constant.
21469 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21470 a string. Handle both cases.
21471 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21472 (Fdbus_register_method): Use Qinvalid_function.
21473
21474 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21475
21476 * makefile.w32-in: Update dependencies.
21477 (LISP_H): Add inttypes.h and stdin.h.
21478 (PROCESS_H): Add unistd.h.
21479
21480 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21481
21482 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21483 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21484
21485 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21486
21487 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21488
21489 * term.c (vfatal): Remove stray call to va_end.
21490 It's not needed and the C Standard doesn't allow it here anyway.
21491
21492 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21493 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21494
21495 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21496 bytes.
21497
21498 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21499
21500 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21501
21502 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21503
21504 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21505
21506 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21507
21508 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21509 * charset.c (Fdefine_charset_internal): Don't initialize
21510 charset.code_space[15]. The value was garbage, on hosts with
21511 32-bit int (Bug#8600).
21512
21513 * lread.c (read_integer): Be more consistent with string-to-number.
21514 Use string_to_number to do the actual conversion; this avoids
21515 rounding errors and fixes some other screwups. Without this fix,
21516 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21517 (digit_to_number): Move earlier, for benefit of read_integer.
21518 Return -1 if the digit is out of range for the base, -2 if it is
21519 not a digit in any supported base. (Bug#8602)
21520
21521 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21522
21523 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21524 to match comment at start of function. This also removes a
21525 GCC warning about overflow in a 32+64-bit port.
21526
21527 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21528
21529 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21530 Reported by Stefan Monnier in
21531 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21532 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21533 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21534
21535 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21536 (EMACS_UINTPTR): Likewise, with uintptr_t.
21537
21538 * lisp.h: Prefer 64-bit EMACS_INT if available.
21539 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21540 on 32-bit hosts that have 64-bit int, so that they can access
21541 large files.
21542 However, temporarily disable this change unless the temporary
21543 symbol WIDE_EMACS_INT is defined.
21544
21545 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21546
21547 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21548 This removes an assumption that EMACS_INT and long are the same
21549 width as pointers. The assumption is true for Emacs porting targets
21550 now, but we want to make other targets possible.
21551 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21552 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21553 In the rest of the code, change types of integers that hold casted
21554 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21555 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21556 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21557 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21558 No need to cast type when ORing.
21559 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21560 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21561 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21562 assume EMACS_INT is the same width as char *.
21563 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21564 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21565 Remove no-longer-needed casts.
21566 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21567 (xg_tool_bar_help_callback, xg_make_tool_item):
21568 Use EMACS_INTPTR to hold an integer
21569 that will be cast to void *; this can avoid a GCC warning
21570 if EMACS_INT is not the same width as void *.
21571 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21572 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21573 (current_message_1, set_message_1):
21574 Use a local to convert to proper width without a cast.
21575 * xmenu.c (dialog_selection_callback): Likewise.
21576
21577 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21578 Also, don't assume VALBITS / RAND_BITS is less than 5,
21579 and don't rely on undefined behavior when shifting a 1 left into
21580 the sign bit.
21581 * lisp.h (get_random): Change signature to match.
21582
21583 * lread.c (hash_string): Use size_t, not int, for hash computation.
21584 Normally we prefer signed values; but hashing is special, because
21585 it's better to use unsigned division on hash table sizes so that
21586 the remainder is nonnegative. Also, size_t is the natural width
21587 for hashing into memory. The previous code used 'int', which doesn't
21588 retain enough info to hash well into very large tables.
21589 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21590
21591 * dbusbind.c: Don't possibly lose pointer info when converting.
21592 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21593 Use XPNTR rather than XHASH, so that the high-order bits of
21594 the pointer aren't lost when converting through void *.
21595
21596 * eval.c (Fautoload): Don't double-shift a pointer.
21597
21598 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21599
21600 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21601
21602 * gnutls.c (DEF_GNUTLS_FN):
21603 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21604
21605 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21606
21607 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21608 marker. (Bug#8610)
21609
21610 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21611
21612 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21613 New version that can reserve upto 2GB of heap space.
21614
21615 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21616
21617 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21618
21619 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21620
21621 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21622 `gnutls_certificate_set_x509_key_file'.
21623
21624 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21625
21626 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21627 Update dependencies.
21628
21629 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21630
21631 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21632 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21633 Remove unused parameter `fildes'.
21634 * process.c (read_process_output, send_process): Don't pass it.
21635
21636 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21637
21638 Fix previous change: the library cache is defined in w32.c.
21639 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21640 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21641
21642 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21643
21644 Implement dynamic loading of GnuTLS on Windows.
21645
21646 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21647 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21648 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21649 Declare.
21650
21651 * gnutls.c (Qgnutls_dll): Define.
21652 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21653 (gnutls_*): Declare function pointers.
21654 (init_gnutls_functions): New function to initialize function pointers.
21655 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21656 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21657 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21658 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21659 (emacs_gnutls_write, emacs_gnutls_read)
21660 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21661 (Fgnutls_available_p): New function.
21662 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21663 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21664 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21665
21666 * image.c: Include w32.h.
21667 (Vimage_type_cache): Delete.
21668 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21669 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21670 (w32_delayed_load): Move to w32.c.
21671
21672 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21673
21674 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21675 (w32_delayed_load): Move from image.c. When loading a library, record
21676 its filename in the :loaded-from property of the library id.
21677 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21678 Initialize and staticpro them.
21679 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21680
21681 * process.c: Include lisp.h before w32.h, not after.
21682 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21683 instead of gnutls_record_check_pending.
21684
21685 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21686
21687 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21688
21689 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21690 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21691 as passed in.
21692
21693 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21694
21695 * xterm.c (x_set_frame_alpha): Do not set property on anything
21696 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21697
21698 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21699
21700 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21701
21702 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21703
21704 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21705 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21706 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21707 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21708 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21709 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21710 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21711 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21712 (Qgnutls_bootprop_callbacks_verify): Make static.
21713
21714 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21715
21716 * callproc.c: Indentation fixup.
21717
21718 * sysdep.c (wait_for_termination_1): Make static.
21719 (wait_for_termination, interruptible_wait_for_termination):
21720 Move after wait_for_termination_1.
21721
21722 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21723
21724 * sysdep.c (interruptible_wait_for_termination): New function
21725 which is like wait_for_termination, but allows keyboard
21726 interruptions.
21727
21728 * callproc.c (Fcall_process): Add (:file "file") as an option for
21729 the STDOUT buffer.
21730 (Fcall_process_region): Ditto.
21731
21732 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21733
21734 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21735 rather than `XVECTOR (FOO)->size'.
21736
21737 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21738 inttypes.h, as a gnulib replacement is used if it not available in
21739 system headers.
21740
21741 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21742
21743 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21744 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21745 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21746
21747 * coding.c (coding_alloc_by_realloc): Error out if destination
21748 will grow beyond MOST_POSITIVE_FIXNUM.
21749 (decode_coding_emacs_mule): Abort if there isn't enough place in
21750 charbuf for the composition carryover bytes. Reserve an extra
21751 space for up to 2 characters produced in a loop.
21752 (decode_coding_iso_2022): Abort if there isn't enough place in
21753 charbuf for the composition carryover bytes.
21754
21755 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21756
21757 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21758 aborting when %lld or %lll format is passed.
21759 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21760 %llo or %llx format is passed. (Bug#8545)
21761
21762 * window.c (window_scroll_line_based): Use a marker instead of
21763 simple variables to record original value of point. (Bug#7952)
21764
21765 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21766 produced by %s or %c overflows available buffer space. (Bug#8545)
21767
21768 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21769
21770 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21771 (SIZE_MAX): Move defn after all includes, as they might #define it.
21772
21773 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21774
21775 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21776
21777 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21778
21779 * keyboard.c (Qdelayed_warnings_hook): Define.
21780 (command_loop_1): Run `delayed-warnings-hook'
21781 if Vdelayed_warnings_list is non-nil.
21782 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21783 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21784
21785 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21786
21787 * doprnt.c (doprnt): Don't return value smaller than the buffer
21788 size if the message was truncated. (Bug#8545).
21789
21790 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21791
21792 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21793 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21794
21795 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21796
21797 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21798
21799 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21800
21801 * makefile.w32-in: Update dependencies.
21802
21803 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21804
21805 Improve `doprnt' and its usage. (Bug#8545)
21806 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21807 `format_end'. Remove support for %l as a conversion specifier.
21808 Don't use xrealloc. Improve diagnostics when the %l size modifier
21809 is used. Update the commentary.
21810
21811 * eval.c (verror): Simplify calculation of size_t.
21812
21813 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21814 messages.
21815
21816 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21817
21818 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21819 change.
21820
21821 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21822
21823 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21824 This makes this file independent of the recent pseudovector change.
21825
21826 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21827
21828 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21829
21830 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21831 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21832 Remove unused local.
21833 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21834
21835 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21836 GCC 4.6.0 optimizes based on type-based alias analysis.
21837 For example, if b is of type struct buffer * and v of type struct
21838 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21839 != &v->size, and therefore "v->size = 1; b->size = 2; return
21840 v->size;" must therefore return 1. This assumption is incorrect
21841 for Emacs, since it type-puns struct Lisp_Vector * with many other
21842 types. To fix this problem, this patch adds a new type struct
21843 vectorlike_header that documents the constraints on layout of vectors
21844 and pseudovectors, and helps optimizing compilers not get fooled
21845 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21846 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21847 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21848 the size member.
21849 (XSETPVECTYPE): Rewrite in terms of new macro.
21850 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21851 This is a bit clearer, and further avoids the possibility of
21852 undesirable aliasing.
21853 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21854 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21855 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21856 since Lisp_Subr is a special case (no "next" field).
21857 (ASIZE): Now uses header.size rather than size.
21858 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21859 to avoid the hassle of writing XVECTOR (foo)->header.size.
21860 (struct vectorlike_header): New type.
21861 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21862 object, to help avoid aliasing.
21863 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21864 (SUBRP): Likewise, since Lisp_Subr is a special case.
21865 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21866 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21867 (struct Lisp_Hash_Table): Combine first two members into a single
21868 struct vectorlike_header member. All uses of "size" and "next" members
21869 changed to be "header.size" and "header.next".
21870 * buffer.h (struct buffer): Likewise.
21871 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21872 * frame.h (struct frame): Likewise.
21873 * process.h (struct Lisp_Process): Likewise.
21874 * termhooks.h (struct terminal): Likewise.
21875 * window.c (struct save_window_data, struct saved_window): Likewise.
21876 * window.h (struct window): Likewise.
21877 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21878 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21879 * buffer.c (init_buffer_once): Likewise.
21880 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21881 special case.
21882 * process.c (Fformat_network_address): Use local var for size,
21883 for brevity.
21884
21885 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21886
21887 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21888 * data.c (atof): Remove decl; no longer used or needed.
21889 (digit_to_number): Move to lread.c.
21890 (Fstring_to_number): Use new string_to_number function, to be
21891 consistent with how the Lisp reader treats infinities and NaNs.
21892 Do not assume that floating-point numbers represent EMACS_INT
21893 without losing information; this is not true on most 64-bit hosts.
21894 Avoid double-rounding errors, by insisting on integers when
21895 parsing non-base-10 numbers, as the documentation specifies.
21896 * lisp.h (string_to_number): New decl, replacing ...
21897 (isfloat_string): Remove.
21898 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21899 (read1): Do not accept +. and -. as integers; this
21900 appears to have been a coding error. Similarly, do not accept
21901 strings like +-1e0 as floating point numbers. Do not report
21902 overflow for integer overflows unless the base is not 10 which
21903 means we have no simple and reliable way to continue.
21904 Break out the floating-point parsing into a new
21905 function string_to_number, so that Fstring_to_number parses
21906 floating point numbers consistently with the Lisp reader.
21907 (digit_to_number): Move here from data.c. Make it static inline.
21908 (E_CHAR, EXP_INT): Remove, replacing with ...
21909 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21910 (string_to_number): New function, replacing isfloat_string.
21911 This function checks for valid syntax and produces the resulting
21912 Lisp float number too. Rework it so that string-to-number
21913 no longer mishandles examples like "1.0e+". Use strtoumax,
21914 so that overflow for non-base-10 numbers is reported only when
21915 there's no portable and simple way to convert to floating point.
21916
21917 * textprop.c (set_text_properties_1): Rewrite for clarity,
21918 and to avoid GCC warning about integer overflow.
21919
21920 * intervals.h (struct interval): Use EMACS_INT for members
21921 where EMACS_UINT might cause problems. See
21922 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21923 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21924 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21925 All uses changed.
21926 (offset_intervals): Tell GCC not to worry about length overflow
21927 when negating a negative length.
21928
21929 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21930 (overrun_check_free): Likewise.
21931
21932 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21933 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21934 word size.
21935
21936 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21937 (gnutls_make_error): Rename local to avoid shadowing.
21938 (gnutls_emacs_global_deinit): ifdef out; not used.
21939 (Fgnutls_boot): Use const for pointer to readonly storage.
21940 Comment out unused local. Fix pointer signedness problems.
21941
21942 * lread.c (openp): Don't stuff size_t into an 'int'.
21943 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21944 about possible signed overflow.
21945
21946 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21947 (GDK_KEY_g): Don't define if already defined.
21948 (xg_prepare_tooltip): Avoid pointer signedness problem.
21949 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21950
21951 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21952 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21953
21954 * xfns.c (Fx_window_property): Simplify a bit,
21955 to make a bit faster and to avoid GCC 4.6.0 warning.
21956 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21957
21958 * fns.c (internal_equal): Don't assume size_t fits in int.
21959
21960 * alloc.c (compact_small_strings): Tighten assertion a little.
21961
21962 Replace pEd with more-general pI, and fix some printf arg casts.
21963 * lisp.h (pI): New macro, generalizing old pEd macro to other
21964 conversion specifiers. For example, use "...%"pI"d..." rather
21965 than "...%"pEd"...".
21966 (pEd): Remove. All uses replaced with similar uses of pI.
21967 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21968 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21969 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21970 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21971 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21972 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21973 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21974 64-bit hosts.
21975 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21976 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21977 * print.c (safe_debug_print, print_object): Likewise.
21978 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21979 to int.
21980 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21981 avoiding the 0 flag, which is not portable.
21982 * process.c (Fmake_network_process): Use pI to avoid cast.
21983 * region-cache.c (pp_cache): Likewise.
21984 * xdisp.c (decode_mode_spec): Likewise.
21985 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21986 behavior on 64-bit hosts with printf arg.
21987 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21988 (x_stop_queuing_selection_requests): Likewise.
21989 (x_get_window_property): Don't truncate byte count to an 'int'
21990 when tracing.
21991
21992 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21993 here, since it parses constructs like leading '-' and spaces,
21994 which are not wanted; and it overflows with large numbers.
21995 Instead, simply match F[0-9]+, which is what is wanted anyway.
21996
21997 * alloc.c: Remove unportable assumptions about struct layout.
21998 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21999 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
22000 (allocate_vectorlike, make_pure_vector): Use the new macros,
22001 plus offsetof, to remove unportable assumptions about struct layout.
22002 These assumptions hold on all porting targets that I know of, but
22003 they are not guaranteed, they're easy to remove, and removing them
22004 makes further changes easier.
22005
22006 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
22007 This doesn't fix a bug but makes the code clearer.
22008 (string_overrun_cookie): Now const. Use initializers that
22009 don't formally overflow signed char, to avoid warnings.
22010 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
22011 can cause Emacs to crash when string overrun checking is enabled.
22012 (allocate_buffer): Don't assume sizeof (struct buffer) is a
22013 multiple of sizeof (EMACS_INT); it need not be, if
22014 alignof(EMACS_INT) < sizeof (EMACS_INT).
22015 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
22016
22017 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
22018
22019 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
22020
22021 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
22022
22023 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
22024 supposed to be handshaking. (Bug#8556)
22025 Reported by Paul Eggert <eggert@cs.ucla.edu>.
22026
22027 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
22028
22029 * lisp.h (Qdebug): List symbol.
22030 * eval.c (Qdebug): Restore global linkage.
22031 * keyboard.c (debug-on-event): New variable.
22032 (handle_user_signal): Break into debugger when debug-on-event
22033 matches the current signal symbol.
22034
22035 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22036
22037 * alloc.c (check_sblock, check_string_bytes)
22038 (check_string_free_list): Convert to standard C.
22039
22040 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22041
22042 * w32.c (emacs_gnutls_push): Fix typo.
22043
22044 2011-04-25 Eli Zaretskii <eliz@gnu.org>
22045
22046 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22047 "cast to pointer from integer of different size".
22048
22049 Improve doprnt and its use in verror. (Bug#8545)
22050 * doprnt.c (doprnt): Document the set of format control sequences
22051 supported by the function. Use SAFE_ALLOCA instead of always
22052 using `alloca'.
22053
22054 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22055 is one byte too soon. Don't use xrealloc; instead xfree and
22056 xmalloc anew.
22057
22058 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22059
22060 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22061 callbacks stage.
22062
22063 * gnutls.c: Renamed global_initialized to
22064 gnutls_global_initialized. Added internals for the
22065 :verify-hostname-error, :verify-error, and :verify-flags
22066 parameters of `gnutls-boot' and documented those parameters in the
22067 docstring. Start callback support.
22068 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22069 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22070 on error. Return error code.
22071 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22072 (emacs_gnutls_read): Likewise.
22073 (Fgnutls_boot): Return handshake error code.
22074 (emacs_gnutls_handle_error): New function.
22075 (wsaerror_to_errno): Likewise.
22076
22077 * w32.h (emacs_gnutls_pull): Add prototype.
22078 (emacs_gnutls_push): Likewise.
22079
22080 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22081 (emacs_gnutls_push): Likewise.
22082
22083 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22084
22085 * process.c (wait_reading_process_output): Check if GnuTLS
22086 buffered some data internally if no FDs are set for TLS
22087 connections.
22088
22089 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22090 (LIBS): Link to USER_LIBS.
22091 ($(BLD)/gnutls.$(0)): New target.
22092
22093 2011-04-24 Eli Zaretskii <eliz@gnu.org>
22094
22095 * xdisp.c (handle_single_display_spec): Rename the
22096 display_replaced_before_p argument into display_replaced_p, to
22097 make it consistent with the commentary. Fix typos in the
22098 commentary.
22099
22100 * textprop.c (syms_of_textprop): Remove dead code.
22101 (copy_text_properties): Delete obsolete commentary about an
22102 interface that was deleted long ago. Fix typos in the description
22103 of arguments.
22104
22105 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22106 to changes in oldXMenu/XMenu.h from 2011-04-16.
22107 <menu_help_message, prev_menu_help_message>: Constify.
22108 (IT_menu_make_room): menu->help_text is now `const char **';
22109 adjust.
22110
22111 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22112 to changes in oldXMenu/XMenu.h from 2011-04-16.
22113 (struct XMenu): Declare `help_text' `const char **'.
22114
22115 * xfaces.c <Qunspecified>: Make extern again.
22116
22117 * syntax.c: Include sys/types.h before including regex.h, as
22118 required by POSIX.
22119
22120 * doc.c (get_doc_string): Improve the format passed to `error'.
22121
22122 * doprnt.c (doprnt): Improve commentary.
22123
22124 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22125
22126 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22127 them with etags.
22128
22129 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22130 changes in globals.h immediately force recompilation.
22131 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22132 $(CURDIR)/s/ms-w32.h.
22133 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22134
22135 * character.c (Fchar_direction): Function deleted.
22136 (syms_of_character): Don't defsubr it.
22137 <char-direction-table>: Deleted.
22138
22139 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22140
22141 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22142 * doprnt.c: Include limits.h.
22143 (SIZE_MAX): New macro.
22144 (doprnt): Return a size_t value. 2nd arg is now size_t.
22145 Many local variables are now size_t instead of int or unsigned.
22146 Improve overflow protection. Support `l' modifier for integer
22147 conversions. Support %l conversion. Don't assume an EMACS_INT
22148 argument for integer conversions and for %c.
22149
22150 * lisp.h (doprnt): Restore prototype.
22151
22152 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22153 $(SRC)/character.h.
22154
22155 * Makefile.in (base_obj): Add back doprnt.o.
22156
22157 * deps.mk (doprnt.o): Add back prerequisites.
22158 (callint.o): Depend on character.h.
22159
22160 * eval.c (internal_lisp_condition_case): Include the handler
22161 representation in the error message.
22162 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22163 when breaking from the loop.
22164
22165 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22166
22167 * callint.c (Fcall_interactively): When displaying error message
22168 about invalid control letter, pass the character's codepoint, not
22169 a pointer to its multibyte form. Improve display of the character
22170 in octal and display also its hex code.
22171
22172 * character.c (char_string): Use %x to display the (unsigned)
22173 codepoint of an invalid character, to avoid displaying a bogus
22174 negative value.
22175
22176 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22177 `error', not SYMBOL_NAME itself.
22178
22179 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22180 character arguments to `error'.
22181
22182 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22183 to `error' in error message about FINAL_CHAR argument. Make sure
22184 FINAL_CHAR is a character, and use %c when it is passed as
22185 argument to `error'.
22186
22187 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22188
22189 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22190
22191 * w32.c: Include <time.h>.
22192 (sys_localtime): New function.
22193
22194 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22195
22196 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22197
22198 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22199
22200 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22201
22202 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22203 zombies (Bug#8467).
22204
22205 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22206
22207 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22208 gl_state.e_property when gl_state.object is Qt.
22209
22210 * insdel.c (make_gap_larger): Remove limitation of buffer size
22211 to <= INT_MAX.
22212
22213 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22214
22215 * xdisp.c (lookup_glyphless_char_display)
22216 (produce_glyphless_glyph): Handle cons cell entry in
22217 glyphless-char-display.
22218 (Vglyphless_char_display): Document it.
22219
22220 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22221 glyphless-char-display.
22222
22223 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22224
22225 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22226
22227 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22228
22229 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22230 definition for no-X builds.
22231
22232 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22233
22234 Static checks with GCC 4.6.0 and non-default toolkits.
22235
22236 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22237
22238 * process.c (keyboard_bit_set): Define only if SIGIO.
22239 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22240 (send_process): Repair possible setjmp clobbering.
22241
22242 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22243
22244 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22245
22246 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22247
22248 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22249 Define only if needed.
22250
22251 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22252 by pacifying GCC about it. Maybe it's time to retire it?
22253 * xfaces.c (USG, __TIMEVAL__): Likewise.
22254
22255 * dispextern.h (struct redisplay_interface): Rename param
22256 to avoid shadowing.
22257 * termhooks.h (struct terminal): Likewise.
22258 * xterm.c (xembed_send_message): Likewise.
22259
22260 * insdel.c (make_gap_smaller): Define only if
22261 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22262
22263 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22264 it.
22265
22266 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22267 so that we aren't warned about unused symbols.
22268
22269 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22270
22271 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22272
22273 * xfns.c (x_real_positions): Mark locals as initialized.
22274
22275 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22276
22277 * xterm.c: Fix problems found by static analysis with other toolkits.
22278 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22279 (x_dispatch_event): Declare static if USE_GTK, and
22280 define if USE_GTK || USE_X_TOOLKIT.
22281 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22282 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22283 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22284 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22285
22286 * xmenu.c (menu_help_callback): Pointer type fixes.
22287 Use const pointers when pointing at readonly data. Avoid pointer
22288 signedness clashes.
22289 (FALSE): Remove unused macro.
22290 (update_frame_menubar): Remove unused decl.
22291
22292 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22293
22294 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22295 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22296 (single_menu_item): Rename local to avoid shadowing.
22297
22298 * keyboard.c (make_lispy_event): Remove unused local var.
22299
22300 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22301 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22302
22303 * bitmaps: Change bitmaps from unsigned char back to the X11
22304 compatible char. Avoid the old compiler warnings about
22305 out-of-range initializers by using, for example, '\xab' rather
22306 than 0xab.
22307
22308 * xgselect.c (xgselect_initialize): Check vs interface
22309 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22310
22311 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22312
22313 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22314 to read-only memory.
22315
22316 * fns.c (vector): Remove; this old hack is no longer needed.
22317
22318 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22319 Remove unused var.
22320 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22321
22322 * xrdb.c (x_load_resources): Omit unused local.
22323
22324 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22325 (x_window): Rename locals to avoid shadowing.
22326 (USG): Use the kludged USG macro, to pacify gcc.
22327
22328 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22329 (x_term_init): Remove local to avoid shadowing.
22330
22331 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22332
22333 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22334 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22335
22336 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22337
22338 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22339
22340 Fix regex.c, syntax.c and friends for buffers > 2GB.
22341 * syntax.h (struct gl_state_s): Declare character position members
22342 EMACS_INT.
22343
22344 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22345
22346 * textprop.c (verify_interval_modification, interval_of):
22347 Declare arguments EMACS_INT.
22348
22349 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22350 EMACS_INT.
22351
22352 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22353
22354 * indent.c (Fvertical_motion): Local variable it_start is now
22355 EMACS_INT.
22356
22357 * regex.c (re_match, re_match_2, re_match_2_internal)
22358 (bcmp_translate, regcomp, regexec, print_double_string)
22359 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22360 (re_compile_pattern, re_exec): Declare arguments and local
22361 variables `size_t' and `ssize_t' and return values `regoff_t', as
22362 appropriate.
22363 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22364 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22365 <compile_stack_type>: `size' and `avail' are now `size_t'.
22366
22367 * regex.h <regoff_t>: Use ssize_t, not int.
22368 (re_search, re_search_2, re_match, re_match_2): Arguments that
22369 specify buffer/string position and length are now ssize_t and
22370 size_t. Return type is regoff_t.
22371
22372 2011-04-16 Ben Key <bkey76@gmail.com>
22373
22374 * nsfont.m: Fixed bugs in ns_get_family and
22375 ns_descriptor_to_entity that were caused by using free to
22376 deallocate memory blocks that were allocated by xmalloc (via
22377 xstrdup). This caused Emacs to crash when compiled with
22378 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22379 --enable-checking=xmallocoverrun). xfree is now used to
22380 deallocate these memory blocks.
22381
22382 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22383
22384 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22385
22386 emacs_write: Accept and return EMACS_INT for sizes.
22387 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22388 et seq.
22389 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22390 Accept and return EMACS_INT.
22391 (emacs_gnutls_write): Return the number of bytes written on
22392 partial writes.
22393 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22394 (emacs_read, emacs_write): Remove check for negative size, as the
22395 Emacs source code has been audited now.
22396 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22397 (emacs_read, emacs_write): Use it.
22398 * process.c (send_process): Adjust to the new signatures of
22399 emacs_write and emacs_gnutls_write. Do not attempt to store
22400 a byte offset into an 'int'; it might overflow.
22401 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22402
22403 * sound.c: Don't assume sizes fit in 'int'.
22404 (struct sound_device.period_size, alsa_period_size):
22405 Return EMACS_INT, not int.
22406 (struct sound_device.write, vox_write, alsa_write):
22407 Accept EMACS_INT, not int.
22408 (wav_play, au_play): Use EMACS_INT to store sizes and to
22409 record read return values.
22410
22411 2011-04-15 Ben Key <bkey76@gmail.com>
22412
22413 * keyboard.c (Qundefined): Don't declare static since it is used
22414 in nsfns.m.
22415 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22416 static since they are used in nsfont.m.
22417
22418 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22419
22420 * process.c (Qprocessp): Don't declare static.
22421 * lisp.h (Qprocessp): Declare again.
22422
22423 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22424
22425 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22426
22427 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22428
22429 Improve C-level modularity by making more things 'static'.
22430
22431 Don't publish debugger-only interfaces to other modules.
22432 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22433 (verify_bytepos, count_markers): Move decls to the only modules
22434 that need them.
22435 * region-cache.h (pp_cache): Likewise.
22436 * window.h (check_all_windows): Likewise.
22437 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22438
22439 * sysdep.c (croak): Now static, if
22440 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22441 * syssignal.h (croak): Declare only if not static.
22442
22443 * alloc.c (refill_memory_reserve): Now static if
22444 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22445 * lisp.h (refill_memory_reserve): Declare only if not static.
22446
22447 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22448 Define only if USE_LUCID.
22449
22450 * xrdb.c (x_customization_string, x_rm_string): Now static.
22451
22452 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22453 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22454
22455 * xdisp.c (draw_row_with_mouse_face): Now static.
22456 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22457
22458 * window.h (check_all_windows): Mark externally visible.
22459
22460 * window.c (window_deletion_count): Now static.
22461
22462 * undo.c: Make symbols static if they're not exported.
22463 (last_undo_buffer, last_boundary_position, pending_boundary):
22464 Now static.
22465
22466 * textprop.c (interval_insert_behind_hooks): Now static.
22467 (interval_insert_in_front_hooks): Likewise.
22468
22469 * term.c: Make symbols static if they're not exported.
22470 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22471 (max_frame_lines, tty_set_terminal_modes):
22472 (tty_reset_terminal_modes, tty_turn_off_highlight):
22473 (get_tty_terminal): Now static.
22474 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22475 * termhooks.h (term_mouse_moveto): Do not declare if
22476 HAVE_WINDOW_SYSTEM.
22477 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22478 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22479
22480 * sysdep.c: Make symbols static if they're not exported.
22481 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22482 Now static.
22483 (sigprocmask_set, full_mask): Remove; unused.
22484 (wait_debugging): Mark as visible.
22485 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22486 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22487
22488 * syntax.c (syntax_temp): Define only if !__GNUC__.
22489
22490 * sound.c (current_sound_device, current_sound): Now static.
22491
22492 * search.c (searchbufs, searchbuf_head): Now static.
22493
22494 * scroll.c (scroll_cost): Remove; unused.
22495 * dispextern.h (scroll_cost): Remove decl.
22496
22497 * region-cache.h (pp_cache): Mark as externally visible.
22498
22499 * process.c: Make symbols static if they're not exported.
22500 (process_tick, update_tick, create_process, chan_process):
22501 (Vprocess_alist, proc_buffered_char, datagram_access):
22502 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22503 (deactivate_process): Mark defn as static, as well as decl.
22504 * lisp.h (create_process): Remove decl.
22505 * process.h (chan_process, Vprocess_alist): Remove decls.
22506
22507 * print.c: Make symbols static if they're not exported.
22508 (print_depth, new_backquote_output, being_printed, print_buffer):
22509 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22510 (print_interval, print_number_index, initial_stderr_stream):
22511 Now static.
22512 * lisp.h (Fprinc): Remove decl.
22513 (debug_output_compilation_hack): Mark as externally visible.
22514
22515 * sysdep.c (croak): Move decl from here to syssignal.h.
22516 * syssignal.h (croak): Put it here, so the API can be checked when
22517 'croak' is called from dissociate_if_controlling_tty.
22518
22519 * minibuf.c: Make symbols static if they're not exported.
22520 (minibuf_save_list, choose_minibuf_frame): Now static.
22521 * lisp.h (choose_minibuf_frame): Remove decl.
22522
22523 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22524
22525 * lread.c: Make symbols static if they're not exported.
22526 (read_objects, initial_obarray, oblookup_last_bucket_number):
22527 Now static.
22528 (make_symbol): Remove; unused.
22529 * lisp.h (initial_obarray, make_symbol): Remove decls.
22530
22531 * keyboard.c: Make symbols static if they're not exported.
22532 (single_kboard, recent_keys_index, total_keys, recent_keys):
22533 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22534 (this_single_command_key_start, echoing, last_auto_save):
22535 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22536 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22537 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22538 (Vlispy_mouse_stem, double_click_count):
22539 Now static.
22540 (force_auto_save_soon): Define only if SIGDANGER.
22541 (ignore_mouse_drag_p): Now static if
22542 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22543 (print_help): Remove; unused.
22544 (stop_character, last_timer_event): Mark as externally visible.
22545 * keyboard.h (ignore_mouse_drag_p): Declare only if
22546 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22547 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22548 * lisp.h (echoing): Remove decl.
22549 (force_auto_save_soon): Declare only if SIGDANGER.
22550 * xdisp.c (redisplay_window): Simplify code, to make it more
22551 obvious that ignore_mouse_drag_p is not accessed if !defined
22552 USE_GTK && !defined HAVE_NS.
22553
22554 * intervals.c: Make symbols static if they're not exported.
22555 (merge_properties_sticky, merge_interval_right, delete_interval):
22556 Now static.
22557 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22558
22559 * insdel.c: Make symbols static if they're not exported.
22560 However, leave prepare_to_modify_buffer alone. It's never
22561 called from outside this function, but that appears to be a bug.
22562 (combine_after_change_list, combine_after_change_buffer):
22563 (adjust_after_replace, signal_before_change): Now static.
22564 (adjust_after_replace_noundo): Remove; unused.
22565 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22566 (signal_before_change): Remove decls.
22567
22568 * indent.c (val_compute_motion, val_vmotion): Now static.
22569
22570 * image.c: Make symbols static if they're not exported.
22571 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22572 if USE_GTK.
22573 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22574 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22575
22576 * fringe.c (standard_bitmaps): Now static.
22577 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22578
22579 * frame.c: Make symbols static if they're not exported.
22580 (x_report_frame_params, make_terminal_frame): Now static.
22581 (get_frame_param): Now static, unless HAVE_NS.
22582 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22583 (x_get_resource_string): Remove; not used.
22584 * frame.h (make_terminal_frame, x_report_frame_params):
22585 (x_get_resource_string); Remove decls.
22586 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22587 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22588
22589 * font.c, fontset.c: Make symbols static if they're not exported.
22590 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22591 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22592 * font.c (font_close_object): Now static.
22593 * font.h (font_close_object): Remove.
22594 * fontset.c (FONTSET_OBJLIST): Remove.
22595 (free_realized_fontset) #if-0 the body, which does nothing.
22596 (face_suitable_for_char_p): #if-0, as it's never called.
22597 * fontset.h (face_suitable_for_char_p): Remove decl.
22598 * xfaces.c (face_at_string_position):
22599 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22600 since 0 is always ASCII.
22601
22602 * fns.c (weak_hash_tables): Now static.
22603
22604 * fileio.c: Make symbols static if they're not exported.
22605 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22606 (Vwrite_region_annotation_buffers): Now static.
22607
22608 * eval.c: Make symbols static if they're not exported.
22609 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22610 * lisp.h (backtrace_list): Remove decl.
22611
22612 * emacs.c: Make symbols static if they're not exported.
22613 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22614 (fatal_error_code, fatal_error_signal_hook, standard_args):
22615 Now static.
22616 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22617 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22618 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22619 * lisp.h (fatal_error_signal_hook): Remove decl.
22620 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22621
22622 * editfns.c: Move a (normally-unused) function to its only use.
22623 * editfns.c, lisp.h (get_operating_system_release): Remove.
22624 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22625 worth the hassle of breaking this out.
22626
22627 * xterm.c: Make symbols static if they're not exported.
22628 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22629 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22630 (x_destroy_window, x_delete_display):
22631 Now static.
22632 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22633 (x_mouse_leave): Remove; unused.
22634 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22635 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22636 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22637 Remove decls.
22638 (x_mouse_leave): Declare only if WINDOWSNT.
22639 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22640 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22641 USE_X_TOOLKIT.
22642
22643 * ftxfont.c: Make symbols static if they're not exported.
22644 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22645 HAVE_FREETYPE.
22646 * font.h (ftxfont_driver): Likewise.
22647
22648 * xfns.c: Make symbols static if they're not exported.
22649 (x_last_font_name, x_display_info_for_name):
22650 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22651 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22652 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22653 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22654 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22655 (last_show_tip_args): Now static.
22656 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22657 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22658 (x_screen_planes): Remove; unused.
22659 * dispextern.h (x_screen_planes): Remove decl.
22660
22661 * dispnew.c: Make symbols static if they're not exported.
22662 * dispextern.h (redraw_garbaged_frames, scrolling):
22663 (increment_row_positions): Remove.
22664 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22665 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22666 Now static.
22667 (redraw_garbaged_frames): Remove; unused.
22668
22669 * xfaces.c: Make symbols static if they're not exported.
22670 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22671 Remove decls.
22672 * xterm.h (defined_color): Remove decls.
22673 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22674 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22675 (menu_face_changed_default, defined_color, free_realized_face):
22676 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22677 (ascii_face_of_lisp_face): Remove; unused.
22678
22679 * xdisp.c: Make symbols static if they're not exported.
22680 * dispextern.h (scratch_glyph_row, window_box_edges):
22681 (glyph_to_pixel_coords, set_cursor_from_row):
22682 (get_next_display_element, set_iterator_to_next):
22683 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22684 (show_mouse_face): Remove decls
22685 * frame.h (message_buf_print): Likewise.
22686 * lisp.h (pop_message, set_message, check_point_in_composition):
22687 Likewise.
22688 * xterm.h (set_vertical_scroll_bar): Likewise.
22689 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22690 (message_buf_print, scratch_glyph_row, displayed_buffer):
22691 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22692 (get_next_display_element, show_mouse_face, window_box_edges):
22693 (frame_to_window_pixel_xy, check_point_in_composition):
22694 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22695 (glyph_to_pixel_coords): Remove; unused.
22696
22697 * dired.c (file_name_completion): Now static.
22698
22699 * dbusbind.c (xd_in_read_queued_messages): Now static.
22700
22701 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22702 * data.c (circular_list_error): Remove.
22703
22704 * commands.h (last_point_position, last_point_position_buffer):
22705 (last_point_position_window): Remove decls.
22706 * keyboard.c: Make these variables static.
22707
22708 * coding.h (coding, code_convert_region, encode_coding_gap):
22709 Remove decls.
22710 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22711 (iso_code_class, detect_coding, code_convert_region): Now static.
22712 (encode_coding_gap): Remove; unused.
22713
22714 * chartab.c (chartab_chars, chartab_bits): Now static.
22715
22716 * charset.h (charset_iso_8859_1): Remove decl.
22717 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22718 Now static.
22719
22720 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22721 * ccl.c (Vccl_program_table): Now static.
22722 (check_ccl_update): Remove; unused.
22723
22724 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22725 * category.h: ... from here.
22726 * category.c (check_category_table, set_category_set): Now static.
22727
22728 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22729 * lisp.h: Remove these decls.
22730
22731 * buffer.c (buffer_count): Remove unused var.
22732
22733 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22734 so that it's not optimized away.
22735 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22736 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22737 exported only to the debugger.
22738
22739 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22740 * atimer.h (run_all_atimers): Remove; not exported.
22741
22742 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22743 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22744 was inaccessible from Lisp.
22745 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22746 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22747
22748 alloc.c: Import and export fewer symbols, and remove unused items.
22749 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22750 is defined.
22751 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22752 it's not optimized away by whole-program optimization.
22753 (message_enable_multibyte, free_misc): Remove.
22754 (catchlist, handlerlist, mark_backtrace):
22755 Declare only if BYTE_MARK_STACK.
22756 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22757 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22758 (message_enable_multibyte): Remove decl.
22759 (free_misc, interval_free_list, float_block, float_block_index):
22760 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22761 (cons_free_list, last_marked_index):
22762 Now static.
22763 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22764 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22765 (mark_backtrace): Define only if BYTE_MARK_STACK.
22766 * xdisp.c (message_enable_multibyte): Now static.
22767
22768 Declare Lisp_Object Q* variables to be 'static' if not exported.
22769 This makes it easier for human readers (and static analyzers)
22770 to see whether these variables are used from other modules.
22771 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22772 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22773 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22774 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22775 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22776 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22777 * xmenu.c, xselect.c:
22778 Declare Q* vars static if they are not used in other modules.
22779 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22780 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22781 Remove decls of unexported vars.
22782 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22783
22784 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22785
22786 Make Emacs functions such as Fatom 'static' by default.
22787 This makes it easier for human readers (and static analyzers)
22788 to see whether these functions can be called from other modules.
22789 DEFUN now defines a static function. To make the function external
22790 so that it can be used in other C modules, use the new macro DEFUE.
22791 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22792 (Finit_image_library):
22793 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22794 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22795 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22796 Remove decls, since these functions are now static.
22797 (Funintern, Fget_internal_run_time): New decls, since these functions
22798 were already external.
22799
22800 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22801 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22802 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22803 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22804 * keyboard.c, keymap.c, lread.c:
22805 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22806 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22807 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22808 Mark functions with DEFUE instead of DEFUN,
22809 if they are used in other modules.
22810 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22811 decls for now-static functions.
22812 * buffer.h (Fdelete_overlay): Remove decl.
22813 * callproc.c (Fgetenv_internal): Mark as internal.
22814 * composite.c (Fremove_list_of_text_properties): Remove decl.
22815 (Fcomposition_get_gstring): New forward static decl.
22816 * composite.h (Fcomposite_get_gstring): Remove decl.
22817 * dired.c (Ffile_attributes): New forward static decl.
22818 * doc.c (Fdocumntation_property): New forward static decl.
22819 * eval.c (Ffetch_bytecode): New forward static decl.
22820 (Funintern): Remove extern decl; now in .h file where it belongs.
22821 * fileio.c (Fmake_symbolic_link): New forward static decl.
22822 * image.c (Finit_image_library): New forward static decl.
22823 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22824 * intervals.h (Fprevious_property_change):
22825 (Fremove_list_of_text_properties): Remove decls.
22826 * keyboard.c (Fthis_command_keys): Remove decl.
22827 (Fcommand_execute): New forward static decl.
22828 * keymap.c (Flookup_key): New forward static decl.
22829 (Fcopy_keymap): Now static.
22830 * keymap.h (Flookup_key): Remove decl.
22831 * process.c (Fget_process): New forward static decl.
22832 (Fprocess_datagram_address): Mark as internal.
22833 * syntax.c (Fsyntax_table_p): New forward static decl.
22834 (skip_chars): Remove duplicate decl.
22835 * textprop.c (Fprevious_property_change): New forward static decl.
22836 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22837 Now internal.
22838 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22839 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22840
22841 * editfns.c (Fformat): Remove unreachable code.
22842
22843 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22844
22845 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22846 change. (Bug#8496)
22847
22848 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22849
22850 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22851 when at ZV. (Bug#8487)
22852
22853 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22854
22855 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22856 (Bug#8437)
22857 * keyboard.c (parse_tool_bar_item): Likewise.
22858 * sound.c (sound_cleanup, alsa_close): Likewise.
22859 * termcap.c (tgetent): Likewise.
22860 * xfns.c (x_default_font_parameter): Likewise.
22861 * xsettings.c (read_and_apply_settings): Likewise.
22862
22863 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22864 (overrun_check_free): Protoize.
22865
22866 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22867
22868 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22869 since callers should never pass a negative size.
22870 Change the signature to match that of plain 'read' and 'write'; see
22871 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22872 * lisp.h: Update prototypes of emacs_write and emacs_read.
22873
22874 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22875
22876 * xdisp.c (redisplay_window): Don't try to determine the character
22877 position of the scroll margin if the window start point w->startp
22878 is outside the buffer's accessible region. (Bug#8468)
22879
22880 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22881
22882 Fix write-region and its subroutines for buffers > 2GB.
22883 * fileio.c (a_write, e_write): Modify declaration of arguments and
22884 local variables to support buffers larger than 2GB.
22885 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22886
22887 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22888 argument, local variables, and return value.
22889
22890 * lisp.h: Update prototypes of emacs_write and emacs_read.
22891
22892 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22893
22894 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22895
22896 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22897
22898 Fix more problems found by GCC 4.6.0's static checks.
22899
22900 * xdisp.c (vmessage): Use a better test for character truncation.
22901
22902 * charset.c (load_charset_map): <, not <=, for optimization,
22903 and to avoid potential problems with integer overflow.
22904 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22905 * casetab.c (set_identity, shuffle): Likewise.
22906 * editfns.c (Fformat): Likewise.
22907 * syntax.c (skip_chars): Likewise.
22908
22909 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22910 This also lets GCC 4.6.0 generate slightly better loop code.
22911
22912 * callint.c (Fcall_interactively): <, not <=, for optimization.
22913 (Fcall_interactively): Count the number of arguments produced,
22914 not the number of arguments given. This is simpler and lets GCC
22915 4.6.0 generate slightly better code.
22916
22917 * ftfont.c: Distingish more carefully between FcChar8 and char.
22918 The previous code passed unsigned char * to a functions like
22919 strlen and xstrcasecmp that expect char *, which does not
22920 conform to the C standard.
22921 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22922 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22923 char * when the C standard requires it.
22924
22925 * keyboard.c (read_char): Remove unused var.
22926
22927 * eval.c: Port to Windows vsnprintf (Bug#8435).
22928 Include <limits.h>.
22929 (SIZE_MAX): Define if the headers do not.
22930 (verror): Do not give up if vsnprintf returns a negative count.
22931 Instead, grow the buffer. This ports to Windows vsnprintf, which
22932 does not conform to C99. Problem reported by Eli Zaretskii.
22933 Also, simplify the allocation scheme, by avoiding the need for
22934 calling realloc, and removing the ALLOCATED variable.
22935
22936 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22937
22938 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22939 But keep the doprint source code for now, as we might revamp it
22940 and use it again (Bug#8435).
22941 * lisp.h (doprnt): Remove.
22942 * Makefile.in (base_obj): Remove doprnt.o.
22943 * deps.mk (doprnt.o): Remove.
22944
22945 error: Print 32- and 64-bit integers portably (Bug#8435).
22946 Without this change, on typical 64-bit hosts error ("...%d...", N)
22947 was used to print both 32- and 64-bit integers N, which relied on
22948 undefined behavior.
22949 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22950 * lisp.h (error, verror): Mark as printf-like functions.
22951 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22952 Report overflow in size calculations when allocating printf buffer.
22953 Do not truncate output string at its first null byte.
22954 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22955 Truncate the output at a character boundary, since vsnprintf does not
22956 do that.
22957 * charset.c (check_iso_charset_parameter): Convert internal
22958 character to string before calling 'error', since %c now has the
22959 printf meaning.
22960 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22961 overflow when computing char to be passed to 'error'. Do not
22962 pass Lisp_Object to 'error'; pass the integer instead.
22963 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22964 formatted with plain %d.
22965
22966 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22967
22968 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22969
22970 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22971
22972 * xterm.c (x_catch_errors): Remove duplicate declaration.
22973
22974 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22975
22976 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22977
22978 2011-04-10 Jim Meyering <meyering@redhat.com>
22979
22980 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22981 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22982 return ssize_t not "int", and use size_t as the buffer length.
22983 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22984 * gnutls.h: Update declarations.
22985 * process.c (read_process_output): Use ssize_t, to match.
22986 (send_process): Likewise.
22987
22988 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22989
22990 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22991
22992 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22993
22994 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22995 Use unsigned char, to match FcChar8 type definition.
22996
22997 * xterm.c (handle_one_xevent):
22998 * xmenu.c (create_and_show_popup_menu):
22999 * xselect.c (x_decline_selection_request)
23000 (x_reply_selection_request): Avoid type-punned deref of X events.
23001
23002 2011-04-09 Eli Zaretskii <eliz@gnu.org>
23003
23004 Fix some uses of `int' instead of EMACS_INT.
23005 * search.c (string_match_1, fast_string_match)
23006 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
23007 (scan_buffer, find_next_newline_no_quit)
23008 (find_before_next_newline, search_command, Freplace_match)
23009 (Fmatch_data): Make some `int' variables be EMACS_INT.
23010
23011 * xdisp.c (display_count_lines): 3rd argument and return value now
23012 EMACS_INT. All callers changed.
23013 (pint2hrstr): Last argument is now EMACS_INT.
23014
23015 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
23016 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
23017 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
23018 (decode_coding_utf_16, decode_coding_emacs_mule)
23019 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
23020 (decode_coding_ccl, decode_coding_charset)
23021 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
23022 (decode_coding_iso_2022, decode_coding_emacs_mule)
23023 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
23024 <char_offset, last_offset>: Declare EMACS_INT.
23025 (encode_coding_utf_8, encode_coding_utf_16)
23026 (encode_coding_emacs_mule, encode_invocation_designation)
23027 (encode_designation_at_bol, encode_coding_iso_2022)
23028 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
23029 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
23030 Declare EMACS_INT.
23031 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
23032 (encode_invocation_designation): Last argument P_NCHARS is now
23033 EMACS_INT.
23034 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
23035 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23036
23037 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23038 All users changed.
23039
23040 * ccl.c (Fccl_execute_on_string): Declare some variables
23041 EMACS_INT.
23042
23043 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23044
23045 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23046
23047 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23048
23049 * process.c (Fformat_network_address): Doc fix.
23050
23051 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23052
23053 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23054
23055 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
23056
23057 * keyboard.c (read_char): Call Lisp function help-form-show,
23058 instead of using internal_with_output_to_temp_buffer.
23059 (Qhelp_form_show): New var.
23060 (syms_of_keyboard): Use DEFSYM macro.
23061
23062 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23063
23064 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23065
23066 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
23067
23068 * process.c (Flist_processes): Remove to Lisp.
23069 (list_processes_1): Delete.
23070
23071 2011-04-06 Eli Zaretskii <eliz@gnu.org>
23072
23073 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23074
23075 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23076
23077 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23078
23079 Fix more problems found by GCC 4.6.0's static checks.
23080
23081 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23082
23083 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23084
23085 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23086
23087 * xdisp.c (vmessage): Mark as a printf-like function.
23088
23089 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23090
23091 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23092
23093 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23094 printf-like functions.
23095 (tiff_load): Add casts to remove these marks before passing them
23096 to system-supplied API.
23097
23098 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23099
23100 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23101 This avoids several warnings with gcc -Wstrict-overflow.
23102 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23103 directly, rather than having caller test rule sign. This avoids
23104 some unnecessary tests.
23105 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23106 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23107 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23108
23109 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23110 (xfont_open): Avoid unnecessary tests.
23111
23112 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23113
23114 * composite.h, composite.c (composition_gstring_put_cache):
23115 Use EMACS_INT, not int, for length.
23116
23117 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23118 breaking out part of COMPOSITION_DECODE_RULE.
23119 (COMPOSITION_DECODE_RULE): Use it.
23120 * composite.c (get_composition_id): Remove unused local vars,
23121 by using the new macro.
23122
23123 * textprop.c (set_text_properties_1): Change while to do-while,
23124 since the condition is always true at first.
23125
23126 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23127 (interval_deletion_adjustment): Return unsigned value.
23128 All uses changed.
23129
23130 * process.c (list_processes_1, create_pty, read_process_output):
23131 (exec_sentinel): Remove vars that were set but not used.
23132 (create_pty): Remove unnecessary "volatile"s.
23133 (Fnetwork_interface_info): Avoid possibility of int overflow.
23134 (read_process_output): Do adaptive read buffering even if carryover.
23135 (read_process_output): Simplify nbytes computation if buffered.
23136
23137 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23138
23139 * syntax.c (scan_words): Remove var that was set but not used.
23140 (update_syntax_table): Use unsigned instead of int.
23141
23142 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23143 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23144 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23145
23146 * print.c (print_error_message): Avoid int overflow.
23147
23148 * font.c (font_list_entities): Redo for clarity,
23149 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23150
23151 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23152 (font_score): Avoid potential overflow in diff calculation.
23153
23154 * fns.c (substring_both): Remove var that is set but not used.
23155 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23156
23157 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23158
23159 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23160 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23161 can always succeed if overflow has undefined behavior.
23162
23163 * search.c (boyer_moore, wordify): Remove vars set but not used.
23164 (wordify): Omit three unnecessary tests.
23165
23166 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23167 All callers changed. This avoids the need for an unused var.
23168
23169 * casefiddle.c (casify_region): Remove var that is set but not used.
23170
23171 * dired.c (file_name_completion): Remove var that is set but not used.
23172
23173 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23174
23175 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23176 (Finsert_file_contents): Remove unnecessary code checking fd.
23177
23178 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23179 Check for integer overflow on size calculations.
23180
23181 * buffer.c (Fprevious_overlay_change): Remove var that is set
23182 but not used.
23183
23184 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23185 Remove vars that are set but not used.
23186 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23187 (timer_check_2): Mark vars as initialized.
23188
23189 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23190
23191 * image.c (lookup_image): Remove var that is set but not used.
23192 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23193
23194 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23195 that are set but not used.
23196
23197 * xfns.c (make_invisible_cursor): Don't return garbage
23198 if XCreateBitmapFromData fails (Bug#8410).
23199
23200 * xselect.c (x_get_local_selection, x_handle_property_notify):
23201 Remove vars that are set but not used.
23202
23203 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23204 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23205
23206 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23207 Remove var that is set but not used.
23208 (scroll_bar_windows_size): Now size_t, not int.
23209 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23210 Check for overflow.
23211
23212 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23213 (map_tty_color) [!defined MSDOS]: Likewise.
23214
23215 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23216
23217 * coding.c: Remove vars that are set but not used.
23218 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23219 All callers changed.
23220 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23221 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23222 (decode_coding_charset): Remove vars that are set but not used.
23223
23224 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23225 that is set but not used.
23226
23227 * print.c (print_object): Remove var that is set but not used.
23228
23229 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23230 The gnulib version avoids calling malloc in the usual case,
23231 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23232 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23233 * filelock.c (current_lock_owner): Likewise.
23234 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23235 * sysdep.c: Include allocator.h, careadlinkat.h.
23236 (emacs_no_realloc_allocator): New static constant.
23237 (emacs_readlink): New function.
23238 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23239 ../lib/careadlinkat.h.
23240
23241 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23242
23243 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23244 first non-nil return value).
23245
23246 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23247
23248 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23249 if not defined (Bug#8403).
23250
23251 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23252
23253 * xdisp.c (display_count_lines): Remove parameter `start',
23254 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23255 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23256 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23257 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23258 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23259 and thereabouts. All callers changed.
23260 (get_per_char_metric): Remove parameter `f', unused since
23261 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23262
23263 2011-04-02 Jim Meyering <meyering@redhat.com>
23264
23265 do not dereference NULL upon failed strdup
23266 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23267 (ns_get_family): Likewise.
23268
23269 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23270
23271 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23272
23273 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23274
23275 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23276 later (Bug#8403).
23277
23278 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23279
23280 Add lexical binding.
23281
23282 * window.c (Ftemp_output_buffer_show): New fun.
23283 (Fsave_window_excursion):
23284 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23285
23286 * lread.c (lisp_file_lexically_bound_p): New function.
23287 (Fload): Bind Qlexical_binding.
23288 (readevalloop): Remove `evalfun' arg.
23289 Bind Qinternal_interpreter_environment.
23290 (Feval_buffer): Bind Qlexical_binding.
23291 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23292 Mark as dynamic.
23293 (syms_of_lread): Declare `lexical-binding'.
23294
23295 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23296
23297 * keyboard.c (eval_dyn): New fun.
23298 (menu_item_eval_property): Use it.
23299
23300 * image.c (parse_image_spec): Use Ffunctionp.
23301
23302 * fns.c (concat, mapcar1): Accept byte-code-functions.
23303
23304 * eval.c (Fsetq): Handle lexical vars.
23305 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23306 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23307 (FletX, Flet): Obey lexical binding.
23308 (Fcommandp): Handle closures.
23309 (Feval): New `lexical' arg.
23310 (eval_sub): New function extracted from Feval. Use it almost
23311 everywhere where Feval was used. Look up vars in lexical env.
23312 Handle closures.
23313 (Ffunctionp): Move from subr.el.
23314 (Ffuncall): Handle closures.
23315 (apply_lambda): Remove `eval_flags'.
23316 (funcall_lambda): Handle closures and new byte-code-functions.
23317 (Fspecial_variable_p): New function.
23318 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23319 but without exporting it to Lisp.
23320
23321 * doc.c (Fdocumentation, store_function_docstring):
23322 * data.c (Finteractive_form): Handle closures.
23323
23324 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23325 interactive spec.
23326
23327 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23328 New byte-codes.
23329 (exec_byte_code): New function extracted from Fbyte_code to handle new
23330 calling convention for byte-code-functions. Add new byte-codes.
23331
23332 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23333
23334 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23335
23336 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23337
23338 * xdisp.c (redisplay_internal): Fix prototype.
23339
23340 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23341
23342 * xdisp.c (SCROLL_LIMIT): New macro.
23343 (try_scrolling): Use it when setting scroll_limit.
23344 Limit scrolling to 100 screen lines.
23345 (redisplay_window): Even when falling back on "recentering",
23346 position point in the window according to scroll-conservatively,
23347 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23348
23349 (try_scrolling): When point is above the window, allow searching
23350 as far as scroll_max, or one screenful, to compute vertical
23351 distance from PT to the scroll margin position. This prevents
23352 try_scrolling from unnecessarily failing when
23353 scroll-conservatively is set to a value slightly larger than the
23354 window height. Clean up the case of PT below the margin at bottom
23355 of window: scroll_max can no longer be INT_MAX. When aggressive
23356 scrolling is in use, don't let point enter the opposite scroll
23357 margin as result of the scroll.
23358 (syms_of_xdisp) <scroll-conservatively>: Document the
23359 threshold of 100 lines for never-recentering scrolling.
23360
23361 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23362
23363 * dispextern.h (move_it_by_lines):
23364 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23365 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23366 (message_log_check_duplicate): Remove parameters `prev_bol' and
23367 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23368 (redisplay_internal): Remove parameter `preserve_echo_area',
23369 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23370
23371 * indent.c (Fvertical_motion):
23372 * window.c (window_scroll_pixel_based, Frecenter):
23373 Don't pass `need_y_p' to `move_it_by_lines'.
23374
23375 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23376
23377 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23378 steal a few bits to be more compact.
23379 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23380 Remove unneeded casts.
23381
23382 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23383
23384 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23385
23386 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23387 binding" message (bug#7967).
23388
23389 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23390
23391 Fix more problems found by GCC 4.6.0's static checks.
23392
23393 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23394 Remove unused local var.
23395
23396 * editfns.c (Fmessage_box): Remove unused local var.
23397
23398 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23399 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23400 Omit unused local vars.
23401 * window.c (shrink_windows): Omit unused local var.
23402 * menu.c (digest_single_submenu): Omit unused local var.
23403 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23404 Omit unused local var.
23405
23406 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23407 Don't assume string length fits in int.
23408 (keyremap_step, read_key_sequence): Use size_t for sizes.
23409 (read_key_sequence): Don't check last_real_key_start redundantly.
23410
23411 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23412 instead of alloca (Bug#8344).
23413
23414 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23415 (Fbacktrace_frame): Don't assume nframes fits in int.
23416
23417 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23418
23419 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23420 concerns.
23421
23422 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23423
23424 * cm.c (calccost): Turn while-do into do-while, for clarity.
23425
23426 * keyboard.c (syms_of_keyboard): Use the same style as later
23427 in this function when indexing through an array. This also
23428 works around GCC bug 48267.
23429
23430 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23431
23432 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23433
23434 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23435 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23436
23437 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23438 This avoids undefined behavior on integer overflow, and is a bit
23439 more convenient anyway since it is compared to a size_t variable.
23440
23441 Variadic C functions now count arguments with size_t, not int.
23442 This avoids an unnecessary limitation on 64-bit machines, which
23443 caused (substring ...) to crash on large vectors (Bug#8344).
23444 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23445 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23446 All variadic functions and their callers changed accordingly.
23447 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23448 * data.c (arith_driver, float_arith_driver): Likewise.
23449 * editfns.c (general_insert_function): Likewise.
23450 * eval.c (struct backtrace.nargs, interactive_p)
23451 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23452 (funcall_lambda, mark_backtrace): Likewise.
23453 * fns.c (concat): Likewise.
23454 * frame.c (x_set_frame_parameters): Likewise.
23455 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23456 0 if not found, not -1. All callers changed.
23457
23458 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23459 (stack_copy_size): Now size_t, not int.
23460 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23461
23462 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23463
23464 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23465 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23466 All callers changed.
23467
23468 * lisp.h (multibyte_char_to_unibyte):
23469 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23470 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23471 * character.h (CHAR_TO_BYTE8):
23472 * cmds.c (internal_self_insert):
23473 * editfns.c (general_insert_function):
23474 * keymap.c (push_key_description):
23475 * search.c (Freplace_match):
23476 * xdisp.c (message_dolog, set_message_1): All callers changed.
23477
23478 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23479
23480 * keyboard.c (safe_run_hook_funcall): New function.
23481 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23482 don't set the hook to nil, but remove the offending function instead.
23483 (Qcommand_hook_internal): Remove, unused.
23484 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23485 Vcommand_hook_internal.
23486
23487 * eval.c (enum run_hooks_condition): Remove.
23488 (funcall_nil, funcall_not): New functions.
23489 (run_hook_with_args): Call each function through a `funcall' argument.
23490 Remove `cond' argument, now redundant.
23491 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23492 (Frun_hook_with_args_until_failure): Adjust accordingly.
23493 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23494
23495 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23496
23497 * dispextern.h (string_buffer_position): Remove declaration.
23498
23499 * print.c (strout): Remove parameter `multibyte', unused since
23500 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23501
23502 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23503 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23504 All callers changed.
23505
23506 * w32.c (_wsa_errlist): Use braces for struct initializers.
23507
23508 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23509 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23510 All callers changed.
23511 (string_buffer_position): Likewise. Also, make static (it's never
23512 used outside xdisp.c).
23513 (cursor_row_p): Remove parameter `w', unused since
23514 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23515 (decode_mode_spec): Remove parameter `precision', introduced during
23516 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23517 All callers changed.
23518
23519 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23520
23521 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23522
23523 2011-03-27 Anders Lindgren <andlind@gmail.com>
23524
23525 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23526 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23527 (ns_update_auto_hide_menu_bar): New functions.
23528 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23529 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23530 ns_constrain_all_frames.
23531 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23532 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23533
23534 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23535
23536 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23537
23538 2011-03-27 Glenn Morris <rgm@gnu.org>
23539
23540 * syssignal.h: Replace RETSIGTYPE with void.
23541 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23542 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23543 Replace SIGTYPE with void everywhere.
23544 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23545 * s/template.h (SIGTYPE): Remove commented out definition.
23546
23547 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23548
23549 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23550 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23551
23552 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23553
23554 * w32.c (read_unc_volume): Use parameter `henum', instead of
23555 global variable `wget_enum_handle'.
23556
23557 * keymap.c (describe_vector): Remove parameters `indices' and
23558 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23559 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23560
23561 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23562
23563 * keyboard.c (timer_check): Remove parameter `do_it_now',
23564 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23565 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23566 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23567
23568 * keyboard.c (read_char):
23569 * w32menu.c (w32_menu_display_help):
23570 * xmenu.c (show_help_event, menu_help_callback):
23571 Adjust calls to `show_help_echo'.
23572
23573 * gtkutil.c (xg_maybe_add_timer):
23574 * keyboard.c (readable_events):
23575 * process.c (wait_reading_process_output):
23576 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23577
23578 * insdel.c (adjust_markers_gap_motion):
23579 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23580 (gap_left, gap_right): Don't call it.
23581
23582 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23583
23584 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23585 incurred during fontification.
23586
23587 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23588
23589 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23590 (DEFVAR_PER_BUFFER): Don't pass it.
23591
23592 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23593 (scrolling_window): Don't pass it.
23594
23595 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23596
23597 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23598
23599 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23600 and `suffix'.
23601 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23602 of variables specific to SELinux and computation of `encoded_absname'.
23603
23604 * image.c (XPutPixel): Remove unused variable `height'.
23605
23606 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23607
23608 * unexw32.c (get_section_info): Remove unused variable `section'.
23609
23610 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23611 (system_process_attributes): Remove unused variable `sess'.
23612 (sys_read): Remove unused variable `err'.
23613
23614 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23615 (w32_wnd_proc): Remove unused variable `isdead'.
23616 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23617 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23618 (x_create_tip_frame): Remove unused variable `tem'.
23619
23620 * w32inevt.c (w32_console_read_socket):
23621 Remove unused variable `no_events'.
23622
23623 * w32term.c (x_draw_composite_glyph_string_foreground):
23624 Remove unused variable `width'.
23625
23626 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23627
23628 * w32term.c (x_set_glyph_string_clipping):
23629 Don't pass uninitialized region to CombineRgn.
23630
23631 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23632
23633 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23634 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23635 (Fx_close_connection): Remove unused variable `i'.
23636
23637 * w32font.c (w32font_draw): Return number of glyphs.
23638 (w32font_open_internal): Remove unused variable `i'.
23639 (w32font_driver): Add missing initializer.
23640
23641 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23642 (fill_in_menu): Remove unused variable `items_added'.
23643
23644 * w32term.c (last_mouse_press_frame): Remove static global variable.
23645 (w32_clip_to_row): Remove unused variable `f'.
23646 (x_delete_terminal): Remove unused variable `i'.
23647
23648 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23649 (NOTHING): Remove unused static global variable.
23650 (uniscribe_check_otf): Remove unused variable `table'.
23651 (uniscribe_font_driver): Add missing initializers.
23652
23653 2011-03-23 Julien Danjou <julien@danjou.info>
23654
23655 * term.c (Fsuspend_tty, Fresume_tty):
23656 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23657 * window.c (temp_output_buffer_show):
23658 * insdel.c (signal_before_change):
23659 * frame.c (Fhandle_switch_frame):
23660 * fileio.c (Fdo_auto_save):
23661 * emacs.c (Fkill_emacs):
23662 * editfns.c (save_excursion_restore):
23663 * cmds.c (internal_self_insert):
23664 * callint.c (Fcall_interactively):
23665 * buffer.c (Fkill_all_local_variables):
23666 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23667 Use Frun_hooks.
23668 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23669 unconditionally since it does the check itself.
23670
23671 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23672
23673 Fix more problems found by GCC 4.5.2's static checks.
23674
23675 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23676 the first time through the loop, since we know p0 < p1 then.
23677 This also avoids a gcc -Wstrict-overflow warning.
23678
23679 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23680 leading to a memory leak, possible in functions like
23681 load_charset_map_from_file that can allocate an unbounded number
23682 of objects (Bug#8318).
23683
23684 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23685 that could (at least in theory) be that large.
23686
23687 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23688 This is less likely to overflow, and avoids undefined behavior if
23689 overflow does occur. All callers changed. Use strtoul to scan
23690 for the unsigned long integer.
23691 (pint2hrstr): Simplify and tune code slightly.
23692 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23693
23694 * scroll.c (do_scrolling): Work around GCC bug 48228.
23695 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23696
23697 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23698 This also avoids a warning with gcc -Wstrict-overflow.
23699 (validate_x_resource_name): Simplify count usage.
23700 This also avoids a warning with gcc -Wstrict-overflow.
23701
23702 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23703 fail (Bug#8306).
23704
23705 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23706
23707 * process.c (Fmake_network_process): Use socklen_t, not int,
23708 where POSIX says socklen_t is required in portable programs.
23709 This fixes a porting bug on hosts like 64-bit HP-UX, where
23710 socklen_t is wider than int (Bug#8277).
23711 (Fmake_network_process, server_accept_connection):
23712 (wait_reading_process_output, read_process_output):
23713 Likewise.
23714
23715 * process.c: Rename or move locals to avoid shadowing.
23716 (list_processes_1, Fmake_network_process):
23717 (read_process_output_error_handler, exec_sentinel_error_handler):
23718 Rename or move locals.
23719 (Fmake_network_process): Define label "retry_connect" only if needed.
23720 (Fnetwork_interface_info): Fix pointer signedness.
23721 (process_send_signal): Add cast to avoid pointer signedness problem.
23722 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23723 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23724
23725 Make tparam.h and terminfo.c consistent.
23726 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23727 Include tparam.h instead, since it declares them.
23728 * cm.h (PC): Remove extern decl; tparam.h now does this.
23729 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23730 * terminfo.c: Include tparam.h, to check interfaces.
23731 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23732 (tparam): Adjust signature to match interface in tparam.h;
23733 this removes some undefined behavior. Check that outstring and len
23734 are zero, which they always are with Emacs.
23735 * tparam.h (PC, BC, UP): New extern decls.
23736
23737 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23738 (xftfont_open): Rename locals to avoid shadowing.
23739
23740 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23741 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23742 (OTF_TAG_SYM): Omit macro if not needed.
23743 (ftfont_list): Remove unused local.
23744 (get_adstyle_property, ftfont_pattern_entity):
23745 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23746 Rename locals to avoid shadowing.
23747
23748 * xfont.c (xfont_list_family): Mark var as initialized.
23749
23750 * xml.c (make_dom): Now static.
23751
23752 * composite.c (composition_compute_stop_pos): Rename local to
23753 avoid shadowing.
23754 (composition_reseat_it): Remove unused locals.
23755 (find_automatic_composition, composition_adjust_point): Likewise.
23756 (composition_update_it): Mark var as initialized.
23757 (find_automatic_composition): Mark vars as initialized,
23758 with a FIXME (Bug#8290).
23759
23760 character.h: Rename locals to avoid shadowing.
23761 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23762 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23763 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23764 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23765 to avoid shadowing.
23766
23767 * textprop.c (property_change_between_p): Remove; unused.
23768
23769 * intervals.c (interval_start_pos): Now static.
23770
23771 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23772
23773 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23774 Rename locals to avoid shadowing.
23775
23776 * sound.c (wav_play, au_play, Fplay_sound_internal):
23777 Fix pointer signedness.
23778 (alsa_choose_format): Remove unused local var.
23779 (wav_play): Initialize a variable to 0, to prevent undefined
23780 behavior (Bug#8278).
23781
23782 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23783
23784 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23785
23786 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23787 clobbering (Bug#8298).
23788 * sysdep.c (sys_subshell): Likewise.
23789 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23790
23791 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23792 This should get cleaned up, so that child_setup has the
23793 same signature on all platforms.
23794
23795 * callproc.c (call_process_cleanup): Now static.
23796 (relocate_fd): Rename locals to avoid shadowing.
23797
23798 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23799
23800 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23801 not to be necessary, and produces flickering.
23802
23803 2011-03-20 Glenn Morris <rgm@gnu.org>
23804
23805 * config.in: Remove file.
23806
23807 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23808
23809 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23810 are now in src/globals.h.
23811 (syms_of_minibuf): Remove spurious & from previous change.
23812
23813 2011-03-20 Leo Liu <sdl.web@gmail.com>
23814
23815 * minibuf.c (completing-read-function): New variable.
23816 (completing-read-default): Rename from completing-read.
23817 (completing-read): Call completing-read-function.
23818
23819 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23820
23821 * xfaces.c (Fx_load_color_file):
23822 Read color file from absolute filename (bug#8250).
23823
23824 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23825
23826 * makefile.w32-in: Update dependencies.
23827
23828 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23829
23830 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23831
23832 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23833
23834 Fix more problems found by GCC 4.5.2's static checks.
23835
23836 * process.c (make_serial_process_unwind, send_process_trap):
23837 (sigchld_handler): Now static.
23838
23839 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23840 That way, the code declares only the vars that it needs.
23841 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23842 * s/cygwin.h (PTY_ITERATION): Likewise.
23843 * s/darwin.h (PTY_ITERATION): Likewise.
23844 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23845
23846 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23847 * process.c (allocate_pty): Don't declare stb unless it's needed.
23848
23849 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23850 (CONSTANTLIM): Remove; unused.
23851 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23852 Define only if needed.
23853
23854 * unexelf.c (unexec): Name an expression,
23855 to avoid gcc -Wbad-function-cast warning.
23856 Use a different way to cause a compilation error if anyone uses
23857 n rather than nn, a way that does not involve shadowing.
23858 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23859
23860 * deps.mk (unexalpha.o): Remove; unused.
23861
23862 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23863 * unexec.h: New file.
23864 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23865 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23866 Depend on unexec.h.
23867 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23868 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23869 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23870 Change as necessary to match prototype in unexec.h.
23871
23872 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23873 shadowing.
23874 (back_comment, skip_chars): Mark vars as initialized.
23875
23876 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23877 Rename locals to avoid shadowing.
23878
23879 * lread.c (read1): Rewrite so as not to use empty "else".
23880 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23881
23882 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23883
23884 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23885 warning when compiling print.c.
23886
23887 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23888 instead of using an uninitialized var.
23889 (font_sort_entities): Mark var as initialized.
23890
23891 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23892
23893 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23894 pointers to constants.
23895 (font_parse_fcname): Remove unused vars.
23896 (font_delete_unmatched): Now static.
23897 (font_get_spec): Remove; unused.
23898 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23899 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23900 Rename or move locals to avoid shadowing.
23901
23902 * fns.c (require_nesting_list, require_unwind): Now static.
23903 (Ffillarray): Rename locals to avoid shadowing.
23904
23905 * floatfns.c (domain_error2): Define only if needed.
23906 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23907
23908 * alloc.c (mark_backtrace): Move decl from here ...
23909 * lisp.h: ... to here, so that it can be checked.
23910
23911 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23912 (Fdefvar): Rewrite so as not to use empty "else".
23913 (lisp_indirect_variable): Name an expression,
23914 to avoid gcc -Wbad-function-cast warning.
23915 (Fdefvar): Rename locals to avoid shadowing.
23916
23917 * callint.c (quotify_arg, quotify_args): Now static.
23918 (Fcall_interactively): Rename locals to avoid shadowing.
23919 Use const pointer when appropriate.
23920
23921 * lisp.h (get_system_name, get_operating_system_release):
23922 Move decls here, to check interfaces.
23923 * process.c (get_operating_system_release): Move decl to lisp.h.
23924 * xrdb.c (get_system_name): Likewise.
23925 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23926 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23927 some of which prompt warnings from gcc -Wbad-function-cast.
23928 (Fformat_time_string, Fencode_time, Finsert_char):
23929 (Ftranslate_region_internal, Fformat):
23930 Rename or remove local vars to avoid shadowing.
23931 (Ftranslate_region_internal): Mark var as initialized.
23932
23933 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23934 avoid shadowing.
23935
23936 * lisp.h (eassert): Check that the argument compiles, even if
23937 ENABLE_CHECKING is not defined.
23938
23939 * data.c (Findirect_variable): Name an expression, to avoid
23940 gcc -Wbad-function-cast warning.
23941 (default_value, arithcompare, arith_driver, arith_error): Now static.
23942 (store_symval_forwarding): Rename local to avoid shadowing.
23943 (Fmake_variable_buffer_local, Fmake_local_variable):
23944 Mark variables as initialized.
23945 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23946
23947 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23948 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23949 Rename locals to avoid shadowing.
23950 (mark_stack): Move local variables into the #ifdef region where
23951 they're used.
23952 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23953 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23954 needed otherwise.
23955 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23956 (GC_STRING_CHARS): Remove; not used.
23957 (Fmemory_limit): Cast sbrk's returned value to char *.
23958
23959 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23960 avoids undefined behavior in theory.
23961
23962 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23963
23964 Use functions, not macros, for up- and down-casing (Bug#8254).
23965 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23966 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23967 to use the following functions instead of these macros.
23968 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23969 EMACS_INT, since callers assume the returned value fits in int.
23970 (upcase1): Likewise, for UPCASE_TABLE.
23971 (uppercasep, lowercasep, upcase): New static inline functions.
23972 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23973 the race-condition problem in the old DOWNCASE.
23974
23975 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23976 Rename locals to avoid shadowing.
23977 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23978 (regex_compile, re_search_2, re_match_2_internal):
23979 Remove unused local vars.
23980 (FREE_VAR): Rewrite so as not to use empty "else",
23981 which gcc can warn about.
23982 (regex_compile, re_match_2_internal): Mark locals as initialized.
23983 (RETALLOC_IF): Define only if needed.
23984 (WORDCHAR_P): Likewise. This one is never needed, but is used
23985 only in a comment talking about a compiler bug, so put inside
23986 the #if 0 of that comment.
23987 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23988 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23989 Remove; unused.
23990
23991 * search.c (boyer_moore): Rename locals to avoid shadowing.
23992 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23993 (PREV_CHAR_BOUNDARY): Likewise.
23994
23995 * search.c (simple_search): Remove unused var.
23996
23997 * dired.c (compile_pattern): Move decl from here ...
23998 * lisp.h: ... to here, so that it can be checked.
23999 (struct re_registers): New forward decl.
24000
24001 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
24002
24003 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
24004 All uses changed.
24005 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
24006 Rename locals to avoid shadowing.
24007 (Fvertical_motion): Mark locals as initialized.
24008
24009 * casefiddle.c (casify_object, casify_region): Now static.
24010 (casify_region): Mark local as initialized.
24011
24012 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
24013
24014 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
24015 New macros, so that the caller can use some names other than
24016 gcpro1, gcpro2, etc.
24017 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
24018 of the new macros.
24019 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
24020 argument, for consistency with GCPRO2_VAR, etc: it is now the
24021 prefix of the variable, not the variable itself. All uses
24022 changed.
24023 * dired.c (directory_files_internal, file_name_completion):
24024 Rename locals to avoid shadowing.
24025
24026 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
24027 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
24028 dired.c's scmp function, had undefined behavior.
24029 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24030 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
24031 * buffer.h: ... to here, because these macros use current_buffer,
24032 and the new implementation with inline functions needs to have
24033 current_buffer in scope now, rather than later when the macros
24034 are used.
24035 (downcase, upcase1): New static inline functions.
24036 (DOWNCASE, UPCASE1): Reimplement using these functions.
24037 This avoids undefined behavior in expressions like
24038 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24039 from race conditions in accessing the global variables
24040 case_temp1 and case_temp2.
24041 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24042 * lisp.h (case_temp1, case_temp2): Remove their decls.
24043 * character.h (ASCII_CHAR_P): Move from here ...
24044 * lisp.h: ... to here, so that the inline functions mentioned
24045 above can use them.
24046
24047 * dired.c (directory_files_internal_unwind): Now static.
24048
24049 * fileio.c (file_name_as_directory, directory_file_name):
24050 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24051 Now static.
24052 (file_name_as_directory): Use const pointers when appropriate.
24053 (Fexpand_file_name): Likewise. In particular, newdir might
24054 point at constant storage, so make it a const pointer.
24055 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24056 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24057 signedness issues.
24058 (Fset_file_times, Finsert_file_contents, auto_save_error):
24059 Rename locals to avoid shadowing.
24060
24061 * minibuf.c (choose_minibuf_frame_1): Now static.
24062 (Ftry_completion, Fall_completions): Rename or remove locals
24063 to avoid shadowing.
24064
24065 * marker.c (bytepos_to_charpos): Remove; unused.
24066
24067 * lisp.h (verify_bytepos, count_markers): New decls,
24068 so that gcc does not warn that these functions aren't declared.
24069
24070 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24071 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24072 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24073 (copy_text): Remove unused local var.
24074
24075 * filelock.c (within_one_second): Now static.
24076 (lock_file_1): Rename local to avoid shadowing.
24077
24078 * buffer.c (fix_overlays_before): Mark locals as initialized.
24079 (fix_start_end_in_overlays): Likewise. This function should be
24080 simplified by using pointers-to-pointers, but that's a different
24081 matter.
24082 (switch_to_buffer_1): Now static.
24083 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24084 (report_overlay_modification): Rename locals to avoid shadowing.
24085
24086 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24087 Fix pointer signedness issue.
24088 (sys_subshell): Mark local as volatile if checking for lint,
24089 to suppress a gcc -Wclobbered warning that does not seem to be right.
24090 (MAXPATHLEN): Define only if needed.
24091
24092 * process.c (serial_open, serial_configure): Move decls from here ...
24093 * systty.h: ... to here, so that they can be checked.
24094
24095 * fns.c (get_random, seed_random): Move extern decls from here ...
24096 * lisp.h: ... to here, so that they can be checked.
24097
24098 * sysdep.c (reset_io): Now static.
24099 (wait_for_termination_signal): Remove; unused.
24100
24101 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24102 (copy_keymap_item, append_key, push_text_char_description):
24103 Now static.
24104 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24105 (DENSE_TABLE_SIZE): Remove; unused.
24106 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24107 (describe_map_tree):
24108 Rename locals to avoid shadowing.
24109
24110 * keyboard.c: Declare functions static if they are not used elsewhere.
24111 (echo_char, echo_dash, cmd_error, top_level_2):
24112 (poll_for_input, handle_async_input): Now static.
24113 (read_char, kbd_buffer_get_event, make_lispy_position):
24114 (make_lispy_event, make_lispy_movement, apply_modifiers):
24115 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24116 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24117 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24118 (read_key_sequence, read_char): Mark locals as initialized.
24119 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24120
24121 * keyboard.h (make_ctrl_char): New decl.
24122 (mark_kboards): Move decl here ...
24123 * alloc.c (mark_kboards): ... from here.
24124
24125 * lisp.h (force_auto_save_soon): New decl.
24126
24127 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24128 (DEFINE_DUMMY_FUNCTION): New macro.
24129 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24130 Use it.
24131 (main): Add casts to avoid warnings
24132 if GCC considers string literals to be constants.
24133
24134 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24135
24136 * dbusbind.c: Pointer signedness fixes.
24137 (xd_signature, xd_append_arg, xd_initialize):
24138 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24139 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24140 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24141 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24142
24143 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24144 if GCC considers string literals to be constants.
24145 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24146
24147 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24148
24149 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24150 (print_preprocess, print_object): New macro to fix last change.
24151
24152 * print.c (print_preprocess): Don't forget font objects.
24153
24154 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
24155
24156 * emacs.c (USAGE3): Doc fixes.
24157
24158 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24159
24160 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24161 structure.
24162
24163 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
24164
24165 * lisp.h (VWindow_system, Qfile_name_history):
24166 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24167 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24168 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24169
24170 * w32select.c: Don't #include "keyboard.h".
24171 (run_protected): Add extern declaration for waiting_for_input.
24172
24173 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24174 * w32console.c (detect_input_pending, read_input_pending)
24175 (encode_terminal_code):
24176 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24177 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24178 (w32_system_caret_y, Qfile_name_history):
24179 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24180 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24181 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24182 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24183 * w32proc.c (Qlocal, report_file_error):
24184 * w32term.c (Vwindow_system, updating_frame):
24185 * w32uniscribe.c (initialized, uniscribe_font_driver):
24186 Remove unneeded extern declarations.
24187
24188 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
24189
24190 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24191
24192 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24193
24194 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24195 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24196 These macros can no longer be used for assignment.
24197
24198 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24199 Assign struct members directly, instead of using BUF_BEGV etc.
24200 (record_buffer_markers, fetch_buffer_markers): New functions for
24201 recording and fetching special buffer markers.
24202 (set_buffer_internal_1, set_buffer_temp): Use them.
24203
24204 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24205
24206 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24207
24208 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24209 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24210
24211 * xdisp.c (hscroll_window_tree):
24212 (reconsider_clip_changes): Use PT instead of BUF_PT.
24213
24214 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24215
24216 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24217 $(EMACS_ROOT)/lib/intprops.h.
24218
24219 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24220
24221 Fix more problems found by GCC 4.5.2's static checks.
24222
24223 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24224 to unsigned char * to avoid compiler diagnostic.
24225 (xg_free_frame_widgets): Make it clear that a local variable is
24226 needed only if USE_GTK_TOOLTIP.
24227 (gdk_window_get_screen): Make it clear that this macro is needed
24228 only if USE_GTK_TOOLTIP.
24229 (int_gtk_range_get_value): New function, which avoids a diagnostic
24230 from gcc -Wbad-function-cast.
24231 (xg_set_toolkit_scroll_bar_thumb): Use it.
24232 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24233 diagnostic from gcc -Wbad-function-cast.
24234 (get_utf8_string, xg_get_file_with_chooser):
24235 Rename locals to avoid shadowing.
24236 (create_dialog): Move locals to avoid shadowing.
24237
24238 * xgselect.c (xg_select): Remove unused var.
24239
24240 * image.c (four_corners_best): Mark locals as initialized.
24241 (gif_load): Initialize transparent_p to zero (Bug#8238).
24242 Mark another local as initialized.
24243 (my_png_error, my_error_exit): Mark with NO_RETURN.
24244
24245 * image.c (clear_image_cache): Now static.
24246 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24247 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24248 (x_edge_detection): Remove unnecessary cast that
24249 gcc -Wbad-function-cast diagnoses.
24250 (gif_load): Fix pointer signedness.
24251 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24252 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24253
24254 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24255
24256 Improve quality of tests for time stamp overflow.
24257 For example, without this patch (encode-time 0 0 0 1 1
24258 1152921504606846976) returns the obviously-bogus value (-948597
24259 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24260 reports time overflow. See
24261 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24262 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24263 * editfns.c: Include limits.h and intprops.h.
24264 (TIME_T_MIN, TIME_T_MAX): New macros.
24265 (time_overflow): Move earlier, to before first use.
24266 (hi_time, lo_time): New functions, for an accurate test for
24267 out-of-range times.
24268 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24269 (Fget_internal_run_time): Don't assume time_t fits in int.
24270 (make_time): Use list2 instead of Fcons twice.
24271 (Fdecode_time): More accurate test for out-of-range times.
24272 (check_tm_member): New function.
24273 (Fencode_time): Use it, to test for out-of-range times.
24274 (lisp_time_argument): Don't rely on undefined left-shift and
24275 right-shift behavior when checking for time stamp overflow.
24276
24277 * editfns.c (time_overflow): New function, refactoring common code.
24278 (Fformat_time_string, Fdecode_time, Fencode_time):
24279 (Fcurrent_time_string): Use it.
24280
24281 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24282 * dired.c (make_time): Move to ...
24283 * editfns.c (make_time): ... here.
24284 * systime.h: Note the move.
24285
24286 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24287
24288 * fringe.c (update_window_fringes): Remove unused variables.
24289
24290 * unexmacosx.c (copy_data_segment): Also copy __got section.
24291 (Bug#8223)
24292
24293 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24294
24295 * termcap.c [MSDOS]: Include "msdos.h".
24296 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24297 Constify `char *' arguments and their references according to
24298 prototypes in tparam.h.
24299
24300 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24301
24302 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24303 Adapt all references accordingly.
24304
24305 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24306
24307 2011-03-11 Tom Tromey <tromey@redhat.com>
24308
24309 * buffer.c (syms_of_buffer): Remove obsolete comment.
24310
24311 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24312
24313 * termhooks.h (encode_terminal_code): Declare prototype.
24314
24315 * msdos.c (encode_terminal_code): Don't declare prototype.
24316
24317 * term.c (encode_terminal_code): Now external again, used by
24318 w32console.c and msdos.c.
24319
24320 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24321 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24322
24323 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24324
24325 Fix some minor problems found by GCC 4.5.2's static checks.
24326
24327 * fringe.c (update_window_fringes): Mark locals as initialized
24328 (Bug#8227).
24329 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24330
24331 * alloc.c (mark_fringe_data): Move decl from here ...
24332 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24333 to check its interface.
24334 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24335
24336 * fontset.c (free_realized_fontset): Now static.
24337 (Fset_fontset_font): Rename local to avoid shadowing.
24338 (fontset_font): Mark local as initialized.
24339 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24340
24341 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24342
24343 * xselect.c (x_disown_buffer_selections): Remove; not used.
24344 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24345 (x_own_selection, Fx_disown_selection_internal): Rename locals
24346 to avoid shadowing.
24347 (x_handle_dnd_message): Remove local to avoid shadowing.
24348
24349 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24350 so that the caller can use some name other than gcpro1.
24351 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24352 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24353 (Fx_backspace_delete_keys_p):
24354 Use them to avoid shadowing, and rename vars to avoid shadowing.
24355 (x_decode_color, x_set_name, x_window): Now static.
24356 (Fx_create_frame): Add braces to silence GCC warning.
24357 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24358 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24359 Remove unused locals.
24360 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24361 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24362 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24363 macros.
24364
24365 * xterm.h (x_mouse_leave): New decl.
24366
24367 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24368 Remove unused functions.
24369 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24370 (x_calc_absolute_position): Now static.
24371 (XTread_socket): Don't define label "out" unless it's used.
24372 Don't declare local "event" unless it's used.
24373 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24374 unless they are used.
24375 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24376 (x_fatal_error_signal): Remove; not used.
24377 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24378 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24379 (x_error_catcher, x_connection_closed, x_error_handler):
24380 (x_error_quitter, xembed_send_message, x_iconify_frame):
24381 (my_log_handler): Rename locals to avoid shadowing.
24382 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24383 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24384
24385 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24386 Rename or move locals to avoid shadowing.
24387 (tty_defined_color, merge_face_heights): Now static.
24388 (free_realized_faces_for_fontset): Remove; not used.
24389 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24390 does not deduce is never used uninitialized.
24391 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24392 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24393
24394 * terminal.c (store_terminal_param): Now static.
24395
24396 * xmenu.c (menu_highlight_callback): Now static.
24397 (set_frame_menubar): Remove unused local.
24398 (xmenu_show): Rename parameter to avoid shadowing.
24399 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24400 since they might point to immutable storage.
24401 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24402 since it's unused otherwise.
24403
24404 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24405 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24406 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24407 avoids a gcc -Wuninitialized diagnostic.
24408 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24409 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24410 does not deduce are never used uninitialized.
24411
24412 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24413
24414 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24415 * window.c (window_loop, size_window):
24416 (run_window_configuration_change_hook, enlarge_window): Likewise.
24417
24418 * window.c (display_buffer): Now static.
24419 (size_window): Mark variables that gcc -Wuninitialized
24420 does not deduce are never used uninitialized.
24421 * window.h (check_all_windows): New decl, to forestall
24422 gcc -Wmissing-prototypes diagnostic.
24423 * dispextern.h (bidi_dump_cached_states): Likewise.
24424
24425 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24426 shadowing.
24427 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24428 Include <limits.h>.
24429 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24430 and to avoid gcc -Wuninitialized warning.
24431 (load_charset_map): Mark variables that gcc -Wuninitialized
24432 does not deduce are never used uninitialized.
24433 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24434
24435 * coding.c (coding_set_source, coding_set_destination):
24436 Use "else { /* comment */ }" rather than "else /* comment */;"
24437 for clarity, and to avoid gcc -Wempty-body warning.
24438 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24439 a block, when the outer 'i' will do.
24440 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24441 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24442 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24443 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24444 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24445 Rename locals to avoid shadowing.
24446 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24447 * coding.c (emacs_mule_char, encode_invocation_designation):
24448 Now static, since they're not used elsewhere.
24449 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24450 (decode_coding_object, encode_coding_object, detect_coding_system):
24451 (decode_coding_emacs_mule): Mark variables that gcc
24452 -Wuninitialized does not deduce are never used uninitialized.
24453 (detect_coding_iso_2022): Initialize a local variable that might
24454 be used uninitialized. Leave a FIXME because it's not clear that
24455 this initialization is needed. (Bug#8211)
24456 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24457 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24458 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24459 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24460 Remove unused macros.
24461
24462 * category.c (hash_get_category_set): Remove unused local var.
24463 (copy_category_table): Now static, since it's not used elsewhere.
24464 * character.c (string_count_byte8): Likewise.
24465
24466 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24467 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24468
24469 * chartab.c (copy_sub_char_table): Now static, since it's not used
24470 elsewhere.
24471 (sub_char_table_ref_and_range, char_table_ref_and_range):
24472 Rename locals to avoid shadowing.
24473 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24474
24475 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24476 (BIDI_BOB): Remove unused macro.
24477
24478 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24479 deduce are never used uninitialized.
24480 * term.c (encode_terminal_code): Likewise.
24481
24482 * term.c (encode_terminal_code): Now static. Remove unused local.
24483
24484 * tparam.h: New file.
24485 * term.c, tparam.h: Include it.
24486 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24487 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24488 Move these decls to tparam.h, and make them agree with what
24489 is actually in tparam.c. The previous trick of using incompatible
24490 decls in different modules does not conform to the C standard.
24491 All callers of tparam changed to use tparam's actual API.
24492 * tparam.c (tparam1, tparam, tgoto):
24493 Use const pointers where appropriate.
24494
24495 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24496 * cm.h (struct cm): Likewise.
24497 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24498 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24499 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24500 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24501 (turn_on_face, init_tty): Likewise.
24502 * termchar.h (struct tty_display_info): Likewise.
24503
24504 * term.c (term_mouse_position): Rename local to avoid shadowing.
24505
24506 * alloc.c (mark_ttys): Move decl from here ...
24507 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24508
24509 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24510
24511 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24512
24513 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24514
24515 * search.c (compile_pattern_1): Remove argument regp, unused since
24516 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24517 (compile_pattern): Don't pass it.
24518
24519 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24520
24521 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24522 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24523 for ! HAVE_GTK3.
24524 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24525
24526 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24527
24528 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24529 gdk_window_get_screen, gdk_window_get_geometry,
24530 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24531 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24532 (xg_get_pixbuf_from_pixmap): New function.
24533 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24534 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24535 Call xg_get_pixbuf_from_pixmap instead of
24536 gdk_pixbuf_get_from_drawable.
24537 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24538 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24539 (xg_check_special_colors): Use GtkStyleContext and its functions
24540 for HAVE_GTK3.
24541 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24542 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24543 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24544 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24545 Call gtk_widget_get_preferred_size.
24546 (xg_frame_resized): gdk_window_get_geometry only takes 5
24547 parameters.
24548 (xg_win_to_widget, xg_event_is_for_menubar):
24549 Call gdk_x11_window_lookup_for_display.
24550 (xg_set_widget_bg): New function.
24551 (delete_cb): New function.
24552 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24553 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24554 (xg_set_background_color): Call xg_set_widget_bg.
24555 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24556 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24557 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24558 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24559 if ! HAVE_GTK3.
24560 (update_frame_tool_bar): Call gtk_widget_hide.
24561 (xg_initialize): Use GDK_KEY_g.
24562
24563 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24564 if ! HAVE_GTK3
24565 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24566
24567 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24568 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24569 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24570
24571 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24572
24573 * w32xfns.c (select_palette): Check success of RealizePalette against
24574 GDI_ERROR, not zero.
24575
24576 See ChangeLog.11 for earlier changes.
24577
24578 ;; Local Variables:
24579 ;; coding: utf-8
24580 ;; End:
24581
24582 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24583
24584 This file is part of GNU Emacs.
24585
24586 GNU Emacs is free software: you can redistribute it and/or modify
24587 it under the terms of the GNU General Public License as published by
24588 the Free Software Foundation, either version 3 of the License, or
24589 (at your option) any later version.
24590
24591 GNU Emacs is distributed in the hope that it will be useful,
24592 but WITHOUT ANY WARRANTY; without even the implied warranty of
24593 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24594 GNU General Public License for more details.
24595
24596 You should have received a copy of the GNU General Public License
24597 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.