1 2013-06-09 Eli Zaretskii <eliz@gnu.org>
3 * xdisp.c (get_it_property): If it->object is a buffer, pass to
4 get-char-property the window that is being rendered, instead of
5 the buffer, to support window-specific overlays. (Bug#14575)
7 2013-06-08 Eli Zaretskii <eliz@gnu.org>
9 * bidi.c (bidi_fetch_char): Accept additional argument, the window
10 being displayed, and pass it to compute_display_string_pos.
11 (bidi_level_of_next_char, bidi_resolve_explicit_1)
12 (bidi_paragraph_init): All callers changed.
14 * xdisp.c (init_from_display_pos, init_iterator)
15 (handle_single_display_spec, next_overlay_string)
16 (get_overlay_strings_1, reseat_1, reseat_to_string)
17 (push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set
18 bidi_it.w member from it->w.
19 (compute_display_string_pos): Accept additional argument, the
20 window being displayed, and pass it to Fget_char_property.
23 * dispextern.h (struct bidi_it): New member w, the window being
25 (compute_display_string_pos): Adjust prototype.
27 2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
29 * xgselect.c: Remove unneeded include xterm.h
31 * process.c (wait_reading_process_output): Check for NS before GLIB.
32 GLIB may be linked in due to rsvg, but ns_select must be called.
34 * xgselect.c (xg_select): Remove call to window_system_available
35 and g_main_context_pending at the top, so Gdk events (i.e. file
36 notify) are processed when Emacs is started with -nw.
38 2013-06-07 Eli Zaretskii <eliz@gnu.org>
40 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
41 (ctagsfiles3): New variable, includes only *.m files.
42 (TAGS): Use an explicit language name in the regular expressions,
43 to avoid transformation of '/SOMETHING' by MSYS to
46 2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
48 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
50 2013-06-06 Eli Zaretskii <eliz@gnu.org>
52 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
53 still need to set the mouse pointer shape and activate help-echo.
56 2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
58 A few porting etc. fixes for the new file monitor code.
59 See the thread containing
60 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
61 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
62 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
63 (dir_monitor_callback, Fgfile_rm_watch):
64 Use assq_no_quit instead of Fassoc, for speed.
65 (dir_monitor_callback, Fgfile_rm_watch):
66 eassert that the monitor is a fixnum.
67 (dir_monitor_callback): No need for CDR_SAFE.
68 Simplify building of lisp with alternative tails.
69 (Fgfile_add_watch, Fgfile_rm_watch):
70 Do not assume glib functions set errno reliably on failure.
71 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
72 and signal an error otherwise.
73 (Fgfile_rm_watch): Prefer CONSP to !NILP.
74 Use Fdelq instead of Fdelete, for speed.
76 2013-06-05 Eli Zaretskii <eliz@gnu.org>
78 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
79 don't insist on being invoked on a highlighted tool-bar button.
80 Avoids losing tool-bar functionality when mouse-highlight is nil.
81 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
82 Don't highlight when mouse-highlight is nil.
83 (note_mouse_highlight): When mouse-highlight is nil, don't return
84 right away; instead, run tool-bar and mode-line highlight
85 subroutine, clear any existing highlight, and revert the mouse
86 pointer to its default shape. (Bug#14558)
88 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
90 * lisp.mk (lisp): Add prog-mode.el.
92 2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
94 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
95 * process.c (dummy_handler): New function.
96 (lib_child_handler): New static var.
97 (handle_child_signal): Invoke it.
98 (catch_child_signal): If a library has set up a signal handler,
99 save it into lib_child_handler.
100 (init_process_emacs): If using glib and not on Windows, tickle glib's
101 child-handling code so that it initializes its private SIGCHLD handler.
102 * syssignal.h (SA_SIGINFO): Default to 0.
103 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
104 31; it should no longer be needed now.
106 2013-06-05 Michael Albinus <michael.albinus@gmx.de>
108 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
110 * gfilenotify.c (globals_of_gfilenotify): New function.
111 (syms_of_gfilenotify): Move global initialization there.
113 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
115 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
117 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
118 * keyboard.c (menu_bar_items, tool_bar_items):
119 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
120 not override local keymaps any more.
122 2013-06-04 Eli Zaretskii <eliz@gnu.org>
124 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
126 2013-06-03 Eli Zaretskii <eliz@gnu.org>
128 * w32console.c (initialize_w32_display): Return the dimensions of
129 the console window via 2 additional arguments, not via the current
130 frame. This avoids crashes due to overrunning the bounds of
131 frame's decode_mode_spec_buffer, which is not resized following
132 the change of the frame dimensions from the initial 10x10.
134 * w32term.h (w32_initialize_display_info): Adjust prototype.
136 * term.c (init_tty): Take dimensions of the frame from the values
137 returned by initialize_w32_display.
139 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
140 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
141 (LIBES): Add $(GFILENOTIFY_LIBS).
143 * w32inevt.c (handle_file_notifications): Add dummy implementation
146 * w32term.c: Wrap code with HAVE_W32NOTIFY.
148 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
150 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
152 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
154 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
156 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
158 Fix minor problems found by static checking.
159 * data.c (pure_write_error):
160 Use xsignal2, not Fsignal, as Fsignal might return.
161 * eval.c (set_backtrace_debug_on_exit): Now static.
162 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
163 No longer inline. EXTERN_INLINE is needed only for functions
164 defined in .h files. Reindent function header as per GNU style.
165 (backtrace_p, backtrace_top, backtrace_next):
166 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
167 compiler or linker. Add extern decls to pacify gcc -Wall.
168 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
170 * frame.c (free_monitors): Define only on platforms that need it.
171 * nsterm.m (ns_term_init):
172 * process.c (catch_child_signal):
173 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
174 defined on all porting targets these days.
175 * process.c, process.h (catch_child_signal):
176 Make it extern only if NS_IMPL_GNUSTEP is defined.
178 2013-06-03 Eli Zaretskii <eliz@gnu.org>
180 * w32.c (gettimeofday): Make the signature identical to prototype
181 in nt/inc/sys/time.h.
183 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
185 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
188 * keyboard.c (safe_run_hooks_error): Improve error message.
190 * data.c (pure_write_error): Add `object' argument.
191 * puresize.h (CHECK_IMPURE): Use it.
193 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
195 * Makefile.in (NOTIFY_OBJ): New variable.
196 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
198 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
199 Call syms_of_gfilenotify.
201 * gfilenotify.c: New file.
203 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
205 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
206 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
208 * lisp.h: Declare syms_of_gfilenotify.
210 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
212 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
214 Merge the specpdl and backtrace stacks. Make the structure of the
215 specpdl entries more obvious via a tagged union of structs.
216 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
217 (enum specbind_tag): New enum.
218 (struct specbinding): Make it a tagged union of structs.
219 Add a case for backtrace records.
220 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
221 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
222 (backtrace_debug_on_exit): New accessors.
223 (struct backtrace): Remove.
224 (struct catchtag): Remove backlist field.
225 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
227 (Flocal_variable_p): Speed up the common case where the binding is
229 * eval.c (backtrace_list): Remove.
230 (set_specpdl_symbol, set_specpdl_old_value): Remove.
231 (set_backtrace_args, set_backtrace_nargs)
232 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
233 (backtrace_next): New functions.
234 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
235 (unwind_to_catch, internal_lisp_condition_case)
236 (internal_condition_case, internal_condition_case_1)
237 (internal_condition_case_2, internal_condition_case_n): Don't bother
238 with backtrace_list any more.
239 (Fsignal): Adjust to new backtrace format.
240 (grow_specpdl): Move up.
241 (record_in_backtrace): New function.
242 (eval_sub, Ffuncall): Use it.
243 (apply_lambda): Adjust to new backtrace format.
244 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
246 (specbind): Adjust to new specpdl format. Simplify.
247 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
248 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
250 (mark_backtrace): Remove.
251 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
252 * xdisp.c (redisplay_internal): Use record_in_backtrace.
253 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
255 * profiler.c (record_backtrace): Use get_backtrace.
256 (handle_profiler_signal): Use backtrace_top_function.
257 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
260 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
262 * process.h (catch_child_signal): Declare.
264 * process.c (catch_child_signal): New function.
265 (init_process_emacs): Call it.
267 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
268 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
270 (x_set_cursor_type): Remove declaration.
271 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
272 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
273 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
274 (ns_get_color): Use F suffix on float.
275 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
276 (ns_get_rgb_color): Remove.
277 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
278 (note_mouse_movement): x and y are CGFloat.
279 (ns_draw_fringe_bitmap): Remove unused rowY.
280 Change #if to COCOA && >= 10_6.
281 (ns_draw_window_cursor): Remove unused overspill.
282 (ns_draw_underwave): width and x are EamcsCGFloat.
283 (ns_draw_box): thickness is CGFloat.
284 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
285 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
286 if not in main thread.
287 (ns_get_pending_menu_title, ns_check_menu_open)
288 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
289 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
290 (sendFromMainThread:): New method.
291 (changeFont:): size is CGFloat.
292 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
293 Disable warning about permanent text.
294 (characterIndexForPoint:): Adjust return type depending on GNUStep
296 (mouseDown:): delta is CGFloat.
297 (updateFrameSize): Remove unised variable f.
298 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
299 Cast float to EmacsCGFloat.
300 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
301 also to -1 when restoring.
302 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
303 inside NS_IMPL_COCOA.
304 (toggleFullScreen:): Put call to toggleFullScreen inside
305 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
306 (setPosition:portion:whole:): por is CGFloat.
307 (getMouseMotionPart:window:x:y:): Add F suffix to float.
308 (mouseDown:): Use CGFloat.
309 (mouseDragged:): Remove unised variable edge.
310 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
312 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
314 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
315 when NS_IMPL_GNUSTEP.
316 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
317 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
318 (EmacsToolbar): Add clearAll. Add tag argument to
319 addDisplayItemWithImage.
320 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
322 * nsselect.m (ns_get_local_selection): Remove unused variable type.
324 * nsmenu.m (ns_update_menubar): Make static.
325 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
326 (fillWithWidgetValue:): Add cast to SEL for setAction.
327 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
328 (update_frame_tool_bar): Update code for GNUStep.
329 (clearAll): New method.
330 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
331 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
332 identifierToItem setObject and activeIdentifiers addObject before
333 call to insertItemWithItemIdentifier.
334 (validateVisibleItems): Fix indentation.
335 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
336 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
337 UtilityWindow to aStyle, remove call to setStyleMask.
339 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
341 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
342 (ns_charset_covers, ns_get_covering_families, nsfont_open):
343 Use F suffix on floats.
344 (ns_char_width): Returns CGFloat.
345 (ns_ascii_average_width): w is CGFloat instead of float.
346 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
348 (ns_glyph_metrics): CGFloat instead of float.
350 * nsfns.m (x_set_foreground_color, x_set_background_color):
352 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
353 remove unused variables.
354 (Fns_read_file_name): Keep track if panel is for save.
355 Use ns_filename_from_panel/ns_directory_from_panel.
356 (Fns_list_services): delegate only used for COCOA.
357 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
358 Just return the input if GNUStep.
359 (x_screen_planes): Remove.
360 (Fxw_color_values): Use EmacsCGFloat
361 (Fns_display_monitor_attributes_list): Only get screen number for
363 (getDirectory, getFilename): Removed from EmacsOpenPanel and
365 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
366 ns_directory_from_panel.
368 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
370 * process.c (handle_child_signal): Also use WCONTINUED.
371 This is so that list-processes doesn't mistakenly list the process
372 as stopped, when the process has actually been continued and is
375 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
377 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
378 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
379 not already configured.
381 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
383 2013-05-29 Eli Zaretskii <eliz@gnu.org>
385 * Makefile.in (mostlyclean): Remove *.res files.
387 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
389 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
392 2013-05-27 Eli Zaretskii <eliz@gnu.org>
394 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
395 display vector, and we backtrack, handle the case that the
396 previous character position is also displayed from a display
397 vector or covered by a display string or image. (Bug#14476)
399 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
401 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
402 (struct MonitorInfo, free_monitors): Remove.
403 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
404 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
405 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
408 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
409 (struct MonitorInfo, free_monitors): Remove.
410 (ns_screen_name): Make static.
411 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
412 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
415 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
416 (struct MonitorInfo): New struct.
417 (free_monitors, make_monitor_attribute_list): Declare.
419 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
421 (free_monitors, make_monitor_attribute_list): New functions.
422 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
425 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
427 * callproc.c (call_process): Refine the doc string. (Bug#14045)
429 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
431 * keyboard.c: Apply keyboard decoding only to events that come directly
432 from the tty, not from unread-command-events (bug#14368).
433 (read_event_from_main_queue): New function, extracted from read_char).
434 (read_decoded_char): Remove.
435 (read_decoded_event_from_main_queue): New function to replace it.
437 (read_key_sequence): Use read_char rather than read_decoded_char.
439 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
441 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
443 * casetab.c (init_casetab_once): Fix last change (bug#14424).
445 2013-05-22 Kenichi Handa <handa@gnu.org>
447 The following changes are to fix the setting of
448 buffer-file-coding-system on, for instance, C-x RET c unix RET
449 _FILE_OF_DOS_EOL_TYPE_ RET.
451 * coding.h (struct coding_system): New member detected_utf8_chars.
453 * coding.c (detect_coding_utf_8): Count characters and check EOL
454 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
456 (setup_coding_system): Do not initialize coding->head_ascii.
457 (check_ascii): Do not set coding->eol_seen but update it. Do not
458 call adjust_coding_eol_type here.
459 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
460 If the eol-type of CODING is already specified, adjust the eol type
461 of the found coding-system.
462 (decode_coding_gap): Cancel previous change. Utilize the
463 character numbers counted by detect_coding_utf_8. Fix detection
466 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
468 * search.c (looking_at_1): Only set last_thing_searched if the match
469 changed the match-data (bug#14281).
471 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
473 * xdisp.c (reseat_at_previous_visible_line_start):
474 Already declared in dispextern.h, so remove it here.
475 (move_it_vertically_backward): Likewise.
477 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
479 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
480 (Fx_display_pixel_width, Fx_display_pixel_height)
481 (Fx_display_mm_width, Fx_display_mm_height):
482 Mention `display-monitor-attributes-list' in docstrings.
484 * nsfns.m (ns_get_screen): Remove function. All uses removed.
485 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
486 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
487 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
488 (Fx_display_backing_store, Fx_display_visual_class)
489 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
490 (Fx_display_grayscale_p, Fx_display_pixel_width)
491 (Fx_display_pixel_height, Fx_display_planes)
492 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
493 (Fx_display_screens): Don't confuse X11 screens with NS screens.
494 (Fx_display_mm_width, Fx_display_mm_height)
495 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
496 height for all physical monitors as in X11.
498 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
499 Return pixel width or height for all physical monitors as in X11.
501 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
503 Port --enable-gcc-warnings to clang.
504 * bytecode.c (exec_byte_code):
506 Redo diagnostic pragmas to pacify clang, too.
507 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
508 * editfns.c (Fencode_time):
509 * fileio.c (file_accessible_directory_p):
510 * font.c (font_unparse_xlfd):
511 Use '&"string"[index]' instead of '"string" + (index)'.
512 * undo.c (user_error): Remove; unused.
514 2013-05-16 Eli Zaretskii <eliz@gnu.org>
516 * insdel.c (insert_1_both): Document the arguments, instead of
517 referring to insert_1, which no longer exists.
519 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
520 some window, increment windows_or_buffers_changed, so that
521 *Messages* display in that window is updated. (Bug#14408)
523 * w32.c: Include epaths.h.
524 (init_environment): Use cmdproxy.exe without leading directories.
525 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
527 (gettimeofday): Adjust signature and return value to Posix
530 * unexw32.c (open_output_file): Delete the existing emacs.exe
531 before creating it, to break the hard link to the versioned
534 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
535 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
536 (FIRSTFILE_OBJ): New variables.
537 (W32_RES): Rename to EMACSRES. All users changed.
538 (base_obj): Use $(CM_OBJ).
539 (ALLOBJS): Use $(FIRSTFILE_OBJ).
540 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
541 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
542 $(W32_RES_LINK) before $(LIBES).
543 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
545 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
547 * makefile.w32-in (DOC): Use just "DOC".
549 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
551 * process.c: Export default filters and sentinels to Elisp.
552 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
554 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
555 (Fset_process_sentinel, Fformat_network_address):
556 Default to them instead of nil.
557 (server_accept_connection): Sentinels can't be nil any more.
558 (read_and_dispose_of_process_output): New function, extracted from
560 (read_process_output): Use it; filters can't be nil.
561 (Finternal_default_process_filter): New function, extracted from
563 (exec_sentinel_unwind): Remove function.
564 (exec_sentinel): Don't zilch sentinel while running.
565 (status_notify): Sentinels can't be nil.
566 (Finternal_default_process_sentinel): New function extracted from
568 (setup_process_coding_systems): Default filter is not nil any more.
569 (syms_of_process): Export new Elisp functions and initialize
571 * lisp.h (make_lisp_proc): New function.
573 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
575 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
577 2013-05-14 Eli Zaretskii <eliz@gnu.org>
579 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
580 unless we know that the window w is a leaf window.
581 Another attempt at solving bug#14062.
583 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
585 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
588 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
590 * image.c (gif_load): Check that subimages fit (Bug#14345).
592 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
594 * lread.c (skip_dyn_eof): New function.
595 (read1): Use it to skip the end of a file in response to #@00.
597 * doc.c (get_doc_string): Slightly relax the sanity checking.
599 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
601 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
602 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
603 (MonitorInfo): New struct.
604 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
605 (Fns_display_monitor_attributes_list): New functions.
606 (display-usable-bounds): Remove.
607 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
610 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
612 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
613 (GTK_CHECK_VERSION): New macro, if not already defined.
614 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
615 replaced by GTK_CHECK_VERSION.
617 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
619 * xterm.h (GTK_PREREQ): New macro.
620 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
621 to use this macro instead, for consistency and clarity.
623 2013-05-08 Eli Zaretskii <eliz@gnu.org>
625 * xdisp.c (row_for_charpos_p): New function, with code of
626 cursor_row_p, but accepts an additional argument CHARPOS instead
627 of using a hardcoded PT.
628 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
629 (row_containing_pos): Call row_for_charpos_p instead of partially
630 doing the same. Fixes cursor positioning under longlines-mode
631 when longlines-show-effect includes more than one newline, when
632 moving the cursor vertically up.
634 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
636 * makefile.w32-in (ACL_H): New macro.
637 ($(BLD)/fileio.$(O)): Update dependencies.
639 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
641 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
642 * Makefile.in (LIB_ACL): New macro.
643 (LIBACL_LIBS): Remove.
644 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
645 * fileio.c: Include <acl.h>.
646 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
647 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
649 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
652 * unexelf.c: Don't assume ElfW (Half) fits in int.
653 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
654 when dealing with ElfW (Half) values, since they can exceed 2**31
655 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
656 (entry_address): Omit unused NUM arg. All uses changed.
658 2013-05-07 Juri Linkov <juri@jurta.org>
660 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
661 to the string converted from number with `Fnumber_to_string'.
664 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
666 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
667 This fixes a problem introduced by my previous change.
669 2013-05-07 Glenn Morris <rgm@gnu.org>
671 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
673 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
675 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
677 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
679 Static checking by GCC 4.8.0.
680 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
681 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
682 (x_get_monitor_attributes_fallback)
683 (x_get_monitor_attributes_xinerama)
684 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
685 Define only if USE_GTK.
686 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
687 (x_get_monitor_attributes_fallback): Omit unused locals.
688 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
689 Use double, not float, to avoid mixed-mode floating point arithmetic.
691 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
692 Jan Djärv <jan.h.d@swipnet.se>
694 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
695 (XINERAMA_CFLAGS): New macros.
696 (ALL_CFLAGS, LIBES): Use them.
698 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
699 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
700 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
701 (syms_of_xfns): DEFSYM them.
702 (struct MonitorInfo): New struct.
703 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
704 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
705 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
706 (x_get_monitor_attributes_xinerama): New functions.
707 (Fx_display_monitor_attributes_list): New primitive.
708 (syms_of_xfns): Defsubr it.
710 * xterm.h (x_display_info): Add Xatom_net_workarea and
711 Xatom_net_current_desktop.
713 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
714 and dpyinfo->Xatom_net_current_desktop.
716 2013-05-06 Eli Zaretskii <eliz@gnu.org>
718 * xdisp.c (pos_visible_p): Use the special code for finding the
719 beginning of a display property or overlay for any "replacing"
720 display property, not just for display strings. This solves
721 incorrect reporting of position by posn-at-point. (Bug#14241)
723 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
725 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
726 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
727 Verify that ElfW (Half) fits in int.
728 (fatal): Use same signature as lisp.h.
729 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
730 configure and build with -DUNEXELF_DEBUG without worrying about
731 other modules that use DEBUG.
732 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
733 possibly-wide integers now uses it instead of plain fprintf.
734 (entry_address): New function, which avoids problems with 32-bit
735 overflow on 64-bit hosts.
736 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
737 (round_up): Don't assume the remainder fits in int.
738 (find_section): Use bool for boolean. Simplify debug code.
739 (unexec): Don't assume file sizes fit in int or size_t.
740 Omit unnecessary trailing newline in 'fatal' format.
741 Use strerror rather than outputting decimal error number.
742 Remove unused code when emacs is not defined;
743 this file relies on Emacs now.
744 Don't assume e_phnum and e_shnum are positive.
746 * regex.c: Fix problems when DEBUG is defined.
747 (extract_number, extract_number_and_incr): Define regardless of
748 whether DEBUG is defined; that's simpler and makes the code less
749 likely to go stale in the normal case when DEBUG is not defined.
750 Return int rather than taking an int * arg. All callers changed.
751 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
752 Remove, replacing with ...
753 (DEBUG_PRINT): New macro. All callers changed.
754 (DEBUG_COMPILES_ARGUMENTS): New macro.
755 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
756 (print_compiled_pattern, print_double_string) [DEBUG]:
757 Use prototype rather than old-style definition.
758 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
759 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
760 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
761 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
762 Don't assume ptrdiff_t, size_t, and long are the same width as int.
763 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
764 This matters only when DEBUG is defined.
766 2013-05-05 Eli Zaretskii <eliz@gnu.org>
768 * xdisp.c (set_iterator_to_next): Set the
769 ignore_overlay_strings_at_pos_p flag only if we are _really_
770 iterating over an overlay string, as indicated by the
771 current.overlay_string_index member. (Bug#14306)
773 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
775 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
776 to where it is used, to avoid autorelease issues (Bug#14050).
778 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
780 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
781 * fileio.c (syms_of_fileio): Implement this.
782 * filelock.c (create_lock_file): If symbolic links don't work, so
783 we use a regular file as a lock file, do not fsync the lock file;
786 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
788 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
789 (syms_of_minibuf): Adjust accodingly.
791 * callint.c (Fcall_interactively): Adjust calls accordingly.
793 2013-05-04 Eli Zaretskii <eliz@gnu.org>
795 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
796 w->contents is a buffer before computing everything else.
797 Use parentheses to disambiguate last part of the condition.
799 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
800 assertion violations. (Bug#14062)
802 2013-05-01 David Reitter <david.reitter@gmail.com>
804 * nsfns.m (ns_tooltip): Initialize.
806 2013-04-28 Eli Zaretskii <eliz@gnu.org>
808 * coding.c (decode_coding_gap): Don't remove the character before
809 a newline unless it's a CR character. (Bug#14287)
811 2013-04-28 Dan Nicolaescu <dann@gnu.org>
813 * dispextern.h (struct face): Move enum face_underline_type
814 earlier so that bitfields can be in the same word.
816 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
818 * nsfns.m (handlePanelKeys): New function.
819 (EmacsOpenPanel:performKeyEquivalent:)
820 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
821 arrows/function/control and copy/paste keys (Bug#14296).
823 2013-04-27 Juri Linkov <juri@jurta.org>
825 * callint.c (Fcall_interactively): Call `Qread_number' for
826 interactive code letter `n' instead of using duplicate code.
829 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
831 * systime.h (make_timeval): Declare as 'const'.
833 2013-04-27 Kenichi Handa <handa@gnu.org>
835 * font.c (font_open_entity): Always open a font of manageable
838 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
840 Port better to AIX (Bug#14258).
841 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
844 2013-04-24 Kenichi Handa <handa@gnu.org>
846 * coding.c (decode_coding_iso_2022): When an invalid escape
847 sequence is encountered, reset the invocation and designation
848 status to the safest one.
850 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
852 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
853 Without this fix, "make distclean" leaves stamp-h1 behind.
855 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
857 * w32fns.c (w32_fullscreen_rect): New function to compute the
858 window rectangle for the given fullscreen mode.
859 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
860 longer tunes the window size. This keeps the window's edges flush
861 with the screen and allows the taskbar to hide itself in fullboth.
863 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
864 window decorations and uses the entire screen.
866 * w32term.h (w32_fullscreen_rect) Add prototype.
867 (struct w32_output): Replace normal_width, normal_height,
868 normal_top, and normal_left members with a single normal_placement
870 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
872 (FRAME_NORMAL_PLACEMENT): New macro.
874 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
876 * minibuf.c (Ftest_completion): Silence compiler warning.
878 2013-04-15 Eli Zaretskii <eliz@gnu.org>
880 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
883 * frame.h (WINDOW_FRAME): Protect macro and its argument with
886 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
887 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
888 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
889 parentheses where appropriate.
891 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
893 * keyboard.c (timer_start_idle): Remove no-longer-used local.
895 2013-04-14 Eli Zaretskii <eliz@gnu.org>
897 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
898 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
899 Mention in the doc string that setting these variables takes
900 effect only after a call to set-window-buffer. (Bug#14200)
902 2013-04-13 Eli Zaretskii <eliz@gnu.org>
904 * indent.c (Fvertical_motion): Don't consider display strings on
905 overlay strings as display strings on the buffer position we
906 started from. This prevents vertical cursor motion from jumping
907 more than one line when there's an overlay string with a display
908 property at end of line.
909 Reported by Karl Chen <Karl.Chen@quarl.org> in
910 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
912 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
914 * window.c (select_window): `record_buffer' even if window is
915 already selected (bug#14191).
917 2013-04-11 Eli Zaretskii <eliz@gnu.org>
919 * window.c (Fwindow_end): Test more flags, including the buffer's
920 last_overlay_modified flag, to determine whether the window's
921 display is really up-to-date. Prevents the function from
922 returning a stale value. (Bug#14170)
923 (Fwindow_line_height): Fix the test for up-to-date-ness of the
926 2013-04-10 Eli Zaretskii <eliz@gnu.org>
928 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
929 garbaged only if it is not already the top frame on its TTY.
930 This prevents flickering due to constant redrawing of TTY frames when
931 there are GUI frames open in the same session. (Bug#13864)
933 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
935 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
936 of marking the idle timers directly.
938 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
940 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
943 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
945 * window.c (select_window): Don't record_buffer while the invariant is
946 temporarily broken (bug#14161).
948 * fns.c (Fdelq): Don't assume !NILP => CONSP.
950 2013-04-07 Eli Zaretskii <eliz@gnu.org>
952 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
954 2013-04-07 Romain Francoise <romain@orebokech.com>
956 Ignore additional platform-specific ACL errors (Bug#13702).
957 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
958 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
960 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
962 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
965 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
967 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
968 This bug was introduced by my 2013-02-25 change that simplified
969 data_start configuration. Without this change, on GNU/Linux
970 an Emacs configured with --enable-profiling fails immediately
971 due to a profiler signal.
972 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
973 with these flags. On platforms where special flags are needed
974 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
975 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
976 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
978 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
980 Get rid of some platform-specific functions examining window
981 system and its capabilities. This is a partial rework of the
983 * lisp.h (have_menus_p): Remove prototype. This function is
984 replaced with platform-independent window_system_available.
985 (check_window_system): Move to...
986 * frame.h (decode_window_system_frame, window_system_available):
987 ...here, add new prototypes.
988 * frame.c (window_system_available, decode_window_system_frame):
990 (check_window_system): Platform-independent now.
991 * xterm.h (x_in_use): Remove declaration.
993 * w32term.h (check_x_frame):
994 * nsterm.h (check_x_frame): Remove prototypes. This function
995 is replaced with platform-independent decode_window_system_frame.
996 * msdos.c (have_menus_p): Remove.
997 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
998 Remove platform-specific functions. Use check_window_system,
999 decode_window_system_frame and check_ns_display_info where
1000 appropriate. Minor style and comment tweaks.
1001 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
1002 (check_x_frame): Likewise.
1003 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
1005 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
1006 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
1007 * xmenu.c, xselect.c: All related users changed.
1009 2013-04-03 Kenichi Handa <handa@gnu.org>
1011 The following changes is to optimize the code for reading UTF-8
1014 * coding.c (check_ascii): Rename from detect_ascii. Return value
1015 changed. Check EOL format. Do not call adjust_coding_eol_type
1017 (check_utf_8): New function.
1018 (adjust_coding_eol_type): Do nothing if already adjusted.
1019 (detect_coding): Compare the return value of check_ascii with
1020 coding->src_bytes. Call adjust_coding_eol_type if necessary.
1021 (decode_coding_gap): Optimize for valid UTF-8.
1023 2013-03-21 Kenichi Handa <handa@gnu.org>
1025 * coding.c (syms_of_coding): Cancel previous change.
1027 * insdel.c (insert_from_gap): Fix previous change.
1029 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
1031 Consistently use platform-specific function to detect window system.
1032 * lisp.h (check_window_system): New prototype. This function is
1033 going to replace check_x, check_w32 and check_ns.
1034 (have_menus_p): Mention msdos.c in comment.
1035 * fontset.c (check_window_system_func): Remove. Adjust all users.
1036 * fontset.h (check_window_system_func): Remove prototype.
1037 * nsterm.h (check_ns):
1038 * xterm.h (check_x):
1039 * w32term.h (check_w32): Likewise.
1040 * menu.c (Fx_popup_menu): Use check_window_system.
1041 * msdos.c (check_window_system): Define for MS-DOS.
1042 * nsfns.m (check_window_system): Define for NS. Adjust all users.
1043 * w32fns.c (check_window_system): Likewise for MS-Windows.
1044 * xfns.c (check_window_system): Likewise for X.
1045 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
1046 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
1048 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
1050 Prefer < to > in range checks such as 0 <= i && i < N.
1051 This makes it easier to visualize quantities on a number line.
1052 This patch doesn't apply to all such range checks,
1053 only to the range checks affected by the 2013-03-24 change.
1054 This patch reverts most of the 2013-03-24 change.
1055 * alloc.c (xpalloc, Fgarbage_collect):
1056 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
1057 * character.c (string_escape_byte8):
1058 * charset.c (read_hex):
1059 * data.c (cons_to_unsigned):
1060 * dispnew.c (update_frame_1):
1061 * doc.c (Fsubstitute_command_keys):
1062 * doprnt.c (doprnt):
1063 * editfns.c (hi_time, decode_time_components):
1064 * fileio.c (file_offset):
1065 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1066 * font.c (font_intern_prop):
1067 * frame.c (x_set_alpha):
1068 * gtkutil.c (get_utf8_string):
1069 * indent.c (check_display_width):
1070 * keymap.c (Fkey_description):
1071 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
1073 * minibuf.c (read_minibuf_noninteractive):
1074 * process.c (wait_reading_process_output):
1075 * search.c (Freplace_match):
1076 * window.c (get_phys_cursor_glyph):
1077 * xdisp.c (redisplay_internal):
1078 * xsmfns.c (smc_save_yourself_CB):
1079 Prefer < to > for range checks.
1080 * dispnew.c (sit_for): Don't mishandle NaNs.
1081 This fixes a bug introduced in the 2013-03-24 change.
1082 * editfns.c (decode_time_components): Don't hoist comparison.
1083 This fixes another bug introduced in the 2013-03-24 change.
1085 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
1087 * frame.h (struct frame): Drop scroll_bottom_vpos
1088 member becaue all real users are dead long ago.
1089 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
1090 * xdisp.c (redisplay_internal): Adjust user.
1092 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
1094 * nsmenu.m (showAtX:Y:for:): setLevel to
1095 NSPopUpMenuWindowLevel (Bug#13998).
1097 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
1099 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
1100 (ns_check_pending_open_menu): Declare.
1102 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
1103 (x_activate_menubar): Update the menu with title that matches
1104 ns_get_pending_menu_title, and call
1105 ns_check_pending_openmenu (Bug#12698).
1106 (menuWillOpen:): New method.
1107 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
1109 * nsterm.m (menu_will_open_state, menu_mouse_point)
1110 (menu_pending_title): New varaibles.
1111 (ns_get_pending_menu_title, ns_check_menu_open)
1112 (ns_check_pending_open_menu): New functions.
1114 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
1116 * indent.c (current_column_bol_cache): Remove leftover which is not
1117 used in Fmove_to_column any more.
1118 (current_column, scan_for_column): Adjust users.
1119 * keyboard.c (last_point_position_buffer, last_point_position_window):
1120 Remove leftovers which are not used for recording undo any more.
1121 (command_loop_1, syms_of_keyboard): Adjust users.
1122 * xdisp.c (last_max_ascent): Remove leftover which is not used in
1123 redisplay_window any more.
1124 (move_it_to): Adjust user.
1126 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
1128 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1129 Update dependencies.
1131 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1133 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1134 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1137 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1139 * window.h (struct window): Replace hchild, vchild and buffer slots
1140 with the only contents slot. This is possible because each valid
1141 window may have either the child window (in vertical or horizontal
1142 combination) or buffer to display (for the leaf window). Using that,
1143 a lof of operations to traverse and/or change window hierarchies may
1144 be simplified. New member horizontal is used to distinguish between
1145 horizontal and vertical combinations of internal windows.
1146 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1147 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1148 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1149 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1150 Use contents slot, not buffer, where appropriate.
1151 (wset_combination): New function.
1152 (wset_buffer): Add eassert.
1153 (Fframe_first_window): Simplify the loop reaching first window.
1154 (Fwindow_buffer): Use WINDOW_LEAF_P.
1155 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1156 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1157 (unshow_buffer): Convert initial debugging check to eassert.
1158 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1159 (make_parent_window, window_resize_check, window_resize_apply)
1160 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1161 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1162 Adjust to match struct window changes.
1163 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1164 (mark_window_cursors_off, count_windows, get_leaf_windows)
1165 (foreach_window_1): Simplify the loop.
1166 * alloc.c (mark_object): Do not check for the leaf window because
1167 internal windows has no glyph matrices anyway.
1168 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1169 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1170 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1171 (build_frame_matrix_from_window_tree, mirror_make_current)
1172 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1173 (update_window_tree, set_window_update_flags): Simplify the loop.
1174 (sync_window_with_frame_matrix_rows): Enforce live window.
1175 Use contents slot, not buffer, where appropriate.
1176 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1177 and WINDOW_HORIZONTAL_COMBINATION_P.
1178 (make_frame_visible_1): Simplify the loop.
1179 Use contents slot, not buffer, where appropriate.
1180 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1181 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1182 (expose_window_tree): Likewise.
1183 Use contents slot, not buffer, where appropriate.
1184 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1185 to avoid deleted windows. Use contents slot instead of buffer.
1186 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1187 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1188 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1189 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1191 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1193 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1194 identify the reasons for assertion violations in bug#14062 and
1196 (Fx_show_tip): Fix compilation error under
1197 "--enable-check-lisp-object-type". (Bug#14073)
1199 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1200 Reported by <rzl24ozi@gmail.com>.
1202 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1204 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1206 (unwind_with_echo_area_buffer): ...to restore it here.
1207 This is needed to ensure that...
1208 (redisplay_window): ...both window markers are valid here,
1209 which is verified by eassert.
1210 * editfns.c (save_excursion_save): Do not assume that
1211 selected_window always displays the buffer.
1212 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1215 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1217 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1220 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1222 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1224 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1226 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1227 since MinGW's w32api headers do. This avoids compiler warnings.
1229 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1232 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1234 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1236 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1238 * gtkutil.c (style_changed_cb): Check if frame is live and an
1239 X frame (Bug#14038).
1241 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1243 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1244 Define only for _WIN32_WINNT less than 0x0500.
1245 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1247 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1248 see its own definitions of 'struct timeval' and 'struct timezone'.
1250 Fix incompatibilities between MinGW.org and MinGW64 headers.
1251 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1253 * w32.c (REPARSE_DATA_BUFFER): Guard with
1254 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1256 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1258 * xterm.c: Include X11/XKBlib.h
1259 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1261 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1263 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1265 * blockinput.h (input_blocked_p): Likewise.
1266 * bytecode.c (exec_byte_code): Likewise.
1267 * callproc.c (call_process_kill, call_process_cleanup)
1268 (Fcall_process): Likewise.
1269 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1270 (Fccl_execute_on_string): Likewise.
1271 * character.c (string_escape_byte8): Likewise.
1272 * charset.c (read_hex): Likewise.
1273 * cm.c (calccost): Likewise.
1274 * data.c (cons_to_unsigned): Likewise.
1275 * dired.c (directory_files_internal, file_name_completion):
1277 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1278 (sit_for): Likewise.
1279 * doc.c (Fsubstitute_command_keys): Likewise.
1280 * doprnt.c (doprnt): Likewise.
1281 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1282 * emacsgtkfixed.c: Likewise.
1283 * fileio.c (file_offset, Fwrite_region): Likewise.
1284 * floatfns.c (Fexpt, fmod_float): Likewise.
1285 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1287 * font.c (font_intern_prop): Likewise.
1288 * frame.c (x_set_alpha): Likewise.
1289 * gtkutil.c (get_utf8_string): Likewise.
1290 * indent.c (check_display_width): Likewise.
1291 * intervals.c (create_root_interval, rotate_right, rotate_left)
1292 (split_interval_right, split_interval_left)
1293 (adjust_intervals_for_insertion, delete_node)
1294 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1295 (merge_interval_right, merge_interval_left, copy_intervals)
1296 (set_intervals_multibyte_1): Likewise.
1297 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1298 * keymap.c (Fkey_description): Likewise.
1299 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1300 * lread.c (openp, read_integer, read1, string_to_number):
1302 * menu.c (ensure_menu_items): Likewise.
1303 * minibuf.c (read_minibuf_noninteractive): Likewise.
1304 * print.c (printchar, strout): Likewise.
1305 * process.c (create_process, Faccept_process_output)
1306 (wait_reading_process_output, read_process_output, send_process)
1307 (wait_reading_process_output): Likewise.
1308 * profiler.c (make_log, handle_profiler_signal): Likewise.
1309 * regex.c (re_exec): Likewise.
1310 * regex.h: Likewise.
1311 * search.c (looking_at_1, Freplace_match): Likewise.
1312 * sysdep.c (get_child_status, procfs_ttyname)
1313 (procfs_get_total_memory): Likewise.
1314 * systime.h (EMACS_TIME_VALID_P): Likewise.
1315 * term.c (dissociate_if_controlling_tty): Likewise.
1316 * window.c (get_phys_cursor_glyph): Likewise.
1317 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1318 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1320 * xfns.c (Fx_window_property): Likewise.
1321 * xmenu.c (set_frame_menubar): Likewise.
1322 * xselect.c (x_get_window_property, x_handle_dnd_message):
1324 * xsmfns.c (smc_save_yourself_CB): Likewise.
1325 * xterm.c (x_scroll_bar_set_handle): Likewise.
1327 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1329 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1330 to be optional or nil. Adjust comment and convert it to docstring.
1331 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1332 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1334 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1336 Static checking by GCC 4.8-20130319.
1337 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1338 * process.c (Fset_process_datagram_address)
1339 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1340 * xdisp.c (get_char_face_and_encoding):
1341 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1342 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1343 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1345 2013-03-24 Ken Brown <kbrown@cornell.edu>
1347 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1348 fix compilation on 64-bit Cygwin, where underscores are not
1349 automatically prepended.
1351 * w32term.c (w32_initialize): Silence compiler warning.
1353 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1355 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1356 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1357 variables, to save and restore frame dimensions.
1358 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1359 after returning from a 'fullscreen' configuration.
1360 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1361 to avoid races between the main thread and the input thread.
1363 * w32term.h (struct w32_output): New members normal_width,
1364 normal_height, normal_top, normal_left, and prev_fsmode.
1365 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1366 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1369 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1370 'fullscreen' parameter. Always record previous width and height
1371 of the frame, except when switching out of maximized modes, so
1372 that they could be restored correctly, instead of resetting to the
1373 default frame dimensions. Send SC_RESTORE command to the frame,
1374 unless we are going to send SC_MAXIMIZE, to restore the frame
1375 resize hints in the mouse pointer shown by the window manager.
1378 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1380 * lisp.h (get_frame_param): Adjust conditions for prototype
1383 2013-03-22 Ken Brown <kbrown@cornell.edu>
1385 * unexcw.c: Drop unneeded inclusion of w32common.h.
1386 (report_sheap_usage): Declare.
1387 (read_exe_header): Add magic numbers for x86_64.
1388 (fixup_executable): Fix printf format specifier for unsigned long
1391 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1393 * frame.h (struct frame): Put menu_bar_window under #ifdef
1394 because this member is not needed when X toolkit is in use.
1395 (fset_menu_bar_window):
1396 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1397 (free_glyphs, update_frame):
1398 * xdisp.c (expose_frame): Likewise.
1399 (display_menu_bar): Likewise. Remove redundant eassert.
1400 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1403 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1405 Use functions and constants to manipulate Lisp_Save_Value objects.
1406 This replaces code that used macros and strings and token-pasting.
1407 The change makes the C source a bit easier to follow,
1408 and shrinks the Emacs executable a bit.
1409 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1410 (make_save_value): Change 1st arg from string to enum. All callers
1413 (mark_object): Use if, not #if, for GC_MARK_STACK.
1414 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1415 (XSAVE_OBJECT): Now functions, not macros.
1416 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1417 the constant was never used.
1418 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1419 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1420 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1421 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1423 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1424 type3 with a single member save_type. All uses changed.
1425 (save_type, set_save_pointer, set_save_integer): New functions.
1426 * print.c (PRINTX): Remove.
1428 * alloc.c: Remove redundant static declarations.
1430 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1432 * window.h (struct window): Convert left_col, top_line, total_lines
1433 and total_cols from Lisp_Objects to integers. Adjust comments.
1434 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1436 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1437 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1438 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1439 Adjust users where appropriate.
1441 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1443 * frame.h (struct frame): Drop resx and resy because the same data is
1444 available from window system-specific output context. Adjust users.
1445 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1446 New functions to provide defaults when no window system available.
1447 (FRAME_RES_X, FRAME_RES_Y): New macros.
1448 (NUMVAL): Move from xdisp.c.
1449 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1450 (Ffont_face_attributes, Fopen_font):
1451 * image.c (gs_load):
1452 * w32font.c (fill_in_logfont):
1453 * xdisp.c (calc_pixel_width_or_height):
1454 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1455 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1457 2013-03-20 Kenichi Handa <handa@gnu.org>
1459 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1460 to 1 (temporary workaround until a bug related to ASCII
1461 optimization is fixed).
1463 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1465 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1466 Signal error if window is not internal. Adjust docstring.
1467 (delete_all_child_windows): Use combination_limit to save the buffer.
1468 (Fset_window_configuration): Adjust accordingly.
1469 * print.c (syms_of_print): Initialize debugging output not here...
1470 (init_print_once): ...but in a new function here.
1471 * lisp.h (init_print_once): Add prototype.
1472 * emacs.c (main): Add call to init_print_once. Adjust comments.
1474 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1476 * window.c (window_resize_check, window_resize_apply)
1477 (window_from_coordinates, recombine_windows, set_window_buffer)
1478 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1479 (Fsplit_window_internal, Fdelete_window_internal)
1480 (freeze_window_starts): Use bool for booleans.
1481 * window.h (window_frame_coordinates, resize_frame_windows)
1482 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1484 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1486 * dispnew.c (bitch_at_user): Use `user-error'.
1488 2013-03-17 Ken Brown <kbrown@cornell.edu>
1490 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1491 as return type of image_background. (Bug#13981)
1492 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1494 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1496 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1497 (ns_select): Don't return with result uninitialized.
1499 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1502 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1504 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1505 directories. If filename is nil, get directory name (Bug#13932).
1506 Use getFilename and getDirectory.
1507 (getFilename, getDirectory): New methods for EmacsSavePanel and
1509 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1511 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1513 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1515 2013-03-15 Kenichi Handa <handa@gnu.org>
1517 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1518 (adjust_after_replace): Make it back to static. Delete the third
1519 arg text_at_gap_tail. Cancel the code for handling it.
1521 * coding.h (struct coding_system): New member eol_seen.
1523 * coding.c (detect_ascii): New function.
1524 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1525 when the source bytes are actually scanned. On detecting for
1526 coding_category_utf_8_auto, call detect_ascii instead of scanning
1527 source bytes directly.
1528 (produce_chars): Call insert_from_gap with the new arg 0.
1529 (encode_coding): Likewise.
1530 (decode_coding_gap): Control ASCII optimization by the variable
1531 disable_ascii_optimization instead of #ifndef .. #endif.
1532 Deccode EOL format according to coding->eol_seen.
1533 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1536 * lisp.h (adjust_after_replace): Cancel externing it.
1537 (insert_from_gap): Adjust prototype.
1539 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1541 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1542 FULLSCREEN_MAXIMIZED. (Bug#13935)
1544 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1546 * region-cache.c (find_cache_boundary, move_cache_gap)
1547 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1548 Simplify debugging check and convert to eassert. Adjust comment.
1549 (pp_cache): Put under ENABLE_CHECKING.
1551 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1553 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1554 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1556 (w32fullscreen_hook): If the frame is visible, reset
1557 f->want_fullscreen flag after changing the frame size. If the
1558 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1561 2013-03-13 Daniel Colascione <dancol@dancol.org>
1563 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1564 too so that these builds can use Cygwin's file conversion
1565 functions. (We've been building and linking cygw32.o all along
1566 and just not using it.)
1568 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1570 File synchronization fixes (Bug#13944).
1571 * Makefile.in (LIB_FDATASYNC): New macro.
1573 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1574 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1575 Don't worry about HAVE_FSYNC, since a substitute fsync is
1576 available if the system lacks one.
1577 (Fwrite_regin): Retry fsync if interrupted.
1579 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1581 * w32term.c (w32_read_socket): If the Emacs frame is being
1582 activated, call w32fullscreen_hook, to make sure the new frame
1583 dimensions are in effect. (Bug#13937)
1585 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1587 * xdisp.c (init_iterator): Simplify because both character and byte
1588 positions are either specified or -1. Add eassert. Adjust comment.
1589 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1590 character and byte positions can be obtained from marker.
1592 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1594 Static checking by Sun C 5.12.
1595 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1596 * bytecode.c (exec_byte_code):
1597 * dispnew.c (init_display):
1599 * fileio.c (Fsubstitute_in_file_name):
1600 * keyboard.c (Fevent_convert_list):
1601 * keymap.c (Fsingle_key_description):
1602 * term.c (maybe_fatal, fatal):
1603 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1604 * xsmfns.c (Fhandle_save_session):
1605 Omit unreachable code.
1606 * keymap.c (map_keymap_char_table_item): Cast void * to
1607 a function pointer type; the C Standard requires this.
1609 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1610 Include <sys/param.h> unconditionally, as that works elsewhere and
1611 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1612 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1615 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1617 * insdel.c (adjust_after_replace): Use bool for boolean.
1619 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1621 * keyboard.c: Move keyboard decoding to read_key_sequence.
1622 (decode_keyboard_code): Remove.
1623 (tty_read_avail_input): Don't try to decode input.
1624 (read_decoded_char): New function.
1625 (read_key_sequence): Use it.
1627 2013-03-10 Daniel Colascione <dancol@dancol.org>
1629 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1630 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1631 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1634 * w32term.c (construct_drag_n_drop): Use the above macros to make
1635 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1637 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1638 properly display non-ASCII frame titles in cygw32 builds.
1640 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1641 call ShellExecute in cygw32 builds.
1643 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1644 common file dialog code.
1646 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1647 can just use du like other systems.
1649 * coding.c (from_unicode_buffer): Declare.
1650 * coding.c (from_unicode_buffer): Implement.
1652 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1654 * lread.c: Minor cleanup.
1655 (FROM_FILE_P): New macro.
1656 (skip_dyn_bytes, unreadchar, read1): Use it.
1657 (read_list): Consolidate duplicated code.
1659 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1661 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1663 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1664 (redisplay_internal, set_cursor_from_row, try_window)
1665 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1666 (display_line, notice_overwritten_cursor)
1667 (mouse_face_from_buffer_pos, note_mouse_highlight):
1668 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1669 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1670 (mouse_face_from_string_pos, fast_find_string_pos):
1671 Use MATRIX_ROW_VPOS.
1673 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1675 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1677 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1678 MATRIX_MODE_LINE_ROW.
1680 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1682 2013-03-10 handa <handa@gnu.org>
1684 * lisp.h (adjust_after_replace): Extern it.
1686 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1687 case of detection for coding_category_utf_8_auto.
1688 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1689 Skip decoding if all bytes are ASCII.
1691 * insdel.c (adjust_after_replace): Make it public. New arg
1693 (adjust_after_insert): Call adjust_after_replace with the new arg
1696 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1698 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1699 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1700 from Elisp via unread-command-events.
1702 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1703 functions to mean "no change".
1705 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1707 region-cache.c, scroll.c, search.c: Use bool for booleans.
1708 * lisp.h (compile_pattern):
1709 * scroll.c (do_scrolling, do_direct_scrolling):
1710 * search.c (struct regexp_cache, compile_pattern_1)
1711 (compile_pattern, string_match_1, search_command)
1712 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1713 (search_regs_saved, Fregexp_quote):
1714 Use bool for boolean.
1715 * region-cache.c (region_cache_forward, region_cache_backward):
1716 Fix comments to match code: these functions return int, not boolean.
1718 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1720 * search.c (find_newline): Accept start and end byte positions
1721 as arguments and allow -1 if not known.
1722 (find_newline_no_quit): Likewise for start position.
1723 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1724 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1725 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1726 * editfns.c (Fconstrain_to_field): Break long line.
1727 Adjust call to find_newline.
1728 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1729 Use DEC_BOTH to start next search from the previous buffer
1730 position, where appropriate.
1731 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1732 (get_visually_first_element, move_it_vertically_backward): Likewise.
1733 Obtain byte position from the display iterator, where appropriate.
1735 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1737 print.c, process.c: Use bool for booleans.
1738 * lisp.h (wait_reading_process_output):
1739 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1740 (strout, debug_output_compilation_hack, float_to_string, print)
1742 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1743 (decode_status, status_message, create_process, create_pty)
1744 (Fmake_network_process, Fnetwork_interface_info)
1745 (wait_reading_process_output, read_process_output)
1746 (write_queue_push, write_queue_pop, process_send_signal)
1747 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1748 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1749 Use bool for booleans.
1750 * process.c (Fnetwork_interface_list): Remove unused local.
1751 (connect_counter): Now EMACS_INT, not int.
1753 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1755 * bidi.c (bidi_fetch_char): Swap first and second arguments
1756 to match other functions accepting character and byte positions.
1758 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1759 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1760 when you need just to move to the previous buffer position.
1761 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1763 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1765 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1767 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1769 Avoid character to byte conversions in motion subroutines.
1770 * indent.h (compute_motion, vmotion): Add byte position argument.
1771 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1773 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1774 Use list5 for return value.
1775 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1776 Adjust comments, style and calls to compute_motion.
1777 (Fvertical_motion): Adjust call to vmotion.
1778 * window.c (Fdelete_other_windows_internal): Record window start
1779 byte position and adjust call to vmotion.
1780 (window_scroll_line_based): Likewise with call to compute_motion.
1782 (Frecenter): Adjust calls to vmotion.
1784 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1786 * lisp.h (list2i, list3i): New functions.
1787 (list4i): Move from window.c and make LISP_INLINE.
1788 * editfns.c (make_lisp_time):
1789 * fns.c (Flocale_info):
1790 * keyboard.c (parse_modifiers):
1791 * xterm.c (x_ewmh_activate_frame): Use list2i.
1792 * instel.c (signal_after_change):
1793 * nsfns.m (Fx_server_version, Fxw_color_values):
1794 * w32fns.c (Fxw_color_values, Fx_server_version):
1795 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1796 * fileio.c (Fvisited_file_modtime):
1797 * nsfns.m (Fns_display_usable_bounds):
1798 * w32.c (ltime): Use list4i.
1800 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1802 * search.c (find_newline_no_quit): Rename from find_next_newline.
1805 * lisp.h (find_newline_no_quit): Rename prototype.
1807 * xdisp.c (back_to_previous_line_start)
1808 (forward_to_next_line_start, get_visually_first_element)
1809 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1810 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1811 * bidi.c (bidi_find_paragraph_start): Callers of
1812 find_newline_no_quit changed.
1814 * msdos.c: Change encoding to cp850. (Bug#13879)
1815 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1817 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1819 Coding system support cleanup and minor refactoring.
1820 * coding.h (enum coding_result_code): Remove
1821 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1822 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1823 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1824 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1825 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1826 (decode_coding_region, encode_coding_region, decode_coding_string):
1827 Remove unused compatibility macros.
1828 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1829 (record_conversion_result): Adjust user.
1830 (syms_of_coding): Likewise.
1831 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1832 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1833 (decode_coding_object): Simplify since xrealloc never returns NULL.
1836 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1838 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1839 * sysdep.c (list_system_processes)
1840 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1841 Make it a stub in this case; otherwise the build might fail,
1842 and this code hasn't been tested on such hosts anyway.
1843 Problem reported by Nelson H. F. Beebe in
1844 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1845 and analyzed by Jérémie Courrèges-Anglas in
1846 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1848 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1850 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1851 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1852 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1853 * bidi.c (bidi_find_paragraph_start): Likewise.
1854 * indent.c (vmotion): Likewise.
1856 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1858 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1859 * filelock.c: Include <c-ctype.h>.
1860 (MAX_LFINFO): New top-level constant.
1861 (lock_info_type): Remove members pid, boot_time. Add members at,
1862 dot, colon. Change user member to be the entire buffer, not a
1863 pointer. This allows us to handle the case where a foreign
1864 pid or boot time exceeds the local range. All uses changed.
1865 (LINKS_MIGHT_NOT_WORK): New constant.
1866 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1867 (defined_WINDOWSNT): Remove.
1868 (MAKE_LOCK_NAME, file_in_lock_file_name):
1869 Always use .#FILE (not .#-FILE) for the file lock,
1870 even if it is a regular file.
1871 (rename_lock_file): New function.
1872 (create_lock_file): Use it.
1873 (create_lock_file, read_lock_data):
1874 Prefer a symbolic link for the lock file, falling back on a
1875 regular file if symlinks don't work. Do not try to create
1876 symlinks on MS-Windows, due to security hassles. Stick with
1877 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1878 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1879 host may be using a Windowsish file system, and cannot use
1880 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1881 doesn't work. Don't fail merely because of a symlink-contents
1882 length limit in the current file system; fall back on regular
1883 files. Increase the symlink contents length limit to 8 KiB, this
1884 should be big enough for any real use and doesn't crunch the
1886 (create_lock_file, lock_file_1, read_lock_data):
1887 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1888 (lock_file_1): Return error number, not bool. All callers changed.
1889 (ELOOP): New macro, if not already defined.
1890 (read_lock_data): Return size of lock file contents, not Lisp object.
1891 All callers changed. Handle a race condition if some other process
1892 replaces a regular-file lock with a symlink lock or vice versa,
1893 while we're trying to read the lock.
1894 (current_lock_owner): Parse contents more carefully, to help avoid
1895 confusing a regular-file lock with some other application's use
1896 of the file. Check for lock file contents being too long, or
1897 not parsing correctly.
1898 (current_lock_owner, lock_file):
1899 Allow foreign pid and boot times that exceed the local range.
1900 (current_lock_owner, lock_if_free, lock_file):
1901 Simplify allocation of lock file contents.
1902 * w32.c (sys_rename_replace): New function, containing most of
1903 the contents of the old sys_rename.
1904 (sys_rename): Use it.
1905 (fchmod): New dummy function.
1906 * w32.h (sys_rename_replace, fchmod): New decls.
1908 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1910 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1911 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1912 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1913 <dmantipov@yandex.ru>.
1915 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1917 * composite.c (get_composition_id, fill_gstring_header):
1918 Use make_uninit_vector where appropriate.
1919 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1920 * xselect.c (clean_local_selection_data): Likewise.
1922 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1924 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1925 * image.c (imagemagick_load_image): Calculate height and width
1926 after flattening the image, not before.
1928 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1930 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1931 * ftfont.c (ftfont_shape_by_flt): Likewise.
1932 * w32uniscribe.c (uniscribe_shape): Likewise.
1934 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1936 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1937 The old approach, which fell back on DIR/.#FILE.0 through
1938 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1939 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1940 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1941 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1942 because the locking mechanism was never reliable in that case).
1943 This patch fixes this and other bugs discovered by a code
1944 inspection that was prompted by
1945 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1946 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1947 to avoid interoperability problems between the MS-Windows and
1948 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1949 instances of Emacs now ignore each others' locks.
1950 * filelock.c (defined_WINDOWSNT): New constant.
1951 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1952 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1953 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1954 regular files on MS-Windows hosts.
1955 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1956 Use SAFE_ALLOCA to avoid problems with long file names.
1957 (MAX_LFINFO): Now a local constant, not a global macro.
1958 (IS_LOCK_FILE): Remove.
1959 (lock_file_1): Don't inspect errno if symlink call succeeds;
1960 that's not portable.
1961 (lock_file): Document that this function can return if lock
1963 (lock_file): Don't access freed storage.
1965 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1967 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1969 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1971 * textprop.c: Use bool for booleans.
1972 (validate_interval_range, Fadd_text_properties)
1973 (Fremove_text_properties): Prefer bool to int when either works.
1975 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1977 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1978 If the interval tree changes as a side effect of calling
1979 modify_region, re-do processing starting from the call to
1980 validate_interval_range. (Bug#13743)
1982 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1984 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1987 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1989 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1990 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1991 access to the lock file until it is written and closed.
1994 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1996 * callint.c (Qcall_interactively):
1997 * macros.c (Qexecute_kbd_macro):
2000 2013-02-26 Bastien Guerry <bzg@gnu.org>
2002 * window.c (Frecenter): Tiny docstring enhancement.
2004 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2006 Minor textprop integer cleanup.
2007 * intervals.h, textprop.c (add_text_properties_from_list):
2008 Return void, not int, since nobody uses the return value.
2009 * textprop.c (validate_plist, add_properties, remove_properties)
2010 (Fadd_text_properties):
2011 Don't assume list length fits in int.
2012 (interval_has_all_properties, interval_has_some_properties)
2013 (interval_has_some_properties_list, add_properties, remove_properties)
2014 (Fadd_text_properties, Fremove_text_properties)
2015 (Fremove_list_of_text_properties, text_property_stickiness):
2016 Use bool for booleans.
2017 (Fadd_text_properties, Fremove_text_properties):
2018 (Fremove_list_of_text_properties):
2019 Reindent do-while as per GNU style.
2021 2013-02-25 Eli Zaretskii <eliz@gnu.org>
2023 Implement CLASH_DETECTION for MS-Windows.
2025 * filelock.c [WINDOWSNT]: Include w32.h.
2026 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2027 function of that name. Up-case the macro arguments.
2028 (IS_LOCK_FILE): New macro.
2029 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2030 (create_lock_file): New function, with body extracted from
2032 [WINDOWSNT]: Implement lock files by writing a regular file with
2033 the lock information as its contents.
2034 (read_lock_data): New function, on Posix platforms just calls
2036 [WINDOWSNT]: Read the lock info from the file.
2037 (current_lock_owner): Call read_lock_data instead of calling
2038 emacs_readlinkat directly.
2039 (lock_file) [WINDOWSNT]: Run the file name through
2042 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2043 just check if the process by that PID exists.
2045 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2046 also present, as doing so will fail to error out if the file
2049 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2051 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2052 (Fremove_list_of_text_properties): Skip all of the intervals in
2053 the region between START and END that already have resp. don't
2054 have the requested properties, not just the first one.
2055 Add assertions that the loop afterwards always modifies the
2056 properties. (Bug#13743)
2058 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2060 * callint.c (Fcall_interactively): Use the right lexical environment
2061 for `interactive' specs (bug#13811).
2062 * eval.c (Feval): Accept a lexical environment.
2064 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2066 Simplify data_start configuration (Bug#13783).
2067 This is a followon simplification to the fix for Bug#13650.
2068 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2069 (START_FILES): Remove. All uses removed.
2070 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2071 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2072 (buildobj.h): Use it.
2073 ($(ALLOBJS)): Depend on globals.h.
2074 (temacs$(EXEEXT)): Use $(ALLOBJS).
2075 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2076 * deps.mk (vm-limit.o):
2077 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2078 Do not depend on mem-limits.h.
2079 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2080 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2081 [__GNUC__ && !ORDINARY_LINK]: Remove.
2082 * mem-limits.h, pre-crt0.c: Remove.
2083 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2084 * unexcoff.c (etext): New decl.
2085 (make_hdr): Use DATA_START instead of start_of_data.
2086 * vm-limit.c: Move most of mem-limits.h's contents here.
2087 (data_start): New decl. It's OK if this is approximate,
2088 so simplify-away some unnecessary exactness.
2089 (POINTER): Remove; all uses removed.
2090 (data_space_start): Now char *, to avoid casts.
2091 (exceeds_lisp_ptr): New function, replacing the old
2092 EXCEEDS_LISP_PTR macro. All uses changed.
2093 (check_memory_limits): Simplify and remove casts.
2094 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2095 (memory_warnings): Use data_start instead of start_of_data.
2097 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2099 * xdisp.c (set_message): Only check for debug-on-message if STRING
2100 is a string. (Bug#13797)
2102 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2104 Fix regression introduced by July 10 filelock.c patch.
2105 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2106 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2107 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2108 and diagnosed by Andreas Schwab in
2109 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2111 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2113 Assume C89 or better.
2114 * ralloc.c (SIZE, POINTER, NIL):
2115 * vm-limit.c (POINTER):
2116 Remove, replacing all uses with C89 equivalents. These old
2117 symbols were present only for porting to pre-C89 platforms.
2119 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
2121 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2122 This avoids warning messages reported as part of Bug#13546.
2124 2013-02-21 Ken Brown <kbrown@cornell.edu>
2126 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2128 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2130 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2132 * keyboard.c (Qcommand_execute): New var.
2133 (command_loop_1, read_char): Use it.
2134 (Fcommand_execute): Remove, replace by an Elisp implementation.
2135 (syms_of_keyboard): Adjust accordingly.
2137 2013-02-19 Daniel Colascione <dancol@dancol.org>
2139 * sheap.c (report_sheap_usage): Use message, not message1, so
2140 that we don't try to create a buffer while we're in the middle
2141 of dumping Emacs. Explain why.
2143 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2145 * search.c (find_newline): Return byte position in bytepos.
2147 (find_next_newline_no_quit, find_before_next_newline):
2148 Add bytepos argument.
2149 * lisp.h (find_newline, find_next_newline_no_quit)
2150 (find_before_next_newline): Adjust prototypes.
2151 * bidi.c (bidi_find_paragraph_start):
2152 * editfns.c (Fconstrain_to_field, Fline_end_position):
2153 * indent.c (compute_motion, vmotion):
2154 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2155 (get_visually_first_element, move_it_vertically_backward):
2156 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2158 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2160 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2161 resources were not orderly released.
2163 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2165 * xdisp.c (x_draw_vertical_border): For a window that is neither
2166 the leftmost nor the rightmost, redraw both the left and the right
2167 vertical borders. (Bug#13723)
2169 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2171 * xml.c (init_libxml2_functions):
2172 * sound.c (sound_warning):
2173 * sheap.c (report_sheap_usage):
2174 * process.c (wait_reading_process_output):
2175 * msdos.c (XMenuActivate):
2176 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2177 * keyboard.c (top_level_1):
2178 * editfns.c (Fmessage, Fmessage_box):
2179 * callint.c (Fcall_interactively):
2180 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2182 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2184 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2185 * frame.c (syms_of_frame): ... to here.
2187 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2189 * w32.c (sys_chown): Remove unused function.
2191 * w32term.c <input_signal_count>: Declare 'volatile'
2192 unconditionally. (Bug#9066)
2194 * w32.c (set_errno): Reset h_errno and don't set it to any other
2195 value. Set errno instead.
2196 (check_errno): Reset h_errno.
2197 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2198 (sys_gethostname, sys_getservbyname, sys_getpeername)
2199 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2200 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2202 (sys_gethostbyname): Set h_errno only errors detected.
2204 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2206 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2208 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2210 * keyboard.c (read_char): Fix calculation of auto-save time out
2211 when auto-save-timeout is less than 4. (Bug#13720)
2213 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2214 time. Improve diagnostics in DebPrint. (Bug#13546)
2216 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2217 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2218 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2219 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2220 make sure errno is set to an appropriate value. (Bug#13546)
2221 (socket_to_fd): Add assertion against indexing fd_info[] with a
2222 value that is out of bounds.
2223 (sys_accept): If fd is negative, do not set up the child_process
2224 structure for reading.
2226 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2228 * composite.c (fill_gstring_header): Remove useless prototype.
2230 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2231 * print.c (PRINTDECLARE, print_object):
2232 * search.c (compile_pattern, fast_looking_at, search_buffer):
2233 (simple_search, boyer_moore, Freplace_match):
2234 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2235 (get_overlay_arrow_glyph_row, display_mode_element):
2236 (decode_mode_spec_coding, message3):
2237 * xfaces.c (face_at_string_position): Use bool for booleans.
2240 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2242 Fix AIX port (Bug#13650).
2243 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2244 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2245 was #undeffed earlier, so it cannot be used as a macro here.
2246 Use the constant and not the macro.
2248 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2250 * w32proc.c (new_child): If no vacant slots are found in
2251 child_procs[], make another pass looking for slots whose process
2252 has exited or died. (Bug#13546)
2254 * w32.c (sys_pipe): When failing due to file descriptors above
2255 MAXDESC, set errno to EMFILE.
2256 (_sys_read_ahead): Update cp->status when failing to read serial
2257 communications input, so that the status doesn't stay at
2258 STATUS_READ_IN_PROGRESS. (Bug#13546)
2260 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2262 * gtkutil.c (tb_size_cb): New function.
2263 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2265 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2267 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2270 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2272 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2274 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2276 * font.c (font_range): Add pos_byte argument. Adjust comment
2277 and break long line.
2278 * font.h (font_range): Adjust prototype.
2279 * composite.c (autocmp_chars): Pass byte position to font_range.
2280 Break long line. Remove useless prototype and format comment.
2282 2013-02-13 Glenn Morris <rgm@gnu.org>
2284 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2286 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2288 Improve AIX port some more (Bug#13650).
2289 With this, it should be as good as it was in 23.3, though it's
2290 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2291 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2292 * unexaix.c (start_of_text): Remove.
2293 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2294 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2295 (orig_load_scnptr, orig_data_scnptr):
2296 Now off_t, not long, since they are file offsets.
2297 (make_hdr): Use _data, not start_of_data ().
2298 This is the key part of the fix.
2299 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2300 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2302 * pre-crt0.c (data_start): Initialize to 1.
2303 This ports to compilers that optimize the external declaration
2304 'int x = 0;' as if it were 'int x;' to shrink the executable.
2306 Improve AIX port (Bug#13650).
2307 This doesn't fix the bug, but it makes progress: Emacs builds now.
2308 * unexaix.c: Include inttypes.h, stdarg.h.
2309 (report_error, report_error_1): Mark as _Noreturn.
2310 (report_error): Don't report the wrong errno.
2311 (report_error_1): Now varargs. All callers changed.
2312 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2313 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2314 (write_ptr): Use %p to print address rather than %lx and a cast
2315 to unsigned long. Grow buffer a bit, to be safer.
2317 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2319 * bidi.c (bidi_resolve_neutral): After finding the next
2320 non-neutral character, accept NEUTRAL_ON type as well, because
2321 directional control characters, such as LRE and RLE, have their
2322 type converted to that by bidi_resolve_weak. This avoids aborts
2323 when LRE/RLE follows a run of neutrals.
2324 (bidi_move_to_visually_next): Assert that return value of
2325 bidi_peek_at_next_level is non-negative. Negative values will
2328 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2330 Minor getenv-related fixes.
2331 * callproc.c (Fcall_process_region) [!DOS_NT]:
2332 Avoid unnecessary duplicate call to getenv.
2333 * callproc.c (init_callproc):
2334 * dispnew.c (init_display):
2335 * sysdep.c (sys_subshell):
2336 Omit unnecessary cast of getenv or egetenv.
2338 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2340 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2341 Update dependencies.
2343 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2345 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2347 (display_line): Set w->region_showing to the value of
2348 it->region_beg_charpos, not to -1. This fixes redisplay
2349 optimization when cursor is moved up after M->. (Bug#13623)
2351 (try_scrolling): Scroll text up more if point is too close to ZV
2352 and inside the scroll margin. This makes sure point is moved
2353 outside the scroll margin in these cases.
2355 * window.h (struct window): region_showing can no longer be
2358 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2360 Tune by using memchr and memrchr.
2361 * doc.c (Fsnarf_documentation):
2362 * fileio.c (Fsubstitute_in_file_name):
2363 * search.c (find_newline, scan_newline):
2364 * xdisp.c (pos_visible_p, display_count_lines):
2365 Use memchr and memrchr rather than scanning byte-by-byte.
2366 * search.c (find_newline): Rename from scan_buffer.
2367 Omit first arg TARGET, as it's always '\n'. All callers changed.
2369 Clean up read_key_sequence a tiny bit more.
2370 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2371 (read_key_sequence): Remove unused locals.
2373 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2375 Clean up read_key_sequence a bit; reread active keymaps after first event.
2376 * keyboard.c (read_char, read_char_x_menu_prompt)
2377 (read_char_minibuf_menu_prompt):
2378 Replace nmaps+maps with a single `map' arg.
2379 (follow_key): Operate on a single map.
2380 (active_maps): New function.
2381 (test_undefined): Also return true for nil bindings.
2382 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2383 a single (composed) keymap. Remember `first_event' to choose the right
2384 set of active keymaps. Recompute the set of keymaps after receiving
2385 the first event. Remove GOBBLE_FIRST_EVENT.
2386 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2387 * keyboard.h (read_char): Update declaration.
2388 * lread.c (read_filtered_event): Adjust call to read_char.
2390 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2392 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2393 Don't use the limitation on backwards movement when lines are truncated
2394 in the window. (Bug#13675)
2396 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2398 * marker.c (set_marker_internal): If desired position is passed
2399 as a marker, avoid call to buf_charpos_to_bytepos.
2400 * window.c (Fset_window_point): Omit redundant type checking.
2401 (Fset_window_start): Likewise. Format comment.
2402 (window_scroll_pixel_based): Use set_marker_restricted_both
2403 with character and byte positions obtained from an iterator.
2404 (Fset_window_configuration): Use set_marker_restricted_both.
2405 * xdisp.c (message_dolog): Likewise.
2407 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2409 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2410 When text lines are longer than window's screen lines, don't move back
2411 too far. This speeds up some redisplay operations. (Bug#13675)
2413 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2415 * syntax.c (scan_sexps_forward): Fix byte position calculation
2416 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2418 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2420 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2421 that was not needed.
2423 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2425 Minor hashing refactoring.
2426 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2427 (sxhash_float): Return EMACS_UINT, for consistency with the other
2429 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2430 non-static inline function and therefore can't use static vars.
2431 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2432 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2433 with the other hash functions.
2435 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2437 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2438 XXXXXX part of the temporary file pattern is not downcased even
2439 when w32-downcase-file-names is non-nil. (Bug#13661)
2441 * xdisp.c (decode_mode_spec): Remove handling of %t.
2443 * msdos.c (careadlinkatcwd): Remove.
2445 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2447 * lread.c (skip_dyn_bytes): New function (bug#12598).
2448 (read1): Use it. Use getc instead of READCHAR to read bytes.
2449 (load_each_byte): Remove. Update users.
2451 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2453 * search.c (scan_buffer): Calculate end byte position just once.
2454 (scan_newline): Do not recalculate start_byte.
2455 (search_command): Use eassert.
2456 * syntax.c (struct lisp_parse_state): New member location_byte.
2457 (scan_sexps_forward): Record from_byte and avoid redundant
2458 character to byte position calculation ...
2459 (Fparse_partial_sexp): ... here. Break too long line.
2461 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2463 * lisp.h (make_uninit_vector): New function.
2464 * alloc.c (Fvector, Fmake_byte_code):
2465 * ccl.c (Fregister_ccl_program):
2466 * charset.c (Fdefine_charset_internal, define_charset_internal):
2467 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2468 * composite.c (syms_of_composite):
2469 * font.c (Fquery_font, Ffont_info, syms_of_font):
2470 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2471 * ftfont.c (ftfont_shape_by_flt):
2472 * indent.c (recompute_width_table):
2473 * nsselect.m (clean_local_selection_data):
2474 * syntax.c (init_syntax_once):
2475 * w32unsubscribe.c (uniscribe_shape):
2476 * window.c (Fcurrent_window_configuration):
2477 * xfaces.c (Fx_family_fonts):
2478 * xselect.c (selection_data_to_lisp_data): Use it.
2480 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2482 * coding.c (Fdefine_coding_system_internal): Use AREF where
2483 argument is known to be a vector.
2484 * fns.c (Flocale_info): Likewise for ASET.
2485 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2486 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2488 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2490 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2493 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2494 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2495 updateCollectionBehaviour.
2497 * nsterm.m (NEW_STYLE_FS): Remove.
2498 (ns_last_use_native_fullscreen): New variable.
2499 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2500 (x_set_window_size): Do not take title bar and tool bar into account
2501 if isFullscreen returns YES.
2502 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2503 (check_native_fs): New function.
2504 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2505 (ns_term_init): Remove NEW_STYLE_FS.
2506 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2507 and tool bar if isFullscreen returns NO.
2508 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2509 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2510 with HAVE_NATIVE_FS.
2511 (window:willUseFullScreenPresentationOptions:): New method.
2512 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2513 Hide toolbar if not enabled (Bug#13444).
2514 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2515 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2516 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2517 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2518 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2519 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2520 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2521 (syms_of_nsterm): Add ns-use-native-fullscreen.
2523 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2525 * fileio.c (Qchoose_write_coding_system): Now static.
2527 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2529 * xdisp.c (window_buffer_changed): region_showing can be negative,
2530 which still means region is being displayed.
2531 (redisplay_internal): Resurrect code that forced redisplay of the
2532 whole window when showing region and the mark has changed.
2533 Record the new mark position to allow redisplay optimizations.
2534 (display_line): If it->region_beg_charpos is non-zero, set the
2535 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2537 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2538 not bitfield of 1 bit.
2540 2013-02-03 Daniel Colascione <dancol@dancol.org>
2542 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2543 daemon mode works on cygw32 when Emacs is installed and not just
2546 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2548 Avoid file time stamp bug on MS-Windows (Bug#13149).
2549 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2550 as FAT32 doesn't update time stamps when truncating them.
2551 Also, check that a file time stamp is not a multiple of 100 ns;
2552 this should catch all instances of the problem on MS-Windows,
2553 as its native file system resolution is 100 ns or worse, and
2554 checking for a non-multiple of 100 ns should impose only a small
2555 overhead on systems with ns resolution.
2557 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2559 Avoid encoding file names on MS-Windows when they need to be run
2560 through dostounix_filename.
2561 * w32.c (normalize_filename): Accept an additional argument
2562 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2563 downcase it even if w32-downcase-file-names is non-nil.
2564 (dostounix_filename): Accept an additional argument MULTIBYTE and
2565 pass it to normalize_filename.
2566 (emacs_root_dir): Adjust.
2568 * msdos.h (dostounix_filename): Adjust prototype.
2570 * w32.h (dostounix_filename): Adjust prototype.
2572 * msdos.c (dostounix_filename): Accept an additional argument and
2574 (init_environment): Adjust callers of dostounix_filename.
2576 * fileio.c (Ffile_name_directory, file_name_as_directory)
2577 (directory_file_name, Fexpand_file_name)
2578 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2580 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2582 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2583 variables, as egetenv is case-insensitive for DOS_NT.
2585 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2586 with an encoded file name.
2588 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2589 Adjust calls to dostounix_filename.
2591 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2593 * unexw32.c (unexec): Adjust call to dostounix_filename.
2595 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2597 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2600 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2603 * callproc.c (Fcall_process): Make sure program name in PATH and
2604 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2605 is passed to exec/spawnve, which fails unless the file-name
2608 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2609 even if w32-quote-process-args is nil.
2611 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2613 Fix timestamp bug when write-region appends nothing (Bug#13149).
2614 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2615 the file's time stamp doesn't change if Emacs happens to write nothing
2616 to the file, and on a buggy file system this could cause Emacs to
2617 incorrectly infer that the file system doesn't have the bug.
2618 Avoid this problem by inhibiting the inference in this case.
2620 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2622 * window.h (struct window): Convert base_line_number, base_line_pos
2623 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2624 Convert region_showing member from Lisp_Object to bitfield.
2625 Remove sequence_number member. Adjust comments.
2626 * window.c (sequence_number): Remove.
2627 (make_window): Initialize column_number_displayed.
2628 * print.c (print_object): Follow the printed representation of
2629 frames and print window pointer to distinguish between windows.
2630 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2631 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2632 (wset_column_number_displayed, wset_region_showing): Remove.
2633 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2634 (try_scrolling, try_cursor_movement, redisplay_window)
2635 (try_window_reusing_current_matrix, try_window_id, display_line)
2636 (display_mode_lines, decode_mode_spec): Adjust users.
2637 * .gdbinit (pwinx): Do not print sequence_number.
2639 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2641 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2642 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2643 * dired.c: Include <fcntl.h>.
2644 (open_directory): New function, which uses open and fdopendir
2645 rather than opendir. DOS_NT platforms still use opendir, though.
2646 (directory_files_internal, file_name_completion): Use it.
2647 (file_attributes): New function, with most of the old Ffile_attributes.
2648 (directory_files_internal, Ffile_attributes): Use it.
2649 (file_attributes, file_name_completion_stat): First arg is now fd,
2650 not dir name. All uses changed. Use fstatat rather than lstat +
2652 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2653 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2654 (emacs_readlinkat): New function, with much of the old
2655 Ffile_symlink_p, but with an fd argument for speed.
2656 It uses readlinkat rather than careadlinkatcwd, so that it
2657 need not assume the working directory.
2658 (Ffile_symlink_p): Use it.
2659 * filelock.c (current_lock_owner): Use emacs_readlinkat
2660 rather than emacs_readlink.
2661 * lisp.h (emacs_readlinkat): New decl.
2662 (READLINK_BUFSIZE, emacs_readlink): Remove.
2663 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2664 (emacs_norealloc_allocator, emacs_readlink): Remove.
2665 This stuff is moved to fileio.c.
2666 * w32.c (fstatat, readlinkat): New functions.
2667 (careadlinkat): Don't check that fd == AT_FDCWD.
2668 (careadlinkatcwd): Remove; no longer needed.
2670 2013-01-31 Glenn Morris <rgm@gnu.org>
2672 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2673 (Fwrite_region): Update for new choose_write_coding_system args.
2674 Move the last piece of choose_write_coding_system here. (Bug#13522)
2675 (syms_of_fileio): Add choose-write-coding-system.
2677 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2679 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2680 (sys_close): Zero out the flags for the file descriptor before
2681 closing it. (Bug#13546)
2683 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2684 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2685 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2688 * w32.c (w32_get_long_filename, init_environment, readlink):
2689 Support file names encoded in DBCS codepages.
2690 (readlink): Use the current file-name-coding-system, not the ANSI
2691 codepage, to decode and handle targets of symlinks.
2693 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2695 * w32.c (opendir): Now accepts a 'const char *'.
2697 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2699 Remove obsolete redisplay code. See the discussion at
2700 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2701 * dispnew.c (preemption_period, preemption_next_check): Remove.
2702 (Vredisplay_preemption_period): Likewise.
2703 (update_frame, update_single_window, update_window, update_frame_1):
2704 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2705 used, following the 2012-06-22 change.
2707 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2709 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2711 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2713 * font.c (num_fonts): Remove the leftover from old
2714 debugging code. Adjust comment style here and there.
2715 * insdel.c (insert_1): Remove.
2716 * lisp.h (insert_1): Remove prototype.
2717 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2719 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2721 * w32.c (max_filename_mbslen): New function.
2722 (normalize_filename, readdir): Use it to detect locales where ANSI
2723 encoding of file names uses a double-byte character set (DBCS).
2724 If a DBCS encoding is used, advance by characters using
2725 CharNextExA, instead of incrementing a 'char *' pointer.
2726 Use _mbslwr instead of _strlwr. (Bug#13515)
2728 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2729 request of memory reservation to 1.7GB. (Bug#13065)
2731 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2733 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2734 at check_extra_latin label. (Bug#13505)
2736 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2738 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2739 Avoid redundant calls to strlen.
2741 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2743 Drop async_visible and async_iconified fields of struct frame.
2744 This is possible because async input is gone; for details, see
2745 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2746 * frame.h (struct frame): Remove async_visible and async_iconified
2747 members, convert garbaged to unsigned bitfield. Adjust comments.
2748 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2749 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2750 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2751 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2752 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2754 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2755 properly. Likewise for obscured.
2757 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2760 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2762 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2764 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2765 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2767 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2769 * xdisp.c (message2, message2_nolog): Remove functions.
2770 (message3, message3_nolog): Extract nbytes and multibyteness directly
2771 from the string. Change all callers.
2772 (message3_nolog): Don't set message_enable_multibyte since set_message
2773 will reset it anyway.
2774 (message1, message1_nolog): Use message3.
2775 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2776 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2777 (set_message): Drop all but the second arg, which has to be a string.
2778 (set_message_1): Simplify now that we know that a1 is NULL and the
2779 second arg is a string.
2780 * frame.h (struct frame): Remove `message_buf' field.
2781 Use glyphs_initialized_p instead.
2782 (FRAME_MESSAGE_BUF): Remove macro.
2783 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2784 * lisp.h (message2, message2_nolog): Remove declarations.
2785 (message3, message3_nolog): Update declarations.
2786 * keyboard.c (read_char_minibuf_menu_text)
2787 (read_char_minibuf_menu_width): Remove vars.
2788 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2789 to correctly handle multibyte strings.
2790 * frame.c (delete_frame): Don't free message_buf any more.
2791 * editfns.c (message_text, message_length): Remove vars.
2792 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2793 * fileio.c (auto_save_error): Use message3 instead of message2.
2794 * dispnew.c (adjust_frame_message_buffer): Remove function.
2796 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2798 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2799 real estate used for the tool bar and the menu bar.
2801 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2803 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2804 hidden buffer is prepared to modification (Bug#13164).
2806 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2808 * window.h (struct window): Change window_end_valid member from
2809 Lisp_Object to a bitfield. Adjust comments.
2810 (wset_window_end_valid): Remove.
2811 * window.c (adjust_window_count): Clear window_end_valid.
2812 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2813 (Fwindow_line_height, set_window_buffer, Frecenter)
2814 (Fsplit_window_internal, Fdelete_other_windows_internal)
2815 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2816 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2817 * xdisp.c (check_window_end, reconsider_clip_changes)
2818 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2819 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2820 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2822 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2824 * xdisp.c (mark_window_display_accurate): Simplify the loop
2825 assuming that the only one of vchild, hchild or buffer window
2826 slots is non-nil. Call mark_window_display_accurate_1 for
2827 the leaf windows only.
2828 (mark_window_display_accurate_1): Always assume leaf window.
2831 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2833 * emacs.c (Qkill_emacs_hook): Now static.
2835 * fileio.c (Finsert_file_contents): Simplify.
2836 Remove unnecessary assignments and tests.
2838 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2840 * w32.c (acl_set_file): Don't test for errors unless
2841 set_file_security returns FALSE. Avoids spurious errors when
2844 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2846 * fileio.c (Finsert_file_contents): Revert code introduced at
2847 2013-01-18 in favor of the simpler and generally better fix.
2848 Save stack space by removing 'buffer' and reusing 'read_buf'
2851 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2853 * lisp.h (eabs): Define unconditionally (Bug#13419).
2854 The old "#if !defined (eabs)" was an unnecessary revenant of back
2855 when this macro was called "abs". Document 'eabs' better.
2857 2013-01-19 Glenn Morris <rgm@gnu.org>
2859 * fns.c (Frandom): Doc fix.
2861 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2863 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2864 segfault when there are lots of overlays.
2866 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2867 when there are lots of overlays.
2868 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2869 for the details and a way to reproduce.
2871 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2873 * fileio.c: Use O_APPEND to append.
2874 This corresponds better to the natural interpretation of "append",
2875 and avoids the need to open the output file twice, or to invoke
2876 lseek when APPEND is neither nil nor a number.
2877 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2878 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2879 file possibly twice, and lseeking to its end; this avoids the
2880 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2881 at the same time: the combination is never needed and apparently
2882 it doesn't work with DOS_NT.
2884 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2885 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2887 Allow floating-point file offsets.
2888 Problem reported by Vitalie Spinu in
2889 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2890 * fileio.c (emacs_lseek): Remove.
2891 (file_offset): New function.
2892 (Finsert_file_contents, Fwrite_region): Use it.
2894 2013-01-19 Chong Yidong <cyd@gnu.org>
2896 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2897 aborting on Fsignal (Bug#13289).
2899 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2901 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2902 set_file_security as failure due to insufficient privileges.
2903 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2904 (fstat): Return owner and group like 'stat' and 'lstat' do.
2906 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2908 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2909 The bug was observed on Ubuntu operating inside a virtual machine,
2910 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2911 The workaround introduces a race condition on non-buggy hosts,
2912 but it's an unlikely race and anyway there's a nearly identical
2913 nearby race that can't be fixed.
2914 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2916 (Fwrite_region): Test for file system time stamp bug.
2917 (init_fileio): New function.
2918 * lisp.h (init_fileio): Declare it.
2919 * emacs.c (main): Call it.
2921 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2922 and make it more consistent with other stat-failure diagnostics.
2924 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2926 Fix crash when inserting data from non-regular files.
2927 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2928 for the error description produced by valgrind.
2929 * fileio.c (read_non_regular): Rename to read_contents.
2930 Free Lisp_Save_Value object used to pass parameters.
2931 (read_non_regular_quit): Rename to read_contents_quit.
2932 (Finsert_file_contents): Redesign internal file reading loop to adjust
2933 gap and end positions after each read and so help make_gap to work
2934 properly. Do not signal an I/O error too early and so do not leave
2935 not yet decoded characters in a buffer, which was the reason of
2936 redisplay crash. Use list2 to build return value. Adjust comments.
2938 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2940 Close a race when statting and reading files (Bug#13149).
2941 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2942 This avoids a race if the file is renamed between stat and open.
2943 This race is not the problem originally noted in Bug#13149;
2944 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2946 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2948 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2949 objects, related functions and macros.
2950 (make_save_value): Adjust prototype.
2951 (make_save_pointer): New prototype.
2952 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2953 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2954 * alloc.c (format_save_value): Rename to make_save_value.
2955 (make_save_pointer): New function.
2956 (record_xmalloc): Use make_save_pointer.
2957 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2958 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2959 Change users of make_save_value to make_save_pointer.
2960 Likewise for format_save_value and make_save_value.
2962 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2964 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2965 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2966 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2969 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2971 * alloc.c (free_save_value): Now static.
2973 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2975 * keymap.c (map_keymap_internal): Use format_save_value.
2976 (map_keymap_char_table_item): Adjust accordingly.
2977 * fileio.c (non_regular_fd, non_regular_inserted)
2978 (non_regular_nbytes): Remove.
2979 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2980 Use format_save_value to pass parameters to read_non_regular.
2981 (read_non_regular): Use XSAVE_ macros to extract parameters.
2983 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2985 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2987 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2989 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2990 extraction from any Lisp_Save_Value slot. Add type checking.
2991 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2992 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2993 * xselect.c: All users changed.
2995 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2997 Some convenient bits to deal with Lisp_Save_Values.
2998 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2999 (allocate_misc): Remove prototype.
3000 (format_save_value): New prototype.
3001 * alloc.c (allocate_misc): Revert back to static.
3002 (format_save_value): New function to build Lisp_Save_Value
3003 object with the specified internal structure.
3004 (make_save_value): Reimplement using format_save_value.
3005 * editfns.c (save_excursion_save): Use format_save_value.
3006 (save_excursion_restore): Use XSAVE_OBJECT.
3008 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3010 Avoid needless casts with XSAVE_POINTER.
3011 * alloc.c (mark_object) [GC_MARK_STACK]:
3012 * dired.c (directory_files_internal_unwind):
3013 * fileio.c (do_auto_save_unwind):
3014 * gtkutil.c (pop_down_dialog):
3015 * keymap.c (map_keymap_char_table_item):
3016 * lread.c (load_unwind):
3017 * nsmenu.m (pop_down_menu):
3018 * print.c (print_object) [GC_MARK_STACK]:
3019 * xfns.c (clean_up_file_dialog):
3020 * xmenu.c (cleanup_widget_value_tree):
3021 Omit casts between XSAVE_POINTER and a pointer type.
3023 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3025 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3026 * eval.c (eval_sub): Protect `form' from being GCed before its
3027 car and cdr becomes protected with the backtrace entry.
3029 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3031 Make Lisp_Save_Value more versatile storage for up to four objects.
3032 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3033 (struct Lisp_Save_Value): New layout. Adjust comments.
3034 (XSAVE_POINTER): New macro.
3035 (XSAVE_INTEGER): Likewise.
3036 (allocate_misc): Add prototype.
3037 (free_misc): Likewise.
3038 * alloc.c (allocate_misc): Now global.
3039 (free_misc): Likewise. Adjust comment.
3040 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3041 (free_save_value): Likewise.
3042 (mark_object): Likewise.
3043 * editfns.c (save_excursion_save): Pack everything within
3044 Lisp_Save_Value and so avoid xmalloc.
3045 (save_excursion_restore): Adjust to match new layout. Use free_misc
3046 because we do not allocate extra memory any more. Add eassert.
3047 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3048 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3049 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3050 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3051 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3053 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3055 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3056 (nsfont_draw): Remove disabling of LCD smoothing.
3057 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3058 Bug#11484 with LCD smoothing on.
3060 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3062 Fix SIGDANGER handlers, for AIX (Bug#13408).
3063 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3064 Move handlers here from emacs.c; they were out of place.
3066 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3068 * xterm.c (syms_of_xterm): Adjust documentation for
3069 scroll-bar-adjust-thumb-portion.
3071 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3073 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3074 determine whether scroll bar thumb size should be adjusted or
3075 not. Use variable for MOTIF.
3077 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
3080 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3082 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3084 (doCommandBySelector:): Set processingCompose to NO.
3086 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3087 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3088 (nsfont_list_family): Add block/unblock_input calls.
3089 (nsfont_open): Move block_input earlier. Add unblock_input before early
3091 (nsfont_draw): Add block/unblock_input calls.
3093 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3095 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3096 for old_charpos and old_bytepos.
3098 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3100 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3101 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3102 Clear tzvalbuf_in_environ if this workaround is in effect.
3103 Problem and fix reported by Kazuhiro Ito.
3105 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3107 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3108 Fix ambiguous doc string cross-reference(s).
3110 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3111 doc string cross-reference(s).
3113 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3114 string cross-reference(s).
3116 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3118 Avoid unnecessary byte position calculation for the gap movement.
3119 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3120 anyway, all of them should use move_gap_both instead.
3121 * lisp.h (move_gap): Remove prototype.
3122 * insdel.c (move_gap): Remove.
3123 (move_gap_both): Add eassert.
3124 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3125 * xml.c (parse_region): Likewise.
3127 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3129 emacsclient -t should not suspend Emacs server (Bug#13387)
3130 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3132 * term.c (init_tty): Use them instead of rolling our own code.
3133 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3134 switches from 'signal' to 'pthread_sigmask', which is safer in
3135 multithreaded applications.
3136 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3137 which has already arranged for that.
3138 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3139 This is the main part of the bug fix.
3141 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3143 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3144 x_last_font_name (Bug#13403).
3146 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3148 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3149 the type of per-buffer values where appropriate.
3150 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3151 predicate, which is how it's really used now. Adjust comment.
3152 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3153 * buffer.c (buffer_slot_type_mismatch): Remove.
3154 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3155 predicate. Adjust comment.
3156 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3157 fill-column, left-margin, tab-width, buffer-saved-size,
3158 left-margin-width, right-margin-width, left-fringe-width,
3159 right-fringe-width, scroll-bar-width and buffer-display-count.
3160 Use Qstringp for default-directory, buffer-file-name,
3161 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3162 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3164 * data.c (store_symval_forwarding): Adjust to call the predicate.
3166 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3168 * w32.c (get_name_and_id, acl_set_file):
3169 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3171 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3173 * lisp.h (make_gap_1): New prototype.
3174 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3176 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3178 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3179 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3180 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3181 (make_gap_1): New function to adjust the gap of any buffer.
3182 * coding.c (coding_alloc_by_making_gap): Use it.
3183 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3184 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3186 2013-01-08 Juri Linkov <juri@jurta.org>
3188 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3189 of (supports :underline (:style wave)). (Bug#13000)
3191 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3193 * undo.c (Fprimitive_undo): Move to simple.el.
3194 (syms_of_undo): Remove declarations for Sprimitive_undo.
3196 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3198 * keyboard.c (echo_add_key): Rename from echo_add_char.
3200 2013-01-06 Chong Yidong <cyd@gnu.org>
3202 * keyboard.c (echo_add_char): New function, factored out from
3203 echo_char. Don't add a space if the previous echo string was
3205 (echo_char): Use it.
3206 (read_key_sequence): When echoing mock input, ensure that the
3207 trailing dash is properly added.
3209 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3211 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3212 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3213 digits for buffer positions, before misalignment starts.
3214 Display "0" for integer "object" field.
3215 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3216 Display the newline glyph more unambiguously.
3218 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3220 * nsterm.m (ns_draw_underwave):
3221 * w32term.c (w32_draw_underwave):
3222 * xterm.c (x_draw_underwave): Make underwave look more triangular
3223 and also degrade gracefully for small fonts. (Bug#13000)
3225 * nsterm.m (ns_draw_text_decoration):
3226 * w32term.c (x_draw_glyph_string):
3227 * xterm.c (x_draw_glyph_string): Don't use previous underline
3228 thickness and position if previous underline type is underwave.
3230 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3232 * fileio.c (Ffile_acl): Undocument return format.
3234 2013-01-02 Glenn Morris <rgm@gnu.org>
3236 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3238 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3241 * dired.c (file_name_completion):
3242 * doc.c (get_doc_string):
3243 * floatfns.c (round2):
3244 * font.c (font_score, font_delete_unmatched):
3245 * fringe.c (compute_fringe_widths):
3246 * lread.c (read_list):
3247 * minibuf.c (Ftry_completion):
3248 * term.c (tty_ins_del_lines):
3249 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3250 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3252 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3254 * w32.c (unsetenv): Set up the string passed to _putenv
3256 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3257 for the bug this caused.
3259 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3261 * coding.c (Qmac): Now static.
3263 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3265 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3266 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3267 handlebox_widget. Set toolbar_in_hbox to false/true, set
3268 toolbar_is_packed to true.
3269 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3270 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3271 Show all on TOOLBAR_TOP_WIDGET.
3272 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3273 by TOOLBAR_TOP_WIDGET.
3274 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3275 Check toolbar_is_packed.
3276 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3277 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3278 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3280 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3281 (xg_update_menubar): Update title only if
3282 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3283 (xg_update_submenu): Skip tearoff only if
3284 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3285 (xg_initialize): Initialize xg_detached_menus only if
3286 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3288 * xterm.h (struct x_output): Surround handlebox_widget with
3289 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3290 toolbar_in_hbox is bool.
3292 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3294 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3295 (LIBS_GNUSTEP): Define.
3296 (LIBES): Add $(LIBS_GNUSTEP).
3297 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3299 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3301 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3302 continuation glyph on a TTY with an indication of an empty line.
3305 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3307 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3308 file's SELinux context or ACLs successfully set, nil otherwise.
3310 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3312 * w32proc.c (reader_thread): Avoid passing NULL handles to
3313 SetEvent and WaitForSingleObject.
3315 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3317 Port EXTERNALLY_VISIBLE to Clang 3.2.
3318 * conf_post.h (__has_attribute): New macro.
3319 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3321 2012-12-27 Glenn Morris <rgm@gnu.org>
3323 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3324 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3326 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3328 * fileio.c (file_name_as_directory, directory_file_name):
3329 Accept an additional argument MULTIBYTE to indicate whether the input C
3330 came from a multibyte or a unibyte Lisp string; all callers
3331 adjusted. Don't assume the input string is always multibyte.
3333 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3334 don't ENCODE_FILE them, and return a unibyte string if the input
3336 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3337 don't assume the input strings will always be multibyte. If the
3338 input strings are multibyte, decode strings obtained from C
3341 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3343 * lisp.h (toplevel): Add two notices to the comment about
3344 defining a new Lisp data type.
3345 * print.c (print_object): If Lisp_Save_Value object's pointer
3346 is the address of a memory area containing Lisp_Objects, try
3348 * alloc.c (valid_lisp_object_p): Adjust comment.
3350 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3352 * keyboard.c (record_asynch_buffer_change): Initialize an event
3353 only if it's really needed.
3354 * frame.h (enum output_method): Remove output_mac member since
3355 it's a leftover from the deleted code.
3356 * frame.c (Fframep): Adjust user here ...
3357 * terminal.c (Fterminal_live_p): ... and here.
3358 * coding.c (Qmac): Now here because it's only used to denote
3359 end-of-line encoding type.
3360 (syms_of_coding): DEFSYM it.
3361 * frame.h (Qmac): Remove duplicated declaration.
3363 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3365 * window.c (select_window_1): Now static, since it's used only here.
3367 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3369 * window.c (window_body_cols): Subtract display margins from the
3370 window body width on TTYs as well. See
3371 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3372 for the original report.
3374 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3376 * xdisp.c (redisplay_window): Remove inner local variable
3377 because the outer shadowed one has the same meaning.
3378 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3380 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3381 (xg_create_tool_bar): Adjust users.
3383 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3385 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3386 * buffer.c (Fget_buffer_create): Use it to set compact field of
3387 struct buffer_text to avoid accessing an uninitialized value
3388 when compact_buffer is called for the first time.
3389 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3390 (Fset_buffer_modified_p): Use buffer_window_count to check
3391 whether the buffer is displayed in some window.
3392 * xdisp.c (message_dolog): Likewise.
3394 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3396 * w32.c (acl_set_file): If setting the file security descriptor
3397 fails, and the new DACL is identical to the existing one, silently
3398 return success. This fixes problems for users backing up their
3399 own files without having the necessary privileges for setting
3400 security descriptors.
3402 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3404 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3405 after WaitForSingleObject returns normally. This expedites reader
3406 thread shutdown when delete_child triggers it.
3407 (reap_subprocess): More accurate commentary for why we call
3408 delete_child only when cp->fd is negative.
3410 * w32.c (sys_close): Do not call delete_child on a subprocess
3411 whose handle is not yet closed. Instead, set its file descriptor
3412 to a negative value, so that reap_subprocess will call
3413 delete_child on that subprocess when its SIGCHLD arrives.
3414 This avoids closing handles used for communications between sys_select
3415 and reader_thread, which doesn't give sys_select a chance to
3416 notice that the process exited and invoke the SIGCHLD handler for
3419 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3421 * nsfns.m (Fns_do_applescript): Run event loop until script has
3422 been executed (Bug#12969).
3423 (ns_run_ascript): Chech as_script for nil, set to nil after
3426 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3428 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3430 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3432 * w32term.c (w32fullscreen_hook): New function.
3433 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3435 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3437 * fileio.c (Finsert_file_contents): Doc fix.
3439 * w32proc.c (new_child, delete_child, find_child_pid): For a
3440 subprocess, consider its slot being in use as long as its process
3441 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3442 slot when a new process is started immediately after killing
3443 another one, without waiting enough time for the first process to
3444 be reaped and resources allocated for it be orderly freed.
3446 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3448 2012-12-21 Chong Yidong <cyd@gnu.org>
3450 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3452 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3454 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3456 * w32.c (get_name_and_id): Always pass NULL as the first argument
3457 of lookup_account_sid. Avoids crashes with UNC file names that
3458 refer to DFS domains, not to specific machine names. (Bug#12621)
3459 Remove now unused argument FNAME; all callers changed.
3460 (get_file_owner_and_group): Remove now unused argument FNAME; all
3463 2012-12-21 Chong Yidong <cyd@gnu.org>
3465 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3466 error for invalid chars, don't check for a nil return value.
3468 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3470 Avoid calls to CHAR_TO_BYTE if byte position is known.
3471 * editfns.c (make_buffer_string_both): Use move_gap_both.
3472 (Fbuffer_string): Use make_buffer_string_both.
3473 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3475 (buf_bytepos_to_charpos): Likewise.
3476 (charpos_to_bytepos): Remove.
3477 * fileio.c (Finsert_file_contents): Use move_gap_both.
3478 * search.c (Freplace_match): Likewise.
3479 * process.c (process_send_region): Likewise. Use convenient
3480 names for byte positions.
3481 * lisp.h (charpos_to_bytepos): Remove prototype.
3482 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3483 * insdel.c (move_gap): Likewise.
3485 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3487 * xdisp.c (redisplay_internal): Remove now-unused local.
3489 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3491 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3492 (redisplay_internal): Don't bother selecting the frame to get the
3493 proper value of frame-local variables (bug#13225).
3495 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3497 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3498 Rename 4th argument since it may be buffer or string. Adjust comment.
3499 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3501 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3503 * coding.c (Fdetect_coding_region): Do not check start and end with
3504 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3505 (code_convert_region): Likewise.
3507 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3509 * w32.c (acl_get_file, acl_set_file): Run the file name through
3510 map_w32_filename, and resolve any symlinks in the file name, like
3512 (acl_set_file): Call revert_to_self, if any privileges were
3515 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3517 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3518 ($(BLD)/w32.$(O)): Update dependencies.
3520 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3522 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3523 propagate redisplay's scrolling (if any) to the right window.
3524 (redisplay_internal): Use ensure_selected_frame.
3525 (display_mode_lines): Complete last fix.
3526 * window.c (select_window_1): New func, extracted from select_window.
3527 (select_window): Use it.
3528 * window.h (select_window_1): Declare.
3530 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3532 Emulate Posix ACL APIs on MS-Windows.
3533 * w32.c: Include sddl.h and sys/acl.h.
3534 (SDDL_REVISION_1): Define if not already defined.
3535 (g_b_init_get_security_descriptor_dacl)
3536 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3537 (g_b_init_is_valid_security_descriptor)
3538 (g_b_init_set_file_security): New static flags.
3539 (globals_of_w32): Initialize them to zero.
3540 (SetFileSecurity_Name): New string constant.
3541 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3542 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3543 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3544 (IsValidSecurityDescriptor_Proc): New typedefs.
3545 (get_file_security, get_security_descriptor_owner)
3546 (get_security_descriptor_group): Set errno to ENOTSUP.
3547 (set_file_security, get_security_descriptor_dacl)
3548 (is_valid_security_descriptor, convert_sd_to_sddl)
3549 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3550 (acl_free, acl_get_file, acl_set_file): New functions.
3552 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3554 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3556 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3557 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3558 for some of that bug's symptoms can now cause Emacs to abort.
3559 Remove the workaround.
3560 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3561 The bug that caused SIGCHLD to get lost has been fixed, and the
3562 workaround for it can now cause Emacs to abort.
3564 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3566 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3567 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3568 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3570 2012-12-16 Romain Francoise <romain@orebokech.com>
3572 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3573 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3574 and copy ACL entries of file in addition to SELinux context if set.
3575 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3577 * Makefile.in (LIBACL_LIBS): New macro.
3580 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3582 * fileio.c (internal_delete_file): Use bool for boolean.
3584 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3586 Fix bug #13079 on MS-Windows with temp files not being deleted.
3587 * w32.h (_child_process): New members input_file and
3589 (register_child): First argument is now pid_t.
3590 (record_infile, record_pending_deletion): New prototypes.
3592 * w32proc.c (new_child): Initialize input_file and
3593 pending_deletion members of the child.
3594 (delete_child): Delete the child's temporary input file, if any,
3595 that is pending deletion.
3596 (register_child): First argument is now pid_t.
3597 (record_infile, record_pending_deletion): New functions.
3598 (reap_subprocess): Fix a typo in DebPrint string.
3599 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3601 * fileio.c (internal_delete_file): Return an int again: non-zero
3602 if delete-file succeeds, zero otherwise.
3604 * lisp.h (internal_delete_file): Adjust prototype.
3606 * callproc.c (Fcall_process): Don't overwrite infile with result
3608 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3609 asynchronous subprocess, record the name of the input file name,
3611 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3612 delete the file, record it as pending deletion when the subprocess
3615 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3617 * editfns.c [HAVE_PWD_H]: Include grp.h.
3619 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3621 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3623 Fix permissions bugs with setgid directories etc. (Bug#13125)
3624 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3625 to mark it as a placeholder. The old value was often wrong.
3626 The only user of this attribute has been changed to use
3627 file-ownership-preserved-p instead, with its new group arg.
3628 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3630 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3632 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3633 Keep selected_window and selected_frame in sync.
3635 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3637 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3638 try to get accurate owner and group information from NT file
3639 security APIs. This is to make most callers of 'stat' and
3640 'lstat', which don't need that information, much faster.
3642 * dired.c (Ffile_attributes) [WINDOWSNT]:
3643 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3644 owner and group information from 'lstat'.
3646 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3648 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3649 as that confuses set-auto-coding, so insist on the head-read
3650 returning the full 1024 bytes. Let lseek compute the tail offset;
3651 less work for us. Do not ignore I/O errors when reading the tail.
3653 * xdisp.c: Minor style fixes.
3654 (init_iterator): Hoist assignment out of if-expression.
3655 (markpos_of_region): Callers now test for sign, not for -1.
3657 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3659 Minor redisplay optimization when the region length is zero.
3660 * xdisp.c (markpos_of_region): New function.
3661 (init_iterator): Do not highlight the region of zero length.
3662 (redisplay_window): Check whether the region is of non-zero length.
3663 (try_cursor_movement): Allow if the region length is zero.
3664 (try_window_reusing_current_matrix, try_window_id): Likewise.
3666 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3668 * search.c (search_buffer): Check the inverse translations of each
3669 character in pattern when the buffer being searched is unibyte.
3672 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3674 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3675 files, fixing a regression from 24.2.
3676 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3678 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3680 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3681 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3682 Remove unnecessary S_ISLNK test, as (contra the comments) this
3683 function can't copy symlinks. Improve quality of error message
3684 when attempting to copy files that are neither regular files nor
3687 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3689 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3690 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3691 * window.c (Frecenter):
3692 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3693 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3695 2012-12-12 Daniel Colascione <dancol@dancol.org>
3697 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3698 the dumped Emacs is not a sparse file, greatly improving Cygwin
3699 "make bootstrap" performance.
3701 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3703 * inotify.c (inotify_callback): Generate an Emacs event for every
3704 incoming inotify event.
3706 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3708 * xdisp.c (handle_face_prop): Fix logic of computing
3709 it->start_of_box_run_p.
3710 (append_space_for_newline): If the glyph row is R2L, reset the
3711 iterator's end_of_box_run_p flag before prepending the space glyph.
3712 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3713 iterator's start_of_box_run_p flag before prepending the stretch.
3714 (append_glyph, produce_image_glyph, append_composite_glyph)
3715 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3716 left_box_line_p and right_box_line_p flags of the glyph for R2L
3717 glyph rows. (Bug#13011)
3719 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3721 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3722 if changed buffer is not shown in a window.
3723 * insdel.c (prepare_to_modify_buffer): Likewise.
3724 * window.c (replace_buffer_in_windows_safely): Do nothing
3725 if buffer is not shown in a window.
3726 (Fforce_window_update): Likewise if string or buffer argument
3729 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3731 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3732 encoded_file_name, which is what it is.
3734 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3736 Consistently use marker_position and marker_byte_position.
3737 * fringe.c (Ffringe_bitmaps_at_pos):
3738 * indent.c (Fvertical_motion):
3739 * insdel.c (prepare_to_modify_buffer):
3740 * keyboard.c (make_lispy_position):
3741 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3742 (window_scroll_pixel_based, displayed_window_lines)
3743 (Fset_window_configuration):
3744 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3745 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3746 Replace direct access to marker fields with calls
3747 to marker_position and/or marker_byte_position.
3749 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3751 * makefile.w32-in (SIG2STR_H): New macro.
3752 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3753 ($(BLD)/w32notify.$(O)): Update dependencies.
3755 2012-12-10 Daniel Colascione <dancol@dancol.org>
3757 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3758 Windows file notification functionality unless WINDOWSNT.
3760 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3763 * w32fns.c (cache_system_info): Initialize the global hinst
3764 variable here so various initialization calls DTRT.
3766 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3767 (hinst): Remove unneeded extern declaration.
3768 (_start): Remove initialization of above variables; remove
3769 initialization of hinst, as cache_system_info now does that.
3771 * emacs.c (main): Call cache_system_info early in startup; we
3772 previously weren't calling it in Cygwin builds.
3774 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3775 Teach the autoconf build system how to compile a Windows resource file
3776 and link it to Emacs.
3778 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3780 Per-buffer window counters.
3781 * buffer.h (struct buffer): New member window_count.
3782 (buffer_window_count): New function.
3783 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3784 Initialize window_count.
3785 (Fkill_buffer): Verify window_count for the buffer being killed.
3786 (modify_overlay): Do not force redisplay if buffer is not shown
3788 (init_buffer_once): Initialize window_count for buffer_defaults
3789 and buffer_local_symbols.
3790 * window.h (buffer_shared): Remove declaration.
3791 (wset_buffer): Convert from inline ...
3792 * window.c (wset_buffer): ... to an ordinary function.
3793 (adjust_window_count): New function.
3794 (make_parent_window): Use it.
3795 * xdisp.c (buffer_shared): Remove.
3796 (redisplay_internal, redisplay_window): Adjust users.
3797 (buffer_shared_and_changed): Use per-buffer window counter.
3799 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3801 Support for filesystem notifications on MS-Windows.
3802 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3803 and this is a TTY frame, signal the caller that keyboard input is
3806 * w32xfns.c (drain_message_queue): Now returns an int: an
3807 indication whether any WM_EMACS_FILENOTIFY messages were found in
3810 * w32inevt.c (handle_file_notifications): New function.
3811 (w32_console_read_socket): Call it to process file notifications.
3813 * w32console.c (initialize_w32_display): Record the main thread ID
3816 * deps.mk (inotify.o): New dependency list.
3818 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3820 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3821 (WM_EMACS_END): Bump value by 1.
3822 (notification_buffer_in_use, file_notifications)
3823 (notifications_size, notifications_desc): Declare.
3824 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3827 * w32term.c (lispy_file_action, queue_notifications): New functions.
3828 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3829 <Qrenamed_to>: New symbols.
3830 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3832 * w32notify.c: New file, implements file event notifications for
3835 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3836 by posting it to the w32_read_socket queue.
3838 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3840 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3841 (GLOBAL_SOURCES): Add w32notify.c
3842 ($(BLD)/w32notify.$(O)): New set of dependencies.
3844 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3846 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3847 Handle FILE_NOTIFY_EVENT.
3848 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3849 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3850 w32notify-handle-event by default.
3852 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3855 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3857 Support for filesystem notifications on GNU/Linux via inotify.
3858 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3860 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3862 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3863 (syms_of_keyboard): DEFSYM it.
3864 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3865 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3866 Qfile_inotify events.
3867 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3868 special-event-map to inotify-handle-event.
3870 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3872 * Makefile.in (base_obj): Add inotify.o.
3874 * inotify.c: New file.
3876 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3878 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3880 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3882 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3883 DWORD_PTR, for compatibility with 64-bit builds.
3885 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3886 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3887 (system_process_attributes): Use SIZE_T rather than DWORD, for
3888 compatibility with 64-bit builds.
3890 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3892 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3894 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3896 * indent.c (Fvertical_motion): If a display string will be
3897 displayed on the left or the right margin, don't consider it as a
3898 factor in cursor positioning. (Bug#13108)
3900 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3902 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3904 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3906 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3909 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3911 * w32.c (unsetenv): Return 0 if the input string is too long.
3913 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3915 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3916 * alloc.c (xputenv): New function.
3917 * dbusbind.c (Fdbus_init_bus):
3919 * xterm.c (x_term_init):
3920 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3921 * editfns.c (initial_tz): Move static var decl up.
3922 (tzvalbuf_in_environ): New static var.
3923 (init_editfns): Initialize these two static vars.
3924 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3925 Save old TZ value on stack, if it's small.
3926 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3927 instead, use xputenv+unsetenv to set and restore TZ.
3928 (environbuf): Remove static var. All uses removed.
3929 (Fset_time_zone_rule): Do not save TZ and environ;
3930 no longer needed here.
3931 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3932 Move to inside set_time_zone_rule; they don't need file scope any more.
3933 (set_time_zone_rule): Maintain the TZ=value string separately.
3934 (syms_of_editfns): Don't initialize initial_tz;
3935 init_editfns now does it.
3936 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3937 * lisp.h (xputenv): New decl.
3939 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3941 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3943 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3945 * w32.c (unsetenv, sys_putenv): New functions.
3947 2012-12-08 Chong Yidong <cyd@gnu.org>
3949 * editfns.c (Finsert_char): Make the error message more
3950 informative (Bug#12992).
3952 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3954 Simplify get_lim_data.
3955 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3956 Remove USG and vlimit methods; no longer used these days.
3957 Add #error catchall just in case.
3959 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3960 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3961 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3962 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3963 (deleted_pid_list, Fdelete_process, create_process)
3964 (record_child_status_change, handle_child_signal, deliver_child_signal)
3965 (init_process_emacs, syms_of_process):
3966 Assume SIGCHLD is defined.
3967 (parse_signal): Remove. All uses removed.
3968 (abbr_to_signal): New static function.
3969 (Fsignal_process): Use it to convert signal names to ints.
3970 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3971 kill (getpgrp (), ...).
3972 (emacs_sigaction_init): Assume SIGCHLD is defined.
3973 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3974 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3975 * syssignal.h (EMACS_KILLPG): Remove.
3976 All uses replaced by 'kill' with a negative pid.
3977 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3978 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3980 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3982 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3983 This will cause a production Emacs to dump core instead of
3986 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3988 * frame.c (make_frame): Do not set window's buffer to t.
3989 * window.c (Fsplit_window_internal): Likewise. Previously it was
3990 used to indicate that the window is being set up. Now we use
3991 set_window_buffer for all new windows, so the condition in ...
3992 (Fset_window_buffer): ... is always true and can be removed.
3994 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3996 Convenient macro to check whether the buffer is hidden.
3997 * buffer.h (BUFFER_HIDDEN_P): New macro.
3998 * frame.c (make_frame): Use it. Adjust comment.
3999 * buffer.c (candidate_buffer): New function.
4000 (Fother_buffer, other_buffer_safely): Use it.
4002 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4004 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4005 if the child process is still running. Instead, exit the wait
4006 loop and return zero. (Bug#13086)
4008 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4010 * frame.h (x_char_width, x_char_height): Remove prototypes.
4011 * w32term.h (x_char_width, x_char_height): Likewise.
4012 * xfns.c (x_char_width, x_char_height): Remove.
4013 * w32fns.c (x_char_width, x_char_height): Likewise.
4014 * nsfns.c (x_char_width, x_char_height): Likewise.
4015 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4017 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4018 * keyboard.c (command_loop_1): Remove prototype.
4019 (command_loop_2, top_level_1): Add static to match prototype.
4021 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4023 Fix a recently-introduced delete-process race condition.
4024 * callproc.c, process.h (record_kill_process):
4025 New function, containing part of the old call_process_kill.
4026 (call_process_kill): Use it.
4027 This does not change call_process_kill's behavior.
4028 * process.c (Fdelete_process): Use record_kill_process to fix a
4029 race condition that could cause Emacs to lose track of a child.
4031 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4033 Avoid code duplication between prev_frame and next_frame.
4034 * frame.c (candidate_frame): New function. Add comment.
4035 (prev_frame, next_frame): Use it. Adjust comment.
4037 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4039 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4040 fails, signal an error instead of continuing with an empty
4042 Encode expanded temp file pattern before passing it to mkstemp or
4045 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4046 Encode the file name before passing it to dostounix_filename, in
4047 case it will downcase it (under w32-downcase-file-names).
4050 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4052 Minor call-process cleanups.
4053 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4054 at the same time as other platforms, to simplify analysis.
4055 No need for fd0_volatile since we have synch_process_fd.
4056 Avoid needless emacs_close; arg is always negative.
4058 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4060 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4063 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4065 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4066 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4067 and mouse_face_hidden members to a bitfields.
4068 * frame.h (struct frame): Remove set-but-not-used space_width member.
4069 (FRAME_SPACE_WIDTH): Remove.
4070 * nsterm.m, w32term.c, xterm.c: Adjust users.
4071 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4072 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4073 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4074 members to a bitfields.
4076 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4078 Don't let call-process be a zombie factory (Bug#12980).
4079 Fixing this bug required some cleanup of the signal-handling code.
4080 As a side effect, this change also fixes a longstanding rare race
4081 condition whereby Emacs could mistakenly kill unrelated processes,
4082 and it fixes a bug where a second C-g does not kill a recalcitrant
4083 synchronous process in GNU/Linux and similar platforms.
4084 The patch should also fix the last vestiges of Bug#9488,
4085 a bug which has mostly been fixed on the trunk by other changes.
4086 * callproc.c, process.h (synch_process_alive, synch_process_death)
4087 (synch_process_termsig, sync_process_retcode):
4088 Remove. All uses removed, to simplify analysis and so that
4089 less consing is done inside critical sections.
4090 * callproc.c (call_process_exited): Remove. All uses replaced
4091 with !synch_process_pid.
4092 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4093 These take the role of what used to be in unwind-protect arg.
4095 (block_child_signal, unblock_child_signal):
4096 New functions, to avoid races that could kill innocent-victim processes.
4097 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4098 (call_process_kill): Record killed processes as deleted, so that
4099 zombies do not clutter up the system. Do this inside a critical
4100 section, to avoid a race that would allow the clutter.
4101 (call_process_cleanup): Fix code so that the second C-g works again
4102 on common platforms such as GNU/Linux.
4103 (Fcall_process): Create the child process in a critical section,
4104 to fix a race condition. If creating an asynchronous process,
4105 record it as deleted so that zombies do not clutter up the system.
4106 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4107 light of these changes. Omit unnecessary call to emacs_close
4108 before failure, as the unwind-protect code does that.
4109 * callproc.c (call_process_cleanup):
4110 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4111 * process.c (record_deleted_pid): New function, containing
4112 code refactored out of Fdelete_process.
4113 (Fdelete_process): Use it.
4114 (process_status_retrieved): Remove. All callers changed to use
4115 child_status_change.
4116 (record_child_status_change): Remove, folding its contents into ...
4117 (handle_child_signal): ... this signal handler. Now, this
4118 function is purely a handler for SIGCHLD, and is not called after
4119 a synchronous waitpid returns; the synchronous code is moved to
4120 wait_for_termination. There is no need to worry about reaping
4121 more than one child now.
4122 * sysdep.c (get_child_status, child_status_changed): New functions.
4123 (wait_for_termination): Now takes int * status and bool
4124 interruptible arguments, too. Do not record child status change;
4125 that's now the caller's responsibility. All callers changed.
4126 Reimplement in terms of get_child_status.
4127 (wait_for_termination_1, interruptible_wait_for_termination):
4128 Remove. All callers changed to use wait_for_termination.
4129 * syswait.h: Include <stdbool.h>, for bool.
4130 (record_child_status_change, interruptible_wait_for_termination):
4132 (record_deleted_pid, child_status_changed): New decls.
4133 (wait_for_termination): Adjust to API changes noted above.
4135 * bytecode.c, lisp.h (Qbytecode): Remove.
4136 No longer needed after 2012-11-20 interactive-p changes.
4138 2012-12-03 Eli Zaretskii <eliz@gnu.org>
4140 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4141 the scroll margin, move point outside the margin. (Bug#13055)
4143 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4145 * gtkutil.c (my_log_handler): New function.
4146 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4148 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4150 * lisp.h (modify_region): Rename to...
4151 (modify_region_1): ...new prototype.
4152 * textprop.c (modify_region): Now static. Adjust users.
4153 * insdel.c (modify_region): Rename to...
4154 (modify_region_1): ...new function to work with current buffer.
4155 Adjust comment and users. Use true and false for booleans.
4157 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4159 * alloc.c (free_save_value): New function.
4160 (safe_alloca_unwind): Use it.
4161 * lisp.h (free_save_value): New prototype.
4162 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4164 (save_excursion_restore): Adjust to match saved data structure.
4165 Use free_save_value to offload some work from GC. Drop obsolete
4168 2012-12-03 Chong Yidong <cyd@gnu.org>
4170 * fileio.c (Vauto_save_list_file_name): Doc fix.
4172 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4174 * w32fns.c: Remove prototype of atof.
4175 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4177 (file_dialog_callback): Make it UINT_PTR.
4179 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4182 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4183 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4186 2012-12-03 Glenn Morris <rgm@gnu.org>
4188 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4190 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4192 Fix xpalloc confusion after memory is exhausted.
4193 * alloc.c (xpalloc): Comment fix.
4194 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4195 and signals an error, do not clear charset_table_size, as
4196 charset_table is still valid.
4197 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4199 Use execve to avoid need to munge environ (Bug#13054).
4200 * callproc.c (Fcall_process):
4201 * process.c (create_process):
4202 Don't save and restore environ; no longer needed.
4203 * callproc.c (child_setup):
4204 Use execve, not execvp, to preserve environ.
4206 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4208 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4210 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4212 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4213 display for sliced images (Bug#10500).
4215 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4217 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4219 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4220 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4222 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4224 * xdisp.c (window_outdated): Remove eassert since it hits
4225 some suspicious corner cases (see Bug#13007 and Bug#13012).
4226 (mode_line_update_needed): New function.
4227 (redisplay_internal, redisplay_window): Use it.
4228 (ensure_selected_frame): New function.
4229 (redisplay_internal, unwind_redisplay): Use it.
4230 (redisplay_internal): Move comment about buffer_shared...
4231 (buffer_shared_and_changed): ...near to its real use.
4233 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4235 * callproc.c (Fcall_process): Don't misreport vfork failure.
4237 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4239 * callproc.c (Fcall_process): Fix vfork portability problems.
4240 Do not assume that fd[0], count, filefd, and save_environ survive
4241 vfork. Fix bug whereby wrong errno value could be reported for
4242 pipe failure. Some minor cleanups, too, as follows. Move buf and
4243 bufsize to the context where they're needed. Change new_argv to
4244 be of type char **, as this is more convenient and avoids casts.
4245 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4246 Now local constants, not macros.
4248 2012-11-18 Kenichi Handa <handa@gnu.org>
4250 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4251 for the variable "f".
4253 2012-11-13 Kenichi Handa <handa@gnu.org>
4255 * font.c (font_unparse_xlfd): Exclude special characters from the
4256 generating XLFD name.
4258 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4260 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4261 * dired.c (stat_uname, stat_gname):
4262 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4264 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4265 * dired.c (directory_files_internal, file_name_completion):
4266 Assume EAGAIN and EINTR are defined.
4268 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4269 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4270 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4271 * lread.c (readbyte_from_file): Assume EINTR is defined.
4272 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4273 Assume EIO and EAGAIN are defined.
4274 * unexcoff.c (write_segment): Assume EFAULT is defined.
4276 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4278 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4281 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4282 highlighting on the frame was cleared. Prevents assertion
4283 violations when repeatedly clicking on the "Top" link of the
4284 "bread-crumbs" in Info buffers.
4286 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4288 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4290 2012-11-24 Ken Brown <kbrown@cornell.edu>
4292 * keyboard.c (HAVE_MOUSE):
4293 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4294 were always defined.
4296 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4298 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4299 between bpos_covered and bpos_max. This fixes cursor display when
4300 several display strings follow each other.
4302 * .gdbinit (pgx): If the glyph's object is a string, display the
4303 pointer to string data, rather than the value of the string object
4304 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4306 * indent.c (Fvertical_motion): If the starting position is covered
4307 by a display string, return to one position before that, to avoid
4308 overshooting it inside move_it_to. (Bug#12930)
4310 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4312 * frame.h (struct frame): Remove display_preempted member
4313 since all users are dead long ago.
4314 * nsterm.h (struct x_output): Use the only dummy member.
4315 * w32menu.c (pending_menu_activation): Remove since not
4317 (set_frame_menubar): Adjust user.
4318 * w32term.h (struct x_output): Drop outdated #if 0 code.
4319 (struct w32_output): Use bitfields for explicit_parent,
4320 asked_for_visible and menubar_active members.
4321 Drop unused pending_menu_activation member.
4322 * xterm.h (struct x_output): Drop outdated #if 0 code.
4323 Use bitfields for explicit_parent, asked_for_visible,
4324 has_been_visible and net_wm_state_hidden_seen members.
4326 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4328 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4329 of a literal "/". (Bug#12955)
4330 (gl-stamp): Invoke fc.exe directly, not through cmd.
4332 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4334 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4335 * dired.c: Assume HAVE_DIRENT_H.
4336 (NAMLEN): Remove, replacing with ...
4337 (dirent_namelen): New function. All uses changed. Use the GNU macro
4338 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4339 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4340 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4341 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4343 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4344 * ndir.h: Rename to ../nt/inc/dirent.h.
4345 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4346 Do not include <dirent.h>; no longer needed.
4347 * w32.c: Include <dirent.h> rather than "ndir.h".
4349 2012-11-23 Chong Yidong <cyd@gnu.org>
4351 * xftfont.c (xftfont_open): Remove duplicate assignment.
4353 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4355 * alloc.c (Fgarbage_collect): Unblock input after clearing
4356 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4357 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4358 * msdos.c (IT_frame_up_to_date): Use it here...
4359 * w32term.c (w32_frame_up_to_date): ...here...
4360 * xterm.c (XTframe_up_to_date): ...and here...
4361 * nsterm.m (ns_frame_up_to_date): ...but not here.
4362 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4364 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4365 Do not check whether GC is in progress.
4367 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4369 * xdisp.c (window_buffer_changed): New function.
4370 (update_menu_bar, update_tool_bar): Use it to
4371 simplify large 'if' statements.
4372 (redisplay_internal): Generalize commonly used
4373 'tail' and 'frame' local variables.
4375 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4377 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4378 with Windows system header.
4380 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4382 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4383 * alloc.c: Assume unistd.h exists.
4384 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4385 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4386 (getwd) [USG]: Remove; no longer needed.
4387 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4388 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4389 * w32.h (getcwd): Remove decl.
4391 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4393 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4394 Make it set selected_window as well.
4395 (update_tool_bar): Use it.
4397 2012-11-21 Ken Brown <kbrown@cornell.edu>
4399 * emacs.c (main): Set the G_SLICE environment variable for all
4400 Cygwin builds, not just GTK builds. See
4401 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4403 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4405 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4406 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4407 Define for the MSVC compiler.
4409 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4411 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4412 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4413 dostounix_filename. Prevents crashes down the road, because
4414 dostounix_filename assumes it gets a unibyte string.
4415 Reported by Michel de Ruiter <michel@sentient.nl>, see
4416 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4418 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4420 Conflate Qnil and Qunbound for `symbol-function'.
4421 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4422 * lread.c (init_obarray): Set `function' fields to Qnil.
4423 * eval.c (Fcommandp): Ignore Qunbound.
4424 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4425 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4426 Test NILP rather than Qunbound.
4427 (Ffmakunbound): Set to Qnil.
4428 (Fsymbol_function): Never signal an error.
4429 (Finteractive_form): Ignore Qunbound.
4431 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4433 * eval.c (interactive_p): Remove no-longer-used decl.
4435 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4437 * xdisp.c (buffer_shared): Adjust comment.
4438 (buffer_shared_and_changed): New function.
4439 (prepare_menu_bars, redisplay_internal): Use it to
4440 decide whether all windows or frames should be updated.
4441 (window_outdated): New function.
4442 (text_outside_line_unchanged_p, redisplay_window): Use it.
4443 (redisplay_internal): Likewise. Fix indentation.
4445 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4447 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4448 (syms_of_eval): Remove corresponding defsubr.
4449 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4451 2012-11-19 Daniel Colascione <dancol@dancol.org>
4453 * w32fns.c (Fx_file_dialog):
4454 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4455 cygwin_convert_file_name*.
4457 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4458 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4460 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4462 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4464 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4466 * w32select.c: Include w32common.h before w32term.h, so that
4467 windows.h gets included before w32term.h uses some of its
4468 features, see below.
4470 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4472 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4474 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4476 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4478 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4479 (ns_select): Return at once if events are held (Bug#12834).
4481 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4483 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4484 Needed following 2012-10-20 change. (Bug#12902)
4486 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4488 * w32proc.c (waitpid): Remove unused label get_result.
4490 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4492 * makefile.w32-in (SYSWAIT_H): New macro.
4493 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4494 ($(BLD)/sysdep.$(O)): Update dependencies.
4496 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4498 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4499 * callproc.c (relocate_fd): Assume F_DUPFD.
4500 * emacs.c, term.c (O_RDWR): Remove.
4501 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4502 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4503 * nsterm.m: Assume <fcntl.h> exists.
4504 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4505 (create_pty, Fmake_network_process, server_accept_connection)
4506 (wait_reading_process_output, init_process_emacs):
4508 (wait_reading_process_output): Put in a special case for WINDOWSNT
4509 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4510 It's not clear this is needed, but it's a more-conservative change.
4511 (create_process): Assume FD_CLOEXEC.
4512 (create_process, create_pty): Assume O_NOCTTY.
4513 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4514 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4515 Omit if not DOS_NT, since F_GETFL is not defined there.
4516 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4517 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4519 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4520 lack it, since gnulib guarantees this.
4521 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4523 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4525 * w32.c (faccessat): Pretend that directories have the execute bit
4526 set. Emacs expects that, e.g., in files.el:cd-absolute.
4528 * w32proc.c (create_child): Don't clip the PID of the child
4529 process to fit into an Emacs integer, as this is no longer a
4531 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4532 reaping only the process specified by PID argument, if that is
4533 positive. Use PID instead of dead_child to know which process to
4534 reap. Wait for the child to die only if WNOHANG is not in
4536 (sys_select): Don't set dead_child.
4538 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4539 as it is no longer needed.
4541 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4543 (record_child_status_change): Remove the setting of
4544 record_at_most_one_child for the !WNOHANG case.
4546 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4548 Fix problems in ns port found by static checking.
4549 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4550 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4551 not to process group.
4552 (ns_select): Use emacs_write, not write, as that's more robust
4553 in the presence of signals.
4554 (fd_handler:): Check for read errors.
4556 2012-11-16 Glenn Morris <rgm@gnu.org>
4558 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4560 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4562 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4564 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4566 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4567 use the same value of thread handle.
4568 (start_timer_thread): If the timer thread exited (due to error),
4569 clean up by closing the two handles it used. Duplicate the caller
4570 thread's handle here, so it gets duplicated only once, when
4571 launching the timer thread. Set priority of the timer thread, not
4573 (getitimer): Don't duplicate the caller thread's handle here.
4576 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4578 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4581 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4583 Remove no-longer-used pty_max_bytes variable.
4584 * process.c (pty_max_bytes): Remove; unused.
4585 (send_process): Do not set it.
4587 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4589 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4590 Update dependencies.
4592 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4594 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4595 This follows up on the 2012-09-29 patch that removed indirection
4596 for the 'function' field. Reported by Sergey Vinokurov in
4597 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4599 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4601 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4602 different name, as the MS runtime does not have such a function,
4603 and probably never will.) All callers changed. Ignore DIRFD
4604 value if PATH is an absolute file name, to match Posix spec
4605 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4608 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4610 * xdisp.c (echo_area_display, redisplay_internal):
4611 Omit redundant check whether frame_garbaged is set.
4613 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4615 Use faccessat, not access, when checking file permissions (Bug#12632).
4616 This fixes a bug that has been present in Emacs since its creation.
4617 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4618 which must set some sort of record. (Torek's bug report was against
4619 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4620 same common flaw.) See Torek's Usenet posting
4621 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4622 Posted: Fri Apr 8 14:18:56 1983.
4623 * Makefile.in (LIB_EACCESS): New macro.
4625 * callproc.c (init_callproc):
4626 * charset.c (init_charset):
4627 * fileio.c (check_existing, check_executable, check_writable)
4629 * lread.c (openp, load_path_check):
4630 * process.c (allocate_pty):
4632 Use effective UID when checking permissions, not real UID.
4633 * callproc.c (init_callproc):
4634 * charset.c (init_charset):
4635 * lread.c (load_path_check, init_lread):
4636 Test whether directories are accessible, not merely whether they exist.
4637 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4638 * fileio.c (check_existing, check_executable, check_writable)
4640 Use symbolic names instead of integers for the flags, as they're
4642 (check_writable): New arg AMODE. All uses changed.
4643 Set errno on failure.
4644 (Ffile_readable_p): Use faccessat, not stat + open + close.
4645 (Ffile_writable_p): No need to call check_existing + check_writable.
4646 Just call check_writable and then look at errno. This saves a syscall.
4647 dir should never be nil; replace an unnecessary runtime check
4648 with an eassert. When checking the parent directory of a nonexistent
4649 file, check that the directory is searchable as well as writable, as
4650 we can't create files in unsearchable directories.
4651 (file_directory_p): New function, which uses 'stat' on most platforms
4652 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4653 (Ffile_directory_p, Fset_file_times): Use it.
4654 (file_accessible_directory_p): New function, which uses a single
4655 syscall for efficiency.
4656 (Ffile_accessible_directory_p): Use it.
4657 * xrdb.c (file_p): Use file_directory_p.
4658 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4659 * lread.c (openp): When opening a file, use fstat rather than
4660 stat, as that avoids a permissions race. When not opening a file,
4661 use file_directory_p rather than stat.
4662 (dir_warning): First arg is now a usage string, not a format.
4663 Use errno. All uses changed.
4664 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4665 that merely introduced a race.
4666 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4667 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4668 and similarly for the other O_* flags.
4669 * w32.c (sys_faccessat): Rename from sys_access and switch to
4670 faccessat's API. All uses changed.
4671 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4672 (magic_db): Rename from magic_file_p.
4673 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4674 char *, so that we don't have to test for file existence
4675 separately from opening the file for reading. This removes a race
4676 fixes a permission-checking problem, and simplifies the code.
4678 (file_p): Remove; no longer needed.
4680 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4682 Omit glyphs initialization at startup.
4683 * dispnew.c (glyphs_initialized_initially_p): Remove.
4684 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4685 (Fredraw_frame): Move actual code from here...
4686 (redraw_frame): ...to here. Add eassert. Adjust comment.
4687 (Fredraw_display): Use redraw_frame.
4688 * xdisp.c (clear_garbaged_frames): Likewise.
4690 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4692 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4693 passed to pint2str and pint2hrstr to be at most the size of the
4694 frame's decode_mode_spec_buffer. This avoids crashes with very
4695 large values of FIELD_WIDTH argument to decode_mode_spec.
4698 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4700 Fix a race with verify-visited-file-modtime (Bug#12863).
4701 Since at least 1991 Emacs has ignored an mtime difference of no
4702 more than one second, but my guess is that this was to work around
4703 file system bugs that were fixed long ago. Since the race is
4704 causing problems now, let's remove that code.
4705 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4706 whose time stamp is off by no more than a second. Insist that the
4707 file time stamps match exactly.
4709 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4711 * frame.h (struct frame): Convert external_tool_bar member to
4712 1-bit unsigned bitfield.
4713 * termhooks.h (struct terminal): Remove mouse_moved member since
4714 all users are long dead. Adjust comment on mouse_position_hook.
4716 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4718 Simplify by using FOR_EACH_FRAME here and there.
4719 * frame.c (next_frame, prev_frame, other_visible_frames)
4720 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4721 * w32term.c (x_window_to_scroll_bar): Likewise.
4722 * window.c (window_list): Likewise.
4723 * xdisp.c (x_consider_frame_title): Likewise.
4724 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4725 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4726 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4727 * xmenu.c (menubar_id_to_frame): Likewise.
4728 * xselect.c (frame_for_x_selection): Likewise.
4729 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4730 (x_window_to_menu_bar): Likewise.
4731 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4733 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4735 * data.c (Qdefalias_fset_function): Now static.
4737 Another tweak to vectorlike_header change.
4738 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4739 Remove, and replace all uses with ...
4740 (next_in_free_list, set_next_in_free_list):
4741 New functions, which respect C's aliasing rules better.
4743 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4745 * window.c (list4i): Rename from 'quad'. All uses changed.
4746 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4748 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4750 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4751 warning about mixing declarations and code in ISO C90.
4753 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4755 * window.c (Fsplit_window_internal): Set combination limit of
4756 new parent window to t iff Vwindow_combination_limit is t;
4757 fixing a regression introduced with the change from 2012-09-22.
4758 (Fset_window_combination_limit): Fix doc-string.
4760 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4762 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4763 amount when the scroll margins are too large. When scrolling
4764 backwards in the buffer, give up if cannot reach point or the
4765 scroll margin within a reasonable number of screen lines.
4766 Fixes point position in window under scroll-up/down-aggressively when
4767 point is positioned many lines beyond the window top/bottom.
4770 * ralloc.c (relinquish): If real_morecore fails to return memory
4771 to the system, don't crash; instead, leave the last heap
4772 unchanged and return. (Bug#12774)
4774 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4776 * lisp.h (AUTOLOADP): New macro.
4777 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4778 * data.c (Ffset): Remove special ad-advice-info handling.
4779 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4781 (Finteractive_form): Simplify.
4782 (Fquo): Don't insist on having at least 2 arguments.
4783 (Qdefalias_fset_function): New var.
4785 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4787 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4789 * nsfont.m (Qcondensed, Qexpanded): New variables.
4790 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4791 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4793 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4795 Fix recently introduced crash on MS-Windows (Bug#12839).
4796 * w32term.h (struct scroll_bar): Use convenient header.
4797 (SCROLL_BAR_VEC_SIZE): Remove.
4798 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4800 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4802 Tweak last vectorlike_header change.
4803 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4804 vectorlike object on the free list. This is introduced to avoid
4805 some (but not all) pointer casting and aliasing problems, see
4806 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4807 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4809 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4811 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4813 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4814 been removed, so remove them here also.
4816 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4818 * doc.c (Fdocumentation): Handle new property
4819 dynamic-docstring-function to replace the old ad-advice-info.
4821 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4823 * fns.c (Qeql, hashtest_eq): Now static.
4825 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4827 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4828 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4829 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4830 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4832 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4834 Use same hash function for hashfn_profiler as for hash_string etc.
4835 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4836 * lisp.h (sxhash_combine): New inline function, with the contents
4837 of the old SXHASH_COMBINE.
4838 * profiler.c (hashfn_profiler): Use it, instead of having a
4839 special hash function containing a comparison that always yields 1.
4841 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4843 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4844 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4845 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4848 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4850 * image.c (xpm_make_color_table_h): Fix compiler error because
4851 make_hash_table changed.
4853 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4855 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4857 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4859 Use ad-hoc comparison function for the profiler's hash-tables.
4860 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4861 (make_log): Use them.
4862 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4863 call Fequal any more.
4864 (Ffunction_equal): New function.
4865 (cmpfn_profiler, hashfn_profiler): New functions.
4866 (syms_of_profiler): Initialize them.
4867 * lisp.h (struct hash_table_test): New struct.
4868 (struct Lisp_Hash_Table): Use it.
4869 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4870 * fns.c (make_hash_table): Take a struct to describe the test.
4871 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4872 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4873 (hash_lookup, hash_remove_from_table): Move assertion checking of
4874 hashfn result here. Check hash-equality before calling cmpfn.
4875 (Fmake_hash_table): Adjust call to make_hash_table.
4876 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4877 (syms_of_fns): Initialize them.
4878 * emacs.c (main): Move syms_of_fns earlier.
4879 * xterm.c (syms_of_xterm):
4880 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4881 * print.c (print_object): Adjust to new hash-table struct.
4882 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4884 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4886 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4887 value of w32-scroll-lock-modifier is neither nil nor one of the
4888 known key modifiers. (Bug#12806)
4890 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4892 Shrink struct vectorlike_header to the only size field.
4893 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4895 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4896 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4897 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4898 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4899 information from the vector header. Adjust comment.
4900 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4901 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4903 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4904 (struct vectorlike_header): Remove next member. Adjust comment.
4905 (struct Lisp_Subr): Add convenient header. Adjust comment.
4906 (allocate_pseudovector): Adjust prototype.
4907 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4908 (sweep_string, lisp_malloc): Remove useless prototypes.
4909 (enum mem_type): Adjust comment.
4910 (NEXT_IN_FREE_LIST): New macro.
4911 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4912 (Fmake_bool_vector): Likewise.
4913 (struct large_vector): New type to represent allocation unit for
4914 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4915 (large_vectors): Change type to struct large_vector.
4916 (allocate_vector_from_block): Simplify.
4917 (PSEUDOVECTOR_NBYTES): Replace with...
4918 (vector_nbytes): ...new function. Adjust users.
4919 (sweep_vectors): Adjust processing of large vectors.
4920 (allocate_vectorlike): Likewise.
4921 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4922 Add easserts. Adjust XSETPVECTYPESIZE usage.
4923 (allocate_buffer): Use BUFFER_PVEC_INIT.
4924 (live_vector_p): Adjust to match large vector.
4925 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4926 * buffer.h (struct buffer): Add next member.
4927 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4929 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4930 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4931 (copy_hash_table): Adjust to match vector header change.
4932 * lread.c (defsubr): Use XSETPVECTYPE.
4933 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4934 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4935 (xvecsize): New command.
4937 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4939 * keyboard.c (event_to_kboard): Do not dereference
4940 frame_or_window field of SELECTION_REQUEST_EVENT
4941 and SELECTION_CLEAR_EVENT events (Bug#12814).
4942 * xterm.h (struct selection_input_event): Adjust comment.
4944 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4946 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4947 such as Scroll Lock, if the respective keys are treated as
4948 function keys, not as modifiers. This avoids destroying non-ASCII
4949 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4951 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4953 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4955 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4957 Restore some duplicate definitions (Bug#12814).
4958 This undoes part of the 2012-11-03 changes. Some people build
4959 with plain -g rather than with -g3, and they need the duplicate
4960 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4961 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4962 Define as macros, as well as as enums or as constants.
4964 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4966 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4967 to keypad keys (Bug#12816).
4969 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4971 Minor adjustments of recently-changed frame functions.
4972 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4973 known to be a frame (we're in the FRAMEP branch).
4974 * lisp.h (Qframep): Remove decl. frame.h declares this.
4975 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4976 since they're meant for Lisp fixnum values.
4978 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4980 * window.c (Fwindow_combination_limit): Revert to the only
4981 required argument and adjust docstring as suggested in
4982 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4983 by Martin Rudalics <rudalics@gmx.at>.
4985 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4987 Widely used frame validity and checking functions.
4988 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4989 * frame.c (decode_live_frame, decode_any_frame): New functions.
4990 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4991 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4992 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4993 (Fframe_pointer_visible_p): Use decode_any_frame.
4994 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4995 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4996 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4997 (Fframe_focus): Likewise. Allow zero number of arguments.
4999 (frame_buffer_list, frame_buffer_predicate): Remove.
5000 * lisp.h (frame_buffer_predicate): Remove prototype.
5001 * buffer.c (Fother_buffer): Use decode_any_frame.
5002 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5003 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5004 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5005 (Fclose_font, Ffont_info): Use decode_live_frame.
5006 * fontset.c (check_fontset_name): Likewise.
5007 * terminal.c (Fframe_terminal): Likewise.
5008 * w32fns.c (check_x_frame): Likewise.
5009 * window.c (Fminibuffer_window, Fwindow_at)
5010 (Fcurrent_window_configuration): Likewise.
5011 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5012 Likewise. Allow zero number of arguments. Adjust docstring.
5013 * dispnew.c (Fredraw_frame): Likewise.
5014 * xfaces.c (frame_or_selected_frame): Remove.
5015 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5016 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5017 (Fframe_face_alist): Use decode_live_frame.
5018 * xfns.c (check_x_frame): Likewise.
5020 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5022 * window.c (quad): New function.
5023 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5024 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5025 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5026 (Fwindow_line_height): Use it.
5027 (Fwindow_fringes): Use list3.
5028 (Fwindow_scroll_bars): Use list4.
5029 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5030 (Fwindow_combination_limit): Allow zero number of arguments.
5032 2012-11-05 Eli Zaretskii <eliz@gnu.org>
5034 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5036 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5037 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5038 file descriptor 2 for standard error. (Bug#12805)
5040 2012-11-05 Chong Yidong <cyd@gnu.org>
5042 * process.c (wait_reading_process_output): Revert previous change.
5044 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5046 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5047 This removes code that has been obsolete since around 1990.
5048 * callproc.c (Fcall_process):
5050 * process.c (create_process):
5051 * term.c (dissociate_if_controlling_tty):
5052 Assume setsid exists.
5053 * callproc.c (child_setup): Assume setpgid exists and behaves as
5054 per POSIX.1-1988 or later.
5055 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5056 * emacs.c (shut_down_emacs):
5057 * sysdep.c (sys_suspend, init_foreground_group):
5058 Assume getpgrp behaves as per POSIX.1-1998 or later.
5059 * msdos.c (setpgrp): Remove.
5060 (tcgetpgrp, setpgid, setsid): New functions.
5061 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5062 * term.c (no_controlling_tty): Remove; unused.
5063 * w32proc.c (setpgrp): Remove.
5064 (setsid, tcgetpgrp): New functions.
5066 Simplify by assuming __fpending.
5067 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5068 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5069 Do not assume that __fpending's result fits in int.
5071 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5073 Remove EMACS_OUTQSIZE+sleep hack.
5074 * dispnew.c (update_frame_1): Remove hack for terminals slower
5075 than 2400 bps, which throttled Emacs by having it sleep.
5076 This code hasn't worked since at least 2007, when the multi-tty stuff
5077 was added, and anyway those old terminals are long dead.
5078 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5079 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5081 Fix data-loss with --version (Bug#9574).
5082 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5083 as we can't assume that emacs_strerror is initialized, and strerror
5084 is good enough here.
5085 (main): Invoke atexit earlier, to catch earlier instances of
5086 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5088 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5090 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5091 (keyDown): Remap keypad keys to X11 virtual key codes.
5093 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5095 Fix data-loss with --batch (Bug#9574).
5096 * emacs.c: Include <close-stream.h>.
5097 (close_output_streams): New function.
5098 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5099 and handles errors appropriately.
5100 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5103 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5104 The symptom is a diagnostic "GLib-WARNING **: In call to
5105 g_spawn_sync(), exit status of a child process was requested but
5106 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5107 waitpid(), so exit status can't be returned." The diagnostic
5108 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5109 The real bug is a race condition between Emacs and glib: Emacs
5110 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5111 so that glib can't find it. Work around the bug by invoking
5112 waitpid only on subprocesses that Emacs itself creates.
5113 * process.c (create_process, record_child_status_change):
5114 Don't use special value -1 in pid field, as the caller now must
5115 know the pid rather than having the callee infer it.
5116 The inference was sometimes incorrect anyway, due to another race.
5117 (create_process): Set new 'alive' member if child is created.
5118 (process_status_retrieved): New function.
5119 (record_child_status_change): Use it.
5120 Accept negative 1st argument, which means to wait for the
5121 processes that Emacs already knows about. Move special-case code
5122 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5123 processes that have already been waited for, by testing and
5124 clearing new 'alive' member.
5125 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5126 now does this internally.
5127 (handle_child_signal): Let record_child_status_change do all
5128 the work, since we do not want to reap all exited child processes,
5129 only the child processes that Emacs itself created.
5130 * process.h (Lisp_Process): New boolean member 'alive'.
5132 Omit duplicate definitions no longer needed with gcc -g3.
5133 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5134 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5135 Define only as macros. There's no longer any need to also define
5136 these symbols as enums or as constants, since we now assume
5137 gcc -g3 when debugging.
5139 2012-11-03 Eli Zaretskii <eliz@gnu.org>
5141 * lisp.mk: Adjust comments to the fact that term/internal is now
5142 loaded from loadup.el.
5144 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5145 (msdos_fatal_signal): New function.
5146 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5149 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5150 for GCC versions before 4.
5151 (emacs_raise): Define to call msdos_fatal_signal.
5153 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5154 iterator when starting in the middle of a display or overlay
5157 2012-11-03 Chong Yidong <cyd@gnu.org>
5159 * process.c (wait_reading_process_output): Clean up the last
5162 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5164 * process.c (wait_reading_process_output): Avoid a race condition
5165 with SIGIO delivery (Bug#11536).
5167 2012-11-03 Chong Yidong <cyd@gnu.org>
5169 * buffer.c (cursor_type): Untabify docstring.
5171 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5173 * frame.h (struct frame): Drop can_have_scroll_bars member
5174 which is meaningless for a long time. Adjust comments.
5175 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5176 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5178 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5180 * window.c (decode_next_window_args): Update window arg after
5181 calling decode_live_window and so fix crash reported at
5182 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5183 by Juanma Barranquero <lekktu@gmail.com>.
5184 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5185 * font.c (Ffont_at): Likewise.
5187 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5189 * widget.c (resize_cb): New function.
5190 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5191 (EmacsFrameResize): Check if all is up to date before changing frame
5194 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5196 Implement backtrace output for fatal errors on MS-Windows.
5197 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5198 (BACKTRACE_LIMIT_MAX): New macro.
5199 (w32_backtrace): New function.
5200 (emacs_abort): Use w32_backtrace when the user chooses not to
5201 attach a debugger. Update the text of the abort dialog.
5203 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5205 Window-related stuff cleanup here and there.
5206 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5207 Use decode_any_window.
5208 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5209 * xdisp.c (Fformat_mode_line): Likewise.
5210 * font.c (Ffont_at): Use decode_live_window.
5211 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5212 * window.c (decode_next_window_args): Likewise.
5213 (decode_any_window): Remove static.
5214 * window.h (decode_any_window): Add prototype.
5215 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5216 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5219 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5221 Remove pad from struct input_event.
5222 * termhooks.h (struct input_event): Remove padding field.
5224 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5225 member is never cons for a long time. Adjust comment.
5226 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5227 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5228 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5229 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5231 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5233 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5235 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5237 Fix crash when using Emacs as commit editor for git (Bug#12697).
5238 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5239 and it is configured in conf_post.h.
5240 (Fcall_process): Don't invoke both setsid and setpgid; the former
5241 is enough, if it exists.
5242 * callproc.c (Fcall_process, child_setup):
5243 * process.c (create_process): Use setpgid.
5244 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5246 * dispnew.c (init_display): Initialize the foreground group
5247 if we are running a tty display.
5248 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5249 * lisp.h (init_foreground_group): New decl.
5250 * sysdep.c (inherited_pgroup): New static var.
5251 (init_foreground_group, tcsetpgrp_without_stopping)
5252 (narrow_foreground_group, widen_foreground_group): New functions.
5253 (init_sys_modes): Narrow foreground group.
5254 (reset_sys_modes): Widen foreground group.
5256 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5258 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5260 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5262 * minibuf.c (read_minibuf): Restore current buffer since
5263 choose_minibuf_frame calling Fset_frame_selected_window may
5264 change it (Bug#12766).
5266 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5268 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5270 2012-10-30 Kenichi Handa <handa@gnu.org>
5272 * font.c (Ffont_at): If WINDOW is specified and it is not
5273 displaying the current buffer, signal an error.
5275 2012-10-29 Daniel Colascione <dancol@dancol.org>
5277 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5278 In preparation for fixing bug#12739, move these functions from
5281 * coding.h, coding.c: ... to here, and compile them only when
5282 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5283 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5285 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5287 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5288 (timer_loop, getitimer, setitimer): Use it instead of
5289 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5291 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5294 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5296 * nsterm.m (NO_APPDEFINED_DATA): New define.
5297 (last_appdefined_event_data): New variable
5298 (last_appdefined_event): Remove.
5299 (ns_select): Initialize t from last_appdefined_event_data instead
5300 of [last_appdefined_event data1].
5301 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5302 remove last_appdefined_event (Bug#12698).
5304 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5306 * frame.c (x_set_font): Catch internal error.
5308 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5310 Avoid overflow in w32 implementation of interval timers.
5311 When possible, for ITIMER_PROF count only times the main thread
5313 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5314 'volatile ULONGLONG' types. All the other data which was
5315 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5316 (GetThreadTimes_Proc): New typedef.
5317 (w32_get_timer_time): New function, returns a suitable time value
5319 (timer_loop): Enter critical section when accessing ULONGLONG
5320 values of the itimer_data struct, as these accesses are no longer
5321 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5322 Remove unused variable.
5323 (init_timers): Initialize s_pfn_Get_Thread_Times.
5324 (start_timer_thread): Don't assign itimer->caller_thread here.
5325 (getitimer): Assign itimer->caller_thread here.
5326 (setitimer): Always call getitimer to get the value of ticks_now.
5327 (sys_spawnve): Avoid compiler warning about format mismatch.
5329 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5331 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5332 mouse movement events if the menu bar is active. This avoids
5333 producing a busy "hour-glass" cursor by Windows if the mouse
5334 pointer is positioned over a tooltip shown for some menu item.
5336 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5338 Don't assume process IDs fit in int.
5339 * emacs.c (shut_down_emacs) [!DOS_NT]:
5340 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5341 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5342 Use pid_t, not int, to store process IDs, as 'int'
5343 is not wide enough on a few platforms (e.g., AIX and IRIX).
5345 2012-10-23 Kenichi Handa <handa@gnu.org>
5347 The following change is to make face-font-rescale-alist work
5348 correctly for non-ASCII fonts.
5350 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5351 (font_open_for_lface): Handle Vface_font_rescale_alist.
5353 2012-10-23 Chong Yidong <cyd@gnu.org>
5355 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5357 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5359 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5361 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5363 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5366 2012-10-21 Glenn Morris <rgm@gnu.org>
5368 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5370 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5372 Port to OpenBSD 5.1.
5373 * frame.c (Fmouse_position, Fmouse_pixel_position):
5374 * xdisp.c (produce_stretch_glyph):
5375 Declare local vars only when they're needed.
5376 This is clearer and avoids a warning on OpenBSD about unused vars.
5377 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5378 This is safer, and avoids OpenBSD warnings about unused vars.
5379 * keyboard.c (record_menu_key): Remove unnecessary decl.
5380 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5381 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5382 as our definition clashes with OpenBSD's.
5383 * xfaces.c (load_face_colors, check_lface_attrs)
5384 (get_lface_attributes_no_remap, get_lface_attributes)
5385 (lface_fully_specified_p, x_supports_face_attributes_p)
5386 (tty_supports_face_attributes_p, face_fontset, realize_face)
5387 (realize_x_face, realize_tty_face):
5388 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5389 merely Lisp_Object *. This is more informative and avoids
5390 a warning on OpenBSD about accessing beyond an object's size.
5392 2012-10-20 Chong Yidong <cyd@gnu.org>
5394 * lread.c (Fload): Doc fix (Bug#12592).
5396 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5398 * font.c (Ffont_at): Fix previous change.
5400 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5402 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5403 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5406 * alloc.c (NSTATICS): Decrease to 0x800.
5408 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5410 * fns.c (Fnreverse): Include the problem element when signaling an
5413 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5415 * nsterm.m (ns_select): Check writefds before call to
5416 FD_ISSET (Bug#12668).
5418 2012-10-18 Daniel Colascione <dancol@dancol.org>
5420 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5421 (staticpro): If we run out of staticpro slots, die with an
5422 informative error instead of just calling emacs_abort.
5424 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5426 Fix two flaws reported by Dmitry Antipov.
5427 * window.c (Ftemp_output_buffer_show): Remove.
5428 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5429 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5431 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5433 * makefile.w32-in ($(BLD)/w32.$(O)):
5434 ($(BLD)/vm-limit.$(O)):
5436 ($(BLD)/unexw32.$(O)):
5437 ($(BLD)/fileio.$(O)):
5438 ($(BLD)/dispnew.$(O)): Update dependencies.
5440 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5443 * w32proc.c: Include ctype.h.
5445 * w32.h (init_environment, check_windows_init_file)
5446 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5447 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5448 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5449 (sys_link): Add prototypes.
5451 * w32.c: Include w32select.h.
5452 (sys_access, e_malloc, sys_select): Add prototypes.
5453 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5455 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5457 * unexw32.c: Include lisp.h and w32.h.
5459 * term.c [WINDOWSNT]: Include w32term.h.
5461 * process.c [WINDOWSNT]: Add prototype of sys_select.
5463 * fileio.c [WINDOWSNT]: Include w32.h.
5465 * dispnew.c [WINDOWSNT]: Include w32.h.
5467 * cygw32.c (Fcygwin_convert_path_to_windows)
5468 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5469 Lisp_Object values. (Bug#12661)
5471 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5472 to Lisp_Object. (Bug#12661)
5474 2012-10-17 Kenichi Handa <handa@gnu.org>
5476 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5479 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5481 * buffer.c (Fkill_buffer): When unchaining the marker,
5482 reset its buffer pointer to NULL (Bug#12652).
5484 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5486 Do not verify indirection counters of killed buffers (Bug#12579).
5487 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5488 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5490 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5492 * alloc.c (Fmake_byte_code): Fix typo in comment.
5493 * print.c (print_interval): Define as static to match prototype.
5494 * indent.c (disptab_matches_widthtab, recompute_width_table):
5497 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5499 * editfns.c (get_system_name): Remove.
5500 * lisp.h (get_system_name): Remove prototype.
5501 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5502 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5504 2012-10-15 Daniel Colascione <dancol@dancol.org>
5506 * dbusbind.c: Add comment explaining reason for previous change.
5508 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5510 * window.c (Fwindow_end): Rewrite check whether cached position
5511 can be used (Bug#12600).
5512 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5513 Set windows_or_buffers_changed.
5515 2012-10-15 Daniel Colascione <dancol@dancol.org>
5517 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5518 enabled by undefining the symbol "interface", which the platform
5519 headers define to something incompatible.
5521 2012-10-14 Daniel Colascione <dancol@dancol.org>
5523 * image.c (init_tiff_functions, init_imagemagick_functions)
5524 (init_svg_functions): Fix cygw32 build break by using these
5525 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5527 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5529 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5531 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5533 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5535 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5537 * coding.c (detect_coding): Set coding->id before calling
5540 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5542 * fileio.c: Formatting fixes.
5544 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5546 Fix some stat-related races.
5547 * fileio.c (Fwrite_region): Avoid race condition if a file is
5548 removed or renamed by some other process immediately after Emacs
5549 writes it but before Emacs stats it. Do not assume that stat (or
5551 * image.c (slurp_file): Resolve the file name with fopen + fstat
5552 rather than stat + fopen.
5553 (pbm_read_file) [0]: Remove unused code with stat race.
5554 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5555 Remove ineffective code with stat race.
5557 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5559 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5561 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5563 * nsterm.m (hold_event_q): New static variable.
5564 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5566 (hold_event): New function.
5567 (ns_read_socket): If hold_event_q have events, store them and
5569 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5570 is zero (Bug#12384).
5572 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5574 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5576 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5578 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5580 * fileio.c (check_existing): New function.
5581 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5582 instead of calling 'stat', when what's needed is to check whether
5583 a file exists. This avoids expensive system calls on MS-Windows.
5586 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5588 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5589 determine whether a file exists and is not a directory.
5591 * lisp.h (check_existing): Add prototype.
5593 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5595 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5597 2012-10-12 Glenn Morris <rgm@gnu.org>
5599 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5601 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5603 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5605 * eval.c (Fautoload): Remember previous autoload status in load-history.
5607 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5609 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5610 * lread.c (load_each_byte, new_backquote_flag, readchar)
5611 (read_filtered_event, lisp_file_lexically_bound_p)
5612 (safe_to_load_version, Fload, complete_filename_p, openp)
5613 (build_load_history, readevalloop, read_escape, read1)
5614 (string_to_number, read_vector, read_list):
5615 * macros.c (Fstart_kbd_macro):
5616 * marker.c (CONSIDER):
5617 * menu.c (parse_single_submenu, digest_single_submenu)
5618 (find_and_return_menu_selection, Fx_popup_menu):
5619 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5621 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5623 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5624 (xmenu_show, xdialog_show):
5625 Use bool for booleans.
5626 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5627 as it's not a predicate. All uses changed. Omit unnecessary
5630 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5632 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5633 (save_excursion_restore): Do not restore mark if it was not saved.
5635 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5637 * marker.c (cached_modiff): EMACS_INT, not int.
5639 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5640 instead of having a wrong decl.
5641 * nsmenu.m (waiting_for_input): Remove wrong decl.
5643 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5645 keyboard.c, keymap.c: Use bool for booleans.
5646 * dispnew.c (sit_for): Distinguish between 3-way display_option
5647 and boolean do_display.
5648 * keyboard.c (single_kboard, this_command_key_count_reset)
5649 (waiting_for_input, echoing, immediate_quit, input_pending)
5650 (interrupt_input, interrupts_deferred, pop_kboard)
5651 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5652 (command_loop_1, adjust_point_for_property)
5653 (safe_run_hooks_error, input_polling_used, read_char):
5654 (help_char_p, readable_events, kbd_buffer_events_waiting)
5655 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5656 (lucid_event_type_list_p, get_input_pending):
5657 (gobble_input, menu_separator_name_p, menu_bar_item)
5658 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5659 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5660 (keyremap_step, test_undefined, read_key_sequence)
5661 (detect_input_pending, detect_input_pending_ignore_squeezables)
5662 (detect_input_pending_run_timers, requeued_events_pending_p)
5663 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5664 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5665 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5666 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5667 (accessible_keymaps_1, Fkey_description, push_key_description):
5668 (shadow_lookup, struct where_is_internal_data)
5669 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5670 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5671 (describe_map, describe_vector):
5672 * menu.c (single_menu_item):
5673 * nsmenu.m (ns_update_menubar):
5674 * process.c (wait_reading_process_output):
5675 * search.c (scan_buffer, scan_newline):
5676 Use bool for boolean.
5677 * keyboard.c (timers_run, swallow_events)
5678 (detect_input_pending_run_timers):
5679 * process.c (wait_reading_process_output):
5680 Use unsigned for counter where wraparound-on-overflow is desired,
5681 since unsigned is guaranteed to have that behavior and signed is not.
5682 (read_char): Use ptrdiff_t for string length.
5683 (get_input_pending): Remove first argument, since it was always
5684 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5685 and behave as if it had that value. Return new value of
5686 input_pending. All callers changed.
5687 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5688 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5690 * keymap.c (push_key_description): Omit last arg, which was always 1.
5691 All callers changed.
5693 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5695 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5697 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5698 ($(BLD)/term.$(O)): Update dependencies.
5700 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5702 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5703 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5704 initializer for PVEC_NORMAL_VECTOR.
5706 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5708 Clean out old termopts cruft.
5709 * termopts.h (flow_control, meta_key): Remove unused decls.
5710 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5711 Don't include termopts.h.
5713 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5715 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5717 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5719 * commands.h (immediate_quit): Remove duplicate decl.
5721 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5723 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5725 (nsfont_open): Remove setting of Vfonts_in_cache.
5726 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5728 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5730 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5731 match what GetLastError returns. Explain why the function is
5734 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5735 'is_tooltip_frame', to avoid confusion with its global namesake.
5737 2012-10-08 Daniel Colascione <dancol@dancol.org>
5739 * xdisp.c (start_hourglass): Call w32_note_current_window when
5740 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5741 build that caused Emacs to display the hourglass cursor forever.
5743 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5744 which is broken under remote desktop, calculate the number of
5745 colors available for a display based on the display's number of
5746 planes and number of bits per pixel per plane. (bug#10397).
5748 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5750 * nsfont.m (Vfonts_in_cache): New variable.
5751 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5752 are used. Add cached fonts to Vfonts_in_cache.
5753 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5755 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5757 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5759 (FONT_H): Define after FRAME_H.
5760 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5761 Update dependencies.
5763 * w32term.c: Remove leftover declaration of keyboard_codepage.
5765 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5767 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5768 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5769 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5770 (GLOBAL_SOURCES): Add cygw32.c.
5771 ($(BLD)/unexw32.$(O)):
5773 ($(BLD)/w32console.$(O)):
5774 ($(BLD)/w32fns.$(O)):
5775 ($(BLD)/w32heap.$(O)):
5776 ($(BLD)/w32menu.$(O)):
5777 ($(BLD)/w32proc.$(O)): Add w32common.h.
5779 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5781 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5783 2012-10-08 Daniel Colascione <dancol@dancol.org>
5785 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5786 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5787 accidental message numbering hole. Change other messages to
5790 * w32select.h (HAVE_W32SELECT): Remove.
5792 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5793 w32common.h instead of w32heap.h.
5795 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5796 (get_allocation_unit, get_processor_type, get_w32_major_version)
5797 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5798 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5799 (OS_NT, os_subtype, cache_system_info): Move declarations to
5802 * w32heap.c: Include w32common.h.
5803 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5804 (w32_minor_version, w32_build_number, w32_subtype):
5805 Remove duplicate definitions.
5807 * w32fns.c: Include w32common.h; include w32heap.h only in
5810 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5811 Use `report_file_error' instead of `error' in order to better
5812 inform users of what went wrong. Increase NTGUI_UNICODE file
5813 dialog box file name length to 32k, the maximum allowed by the NT
5816 * w32common.h: New file.
5817 (ROUND_UP, ROUND_DOWN, get_page_size)
5818 (get_allocation_unit, get_processor_type, get_w32_major_version)
5819 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5820 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5821 (OS_NT, os_subtype, cache_system_info): Move here.
5823 * unexw32.c, unexcw.c: Include w32common.h.
5825 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5826 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5827 to call syms_of_w32select.
5829 * cygw32.h: Remove obsolete EXFUN declarations.
5831 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5833 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5834 of w32inevt.o from SOME_MACHINE_OBJECTS.
5836 2012-10-08 Daniel Colascione <dancol@dancol.org>
5838 * image.c: Permanent fix for JPEG compilation issue --- limit
5839 jpeglib `boolean' redefinition to Cygwin builds.
5841 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5843 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5845 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5848 2012-10-08 Daniel Colascione <dancol@dancol.org>
5850 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5851 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5852 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5853 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5854 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5855 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5856 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5857 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5858 now a supported configuration.
5860 * Makefile.in: consolidate image variables into LIBIMAGE; add
5861 W32_OBJ and W32_LIBS. Compile new files.
5864 (_DebPrint) declare tracing facility for W32 debugging. We need
5865 to unify tracing later.
5867 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5868 unconditional use of W32 Unicode functions. Cygwin runs only on
5869 100% Unicode operating systems.
5871 * cygw32.c: New file. Define Cygwin-specific facilities.
5872 (Fcygwin_convert_path_to_windows)
5873 (Fcygwin_convert_path_from_windows): New user functions for
5874 accessing Cygwin path-munging routines.
5876 * cygw32.h: New file.
5877 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5878 UTF-16LE strings temporarily inside non-Lisp-visible string
5881 (w32_strerror): Just what it says on the tin.
5883 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5884 also run for Cygwin; both systems have the same problem with using
5885 GUI facilities in a forked child. Also call syms_of_cygw32,
5886 syms_of_w32select in correct places.
5888 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5889 needs fork-then-exec for daemon launching.
5891 * font.h: Include frame.h.
5893 * image.c: Use the image library cache machinery only when we're
5894 compiling for native WINDOWSNT; Cygwin can use shared libraries
5895 like any other Unixlike system.
5897 * keyboard.c: Clarify a comment regarding the input loop.
5899 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5900 functions directly instead of trying to detect at runtime that our
5901 host operating system supports them. We make this change for two
5902 reasons: Cygwin lacks support for the multibyte character
5903 conversion functions used by the legacy menu code, and Cygwin
5904 never needs to rely on non-Unicode APIs.
5906 * unexw32.c (hinst): Declare extern.
5908 * w32.c: Change header order;
5909 (w32_strerror): Move to w32fns.c because we need it for
5910 non-WINDOWSNT builds.
5912 * w32.h: Add #error macro to make sure we don't include w32.h for
5913 Cygwin builds. Remove w32select declarations.
5915 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5916 w32fns.c. w32console.c is WINDOWSNT-only.
5918 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5919 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5921 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5922 (w32_major_version, w32_minor_version, w32_build_number)
5923 (os_subtype, sound_type): Define here
5924 (w32_defined_color): Make color parameter const for consistency
5925 with other _defined_color functions.
5926 (w32_createwindow): Unconditionally call w32_init_class instead of
5927 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5928 through the code is complex and unnecessary because class
5929 registration is practically free.
5930 (w32_name_of_message): New EMACSDEBUG-only function.
5931 (Fset_message_beep): Move here
5932 (Fx_open_connection): Require that the display name for Windows be
5933 "w32" for consistency, emacsclient disambiguation, and maybe, one
5934 day, multi-window-system support.
5935 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5936 Cygwin files for W32 GUI facilities, since these clearly don't
5937 expect Cygwin names.
5938 (_DebPrint): Define.
5939 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5940 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5941 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5942 (w32_last_error): Remove.
5944 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5946 * w32heap.c (syspage_mask): Declare here.
5947 (cache_system_info): Remove.
5949 * w32inevt.c (faked_key): Define globally, not statically.
5950 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5951 (w32_console_toggle_lock_key): Move to w32fns.c.
5953 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5955 * w32proc.c (_DebPrint): Move to w32fns.c.
5956 * w32select.c: Include string.h, stdio.h for Cygwin.
5957 * w32select.h: New File.
5959 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5961 (w32_message_fd): New variable. Under Cygwin, holds the file
5962 descriptor the system used to tell us about pending thread
5965 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5966 that prevented compilation under non-WINDOWSNT systems.
5968 (w32_initialize): Open /dev/windows and assign it to
5969 w32_message_fd. Provide w32 feature.
5971 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5972 (WM_EMACS_INPUT_READY): add.
5973 (prepend_msg, w32_message_fd): Declare globally.
5976 (keyboard_handle): Use only when WINDOWSNT.
5977 (notify_msg_ready): New function. Posts a message to the main
5978 thread's message queue under CYGWIN, which wakes up the main
5979 thread from select(2) by making the /dev/windows file descriptor
5980 ready. Under WINDOWSNT, it sets an event the same way the old
5983 (post, prepend_msg): Actually call notify_msg_ready instead of
5984 setting the input event directly.
5986 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5988 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5989 but it still has blocs in it, don't return it to the system,
5990 instead of aborting. (Bug#12402)
5992 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5994 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5996 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5997 MAC_OS_X_VERSION_10_6.
5998 (syms_of_nsterm): Remove comment about Panther and above for
6000 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6001 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6002 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6004 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6005 MAC_OS_X_VERSION_10_4.
6007 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6008 MAC_OS_X_VERSION_10_2.
6010 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6012 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6013 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6015 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6016 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6017 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6018 Remove ns_in_resize check.
6019 (ns_clear_frame_area): Remove resize handle code.
6021 * nsfns.m (ns_in_resize): Remove.
6022 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6023 Remove ns_in_resize check.
6025 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6027 Improve sys_siglist detection.
6028 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6029 defined as a macro, as is done in Solaris.
6030 (sys_siglist_entries): New macro.
6031 (save_strsignal): Use it.
6032 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6033 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6035 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6037 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6038 fullscreen/Fullscreen.
6040 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6041 tobar_height is new.
6043 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6044 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6045 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6046 (windowDidResize:): Check for correct window if old style fullscreen.
6047 Capitalize word in comment. Remove incorrect comment.
6048 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6049 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6050 error in drawing background.
6051 (toggleFullScreen:): Remove comment. Rearrange calls.
6052 Set toolbar values to zero, save old height in tobar_height.
6053 Restore tool bar height when leaving fullscreen.
6054 (canBecomeMainWindow): New function.
6056 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6058 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6060 2012-10-05 Eli Zaretskii <eliz@gnu.org>
6062 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6064 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6065 that time stamps of directories could also be changed.
6066 Don't request the too broad GENERIC_WRITE, only the more restrictive
6067 FILE_WRITE_ATTRIBUTES access rights.
6069 * fileio.c (Fset_file_times): Special-case ignoring errors for
6070 directories only on MSDOS, not on MS-Windows.
6072 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6074 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6076 2012-10-04 Eli Zaretskii <eliz@gnu.org>
6078 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6079 see whether CreateFile failed.
6081 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6083 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6084 to avoid similar races.
6085 * keyboard.c (pending_signals): Now bool, not int.
6087 Port timers to OpenBSD, plus check for timer failures.
6088 OpenBSD problem reported by Han Boetes.
6089 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6091 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6092 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6093 like OpenBSD, which has timer_settime but does not declare it.
6094 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6095 whether to use itimerspec-related primitives. All uses of
6096 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6098 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6100 * profiler.c (handle_profiler_signal): Fix a malloc race
6101 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6103 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6105 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6107 2012-10-02 Eli Zaretskii <eliz@gnu.org>
6109 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6110 consistent with the change in return value of 'safe_strsignal'.
6112 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6114 Prefer plain 'static' to 'static inline' (Bug#12541).
6115 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6116 (bidi_set_sor_type, bidi_push_embedding_level)
6117 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6118 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6119 (bidi_cache_search, bidi_cache_ensure_space)
6120 (bidi_cache_iterator_state, bidi_cache_find)
6121 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6122 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6123 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6124 Now 'static', not 'static inline'.
6126 Count overruns when profiling; change units to ns.
6127 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6128 Give extra weight to samples after overruns, to attempt to count
6129 the time more accurately.
6130 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6131 the underlying primitives nominally do ns.
6132 (Fprofiler_cpu_start): Document the change. Mention that
6133 the sampling intervals are only approximate.
6135 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6137 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6139 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6140 case for the special 0 coding-system.
6142 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6143 (Fmake_overlay): Remove redundant tests.
6144 (fix_start_end_in_overlays): Remove redundant recentering.
6146 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
6148 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6149 Update dependencies.
6151 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6153 Fix a malloc race condition involving strsignal.
6154 A signal can arrive in the middle of a malloc, and Emacs's signal
6155 handler can invoke strsignal, which can invoke malloc, which is
6156 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6157 Fix it by altering the signal handler so that it does not invoke
6159 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6160 * process.c (status_message): Use const pointer, in case strsignal
6161 is #defined to safe_strsignal.
6162 * sysdep.c (sys_siglist, init_signals): Always define and
6163 initialize a substitute sys_siglist if the system does not define
6164 one, even if HAVE_STRSIGNAL.
6165 (safe_strsignal): Rename from strsignal. Always define,
6166 using sys_siglist. Return a const pointer.
6167 * syssignal.h (safe_strsignal): New decl.
6168 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6170 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6172 * w32proc.c (timer_loop): Fix code that waits for timer
6173 expiration, to avoid high CPU usage.
6175 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6177 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6178 (sweep_weak_table): Remove redundant prototypes.
6180 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6182 * emacs.c: Move the inclusion of TERM_HEADER after including
6183 windows.h on WINDOWSNT. This avoids compilation problems with
6186 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6188 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6189 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6190 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6191 as the previous version used 'void *'.
6193 * ralloc.c (ROUNDUP): Fix last change.
6194 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6197 * w32proc.c <disable_itimers>: New static flag.
6198 (init_timers): Initialize it to zero, after creating the critical
6199 sections used by the timer threads.
6200 (term_timers): Set to 1 before deleting the critical sections.
6201 (getitimer, setitimer): If disable_itimers is non-zero, return an
6202 error indication without doing anything. Reported by Fabrice
6203 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6204 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6206 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6209 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6210 term_ntproc after all the other bookkeeping, to get timers working
6211 as long as possible.
6213 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6215 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6216 Suggested by Juri Linkov in
6217 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6219 Prefer plain 'static' to 'static inline' (Bug#12541).
6220 With static functions, modern compilers inline pretty well by
6221 themselves; advice from programmers often hurts as much as it helps.
6222 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6223 this change shrinks the text size of the Emacs executable by 1.1%
6224 without affecting CPU significantly in my benchmark.
6225 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6226 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6227 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6228 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6229 (bset_auto_fill_function, bset_auto_save_file_format)
6230 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6231 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6232 (bset_cache_long_line_scans, bset_case_fold_search)
6233 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6234 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6235 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6236 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6237 (bset_header_line_format, bset_indicate_buffer_boundaries)
6238 (bset_indicate_empty_lines, bset_invisibility_spec)
6239 (bset_left_fringe_width, bset_major_mode, bset_mark)
6240 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6241 (bset_name, bset_overwrite_mode, bset_pt_marker)
6242 (bset_right_fringe_width, bset_save_length)
6243 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6244 (bset_scroll_up_aggressively, bset_selective_display)
6245 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6246 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6247 (set_buffer_overlays_after):
6248 * category.c (bset_category_table):
6249 * charset.c (read_hex):
6250 * coding.c (produce_composition, produce_charset)
6251 (handle_composition_annotation, handle_charset_annotation)
6253 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6254 (assign_row, set_frame_matrix_frame, make_current)
6256 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6257 * fns.c (maybe_resize_hash_table):
6258 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6259 * gmalloc.c (register_heapinfo):
6260 * image.c (lookup_image_type):
6261 * intervals.c (set_interval_object, set_interval_left)
6262 (set_interval_right, copy_interval_parent, rotate_right)
6263 (rotate_left, balance_possible_root_interval):
6264 * keyboard.c (kset_echo_string, kset_kbd_queue)
6265 (kset_keyboard_translate_table, kset_last_prefix_arg)
6266 (kset_last_repeatable_command, kset_local_function_key_map)
6267 (kset_overriding_terminal_local_map, kset_real_last_command)
6268 (kset_system_key_syms, clear_event, set_prop):
6269 * lread.c (digit_to_number):
6270 * marker.c (attach_marker, live_buffer, set_marker_internal):
6271 * nsterm.m (ns_compute_glyph_string_overhangs):
6272 * process.c (pset_buffer, pset_command)
6273 (pset_decode_coding_system, pset_decoding_buf)
6274 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6275 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6276 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6277 * syntax.c (bset_syntax_table, dec_bytepos):
6278 * terminal.c (tset_param_alist):
6279 * textprop.c (interval_has_some_properties)
6280 (interval_has_some_properties_list):
6281 * window.c (wset_combination_limit, wset_dedicated)
6282 (wset_display_table, wset_hchild, wset_left_fringe_width)
6283 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6284 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6285 (wset_right_fringe_width, wset_right_margin_cols)
6286 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6287 (wset_vertical_scroll_bar_type, wset_window_parameters):
6288 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6289 (wset_column_number_displayed, wset_region_showing)
6290 (window_box_edges, run_window_scroll_functions)
6291 (append_glyph_string_lists, prepend_glyph_string_lists)
6292 (append_glyph_string, set_glyph_string_background_width)
6293 (append_glyph, append_composite_glyph)
6294 (take_vertical_position_into_account):
6295 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6296 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6297 (lface_hash, lface_same_font_attributes_p, lookup_face):
6298 * xml.c (libxml2_loaded_p):
6299 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6300 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6301 Now 'static', not 'static inline'.
6304 (bidi_copy_it): Do the whole copy with a single memcpy.
6305 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6307 Revert the FOLLOW-SYMLINKS change for file-attributes.
6308 Doing it right would require several changes to Tramp, and there's
6309 not enough time to get that tested before the freeze today.
6310 * dired.c (directory_files_internal, Ffile_attributes):
6313 * frame.c (x_report_frame_params): Port better to wider ints.
6314 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6315 or that pointers can be printed in 15 decimal digits.
6316 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6318 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6320 Support x64 build on MS-Windows.
6321 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6322 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6323 compatibility with x64.
6324 (x_get_focus_frame): Add prototype.
6326 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6327 defining an XRectangle structure.
6329 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6330 arithmetics for compatibility with x64.
6332 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6333 compatibility with x64.
6335 * w32heap.h: Adjust prototypes and declarations.
6337 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6338 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6339 DWORD, long, and unsigned long, for compatibility with x64.
6340 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6341 (sbrk): Argument is now of type ptrdiff_t.
6343 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6345 (w32_msg_pump): Use WPARAM type for 'result'.
6347 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6349 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6350 compatibility with x64.
6352 * vm-limit.c (lim_data): Now size_t.
6353 (check_memory_limits): Adjust prototypes of real_morecore and
6354 __morecore to receive argument of type ptrdiff_t. Use size_t for
6355 five_percent and data_size.
6357 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6358 variables, for compatibility with x64.
6359 (rva_to_section, offset_to_section, relocate_offset)
6360 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6361 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6362 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6363 for compatibility with x64.
6365 * sysdep.c (STDERR_FILENO): Define if not already defined.
6367 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6368 (__morecore): Argument type is now ptrdiff_t.
6369 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6370 (relinquish): Use ptrdiff_t type for 'excess'.
6371 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6373 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6374 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6375 instead of a literal number.
6377 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6378 (min): Define only if not already defined.
6380 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6381 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6384 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6385 'bitmaps' is a pointer.
6387 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6389 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6391 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6393 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6394 * dired.c (directory_files_internal, Ffile_attributes):
6395 New arg follow_symlinks. All uses changed.
6397 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6399 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6401 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6403 Support atimers and CPU profiler via profile.c on MS-Windows.
6404 * w32proc.c (sig_mask, crit_sig): New static variables.
6405 (sys_signal): Support SIGALRM and SIGPROF.
6406 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6407 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6408 sigfillset, and sigprocmask are no longer no-ops.
6409 (sigismember): New function.
6410 (struct itimer_data): New definition.
6411 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6412 (crit_prof): New static variables.
6413 (MAX_SINGLE_SLEEP): New definition.
6414 (timer_loop, stop_timer_thread, term_timers, init_timers)
6415 (start_timer_thread, getitimer, setitimer): New functions.
6416 (alarm): No longer a no-op, calls setitimer.
6418 * w32.c (term_ntproc): Call term_timers.
6419 (init_ntproc): Make sure all signals are unblocked at startup, to
6420 erase any traces of dumping. Call init_timers.
6422 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6423 Windows-specific code to display the hourglass mouse pointer is no
6425 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6426 to hourglass timer expiration.
6427 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6428 Remove, no longer used.
6429 (w32_note_current_window, show_hourglass, hide_hourglass):
6430 New functions, in support of hourglass cursor display similar to other
6432 (syms_of_w32fns): Don't initialize hourglass_timer.
6434 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6436 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6438 * w32.h (init_timers, term_timers): Add prototypes.
6440 2012-09-30 Kenichi Handa <handa@gnu.org>
6442 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6443 to the buffer relocation which may be caused by ccl_driver.
6445 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6447 * xfns.c (Fx_file_dialog): Update comment.
6449 * w32fns.c (Fx_file_dialog): Update comment.
6451 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6452 Initialize panel name field if OSX >= 10.6.
6454 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6456 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6458 * nsterm.m (NEW_STYLE_FS): New define.
6459 (ns_fullscreen_hook, windowWillEnterFullScreen)
6460 (windowDidEnterFullScreen, windowWillExitFullScreen)
6461 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6462 (setFSValue): New functions.
6463 (EmacsFSWindow): New implementation.
6464 (canBecomeKeyWindow): New function for EmacsFSWindow.
6465 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6466 (dealloc): Release nonfs_window if in fullscreen.
6467 (updateFrameSize:): Call windowDidMove to update top/left.
6468 (windowWillResize:toSize:): Check if frame is still maximized.
6469 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6470 next_maximized, maximized_width, maximized_height and nonfs_window.
6471 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6473 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6474 fullscreen. Set maximized_width/height. Act on next_maximized.
6476 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6477 (EmacsView): Add variables for fullscreen.
6478 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6479 (EmacsFSWindow): New interface for fullscreen.
6481 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6483 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6485 2012-09-30 Chong Yidong <cyd@gnu.org>
6487 * fns.c (Frandom): Doc fix.
6489 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6491 * window.c (Vwindow_combination_limit): New default value.
6492 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6494 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6496 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6497 Suggested by Eli Zaretskii in
6498 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6500 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6502 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6503 HAVE_TIMER_SETTIME is defined.
6505 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6507 Profiler improvements: more-accurate timers, overflow checks.
6508 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6509 signal.h, setjmp.h. Include systime.h instead.
6510 (saturated_add): New function.
6511 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6512 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6513 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6515 (enum profiler_cpu_running): New enum.
6516 (profiler_cpu_running): Now of that enum type, not bool.
6517 All uses changed to store the new value.
6518 (handle_profiler_signal): Rename from sigprof_handler_1,
6519 for consistency with other handlers. Do not check whether
6520 cpu_log is a hash-table if garbage collecting, since it
6521 doesn't matter in that case.
6522 (deliver_profiler_signal): Rename from sigprof_handler,
6523 for consistency with other handlers.
6524 (setup_cpu_timer): New function, with much of what used to be in
6525 Fprofiler_cpu_start. Check for out-of-range argument.
6526 Prefer timer_settime if available, and prefer
6527 thread cputime clocks, then process cputime clocks, then
6528 monotonic clocks, to the old realtime clock. Use make_timeval
6529 to round more-correctly when falling back to setitimer.
6530 (Fprofiler_cpu_start): Use it.
6531 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6532 Don't assume that passing NULL as the 2nd argument of setitimer
6533 is the same as passing a pointer to all-zero storage.
6534 Ignore SIGPROF afterwards.
6535 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6536 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6537 non-fatal signal handlers. Ignore SIGPROF on startup.
6538 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6539 in profiler.c, since sysdep.c now uses it.
6541 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6542 Suggested by Eli Zaretskii in
6543 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6545 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6547 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6549 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6551 * lisp.h (struct backtrace): Remove indirection for `function' field.
6552 * xdisp.c (redisplay_internal):
6553 * profiler.c (record_backtrace, sigprof_handler_1):
6554 * alloc.c (Fgarbage_collect):
6555 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6556 (Fbacktrace_frame): Adjust accordingly.
6558 2012-09-28 Glenn Morris <rgm@gnu.org>
6560 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6561 (Frun_hook_with_args_until_failure): Doc fixes.
6563 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6565 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6566 Qautomatic_redisplay and change the symbol name. All users changed.
6568 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6570 * profiler.c (sigprof_handler): Fix race condition.
6572 2012-09-28 Glenn Morris <rgm@gnu.org>
6574 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6576 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6578 Check more robustly for timer_settime.
6579 * Makefile.in (LIB_TIMER_TIME): New macro.
6581 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6582 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6585 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6587 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6589 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6591 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6593 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6595 * character.h (MAYBE_UNIFY_CHAR): Remove.
6596 * charset.c, charset.h (maybe_unify_char): Now static.
6597 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6598 Since this stuff is now private to charset.c, there's no need for
6599 a public macro and no need to inline by hand.
6601 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6602 Stefan Monnier <monnier@iro.umontreal.ca>
6603 Juanma Barranquero <lekktu@gmail.com>
6605 * profiler.c: New file.
6606 * Makefile.in (base_obj): Add profiler.o.
6607 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6608 ($(BLD)/profiler.$(O)): New target.
6609 * emacs.c (main): Call syms_of_profiler.
6610 * alloc.c (Qautomatic_gc): New constant.
6611 (MALLOC_PROBE): New macro.
6612 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6613 (total_bytes_of_live_objects): New function.
6614 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6615 Call malloc_probe for the memory profiler.
6616 (syms_of_alloc): Define Qautomatic_gc.
6617 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6619 (struct backtrace): Move definition...
6620 * lisp.h (struct backtrace): ..here.
6621 (Qautomatic_gc, profiler_memory_running): Declare vars.
6622 (malloc_probe, syms_of_profiler): Declare functions.
6623 * xdisp.c (Qautomatic_redisplay): New constant.
6624 (redisplay_internal): Record itself in backtrace_list.
6625 (syms_of_xdisp): Define Qautomatic_redisplay.
6627 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6628 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6630 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6632 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6634 Prefer POSIX timers if available.
6635 They avoid a race if the timer is too close to the current time.
6636 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6637 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6638 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6640 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6642 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6643 CHAR_STRING_ADVANCE.
6644 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6645 STRING_CHAR_ADVANCE.
6647 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6649 Move Vlibrary_cache to emacs.c and reset before dumping.
6651 * lisp.h (reset_image_types): Declare.
6652 [WINDOWSNT] (Vlibrary_cache): Declare.
6654 * image.c (reset_image_types): New function.
6656 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6657 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6658 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6660 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6661 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6663 * w32.h (Vlibrary_cache): Do not declare.
6665 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6667 * w32proc.c (sys_signal): Handle all signals defined by the
6668 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6669 handlers for signals supported by Windows. Don't override
6670 term_ntproc as the handler for SIGABRT.
6671 (sigaction): Rewrite to call sys_signal instead of duplicating its
6673 (sys_kill): Improve commentary.
6675 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6676 consistency with a signature of a signal handler. All callers
6678 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6679 install term_ntproc as a signal handler for SIGABRT, as that
6680 should be done by the dumped Emacs.
6682 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6684 * w32select.c (term_w32select): Protect against repeated
6685 invocation by setting clipboard_owner to NULL after calling
6688 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6689 and term_ntproc to their modified signatures.
6691 * character.c (char_string, string_char): Remove calls to
6692 MAYBE_UNIFY_CHAR. See the discussion starting at
6693 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6696 2012-09-25 Chong Yidong <cyd@gnu.org>
6698 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6700 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6702 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6703 when encountering an unknown bytecode.
6705 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6707 image.c, indent.c: Use bool for booleans.
6708 * dispextern.h (struct image_type): Members valid_p, load, init
6709 now return bool, not int. All uses changed.
6710 * image.c: Omit unnecessary static decls.
6711 (x_create_bitmap_mask, x_build_heuristic_mask):
6712 Return void, not int, since callers don't care about the return value.
6713 (x_create_bitmap_mask, define_image_type, valid_image_p)
6714 (struct image_keyword, parse_image_spec, image_spec_value)
6715 (check_image_size, image_background)
6716 (image_background_transparent, x_clear_image_1)
6717 (postprocess_image, lookup_image, x_check_image_size)
6718 (x_create_x_image_and_pixmap, xbm_image_p)
6719 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6720 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6721 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6722 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6723 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6724 (png_image_p, init_png_functions, png_load_body, png_load)
6725 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6726 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6727 (init_gif_functions, gif_load, imagemagick_image_p)
6728 (imagemagick_load_image, imagemagick_load, svg_image_p)
6729 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6731 * nsimage.m (ns_load_image):
6732 * nsterm.m (ns_defined_color):
6733 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6734 * xfns.c (x_defined_color):
6735 * xterm.c (x_alloc_lighter_color_for_widget)
6736 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6737 (x_alloc_lighter_color):
6738 * indent.c (disptab_matches_widthtab, current_column)
6739 (scan_for_column, string_display_width, indented_beyond_p)
6740 (compute_motion, vmotion, Fvertical_motion):
6741 Use bool for booleans.
6743 2012-09-24 Chong Yidong <cyd@gnu.org>
6745 * chartab.c (Fset_char_table_default): Obsolete function removed.
6747 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6749 Move pid_t related decls out of lisp.h.
6750 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6751 (interruptible_wait_for_termination):
6752 Move these decls from lisp.h to syswait.h, since they use pid_t.
6753 Needed on FreeBSD; see Herbert J. Skuhra in
6754 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6755 * callproc.c: Include syswait.h.
6757 gnutls.c, gtkutil.c: Use bool for boolean.
6758 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6759 (emacs_gnutls_handle_error):
6760 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6761 (xg_hide_tooltip, xg_create_frame_widgets)
6762 (create_dialog, xg_uses_old_file_dialog)
6763 (xg_get_file_with_chooser, xg_get_file_with_selection)
6764 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6765 (xg_item_label_same_p, xg_update_menubar)
6766 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6767 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6768 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6769 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6770 (update_frame_tool_bar, free_frame_tool_bar):
6771 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6772 * nsmenu.m (ns_update_menubar):
6773 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6774 * xfns.c (Fx_show_tip) [USE_GTK]:
6775 Use bool for boolean.
6776 * gtkutil.c (xg_update_frame_menubar):
6777 * xmenu.c (update_frame_menubar):
6778 Return void, not int, since caller ignores return value.
6779 * gtkutil.c (xg_change_toolbar_position):
6782 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6784 * makefile.w32-in (BLOCKINPUT_H): Remove.
6785 (SYSSIGNAL_H): New macro.
6786 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6787 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6788 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6789 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6790 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6791 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6792 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6793 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6794 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6795 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6796 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6797 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6798 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6799 ($(BLD)/w32xfns.$(O)): Update dependencies.
6801 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6803 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6804 fatal_error_backtrace.
6806 * w32proc.c (sys_kill): Undo last change: don't do anything when
6807 invoked to deliver SIGABRT to our own process. This is now
6808 handled by emacs_raise.
6810 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6812 * w32term.c (w32_read_socket): Remove leftover reference to
6813 interrupt_input_pending.
6815 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6817 Do not use SA_NODEFER.
6818 Problem reported by Dani Moncayo in
6819 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6821 * sysdep.c (emacs_abort): Do not reset signal handler.
6822 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6823 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6824 wanted even on POSIXish hosts, and it doesn't work on Windows.
6826 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6828 * xterm.c (x_term_init): Call fixup_locale before and after calling
6829 gtk_init (Bug#12392).
6831 2012-09-23 Chong Yidong <cyd@gnu.org>
6833 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6834 Vdynamic_library_alist.
6836 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6837 (Fgnutls_available_p): Caller changed.
6839 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6840 (Flibxml_parse_xml_region): Likewise.
6842 * dispextern.h (struct image_type): Remove arg from init function.
6844 * image.c (Finit_image_library, lookup_image_type)
6845 (define_image_type): Remove now-unneeded second arg.
6846 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6847 (init_tiff_functions, init_gif_functions, init_svg_functions):
6848 Arglist and w32_delayed_load calling convention changed.
6849 (gs_type): Remove init_gs_functions; there is no such function.
6850 (valid_image_p, make_image): Fix caller to lookup_image_type.
6852 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6854 Simplify and avoid signal-handling races (Bug#12471).
6856 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6857 Avoid recursive loop if there's a fatal error in the function itself.
6858 * atimer.c (pending_atimers):
6859 * blockinput.h: Don't include "atimer.h"; no longer needed.
6860 (interrupt_input_pending): Remove. All uses removed.
6861 pending_signals now counts both atimers and ordinary interrupts.
6862 This is less racy than having three separate pending-signal flags.
6863 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6865 Rename from their upper-case counterparts BLOCK_INPUT,
6866 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6867 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6868 This makes it easier to access volatile variables more accurately.
6869 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6870 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6871 that's more reliable if the code is buggy and sets
6872 interrupt_input_blocked to a negative value. All uses changed.
6873 * atimer.c (deliver_alarm_signal):
6874 Remove. No need to deliver this to the parent; any thread can
6875 handle this signal now. All uses replaced by underlying handler.
6876 * atimer.c (turn_on_atimers):
6877 * dispnew.c (handle_window_change_signal):
6878 * emacs.c (handle_danger_signal):
6879 * keyboard.c (kbd_buffer_get_event):
6880 Don't reestablish signal handler; not needed with sigaction.
6881 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6883 Rework to avoid unnecessary accesses to volatile variables.
6884 (UNBLOCK_INPUT_TO): Now a function.
6885 (totally_unblock_input, unblock_input): New decls.
6886 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6887 (init_data): Remove. Necessary stuff now done in init_signal.
6888 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6889 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6890 (fatal_error_code): Remove; no longer needed.
6891 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6892 it doesn't always backtrace. All uses changed. No need to reset
6893 signal to default, since sigaction and/or die does that for us now.
6894 Use emacs_raise (FOO), not kill (getpid (), FOO).
6895 (main): Check more-accurately whether we're dumping.
6896 Move fatal-error setup to sysdep.c
6897 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6898 * gtkutil.c (xg_get_file_name, xg_get_font):
6899 Remove no-longer-needed signal-mask manipulation.
6900 * keyboard.c, process.c (POLL_FOR_INPUT):
6901 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6902 * keyboard.c (read_avail_input): Remove.
6903 All uses replaced by gobble_input.
6904 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6905 (kbd_buffer_store_event_hold, gobble_input):
6906 (record_asynch_buffer_change) [USABLE_SIGIO]:
6907 (store_user_signal_events):
6908 No need to mess with signal mask.
6909 (gobble_input): If blocking input and there are terminals, simply
6910 set pending_signals to 1 and return. All hooks changed to not
6911 worry about whether input is blocked.
6912 (process_pending_signals): Clear pending_signals before processing
6913 them, in case a signal comes in while we're processing.
6914 By convention callers now test pending_signals before calling us.
6915 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6916 New functions, to support changes to blockinput.h.
6917 (handle_input_available_signal): Now extern.
6918 (reinvoke_input_signal): Remove. All uses replaced by
6920 (quit_count): Now volatile, since a signal handler uses it.
6921 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6922 All callers changed. Block SIGINT only if not already blocked.
6923 Clear sigmask reliably, even if Fsignal returns, which it can.
6924 Omit unnecessary accesses to volatile var.
6925 (quit_throw_to_read_char): No need to restore sigmask.
6926 * keyboard.c (gobble_input, handle_user_signal):
6927 * process.c (wait_reading_process_output):
6928 Call signal-handling code rather than killing ourselves.
6929 * lisp.h: Include <float.h>, for...
6930 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6931 (pending_signals): Now volatile.
6932 (syms_of_data): Now const if IEEE floating point.
6933 (handle_input_available_signal) [USABLE_SIGIO]:
6934 (terminate_due_to_signal, record_child_status_change): New decls.
6935 * process.c (create_process): Avoid disaster if memory is exhausted
6936 while we're processing a vfork, by tightening the critical section
6938 (send_process_frame, process_sent_to, handle_pipe_signal)
6939 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6941 (send_process): No need for setjmp/longjmp any more, since the
6942 SIGPIPE stuff is now gone. Instead, report an error if errno
6944 (record_child_status_change): Now extern. PID and W are now args.
6945 Return void, not bool. All callers changed.
6946 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6947 Remove. All uses removed. This bug should be fixed now in a
6949 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6950 and record the child status change directly. This avoids the
6951 need to futz with the signal mask.
6952 (process_fatal_action): Move here from emacs.c.
6953 (emacs_sigaction_flags): New function, containing
6954 much of what used to be in emacs_sigaction_init.
6955 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6956 caught by emacs, to make races less likely.
6957 (deliver_process_signal): Rename from handle_on_main_thread.
6959 (BACKTRACE_LIMIT_MAX): Now at top level.
6960 (thread_backtrace_buffer, threadback_backtrace_pointers):
6962 (deliver_thread_signal, deliver_fatal_thread_signal):
6963 New functions, for more-accurate delivery of thread-specific signals.
6964 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6965 (deliver_arith_signal): Handle in this thread, not
6966 in the main thread, since it's triggered by this thread.
6967 (maybe_fatal_sig): New function.
6968 (init_signals): New arg DUMPING so that we can be more accurate
6969 about whether we're dumping. Caller changed.
6970 Treat thread-specific signals differently from process-general signals.
6971 Block all signals while handling fatal error; that's safer.
6972 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6974 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6975 Ignore SIGPIPE unless batch.
6976 (emacs_backtrace): Output backtrace for the appropriate thread,
6977 which is not necessarily the main thread.
6978 * syssignal.h: Include <stdbool.h>.
6979 (emacs_raise): New macro.
6980 * xterm.c (x_connection_signal): Remove; no longer needed
6981 now that we use sigaction.
6982 (x_connection_closed): No need to mess with sigmask now.
6983 (x_initialize): No need to reset SIGPIPE handler here, since
6984 init_signals does this for us now.
6986 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6988 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6989 background rect may be larger (Bug#12245).
6991 2012-09-23 Chong Yidong <cyd@gnu.org>
6993 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6995 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6997 * .gdbinit: Just stop at fatal_error_backtrace.
6998 See Stefan Monnier's request in
6999 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7000 Remove no-longer-used query of system type.
7002 2012-09-22 Chong Yidong <cyd@gnu.org>
7004 * search.c (Freplace_match): Doc fix (Bug#12325).
7006 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7008 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7009 (Fline_end_position): Doc fix.
7011 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7013 2012-09-22 Chong Yidong <cyd@gnu.org>
7015 * dispextern.h (struct image_type): Add new slot, storing a type
7016 initialization function.
7018 * image.c (define_image_type): Call the image initializer function
7019 if it is defined. Arguments and return value changed.
7020 (valid_image_p, make_image): Callers changed.
7021 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7022 (gif_type, imagemagick_type, svg_type, gs_type):
7023 Add initialization functions.
7024 (Finit_image_library): Call lookup_image_type.
7025 (CHECK_LIB_AVAILABLE): Macro deleted.
7026 (lookup_image_type): Call define_image_type here, rather than via
7027 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7028 (syms_of_image): Move define_image_type calls for xbm_type and
7029 pbm_type to lookup_image_type.
7031 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7033 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7034 'idle_timers' from here ...
7035 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7036 lists, to avoid infloops when the timer does something stupid,
7037 like reinvoke itself with the same or smaller time-out.
7040 2012-09-22 Martin Rudalics <rudalics@gmx.at>
7042 * window.c (Fsplit_window_internal): Handle only Qt value of
7043 Vwindow_combination_limit separately.
7044 (Qtemp_buffer_resize): New symbol.
7045 (Vwindow_combination_limit): New default value.
7048 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7050 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7051 the new overlay string. (Bug#10159)
7053 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7055 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7056 or that fprintf is async-signal-safe. POSIX doesn't require
7059 2012-09-22 Chong Yidong <cyd@gnu.org>
7061 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7064 2012-09-22 Kenichi Handa <handa@gnu.org>
7066 * composite.c (composition_reseat_it): Handle the case that a
7067 grapheme cluster is not covered by a single font (Bug#12352).
7069 2012-09-21 Chong Yidong <cyd@gnu.org>
7071 * image.c (define_image_type): Avoid adding duplicate types to
7072 image_types (Bug#12463). Suggested by Jörg Walter.
7074 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7076 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7077 (print_load_command_name): Add case LC_DATA_IN_CODE.
7078 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7080 2012-09-21 Glenn Morris <rgm@gnu.org>
7082 * eval.c (Frun_hook_with_args_until_success)
7083 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7085 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7087 * fileio.c (Ffile_selinux_context): Only call freecon when
7088 lgetfilecon succeeded.
7089 (Fset_file_selinux_context): Likewise. (Bug#12444)
7091 2012-09-21 Eli Zaretskii <eliz@gnu.org>
7093 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7094 reordering, locate the cursor by calling set_cursor_from_row; if
7095 that fails, clear the desired glyph matrix before returning a
7096 failure indication to the caller. Fixes leaving garbled display
7097 when fast scrolling with a down-key. (Bug#12403)
7098 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7099 scrolling through multibyte text.
7101 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7103 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7104 calling mark_vectorlike since that's the one that marks the window.
7105 (mark_discard_killed_buffers): Mark the final cdr.
7106 * window.h (struct window): Move prev/next_buffers to the
7107 non-standard fields.
7108 * window.c (make_window): Initialize prev/next_buffers manually.
7110 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7112 Omit unused arg EXPECTED from socket hooks.
7113 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7114 * nsterm.m (ns_term_init):
7115 * termhooks.h (struct terminal.read_socket_hook):
7116 * w32inevt.c (w32_console_read_socket):
7117 * w32term.c (w32_read_socket):
7118 * xterm.c (XTread_socket):
7119 Omit unused arg EXPECTED. All callers changed.
7120 (store_user_signal_events): Return void, not int, since callers no
7121 longer care about the return value. All uses changed.
7123 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
7125 * w32gui.h (XParseGeometry): Do not declare.
7127 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7129 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7130 Ignore 'expected'. See Eli Zaretskii in
7131 <http://bugs.gnu.org/12471#8> (last line).
7133 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7134 (XParseGeometry): Now static. Substitute extremal values for
7135 values that are out of range.
7137 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7139 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7141 * nsfns.m (XParseGeometry): Remove.
7142 (Fx_create_frame): Call x_set_offset to correctly interpret
7143 top_pos in geometry.
7145 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7146 (Fx_parse_geometry): If there is a space in string, call
7147 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7149 2012-09-17 Eli Zaretskii <eliz@gnu.org>
7151 * search.c (scan_buffer): Use character positions in calls to
7152 region_cache_forward and region_cache_backward, not byte
7153 positions. (Bug#12196)
7155 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7156 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7158 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7159 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7160 emacs_blocked_malloc, now deleted.
7162 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7164 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7165 The workaround was for improving performance on Solaris 2.4, but
7166 is getting in the way now. Emacs will still work if someone is
7167 still running Solaris 2.4 in a museum somewhere; Sun dropped
7168 support for Solaris 2.4 in 2003.
7169 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7170 * process.c (create_process) [HAVE_WORKING_VFORK]:
7171 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7172 since Emacs no longer uses vfork on that platform.
7174 2012-09-17 Glenn Morris <rgm@gnu.org>
7176 * emacs.c: Use COPYRIGHT.
7178 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7180 Remove configure's --without-sync-input option (Bug#12450).
7181 When auditing signal-handling in preparation for cleaning it up,
7182 I found that SYNC_INPUT has race conditions and would be a real
7183 pain to fix. Since it's an undocumented and deprecated
7184 configure-time option, now seems like a good time to remove it.
7185 Also see <http://bugs.gnu.org/11080#16>.
7186 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7187 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7188 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7189 (malloc_hysteresis):
7190 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7191 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7192 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7193 (dont_register_blocks, bytes_used_when_reconsidered)
7194 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7195 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7196 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7197 Remove. All uses removed.
7198 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7199 implementation, one that depends on whether the new macro
7200 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7202 * atimer.c (run_timers, handle_alarm_signal):
7203 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7204 (handle_async_input, process_pending_signals)
7205 (handle_input_available_signal, init_keyboard):
7206 * nsterm.m (ns_read_socket):
7207 * process.c (wait_reading_process_output):
7208 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7209 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7211 * xterm.c (XTread_socket):
7213 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7214 * eval.c (handling_signal): Remove. All uses removed.
7215 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7216 All uses replaced with the SYNC_INPUT version.
7217 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7219 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7222 * font.c (Ffont_shape_gstring): Remove unused local.
7224 2012-09-16 Glenn Morris <rgm@gnu.org>
7226 * Makefile.in (clean): No longer run nextstep's clean.
7228 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7230 (ns-app): Move here from ns.mk, and simplify.
7231 (clean): Simplify nextstep entry.
7232 * ns.mk: Remove file.
7234 2012-09-17 Kenichi Handa <handa@gnu.org>
7236 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7237 not covert the last few charactes.
7239 2012-09-16 Kenichi Handa <handa@gnu.org>
7241 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7242 here, but just check the validity of glyphs in the glyph-string.
7244 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7246 * window.c (Fwindow_parameter, Fset_window_parameter):
7247 Accept any window as argument (Bug#12452).
7249 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7251 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7252 to ns_term_init to avoid memory leak.
7254 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7255 explicit retain/release.
7256 (ns_term_init): Only allow one display. Initialize outerpool and
7259 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7261 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7262 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7263 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7264 the Microsoft problem in a different way, by altering ../nt/config.nt.
7266 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7281 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7282 by lisp.h. This completes removal of setjmp.h inclusion
7283 erroneously announced in the previous commit. (Bug#12446)
7285 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7288 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7289 not defined as a macro. The latter happens on MS-Windows.
7292 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7294 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7295 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7296 Some instances of '#include <setjmp.h>' removed, if the
7297 only reason for the instance was because "lisp.h" was included.
7298 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7299 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7300 and _longjmp with the new symbols. Emacs already uses _setjmp if
7301 available, so this change affects only POSIXish hosts that have
7302 sigsetjmp but not _setjmp, such as some versions of Solaris and
7303 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7304 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7305 (png_load_body) [HAVE_PNG]:
7306 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7307 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7308 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7309 since PNG requires jmp_buf. This is the only exception to the
7310 general rule that we now use sys_setjmp and sys_longjmp.
7311 This exception is OK since this code does not change the signal
7312 mask or longjmp out of a signal handler.
7314 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7316 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7317 Include "syssignal.h", for 'main_thread'.
7319 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7321 Avoid out-of-range marker position (Bug#12426).
7322 * insdel.c (replace_range, replace_range_2):
7323 Adjust markers before overlays, as suggested by comments.
7324 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7325 Remove redundant check before calling offset_intervals.
7327 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7329 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7330 current buffer (Bug#12387).
7332 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7334 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7336 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7338 Use a more backwards-compatible timer format (Bug#12430).
7339 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7340 vector element, not from the 4th, since PSECS is now at the end.
7341 (Fcurrent_idle_time): Doc fix.
7343 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7345 Function to mark objects and remove killed buffers at once.
7346 * alloc.c (discard_killed_buffers): Rename to ...
7347 (mark_discard_killed buffers) ... new name. Add marking
7348 of remaining objects. Fix comment. Adjust users.
7349 (mark_object): Do not touch frame buffer lists here.
7350 * frame.c (delete_frame): Reset frame buffer lists here.
7352 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7354 Better workaround for GNOME bug when --enable-gcc-warnings.
7355 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7356 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7357 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7359 Simplify SIGIO usage (Bug#12408).
7360 The code that dealt with SIGIO was crufty and confusing, e.g., it
7361 played tricks like "#undef SIGIO" but these tricks were not used
7362 consistently. Simplify mostly by not #undeffing standard symbols,
7363 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7364 or not as we please) rather than "defined SIGIO" (standard symbol
7365 that we probably shouldn't #undef).
7366 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7367 Modules that need it can include it.
7368 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7369 * dispextern.h (ignore_sigio): New decl.
7370 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7371 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7372 * emacs.c (shut_down_emacs):
7373 * keyboard.c (kbd_buffer_store_event_hold):
7374 Use ignore_sigio rather than invoking 'signal' directly.
7375 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7377 (FIONREAD, SIGIO): Do not #undef.
7378 (tty_read_avail_input): Use #error rather than a syntax error.
7379 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7380 for I_PIPE, used by SETUP_SLAVE_PTY.
7381 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7382 * sysdep.c (croak): Remove; no longer needed. This bit of
7383 temporary code, with Fred N. Fish's comment that it's temporary,
7384 has been in Emacs since at least 1992!
7385 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7386 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7387 * syssignal.h (croak): Remove decl.
7388 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7389 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7390 now that we're termios-only.
7391 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7392 * term.c (dissociate_if_controlling_tty): Use #error rather than
7395 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7396 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7397 to work around GNOME bug 683906.
7398 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7399 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7400 This works around GCC bug 54561.
7402 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7404 More fixes for 'volatile' and setjmp/longjmp.
7405 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7406 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7407 (png_load_body) [HAVE_PNG]:
7408 (jpeg_load_body) [HAVE_JPEG]:
7409 New function, with most of the old parent function's body.
7410 (png_load) [HAVE_PNG]:
7411 (jpeg_load) [HAVE_JPEG]:
7412 Invoke the new function, to avoid longjmp munging our locals.
7413 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7414 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7415 longjmp is passed 2, as the C standard doesn't guarantee this.
7416 Instead, store the failure code into mgr->failure_code.
7418 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7420 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7421 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7422 (syms_of_keyboard): Remove support for unread-command-char.
7424 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7426 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7427 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7428 violation. (Bug#12426)
7430 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7432 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7434 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7436 * eval.c: Add `inhibit-debugger'.
7437 (Qinhibit_debugger): New symbol.
7438 (call_debugger): Bind it instead of Qdebug_on_error.
7439 (maybe_call_debugger): Test Vinhibit_debugger.
7440 (syms_of_eval): Define inhibit-debugger.
7441 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7442 (syms_of_xdisp): Remove inhibit-debug-on-message.
7444 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7446 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7447 If a nonvolatile local variable is written before a _longjmp to
7448 the frame containing the variable, and is read after the _longjmp,
7449 the value read is indeterminate. Some local variables of type
7450 'struct handler' and 'struct catchtag' are used in this way, so
7451 mark each of their slots as volatile if the slot can be set before
7452 _longjmp and read afterwards.
7453 * lisp.h (struct handler): var and chosen_clause are now volatile.
7454 (struct catchtag): val, next, and pdlcount are now volatile.
7456 * bidi.c (bidi_push_it, bidi_pop_it):
7457 * fns.c (copy_hash_table):
7458 * image.c (define_image_type):
7459 * keyboard.c (kbd_buffer_store_event_hold):
7460 * process.c (Fprocess_send_eof):
7461 * xfaces.c (x_create_gc) [HAVE_NS]:
7462 * xgselect.c (xg_select):
7463 Prefer assignment to memcpy when either will do.
7465 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7466 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7467 time an item is removed. No need to mark this function 'inline';
7468 the compiler knows better than we do.
7470 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7472 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7473 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7474 to change_frame_size (Bug#12388).
7475 (windowDidResize:): Pass YES to updateFrameSize.
7477 * nsterm.h: Add delay parameter to updateFrameSize.
7479 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7481 Discard killed buffers from deleted window and frame objects.
7482 This reduces an amount of references to killed buffers and
7483 helps GC to reclaim them faster.
7484 * alloc.c (discard_killed_buffers): New function.
7485 (mark_object): Use it for deleted windows and frames.
7486 (mark_object): If symbol's value is set up for a killed buffer
7487 or deleted frame, restore its global binding.
7488 * data.c (swap_in_global_binding): Add GC notice.
7489 (swap_in_symval_forwarding): Use convenient set_blv_where.
7490 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7491 * window.h: ... to here.
7493 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7495 Convenient macro to check whether the buffer is live.
7496 * buffer.h (BUFFER_LIVE_P): New macro.
7497 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7498 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7500 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7502 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7503 composition cases (Bug#12364).
7505 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7506 overhang of succeeding glyphs overlapping box cursor.
7508 * w32term.c (x_draw_glyph_string): Likewise.
7510 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7512 Simplify, document, and port floating-point (Bug#12381).
7513 The porting part of this patch fixes bugs on non-IEEE platforms
7514 with frexp, ldexp, logb.
7515 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7517 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7518 support, by removing commented-out code and briefly listing the
7519 C89 functions excluded. The commented-out stuff was confusing
7520 maintenance, e.g., we thought we needed cbrt but it was commented out.
7521 (logb): Remove decl; no longer needed.
7522 (isfinite): New macro, if not already supplied.
7523 (isnan): Don't replace any existing macro.
7524 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7525 are present on all C89 platforms.
7526 (Ffrexp): Do not special-case zero, as frexp does the right thing
7528 (Flogb): Do not use logb, as it doesn't have the desired meaning
7529 on hosts that use non-base-2 floating point. Instead, stick with
7530 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7531 frexp, to avoid getting an unspecified result.
7533 * xdisp.c (Qinhibit_debug_on_message): Now static.
7535 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7537 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7538 NSBezierPath (Bug#12131).
7540 2012-09-10 Chong Yidong <cyd@gnu.org>
7542 * fns.c (Fdelq, Fdelete): Doc fix.
7544 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7546 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7547 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7549 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7551 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7552 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7555 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7557 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7558 left fringe if the window has a left margin. This avoids leaving
7559 traces of the cursor because its leftmost pixel is not drawn over.
7561 * dispnew.c (update_window_line): When the left margin area of a
7562 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7563 that screen line. (Bug#12277)
7565 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7567 Assume C89 or later for math functions (Bug#12381).
7568 This simplifies the code, and makes it a bit smaller and faster,
7569 and (most important) makes it easier to clean up signal handling
7570 since we can stop worring about floating-point exceptions in
7571 library code. That was a problem before C89, but the problem
7572 went away many years ago on all practical Emacs targets.
7573 * data.c, image.c, lread.c, print.c:
7574 Don't include <math.h>; no longer needed.
7575 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7576 might be autoconfigured, as that never happens.
7578 * doprnt.c (DBL_MAX_10_EXP):
7579 * print.c (DBL_DIG):
7580 Remove. C89 or later always defines these.
7581 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7582 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7583 (arith_error, domain_error, domain_error2):
7584 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7585 no longer needed -- we simply return what C returns. All uses removed.
7586 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7588 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7589 Remove. All uses expanded, as these macros are no longer used
7590 more than once and are now more trouble than they're worth.
7591 (Ftan): Use tan, not sin / cos.
7592 (Flogb): Assume C89 frexp.
7593 (fmod_float): Assume C89 fmod.
7594 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7595 (init_floatfns): Remove. All uses removed.
7597 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7599 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7600 compositeToPoint for OSX < 10.6 (Bug#12390).
7602 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7604 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7605 This produces more-accurate results.
7607 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7609 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7610 changes (Bug#12088).
7612 2012-09-08 Chong Yidong <cyd@gnu.org>
7614 * syntax.c (Fstring_to_syntax): Doc fix.
7616 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7618 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7619 in the internal border.
7620 (x_set_window_size): Remove static variables and their usage.
7621 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7622 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7623 Remove fringe/internal border adjustment (Bug#11052).
7624 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7625 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7626 (ns_fix_rect_ibw): Remove.
7627 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7628 (ns_dumpglyphs_box_or_relief): Ditto.
7629 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7631 (ns_dumpglyphs_image): Ditto.
7632 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7634 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7635 their usage. Add fringe_extended_p and its use as in other terms.
7636 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7637 scroll bar was removed.
7638 (updateFrameSize): New function.
7639 (windowDidResize): Move code to updateFrameSize and call it.
7641 * nsterm.h (EmacsView): Add updateFrameSize.
7643 2012-09-07 Chong Yidong <cyd@gnu.org>
7645 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7647 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7649 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7651 More signal-handler cleanup (Bug#12327).
7652 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7653 Problem introduced when merging patches. Noted by Eli Zaretskii in
7654 <http://bugs.gnu.org/12327#67>.
7655 * floatfns.c: Comment fix.
7656 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7657 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7658 and anyway the declaration is harmless even if SIGDANGER is not defined.
7659 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7660 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7661 source files not surprisingly expected syssignal.h to define, or
7662 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7663 Include <sys/ioctl.h>, for FIONREAD.
7664 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7665 This eliminates a problem whereby other files mysteriously had
7666 to include "syssignal.h" before including "systty.h" if they
7667 wanted to use "#ifdef SIGIO".
7669 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7671 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7673 * w32.c (sigemptyset): Empty the set.
7674 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7676 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7678 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7680 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7681 (mark_object): Likewise for frame objects.
7683 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7685 * syssignal.h (handle_on_main_thread): Always declare,
7686 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7687 This ports to platforms without HAVE_PTHREAD.
7689 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7691 Signal-handler cleanup (Bug#12327).
7692 Emacs's signal handlers were written in the old 4.2BSD style with
7693 sigblock and sigmask and so forth, and this led to some
7694 inefficiencies and confusion. Rewrite these to use
7695 pthread_sigmask etc. without copying signal sets around. Also,
7696 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7697 'signal', and instead use functions that do not attempt to take
7698 over the system name space. This patch causes Emacs's text
7699 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7700 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7701 Do not include <signal.h> or "syssignal.h", as these
7702 modules do not use signals.
7703 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7704 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7705 Do not include <signal.h>, as "syssignal.h" does that for us now.
7706 * atimer.c (sigmask_atimers): New function.
7707 (block_atimers, unblock_atimers): New functions,
7708 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7710 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7711 no longer needed here.
7712 * emacs.c (main): Inspect existing signal handler with sigaction,
7713 so that there's no need to block and unblock SIGHUP.
7714 * sysdep.c (struct save_signal): New member 'action', replacing
7715 old member 'handler'.
7716 (save_signal_handlers, restore_signal_handlers):
7717 Use sigaction instead of 'signal' to save and restore.
7718 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7719 New function. All users of 'signal' modified to use set_sighandler
7720 if they're writeonly, and to use sys_signal if they're read+write.
7721 (emacs_sigaction_init, forwarded_signal): New functions.
7722 (sys_signal): Remove. All uses replaced by calls to sigaction
7723 and emacs_sigaction_init, or by direct calls to 'signal'.
7724 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7725 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7726 all uses replaced by pthread_sigmask etc. calls.
7727 * syssignal.h: Include <signal.h>.
7728 (emacs_sigaction_init, forwarded_signal): New decls.
7729 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7730 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7731 (sigmask, sys_sigmask): Remove; no longer needed.
7732 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7733 (sigblock, sigunblock, sigfree):
7734 (sigsetmask) [!defined sigsetmask]:
7735 Remove. All uses replaced by pthread_sigmask.
7736 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7737 no longer need to be replaced, and its typical old uses
7738 are now done via emacs_sigaction_init and sigaction.
7739 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7740 (sys_sigdel): Remove; unused.
7741 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7743 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7745 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7746 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7748 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7750 Explicitly mark buffer_defaults and buffer_local_symbols.
7751 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7752 mark_local_symbols here.
7753 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7754 since special buffers aren't marked here any more.
7755 (allocate_buffer): Chain new buffer with all_buffers here...
7756 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7758 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7759 (syms_of_buffer): Remove staticpro of the above.
7760 (init_buffer_once): Set names for buffer_defaults and
7761 buffer_local_symbols.
7763 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7765 Use bool for booleans in font-related modules.
7766 * font.c (font_intern_prop, font_style_to_value)
7767 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7768 (generate_otf_features, font_check_otf_features, font_check_otf)
7769 (font_match_p, font_list_entities, font_at):
7770 * fontset.c (fontset_id_valid_p, reorder_font_vector
7771 (fontset_find_font, Fset_fontset_font)
7772 (face_suitable_for_char_p) [0]:
7773 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7774 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7775 (m17n_flt_initialized, ftfont_shape_by_flt):
7776 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7777 * nsfont.m (nsfont_draw):
7778 * w32font.c (w32font_draw):
7779 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7780 Use bool for booleans.
7781 * font.h: Adjust to above API changes.
7782 (struct font, struct font_driver, struct font_driver_list):
7783 Use bool for booleans.
7784 (struct font): Remove useless member encoding_type.
7786 * fontset.c, xftfont.c: Omit unnecessary static decls.
7788 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7790 * alloc.c (mark_object): Revert window marking code
7791 since it's unsafe for the Fset_window_configuration.
7793 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7795 Fix race conditions with signal handlers and errno (Bug#12327).
7796 Be more systematic about preserving errno whenever a signal
7797 handler returns, even if it's not in the main thread. Do this by
7798 renaming signal handlers to distinguish between signal delivery
7799 and signal handling. All uses changed.
7800 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7801 * data.c (deliver_arith_signal): Rename from arith_error.
7802 * dispnew.c (deliver_window_change_signal): Rename from
7803 window_change_signal.
7804 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7805 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7806 * keyboard.c (deliver_input_available_signal): Rename from
7807 input_available_signal.
7808 (deliver_user_signal): Rename from handle_user_signal.
7809 (deliver_interrupt_signal): Rename from interrupt_signal.
7810 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7811 (deliver_child_signal): Rename from sigchld_handler.
7812 * atimer.c (handle_alarm_signal):
7813 * data.c (handle_arith_signal):
7814 * dispnew.c (handle_window_change_signal):
7815 * emacs.c (handle_fatal_signal, handle_danger_signal):
7816 * keyboard.c (handle_input_available_signal):
7817 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7818 * process.c (handle_pipe_signal, handle_child_signal):
7819 New functions, with the actual signal-handling code taken from the
7820 original respective signal handlers, sans the sporadic attempts to
7821 preserve errno, since that's now done by handle_on_main_thread.
7822 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7823 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7824 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7826 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7827 Move initialization of main_thread to sysdep.c's init_signals.
7828 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7829 our usage, and simplifies the mainline code.
7830 (record_child_status_change): New static function, as a helper
7831 for handle_child_signal, and with most of the old child handler's
7833 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7834 (handle_child_signal): Use the above.
7835 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7836 Moved here from emacs.c.
7837 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7838 code moved here from emacs.c's main function.
7839 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7840 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7841 This lets callers save and restore errno properly.
7843 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7845 Remove redundant or unused things here and there.
7846 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7847 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7848 * editfns.c (Fcompare_buffer_substrings): Likewise.
7849 * frame.h (struct terminal, struct font_driver_list):
7850 Remove redundant declarations.
7851 * window.h (Qleft, Qright): Likewise.
7853 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7855 Do not mark objects from deleted buffers, windows and frames.
7856 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7857 (mark_object): Likewise for windows and frames.
7859 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7861 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7862 buffer_defaults and buffer_local_symbols as valid objects.
7863 Return special value to denote them.
7865 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7867 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7868 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7869 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7870 (file_name_absolute_p, Fsubstitute_in_file_name):
7871 (check_executable, check_writable, Ffile_accessible_directory_p)
7872 (Fset_file_selinux_context, Fdefault_file_modes)
7873 (Finsert_file_contents, choose_write_coding_system)
7874 (Fwrite_region, build_annotations, a_write, e_write)
7876 * filelock.c (boot_time_initialized, get_boot_time)
7877 (get_boot_time_1, lock_file_1, within_one_second):
7878 * floatfns.c (in_float):
7879 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7880 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7881 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7882 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7883 * window.c (compare_window_configurations):
7884 Use bool for booleans.
7885 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7886 (Fdefault_file_modes): Now mode_t, not int, for modes.
7887 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7888 (internal_delete_file): Now returns void, not a (boolean) int,
7889 since nobody was looking at the return value.
7890 * lisp.h, window.h: Adjust to above API changes.
7892 * xdisp.c (set_message): Simplify and reindent last change.
7894 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7896 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7898 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7900 * eval.c (call_debugger): Make the function non-static so that we
7901 can call it from set_message.
7903 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7904 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7906 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7908 Give more-useful info on a fatal error (Bug#12328).
7909 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7910 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7911 of doing the work ourselves.
7912 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7913 do most of the work.
7914 (fatal_error_backtrace): New function, taken from the guts
7915 of the old fatal_error_signal, but with a new option to output
7917 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7918 info about the signal than just its number.
7919 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7920 * sysdep.c: Include <execinfo.h>
7921 (emacs_backtrace): New function, taken partly from the previous
7922 code of the 'die' function.
7923 (emacs_abort): Call fatal_error_backtrace rather than abort.
7925 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7927 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7928 eager (load-time) macro-expansion.
7929 * lisp.mk (lisp): Add macroexp.
7931 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7933 Simplify redefinition of 'abort' (Bug#12316).
7934 Do not try to redefine the 'abort' function. Instead, redo
7935 the code so that it calls 'emacs_abort' rather than 'abort'.
7936 This removes the need for the NO_ABORT configure-time macro
7937 and makes it easier to change the abort code to do a backtrace.
7938 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7939 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7940 Remove; sysdep.c's emacs_abort now takes its place.
7941 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7942 'abort' changed to use 'emacs_abort'.
7943 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7944 (abort) [!defined abort]: Rename to ...
7945 (emacs_abort): ... new name.
7946 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7947 the place of the old 'abort' in emacs.c.
7948 * w32.c, w32fns.c (abort): Do not #undef.
7949 * w32.c (emacs_abort): Rename from w32_abort.
7951 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7953 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7954 offsets[j].dv, since the y axis of the screen coordinates points
7955 down, while the y axis of the font definition coordinates points
7956 up. This fixes display of Arabic diacritics such as KASRA and
7957 KASRATAN. (Bug#11860)
7959 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7961 Be more systematic about _setjmp vs setjmp.
7962 * alloc.c (test_setjmp, mark_stack):
7963 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7964 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7965 (png_load, my_error_exit, jpeg_load):
7966 * process.c (send_process_trap, send_process):
7967 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7968 The underscored versions are up to 30x faster on some hosts.
7969 Formerly, the code used setjmp+longjmp sometimes and
7970 _setjmp+_longjmp at other times, with no particular reason to
7971 prefer setjmp+longjmp.
7973 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7975 Fix minor problem found by static checking.
7976 * buffer.c (Fdelete_all_overlays): Return nil.
7978 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7980 * buffer.c (Fdelete_all_overlays): New function.
7982 2012-09-03 Chong Yidong <cyd@gnu.org>
7984 * gtkutil.c: Add extern decl for Qxft.
7986 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7988 * emacs.c, eval.c: Use bool for boolean.
7989 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7990 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7991 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7992 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7993 (main, decode_env_path, Fdaemon_initialized):
7994 * eval.c (call_debugger, Finteractive_p, interactive_p):
7995 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7996 (maybe_call_debugger, Fbacktrace):
7997 * process.c (read_process_output, exec_sentinel):
7998 Use bool for booleans.
7999 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8000 All callers changed.
8001 * eval.c (interactive_p): Omit always-true boolean argument
8002 EXCLUDE_SUBRS_P. All callers changed.
8003 * dispextern.h, lisp.h: Reflect above API changes.
8004 * firstfile.c (dummy): Use the address of 'main', whose signature
8005 won't change, instead of the address of 'initialize', whose
8006 signature just changed from int to bool.
8007 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8008 * msdos.c (fatal_error_in_progress): ... from here.
8009 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8011 (redisplay_internal, unwind_redisplay): Simply clear
8012 REDISPLAYING_P when unwinding, instead of saving its previous,
8013 always-false value and then restoring it.
8015 Clean up some extern decls.
8016 Mostly, this hoists extern decls out of .c files and into .h files.
8017 That way, we're more likely to catch errors if the interfaces change.
8018 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8019 declare xg_mark_data.
8020 * dispextern.h (x_frame_parm_handlers):
8022 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8023 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8024 (Qultra_bold, Qoblique, Qitalic):
8025 Move extern decl here from .c file.
8026 * alloc.c (xg_mark_data) [USE_GTK]:
8028 * eval.c (Qlexical_binding):
8029 * fns.c (time) [!HAVE_UNISTD_H]:
8030 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8031 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8032 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8033 * lread.c (Qinternal_interpreter_environment):
8034 * minibuf.c (Qbuffer):
8035 * process.c (QCfamily, QCfilter):
8036 * widget.c (free_frame_faces):
8037 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8038 * xfont.c (x_clear_errors):
8039 * xterm.c (x_frame_parm_handlers):
8040 Remove now-redundant extern decls.
8041 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8042 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8044 * xfaces.c: Remove unnecessary static decls.
8045 * xterm.c (updating_frame): Remove decl of nonexistent object.
8047 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8048 when building globals.h, as the objects that are not built on
8049 this host are not needed to compile C files on this host.
8051 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8053 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8055 * frame.h: Add missing prototype for x_wm_set_size_hint.
8057 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8059 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8060 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8061 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8062 (Fsubstitute_command_keys):
8063 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8064 (save_excursion_save, save_excursion_restore)
8065 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8066 (format_time_string, general_insert_function)
8067 (make_buffer_string, make_buffer_string_both)
8068 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8069 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8070 (copy_text, insert_1, insert_1_both, insert_from_string)
8071 (insert_from_string_before_markers, insert_from_string_1)
8072 (insert_from_buffer, insert_from_buffer_1, replace_range)
8073 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8074 (del_range_2, modify_region):
8075 * intervals.c (intervals_equal, balance_possible_root_interval)
8076 (adjust_intervals_for_insertion, merge_properties_sticky)
8077 (graft_intervals_into_buffer, lookup_char_property)
8078 (adjust_for_invis_intang, set_point_both)
8079 (get_property_and_range, compare_string_intervals)
8080 (set_intervals_multibyte_1, set_intervals_multibyte):
8081 * keyboard.c (decode_timer):
8082 Use bool for boolean.
8083 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8084 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8086 2012-09-02 Chong Yidong <cyd@gnu.org>
8088 * keymap.c (push_key_description): Print M-TAB as C-M-i
8091 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
8093 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8094 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8095 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8096 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8097 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8098 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8099 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8101 2012-09-01 Eli Zaretskii <eliz@gnu.org>
8103 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8104 more than one grapheme cluster passed to the shaper: compute the
8105 offset adjustment values separately for each cluster. (Bug#11860)
8107 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8108 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8109 about implicit conversions from integer to pointer.
8111 2012-09-01 Daniel Colascione <dancol@dancol.org>
8113 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8114 system used too early.
8116 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8118 Better seed support for (random).
8119 * emacs.c (main): Call init_random.
8120 * fns.c (Frandom): Set the seed from a string argument, if given.
8121 Remove long-obsolete Gentzel cruft.
8122 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8123 (init_random): New function.
8125 2012-09-01 Daniel Colascione <dancol@dancol.org>
8127 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8128 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8129 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8130 x_wm_set_size_hint, x_query_colors, x_real_positions,
8131 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8132 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8133 all of which have been moved to common code.
8135 * xfaces.c: Include TERM_HEADER instead of listing all possible
8136 window-system headers.
8138 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8141 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8142 directly accessing frame internals.
8144 * w32font.h: Include font.h. Define syms_of_w32font and
8147 * process.c: Include TERM_HEADER instead of listing all possible
8148 window-system headers.
8150 * nsterm.h: Remove declarations now in frame.h.
8151 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8153 * menu.c: Include TERM_HEADER instead of listing all possible
8154 window-system headers.
8156 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8159 * keyboard.c: Include TERM_HEADER instead of listing all possible
8160 window-system headers.
8162 * image.c: Include TERM_HEADER instead of listing all possible
8163 window-system headers. Declare Vlibrary_cache when compiling for
8166 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8167 window system declarations.
8169 * frame.h: Move common functions here: set_frame_menubar,
8170 x_set_window_size, x_sync, x_get_focus_frame,
8171 x_set_mouse_position, x_set_mouse_pixel_position,
8172 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8173 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8174 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8175 x_activate_menubar, x_real_positions, x_bitmap_icon,
8176 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8179 * frame.c: Include TERM_HEADER instead of listing all possible
8180 window-system headers.
8182 * font.c: Include TERM_HEADER instead of listing all possible
8183 window-system headers.
8185 * emacs.c: Include TERM_HEADER.
8187 * dispnew.c: Include TERM_HEADER instead of listing all possible
8188 window-system headers.
8190 * ccl.h: Include character.h.
8192 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8193 the current window system; include in list of objects to link into
8196 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8198 Remove mark_ttys function and fix tty_display_info initialization.
8199 * lisp.h (mark_ttys): Remove prototype.
8200 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8201 to mark_ttys because all possible values of 'top_frame' slot are
8202 the frames which are reachable from Vframe_list.
8203 * term.c (mark_ttys): Remove.
8204 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8206 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8208 Change struct frame bitfields from unsigned char to unsigned.
8209 * frame.h (struct frame): Change type of 'display_preempted',
8210 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8211 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8212 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8213 bitfields from unsigned char to unsigned.
8215 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8217 Remove unused member of struct x_output and struct w32_output.
8218 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8219 * w32term.h (struct w32_output): Likewise.
8221 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8223 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8224 does not become zero (Bug#12234).
8226 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8228 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8229 for GCC 4.7.1 x86-64.
8231 2012-08-30 Glenn Morris <rgm@gnu.org>
8233 * lread.c (init_lread): For out-of-tree builds, only add the
8234 source directory's site-lisp dir to the load-path if it exists,
8235 consistent with in-tree builds. (Bug#12302)
8237 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8239 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8240 button_values to NULL. Call setStykeMask so dialogs get a close button.
8241 (windowShouldClose:): Set window_closed.
8242 (dealloc): New member, free button_values.
8243 (process_dialog:): Make member function. Remove window argument,
8244 replace window with self. Count buttons and allocate and store values
8246 (addButton:value:row:): value is int with the name tag. Call setTag
8247 with tag. Remove return self, declare return value as void.
8248 (addString:row:): Remove return self, declare return value as void.
8249 (addSplit): Remove return self, declare return value as void.
8250 (clicked:): Remove return self, declare return value as void.
8251 Set dialog_return to button_values[seltag]. Code formatting change.
8252 (initFromContents:isQuestion:): Adjust call to process_dialog.
8253 Code formatting change.
8254 (timeout_handler:): Set timer_fired to YES.
8255 (runDialogAt:): Set timer_fired to NO.
8256 Handle click on close button as quit.
8258 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8259 Add window_closed and button_values. Add void as return value for
8260 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8261 Add process_dialog as new member.
8263 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8265 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8266 is not one of the heaps we manage. (Bug#12242)
8268 2012-08-28 Glenn Morris <rgm@gnu.org>
8270 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8272 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8274 * window.c (Fset_window_configuration): Remove handling of
8275 auto-buffer-name window parameter. Install revision of reverted
8278 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8280 Do not allow to set major mode for a dead buffer.
8281 * buffer.c (Fset_buffer_major_mode): Signal an error
8282 if the buffer is dead.
8283 (Fother_buffer, other_buffer_safely): Remove redundant
8286 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8288 Always use set_buffer_if_live to restore original buffer at unwind.
8289 * buffer.h (record_unwind_current_buffer): New function.
8290 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8291 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8292 * undo.c, window.c: Adjust users.
8293 * buffer.c (set_buffer_if_live): Fix comment.
8295 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8297 Fix usage of set_buffer_internal.
8298 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8299 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8300 * coding.c (decode_coding): Omit redundant test.
8301 * fileio.c (decide_coding_unwind): Likewise.
8302 * fns.c (secure_hash): Likewise.
8303 * insdel.c (modify_region): Likewise.
8304 * keyboard.c (command_loop_1): Likewise.
8305 * print.c (PRINTFINISH): Likewise.
8306 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8308 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8310 * dispnew.c: Use bool for boolean.
8311 (frame_garbaged, display_completed, delayed_size_change)
8312 (fonts_changed_p, add_window_display_history)
8313 (add_frame_display_history, verify_row_hash)
8314 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8315 (row_equal_p, realloc_glyph_pool)
8316 (allocate_matrices_for_frame_redisplay)
8317 (showing_window_margins_p)
8318 (adjust_frame_glyphs_for_frame_redisplay)
8319 (build_frame_matrix_from_leaf_window, make_current)
8320 (mirrored_line_dance, mirror_line_dance, update_frame)
8321 (update_window_tree, update_single_window)
8322 (check_current_matrix_flags, update_window, update_text_area)
8323 (update_window_line, set_window_update_flags, scrolling_window)
8324 (update_frame_1, scrolling, buffer_posn_from_coords)
8325 (do_pending_window_change, change_frame_size)
8326 (change_frame_size_1, sit_for):
8327 Use bool for boolean.
8328 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8329 and remove last int (actually boolean) argument, which was always 0.
8330 All callers changed.
8331 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8332 * dispextern.h (struct composition_it): Use bool for boolean.
8333 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8334 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8335 * dired.c (file_name_completion):
8336 Use bool for boolean. (This was missed in an earlier change.)
8338 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8340 * window.c (Fset_window_configuration): Revert first part of
8343 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8345 * nsterm.h (NSPanel): New class variable dialog_return.
8347 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8348 Initialize dialog_return.
8349 (windowShouldClose:): Use stop instead of stopModalWithCode.
8350 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8351 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8353 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8356 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8358 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8359 * composite.c (find_composition, composition_gstring_p)
8360 (composition_reseat_it, find_automatic_composition):
8361 * data.c (let_shadows_buffer_binding_p)
8362 (let_shadows_global_binding_p, set_internal, make_blv)
8363 (Fmake_variable_buffer_local, Fmake_local_variable)
8364 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8365 (cons_to_signed, arith_driver):
8366 * dbusbind.c (xd_in_read_queued_messages):
8367 * dired.c (directory_files_internal, file_name_completion):
8368 Use bool for booleans.
8369 * dired.c (file_name_completion):
8370 * process.h (fd_callback):
8371 Omit int (actually boolean) argument. It wasn't being used.
8373 * composite.h, lisp.h: Reflect above API changes.
8375 * cmds.c, coding.c: Use bool for booleans.
8376 * cmds.c (move_point, Fself_insert_command):
8377 * coding.h (struct composition status, struct coding_system):
8378 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8379 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8380 (emacs_mule_char, decode_coding_emacs_mule)
8381 (encode_coding_emacs_mule, detect_coding_iso_2022)
8382 (decode_coding_iso_2022, encode_invocation_designation)
8383 (encode_designation_at_bol, encode_coding_iso_2022)
8384 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8385 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8386 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8387 (encode_coding_raw_text, detect_coding_charset)
8388 (decode_coding_charset, encode_coding_charset, detect_eol)
8389 (detect_coding, get_translation_table, produce_chars)
8390 (consume_chars, reused_workbuf_in_use)
8391 (make_conversion_work_buffer, code_conversion_save)
8392 (decode_coding_object, encode_coding_object)
8393 (detect_coding_system, char_encodable_p)
8394 (Funencodable_char_position, code_convert_region)
8395 (code_convert_string, code_convert_string_norecord)
8396 (Fset_coding_system_priority):
8397 * fileio.c (Finsert_file_contents):
8398 Use bool for booleans.
8399 * coding.h, lisp.h: Reflect above API changes.
8400 * coding.c: Remove unnecessary static function decls.
8401 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8402 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8403 not a boolean 'int', since callers never look at the return value.
8404 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8405 * coding.h (decoding_buffer_size, encoding_buffer_size)
8406 (emacs_mule_string_char): Remove unused extern decls.
8407 (struct iso_2022_spec, struct coding_system):
8408 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8409 (struct emacs_mule_spec): Remove unused field 'full_support'.
8410 All initializations removed.
8411 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8413 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8415 Fix spare memory change (Bug#12286).
8416 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8417 (valid_lisp_object_p): Likewise.
8419 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8421 * window.c (Fset_window_configuration): Record any window's old
8422 buffer if it's replaced (see Bug#8789). If the new current
8423 buffer doesn't appear in the selected window, go to its old
8426 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8428 Special MEM_TYPE_SPARE to denote reserved memory.
8429 * alloc.c (enum mem_type): New memory type.
8430 (refill_memory_reserve): Use new type for spare memory.
8431 This prevents live_cons_p and live_string_p from incorrect
8432 detection of uninitialized objects from spare memory as live.
8434 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8437 * Makefile.in (.PHONY): versioclean -> versionclean.
8439 Remove unused external symbols.
8440 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8441 * window.c (Qwindow_valid_p, decode_valid_window):
8442 Now static, not extern.
8443 * data.c (Qinterval): Remove; unused.
8444 (syms_of_data): Do not define 'interval'.
8445 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8446 * window.h (decode_valid_window):
8449 * character.c, charset.c, chartab.c: Use bool for booleans.
8450 * character.c (lisp_string_width, string_count_byte8)
8451 (string_escape_byte8):
8452 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8453 (load_charset_map_from_file, map_charset_chars)
8454 (Fdefine_charset_internal, define_charset_internal)
8455 (Fdeclare_equiv_charset, find_charsets_in_text)
8456 (Ffind_charset_region, char_charset, Fiso_charset):
8457 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8458 (sub_char_table_set, sub_char_table_set_range)
8459 (char_table_set_range, optimize_sub_char_table)
8460 (map_sub_char_table):
8461 Use bool for boolean.
8462 * character.c (str_to_unibyte): Omit last boolean argument; it was
8463 always 0. All callers changed.
8464 * character.h, charset.h: Adjust to match previous changes.
8465 * character.h (char_printable_p): Remove decl of nonexistent function.
8466 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8467 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8468 are all boolean, so make them single-bit bitfields.
8470 * lisp.h (ASET): Remove attempt to detect side effects.
8471 It was meant to be temporary and it often doesn't work,
8472 because when IDX has side effects the behavior of IDX==IDX
8473 is undefined. See Stefan Monnier in
8474 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8476 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8478 * lisp.h (functionp): New function (extracted from Ffunctionp).
8479 (FUNCTIONP): Use it.
8480 * eval.c (Ffunctionp): Use it.
8482 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8484 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8485 as that's faster and simpler than static storage. Don't bother
8486 with the g_main_context_query overhead if g_main_context_pending
8487 says no events are pending.
8488 (gfds, gfds_size): Remove these static vars.
8489 (xgselect_initialize): Remove; no longer needed.
8490 All uses and decls removed.
8492 * emacs.c (fatal_error_signal_hook): Remove.
8493 All uses removed. This leftover from old code was always 0.
8495 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8496 * casefiddle.c (casify_object, casify_region):
8497 * casetab.c (set_case_table):
8498 * category.c, category.h (word_boundary_p):
8499 * category.h (CHAR_HAS_CATEGORY):
8500 Use bool for booleans, instead of int.
8502 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8504 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8506 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8508 On assertion failure, print backtrace if available.
8509 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8510 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8511 * Makefile.in (LIB_EXECINFO): New macro.
8514 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8515 * bytecode.c (exec_byte_code):
8516 * callint.c (check_mark, Fcall_interactively):
8517 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8518 (getenv_internal, sync_process_alive, call_process_exited):
8519 * lisp.h (USE_SAFE_ALLOCA):
8520 Use bool for booleans, instead of int.
8521 * lisp.h, process.h: Adjust prototypes to match above changes.
8522 * callint.c (Fcall_interactively): Don't assume the mark's
8523 offset fits in 'int'.
8525 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8527 * buffer.c, buffer.h: Use bool for boolean.
8528 * buffer.c (reset_buffer_local_variables)
8529 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8530 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8531 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8532 (overlay_touches_p, overlay_strings, Foverlay_put)
8533 (report_overlay_modification, call_overlay_mod_hooks):
8534 (mmap_enlarge, mmap_set_vars):
8535 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8536 Use bool for booleans, instead of int.
8537 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8538 since the 1-or-0 return value is always ignored anyway.
8539 (mmap_initialized_p):
8540 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8541 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8543 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8545 * bidi.c: Use bool for boolean.
8546 This is a bit more readable, and makes the text segment of bidi.o
8547 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8548 Presumably it's faster too.
8549 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8551 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8552 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8553 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8554 (bidi_explicit_dir_char, bidi_level_of_next_char)
8555 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8556 Use bool for booleans, instead of int.
8557 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8558 (bidi_unshelve_cache): Adjust decls to match code.
8560 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8562 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8565 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8567 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8568 * atimer.h: Include <stdbool.h>.
8570 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8572 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8573 compile time tests instead of run time tests on systems that do
8575 (FRAME_MAC_P): Remove leftover from deleted code.
8576 * frame.c (syms_of_frame): Remove leftover from deleted code.
8578 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8580 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8582 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8584 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8585 Otherwise, the compiler complains about (A?B:C) where B is void
8586 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8587 (fontset_add): Return void, for FONTSET_ADD.
8589 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8591 * alloc.c: Use bool for booleans.
8592 (gc_in_progress, abort_on_gc)
8593 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8594 (dont_register_blocks) [GC_MALLOC_CHECK]:
8595 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8596 (check_string_bytes, make_specified_string, memory_full)
8597 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8598 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8599 (mark_stack, valid_pointer_p, make_pure_string)
8600 (Fgarbage_collect, survives_gc_p, gc_sweep):
8601 Use bool for booleans, instead of int.
8602 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8603 Remove unused local.
8604 * alloc.c (PURE_POINTER_P):
8605 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8606 * editfns.c (Fformat):
8607 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8609 * fns.c (sweep_weak_table):
8610 * lisp.h (suppress_checking, push_message, survives_gc_p)
8611 (make_pure_string, gc_in_progress, abort_on_gc):
8612 * lread.c (readchar, read1):
8613 * print.c (Fprin1_to_string):
8614 * xdisp.c (push_message):
8615 Use bool for booleans affected directly or indirectly by
8618 Make recently-introduced setters macros.
8619 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8620 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8621 (set_fontset_default, set_fontset_fallback): Rename from their
8622 upper-case counterparts, and make them functions rather than macros.
8623 This is more consistent with the other recently-introduced setters.
8624 These don't need to be inline, since they're local.
8626 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8628 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8629 the loop (Bug#12247).
8631 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8633 * lisp.h (vcopy): Use memcpy rather than our own loop.
8634 This fixes a performance regression introduced by the recent
8635 addition of vcopy. This means 'vcopy' will need to be modified
8636 for a copying collector, but that's OK. Also, tighten the
8637 checking in the assertion.
8639 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8641 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8642 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8643 non-base glyph for the width of the base character, according to
8644 what x_draw_composite_glyph_string_foreground expects.
8645 Generate WADJUST value according to composition_gstring_width's
8646 expectations, to produce correct width of the composed character.
8647 Reverse the sign of the DU offset produced by ScriptPlace.
8649 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8651 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8653 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8655 Avoid direct writes to contents member of struct Lisp_Vector.
8656 * lisp.h (vcopy): New function to copy data into vector.
8657 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8658 * fns.c (Ffillarray): Use ASET.
8659 * keyboard.c (timer_check_2): Use AREF and ASET.
8660 (append_tool_bar_item, Frecent_keys): Use vcopy.
8661 * lread.c (read_vector): Use ASET.
8662 * msdos.c (Frecent_doskeys): Use vcopy.
8663 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8664 (Finternal_merge_in_global_face): Use ASET and vcopy.
8665 * xfont.c (xfont_list_pattern): Likewise.
8667 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8669 * window.c (Fwindow_point): For the selected window always return
8670 the position of its buffer's point.
8671 (Fset_window_point): For the selected window always go in its
8672 buffer to the specified position.
8674 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8676 Setter macros for fontsets.
8677 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8678 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8679 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8682 2012-08-20 Glenn Morris <rgm@gnu.org>
8684 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8685 Don't assume that `ln -f' works.
8687 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8689 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8690 and later about non-assignments with no effect. See discussion at
8691 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8694 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8696 Inline setter functions for Lisp_Objects slots of struct specbinding.
8697 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8700 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8702 * window.c (select_window): Always make selected window's buffer
8705 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8707 Use AREF and ASET for docstrings of category tables.
8708 * category.h (CATEGORY_DOCSTRING): Use AREF.
8709 (SET_CATEGORY_DOCSTRING): Use ASET.
8710 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8712 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8714 Inline setter functions for hash table members.
8715 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8716 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8717 (set_hash_key_and_value, set_hash_index, set_hash_next)
8718 (set_hash_hash): New functions.
8719 * charset.c, fns.c: Adjust users.
8721 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8723 Inline getter and setter functions for per-buffer values.
8724 * buffer.h (per_buffer_default, set_per_buffer_default)
8725 (per_buffer_value, set_per_buffer_value): New functions.
8726 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8727 * buffer.c, data.c: Adjust users.
8729 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8731 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8733 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8735 Rely on <config.h> + <unistd.h> to declare 'environ',
8736 as gnulib does this if the system doesn't.
8737 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8738 Remove declaration. MS-Windows declares it on stdlib.h which is
8739 included by conf_post.h.
8740 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8741 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8742 * vm-limit.c: Include <unistd.h>, for 'environ'.
8744 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8745 (start_of_data): Remove decl; mem-limits.h provides it.
8747 * xdisp.c (handle_invisible_prop): Make it a bit faster
8748 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8750 2012-08-19 Chong Yidong <cyd@gnu.org>
8752 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8755 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8757 * .gdbinit: Use call instead of set when calling a function in the
8760 * data.c (set_internal): Don't use set_blv_found.
8761 (Fkill_local_variable): Likewise.
8763 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8765 * nsfont.m (ns_ascii_average_width): Ensure the string
8766 ascii_printable is initialized with a null-terminated character
8767 array. Otherwise, it can contain undesired extra characters.
8769 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8771 port new setting code to Sun C 5.8 2005/10/13
8772 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8773 Return void, not Lisp_Object. Otherwise, the compiler
8774 complains about (A?B:C) where B is void and C is Lisp_Object
8775 when compiling CHAR_TABLE_SET, due to the recent change to
8776 the API of sub_char_table_set_contents.
8778 2012-08-18 Chong Yidong <cyd@gnu.org>
8780 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8781 for the string case (Bug#3874).
8783 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8785 * buffer.h (BSET): Remove (Bug#12215).
8786 Replace all uses with calls to new setter functions.
8787 (bset_bidi_paragraph_direction, bset_case_canon_table)
8788 (bset_case_eqv_table, bset_directory, bset_display_count)
8789 (bset_display_time, bset_downcase_table)
8790 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8791 (bset_last_selected_window, bset_local_var_alist)
8792 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8793 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8795 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8796 (bset_auto_fill_function, bset_auto_save_file_format)
8797 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8798 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8799 (bset_cache_long_line_scans, bset_case_fold_search)
8800 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8801 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8802 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8803 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8804 (bset_header_line_format, bset_indicate_buffer_boundaries)
8805 (bset_indicate_empty_lines, bset_invisibility_spec)
8806 (bset_left_fringe_width, bset_major_mode, bset_mark)
8807 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8808 (bset_name, bset_overwrite_mode, bset_pt_marker)
8809 (bset_right_fringe_width, bset_save_length)
8810 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8811 (bset_scroll_up_aggressively, bset_selective_display)
8812 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8813 (bset_word_wrap, bset_zv_marker):
8814 * category.c (bset_category_table):
8815 * syntax.c (bset_syntax_table):
8816 New setter functions.
8818 * process.h (PSET): Remove (Bug#12215).
8819 Replace all uses with calls to new setter functions.
8820 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8821 (PROCESS_INLINE): New macro.
8822 (pset_childp): New setter function.
8823 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8824 * process.c (PROCESS_INLINE):
8825 Define to EXTERN_INLINE, so that the corresponding functions
8826 are compiled into code.
8827 (pset_buffer, pset_command, pset_decode_coding_system)
8828 (pset_decoding_buf, pset_encode_coding_system)
8829 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8830 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8831 (pset_type, pset_write_queue): New setter functions.
8833 * window.h (WSET): Remove (Bug#12215).
8834 Replace all uses with calls to new setter functions.
8835 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8836 (WINDOW_INLINE): New macro.
8837 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8838 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8839 (wset_total_lines, wset_vertical_scroll_bar)
8840 (wset_window_end_pos, wset_window_end_valid)
8841 (wset_window_end_vpos): New setter functions.
8842 * window.c (WINDOW_INLINE):
8843 Define to EXTERN_INLINE, so that the corresponding functions
8844 are compiled into code.
8845 (wset_combination_limit, wset_dedicated, wset_display_table)
8846 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8847 (wset_new_normal, wset_new_total, wset_next_buffers)
8848 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8849 (wset_prev_buffers, wset_right_fringe_width)
8850 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8851 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8852 (wset_window_parameters):
8853 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8854 (wset_column_number_displayed, wset_region_showing):
8855 New setter functions.
8857 * termhooks.h (TSET): Remove (Bug#12215).
8858 Replace all uses with calls to new setter functions.
8859 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8860 (TERMHOOKS_INLINE): New macro.
8861 (tset_charset_list, tset_selection_alist): New setter functions.
8862 * terminal.c (TERMHOOKS_INLINE):
8863 Define to EXTERN_INLINE, so that the corresponding functions
8864 are compiled into code.
8865 (tset_param_alist): New setter function.
8867 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8869 * keyboard.h (KSET): Remove (Bug#12215).
8870 Replace all uses with calls to new setter functions.
8871 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8872 (KEYBOARD_INLINE): New macro.
8873 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8874 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8875 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8876 New setter functions.
8877 * keyboard.c (KEYBOARD_INLINE):
8878 Define to EXTERN_INLINE, so that the corresponding functions
8879 are compiled into code.
8880 (kset_echo_string, kset_kbd_queue)
8881 (kset_keyboard_translate_table, kset_last_prefix_arg)
8882 (kset_last_repeatable_command, kset_local_function_key_map)
8883 (kset_overriding_terminal_local_map, kset_real_last_command)
8884 (kset_system_key_syms): New setter functions.
8886 * frame.h (FSET): Remove (Bug#12215).
8887 Replace all uses with calls to new setter functions.
8888 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8889 (FRAME_INLINE): New macro.
8890 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8891 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8892 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8893 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8894 (fset_param_alist, fset_root_window, fset_scroll_bars)
8895 (fset_selected_window, fset_title, fset_tool_bar_items)
8896 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8897 * frame.c (FRAME_INLINE):
8898 Define to EXTERN_INLINE, so that the corresponding functions
8899 are compiled into code.
8900 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8902 A few more naming-convention fixes for getters and setters.
8903 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8904 and rename from buffer_overlays_set_before.
8905 (set_buffer_overlays_after): Move here from buffer.h, and rename
8906 from buffer_overlays_set_after.
8907 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8909 (set_buffer_intervals): Rename from buffer_set_intervals.
8910 * intervals.c (set_interval_object): Move here from intervals.h,
8911 and rename from interval_set_object.
8912 (set_interval_left): Move here from intervals.h, and rename from
8914 (set_interval_right): Move here from intervals.h, and rename from
8916 (copy_interval_parent): Move here from intervals.h, and rename from
8917 interval_copy_parent.
8918 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8919 (set_interval_plist): Rename from interval_set_plist.
8920 Return void, not Lisp_Object, since no caller uses the result.
8921 * lisp.h (string_intervals): Rename from string_get_intervals.
8922 (set_string_intervals): Rename from string_set_intervals.
8924 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8925 (set_char_table_contents): Rename from char_table_set_contents.
8926 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8927 All uses changed. See the end of
8928 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8930 * lisp.h (CSET): Remove (Bug#12215).
8931 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8932 (set_char_table_purpose): New functions,
8933 replacing CSET. All uses changed. For example, replace
8934 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8935 "set_char_table_parent (char_table, parent);".
8936 The old version was confusing because it used the same name
8937 'parent' for two different things.
8939 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8941 Functions to get and set Lisp_Object fields of buffer-local variables.
8942 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8943 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8944 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8945 * data.c, eval.c, frame.c: Adjust users.
8947 2012-08-17 Chong Yidong <cyd@gnu.org>
8949 * xfaces.c (merge_face_vectors): If the target font specfies a
8950 font spec, make the font's attributes take precedence over
8951 directly-specified attributes.
8952 (merge_face_ref): Recognize :font.
8954 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8956 Do not use memcpy for copying intervals.
8957 * intervals.c (reproduce_interval): New function.
8958 (reproduce_tree, reproduce_tree_obj): Use it.
8959 (reproduce_tree_obj): Remove prototype.
8961 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8963 * lisp.h (duration_to_sec_usec): Remove unused decl.
8965 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8967 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8968 to an allocated instance of NSString, not to the class itself.
8970 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8972 * makefile.w32-in (C_CTYPE_H): New macro.
8973 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8974 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8975 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8977 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8979 Use ASCII tests for character types.
8980 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8982 Don't include <ctype.h>; was not needed.
8983 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8984 * sysdep.c, xfaces.c:
8985 Include <c-ctype.h> instead of <ctype.h>.
8986 * nsterm.m: Include <c-ctype.h>.
8987 * charset.c (read_hex):
8988 * doc.c (Fsnarf_documentation):
8989 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8990 (DRIVE_LETTER) [DOS_NT]:
8991 (Ffile_name_directory, Fexpand_file_name)
8992 (Fsubstitute_in_file_name):
8993 * font.c (font_parse_xlfd, font_parse_fcname):
8994 * frame.c (x_set_font_backend):
8995 * gtkutil.c (xg_get_font):
8996 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8997 * nsimage.m (hexchar):
8998 * nsterm.m (ns_xlfd_to_fontname):
8999 * sysdep.c (system_process_attributes):
9000 * xfaces.c (hash_string_case_insensitive):
9001 Use C-locale tests instead of locale-specific tests for character
9002 types, since we want the ASCII interpretation here, not the
9003 interpretation suitable for whatever happens to be the current locale.
9005 2012-08-16 Martin Rudalics <rudalics@gmx.at>
9007 Consistently check windows for validity/liveness
9008 (Bug#11984, Bug#12025, Bug#12026).
9009 * lisp.h (CHECK_VALID_WINDOW): New macro.
9010 * window.c (decode_window): Rename to decode_live_window.
9011 (decode_valid_window, Fwindow_valid_p): New functions.
9012 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9013 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9014 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9015 (Fwindow_prev_sibling, Fwindow_combination_limit)
9016 (Fset_window_combination_limit, Fwindow_use_time)
9017 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9018 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9019 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9020 (Fwindow_hscroll, Fset_window_hscroll)
9021 (Fwindow_redisplay_end_trigger)
9022 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9023 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9024 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9025 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9026 (Fwindow_end, Fset_window_point, Fset_window_start)
9027 (Fpos_visible_in_window_p, Fwindow_line_height)
9028 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9029 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9030 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9031 (Fset_window_parameter, Fwindow_display_table)
9032 (Fset_window_display_table, Fdelete_other_windows_internal)
9033 (Fset_window_buffer, Fset_window_new_total)
9034 (Fset_window_new_normal, Fdelete_window_internal)
9035 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9036 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9037 (Fwindow_scroll_bars): Check whether argument window is a valid or
9038 live window. Update doc-strings.
9039 (syms_of_window): New symbol Qwindow_valid_p.
9040 * keyboard.c (Fposn_at_x_y): Check whether argument
9041 frame_or_window denotes a valid window.
9043 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9045 Fix previous char table change.
9046 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9047 * chartab.c (optimize_sub_char_table): Likewise.
9049 2012-08-16 Chong Yidong <cyd@gnu.org>
9051 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9053 * xfont.c (xfont_open):
9054 * xftfont.c (xftfont_open): Set the font's max_width field.
9056 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9057 min_width to space_width and average_width to the average over
9058 printable ASCII characters.
9059 (ns_char_width): Code cleanup.
9060 (ns_ascii_average_width): New utility function.
9062 * font.h (struct font): Update comments.
9064 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9066 Simple interface to set Lisp_Object fields of character tables.
9067 * lisp.h (CSET): New macro.
9068 (char_table_set_extras, char_table_set_contents)
9069 (sub_char_table_set_contents): New function.
9070 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9071 * syntax.c: Adjust users.
9073 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9075 * eval.c (eval_sub): Bind lexical-binding.
9076 * lread.c (Qlexical_binding): Make non-static.
9078 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9080 * nsmenu.m (popupSession): Remove.
9081 (pop_down_menu): Remove endModalSession.
9082 (timeout_handler:): New method.
9083 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9084 Call runModalForWindow. Check timer_fired when it returns.
9085 If not set, cancel timer and break out of loop.
9086 Otherwise loop again, with a new timeout.
9088 * nsterm.m: Include fcntl.h if present.
9089 (fd_entry, t_readfds, inNsSelect): Remove.
9090 (select_writefds, select_valid, select_timeout, selfds)
9091 (select_mutex, apploopnr): Add.
9092 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9093 Otherwise call kbd_buffer_store_event.
9094 (ns_send_appdefined): Remove release of fd_entry.
9095 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9096 Increment and decrement apploopnr.
9097 (ns_select): If no file descriptors, just do a NSTimer.
9098 Otherwise copy read/write masks and start select thread (fd_handler).
9099 Start main loop and wait for application defined event.
9100 Inform select thread to stop selecting after main loop is exited.
9101 (ns_term_init): Create selfds pipe and set non-blocking.
9102 Initialize select_mutex. Start the select thread (fd_handler).
9103 (fd_handler:): Loop forever, wait for info from the main thread
9104 to either start or stop selecting. When select returns, send
9105 and appdefined event.
9106 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9107 If not call kbd_buffer_store_event.
9109 * nsterm.h (EmacsApp): fd_handler takes id argument.
9110 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9112 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9114 2012-08-15 Eli Zaretskii <eliz@gnu.org>
9116 * region-cache.c (move_cache_gap): Update gap_len using the actual
9117 growth of the boundaries array. Do not change cache_len.
9120 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9122 Generalize and cleanup font subsystem checks.
9123 * font.h (FONT_DEBUG, font_assert): Remove.
9124 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9125 Change font_assert to eassert. Use eassert where appropriate.
9127 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9129 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9131 2012-08-15 Chong Yidong <cyd@gnu.org>
9133 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9134 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9135 extract the font descriptor instead of just the font name.
9136 In that case, return a font spec instead of a string.
9137 (x_last_font_name): Move to this file from xfns.c.
9139 * xfns.c (Fx_select_font): The return value can also be a font
9140 spec. Move x_last_font_name management to gtkutil.c.
9142 * xfaces.c: Make font weight and style symbols non-static.
9144 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9146 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9149 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9151 * alloc.c (Fgarbage_collect): Use plural form consistently.
9153 2012-08-14 Eli Zaretskii <eliz@gnu.org>
9155 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9156 iteration through the command loop. Fixes a problem whereby mouse
9157 movements are ignored until the first mouse click.
9159 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9161 Use bool, not int, for Lisp booleans.
9162 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9163 makes Emacs a bit smaller and presumably a bit faster.
9164 * lisp.h: Include <stdbool.h>.
9165 (struct Lisp_Boolfwd, defvar_bool):
9166 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9167 * regex.c [!emacs]: Include <stdbool.h>.
9168 (false, true): Remove; <stdbool.h> does this for us now.
9170 2012-08-14 Chong Yidong <cyd@gnu.org>
9172 * character.c (Fcharacterp): Doc fix (Bug#12076).
9174 * data.c (Findirect_variable): Doc fix (Bug#11040).
9176 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9178 * editfns.c (Fformat): Doc fix (Bug#12059).
9179 (Fsave_current_buffer): Doc fix (Bug#11542).
9181 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9183 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9186 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9188 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9189 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9190 * minibuf.c (choose_minibuf_frame, read_minibuf):
9191 * w32fns.c (x_create_tip_frame):
9192 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9193 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9195 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9197 * intervals.c (offset_intervals): Remove obsolete comment.
9199 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9201 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9203 2012-08-14 Gergely Risko <gergely@risko.hu>
9205 * coding.c (decode_coding): Record buffer modification before
9206 disabling undo_list (Bug#11773).
9208 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9210 Revert and cleanup some recent overlay changes.
9211 * buffer.h (enum overlay_type): Remove.
9212 (buffer_get_overlays, buffer_set_overlays): Likewise.
9213 (buffer_set_overlays_before, buffer_set_overlays_after):
9214 New function. Adjust users.
9215 (unchain_both): Add eassert.
9217 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9219 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9221 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9223 * gtkutil.c (xg_mark_data): Don't assume C99.
9225 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9227 * gtkutil.c (xg_frame_tb_info): New struct.
9228 (TB_INFO_KEY): New define.
9229 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9230 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9231 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9233 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9234 is up to date. Otherwise store new data.
9235 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9237 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9239 Use KSET for write access to Lisp_Object members of struct kboard.
9240 * keyboard.h (KSET): New macro.
9241 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9242 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9243 * xterm.c: Adjust users.
9245 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9247 Use BSET for write access to Lisp_Object members of struct buffer.
9248 * buffer.h (BSET): New macro.
9249 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9250 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9251 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9252 * window.c, xdisp.c, xfns.c: Adjust users.
9254 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9256 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9258 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9260 * nsterm.m (not_in_argv): New function.
9261 (application:openFile, application:openTempFile:):
9262 (application:openFileWithoutUI:, application:openFiles:): Open file
9263 if not_in_argv returns non-zero (bug#12171).
9265 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9266 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9267 Define for Gtk+ versions less than 3.2.
9268 (xg_get_font_name): Use those functions/macros here.
9269 Reported by Frans Oilinki <moilinki@gmail.com>.
9271 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9273 * unexmacosx.c (copy_data_segment): Copy initialized data in
9274 statically linked libraries from input file rather than memory.
9276 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9277 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9278 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9280 2012-08-10 Glenn Morris <rgm@gnu.org>
9282 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9283 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9285 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9287 Fix last change to allow compilation with low optimization levels.
9288 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9289 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9291 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9293 Use common inline syntax in intervals.h.
9294 * intervals.h (INTERVALS_INLINE): New macro.
9295 Change all users from LISP_INLINE.
9297 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9299 Define Qnone once for all platforms.
9300 * frame.c (Qnone): Define here.
9301 (syms_of_frame): DEFSYM it.
9302 * lisp.h (Qnone): New declaration.
9303 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9304 * xfns.c: Remove duplication. Adjust users.
9306 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9308 Remove unused macros from intervals.h.
9309 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9310 * intervals.c: Adjust comment.
9312 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9314 * w32fns.c <w32_unicode_gui>: New static variable.
9315 (globals_of_w32fns): Initialize it according to os_subtype.
9316 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9319 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9320 Eli Zaretskii <eliz@gnu.org>
9322 Fix bug #10299 with Unicode characters sent by customized
9323 keyboards created by MSKLC.
9324 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9325 (w32_init_class): Use it to initialize the Emacs class with either
9326 ANSI or Unicode API calls.
9327 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9329 (w32_wnd_proc): If the character code sent by WM_CHAR or
9330 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9331 original message. Call DefWindowProcW on NT and later.
9333 2012-08-10 Glenn Morris <rgm@gnu.org>
9335 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9337 * lisp.h (DIRECTORY_SEP): Let configure set it.
9339 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9341 Use TSET for write access to Lisp_Object slots of struct terminal.
9342 * termhooks.h (TSET): New macro.
9343 * coding.c, terminal.c, xselect.c: Adjust users.
9345 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9347 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9348 the failing expression, include them in the error message.
9349 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9350 * lisp.h (internal_condition_case_n): Update declaration.
9352 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9354 Inline functions to examine and change buffer overlays.
9355 * buffer.c (unchain_both): New function.
9356 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9357 (buffer_has_overlays): New function.
9358 (enum overlay_type): New enum.
9359 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9360 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9362 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9364 Inline functions to examine and change buffer intervals.
9365 * alloc.c (mark_interval_tree): Remove.
9366 (MARK_INTERVAL_TREE): Simplify.
9367 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9368 * intervals.c (buffer_balance_intervals): New function.
9369 (graft_intervals_into_buffer): Adjust indentation.
9370 (set_intervals_multibyte): Simplify.
9371 * buffer.h (BUF_INTERVALS): Remove.
9372 (buffer_get_intervals, buffer_set_intervals): New function.
9373 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9374 * intervals.c, textprop.c: Adjust users.
9376 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9378 Inline functions to examine and change string intervals.
9379 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9380 (string_get_intervals, string_set_intervals): New function.
9381 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9382 * lread.c, print.c, textprop.c: Adjust users.
9384 2012-08-08 Glenn Morris <rgm@gnu.org>
9386 * lisp.mk (lisp): Remove language/persian.elc.
9388 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9391 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9392 (NULL_INTERVAL_P): Likewise. Adjust users.
9393 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9394 Adjust comment. Move under #if 0.
9395 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9396 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9398 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9400 Check total length of intervals with eassert.
9401 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9402 * intervals.c: Change all users to eassert.
9404 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9406 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9407 Rename fields to match removal of FGET and WGET and disuse of
9408 INTERNAL_FIELD in Lisp_Cons.
9410 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9412 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9413 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9414 name since all xname users are fixed long time ago. Do not
9416 (set_symbol_name, set_symbol_function, set_symbol_plist):
9417 (set_symbol_next, set_overlay_plist): New function.
9418 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9419 (struct Lisp_Overlay): Likewise.
9420 (CVAR, MVAR, SVAR): Remove.
9421 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9422 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9423 * xterm.c: Adjust users.
9424 * .gdbinit: Change to use name field of struct Lisp_Symbol
9427 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9429 Basic functions to set Lisp_Object and pointer slots of intervals.
9430 * intervals.h (interval_set_parent, interval_set_object):
9431 (interval_set_left, interval_set_right, interval_set_plist):
9432 (interval_copy_parent): New function.
9433 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9434 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9436 (INTERVAL_SIZE): Remove. Adjust users.
9437 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9439 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9441 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9442 * process.h (PGET): Remove.
9443 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9444 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9446 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9448 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9449 * window.h (WGET): Remove.
9450 (struct window): Do not use INTERNAL_FIELD.
9451 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9452 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9453 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9454 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9455 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9458 2012-08-07 Chong Yidong <cyd@gnu.org>
9460 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9461 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9462 (Fdelete_window_internal): Signal an error if the window is not on
9463 a live frame (Bug#12025).
9465 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9467 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9468 * frame.h (FGET): Remove.
9469 (struct frame): Do not use INTERNAL_FIELD.
9470 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9471 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9472 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9473 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9475 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9477 * w32.c: Silence compiler warnings.
9478 (map_w32_filename): Remove unused variable `is_fat'.
9479 (chase_symlinks): Add parentheses around expression.
9481 2012-08-06 Glenn Morris <rgm@gnu.org>
9483 * sysdep.c: Respect BROKEN_GETWD.
9485 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9486 Let configure handle it.
9487 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9489 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9491 Use GCALIGNMENT where appropriate.
9492 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9493 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9494 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9496 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9498 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9499 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9501 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9503 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9504 that should be sufficient for everyone.
9506 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9508 * keyboard.c (timer_check_2): Add break so timer_check returns next
9511 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9513 Fix Windows build errors introduced after converting to WGET and WSET.
9514 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9515 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9517 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9519 * nsterm.m (ns_frame_rehighlight): Use FSET.
9521 * nsmenu.m (ns_update_menubar): Use FSET.
9523 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9525 Separate read and write access to Lisp_Object slots of Lisp_Process.
9526 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9527 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9529 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9531 Separate read and write access to Lisp_Object slots of struct window.
9532 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9533 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9534 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9535 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9536 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9537 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9540 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9542 Fix Windows build errors introduced after converting to FGET and FSET.
9543 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9544 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9545 (w32_judge_scroll_bars): Change to use FSET.
9546 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9548 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9550 Fix replacement typo.
9551 * window.c (replace_window): Set root_window instead of
9552 selected_window. This fixes a total window subsystem
9553 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9555 2012-08-06 Glenn Morris <rgm@gnu.org>
9557 * lisp.mk (lisp): Add language/persian.elc.
9559 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9561 Separate read and write access to Lisp_Object slots of struct frame.
9562 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9563 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9564 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9565 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9566 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9568 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9570 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9572 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9574 Generalize common compile-time constants.
9575 * lisp.h (header_size, bool_header_size, word_size): Now here.
9576 (struct Lisp_Vector): Add comment.
9577 (struct Lisp_Bool_Vector): Move up to define handy constants.
9578 (VECSIZE, PSEUDOVECSIZE): Simplify.
9579 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9580 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9581 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9582 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9583 * xfont.c, xmenu.c: Use word_size where appropriate.
9585 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9587 * search.c (Freplace_match): Treat \? in the replacement text
9588 literally (Bug#8161).
9590 2012-08-05 Chong Yidong <cyd@gnu.org>
9592 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9593 * frame.c (Vdelete_frame_functions):
9594 * emacs.c (Vkill_emacs_hook): Doc fix.
9596 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9598 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9599 --with-x-toolkit=no builds.
9600 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9602 2012-08-04 Chong Yidong <cyd@gnu.org>
9604 * syntax.c (Fmodify_syntax_entry): Doc fix.
9606 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9608 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9609 * w32.c (init_environment): Change the default values of many
9610 environment variables in dflt_envvars[] to NULL, to avoid pushing
9611 them into environment when they were not already defined.
9612 Remove the code that deletes site-lisp subdirectories from the default
9613 value of EMACSLOADPATH, as it is no longer needed.
9614 (check_windows_init_file): Now external, not static.
9615 Use Vload_path as is, without adding anything, as this function is now
9616 called when Vload_path is already set up.
9618 * w32.h (check_windows_init_file): Add prototype.
9620 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9621 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9622 compatibility with Posix platforms.
9623 (main): Move the call to check_windows_init_file to here from
9625 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9626 any, in the DEFALT argument into the root of the Emacs build or
9627 installation tree, as appropriate.
9629 * callproc.c (init_callproc_1): Call decode_env_path instead of
9630 doing its equivalent by hand.
9631 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9632 the code that sets Vexec_path run on MS-Windows.
9634 * lread.c (init_lread): Add comments to #ifdef's.
9636 * msdos.c (dos_set_window_size, IT_update_begin)
9637 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9638 instead of direct references.
9640 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9642 Export DEFAULT_REHASH_* to GDB.
9643 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9644 Now constants, not macros.
9646 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9648 Remove unnecessary casts involving pointers.
9649 These casts are no longer needed now that we assume C89 or later,
9650 since they involve casting to or from void *.
9651 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9652 (make_pure_float, make_pure_vector):
9653 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9654 * macros.c (Fstart_kbd_macro):
9655 * menu.c (find_and_return_menu_selection):
9656 * minibuf.c (read_minibuf_noninteractive):
9657 * sysdep.c (closedir):
9658 * xdisp.c (x_produce_glyphs):
9659 * xfaces.c (compare_fonts_by_sort_order):
9660 * xfns.c (x_real_positions, select_visual):
9661 * xselect.c (x_stop_queuing_selection_requests)
9662 (x_get_window_property, x_get_window_property_as_lisp_data):
9663 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9664 Remove unnecessary pointer casts.
9665 * alloc.c (record_xmalloc): New function.
9666 * lisp.h (record_xmalloc): New decl.
9667 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9668 more like a function. This is because the pointer cast is not
9669 needed. All uses changed.
9670 * print.c (print_string, print_error_message): Avoid length recalc.
9672 Improve fix for macroexp crash with debugging (Bug#12118).
9673 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9674 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9675 not supposed to be invoked from the garbage collector.
9676 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9677 (gc_aset): New function, which is like ASET but can be
9678 used in the garbage collector.
9679 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9680 (set_hash_index): Use it instead of ASET.
9682 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9684 Support symlinks on latest versions of MS-Windows.
9685 * w32.c: Include winioctl.h and aclapi.h.
9686 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9687 (revert_to_self): Forward declarations of static functions.
9688 <static BOOL g_b_init_get_security_info>:
9689 <g_b_init_create_symbolic_link>: New static flags.
9690 (globals_of_w32): Initialize them to zero.
9691 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9692 (map_w32_filename): Improve commentary. Simplify switch.
9693 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9694 headers (most versions of MinGW w32api don't).
9695 (get_security_info, create_symbolic_link)
9696 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9698 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9699 in the argument file name.
9700 (sys_access): Call unc_volume_file_attributes only if
9701 GetFileAttributes fails with network-related error codes.
9702 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9703 have the required privileges.
9704 (get_file_security_desc_by_name): Rename from
9705 get_file_security_desc.
9706 (stat_worker): New function, with most of the guts of 'stat', and
9707 with addition of handling of symlinks and support for 'lstat'.
9708 If possible, get file's attributes and security information by
9709 handle, not by name. Produce S_IFLNK bit for symlinks, when
9710 called from 'lstat'.
9711 (stat, lstat): New functions, call 'stat_worker'.
9712 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9713 symlinks when the underlying filesystem supports them.
9715 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9717 Fix macroexp crash on Windows with debugging (Bug#12118).
9718 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9719 checking subscripts; problem introduced with the recent
9720 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9721 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9722 since it's used in non-static inline functions now.
9724 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9725 Don't assume buffer size fits in 'int'. Remove unused local.
9727 Use C99-style 'extern inline' if available.
9728 * buffer.h (BUFFER_INLINE):
9729 * category.h (CATEGORY_INLINE):
9730 * character.h (CHARACTER_INLINE):
9731 * charset.h (CHARSET_INLINE):
9732 * composite.h (COMPOSITE_INLINE):
9733 * dispextern.h (DISPEXTERN_INLINE):
9734 * lisp.h (LISP_INLINE):
9735 * systime.h (SYSTIME_INLINE):
9736 New macro, replacing 'static inline' in this header.
9737 * buffer.h, category.h, character.h, charset.h, composite.h:
9738 * dispextern.h, lisp.h, systime.h:
9739 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9740 * alloc.c (LISP_INLINE):
9741 * buffer.c (BUFFER_INLINE):
9742 * category.c (CATEGORY_INLINE):
9743 * character.c (CHARACTER_INLINE):
9744 * charset.c (CHARSET_INLINE):
9745 * composite.c (COMPOSITE_INLINE):
9746 * dispnew.c (DISPEXTERN_INLINE):
9747 * sysdep.c (SYSTIME_INLINE):
9748 Define to EXTERN_INLINE, so that the corresponding functions
9749 are compiled into code.
9750 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9751 (INLINE_HEADER_END): New macros.
9752 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9753 since it's used in non-static inline functions now.
9754 (VALMASK) [!USE_LSB_TAG]: Likewise.
9756 2012-08-02 Glenn Morris <rgm@gnu.org>
9758 * s/: Remove empty directory.
9760 * s/ms-w32.h: Move to ../nt/inc.
9761 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9762 Update for new ms-w32.h location.
9764 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9767 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9769 2012-08-02 Glenn Morris <rgm@gnu.org>
9771 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9772 hard-coding the path separator.
9774 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9776 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9777 This how ASET and AREF are supposed to work, and makes
9778 it easier to think about future improvements. See
9779 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9780 * charset.h (set_charset_attr): New function.
9781 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9782 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9783 (aref_addr): New function. All uses of &AREF(...) changed.
9784 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9785 (set_hash_index): New functions. All lvalue-style uses of
9786 HASH_KEY etc. changed.
9787 * keyboard.c (set_prop): New function. All lvalue-style uses
9790 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9792 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9793 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9794 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9795 * nsfns.m (ns_set_name_as_filename): Likewise.
9796 * nsmenu.m (ns_update_menubar): Likewise.
9797 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9799 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9801 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9802 Adapt to latest changes in field names of the corresponding Lisp
9805 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9807 2012-08-01 Glenn Morris <rgm@gnu.org>
9809 * s/msdos.h: Remove file.
9810 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9811 * Makefile.in (S_FILE): Remove.
9812 (config_h): Remove S_FILE.
9814 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9816 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9817 Remove; moved to nt/config.nt.
9819 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9821 Use INTERNAL_FIELD for conses and overlays.
9822 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9823 Remove obsolete comment.
9825 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9826 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9828 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9830 Use INTERNAL_FIELD for symbols.
9831 * lisp.h (SVAR): New macro. Adjust users.
9832 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9833 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9835 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9837 Use INTERNAL_FIELD for processes.
9838 * process.h (PVAR): New macro. Adjust style.
9839 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9840 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9842 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9844 Use INTERNAL_FIELD for windows.
9845 * window.h (WVAR): New macro.
9846 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9847 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9848 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9849 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9850 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9851 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9853 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9855 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9857 2012-08-01 Glenn Morris <rgm@gnu.org>
9859 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9860 Move to configure.ac.
9862 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9864 * makefile.w32-in (CONFIG_H): Update dependencies.
9865 (CONF_POST_H): New macro.
9867 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9869 2012-07-31 Glenn Morris <rgm@gnu.org>
9871 * Makefile.in (S_FILE): No longer set by configure.
9873 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9875 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9877 * process.h (NULL_DEVICE):
9878 * emacs.c (SEPCHAR):
9879 * editfns.c (USER_FULL_NAME): Let configure set them.
9881 * s/README, s/template.h: Remove files.
9883 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9885 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9886 Move to configure.ac.
9888 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9890 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9891 resulting renaming of 'struct frame' members.
9893 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9895 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9896 after introduction of FVAR.
9898 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9900 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9902 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9903 instead of compositeToPoint.
9904 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9906 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9908 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9910 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9911 * lisp.h (INTERNAL_FIELD): New macro.
9912 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9913 (BVAR): Change to use INTERNAL_FIELD.
9914 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9915 (KVAR): Change to use INTERNAL_FIELD.
9916 * frame.h (FVAR): New macro.
9917 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9918 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9919 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9920 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9921 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9923 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9925 Miscellaneous fixes for non-default X toolkits.
9926 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9927 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9928 Move under #ifdef USE_LUCID.
9929 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9930 definition and usage to avoid warnings.
9932 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9934 * nsterm.m (openFiles): Fix previous checkin.
9936 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9938 * indent.c (compute_motion): Remove unused local.
9940 2012-07-31 Glenn Morris <rgm@gnu.org>
9942 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9944 * conf_post.h [USG5_4]:
9945 Move remaining contents of s/usg5-4-common.h here.
9946 * s/usg5-4-common.h: Remove file.
9948 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9949 * s/irix6-5.h: Remove file.
9951 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9952 * s/darwin.h: Remove file.
9954 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9955 * s/hpux10-20.h: Remove file, which is now empty.
9957 2012-07-30 Glenn Morris <rgm@gnu.org>
9959 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9960 * Makefile.in (config_h): Add conf_post.h.
9961 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9963 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9965 * nsterm.m (ns_do_open_file): New variable.
9966 (ns_term_init): Set ns_do_open_file to YES after run returns.
9967 (openFile, openTempFile, openFileWithoutUI, openFiles):
9968 Open files only if ns_do_open_file.
9970 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9972 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9973 This no-op macro hasn't been needed for many years.
9974 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9976 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9977 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9978 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9979 gdb_make_enums_visible.
9980 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9981 (DIRECTORY_SEP): Now a constant, not a macro.
9983 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9985 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9986 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9988 * w32term.c <w32_keyboard_codepage>: Renamed from
9989 keyboard_codepage and now external. All users changed.
9991 * w32term.h: Add declaration of w32_keyboard_codepage.
9993 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9994 the codepage to translate keys to Unicode. If this argument is
9995 -1, use the value returned by GetConsoleCP. All callers changed.
9997 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9999 Update .PHONY listings in makefiles.
10000 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10001 bootstrap-clean, distclean, maintainer-clean, versioclean,
10004 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10005 This is a bit clearer. Fix some commentary typos.
10007 2012-07-30 Glenn Morris <rgm@gnu.org>
10009 * s/netbsd.h: Let configure include signal.h if needed.
10010 Remove file, which is now empty.
10012 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10013 Let configure set them.
10014 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10015 No more need to undefine.
10017 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10019 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10020 non-single-byte char when adding meta modifier. (Bug#12090)
10022 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10024 Convert safe_call to use variable number of arguments.
10025 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10026 (safe_call2): Fix comment.
10027 * lisp.h (safe_call): Adjust prototype.
10028 * coding.c (encode_coding_object): Change to use safe_call2.
10029 * xfaces.c (merge_face_heights): Change to use safe_call1.
10031 2012-07-30 Glenn Morris <rgm@gnu.org>
10033 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10034 does that unconditionally. Remove file, which is now empty.
10036 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10037 Remove empty files.
10039 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10041 Export to GDB most of lisp.h's remaining object-like macros.
10042 * lisp.h (min, max): Move earlier, because they're used earlier now.
10043 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10044 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10045 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10046 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10047 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10048 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10049 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10050 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10051 Now constants, for GDB. They need not be macros.
10052 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10053 Now constants, for GDB, as well as macros, for static initializers.
10054 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10055 Move to after the definition of struct Lisp_Char_Table,
10056 since the former now needs that type defined.
10057 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10058 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10059 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10060 New enums, for gdb_make_enums_visible.
10061 (GLYPH_MODE_LINE_FACE): Remove; unused.
10062 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10063 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10064 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10065 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10066 enum maxargs, enum MAX_ALLOCA.
10067 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10068 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10069 no longer needed, now that they are done in lisp.h.
10071 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10073 Cleanup string bytes checking.
10074 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10075 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10076 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10077 (check_sblock, compact_small_strings): Simplify.
10079 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10081 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10082 These macros are confusing and no longer need to be defined, as
10083 the enum values now suffice. All uses replaced with definiens.
10084 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10086 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
10088 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10089 ($(BLD)/w32console.$(O)): Update dependencies.
10091 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10093 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10094 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10095 time. Adjust users.
10096 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10098 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10100 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10101 setting sitelisp (Bug#12010).
10103 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10105 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10107 * w32heap.c (cache_system_info):
10108 * w32.c (sys_rename):
10109 * w32proc.c (find_child_console, sys_kill): All users changed.
10111 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10113 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10115 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10117 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10119 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10121 Cleanup statistics calculation in Fgarbage_collect.
10122 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10123 Fix zombies percentage calculation. Simplify elapsed time calculation.
10125 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10127 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10128 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10129 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10130 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10131 (replace_range, replace_range_2, del_range_2): Change to eassert.
10132 * marker.c (byte_char_debug_check): Adjust style.
10134 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10136 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10137 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10138 long-ago-commented-out code that talks about "WIN32".
10139 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10142 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10144 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10145 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10146 Simplify by using alignof.
10147 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10148 * lisp.h: Include <stdalign.h>.
10149 (GCALIGNMENT): New macro and constant.
10150 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10151 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10152 (stdalign): New macro, if not already defined.
10154 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10156 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10157 * w32inevt.c: Include w32inevt.h.
10158 (w32_read_console_input): New inline function, calls either
10159 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10160 w32_console_unicode_input.
10161 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10162 (w32_kbd_patch_key, key_event): Use the codepage returned by
10163 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10164 (key_event): use uChar.UnicodeChar only if
10165 w32_console_unicode_input is non-zero.
10167 * w32console.c: Include w32heap.h.
10168 <w32_console_unicode_input>: New global variable.
10169 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10170 family of Windows, zero otherwise.
10172 * w32inevt.h: Declare w32_console_unicode_input.
10174 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10175 --without-x. (Bug#11742)
10177 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10179 Adjust GDB to reflect pvec_type changes (Bug#12036).
10180 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10181 2012-07-04 changes to pseudovector representation.
10182 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10184 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10186 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10188 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10190 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10192 * alloc.c (listn): Fix the order the arguments are consed onto the
10195 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10196 enumeration constants, as PURE and HEAP are too general, and clash
10197 with other headers and sources, such as gmalloc.c and the
10198 MS-Windows system headers. All users changed.
10200 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10202 Revert last save_excursion_save and save_excursion_restore changes.
10203 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10204 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10206 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10208 Fix recently-introduced typos in Windows port.
10209 Reported by Martin Rudalics <rudalics@gmx.at>.
10210 * w32.c (init_environment): Replace comma with semicolon.
10211 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10213 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10215 Improve GDB symbol export (Bug#12036).
10216 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10217 arms of an 'if', not using conditional expressions; otherwise GDB
10218 complains about the types in the unevaluated arm when the argument
10219 is an integer literal.
10220 (xgetint): Simplify expression.
10221 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10222 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10223 Zaretskii in <http://bugs.gnu.org/12036#13>.
10224 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10225 needed now that we have gdb_make_enums_visible.
10226 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10227 (enum enum_USE_LSB_TAG):
10228 New enum types, packaging up enums that need to be exported to GDB.
10230 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10232 Utility function to make a list from specified amount of objects.
10233 * lisp.h (enum constype): New datatype.
10234 (listn): New prototype.
10235 * alloc.c (listn): New function.
10236 (Fmemory_use_count, syms_of_alloc): Use it.
10237 * buffer.c (syms_of_buffer): Likewise.
10238 * callint.c (syms_of_callint): Likewise.
10239 * charset.c (define_charset_internal): Likewise.
10240 * coding.c (syms_of_coding): Likewise.
10241 * keymap.c (syms_of_keymap): Likewise.
10242 * search.c (syms_of_search): Likewise.
10243 * syntax.c (syms_of_syntax): Likewise.
10244 * w32.c (init_environment): Likewise.
10245 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10246 * xdisp.c (syms_of_xdisp): Likewise.
10247 * xfns.c (syms_of_xfns): Likewise.
10249 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10251 Fast save_excursion_save and save_excursion_restore.
10252 * lisp.h (struct Lisp_Excursion): New data type.
10253 (PVEC_EXCURSION): New pseudovector type.
10254 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10255 to deal with it. Adjust comments.
10256 (init_marker, attach_marker): New prototype.
10257 (unchain_marker): Adjust prototype.
10258 * marker.c (attach_marker): Change to global.
10259 (init_marker): New function.
10260 * alloc.c (Fmake_marker, build_marker): Use it.
10261 (build_marker): More easserts.
10262 (mark_object): Handle struct Lisp_Excursion.
10263 * editfns.c (save_excursion_save, save_excursion_restore):
10264 Reimplement to use struct Lisp_Excursion. Add comments.
10266 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10268 Fix export of symbols to GDB (Bug#12036).
10269 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10270 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10271 emacs.c, as this is a more-suitable home. Had this been done earlier
10272 the fix for 12036 would have avoided some of the problems noted in
10273 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10274 would have been more obvious.
10275 * emacs.c: Do not include <verify.h>; no longer needed.
10276 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10277 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10278 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10279 Remove; now done in lisp.h.
10280 * lisp.h (PUBLISH_TO_GDB): New macro.
10281 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10282 (DATA_SEG_BITS): Use it.
10283 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10284 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10285 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10286 not be usable in #if. This simplifies things.
10288 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10290 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10292 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10294 Simplify export of symbols to GDB (Bug#12036).
10295 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10296 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10297 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10298 Adjust to changes in lisp.h and emacs.c, by using
10299 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10300 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10301 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10302 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10303 instead of gdb_valbits.
10304 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10305 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10306 instead of gdb_array_mark_flag.
10307 (xboolvector): Get size from $->size, not $->header.size.
10308 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10309 (xreload, hook-run, hookpost-run): Remove.
10310 * emacs.c: Include <verify.h>.
10311 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10312 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10314 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10315 (gdb_USE_LSB_TAG): New enum constants.
10316 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10317 Also define these as enum constants, so they're visible to GDB.
10318 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10319 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10320 as constants, so they're visible to GDB.
10321 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10322 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10323 Now enum constants, not macros, so they're visible to GDB.
10324 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10325 more convenient now. All uses changed.
10326 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10327 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10329 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10331 Explicitly free restriction data that are not needed anymore.
10332 * editfns.c (save_restriction_restore): Free restriction data.
10334 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10336 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10337 add argument, tune behavior, and adjust all callers.
10339 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10341 Use typedef for EMACS_INT, EMACS_UINT.
10342 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10343 than macros. This simplifies debugging in the usual case, since
10344 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10345 and it allows expressions involving EMACS_INT casts.
10346 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10348 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10350 * nsterm.m (ns_read_socket): Return early if there is a modal
10351 window (Bug#12043).
10353 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10355 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10356 that FOCUS-FRAME can be omitted.
10358 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10360 Adjust buffer text indirection counters at the end of Fkill_buffer.
10361 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10362 buffer is definitely dead. This should really fix an issue reported
10363 by Christoph Scholtes again. (Bug#12007).
10364 (init_buffer_once): Initialize indirection counters of
10365 buffer_defaults and buffer_local_symbols (for sanity and safety).
10367 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10369 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10370 and continuation glyphs on tooltip frames, leave them at zero.
10371 Avoids continued lines in tooltips. (Bug#11832)
10373 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10375 Simplify copy_overlay.
10376 * buffer.c (copy_overlay): Simplify. Use build_marker.
10377 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10379 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10381 * print.c (print_object): Don't crash when a frame's name is nil
10382 or invalid. (Bug#12025)
10384 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10385 it signals an error when a tooltip frame is being created.
10387 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10389 Cleanup miscellaneous objects allocation and initialization.
10390 * alloc.c (allocate_misc): Change to static. Add argument to
10391 specify the subtype. Adjust comment and users.
10392 (build_overlay): New function.
10393 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10394 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10395 (allocate_misc): Remove prototype.
10396 (build_overlay): Add prototype.
10398 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10400 Swap buffer text indirection counters in Fbuffer_swap_text.
10401 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10402 This avoids crash reported by Christoph Scholtes at
10403 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10405 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10407 * nsmenu.m (Popdown_data): New struct.
10408 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10410 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10411 (initWithContentRect): Make imgView and contentView non-static
10412 and autorelease them. Also autorelease img and matrix (Bug#12005).
10413 (dealloc): Remove (Bug#12005).
10415 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10417 Adjust consing_since_gc when objects are explicitly freed.
10418 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10419 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10420 (free_cons, free_misc): Subtract object size from consing_since_gc.
10422 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10424 Simplify and cleanup markers positioning code.
10425 * marker.c (attach_marker): More useful eassert.
10426 (live_buffer, set_marker_internal): New function.
10427 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10428 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10430 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10432 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10433 as it's limited by the amount of memory, not by INT_MAX.
10435 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10437 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10438 in special-event-map. See the discussion at
10439 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10442 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10443 info.dwItemData. Fixes crashes on 64-bit Windows.
10444 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10446 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10448 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10449 (conversationIdentifier): Return value is NSInteger.
10450 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10452 2012-07-21 Chong Yidong <cyd@gnu.org>
10454 * window.c (decode_any_window): Signal an error if the window is
10455 on a dead frame (Bug#11984).
10457 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10459 Add indirection counting to speed up Fkill_buffer.
10460 * buffer.h (struct buffer): New member.
10461 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10462 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10463 base buffer indirection counter.
10464 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10465 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10466 through buffer list if indirection counter is 0.
10468 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10470 Extend the value returned by Fgarbage_collect with heap statistics.
10471 * alloc.c (Qheap): New symbol.
10472 (syms_of_alloc): DEFSYM it.
10473 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10474 (Fmemory_free): Remove.
10475 (syms_of_alloc): Don't defsubr it.
10476 * buffer.c (Fcompact_buffer): Remove.
10477 (syms_of_buffer): Don't defsubr it.
10479 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10481 Make maybe_gc inline.
10482 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10483 * lisp.h (consing_since_gc, gc_relative_threshold)
10484 (memory_full_cons_threshold): Revert declaration.
10485 (maybe_gc): Remove prototype, define as inline.
10486 * alloc.c: Remove old commented-out code.
10487 (consing_since_gc, gc_relative_threshold)
10488 (memory_full_cons_threshold): Revert to global.
10489 (maybe_gc): Remove.
10491 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10493 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10494 * lisp.h (build_unibyte_string): New function.
10495 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10496 * sysdep.c, w32fns.c, xfns.c: Use it.
10497 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10498 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10499 Adjust users accordingly.
10500 * font.h (font_open_by_name): Adjust prototype.
10502 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10504 Cleanup calls to Fgarbage_collect.
10505 * lisp.h (maybe_gc): New prototype.
10506 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10507 Remove declarations.
10508 * alloc.c (maybe_gc): New function.
10509 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10511 * bytecode.c (MAYBE_GC): Use maybe_gc.
10512 * eval.c (eval_sub, Ffuncall): Likewise.
10513 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10514 to avoid dependency from auto-save feature.
10516 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10518 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10519 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10520 'for_each_per_buffer_object_at'.
10521 All uses changed. It's better to use upper-case for macros that
10522 cannot be implemented as functions, to give the reader a clue
10523 that they're special.
10525 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10527 * alloc.c (Fgarbage_collect): Tweak docstring.
10529 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10531 Tweak the value returned from Fgarbage_collect again.
10532 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10533 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10534 Adjust documentation.
10535 (total_vector_bytes): Rename to total_vector_slots, adjust
10537 (total_free_vector_bytes): Rename to total_free_vector_slots,
10539 (Qstring_bytes, Qvector_slots): New symbols.
10540 (syms_of_alloc): DEFSYM them.
10542 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10544 Buffer compaction primitive which may be used from Lisp.
10545 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10546 (syms_of_buffer): Register Fcompact_buffer.
10547 * alloc.c (Fgarbage_collect): Use compact_buffer.
10548 * buffer.h (compact_buffer): New prototype.
10549 (struct buffer_text): New member.
10551 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10553 New macro to iterate over all buffers, miscellaneous cleanups.
10554 * lisp.h (all_buffers): Remove declaration.
10555 * buffer.h (all_buffers): Add declaration, with comment.
10556 (for_each_buffer): New macro.
10557 * alloc.c (Fgarbage_collect, mark_object): Use it.
10558 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10559 (init_buffer): Likewise.
10560 * data.c (Fset_default): Likewise.
10561 * coding.c (code_conversion_restore): Remove redundant check
10563 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10565 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10567 Fix bug that created negative-length intervals.
10568 * intervals.c (merge_interval_right, merge_interval_left):
10569 Do not zero out this interval if it is absorbed by its children,
10570 as this interval's total length doesn't change in that case. See
10571 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10573 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10575 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10576 when invoking (make-bool-vector N t) and N is a positive
10577 multiple of 8 -- the last 8 bits were mistakenly cleared.
10579 Remove some struct layout assumptions in bool vectors.
10580 * alloc.c (bool_header_size): New constant.
10581 (header_size, word_size): Move earlier, as they're now used earlier.
10582 Use 'word_size' in a few more places, where it's appropriate.
10583 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10584 padding before the data member of a bool vector.
10585 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10586 than doing the check by hand with an abort ().
10588 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10590 * eval.c (Fdefvar): Don't check constants since we only set the var if
10591 it's not yet defined anyway (bug#11904).
10593 * lisp.h (last_undo_boundary): Declare new var.
10594 * keyboard.c (command_loop_1): Set it.
10595 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10596 were auto-added by the command loop (bug#11774).
10598 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10600 * w32font.c (Qsymbol): Remove local definition.
10601 (syms_of_w32font): Don't DEFSYM it.
10603 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10605 Fix sweep_vectors to handle large bool vectors correctly.
10606 * alloc.c (sweep_vectors): Account total_vector_bytes for
10607 bool vectors larger than VBLOCK_BYTES_MAX.
10609 2012-07-18 Chong Yidong <cyd@gnu.org>
10611 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10612 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10614 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10616 Return more descriptive data from Fgarbage_collect.
10617 Suggested by Stefan Monnier in
10618 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10619 * alloc.c (bounded_number): New function.
10620 (total_buffers, total_vectors): New variable.
10621 (total_string_size): Rename to total_string_bytes, adjust users.
10622 (total_vector_size): Rename to total_vector_bytes, adjust users.
10623 (sweep_vectors): Account total_vectors and total_vector_bytes.
10624 (Fgarbage_collect): New return value. Adjust documentation.
10625 (gc_sweep): Account total_buffers.
10626 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10627 (VECTOR_SIZE): Remove.
10628 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10629 (Qinterval, Qmisc): New symbols.
10630 (syms_of_data): Initialize them.
10631 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10632 (Qcons, Qbuffer): New declarations.
10634 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10636 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10637 Round up, not down. Improve doc.
10639 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10641 Restore old code in allocate_string_data to avoid Faset breakage.
10642 Reported by Julien Danjou <julien@danjou.info> in
10643 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10644 * alloc.c (allocate_string_data): Restore old code with minor
10645 adjustments, fix comment to explain this subtle issue.
10647 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10649 Remove FILE_SYSTEM_CASE.
10650 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10652 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10653 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10654 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10655 call-process-region passes it through expand-file-name.
10657 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10659 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10661 Fix crash when creating indirect buffer (Bug#11917)
10662 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10663 Don't handle unbound variables specially if non-zero.
10664 (Fbuffer_local_variables): Pass zero.
10665 (clone_per_buffer_values): Pass non-zero.
10667 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10669 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10670 to make the loop interruptible.
10672 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10674 * gnutls.c (emacs_gnutls_handshake): Only retry if
10675 GNUTLS_E_INTERRUPTED.
10677 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10679 Cleanup and convert miscellaneous checks to eassert.
10680 * alloc.c (mark_interval): Fix comment, partially rephrase
10681 old comment from intervals.h (see below).
10682 * intervals.c (find_interval, adjust_intervals_for_insertion)
10683 (delete_interval, adjust_intervals_for_deletion)
10684 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10685 Convert to eassert.
10686 (adjust_intervals_for_insertion, make_new_interval):
10687 Remove obsolete and unused code.
10688 * intervals.h (struct interval): Remove obsolete comment.
10689 * textprotp.c (erase_properties): Remove unused code.
10690 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10691 (Fremove_list_of_text_properties): Convert to eassert.
10693 2012-07-17 Chong Yidong <cyd@gnu.org>
10695 * editfns.c (Finsert_char): Doc fix.
10697 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10699 Fix previous change to make Fmemory_free always accurate.
10700 * alloc.c (make_interval): Update total_free_intervals.
10701 (make_float): Likewise for total_free_floats.
10702 (free_cons, Fcons): Likewise for total_free_conses.
10703 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10704 Likewise for total_free_vector_bytes.
10705 (Fmake_symbol): Likewise for total_free_symbols.
10706 (bytes_free): Remove.
10708 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10710 Simple free memory accounting feature.
10711 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10712 (sweep_vectors): Accumulate size of free vectors.
10713 (Fgarbage_collect): Setup bytes_free.
10714 (Fmemory_free): New function.
10715 (syms_of_alloc): Register it.
10717 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10719 Cleanup overlays checking.
10720 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10721 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10722 eassert and OVERLAYP.
10723 (sort_overlays): Change to use OVERLAYP.
10725 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10727 * editfns.c (Finsert_char): Make it interactive, and make the
10728 second arg optional. Copy interactive spec and docstring from
10731 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10733 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10734 Unlike the other wrapped functions, fabs has an unspecified
10737 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10739 * nsterm.m (keyDown): Interpret flags without left/right bits
10740 as the left key (Bug#11670).
10742 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10744 Remove empty and useless init functions.
10745 * lisp.h (init_character_once, init_fns, init_image)
10746 (init_filelock, init_sound): Remove prototype.
10747 * character.c (init_character_once): Remove.
10748 * filelock.c (init_filelock): Likewise.
10749 * fns.c (init_fns): Likewise.
10750 * image.c (init_image): Likewise.
10751 * sound.c (init_sound): Likewise.
10752 * emacs.c (main): Adjust accordingly.
10754 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10756 * gtkutil.h: Tiny cleanups.
10757 (use_old_gtk_file_dialog): Remove useless declaration.
10758 (xg_uses_old_file_dialog): Add suggested const attribute.
10760 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10762 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10763 (bidi_paragraph_init): Use it to limit search forward for a strong
10764 directional character in abnormally large paragraphs full of
10765 neutral or weak characters. (Bug#11943)
10767 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10769 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10770 the toolbar (Bug#9451).
10771 (xg_make_tool_item): Give the widget event box a transparent
10774 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10776 Cleanup basic allocation variables and functions.
10777 * alloc.c (ignore_warnings, init_intervals, init_float)
10778 (init_cons, init_symbol, init_marker): Remove.
10779 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10780 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10781 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10782 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10783 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10784 (staticidx, init_alloc_once, init_strings, free_ablock):
10785 Remove redundant initialization.
10786 * fns.c (init_weak_hash_tables): Remove.
10787 * lisp.h (init_weak_hash_tables): Remove prototype.
10789 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10791 Use zero_vector where appropriate.
10792 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10794 * lisp.h (zero_vector): New declaration.
10795 * font.c (null_vector): Remove.
10796 (syms_of_font): Remove initialization and staticpro.
10797 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10798 * keymap.c (Faccessible_keymaps): Likewise.
10800 2012-07-15 Leo Liu <sdl.web@gmail.com>
10802 * fringe.c: Fix typo in comments.
10804 2012-07-14 Leo Liu <sdl.web@gmail.com>
10806 * fringe.c: Add a new bitmap exclamation-mark.
10808 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10810 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10812 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10813 (HAVE_MENUS): Don't define, defined by editing config.in with
10815 (GMALLOC_INHIBIT_VALLOC): Don't define.
10816 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10818 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10820 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10822 2012-07-14 Glenn Morris <rgm@gnu.org>
10824 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10825 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10826 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10828 2012-07-13 Glenn Morris <rgm@gnu.org>
10830 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10832 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10833 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10835 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10837 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10838 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10839 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10840 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10842 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10843 as boolean expression.
10844 (x_set_window_size): Remove unused variable toolbar.
10845 (ns_get_color_default, ns_mod_to_lisp): Remove.
10846 (ns_mouse_position): Remove unused variables xchar and ychar.
10847 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10848 (ns_set_vertical_scroll_bar): Remove unused variable count.
10849 (ns_delete_terminal): Remove unused variable i.
10850 (ns_term_init): Remove unused variables r, g and b.
10851 (mouseDown): Remove unused variable window.
10852 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10853 (initFrameFromEmacs): Remove unused variable vbextra.
10854 (mouseEntered): Remove unused variables p and dpyinfo.
10855 (mouseExited): Remove unused variables p and r.
10856 (ns_define_frame_cursor, ns_clear_frame_area)
10857 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10858 (menuDown): Assign [sender tag] to variable and cast the variable.
10860 * nsterm.h (menuDown): Add id as type to argument sender.
10861 (ns_display_info_for_name): Add Lisp_Object argument.
10862 (ns_term_init): Add Lisp_Object argument.
10863 (ns_map_event_to_object): Add void argument.
10864 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10865 prototype with arguments and only declare if __OBJC__.
10866 (nxatoms_of_nsselect): Add void argument.
10867 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10868 (ns_alloc_autorelease_pool): Add void argument.
10869 (ns_release_autorelease_pool): Add void* argument.
10870 (ns_get_defaults_value): Add const char* argument.
10872 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10873 (initFromContents): Use SSDATA where appropriate.
10874 (ns_update_menubar): Add braces to ambigous if-else.
10875 (initWithTitle): Put () around assignment in if statement.
10876 (ns_menu_show): Remove unused variables window and keymap.
10877 (update_frame_tool_bar): Remove unused variable selected_p.
10878 (initWithContentRect): Remove unused variable this_cmd_name.
10880 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10882 (setXBMColor): Remove unused variable len.
10883 (setPixmapData): Put () around assignment in loop statement.
10885 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10886 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10888 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10889 around assignment in loop statement.
10890 (nsfont_open): Remove unused variable i.
10891 (nsfont_open): Remove unused variable len.
10892 (nsfont_draw): Remove unused variable cs.
10894 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10895 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10896 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10897 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10898 (Fns_font_name, Fns_perform_service)
10899 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10900 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10901 (ns_set_name): Remove unused variable view.
10902 (x_set_menu_bar_lines): Remove unused variable olines.
10903 (x_set_tool_bar_lines): Remove unused variable root_window.
10904 (Fns_list_colors): Put () around assignment in while statement.
10905 (Fns_perform_service): Remove unused variable len.
10906 (Fns_display_usable_bounds): Remove unused variable top.
10907 (syms_of_nsfns): Remove unused variable i.
10909 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10910 memcpy (Bug#11907).
10912 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10914 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10915 and free it with DestroyExceptionInfo (Bug#11558).
10917 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10919 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10920 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10921 Set here, not in nt/config.nt.
10923 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10925 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10926 cursor overflow into the last glyph on display line when the right
10927 fringe is off. (Bug#11832)
10929 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10931 * xdisp.c (produce_special_glyphs): Now static.
10932 * dispextern.h (produce_special_glyphs): Remove decl.
10934 2012-07-13 Glenn Morris <rgm@gnu.org>
10936 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10937 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10939 * s/usg5-4-common.h (USG, USG5):
10940 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10941 * s/sol2-6.h (SOLARIS2):
10942 * s/irix6-5.h (IRIX6_5):
10943 * s/hpux10-20.h (USG, USG5, HPUX):
10944 * s/gnu-linux.h (USG, GNU_LINUX):
10945 * s/freebsd.h (BSD_SYSTEM):
10946 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10947 * s/cygwin.h (CYGWIN):
10948 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10949 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10951 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10953 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10955 2012-07-13 Glenn Morris <rgm@gnu.org>
10957 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10959 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10961 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10962 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10964 2012-07-12 Glenn Morris <rgm@gnu.org>
10966 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10968 * process.c (init_process_emacs): Rename from init_process.
10969 The old name is also the name of a Mach system call.
10970 * lisp.h, emacs.c: Update for this name change.
10971 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10974 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10976 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10977 memmove call that removes glyphs covered by the left truncation
10978 glyph. Improve commentary.
10979 (display_line): Fix display of continuation glyphs on GUI frames
10980 when the right fringe is turned off and variable-size fonts are
10981 used in the window. Move the code that appends a stretch glyph to
10982 produce_special_glyphs, so that it could be used for truncation
10983 and continuation glyphs alike.
10984 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10985 glyph of a suitably computed width, to align the special glyphs at
10986 the window margin. Code moved from display_line. (Bug#11832)
10988 2012-07-12 Glenn Morris <rgm@gnu.org>
10990 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10992 * s/gnu-linux.h, s/hpux10-20.h:
10993 Do not unconditionally define HAVE_XRMSETDATABASE.
10995 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10997 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10999 Fix typos that broke OS X build.
11000 Reported by Randal L. Schwartz in
11001 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11002 * nsterm.m (ns_timeout): Add missing local decl.
11003 (ns_get_color): snprintf -> sprintf, to fix typo.
11005 2012-07-12 Glenn Morris <rgm@gnu.org>
11007 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11008 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11009 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11010 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11012 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11013 Move PTY_OPEN to configure.
11015 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11016 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11017 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11019 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11021 Use empty_unibyte_string where applicable.
11022 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11023 * lread.c (read1): Likewise.
11024 * xsettings.c (syms_of_xsettings): Likewise.
11026 2012-07-12 Glenn Morris <rgm@gnu.org>
11028 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11029 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11030 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11031 * s/hpux10-20.h (RUN_TIME_REMAP):
11032 * s/bsd-common.h (TABDLY): Move to configure.
11034 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11036 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11038 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11039 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11041 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11043 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11044 * s/template.h: Move NARROWPROTO to configure.
11046 2012-07-11 Glenn Morris <rgm@gnu.org>
11048 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11049 unused since 2011-01-17 change to systty.h.
11051 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11052 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11053 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11055 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11057 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11059 2012-07-11 Glenn Morris <rgm@gnu.org>
11061 * s/darwin.h, s/gnu-linux.h, s/template.h:
11062 Move INTERRUPT_INPUT to configure.
11064 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11066 Minor adjustments to interning code.
11067 * lisp.h (intern, intern_c_string): Redefine as static inline
11068 wrappers for intern_1 and intern_c_string_1, respectively.
11069 (intern_1, intern_c_string_1): Rename prototypes.
11070 * lread.c (intern_1, intern_c_string_1, oblookup):
11071 Simplify Vobarray checking.
11072 * font.c (font_intern_prop): Likewise. Adjust comment.
11073 * w32font.c (intern_font_name): Likewise.
11075 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11077 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11079 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11080 of Fcar/Fcdr if possible.
11081 * font.c (check_otf_features): Likewise.
11082 * fontset.c (Fnew_fontset): Likewise.
11083 * gnutls.c (Fgnutls_boot): Likewise.
11084 * minibuf.c (read_minibuf): Likewise.
11085 * msdos.c (IT_set_frame_parameters): Likewise.
11086 * xmenu.c (Fx_popup_dialog): Likewise.
11087 * w32menu.c (Fx_popup_dialog): Likewise.
11089 2012-07-11 Glenn Morris <rgm@gnu.org>
11091 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11092 since nothing has defined it on these platforms.
11094 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11095 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11097 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11098 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11099 Move CLASH_DETECTION to configure.
11101 * s/gnu.h: Remove file, which is now empty.
11103 * s/gnu.h, s/gnu-linux.h:
11104 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11106 2012-07-11 John Wiegley <johnw@newartisans.com>
11108 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11109 function attribute, so we only use it if it exists in the
11112 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11114 Avoid call to strlen in fast_c_string_match_ignore_case.
11115 * search.c (fast_c_string_match_ignore_case): Change to use
11116 length argument. Adjust users accordingly.
11117 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11119 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11121 Assume mkdir, rmdir.
11122 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11123 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11126 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11129 * s/hpux10-20.h (HAVE_PERROR): Remove.
11130 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11131 Remove dummy definition, as this problem was obsolete long ago.
11134 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11136 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11138 Avoid calls to strlen in font processing functions.
11139 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11140 (font_open_by_name): Change to use length argument.
11141 Adjust users accordingly.
11142 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11144 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11145 Change to return ptrdiff_t.
11146 (xfont_list_pattern, xfont_match): Use length returned by
11147 xfont_decode_coding_xlfd.
11148 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11150 2012-07-11 Glenn Morris <rgm@gnu.org>
11152 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11153 Move DONT_REOPEN_PTY to configure.
11155 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11156 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11158 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11160 Remove "#define unix" that is no longer needed (Bug#11905).
11161 * s/aix4-2.h (unix): Remove; no longer needed.
11163 EMACS_TIME simplification (Bug#11875).
11164 This replaces macros (which typically do not work in GDB)
11165 with functions, typedefs and enums, making the code easier to debug.
11166 The functional style also makes code easier to read and maintain.
11167 * systime.h: Include <sys/time.h> on all hosts, not just if
11168 WINDOWSNT, since 'struct timeval' is needed in general.
11169 (EMACS_TIME): Now a typedef, not a macro.
11170 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11172 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11173 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11174 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11175 (EMACS_TIME_LE): Now functions, not macros.
11176 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11177 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11178 which are not functions. All uses rewritten to use:
11179 (make_emacs_time): New function.
11180 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11181 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11182 not functions. All uses rewritten to use the following, respectively:
11183 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11184 (add_emacs_time, sub_emacs_time): New functions.
11185 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11186 * fileio.c (Fcopy_file):
11187 * xterm.c (XTflash): Get the current time closer to when it's used.
11188 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11190 * bytecode.c (targets): Suppress -Woverride-init warnings.
11192 Simplify by avoiding confusing use of strncpy etc.
11193 * doc.c (Fsnarf_documentation):
11194 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11195 * frame.c (Fmake_terminal_frame):
11196 * gtkutil.c (get_utf8_string):
11198 * nsmenu.m (ns_update_menubar):
11199 * regex.c (regerror):
11200 Prefer memcpy to strncpy and strncat when either will do.
11201 * fileio.c (Fsubstitute_in_file_name):
11202 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11203 (menu_separator_name_p):
11204 * nsmenu.m (ns_update_menubar):
11205 Prefer memcmp to strncmp when either will do.
11206 * nsterm.m: Include <ftoastr.h>.
11208 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11209 Prefer snprintf to strncpy.
11210 * nsterm.m (ns_term_init):
11211 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11212 * nsterm.m (ns_term_init):
11213 Avoid the need for strncpy, by using build_string or
11214 make_unibyte_string directly. Use dtoastr, not snprintf.
11215 * process.c (Fmake_network_process): Diagnose service names that
11216 are too long, rather than silently truncating them or creating
11217 non-null-terminated names.
11218 (Fnetwork_interface_info): Likewise, for interface names.
11219 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11220 Prefer sprintf to strncat.
11221 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11222 Prefer vsnprintf to vsprintf + strncpy.
11224 2012-07-10 Glenn Morris <rgm@gnu.org>
11226 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11227 Clarify fallback case.
11229 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11231 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11232 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11233 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11234 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11235 where argument type is known to be a Lisp_Cons.
11237 2012-07-10 Tom Tromey <tromey@redhat.com>
11239 * bytecode.c (BYTE_CODE_THREADED): New macro.
11240 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11241 (enum byte_code_op): New type.
11242 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11243 (exec_byte_code): Use them. Use token threading when applicable.
11245 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11247 Optimize pure C strings initialization.
11248 * lisp.h (make_pure_string): Fix prototype.
11249 (build_pure_c_string): New function, defined as static inline. This
11250 provides a better opportunity to optimize away calls to strlen when
11251 the function is called with compile-time constant argument.
11252 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11253 argument, adjust users accordingly. Use build_pure_c_string where
11255 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11256 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11257 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11259 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11261 Avoid calls to strlen in miscellaneous functions.
11262 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11263 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11264 * lread.c (openp): Likewise.
11266 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11268 Avoid calls to strlen in path processing functions.
11269 * fileio.c (file_name_as_directory): Add comment. Change to add
11270 srclen argument and return the length of result. Adjust users
11272 (directory_file_name): Fix comment. Change to add srclen argument,
11273 swap 1st and 2nd arguments to obey the common convention.
11274 Adjust users accordingly.
11275 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11277 2012-07-10 Glenn Morris <rgm@gnu.org>
11279 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11280 Move PENDING_OUTPUT_COUNT definition to configure.
11282 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11283 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11284 * s/gnu.h (DATA_START): Move definitions to configure.
11286 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11287 We include usg5-4-common.h, which defines them both.
11289 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11290 O_RDONLY already includes it).
11292 Stop ns builds setting the EMACSLOADPATH environment variable.
11293 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11294 Now it does not set EMACSLOADPATH, just returns the load-path string.
11295 * nsterm.h: Update accordingly.
11296 * lread.c [HAVE_NS]: Include nsterm.h.
11297 (init_lread) [HAVE_NS]: Use ns_load_path.
11298 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11300 2012-07-09 Glenn Morris <rgm@gnu.org>
11302 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11303 since the included bsd-common.h does so.
11305 Stop ns builds setting the EMACSPATH environment variable.
11306 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11307 (ns_init_paths): Do not set EMACSPATH.
11308 * nsterm.h (ns_exec_path): Add it.
11309 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11312 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11314 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11316 * process.c (wait_reading_process_output): 'waitchannels' was unset
11317 when read_kbd || !NILP (wait_for_cell); fix this.
11319 Add GCC-style 'const' attribute to functions that can use it.
11320 * character.h (char_resolve_modifier_mask):
11321 * keyboard.h (make_ctrl_char):
11322 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11323 (init_character_once, next_almost_prime, init_fns, init_image)
11324 (flush_pending_output, init_sound):
11325 * mem-limits.h (start_of_data):
11326 * menu.h (finish_menu_items):
11327 Add ATTRIBUTE_CONST.
11328 * emacs.c (DEFINE_DUMMY_FUNCTION):
11329 Declare the dummy function with ATTRIBUTE_CONST.
11330 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11331 Add decls with ATTRIBUTE_CONST.
11333 Minor improvements to make_formatted_string.
11334 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11335 where int is good enough, as vsprintf returns an int.
11336 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11338 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11340 Use make_formatted_string to avoid double length calculation.
11341 * lisp.h (make_formatted_string): New prototype.
11342 * alloc.c (make_formatted_string): New function.
11343 * buffer.c (Fgenerate_new_buffer_name): Use it.
11344 * dbusbind.c (syms_of_dbusbind): Likewise.
11345 * editfns.c (Fcurrent_time_zone): Likewise.
11346 * filelock.c (get_boot_time): Likewise.
11347 * frame.c (make_terminal_frame, set_term_frame_name)
11348 (x_report_frame_params): Likewise.
11349 * image.c (gs_load): Likewise.
11350 * minibuf.c (get_minibuffer): Likewise.
11351 * msdos.c (dos_set_window_size): Likewise.
11352 * process.c (make_process): Likewise.
11353 * xdisp.c (ensure_echo_area_buffers): Likewise.
11354 * xsettings.c (apply_xft_settings): Likewise.
11356 2012-07-09 Glenn Morris <rgm@gnu.org>
11358 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11359 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11360 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11361 * nsterm.h (ns_etc_directory): Add it.
11362 * callproc.c [HAVE_NS]: Include nsterm.h.
11363 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11365 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11367 Move marker debugging code under MARKER_DEBUG.
11368 * marker.c (MARKER_DEBUG): Move marker debugging code under
11369 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11370 for bootstrap with --enable-checking (~3x slowdown reported
11371 by Juanma Barranquero <lekktu@gmail.com>).
11372 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11374 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11376 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11377 See <http://bugs.gnu.org/11825#29>.
11379 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11381 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11382 has no font, use the frame's font. (Bug#11813)
11383 (display_line): Add commentary about displaying truncation glyphs
11385 (produce_special_glyphs): Move here from term.c.
11387 * term.c (produce_special_glyphs): Move to xdisp.c.
11389 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11392 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11394 * xdisp.c (display_line): Avoid warning about implicit declaration
11397 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11399 * lisp.h: Remove empty conditional.
11401 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11403 * lread.c (load_path_check): Now static.
11405 Fix some minor --with-ns problems found by static checking.
11406 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11407 (x_set_font) [!HAVE_X_WINDOWS]:
11408 * image.c (xpm_load_image) [HAVE_NS]:
11409 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11410 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11411 Remove unused local.
11412 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11413 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11414 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11415 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11416 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11417 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11418 Fix pointer signedness problem.
11419 * xfaces.c (FRAME_X_FONT_TABLE):
11420 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11422 2012-07-07 Glenn Morris <rgm@gnu.org>
11424 * lread.c (load_path_check): New function, split from init_lread.
11425 (init_lread): Reorganize. Motivation:
11426 If EMACSLOADPATH is set, check/warn about that rather than the
11427 defaults, which we are not going to use. Hence we can remove
11428 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11429 Don't warn if site-lisp directories are missing.
11430 If not installed, start from a blank load-path, since
11431 PATH_LOADSEARCH refers to the eventual installation directories.
11433 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11435 Support truncation and continuation glyphs on GUI frames, when
11436 fringes are disabled. (Bug#11832)
11437 * xdisp.c (init_iterator): Get dimensions of truncation and
11438 continuation glyphs even if on GUI frames.
11439 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11440 or both, are absent.
11441 (start_display, move_it_in_display_line_to): Handle the case of a
11442 GUI frame without a fringe to display continuation or truncation
11444 (insert_left_trunc_glyphs): Support GUI frames: make sure
11445 truncation glyphs overwrite enough glyphs from the current line to
11446 have sufficient space in pixels.
11447 (display_line): Support truncation and continuation glyphs on GUI
11448 frames. If some spare pixels are left on the line after inserting
11449 the truncation glyphs, fill that space with a stretch glyph of a
11450 suitably computed width.
11452 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11453 produce_glyphs, to support GUI sessions.
11455 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11457 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11459 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11461 Do not require float-time's arg to fit in time_t (Bug#11825).
11462 This works better on hosts where time_t is unsigned, and where
11463 float-time is applied to the (negative) difference between two times.
11464 * editfns.c (decode_time_components): Last arg is now double *,
11465 not int *, and means to store all the result as a double, without
11466 worrying about whether the seconds part fits in time_t.
11467 All callers changed.
11468 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11469 All callers changed.
11470 (Ffloat_time): Do not fail merely because the specified time falls
11471 outside of time_t range.
11473 2012-07-07 Glenn Morris <rgm@gnu.org>
11475 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11476 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11477 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11479 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11481 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11482 Update dependencies.
11484 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11486 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11488 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11489 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11490 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11491 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11492 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11493 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11495 * xfont.c (compare_font_names): Redo to omit the need for casts.
11497 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11499 * xfns.c (Fx_change_window_property): Doc fix.
11500 * w32fns.c (Fx_change_window_property): Doc fix.
11502 * w32fns.c (Fx_window_property): Accept the same arguments as the
11503 X Windows version. Doc fix.
11504 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11506 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11507 Eli Zaretskii <eliz@gnu.org>
11509 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11510 Windows-specific code from nt/config.nt moved here.
11511 Obsolete settings removed.
11513 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11515 * process.c: Avoid unnecessary calls to gettime.
11516 (wait_reading_process_output): Don't get the time of day
11517 when gobbling data immediately and not waiting, as there's no need
11518 for it in that case. This removes a FIXME.
11520 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11522 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11523 is defined (Bug#11768).
11525 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11527 Fix marker debugging code.
11528 * marker.c (byte_char_debug_check): Do not perform the check
11529 if buffer is not multibyte.
11530 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11531 Call byte_char_debug_check with correct arguments.
11533 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11535 Compile marker debugging code only if ENABLE_CHECKING is defined.
11536 * marker.c (byte_char_debug_check, count_markers):
11537 Use only if ENABLE_CHECKING is defined.
11538 (byte_debug_flag): Remove.
11539 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11540 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11542 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11544 Avoid code repetition in marker-related functions.
11545 * marker.c (attach_marker): New function.
11546 (Fset_marker, set_marker_restricted, set_marker_both)
11547 (set_marker_restricted_both): Use it.
11548 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11549 Consistently rename charno to charpos.
11550 (marker_position): Add eassert.
11551 (marker_byte_position): Convert to eassert.
11553 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11555 Simplify list operations in unchain_overlay and unchain_marker.
11556 * buffer.c (unchain_overlay): Simplify. Add comment.
11557 * marker.c (unchain_marker): Simplify. Fix comments.
11559 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11561 Introduce fast path for the widely used marker operation.
11562 * alloc.c (build_marker): New function.
11563 * lisp.h (build_marker): New prototype.
11564 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11565 * composite.c (autocmp_chars): Likewise.
11566 * editfns.c (buildmark): Remove.
11567 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11568 (save_restriction_save): Use build_marker.
11569 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11570 * window.c (save_window_save): Likewise.
11572 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11574 Do not use Fdelete_overlay in delete_all_overlays
11575 to avoid redundant calls to unchain_overlay.
11576 * buffer.c (drop_overlay): New function.
11577 (delete_all_overlays, Fdelete_overlay): Use it.
11578 * minibuf.c (get_minibuffer): Fix comment.
11580 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11582 Port to OpenBSD 5.1 amd64.
11583 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11584 This is needed for OpenBSD, and should be harmless on all BSD systems.
11585 Also, include <sys/sysctl.h>, as it should be available on all
11586 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11587 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11588 use p_pid member, not kp_proc.pid.
11590 2012-07-06 Glenn Morris <rgm@gnu.org>
11592 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11594 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11596 More xmalloc and related cleanup.
11597 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11598 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11599 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11600 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11601 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11602 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11603 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11604 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11605 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11607 Omit needless casts involving void * pointers and allocation.
11608 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11609 as the former is more robust if P's type is changed.
11610 Prefer xzalloc to xmalloc + memset 0.
11611 Simplify malloc-or-realloc to realloc.
11612 Don't worry about xmalloc returning a null pointer.
11613 Prefer xstrdup to xmalloc + strcpy.
11614 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11616 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11617 alloca of a constant.
11619 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11621 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11622 hscroll is larger than the line width. Fixes long and futile
11623 looping inside extend_face_to_end_of_line (on a TTY) producing
11624 glyphs that are not needed and thrown away.
11626 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11628 * marker.c (set_marker_restricted_both): Simplify by using
11631 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11633 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11635 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11637 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11638 not defined (Bug#11768).
11639 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11640 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11641 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11642 followed by gtk_box_set_homogeneous (Bug#11768).
11643 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11644 (update_theme_scrollbar_width, xg_create_scroll_bar):
11645 Use gtk_scrollbar_new (Bug#11768).
11646 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11647 (is_box_type): New function (Bug#11768).
11648 (xg_tool_item_stale_p): Call is_box_type.
11649 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11650 with default display (Bug#11768).
11652 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11654 * xdisp.c (window_hscroll_limited): New function.
11655 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11656 coordinates when window's hscroll is set to insanely large
11657 values. (Bug#11857)
11659 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11661 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11662 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11664 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11667 * lisp.h (xzalloc): New prototype. Omit needless casts.
11668 * alloc.c (xzalloc): New function. Omit needless casts.
11669 * charset.c: Omit needless casts. Convert all calls to
11670 xmalloc with following memset to xzalloc.
11671 * dispnew.c: Likewise.
11672 * fringe.c: Likewise.
11673 * image.c: Likewise.
11674 * sound.c: Likewise.
11675 * term.c: Likewise.
11676 * w32fns.c: Likewise.
11677 * w32font.c: Likewise.
11678 * w32term.c: Likewise.
11679 * xfaces.c: Likewise.
11680 * xfns.c: Likewise.
11681 * xterm.c: Likewise.
11682 * atimer.c: Omit needless casts.
11683 * buffer.c: Likewise.
11684 * callproc.c: Likewise.
11686 * coding.c: Likewise.
11687 * composite.c: Likewise.
11689 * doprnt.c: Likewise.
11690 * editfns.c: Likewise.
11691 * emacs.c: Likewise.
11692 * eval.c: Likewise.
11693 * filelock.c: Likewise.
11695 * gtkutil.c: Likewise.
11696 * keyboard.c: Likewise.
11697 * lisp.h: Likewise.
11698 * lread.c: Likewise.
11699 * minibuf.c: Likewise.
11700 * msdos.c: Likewise.
11701 * print.c: Likewise.
11702 * process.c: Likewise.
11703 * region-cache.c: Likewise.
11704 * search.c: Likewise.
11705 * sysdep.c: Likewise.
11706 * termcap.c: Likewise.
11707 * terminal.c: Likewise.
11708 * tparam.c: Likewise.
11709 * w16select.c: Likewise.
11711 * w32reg.c: Likewise.
11712 * w32select.c: Likewise.
11713 * w32uniscribe.c: Likewise.
11714 * widget.c: Likewise.
11715 * xdisp.c: Likewise.
11716 * xmenu.c: Likewise.
11717 * xrdb.c: Likewise.
11718 * xselect.c: Likewise.
11720 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11722 * fileio.c (time_error_value): Check the right error number.
11723 Problem reported by Troels Nielsen in
11724 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11726 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11728 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11729 This should be fixed in a better way; see Eli Zaretskii in
11730 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11731 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11733 * fileio.c (time_error_value): Rename from special_mtime.
11734 The old name's problems were noted by Eli Zaretskii in
11735 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11737 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11738 This variable's comment says Emacs needs at least one GDB-visible
11739 symbol of type enum pvec_type, to work around GDB problems.
11740 The symbol's value doesn't matter.
11742 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11743 that causes compilation to fail on pre-C99 compilers.
11745 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11747 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11748 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11750 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11752 * buffer.c (init_buffer_once): Fix initialization of
11753 headers for buffer_defaults and buffer_local_symbols.
11754 Reported by Juanma Barranquero <lekktu@gmail.com>.
11756 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11758 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11759 * lisp.h (enum pvec_type): Use fewer bits.
11760 (PSEUDOVECTOR_SIZE_BITS): New constant.
11761 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11762 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11763 change in pvec_type.
11764 (PSEUDOVECTOR_TYPEP): New macro.
11765 (TYPED_PSEUDOVECTORP): Use it.
11766 * fns.c (internal_equal): Adapt code to extract pvectype.
11767 * emacs.c (gdb_pvec_type): Update type.
11768 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11769 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11770 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11771 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11772 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11773 abusing vector->header.next.nbytes.
11774 (live_vector_p): Use PVEC_TYPE.
11775 (mark_object): Adapt code to extract pvectype. Use switch.
11777 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11779 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11780 Tighten new eassert a bit.
11782 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11784 Fix compilation with --enable-gcc-warnings and -O1
11785 optimization level.
11786 * doprnt.c (doprnt): Change type of tem to int, initialize
11787 to avoid compiler warning. Add eassert.
11788 * search.c (simple_search): Initialize match_byte to avoid
11789 compiler warning. Add eassert.
11791 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11793 Avoid weird behavior with large horizontal scrolls.
11794 Without this change, for example, large hscroll values would
11795 mess up Emacs's display on Fedora 15 x86, presumably due to
11796 overflows in int calculations in the display code.
11797 Also, if buffers had long lines, Emacs would freeze.
11798 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11799 (set_window_hscroll): New function, containing the old guts of
11800 Fset_window_hscroll. Return the clipped value.
11801 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11802 This avoids the need to check against PTRDIFF_MAX.
11804 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11806 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11808 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11810 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11812 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11813 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11814 since GCC 4.4.6 issues a bogus warning for them.
11816 Fix bugs in file timestamp newness comparisons.
11817 * fileio.c (Ffile_newer_than_file_p):
11818 * lread.c (Fload): Use full timestamp resolution of files,
11819 not just the 1-second resolution, so that files that are only
11820 slightly newer still count as newer.
11821 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11822 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11824 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11826 * fileio.c: Improve handling of file time marker. (Bug#11852)
11827 (special_mtime): New function.
11828 (Finsert_file_contents, Fverify_visited_file_modtime):
11829 Use it to set special mtime values consistently.
11831 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11833 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11834 marker for non-existing file. (Bug#11852)
11836 2012-07-03 Glenn Morris <rgm@gnu.org>
11838 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11839 and did not make it into globals.h).
11841 2012-07-03 Tom Tromey <tromey@redhat.com>
11843 * window.c (Fset_window_margins, Fset_window_fringes)
11844 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11845 * textprop.c (Fprevious_property_change): No longer static.
11846 * syntax.c (Fsyntax_table_p): No longer static.
11847 * process.c (Fget_process, Fprocess_datagram_address): No longer
11849 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11850 * keyboard.c (Fcommand_execute): No longer static.
11852 * insdel.c (Fcombine_after_change_execute): No longer static.
11853 * image.c (Finit_image_library): No longer static.
11854 * fileio.c (Fmake_symbolic_link): No longer static.
11855 * eval.c (Ffetch_bytecode): No longer static.
11856 * editfns.c (Fuser_full_name): No longer static.
11857 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11859 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11861 * dired.c (Ffile_attributes): No longer static.
11862 * composite.c (Fcomposition_get_gstring): No longer static.
11863 * callproc.c (Fgetenv_internal): No longer static.
11865 * ccl.h: Remove EXFUNs.
11866 * buffer.h: Remove EXFUNs.
11867 * dispextern.h: Remove EXFUNs.
11868 * intervals.h: Remove EXFUNs.
11869 * fontset.h: Remove EXFUN.
11870 * font.h: Remove EXFUNs.
11871 * dosfns.c (system_process_attributes): Remove EXFUN.
11872 * keymap.h: Remove EXFUNs.
11873 * lisp.h: Remove EXFUNs.
11874 * w32term.h: Remove EXFUNs.
11875 * window.h: Remove EXFUNs.
11876 * xsettings.h: Remove EXFUN.
11877 * xterm.h: Remove EXFUN.
11879 2012-07-03 Glenn Morris <rgm@gnu.org>
11881 * lisp.h (Frandom): Make it visible to C.
11882 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11883 buffer for invisible buffers. (Bug#1229)
11885 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11887 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11888 values which aren't power of 2.
11889 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11890 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11893 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11895 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11897 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11899 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11901 * alloc.c (allocate_vector_block): Remove redundant
11902 calls to mallopt if DOUG_LEA_MALLOC is defined.
11903 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11904 avoid calls to mallopt if zero_vector is returned.
11906 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11908 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11909 is enabled, avoid dereferencing NULL current_sblock if
11912 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11914 Cleanup basic buffer management.
11915 * buffer.h (struct buffer): Change layout to use generic vector
11916 marking code. Fix some comments. Change type of 'clip_changed'
11917 to bitfield. Remove unused #ifndef old.
11918 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11919 (GET_OVERLAYS_AT): Fix indentation.
11920 (for_each_per_buffer_object_at): New macro.
11921 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11922 (Fbuffer_local_variables): Use it.
11923 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11924 * alloc.c (allocate_buffer): Adjust to match new layout of
11925 struct buffer. Fix comment.
11926 (mark_overlay): New function.
11927 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11928 Lisp area of struct buffer.
11929 (mark_object): Use it. Adjust marking of misc objects
11930 and related comments.
11932 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11934 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11935 wrapper that is not needed because the wrapped code is a no-op (zero
11936 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11937 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11939 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11941 * alloc.c (mark_buffer): Simplify. Remove prototype.
11942 (mark_object): Add comment. Reorganize marking of vector-like
11943 objects. Use CHECK_LIVE for all vector-like objects except buffers
11944 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11945 Avoid redundant calls to mark_vectorlike for bool vectors.
11947 2012-06-30 Glenn Morris <rgm@gnu.org>
11949 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11951 * epaths.in (PATH_SITELOADSEARCH): New.
11952 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11953 This is rather than relying on --enable-locallisppath elements
11954 having "site-lisp" in their names. (Bug#10208#25, 11658)
11956 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11958 * w32proc.c (sys_select): Accept and ignore one more argument.
11960 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11962 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11963 (pselect) [!MS_DOS]: Redirect to sys_select.
11965 * sysdep.c: Don't include dos.h and dosfns.h.
11967 * process.c (sys_select):
11968 * msdos.c (sys_select): Accept one more argument and ignore it.
11970 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11971 adapt data types and code to that.
11974 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11975 which clashes with the gnulib function of the same name.
11977 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11979 * font.c (font_style_to_value, font_style_symbolic)
11980 (font_prop_validate_style): Add type checks for values in
11983 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11985 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11988 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11990 * xdisp.c (try_window_id): Undo last change.
11992 * w32.c (getwd): Adjust commentary about startup_dir.
11993 (init_environment): Always call sys_access, even in non-MSVC
11994 builds. Don't chdir to the directory of the Emacs executable.
11995 This undoes code from 1997 which was justified by the need to
11996 "avoid conflicts when removing and renaming directories". But its
11997 downside was that every relative file name was being interpreted
11998 relative to the directory of the Emacs executable, which can never
11999 be TRT. In particular, it broke sys_access when called with
12000 relative file names.
12001 (sys_access): Map GetLastError to errno.
12003 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12005 * window.h (struct window): Change type of 'fringes_outside_margins'
12006 to bitfield. Fix comment. Adjust users accordingly.
12007 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12009 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12012 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12014 * gnutls.c (emacs_gnutls_handshake):
12015 Add QUIT to make the loop interruptible.
12017 2012-06-29 Glenn Morris <rgm@gnu.org>
12019 * charset.c (init_charset): Make lack of etc/charsets fatal.
12021 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12023 * editfns.c (region_limit): Fix type mismatch.
12025 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12027 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12028 undefined. Convert from xassert to eassert.
12029 * nsmenu.m: Convert from xassert to eassert.
12030 * nsterm.m: Likewise.
12032 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12034 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12036 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12038 Avoid integer overflow on scroll-left and scroll-right.
12039 * window.c (HSCROLL_MAX): New macro.
12040 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12041 overflow when requested scroll falls outside ptrdiff_t range.
12043 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12045 * window.h (struct window): Change type of 'hscroll',
12046 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12047 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12048 Adjust users accordingly.
12049 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12050 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12051 from EMACS_INT to ptrdiff_t.
12052 (make_window): Omit redundant initialization.
12054 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
12056 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12058 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12060 * window.h (struct window): Change type of 'use_time' and
12061 'sequence_number' from Lisp_Object to int.
12062 * frame.c (make_frame): Adjust users accordingly.
12063 * print.c (print_object): Likewise.
12064 * window.c (select_window, Fwindow_use_time, make_parent_window)
12065 (make_window): Likewise.
12067 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12069 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12070 enabled with --enable-checking=[all,glyphs] configure option.
12071 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12072 adjust comments accordingly.
12073 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12074 undefined, adjust comments accordingly.
12075 * image.c: Likewise.
12076 * scroll.c: Likewise.
12077 * w32fns.c: Likewise.
12078 * w32term.c: Likewise.
12079 * xdisp.c: Likewise.
12080 * xfaces.c: Likewise.
12081 * xfns.c: Likewise.
12082 * xterm.c: Likewise.
12084 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12086 Generalize run-time debugging checks.
12087 * dispextern.h (XASSERTS): Remove.
12088 * fontset.c (xassert): Remove.
12089 Convert from xassert to eassert.
12090 * alloc.c: Convert from xassert to eassert.
12091 * bidi.c: Likewise.
12092 * dispnew.c: Likewise.
12094 * fringe.c: Likewise.
12095 * ftfont.c: Likewise.
12096 * gtkutil.c: Likewise.
12097 * image.c: Likewise.
12098 * keyboard.c: Likewise.
12099 * menu.c: Likewise.
12100 * process.c: Likewise.
12101 * scroll.c: Likewise.
12102 * sound.c: Likewise.
12103 * term.c: Likewise.
12104 * w32console.c: Likewise.
12105 * w32fns.c: Likewise.
12106 * w32term.c: Likewise.
12107 * window.c: Likewise.
12108 * xdisp.c: Likewise.
12109 * xfaces.c: Likewise.
12110 * xfns.c: Likewise.
12111 * xselect.c: Likewise.
12112 * xterm.c: Likewise.
12114 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12116 * fns.c (maybe_resize_hash_table): Output message when growing the
12119 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12121 * alloc.c (allocate_string_data): Remove dead code.
12122 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12123 avoid GCC warning about unused macro.
12125 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12127 * alloc.c (allocate_string): Omit intervals initialization.
12128 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12129 as in make_pure_string and make_pure_c_string.
12131 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12133 * alloc.c (allocate_string): Fix last change.
12135 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12137 * alloc.c (allocate_string): Remove two redundant calls
12138 to memset, add explicit initialization where appropriate.
12140 2012-06-27 Glenn Morris <rgm@gnu.org>
12142 * lisp.mk (lisp): Remove paths.elc.
12144 2012-06-27 Chong Yidong <cyd@gnu.org>
12146 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12148 2012-06-26 John Wiegley <johnw@newartisans.com>
12150 * unexmacosx.c (copy_data_segment): Add two section names used
12151 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12153 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12154 when building with Clang.
12156 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12158 * eval.c (Fapply): Allow calling it with a single argument.
12160 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12162 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12163 _stricmp and _strnicmp.
12164 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12166 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12168 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12170 (allocate_process): Likewise for new process.
12171 (allocate_terminal): Change to use offsetof.
12172 (allocate_frame): Likewise.
12173 * frame.c (make_frame): Omit redundant initialization.
12174 * window.c (make_parent_window): Use memset.
12175 (make_window): Omit redundant initialization.
12176 * process.c (make_process): Omit redundant initialization.
12177 * terminal.c (create_terminal): Likewise.
12179 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12181 * term.c (delete_tty): Remove redundant call to memset.
12183 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12185 * alloc.c: Remove build_string.
12186 * lisp.h: Define build_string as static inline. This provides
12187 a better opportunity to optimize away calls to strlen when the
12188 function is called with compile-time constant argument.
12189 * image.c (imagemagick_error): Convert to build_string.
12190 * w32proc.c (sys_spawnve): Likewise.
12191 * xterm.c (x_term_init): Likewise.
12193 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12195 Use sprintf return value instead of invoking strlen on result.
12196 In the old days this wasn't portable, since some sprintf
12197 implementations returned char *. But they died out years ago and
12198 Emacs already assumes sprintf returns int.
12199 Similarly for float_to_string.
12200 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12201 * ccl.c (ccl_driver):
12202 * character.c (string_escape_byte8):
12203 * data.c (Fnumber_to_string):
12204 * doprnt.c (doprnt):
12205 * print.c (print_object):
12206 * xdisp.c (message_dolog):
12207 * xfns.c (syms_of_xfns):
12208 Use sprintf or float_to_string result to avoid need to call strlen.
12209 * data.c (Fnumber_to_string):
12210 Use make_unibyte_string, since the string must be ASCII.
12211 * lisp.h, print.c (float_to_string): Now returns int length.
12212 * term.c (produce_glyphless_glyph):
12213 Use sprintf result rather than recomputing it.
12215 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12216 * Makefile.in (ALL_CFLAGS):
12217 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12218 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12220 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12222 * dispextern.h (xstrcasecmp): Define to library function
12223 strcasecmp if available.
12224 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12226 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12228 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12229 Avoid comma operator.
12230 * menu.c (push_submenu_start, push_submenu_end)
12231 (push_left_right_boundary, push_menu_pane): Likewise.
12232 * msdos.c (dos_rawgetc): Likewise.
12234 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12236 * xfns.c (xic_create_fontsetname): Remove redundant calls
12239 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12241 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12242 sprintf already null-terminates its output.
12244 * xfns.c (x_window): Remove redundant cast.
12246 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12248 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12249 `const char *' to `char *' to avoid compiler warning.
12251 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12253 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12254 instead of truncating it to 63 (admittedly a generous limit).
12256 * process.c: Fix spelling and caps in comments.
12258 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12260 * emacs.c (setpgrp): Remove definition, unused.
12261 * sysdep.c (setpgrp): Remove definition, not used in this file.
12263 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12265 * makefile.w32-in: Update dependencies.
12267 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12269 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12270 (SYSTIME_H): Add nt/inc/sys/time.h.
12272 * systime.h [WINDOWSNT]: Include sys/time.h.
12274 * s/ms-w32.h (struct timespec): Definition moved from
12275 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12277 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12279 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12280 * buffer.h (buffer_slot_type_mismatch):
12281 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12282 * eval.c (unwind_to_catch):
12283 * image.c (my_png_error, my_error_exit):
12284 * keyboard.c (quit_throw_to_read_char, user_error)
12285 (Fexit_recursive_edit, Fabort_recursive_edit):
12286 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12287 (wrong_type_argument, buffer_overflow, __executable_start)
12288 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12289 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12290 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12292 (child_setup) [!DOS_NT]:
12293 * lread.c (end_of_file_error, invalid_syntax):
12294 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12295 * puresize.h (pure_write_error):
12296 * search.c (matcher_overflow):
12297 * sound.c (sound_perror, alsa_sound_perror):
12298 * sysdep.c, syssignal.h (croak):
12299 * term.c (maybe_fatal, vfatal):
12300 * textprop.c (text_read_only):
12301 * undo.c (user_error):
12302 * unexmacosx.c (unexec_error):
12303 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12304 Use _Noreturn rather than NO_RETURN.
12305 No need for separate decl merely because of _Noreturn.
12306 * sound.c (sound_warning, parse_sound):
12307 Remove unnecessary forward decls.
12309 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12311 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12312 * lisp.h (WAIT_READING_MAX): New macro.
12313 * dispnew.c (Fsleep_for, sit_for):
12314 * keyboard.c (kbd_buffer_get_event):
12315 * process.c (Faccept_process_output):
12316 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12317 This improves on the previous patch, which introduced a bug
12318 when time_t is unsigned and as wide as intmax_t.
12319 See <http://bugs.gnu.org/9000#51>.
12321 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12323 * dispnew.c (sit_for, Fsleep_for):
12324 * keyboard.c (kbd_buffer_get_event):
12325 * process.c (Faccept_process_output): Avoid compiler warnings when
12326 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12328 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12330 * makefile.w32-in: Update dependencies.
12332 * w32.c (ltime): Add return type and declare static.
12333 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12335 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12337 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12338 Privately reported by Herbert J. Skuhra.
12339 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12341 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12342 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12344 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12346 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12347 last argument of make_unibyte_string.
12349 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12350 language ID in the event parameters.
12352 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12353 event.code, not the obscure "character set ID".
12355 2012-06-23 Chong Yidong <cyd@gnu.org>
12357 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12359 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12361 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12362 * w32.c (fdutimens): New function.
12364 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12366 * s/ms-w32.h (pselect): Redirect to sys_select.
12368 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12370 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12371 in the logic of incrementing and decrementing the value of
12372 use_relocatable_buffers.
12374 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12376 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12377 Privately reported by Herbert J. Skuhra.
12378 [__FreeBSD__]: Remove "*/" typo after "#include".
12379 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12380 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12381 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12382 Don't assume EMACS_TIME and struct timeval are the same type.
12384 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12386 Support higher-resolution time stamps (Bug#9000).
12387 The time stamps are only nanosecond-resolution at the C level,
12388 since that's the best that any real-world system supports now.
12389 But they are picosecond-resolution at the Lisp level, as that's
12390 easy, and leaves room for future OS improvements.
12392 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12395 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12396 Don't get current time unless it's needed.
12398 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12399 now provides it if it's absent.
12400 (start_atimer): Port to higher-res time stamps.
12401 Check for time stamp overflow. Don't get current time more
12402 often than is needed.
12404 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12405 Include systime.h, not time.h.
12406 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12408 * dired.c: Include stat-time.h.
12409 (Ffile-attributes): File times now have higher resolution.
12411 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12412 (struct image): Timestamp now has higher resolution.
12414 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12415 has at least microseconds now. All uses removed.
12416 (update_frame, update_single_window, update_window, update_frame_1)
12417 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12418 (duration_to_sec_usec): Remove; no longer needed.
12420 * editfns.c (time_overflow): Now extern.
12421 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12422 (float-time, Fformat_time_string, Fcurrent_time_string)
12423 (Fcurrent_time_zone): Accept and generate higher-resolution
12425 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12426 (decode_time_components, lisp_seconds_argument): New functions.
12427 (make_time): Now static.
12428 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12429 Report an error if the time is invalid, rather than having the caller
12432 * fileio.c: Include <stat-time.h>
12433 (Fcopy_file): Copy higher-resolution time stamps.
12434 Prefer to set the time stamp via a file descriptor if that works.
12435 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12436 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12437 (Fvisited_file_modtime, Fset_visited_file_modtime):
12438 Support higher-resolution time stamps.
12440 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12442 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12444 * image.c (prepare_image_for_display, clear_image_cache)
12445 (lookup_image): Port to higer-resolution time stamps.
12447 * keyboard.c (start_polling, bind_polling_period):
12448 Check for time stamp overflow.
12449 (read_char, kbd_buffer_get_event, timer_start_idle)
12450 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12451 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12452 Port to higher-resolution time stamps. Do not assume time_t is signed.
12453 (decode_timer): New function. Timers are now vectors of length 9,
12454 not 8, to accommodate the picosecond component.
12455 (timer_check_2): Use it.
12457 * nsterm.m (select_timeout, timeval_subtract): Remove.
12458 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12459 as they're a bit more accurate and handle overflow better.
12460 (ns_select): Change prototype to be compatible with pselect.
12461 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12462 * nsterm.h (ns_select): Adjust prototype.
12464 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12465 us-resolution time stamps.
12466 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12468 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12470 * lisp.h (time_overflow): New decl.
12471 (wait_reading_process_output): First arg is now intmax_t, not int,
12472 to accommodate larger waits.
12474 * process.h (struct Lisp_Process.read_output_delay):
12475 Now counts nanoseconds, not microseconds.
12476 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12478 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12479 (wait_reading_process_output):
12480 Port to ns-resolution time stamps.
12481 (Faccept_process_output, wait_reading_process_output):
12482 Check for time stamp overflow. Do not assume time_t is signed.
12483 (select_wrapper): Remove; we now use pselect.
12484 (Fprocess_attributes): Now generates ns-resolution time stamps.
12486 * sysdep.c: Include utimens.h. Don't include utime.h
12487 or worry about struct utimbuf; gnulib does that for us now.
12488 (gettimeofday): Remove; gnulib provides a substitute.
12489 (make_timeval): New function.
12490 (set_file_times): Now sets ns-resolution time stamps.
12491 New arg FD; all uses changed.
12492 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12493 (system_process_attributes):
12494 Now returns ns-resolution time stamp. All uses changed.
12495 Check for time stamp overflow.
12497 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12498 provides a substitute now.
12500 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12501 since it guarantees struct timespec.
12502 (EMACS_TIME): Now struct timespec, so that we can support
12503 ns-resolution time stamps.
12504 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12505 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12506 (EMACS_USECS): Remove.
12507 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12508 so multiply the arg by 1000 before storing it.
12509 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12511 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12512 Port to ns-resolution time stamps.
12513 (EMACS_TIME_NEG_P): Remove; replaced by....
12514 (EMACS_TIME_SIGN): New macro.
12515 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12516 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12517 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12518 (make_timeval, make_lisp_time, decode_time_components): New decls.
12519 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12520 that it mishandled time_t overflow. You can't compare by subtracting!
12521 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12522 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12524 * term.c: Include <sys/time.h>.
12525 (timeval_to_Time): New function, for proper overflow wraparound.
12526 (term_mouse_position, term_mouse_click): Use it.
12528 * undo.c (record_first_change): Support higher-resolution time stamps
12529 in the undo buffer.
12530 (Fprimitive_undo): Use them when restoring time stamps.
12532 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12533 (w32_get_internal_run_time):
12534 Port to higher-resolution Emacs time stamps.
12535 (ltime): Now accepts single 64-bit integer, as that's more convenient
12538 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12540 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12541 for compatibility with pselect. Support ns-resolution time stamps.
12543 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12545 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12546 Check for time stamp overflow, and support ns-resolution time stamps.
12548 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12549 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12550 (timeval_subtract): Remove; no longer needed.
12551 (XTflash, XTring_bell, x_wait_for_event):
12552 Port to ns-resolution time stamps. Don't assume time_t is signed.
12554 2012-06-22 Chong Yidong <cyd@gnu.org>
12556 * xdisp.c (x_consider_frame_title): Revert last change.
12558 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12560 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12561 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12562 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12563 staticidx goes up to 1597 out of 1600 = 0x640.)
12565 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12567 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12568 Otherwise, the umask might be mistakenly 0 while handling input signals.
12570 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12572 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12574 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12576 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12577 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12578 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12579 access to `contents' member of Lisp_Vector objects with AREF and ASET
12582 2012-06-19 Chong Yidong <cyd@gnu.org>
12584 * frame.c (delete_frame): When selecting a frame on a different
12585 text terminal, do not alter the terminal's top-frame.
12587 * xdisp.c (format_mode_line_unwind_data): Record the target
12588 frame's selected window and its terminal's top-frame.
12589 (unwind_format_mode_line): Restore them.
12590 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12592 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12593 since tty frames can be explicitly named.
12594 (prepare_menu_bars): Likewise.
12596 * term.c (Ftty_top_frame): New function.
12598 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12600 Port byte-code-meter to modern targets.
12601 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12602 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12603 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12604 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12605 (METER_1, METER_2): Simplify.
12607 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12609 * data.c (Fdefalias): Return `symbol' (bug#11686).
12611 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12613 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12614 gets killed during executing of this function (Bug#11665).
12615 Try to always return Qt when the buffer has been actually killed.
12616 (Vkill_buffer_query_functions): In doc-string say that functions
12617 run by this hook should not change the current buffer.
12619 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12621 Fix recently-introduced process.c problems found by static checking.
12622 * process.c (write_queue_push, write_queue_pop, send_process):
12623 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12624 (write_queue_pop): Fix pointer signedness problem.
12625 (send_process): Remove unused local.
12627 2012-06-17 Chong Yidong <cyd@gnu.org>
12629 * xdisp.c (redisplay_internal): No need to redisplay terminal
12630 frames that are not on top.
12632 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12634 * process.c (make_process): Initialize write_queue.
12635 (write_queue_push, write_queue_pop): New functions.
12636 (send_process): Use them to maintain correct ordering of process
12637 writes (Bug#10815).
12639 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12641 * lisp.h (eassert): Assume C89 or later.
12642 This removes the need for CHECK.
12643 (CHECK): Remove. Its comments about always evaluating its
12644 argument were confusing, as 'eassert' typically does not evaluate
12647 * coding.c (produce_chars): Use ptrdiff_t, not int.
12649 * xterm.c (x_draw_underwave): Check for integer overflow.
12650 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12652 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12654 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12655 referenced (Bug#11583).
12657 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12659 Implement wave-style variant of underlining.
12660 * dispextern.h (face_underline_type): New enum.
12661 (face): Add field for underline type.
12662 * nsterm.m (ns_draw_underwave): New function.
12663 (ns_draw_text_decoration): Use it.
12664 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12666 (x_draw_glyph_string): Use them.
12667 * xfaces.c (Qline, Qwave): New Lisp objects.
12668 (check_lface_attrs, merge_face_ref)
12669 (Finternal_set_lisp_face_attribute, realize_x_face):
12670 Handle wave-style underline face attributes.
12671 * xterm.c (x_draw_underwave): New function.
12672 (x_draw_glyph_string): Use it.
12674 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12676 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12677 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12678 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12679 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12680 ($(BLD)/w32select.$(O)): Update dependencies.
12682 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12684 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12685 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12686 * character.c (_fetch_multibyte_char_p): Remove.
12687 * alloc.c: Include "character.h" before "buffer.h".
12688 * bidi.c: Likewise.
12689 * buffer.c: Likewise.
12690 * bytecode.c: Likewise.
12691 * callint.c: Likewise.
12692 * callproc.c: Likewise.
12693 * casefiddle.c: Likewise.
12694 * casetab.c: Likewise.
12695 * category.c: Likewise.
12696 * cmds.c: Likewise.
12697 * coding.c: Likewise.
12698 * composite.c: Likewise.
12699 * dired.c: Likewise.
12700 * dispnew.c: Likewise.
12702 * dosfns.c: Likewise.
12703 * editfns.c: Likewise.
12704 * emacs.c: Likewise.
12705 * fileio.c: Likewise.
12706 * filelock.c: Likewise.
12707 * font.c: Likewise.
12708 * fontset.c: Likewise.
12709 * fringe.c: Likewise.
12710 * indent.c: Likewise.
12711 * insdel.c: Likewise.
12712 * intervals.c: Likewise.
12713 * keyboard.c: Likewise.
12714 * keymap.c: Likewise.
12715 * lread.c: Likewise.
12716 * macros.c: Likewise.
12717 * marker.c: Likewise.
12718 * minibuf.c: Likewise.
12719 * nsfns.m: Likewise.
12720 * nsmenu.m: Likewise.
12721 * print.c: Likewise.
12722 * process.c: Likewise.
12723 * regex.c: Likewise.
12724 * region-cache.c: Likewise.
12725 * search.c: Likewise.
12726 * syntax.c: Likewise.
12727 * term.c: Likewise.
12728 * textprop.c: Likewise.
12729 * undo.c: Likewise.
12730 * unexsol.c: Likewise.
12731 * w16select.c: Likewise.
12732 * w32fns.c: Likewise.
12733 * w32menu.c: Likewise.
12734 * window.c: Likewise.
12735 * xdisp.c: Likewise.
12736 * xfns.c: Likewise.
12737 * xmenu.c: Likewise.
12739 * xselect.c: Likewise.
12741 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12743 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12744 If all the glyphs of the glyph row came from strings, and we have no
12745 cursor positioning clues, put the cursor on the first glyph of the
12747 (handle_face_prop): Use chunk-relative overlay string index when
12748 indexing into it->string_overlays array. (Bug#11653)
12749 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12750 the rightmost. (Bug#11720)
12752 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12754 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12755 (CATEGORY_MEMBER): Enforce 1/0 value.
12756 * category.c (_temp_category_set): Remove.
12758 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12760 * window.c (Fdelete_other_windows_internal)
12761 (Fdelete_window_internal): Don't access frame's mouse highlight
12762 info of the initial frame. (Bug#11677)
12764 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12766 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12767 Assume USE_2_TAGS_FOR_INTS.
12768 (xreload): Adjust $tagmask width to match recent lisp.h change.
12770 Simplify lisp.h in minor ways that should not affect code.
12771 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12772 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12773 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12774 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12775 (INTTYPEBITS): New macro, for clarity.
12776 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12777 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12778 Simplify now that USE_LSB_TAG is always defined.
12779 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12780 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12782 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12784 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12786 2012-06-13 Glenn Morris <rgm@gnu.org>
12788 * s/bsd-common.h (BSD4_3):
12789 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12791 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12793 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12795 (XLI, XIL): Define.
12796 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12798 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12799 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12800 * alloc.c (widen_to_Lisp_Object): Remove.
12801 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12802 * frame.c (delete_frame): Remove outdated comment.
12803 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12804 USE_LISP_UNION_TYPE.
12805 (Fw32_unregister_hot_key): Likewise.
12806 (Fw32_toggle_lock_key): Likewise.
12807 * w32menu.c (add_menu_item): Likewise.
12808 (w32_menu_display_help): Use XIL instead of checking
12809 USE_LISP_UNION_TYPE.
12810 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12811 (init_heap): Likewise.
12812 * w32term.c (w32_read_socket): Update comment.
12814 2012-06-13 Glenn Morris <rgm@gnu.org>
12816 * s/usg5-4-common.h, src/s/unixware.h:
12817 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12819 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12821 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12823 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12824 * alloc.c (make_number) [!defined make_number]:
12825 Remove, as lisp.h always defines this now.
12826 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12827 (roundup_size): Verify that it is a power of 2.
12828 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12829 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12830 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12831 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12832 USE_LSB_TAG now is always defined to be either 0 or 1.
12834 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12835 code works fine either way, and efficiency is not a concern here,
12836 as the union type is for debugging, not for production.
12837 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12838 Use an inline function on all platforms when using the union type,
12839 since this is simpler and 'static inline' can be used portably
12841 (LISP_INITIALLY_ZERO): New macro.
12842 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12843 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12845 2012-06-12 Glenn Morris <rgm@gnu.org>
12847 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12849 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12851 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12852 Move BROKEN_SIGIO to configure.
12854 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12855 Move NO_TERMIO to configure.
12857 2012-06-12 Chong Yidong <cyd@gnu.org>
12859 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12860 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12861 MagickExportImagePixels is undefined.
12863 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12865 * image.c (imagemagick_load_image): Remove unused label.
12867 2012-06-11 Glenn Morris <rgm@gnu.org>
12869 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12870 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12871 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12872 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12874 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12876 * alloc.c (make_byte_code): New function.
12877 (Fmake_byte_code): Use it. Don't purify here.
12878 * lread.c (read1): Use it as well to avoid extra allocation.
12880 2012-06-11 Chong Yidong <cyd@gnu.org>
12882 * image.c (imagemagick_load_image): Implement transparency.
12884 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12886 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12887 account for preceding backslashes. (Bug#11663)
12889 2012-06-09 Chong Yidong <cyd@gnu.org>
12891 * term.c: Support italics in capable terminals (Bug#9652).
12892 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12893 (turn_on_face): Output using TS_enter_italic_mode if available.
12894 Don't handle unused blinking and alt-charset cases.
12895 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12896 and tty_alt_charset_p cases.
12897 (tty_capable_p, init_tty): Support italics.
12899 * termchar.h (struct tty_display_info): Add field for italics.
12900 Remove unused blink field.
12902 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12905 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12906 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12907 tty_alt_charset_p. Add tty_italic_p.
12909 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12911 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12912 dbus_type_is_basic if available.
12913 (xd_extract_signed, xd_extract_unsigned): Rename from
12914 extract_signed and extract_unsigned, respectively. Adapt callers.
12916 2012-06-09 Chong Yidong <cyd@gnu.org>
12918 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12920 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12923 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12925 * xdisp.c (vmessage): Treat frame message as multibyte.
12926 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12927 would generate the diagnostic "Making \302\247 buffer-local while
12930 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12932 * dispnew.c (showing_window_margins_p): Undo last change, which
12933 was done due to an inadvertent commit.
12934 (adjust_frame_glyphs_for_frame_redisplay): Do call
12935 showing_window_margins_p.
12937 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12939 * eval.c (Fmake_var_non_special): New primitive.
12940 (syms_of_eval): Defsubr it.
12941 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12943 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12945 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12946 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12948 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12950 * alloc.c (allocate_vectorlike): Fix last change.
12952 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12954 Block-based vector allocation of small vectors.
12955 * lisp.h (struct vectorlike_header): New field `nbytes',
12956 adjust comment accordingly.
12957 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12958 to denote vector blocks. Adjust users (live_vector_p,
12959 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12960 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12961 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12962 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12963 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12964 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12965 (roundup_size): New constant.
12966 (struct vector_block): New data type.
12967 (vector_blocks, vector_free_lists, zero_vector): New variables.
12968 (all_vectors): Rename to `large_vectors'.
12969 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12970 (sweep_vectors): New functions.
12971 (allocate_vectorlike): Return `zero_vector' as the only vector of
12972 0 items. Allocate new vector from block if vector size is less than
12973 or equal to VBLOCK_BYTES_MAX.
12974 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12975 (init_alloc_once): Add call to init_vectors.
12977 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12979 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12981 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12983 * doprnt.c (doprnt): Truncate multibyte char correctly.
12984 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12985 would mishandle a string argument "Xc" if X was a multibyte
12986 character of length 2: it would truncate after X's first byte
12987 rather than including all of X.
12989 2012-06-06 Chong Yidong <cyd@gnu.org>
12991 * buffer.c (word_wrap): Doc fix.
12993 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12995 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12997 2012-06-03 Glenn Morris <rgm@gnu.org>
12999 * xdisp.c (tool-bar-style): Doc fix.
13001 2012-06-03 Ulrich Müller <ulm@gentoo.org>
13003 * Makefile.in (PAXCTL): Define.
13004 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13005 binary via PaX flags if the paxctl utility is available.
13006 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13007 Restore PaX flags to their default. (Bug#11398)
13009 2012-06-03 Chong Yidong <cyd@gnu.org>
13011 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13012 buffer (Bug#11226).
13014 2012-06-03 Chong Yidong <cyd@gnu.org>
13016 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13017 (note_mode_line_or_margin_highlight): If there is no help echo,
13018 use mode-line-default-help-echo. Handle the case where the mouse
13019 position is past the end of the mode line string.
13021 * buffer.c (buffer_local_value_1): New function, split from
13022 Fbuffer_local_value; can return Qunbound.
13023 (Fbuffer_local_value): Use it.
13024 (Vmode_line_format): Docstring tweaks.
13026 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13028 * sysdep.c (system_process_attributes): Improve comment.
13030 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13032 * keyboard.c: Export real-this-command to Elisp.
13033 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13034 and DEFVAR it. Update all users.
13036 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13038 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13040 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13041 Convert pctcpu and pctmem to Lisp float properly.
13042 Let the compiler fold better, as 100.0/0x8000 is exact.
13044 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13046 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13049 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13051 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13053 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13055 For a 'struct window', replace some Lisp_Object fields to
13056 bitfields where appropriate, remove unused fields.
13057 * window.h (struct window): Remove unused 'last_mark_x' and
13058 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13059 change its type from Lisp_Object to bitfield.
13060 Change type of 'force_start', 'optional_new_start',
13061 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13062 fields from Lisp_Object to bitfield. Adjust users accordingly.
13064 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13066 Pacify gcc -Wdouble-precision when using Xaw.
13067 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13068 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13069 Use 'float' consistently, rather than 'float' in most places
13070 and 'double' in a couple of places.
13072 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13074 * xdisp.c (handle_stop): Detect whether we have overlay strings
13075 loaded by testing it->current.overlay_string_index to be
13076 non-negative, instead of checking whether n_overlay_strings is
13077 positive. (Bug#11587)
13079 2012-05-31 Chong Yidong <cyd@gnu.org>
13081 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13083 * doc.c (Fsubstitute_command_keys): Doc fix.
13085 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13087 * search.c (search_buffer): Remove calls to
13088 r_alloc_inhibit_buffer_relocation, as it is now called by
13089 maybe_unify_char, which was the cause of relocation of buffer text
13092 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13094 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13095 for the duration of call to load_charset, to avoid problems with
13096 callers of maybe_unify_char that access buffer text through C
13099 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13100 decrement the inhibition flag, instead of just setting or
13103 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13105 Remove obsolete '#define static' cruft.
13106 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13107 This #undef was "temporary" in 2000; it is no longer needed
13108 now that '#define static' has gone away.
13109 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13110 (gray_bitmap_bits): Remove; no longer needed.
13111 All uses replaced with definiens.
13112 * xterm.c: Include "bitmaps/gray.xbm".
13114 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13116 Clean up __executable_start, monstartup when --enable-profiling.
13117 The following changes affect the code only when profiling.
13118 * dispnew.c (__executable_start): Rename from safe_bcopy.
13119 Define only on platforms that need it.
13120 * emacs.c: Include <sys/gmon.h> when profiling.
13121 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13122 (__executable_start): Remove decl, since lisp.h does it now.
13123 (safe_bcopy): Remove decl; no longer has that name.
13124 (main): Coalesce #if into single bit of code, for simplicity.
13125 Cast pointers to uintptr_t, since standard libraries want integers
13127 * lisp.h (__executable_start): New decl.
13129 2012-05-31 Glenn Morris <rgm@gnu.org>
13131 * image.c (Fimagemagick_types): Doc fix.
13133 2012-05-30 Jim Meyering <meyering@redhat.com>
13135 * callproc.c (Fcall_process_region): Include directory component
13136 in mkstemp error message (Bug#11586).
13138 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13140 * alloc.c, lisp.h (make_pure_vector): Now static.
13142 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13144 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13145 Move to byte-run.el.
13146 (Fautoload): Do the hash-doc more carefully.
13147 * data.c (Fdefalias): Purify definition, except for keymaps.
13148 (Qdefun): Move from eval.c.
13149 * lisp.h (Qdefun): Remove.
13150 * lread.c (read1): Tiny simplification.
13152 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
13154 Do not create empty overlays with the evaporate property (Bug#9642).
13155 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13156 Bug#9642, but explicitly check that the buffer the overlay would
13157 be moved to is live and rearrange lines to make sure that errors
13158 will not put the overlay in an inconsistent state.
13159 (Fdelete_overlay): Cosmetics.
13161 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13163 * w32term.c (my_bring_window_to_top): New function.
13164 (x_raise_frame): Use handle returned by DeferWindowPos, which
13165 could be different from the original one.
13166 Call my_bring_window_to_top instead of my_set_foreground_window.
13169 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13170 by calling BringWindowToTop.
13172 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13173 (WM_EMACS_END): Increase by one.
13175 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13177 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13178 This avoids undefined behavior that might cause the eassert
13179 to not catch an out-of-range value.
13181 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13183 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13184 Update dependencies.
13186 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13188 * bidi.c (bidi_mirror_char): Fix last change.
13190 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13192 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13193 when referring to sectname field in printf format.
13195 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13197 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13198 Only r_alloc_inhibit_buffer_relocation needed to be added;
13199 the others were already declared.
13201 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13202 before checking whether it's out of range. Put the check inside
13204 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13206 2012-05-27 Ken Brown <kbrown@cornell.edu>
13208 * callproc.c (Fcall_process): Restore a line that was accidentally
13209 commented out in the 2011-02-13 change (bug#11547).
13211 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13213 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13214 defined on ralloc.c.
13216 * buffer.c [REL_ALLOC]: Remove prototypes of
13217 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13218 they are now on lisp.h.
13220 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13222 * search.c (search_buffer): Use it to inhibit relocation of buffer
13223 text while re_search_2 is doing its job, because re_search_2 is
13224 passed C pointers to buffer text. (Bug#11519)
13226 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13227 Update value to 24.
13229 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13230 state after an additional call to move_it_in_display_line_to, keep
13231 the values of it->max_ascent and it->max_descent found for the
13233 (pos_visible_p): Revert the comparison against bottom_y to what it
13234 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13237 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13239 Fix coding-related core dumps with gcc -ftrapv.
13240 The code was computing A - B, where A and B are pointers, and B is
13241 random garbage. This can lead to core dumps on platforms that
13242 have special pointer registers, and it also leads to core dumps on
13243 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13244 A - B only when B is initialized properly.
13245 * coding.c (coding_set_source, coding_set_destination): Return void.
13246 (coding_change_source, coding_change_destinations): New functions,
13247 with the old behaviors of coding_set_source and coding_set_destination.
13248 All callers that need an offset changed to use these new functions.
13250 2012-05-26 Glenn Morris <rgm@gnu.org>
13252 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13254 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13256 Extend mouse support on W32 text-mode console.
13257 * xdisp.c (draw_row_with_mouse_face):
13258 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13260 * w32console.c: Include window.h.
13261 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13263 (initialize_w32_display): Initialize mouse-highlight data.
13265 * w32inevt.c: Include termchar.h and window.h.
13266 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13267 moves, call note_mouse_highlight. If help_echo changed, call
13268 gen_help_event to produce help-echo message in the echo area.
13269 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13272 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13274 * lread.c (read1): Simplify slightly to avoid an overflow warning
13275 with GCC 4.7.0 on x86-64.
13277 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13279 * bidi.c (bidi_mirror_char): Revert last change: an int is
13280 definitely wide enough here.
13282 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13284 Fix integer width and related bugs (Bug#9874).
13285 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13286 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13287 (string_bytes, check_sblock, allocate_string_data):
13288 (compact_small_strings, Fmake_bool_vector, make_string)
13289 (make_unibyte_string, make_multibyte_string)
13290 (make_string_from_bytes, make_specified_string)
13291 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13292 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13295 (allocate_pseudovector):
13296 Use int, not EMACS_INT, where int is wide enough.
13297 (inhibit_garbage_collection, Fgarbage_collect):
13298 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13299 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13300 int might not be wide enough.
13301 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13302 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13303 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13304 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13305 (bidi_level_of_next_char, bidi_move_to_visually_next):
13306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13307 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13308 (Fkill_buffer, Fset_buffer_major_mode)
13309 (advance_to_char_boundary, Fbuffer_swap_text)
13310 (Fset_buffer_multibyte, overlays_at, overlays_in)
13311 (overlay_touches_p, struct sortvec, record_overlay_string)
13312 (overlay_strings, recenter_overlay_lists)
13313 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13314 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13315 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13316 (Foverlay_recenter, last_overlay_modification_hooks_used)
13317 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13319 (validate_region): Omit unnecessary test for b <= e,
13320 since that's guaranteed by the previous test.
13321 (adjust_overlays_for_delete): Avoid pos + length overflow.
13322 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13323 (report_overlay_modification):
13324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13325 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13326 Omit pointer cast, which isn't needed anyway, and doesn't work
13327 after the EMACS_INT -> ptrdiff_t change.
13328 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13329 * buffer.h: Adjust decls to match defn changes elsewhere.
13330 (struct buffer_text, struct buffer):
13331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13332 Use EMACS_INT, not int, where int might not be wide enough.
13333 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13334 not int, to avoid needless 32-bit limit on 64-bit hosts.
13335 (exec_byte_code): Use tighter memory-full test, one that checks
13336 for alloca overflow. Don't compute the address of the object just
13337 before an array, as that's not portable. Use EMACS_INT, not
13338 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13339 * callint.c (Fcall_interactively):
13340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13341 * callproc.c (call_process_kill, Fcall_process):
13342 Don't assume pid_t fits into an Emacs fixnum.
13343 (call_process_cleanup, Fcall_process, child_setup):
13344 Don't assume pid_t fits into int.
13345 (call_process_cleanup, Fcall_process, delete_temp_file)
13346 (Fcall_process_region):
13347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13348 (Fcall_process): Simplify handling of volatile integers.
13349 Use int, not EMACS_INT, where int will do.
13350 * casefiddle.c (casify_object, casify_region, operate_on_word)
13351 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13353 (casify_object): Avoid integer overflow when overallocating buffer.
13354 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13355 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13356 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13357 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13358 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13359 integers are now checked earlier. All uses replaced with XINT.
13361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13362 For CCL_MapSingle, check that content and value are in int range.
13363 (ccl_driver, Fregister_code_conversion_map):
13364 Check that Vcode_version_map_vector is a vector.
13365 (resolve_symbol_ccl_program): Check that vector header is in range.
13366 Always copy the vector, so that we can check its contents reliably
13367 now rather than having to recheck each instruction as it's being
13368 executed. Check that vector words fit in 'int'.
13369 (ccl_get_compiled_code, Fregister_ccl_program)
13370 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13371 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13372 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13373 contents are in range.
13374 (Fccl_execute_on_string): Check that status is in range.
13375 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13376 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13377 Accept and return EMACS_INT, not int, because callers can pass values
13378 out of 'int' range.
13379 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13380 (multibyte_chars_in_text, parse_str_as_multibyte)
13381 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13382 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13383 (string_escape_byte8, Fget_byte):
13384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13385 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13386 avoid mishandling large integers.
13387 * character.h: Adjust decls to match defn changes elsewhere.
13388 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13389 (Ffind_charset_region):
13390 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13391 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13392 (load_charset_map_from_vector, Fdefine_charset_internal):
13393 Don't assume fixnum fits in int.
13394 (load_charset_map_from_vector, Fmap_charset_chars):
13395 Remove now-unnecessary CHECK_NATNUMs.
13396 (Fdefine_charset_internal): Check ranges here, more carefully.
13397 Don't rely on undefined behavior with signed left shift overflow.
13398 Don't assume unsigned int fits into fixnum, or that fixnum fits
13399 into unsigned int. Don't require max_code to be a valid fixnum;
13400 that's not true for gb10830 4-byte on a 32-bit host. Allow
13401 invalid_code to be a cons, for the same reason. Require code_offset
13402 to be a character. Avoid int overflow if max_char is close
13404 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13405 this is intended anyway and avoids some undefined behavior.
13406 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13407 INDEX_TO_CODE_POINT, as that's what it expects.
13408 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13409 * charset.h (DECODE_CHAR): Return int, not unsigned;
13410 this is what was intended anyway, and it avoids undefined behavior.
13411 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13412 integer-overflow issues.
13413 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13414 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13415 where the argument is EMACS_INT, and this behavior is not intended.
13416 * chartab.c (Fmake_char_table, Fset_char_table_range)
13417 (uniprop_get_decoder, uniprop_get_encoder):
13418 Don't assume fixnum fits in int.
13419 * cmds.c (move_point): New function, that does the gist of
13420 Fforward_char and Fbackward_char, but does so while checking
13421 for integer overflow more accurately.
13422 (Fforward_char, Fbackward_char): Use it.
13423 (Fforward_line, Fend_of_line, internal_self_insert)
13424 (internal_self_insert):
13425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13426 Fix a FIXME, by checking for integer overflow when calculating
13427 target_clm and actual_clm.
13428 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13429 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13430 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13431 (coding_alloc_by_making_gap, alloc_destination)
13432 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13433 (encode_coding_utf_16, detect_coding_emacs_mule)
13434 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13435 (detect_coding_iso_2022, decode_coding_iso_2022)
13436 (encode_invocation_designation, encode_designation_at_bol)
13437 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13438 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13439 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13440 (encode_coding_ccl, encode_coding_raw_text)
13441 (detect_coding_charset, decode_coding_charset)
13442 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13443 (produce_composition, produce_charset, produce_annotation)
13444 (decode_coding, handle_composition_annotation)
13445 (handle_charset_annotation, consume_chars, decode_coding_gap)
13446 (decode_coding_object, encode_coding_object, detect_coding_system)
13447 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13448 (code_convert_region, code_convert_string)
13449 (Fdefine_coding_system_internal)
13450 (coding_set_source, coding_set_destination):
13451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13452 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13453 (Fdefine_coding_system_internal):
13454 Don't assume fixnums fit in int.
13455 (decode_coding_gap, decode_coding_object, encode_coding_object)
13456 (Fread_coding_system, Fdetect_coding_region)
13457 (Funencodable_char_position, Fcheck_coding_systems_region)
13458 (get_translation, handle_composition_annotation, consume_chars):
13459 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13460 (consume_chars): Rewrite to not calculate an address outside buffer.
13461 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13462 Don't access memory outside of the args array.
13463 (Fdefine_coding_system_internal): Check for charset-id overflow.
13464 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13465 result of ENCODE_CHAR.
13466 * coding.h: Adjust decls to match defn changes elsewhere.
13467 (struct coding_system):
13468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13469 * composite.c (get_composition_id, find_composition)
13470 (run_composition_function, update_compositions)
13471 (compose_text, composition_gstring_put_cache)
13472 (composition_gstring_p, composition_gstring_width)
13473 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13474 (composition_compute_stop_pos, composition_reseat_it)
13475 (composition_update_it, struct position_record)
13476 (find_automatic_composition, composition_adjust_point)
13477 (Fcomposition_get_gstring, Ffind_composition_internal):
13478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13479 (update_compositions):
13480 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13481 * composite.h: Adjust decls to match defn changes elsewhere.
13482 (struct composition):
13483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13484 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13485 Do not attempt to compute the address of the object just before a
13486 buffer; this is not portable.
13488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13489 (Faset): Use int, not EMACS_INT, where int is wide enough.
13490 (Fstring_to_number): Don't assume fixnums fit in int.
13491 (Frem): Don't assume arg is nonnegative.
13492 * dbusbind.c (xd_append_arg): Check for integers out of range.
13493 (Fdbus_call_method): Don't overflow the timeout int.
13494 (extract_signed, extract_unsigned): New functions.
13495 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13496 (xd_get_connection_references): Return ptrdiff_t, not int.
13498 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13499 (xd_read_message_1):
13500 Use int, not unsigned, where the dbus API uses int.
13501 (Fdbus_message_internal): Don't overflow mtype.
13502 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13503 * dired.c (directory_files_internal, file_name_completion, scmp)
13504 (file_name_completion_stat):
13505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13506 (file_name_completion): Don't overflow matchcount.
13507 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13508 * dispextern.h: Adjust decls to match defn changes elsewhere.
13509 (struct text_pos, struct glyph, struct bidi_saved_info)
13510 (struct bidi_string_data, struct bidi_it, struct composition_it)
13512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13513 (struct display_pos, struct composition_it, struct it):
13514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13515 * dispnew.c (increment_matrix_positions)
13516 (increment_row_positions, mode_line_string)
13517 (marginal_area_string):
13518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13519 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13521 (duration_to_sec_usec): New function, to check for overflow better.
13522 (Fsleep_for, sit_for): Use it.
13523 * doc.c (get_doc_string, store_function_docstring):
13524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13525 (get_doc_string, Fsnarf_documentation):
13526 Use int, not EMACS_INT, where int is wide enough.
13528 Use SAFE_ALLOCA, not alloca.
13529 Check for overflow when converting EMACS_INT to off_t.
13530 * doprnt.c (doprnt):
13531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13532 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13533 Don't assume uid_t fits into fixnum.
13534 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13535 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13536 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13537 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13538 (general_insert_function)
13539 (Finsert_char, make_buffer_string, make_buffer_string_both)
13540 (update_buffer_properties, Fbuffer_substring)
13541 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13542 (Fsubst_char_in_region, check_translation)
13543 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13544 (transpose_markers, Ftranspose_regions):
13545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13546 (clip_to_bounds): Move to lisp.h as an inline function).
13547 (Fconstrain_to_field): Don't assume integers are nonnegative.
13548 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13549 (Fsubst_char_in_region, Fsave_restriction):
13550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13551 (Femacs_pid): Don't assume pid_t fits into fixnum.
13552 (lo_time): Use int, not EMACS_INT, when int suffices.
13553 (lisp_time_argument): Check for usec out of range.
13554 (Fencode_time): Don't assume fixnum fits in int.
13555 (Fuser_login_name, Fuser_full_name): Signal an error
13556 if a uid argument is out of range, rather than relying on
13557 undefined behavior.
13558 (Fformat_time_string): Remove now-unnecessary check.
13559 lisp_time_argument checks for out-of-range usec now.
13560 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13561 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13562 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13563 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13564 (init_cmdargs, Fdump_emacs):
13565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13566 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13567 the bottom (typically) 32 bits of the fixnum.
13568 * eval.c (specpdl_size, call_debugger):
13569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13570 (when_entered_debugger, Fbacktrace_debug):
13571 Don't assume fixnum can fit in int.
13572 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13573 the object just before a buffer; this is not portable.
13574 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13575 (grow_specpdl, unbind_to):
13576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13577 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13578 (grow_specpdl): Simplify allocation by using xpalloc.
13579 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13580 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13581 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13583 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13584 (a_write, e_write):
13585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13586 (Fcopy_file, non_regular_nbytes, read_non_regular)
13587 (Finsert_file_contents):
13588 Use int, not EMACS_INT, where int is wide enough.
13589 (READ_BUF_SIZE): Verify that it fits in int.
13590 (Finsert_file_contents): Check that counts are in proper range,
13591 rather than assuming fixnums fit into ptrdiff_t etc.
13592 Don't assume fixnums fit into int.
13593 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13594 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13595 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13596 (string_char_to_byte, string_byte_to_char)
13597 (string_make_multibyte, string_to_multibyte)
13598 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13599 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13600 (substring_both, Fdelete, internal_equal, Ffillarray)
13601 (Fclear_string, mapcar1)
13602 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13603 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13604 (larger_vector, make_hash_table, maybe_resize_hash_table)
13605 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13606 (Fmaphash, secure_hash):
13607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13608 (concat): Check for string index and length overflow.
13609 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13612 (larger_vector): New API (vec, incr_min, size_max) replaces old
13613 one (vec, new_size, init). This catches size overflow.
13614 INIT was removed because it was always Qnil.
13615 All callers changed.
13616 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13617 the upper bound on a hash table index size.
13618 (make_hash_table, maybe_resize_hash_table): Use it.
13619 (secure_hash): Computer start_byte and end_byte only after
13620 they're known to be in ptrdiff_t range.
13621 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13622 (Ffont_get_glyphs, Ffont_at):
13623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13624 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13625 (Flist_fonts, Fopen_font):
13626 Don't assume fixnum can fit in int.
13627 (check_gstring): Don't assume index can fit in int.
13628 (font_match_p): Check that fixnum is a character, not a nonnegative
13629 fixnum, since the later code needs to stuff it into an int.
13630 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13631 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13632 conversion overflow issues.
13633 (Fopen_font): Check for integer out of range.
13634 (Ffont_get_glyphs): Don't assume index can fit in int.
13635 * font.h: Adjust decls to match defn changes elsewhere.
13636 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13638 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13639 printmax_t, where ptrdiff_t is wide enough.
13640 (Finternal_char_font):
13641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13642 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13643 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13644 (Fset_frame_position, x_set_frame_parameters)
13645 (x_set_line_spacing, x_set_border_width)
13646 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13647 Check that fixnums are in proper range for system types.
13648 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13650 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13651 Use SAFE_ALLOCA_LISP, not alloca.
13652 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13653 intptr_t is wide enough.
13654 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13655 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13656 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13657 Check for fixnum out of range.
13658 * ftfont.c (ftfont_list): Don't assume index fits in int.
13659 Check that fixnums are in proper range for system types.
13660 (ftfont_shape_by_flt):
13661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13662 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13664 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13665 Check that fixnums are in proper range for system types.
13666 * gnutls.h: Adjust decls to match defn changes elsewhere.
13667 * gtkutil.c (xg_dialog_run):
13668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13669 (update_frame_tool_bar):
13670 Check that fixnums are in proper range for system types.
13671 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13672 (lookup_image): Check that fixnums are in range for system types.
13673 * indent.c (last_known_column, last_known_column_point):
13674 (current_column_bol_cache):
13675 (skip_invisible, current_column, check_display_width):
13676 (check_display_width, scan_for_column, current_column_1)
13677 (Findent_to, Fcurrent_indentation, position_indentation)
13678 (indented_beyond_p, Fmove_to_column, compute_motion):
13679 (Fcompute_motion, Fvertical_motion):
13680 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13681 (last_known_column_modified): Use EMACS_INT, not int.
13682 (check_display_width):
13684 Check that fixnums and floats are in proper range for system types.
13685 (compute_motion): Don't assume index or fixnum fits in int.
13686 (compute_motion, Fcompute_motion):
13687 Use int, not EMACS_INT, when it is wide enough.
13688 (vmotion): Omit local var start_hpos that is always 0; that way
13689 we don't need to worry about overflow in expressions involving it.
13690 * indent.h: Adjust decls to match defn changes elsewhere.
13692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13693 Use int, not EMACS_INT, where int is wide enough.
13694 Remove unused members ovstring_chars_done and tab_offset;
13696 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13697 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13698 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13699 (make_gap, copy_text, insert, insert_and_inherit)
13700 (insert_before_markers, insert_before_markers_and_inherit)
13701 (insert_1, count_combining_before, count_combining_after)
13702 (insert_1_both, insert_from_string)
13703 (insert_from_string_before_markers, insert_from_string_1)
13704 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13705 (adjust_after_replace, adjust_after_insert, replace_range)
13706 (replace_range_2, del_range, del_range_1, del_range_byte)
13707 (del_range_both, del_range_2, modify_region)
13708 (prepare_to_modify_buffer, signal_before_change)
13709 (signal_after_change, Fcombine_after_change_execute):
13710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13711 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13712 (balance_an_interval, split_interval_right, split_interval_left)
13713 (find_interval, next_interval, update_interval)
13714 (adjust_intervals_for_insertion, delete_node, delete_interval)
13715 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13716 (static_offset_intervals, offset_intervals)
13717 (merge_interval_right, merge_interval_left, make_new_interval)
13718 (graft_intervals_into_buffer, temp_set_point_both)
13719 (temp_set_point, set_point, adjust_for_invis_intang)
13720 (set_point_both, move_if_not_intangible, get_property_and_range)
13721 (get_local_map, copy_intervals, copy_intervals_to_string)
13722 (compare_string_intervals, set_intervals_multibyte_1):
13723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13724 * intervals.h: Adjust decls to match defn changes elsewhere.
13726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13727 * keyboard.c (this_command_key_count, this_single_command_key_start)
13728 (before_command_key_count, before_command_echo_length, echo_now)
13729 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13730 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13731 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13732 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13734 (last_non_minibuf_size, last_point_position, echo_truncate)
13735 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13736 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13737 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13738 (stuff_buffered_input):
13739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13740 (last_auto_save, command_loop_1, read_char):
13741 Use EMACS_INT, not int, to avoid integer overflow.
13742 (record_char): Avoid overflow in total_keys computation.
13743 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13744 * keyboard.h: Adjust decls to match defn changes elsewhere.
13745 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13746 (Fkey_description, Fdescribe_vector, Flookup_key):
13747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13748 (click_position): New function, to check that positions are in range.
13749 (Fcurrent_active_maps):
13750 (describe_command):
13751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13752 (Faccessible_keymaps, Fkey_description):
13753 (preferred_sequence_p):
13754 Don't assume fixnum can fit into int.
13755 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13756 Check for integer overflow in size calculations.
13757 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13758 avoid mishandling large integers.
13759 * lisp.h: Adjust decls to match defn changes elsewhere.
13760 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13761 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13762 (struct Lisp_Marker):
13763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13764 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13765 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13766 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13767 All callers changed.
13768 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13769 Assume the arg has valid form, since it always does.
13770 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13771 unsigned integer system type.
13772 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13773 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13775 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13776 (duration_to_sec_usec): New decl.
13777 * lread.c (read_from_string_index, read_from_string_index_byte)
13778 (read_from_string_limit, readchar, unreadchar, openp)
13779 (read_internal_start, read1, oblookup):
13780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13781 (Fload, readevalloop, Feval_buffer, Feval_region):
13782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13783 (openp): Check for out-of-range argument to 'access'.
13784 (read1): Use int, not EMACS_INT, where int is wide enough.
13785 Don't assume fixnum fits into int.
13786 Fix off-by-one error that can read outside a buffer.
13787 (read_filtered_event): Use duration_to_sec_usec
13788 to do proper overflow checking on durations.
13789 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13790 in size calculation.
13791 (Fexecute_kbd_macro):
13792 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13793 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13794 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13795 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13796 (set_marker_both, set_marker_restricted_both, marker_position)
13797 (marker_byte_position, Fbuffer_has_markers_at):
13798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13799 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13800 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13801 It now merely ensures that the menu is large enough, without
13802 necessarily growing it, as this avoids some integer overflow issues.
13803 All callers changed.
13804 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13805 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13806 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13807 Use SAFE_ALLOCA_LISP, not alloca.
13808 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13809 to EMACS_INT. Check that fixnums are in proper range for system types.
13810 * minibuf.c (minibuf_prompt_width, string_to_object)
13811 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13812 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13814 (get_minibuffer, read_minibuf_unwind):
13815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13816 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13817 this simplifies overflow checking. All callers changed.
13818 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13819 (Ftest_completion):
13820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13821 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13822 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13823 Check that fixnums are in proper range for system types.
13824 (Fx_create_frame, Fx_show_tip):
13825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13826 * nsfont.m (ns_findfonts, nsfont_list_family):
13827 Don't assume fixnum fits in long.
13828 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13830 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13832 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13833 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13834 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13835 (PRINTDECLARE, PRINTPREPARE):
13836 (strout, print_string):
13837 (print, print_preprocess, print_check_string_charset_prop)
13839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13841 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13842 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13843 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13844 (printchar, strout): Use xpalloc to catch size calculation overflow.
13845 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13846 (print_error_message): Use SAFE_ALLOCA, not alloca.
13847 (print_object): Use int, not EMACS_INT, where int is wide enough.
13848 (print_depth, new_backquote_output, print_number_index):
13849 Use ptrdiff_t, not int, where int might not be wide enough.
13850 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13851 (Fset_process_window_size, Fformat_network_address)
13852 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13854 Check that fixnums are in proper range for system types.
13855 (Fsignal_process): Simplify by avoiding a goto.
13856 Check for process-ids out of pid_t range rather than relying on
13857 undefined behavior.
13858 (process_tick, update_tick): Use EMACS_INT, not int.
13859 (Fformat_network_address, read_process_output, send_process)
13860 (Fprocess_send_region, status_notify):
13861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13862 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13863 (wait_reading_process_output, read_process_output, exec_sentinel):
13864 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13865 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13866 (Faccept_process_output): Use duration_to_sec_usec to do proper
13867 overflow checking on durations.
13868 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13869 Don't assume pid_t fits in int.
13870 * process.h (struct Lisp_Process): Members tick and update_tick
13871 are now of type EMACS_INT, not int.
13872 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13873 configured --with-wide-int.
13874 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13875 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13876 * search.c (looking_at_1, string_match_1):
13877 (fast_string_match, fast_c_string_match_ignore_case)
13878 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13879 (scan_newline, find_before_next_newline, search_command)
13880 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13881 (set_search_regs, wordify):
13884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13885 (string_match_1, search_buffer, set_search_regs):
13887 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13888 (wordify): Check for overflow in size calculation.
13889 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13890 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13891 Check that fixnums are in proper range for system types.
13892 * sound.c (struct sound_device)
13893 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13895 (Fplay_sound_internal):
13896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13897 * syntax.c (struct lisp_parse_state, find_start_modiff)
13898 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13899 (Fparse_partial_sexp):
13900 Don't assume fixnums can fit in int.
13901 (struct lisp_parse_state, find_start_pos, find_start_value)
13902 (find_start_value_byte, find_start_begv)
13903 (update_syntax_table, char_quoted, dec_bytepos)
13904 (find_defun_start, prev_char_comend_first, back_comment):
13905 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13906 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13908 (Finternal_describe_syntax_value): Check that match_lisp is a
13909 character, not an integer, since the code stuffs it into int.
13910 (scan_words, scan_sexps_forward):
13911 Check that fixnums are in proper range for system types.
13913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13914 (scan_sexps_forward):
13915 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13916 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13917 * syntax.h: Adjust decls to match defn changes elsewhere.
13918 (struct gl_state_s):
13919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13920 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13921 MOST_POSITIVE_FIXNUM.
13922 * sysdep.c (wait_for_termination_1, wait_for_termination)
13923 (interruptible_wait_for_termination, mkdir):
13924 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13925 (emacs_read, emacs_write):
13926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13927 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13928 and double all fit in int.
13929 * term.c (set_tty_color_mode):
13930 Check that fixnums are in proper range for system types.
13931 * termhooks.h (struct input_event):
13932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13933 * textprop.c (validate_interval_range, interval_of)
13934 (Fadd_text_properties, set_text_properties_1)
13935 (Fremove_text_properties, Fremove_list_of_text_properties)
13936 (Ftext_property_any, Ftext_property_not_all)
13937 (copy_text_properties, text_property_list, extend_property_ranges)
13938 (verify_interval_modification):
13939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13940 (Fnext_single_char_property_change)
13941 (Fprevious_single_char_property_change):
13942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13943 (copy_text_properties):
13944 Check for integer overflow in index calculation.
13945 * undo.c (last_boundary_position, record_point, record_insert)
13946 (record_delete, record_marker_adjustment, record_change)
13947 (record_property_change):
13948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13949 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13950 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13951 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13952 (Fx_hide_tip, Fx_file_dialog):
13953 * w32menu.c (set_frame_menubar):
13954 Use ptrdiff_t, not int, for consistency with rest of code.
13955 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13956 (select_window, Fdelete_other_windows_internal)
13957 (window_scroll_pixel_based, window_scroll_line_based)
13958 (Frecenter, Fset_window_configuration):
13959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13960 (Fset_window_hscroll, run_window_configuration_change_hook)
13961 (set_window_buffer, temp_output_buffer_show, scroll_command)
13962 (Fscroll_other_window, Frecenter):
13963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13964 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13965 Don't assume fixnum fits in int.
13966 (Fset_window_scroll_bars):
13967 Check that fixnums are in proper range for system types.
13968 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13969 (string_pos, c_string_pos, number_of_chars, init_iterator)
13970 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13971 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13972 (compute_display_string_end, handle_face_prop)
13973 (face_before_or_after_it_pos, handle_invisible_prop)
13974 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13975 (display_prop_intangible_p, string_buffer_position_lim)
13976 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13977 (get_overlay_strings_1, get_overlay_strings)
13978 (iterate_out_of_display_property, forward_to_next_line_start)
13979 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13980 (get_next_display_element, set_iterator_to_next)
13981 (get_visually_first_element, compute_stop_pos_backwards)
13982 (handle_stop_backwards, next_element_from_buffer)
13983 (move_it_in_display_line_to, move_it_in_display_line)
13984 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13985 (add_to_log, message_dolog, message_log_check_duplicate)
13986 (message2, message2_nolog, message3, message3_nolog
13987 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13988 (current_message_1, truncate_echo_area, truncate_message_1)
13989 (set_message, set_message_1, store_mode_line_noprop)
13990 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13991 (text_outside_line_unchanged_p, check_point_in_composition)
13992 (reconsider_clip_changes)
13993 (redisplay_internal, set_cursor_from_row, try_scrolling)
13994 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13995 (redisplay_window, find_last_unchanged_at_beg_row)
13996 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13997 (trailing_whitespace_p, find_row_edges, display_line)
13998 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13999 (display_mode_element, store_mode_line_string)
14000 (pint2str, pint2hrstr, decode_mode_spec)
14001 (display_count_lines, display_string, draw_glyphs)
14002 (x_produce_glyphs, x_insert_glyphs)
14003 (rows_from_pos_range, mouse_face_from_buffer_pos)
14004 (fast_find_string_pos, mouse_face_from_string_pos)
14005 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14007 (safe_call, init_from_display_pos, handle_fontified_prop)
14008 (handle_single_display_spec, load_overlay_strings)
14009 (with_echo_area_buffer, setup_echo_area_for_printing)
14010 (display_echo_area, echo_area_display)
14011 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14012 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14013 (redisplay_window, dump_glyph_row, display_mode_line)
14014 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14015 (handle_display_spec, display_prop_string_p):
14016 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14017 (handle_single_display_spec, build_desired_tool_bar_string)
14018 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14019 (get_specified_cursor_type):
14020 Check that fixnums are in proper range for system types.
14021 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14022 (Flookup_image_map):
14023 Don't assume fixnums fit in int.
14024 (compare_overlay_entries):
14025 Avoid mishandling comparisons due to subtraction overflow.
14026 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14027 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14028 (handle_tool_bar_click):
14029 Use int, not unsigned, since we prefer signed and the signedness
14030 doesn't matter here.
14031 (get_next_display_element, next_element_from_display_vector):
14032 Use int, not EMACS_INT, when int is wide enough.
14033 (start_hourglass): Use duration_to_sec_usec to do proper
14034 overflow checking on durations.
14035 * xfaces.c (Fbitmap_spec_p):
14036 Check that fixnums are in proper range for system types.
14037 (compare_fonts_by_sort_order):
14038 Avoid mishandling comparisons due to subtraction overflow.
14039 (Fx_family_fonts, realize_basic_faces):
14040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14042 Don't assume fixnum fits in int.
14043 Use SAFE_ALLOCA_LISP, not alloca.
14044 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14045 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14046 (face_at_buffer_position, face_for_overlay_string)
14047 (face_at_string_position):
14048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14049 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14050 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14052 Check that fixnums are in proper range for system types.
14053 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14054 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14056 (Fx_change_window_property): Don't assume fixnums fit in int.
14057 * xfont.c (xfont_chars_supported):
14058 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14059 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14060 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14062 * xml.c (parse_region):
14063 * xrdb.c (magic_file_p):
14064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14065 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14066 (x_get_local_selection, x_reply_selection_request)
14067 (x_handle_selection_request, wait_for_property_change):
14068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14069 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14070 short is wide enough.
14071 (x_send_client_event): Don't assume fixnum fits in int.
14072 * xterm.c (x_x_to_emacs_modifiers):
14073 Don't assume EMACS_INT overflows nicely into int.
14074 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14075 may come from Lisp.
14076 (handle_one_xevent): NATNUMP can eval its arg twice.
14077 (x_connection_closed):
14078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14079 * xterm.h: Adjust decls to match defn changes elsewhere.
14080 (struct scroll_bar): Use struct vectorlike_header
14081 rather than rolling our own approximation.
14082 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14084 2012-05-25 Glenn Morris <rgm@gnu.org>
14086 * lisp.mk (lisp): Update for more files being compiled now.
14088 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14090 * lread.c: Remove `read_pure' which makes no difference.
14091 (read_pure): Remove var.
14092 (unreadpure): Remove function.
14093 (readevalloop): Don't call read_list with -1 flag.
14094 (read1, read_vector): Don't test read_pure any more.
14095 (read_list): Simplify.
14097 * fileio.c, character.h: Minor style tweaks.
14099 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14101 * window.h (clip_changed): Remove useless declaration.
14103 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
14105 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14106 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14108 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14111 This directory predates autoconf and is no longer needed nowadays.
14112 Move its few remaining bits of functionality to where they're needed.
14113 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14114 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14115 * m/template.h: Remove.
14116 * Makefile.in (M_FILE): Remove. All uses removed.
14117 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14118 * lisp.h (USE_LSB_TAG):
14119 * mem-limits.h (EXCEEDS_LISP_PTR):
14120 Use VAL_MAX, not VALBITS, in #if.
14121 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14122 (EMACS_UINT): Define unconditionally now.
14123 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14124 (BITS_PER_EMACS_INT): New constants, replacing
14125 what used to be in config.h, but not useful in #if.
14126 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14127 define them any more.
14128 (VAL_MAX): New macro.
14130 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14131 BITS_PER_EMACS_INT, in #if.
14132 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14133 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14134 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14135 * s/ms-w32.h (DATA_START):
14136 Move here from removed file m/intel386.h.
14137 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14138 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14140 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14142 Assume C89 or later.
14143 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14144 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14146 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14147 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14148 * textprop.c, tparam.c (NULL): Remove.
14149 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14150 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14151 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14152 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14153 * xterm.c (input_signal_count): Assume volatile works.
14155 2012-05-21 Ken Brown <kbrown@cornell.edu>
14157 * xgselect.c (xg_select): Fix first argument in call to 'select'
14160 2012-05-20 Ken Brown <kbrown@cornell.edu>
14162 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14163 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14165 2012-05-19 Ken Brown <kbrown@cornell.edu>
14167 * xfns.c (x_in_use): Remove `static' qualifier.
14168 * xterm.h (x_in_use): Declare.
14169 * xgselect.c: Include xterm.h.
14170 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14171 and `display_arg' (bug#9754).
14173 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14175 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14177 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14178 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14180 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14182 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14184 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14185 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14187 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14188 reference to image_cache->refcount.
14189 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14191 2012-05-17 Juri Linkov <juri@jurta.org>
14193 * search.c (Fword_search_regexp, Fword_search_backward)
14194 (Fword_search_forward, Fword_search_backward_lax)
14195 (Fword_search_forward_lax): Move functions to isearch.el
14196 (bug#10145, bug#11381).
14198 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14200 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14202 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14204 * lread.c (init_obarray): Declare Qt and Qnil as special.
14206 2012-05-14 Glenn Morris <rgm@gnu.org>
14208 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14209 Put "libexec" before "bin", for the sake of init_callproc_1.
14211 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14213 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14215 * unexaix.c: Port to more-recent AIX compilers.
14216 (report_error, report_error_1, make_hdr, copy_sym)
14217 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14218 Make arguments const char *, not char *, to avoid violations of C
14219 standard and to fix some AIX warnings reported by Gilles Pion.
14221 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14223 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14224 already have overlays loaded.
14225 (handle_single_display_spec): Before returning without displaying
14226 fringe bitmap, synchronize the bidi iterator with the main display
14227 iterator, by calling iterate_out_of_display_property.
14228 (iterate_out_of_display_property): Detect buffer iteration by
14229 testing that it->string is a Lisp string.
14230 (get_next_display_element): When the current object is exhausted,
14231 and there's something on it->stack, call set_iterator_to_next to
14232 proceed with what's on the stack, instead of returning zero.
14233 (set_iterator_to_next): If called at the end of a Lisp string,
14234 proceed to consider_string_end without incrementing string
14235 position. Don't increment display vector index past the end of
14236 the display vector. (Bug#11417)
14237 (pos_visible_p): Don't report a position visible when move_it_to
14238 stopped at the last line of window, which happens to be scanned
14239 backwards by the bidi iteration. (Bug#11464)
14241 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14243 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14244 and right-margin display specs even if the spec is invalid or we
14245 are on a TTY, and thus unable to display on the fringes.
14246 That's because the text with the property will not be displayed anyway,
14247 so we need to signal to the caller that this is a "replacing"
14248 display spec. This fixes display when the spec is invalid or we
14251 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14253 * unexaix.c (make_hdr): Fix typo in prototype.
14254 This bug broke the build on AIX. Problem reported by Gilles Pion.
14256 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14258 * keyboard.c (kbd_buffer_get_event): Read special events also in
14259 batch mode. (Bug#11415)
14261 2012-05-12 Glenn Morris <rgm@gnu.org>
14263 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14265 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14267 * lisp.mk (lisp): Add newcomment.elc.
14269 2012-05-12 Glenn Morris <rgm@gnu.org>
14271 * Makefile.in (MKDIR_P): New, set by configure.
14272 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14274 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14276 Remove unused function hourglass_started.
14277 * dispextern.h (hourglass_started):
14278 * w32fns.c (hourglass_started):
14279 * xdisp.c (hourglass_started): Remove.
14281 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14283 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14284 Update dependencies.
14286 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14288 * xgselect.c (xg_select): Put maxfds+1 into a var.
14289 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14291 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14293 2012-05-10 Dave Abrahams <dave@boostpro.com>
14295 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14296 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14298 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14300 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14301 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14302 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14303 Initialize xd_registered_buses.
14305 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14307 Untag more efficiently if USE_LSB_TAG.
14308 This is based on a proposal by YAMAMOTO Mitsuharu in
14309 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14310 For an admittedly artificial (nth 8000 longlist) benchmark on
14311 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14312 Emacs's overall text size by 1%.
14313 * lisp.h (XUNTAG): New macro.
14314 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14315 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14316 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14317 * eval.c (Fautoload):
14318 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14319 * frame.h (XFRAME): Use XUNTAG.
14321 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14322 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14323 Remove unportable assumptions about print widths of types like
14325 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14326 intptr_t when converting between pointer and integer, to avoid GCC
14327 warnings about wrong width.
14329 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14331 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14332 stack for each reader_thread, instead of defaulting to 8MB
14333 determined by the linker. This avoids failures in creating
14334 subprocesses on Windows 7, see the discussion in this thread:
14335 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14337 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14339 Fix up display of the *Minibuf-0* buffer in the mini window.
14340 * keyboard.c (read_char): Don't clear the echo area if there's no
14342 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14343 contents of *Minibuf-0*) if there's no message displayed in its stead.
14345 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14347 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14350 2012-05-06 Chong Yidong <cyd@gnu.org>
14352 * lisp.mk (lisp): Update.
14354 2012-05-05 Jim Meyering <meyering@redhat.com>
14356 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14358 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14360 * data.c (PUT_ERROR): New macro.
14361 (syms_of_data): Use it. Add new error type `user-error'.
14362 * undo.c (user_error): New function.
14363 (Fprimitive_undo): Use it.
14364 * print.c (print_error_message): Adjust print style for `user-error'.
14365 * keyboard.c (user_error): New function.
14366 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14368 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14370 Do not limit current-time-string to years 1000..9999.
14371 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14372 (Fcurrent_time_string): Support any year that is supported by the
14373 underlying localtime representation. Don't use asctime, as it
14374 has undefined behavior for years outside the range -999..9999.
14376 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14378 Fix race conditions involving setenv, gmtime, localtime, asctime.
14379 Without this fix, interrupts could mess up code that uses these
14380 nonreentrant functions, since setting TZ invalidates existing
14381 tm_zone or tzname values, and since most of these functions return
14382 pointers to static storage.
14383 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14384 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14385 Grow the critical sections to include not just invoking
14386 localtime/gmtime, but also accessing these functions' results
14387 including their tm_zone values if any, and any related TZ setting.
14388 (format_time_string): Last arg is now struct tm *, not struct tm **,
14389 so that the struct tm is saved in the critical section.
14390 All callers changed. Simplify allocation of initial buffer, partly
14391 motivated by the fact that memory allocation needs to be outside
14392 the critical section.
14394 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14396 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14397 with RESET_INTERVAL.
14399 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14400 Remove duplicated buffer name initialization.
14402 2012-05-02 Jim Meyering <jim@meyering.net>
14404 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14406 * xfns.c (x_window): Use xstrdup (Bug#11375).
14408 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14410 * xdisp.c (pos_visible_p): If already at a newline from the
14411 display string before the 'while' loop, don't walk back the glyphs
14412 from it3.glyph_row. Solves assertion violation when the display
14413 string begins with a newline (egg.el). (Bug#11367)
14415 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14417 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14420 2012-05-01 Glenn Morris <rgm@gnu.org>
14422 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14423 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14424 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14425 All were removed before 23.1.
14427 * dispnew.c: Remove HAVE_LIBNCURSES test;
14428 it is always true on relevant platforms.
14430 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14431 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14433 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14435 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14437 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14438 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14441 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14443 Do not avoid creating empty evaporating overlays (Bug#9642).
14444 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14445 That is, do not delete an evaporating overlay if it becomes
14446 empty after its bounds are adjusted to fit within its buffer.
14447 This fix caused other problems, and I'm reverting it until we get
14448 to the bottom of them.
14450 2012-04-27 Chong Yidong <cyd@gnu.org>
14452 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14454 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14456 * xdisp.c (pos_visible_p): If the window start position is beyond
14457 ZV, start the display from buffer beginning. Prevents assertion
14458 violation in init_iterator when the minibuffer window is scrolled
14459 via the scroll bar.
14461 * window.c (window_scroll_pixel_based): Likewise.
14463 2012-04-27 Chong Yidong <cyd@gnu.org>
14465 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14467 2012-04-27 Glenn Morris <rgm@gnu.org>
14469 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14470 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14472 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14474 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14475 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14477 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14479 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14480 display element, check also the underlying string or buffer
14481 character. (Bug#11341)
14483 * w32menu.c: Include w32heap.h.
14484 (add_menu_item): If the call to AppendMenuW (via
14485 unicode_append_menu) fails, disable Unicode menus only if we are
14486 running on Windows 9X/Me.
14488 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14490 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14491 (xgetint): Add missing shift for LSB tags.
14493 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14495 * keyboard.c (read_char): Don't wipe echo area for select window
14496 events: These might get delayed via `mouse-autoselect-window'
14499 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14501 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14502 manipulation of :loaded-from data.
14504 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14506 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14507 now a cons (bug#11311).
14509 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14511 Do not create empty overlays with the evaporate property (Bug#9642).
14512 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14513 if it becomes empty after its bounds are adjusted to fit within
14514 its buffer. Without this fix, in a nonempty buffer (let ((o
14515 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14516 yields an empty overlay that has the evaporate property, which is
14517 not supposed to happen.
14519 Fix minor GTK3 problems found by static checking.
14520 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14521 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14522 (struct _EmacsFixedClass, emacs_fixed_get_type):
14523 Move decls here from emacsgtkfixed.h, since they needn't be public.
14524 (emacs_fixed_get_type): Now static.
14525 (emacs_fixed_class_init): Omit unused local.
14526 (emacs_fixed_child_type): Remove; unused.
14527 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14528 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14529 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14530 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14531 (EMACS_FIXED_GET_CLASS): Remove; unused.
14532 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14534 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14535 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14537 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14539 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14540 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14541 (__malloc_size_t, __malloc_ptrdiff_t):
14542 Remove. All uses removed, replaced by the definiens if needed,
14543 since we can assume C89 or better now.
14544 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14545 (protect_malloc_state, align, get_contiguous_space)
14546 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14547 (malloc_atfork_handler_child, malloc_enable_thread)
14548 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14549 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14550 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14551 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14552 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14553 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14554 Define using prototypes, not old style.
14555 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14556 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14557 (align): Don't assume that signed integer overflow wraps around.
14558 Omit unused local var.
14559 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14560 (_free_internal_nolock, memalign, mallochook, reallochook):
14561 Omit no-longer-needed casts.
14562 (valloc): Use getpagesize, not __getpagesize.
14563 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14564 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14566 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14568 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14570 Move functions from C to Lisp. Make non-blocking method calls
14571 the default. Implement further D-Bus standard interfaces.
14573 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14574 (QCdbus_request_name_allow_replacement)
14575 (QCdbus_request_name_replace_existing)
14576 (QCdbus_request_name_do_not_queue)
14577 (QCdbus_request_name_reply_primary_owner)
14578 (QCdbus_request_name_reply_in_queue)
14579 (QCdbus_request_name_reply_exists)
14580 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14581 (QCdbus_registered_serial, QCdbus_registered_method)
14582 (QCdbus_registered_signal): New Lisp objects.
14583 (XD_DEBUG_MESSAGE): Use sizeof.
14584 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14585 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14586 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14587 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14588 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14589 (xd_signature, xd_append_arg): Allow float for integer types.
14590 (xd_get_connection_references): New function.
14591 (xd_get_connection_address): Rename from xd_initialize.
14592 Return cached address.
14593 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14594 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14596 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14597 Return number of refcounts.
14598 (Fdbus_get_unique_name): Make stronger parameter check.
14599 (Fdbus_message_internal): New defun.
14600 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14601 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14602 (Fdbus_send_signal, Fdbus_register_service)
14603 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14604 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14605 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14606 (Vdbus_compiled_version, Vdbus_runtime_version)
14607 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14608 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14609 (Vdbus_message_type_signal): New defvars.
14610 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14613 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14615 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14616 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14617 Do not assume ptrdiff_t is the same width as 'int'.
14619 * alloc.c: Handle unusual debugging option combinations.
14620 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14621 since the two debugging options are incompatible.
14622 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14624 (mem_init, mem_insert, mem_insert_fixup):
14625 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14626 (NEED_MEM_INSERT): Remove; no longer needed.
14628 2012-04-22 Leo Liu <sdl.web@gmail.com>
14630 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14632 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14634 * sysdep.c [__FreeBSD__]: Minor cleanups.
14635 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14636 Use Emacs indenting style more consistently. Avoid some casts.
14637 Use 'double' consistently rather than mixing 'float' and 'double'.
14639 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14641 * sysdep.c (list_system_processes, system_process_attributes):
14642 Add implementation for FreeBSD (Bug#5243).
14644 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14646 * lisp.mk (lisp): Update.
14648 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14650 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14651 It is never used otherwise.
14653 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14655 * print.c (print_preprocess): Only check print_depth if print-circle
14657 (print_object): Check for cycles even when print-circle is nil and
14658 print-gensym is t, but only check print_depth if print-circle is nil.
14660 2012-04-20 Chong Yidong <cyd@gnu.org>
14662 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14663 set the status to "failed" and ensure that sentinel is run.
14665 2012-04-20 Glenn Morris <rgm@gnu.org>
14667 * process.c (Fset_process_inherit_coding_system_flag)
14668 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14669 (Fmake_network_process, Fmake_serial_process): Doc fix.
14671 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14673 * xdisp.c (string_buffer_position_lim): Limit starting position to
14675 (set_cursor_from_row): If called for a mode-line or header-line
14676 row, return zero immediately.
14677 (try_cursor_movement): If inside continuation line, don't back up
14678 farther than the first row after the header line, if any.
14679 Don't consider the header-line row as "partially visible", even if
14680 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14682 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14684 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14687 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14688 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14690 configure: new option --enable-gcc-warnings (Bug#11207)
14691 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14692 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14693 (ALL_CFLAGS): Use new macros rather than old.
14694 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14695 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14696 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14697 -Wunused-result, -Wunused-variable. This should go away once
14698 the Emacs and Gnulib regex code is merged.
14699 (xmalloc, xrealloc): Now static.
14701 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14703 * dired.c (Fsystem_groups): Remove unused local.
14705 2012-04-17 Glenn Morris <rgm@gnu.org>
14707 * dired.c (Fsystem_users): Doc fix.
14709 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14711 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14712 (syms_of_dired): Add them.
14714 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14716 Fix minor alloc.c problems found by static checking.
14717 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14718 New extern decls, to avoid calling undeclared functions.
14719 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14720 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14721 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14722 (NEED_MEM_INSERT): New macro.
14723 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14724 Remove one incorrect comment and fix another.
14726 Fix minor ralloc.c problems found by static checking.
14727 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14728 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14729 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14730 (r_alloc_sbrk): Now static.
14732 Improve ralloc.c interface checking.
14733 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14734 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14735 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14736 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14737 [REL_ALLOC]: ... to here, to check interface.
14738 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14739 Remove decls. This fixes an "It stinks!".
14741 * alloc.c (which_symbols): Fix alignment issue / type clash.
14743 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14745 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14746 (struct Lisp_Misc_Any): Likewise.
14747 (struct Lisp_Free): Likewise.
14748 * alloc.c (union aligned_Lisp_Symbol): Define.
14749 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14750 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14751 (union aligned_Lisp_Misc): Define.
14752 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14753 aligned_Lisp_Misc instead of union Lisp_Misc.
14754 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14756 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14758 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14759 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14760 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14761 * s/netbsd.h, s/sol2-6.h:
14762 Remove definition of GC_MARK_STACK, since the default now works.
14763 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14764 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14765 no longer the default.
14766 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14768 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14770 * lread.c (lisp_file_lexically_bound_p):
14771 Fix hang at ";-*-\n" (bug#11238).
14773 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14775 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14776 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14778 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14780 * nsterm.m (constrainFrameRect): Always constrain when there is only
14781 one screen (Bug#10962).
14783 2012-04-13 Ken Brown <kbrown@cornell.edu>
14785 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14787 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14789 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14791 2012-04-11 Daniel Colascione <dancol@dancol.org>
14793 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14794 against is gone. It's better to use vfork now so that when Cygwin
14795 gains a new, working vfork, we use it automatically (bug#10398).
14797 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14799 * window.c (save_window_save): Obey window-point-insertion-type.
14801 2012-04-11 Glenn Morris <rgm@gnu.org>
14803 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14805 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14807 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14809 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14811 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14812 (force_quit_count): New var.
14813 (handle_interrupt): Use it.
14815 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14817 * w32.c (w32_delayed_load): Record the full path of the library
14818 being loaded (bug#10424).
14820 2012-04-09 Glenn Morris <rgm@gnu.org>
14822 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14823 not just in the obarray, before snarfing them. (Bug#11036)
14825 * Makefile.in ($(leimdir)/leim-list.el):
14826 Pass EMACS rather than BUILT_EMACS.
14828 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14830 * process.c (make_process):
14831 * process.h: Add integer `gnutls_handshakes_tried' member to
14834 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14835 Add convenience `GNUTLS_LOG2i' macro.
14837 * gnutls.c (gnutls_log_function2i): Convenience log function.
14838 (emacs_gnutls_read): Use new log functions,
14839 `gnutls_handshakes_tried' process member, and
14840 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14841 attempts per process (connection).
14843 2012-04-09 Chong Yidong <cyd@gnu.org>
14845 * eval.c (Fuser_variable_p, user_variable_p_eh)
14846 (lisp_indirect_variable): Functions deleted.
14847 (Fdefvar): Caller changed.
14849 * callint.c (Finteractive, Fcall_interactively):
14850 * minibuf.c (Fread_variable): Callers changed.
14852 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14854 * xdisp.c (set_cursor_from_row): If the display string appears in
14855 the buffer at position that is closer to point than the position
14856 after the display string, display the cursor on the first glyph of
14857 the display string. Fixes cursor display when a 'display' text
14858 property immediately follows invisible text. (Bug#11094)
14860 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14862 composite.c: use 'double' consistently
14863 * composite.c (get_composition_id): Use 'double' consistently
14864 instead of converting 'float' to 'double' and vice versa; this is
14865 easier to understand and avoids a GCC warning.
14867 2012-04-09 Glenn Morris <rgm@gnu.org>
14869 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14870 preparation for dumping it with emacs. (Bug#4789)
14871 (leimdir): New variable.
14872 ($(leimdir)/leim-list.el): New rule.
14873 (emacs$(EXEEXT)): Depend on leim-list.el.
14875 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14876 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14877 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14879 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14881 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14884 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14886 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14887 Remove unused local variable.
14889 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14891 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14892 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14893 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14894 objects, as mark_maybe_pointer will catch them otherwise.
14895 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14896 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14898 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14900 Fix typo that broke non-Windows builds.
14901 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14903 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14905 Support building on MS-Windows with libxml2.
14907 * makefile.w32-in (OBJ2): Add xml.$(O).
14908 (GLOBAL_SOURCES): Add xml.c.
14909 ($(BLD)/xml.$(O)): New dependency list.
14911 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14912 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14913 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14914 [!WINDOWSNT]: New macros.
14915 (init_libxml2_functions, libxml2_loaded_p): New functions.
14916 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14917 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14918 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14919 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14921 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14922 Call init_libxml2_functions before calling libxml2 functions.
14923 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14925 * emacs.c: Don't include libxml/parser.h.
14926 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14927 xmlCleanupParser directly.
14929 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14931 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14933 * indent.c (Fvertical_motion): If there is a display string at
14934 point, use it.vpos to compute how many lines to backtrack after
14935 move_it_to point. (Bug#11133)
14937 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14939 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14940 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14941 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14942 macros related to unification of CJK characters. For the details,
14943 see the discussion following the message here:
14944 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14946 2012-04-04 Chong Yidong <cyd@gnu.org>
14948 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14950 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14952 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14953 instead of alloca. (Bug#11138)
14955 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14957 * w32menu.c (is_simple_dialog): Properly check lisp types.
14960 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14962 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14963 position we get to after a call to move_it_to fails the
14964 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14965 only if we wind up in a string from display property. (Bug#11063)
14967 * window.c (Fdelete_other_windows_internal): Invalidate the row
14968 and column information about mouse highlight, so that redisplay
14969 restores it after reallocating the glyph matrices. (Bug#7464)
14971 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14972 string comes from a `display' text property, use the buffer
14973 position of that property as if we actually saw that position in
14975 (move_it_by_lines): Remove the assertion that
14976 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14977 violated when there's a before-string at the beginning of a line.
14980 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14982 * xdisp.c (append_space_for_newline): If the default face was
14983 remapped, use the remapped face for the appended newline.
14984 (extend_face_to_end_of_line): Use the remapped default face for
14985 extending the face to the end of the line.
14986 (display_line): Call extend_face_to_end_of_line when the default
14987 face was remapped. (Bug#11068)
14989 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14991 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14993 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14995 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14997 2012-03-27 Glenn Morris <rgm@gnu.org>
14999 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15002 2012-03-26 Kenichi Handa <handa@m17n.org>
15004 * dispextern.h (struct glyph): Fix previous change. Change the
15005 bit length of glyphless.ch to 25 (Bug#11082).
15007 2012-03-26 Chong Yidong <cyd@gnu.org>
15009 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15010 (command_loop_1): Use it; inhibit selection update for
15011 handle-select-window too (Bug#8996).
15013 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15015 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15017 2012-03-25 Kenichi Handa <handa@m17n.org>
15019 * dispextern.h (struct glyph): Change the bit length of
15020 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15022 2012-03-24 Eli Zaretskii <eliz@gnu.org>
15024 * s/ms-w32.h (tzname): Include time.h before redirecting to
15025 _tzname. Fixes the MSVC build. (Bug#9960)
15027 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15029 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15032 * xterm.c (XTread_socket): Only modify handling_signal if
15033 !SYNC_INPUT. (Bug#11080)
15035 2012-03-23 Eli Zaretskii <eliz@gnu.org>
15037 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15038 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15039 when fetching a multibyte character consumes more bytes than
15040 CHAR_BYTES returns, due to unification of CJK characters in
15041 string_char. (Bug#11073)
15043 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15045 * process.c (wait_reading_process_output): Handle pty disconnect
15046 by refraining from sending oneself a SIGCHLD (bug#10933).
15048 2012-03-22 Chong Yidong <cyd@gnu.org>
15050 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15052 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15053 Mark string as coming from a prefix property.
15054 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15055 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15057 2012-03-21 Chong Yidong <cyd@gnu.org>
15059 * xfaces.c (Vface_remapping_alist): Doc fix.
15061 2012-03-20 Eli Zaretskii <eliz@gnu.org>
15063 * w32proc.c (Fw32_set_console_codepage)
15064 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15067 2012-03-20 Chong Yidong <cyd@gnu.org>
15069 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15070 to reflect default non-nil value of redisplay-dont-pause.
15072 2012-03-19 Kenichi Handa <handa@m17n.org>
15074 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15075 it fit in a valid range (Bug#11003).
15077 2012-03-18 Eli Zaretskii <eliz@gnu.org>
15079 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15080 that is not from display property, accept the row as a "cursor
15081 row" if one of the string's character has a non-nil `cursor'
15082 property. Fixes cursor positioning when there are newlines in
15083 overlay strings, e.g. in icomplete.el. (Bug#11035)
15085 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15087 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15089 2012-03-12 Chong Yidong <cyd@gnu.org>
15091 * eval.c (inhibit_lisp_code): Rename from
15092 inhibit_window_configuration_change_hook; move from window.c.
15094 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15095 * window.c (run_window_configuration_change_hook)
15096 (syms_of_window): Callers changed.
15098 2012-03-11 Chong Yidong <cyd@gnu.org>
15100 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15102 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15104 2012-03-10 Chong Yidong <cyd@gnu.org>
15106 * frame.c (other_visible_frames): Don't assume the selected frame
15107 is visible (Bug#10955).
15109 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15111 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15113 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15115 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15116 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15119 2012-03-03 Glenn Morris <rgm@gnu.org>
15121 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15123 2012-03-02 Eli Zaretskii <eliz@gnu.org>
15125 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15126 position past the first glyph_row that ends at ZV. (Bug#10902)
15127 (redisplay_window, next_element_from_string): Fix typos in
15129 (redisplay_window): Pass to move_it_vertically the margin in
15130 pixels, not in screen lines.
15132 2012-03-02 Glenn Morris <rgm@gnu.org>
15134 * buffer.c (buffer-list-update-hook): Doc fix.
15136 2012-02-29 Eli Zaretskii <eliz@gnu.org>
15138 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15139 push_it before setting up the iterator for the first overlay
15140 string, even if we have an empty string loaded.
15141 (next_overlay_string): If there's an empty string on the iterator
15142 stack, pop the stack. (Bug#10903)
15144 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15146 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15147 Suggested by Stefan Monnier in
15148 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15149 * alloc.c (widen_to_Lisp_Object): New static function.
15150 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15151 and widening them to Lisp_Objects. This would work even if
15152 USE_LSB_TAG is defined and wide integers are used, which might
15153 happen in a future version of Emacs.
15155 2012-02-25 Chong Yidong <cyd@gnu.org>
15157 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15160 * xselect.c (Fx_selection_exists_p): Doc fix.
15161 (x_clipboard_manager_save_all): Print an informative message
15162 before saving to clipboard manager.
15164 2012-02-24 Chong Yidong <cyd@gnu.org>
15166 * keyboard.c (process_special_events): Handle all X selection
15167 requests in kbd_buffer, not just the next one (Bug#8869).
15169 2012-02-23 Chong Yidong <cyd@gnu.org>
15171 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15172 call when setting menu-bar-lines and tool-bar-lines parameters.
15173 (unwind_create_frame_1): New helper function.
15175 * window.c (inhibit_window_configuration_change_hook): New var.
15176 (run_window_configuration_change_hook): Obey it.
15177 (syms_of_window): Initialize it.
15179 2012-02-22 Chong Yidong <cyd@gnu.org>
15181 * xterm.c (x_draw_image_relief): Add missing type check for
15182 Vtool_bar_button_margin (Bug#10743).
15184 2012-02-21 Chong Yidong <cyd@gnu.org>
15186 * fileio.c (Vfile_name_handler_alist): Doc fix.
15188 * buffer.c (Fget_file_buffer): Protect against invalid file
15189 handler return value.
15191 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15193 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15194 when computing $valmask.
15196 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15197 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15198 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15199 It's useless in that case, and it can cause problems on hosts
15200 that allocate halves of EMACS_INT values separately.
15201 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15202 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15203 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15204 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15205 it avoids undefined behavior on hosts where shifting right by more
15206 than the word width has undefined behavior.
15208 2012-02-19 Chong Yidong <cyd@gnu.org>
15210 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15211 (Funhandled_file_name_directory, Ffile_name_as_directory)
15212 (Fdirectory_file_name, Fexpand_file_name)
15213 (Fsubstitute_in_file_name): Protect against invalid file handler
15214 return values (Bug#10845).
15216 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15218 * .gdbinit (pitx): Fix incorrect references to fields of the
15221 2012-02-17 Chong Yidong <cyd@gnu.org>
15223 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15225 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15227 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15228 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15230 2012-02-15 Chong Yidong <cyd@gnu.org>
15232 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15233 marked as special. Also, starting docstrings with * is obsolete.
15235 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15237 * gnutls.c (emacs_gnutls_write): Fix last change.
15239 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15241 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15244 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15246 * keymap.c (Fsingle_key_description): Handle char ranges.
15248 2012-02-12 Chong Yidong <cyd@gnu.org>
15250 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15251 as that creates a dangerous corner case.
15253 * window.c (Fdelete_window_internal): Invalidate the mouse
15254 highlight (Bug#9904).
15256 2012-02-12 Glenn Morris <rgm@gnu.org>
15258 * xselect.c (Fx_own_selection_internal)
15259 (Fx_get_selection_internal, Fx_disown_selection_internal)
15260 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15261 * nsselect.m (Fx_own_selection_internal)
15262 (Fx_disown_selection_internal, Fx_selection_exists_p)
15263 (Fx_selection_owner_p, Fx_get_selection_internal):
15264 Sync docs and argument specs with the xselect.c versions.
15266 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15268 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15270 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15272 * w32select.c (Fx_selection_exists_p): Sync doc string and
15273 argument list with xselect.c. (Bug#10783)
15275 * w16select.c (Fx_selection_exists_p): Sync doc string and
15276 argument list with xselect.c. (Bug#10783)
15278 2012-02-10 Glenn Morris <rgm@gnu.org>
15280 * fns.c (Fsecure_hash): Doc fix.
15282 2012-02-09 Kenichi Handa <handa@m17n.org>
15284 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15286 2012-02-07 Chong Yidong <cyd@gnu.org>
15288 * buffer.c (Fbuffer_local_variables)
15289 (buffer_lisp_local_variables): Handle unbound vars correctly;
15290 don't let Qunbound leak into Lisp.
15292 2012-02-07 Glenn Morris <rgm@gnu.org>
15294 * image.c (Fimagemagick_types): Doc fix.
15296 * image.c (imagemagick-render-type): Change it from a lisp object
15297 to an integer. Move the doc here from the lisp manual.
15298 Treat all values not equal to 0 the same.
15300 2012-02-06 Chong Yidong <cyd@gnu.org>
15302 * doc.c (store_function_docstring): Avoid applying docstring of
15303 alias to base function (Bug#2603).
15305 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15307 * .gdbinit (pp1, pv1): Remove redundant defines.
15310 2012-02-04 Chong Yidong <cyd@gnu.org>
15312 * nsterm.m: Declare a global (Bug#10694).
15314 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15316 * w32.c (get_emacs_configuration_options):
15317 Include --enable-checking, if specified, in the return value.
15319 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15321 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15322 after rounding frame sizes. (Bug#9723)
15324 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15326 * keyboard.c (adjust_point_for_property): Don't position point
15327 before BEGV. (Bug#10696)
15329 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15331 Handle overflow when computing char display width (Bug#9496).
15332 * character.c (char_width): Return EMACS_INT, not int.
15333 (char_width, c_string_width): Check for overflow when
15334 computing the width; this is possible now that individual
15335 characters can have unbounded width. Problem introduced
15336 by merge from Emacs 23 on 2012-01-19.
15338 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15340 * dbusbind.c (Fdbus_register_method): Mention the return value
15341 :ignore in the docstring.
15343 2012-02-02 Glenn Morris <rgm@gnu.org>
15345 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15347 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15348 Unconditionally set to t. (Bug#10673)
15349 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15350 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15351 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15353 2012-02-02 Kenichi Handa <handa@m17n.org>
15355 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15356 0, do not call append_composite_glyph.
15358 2012-02-02 Kenichi Handa <handa@m17n.org>
15360 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15362 (x_produce_glyphs): If the component of a composition is a null
15363 string, set it->pixel_width to 1 to avoid zero-width glyph.
15365 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15367 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15368 first 2 arguments are identical. This makes inserting large
15369 output from a subprocess an order of magnitude faster on
15370 MS-Windows, where all sbrk'ed memory is always contiguous.
15372 2012-01-31 Glenn Morris <rgm@gnu.org>
15374 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15375 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15376 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15378 2012-01-29 Glenn Morris <rgm@gnu.org>
15380 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15382 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15384 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15386 2012-01-28 Chong Yidong <cyd@gnu.org>
15388 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15390 2012-01-26 Chong Yidong <cyd@gnu.org>
15392 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15394 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15395 repeat counts (Bug#10507).
15397 2012-01-26 Glenn Morris <rgm@gnu.org>
15399 * lread.c (syms_of_lread): Doc fix.
15401 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15403 * coding.c (encode_designation_at_bol): Change return value to
15406 2012-01-25 Chong Yidong <cyd@gnu.org>
15408 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15410 2012-01-21 Chong Yidong <cyd@gnu.org>
15412 * floatfns.c (Fcopysign): Make the second argument non-optional,
15413 since nil is not allowed anyway.
15415 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15417 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15418 (send_process): Likewise.
15420 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15422 * window.c (save_window_save, Fcurrent_window_configuration)
15423 (Vwindow_persistent_parameters): Do not use Qstate.
15424 Rewrite doc-strings.
15426 2012-01-19 Kenichi Handa <handa@m17n.org>
15428 * character.c (char_width): New function.
15429 (Fchar_width, c_string_width, lisp_string_width):
15430 Use char_width (Bug#9496).
15432 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15434 * window.c (Vwindow_persistent_parameters): New variable.
15435 (Fset_window_configuration, save_window_save): Handle persistent
15438 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15440 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15441 thrashing the stack of the thread. (Bug#9087)
15443 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15445 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15447 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15449 * xdisp.c (rows_from_pos_range): Handle the case where the
15450 highlight ends on a newline. (Bug#10464)
15451 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15452 he end column for display of highlight that ends on a newline
15455 2012-01-11 Glenn Morris <rgm@gnu.org>
15457 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15458 from load-path also when installation-directory is nil. (Bug#10208)
15460 2012-01-10 Glenn Morris <rgm@gnu.org>
15462 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15464 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15465 Update template values to be closer to their typical values these days.
15467 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15469 * xdisp.c (rows_from_pos_range): Accept additional argument
15470 DISP_STRING, and accept any glyph in a row whose object is that
15471 string as eligible for mouse highlight. Fixes mouse highlight of
15472 display strings from overlays. (Bug#10464)
15474 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15476 emacs: fix an auto-save permissions race condition (Bug#10400)
15477 * fileio.c (auto_saving_dir_umask): New static var.
15478 (Fmake_directory_internal): Use it.
15479 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15480 creating the directory. The old code temporarily assigns
15481 too-generous permissions to the directory.
15482 (do_auto_save_eh): Clear it.
15483 (Fdo_auto_save): Catch all errors, not just file errors, so
15484 that the var is always cleared.
15486 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15488 * search.c (scan_buffer): Pass character positions to
15489 know_region_cache, not byte positions. (Bug#6540)
15491 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15493 * w32.c (sys_rename): Report EXDEV when rename of a directory
15494 fails because the target is on another logical disk. (Bug#10284)
15496 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15498 * xterm.c (x_embed_request_focus): New function.
15500 * xterm.h: Add prototype.
15502 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15504 2012-01-05 Glenn Morris <rgm@gnu.org>
15506 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15508 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15510 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15511 Load gnutls_transport_set_lowat only if GnuTLS version is below
15513 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15514 GnuTLS versions below 2.11.1.
15516 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15518 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15519 to the doc string advising against its use for altering the way
15520 windows are scrolled.
15522 2011-12-28 Kenichi Handa <handa@m17n.org>
15524 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15525 coding-system ASCII compatible only when it does not produce BOM
15526 on encoding (Bug#10383).
15528 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15530 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15532 (create_and_show_popup_menu): Always use menu_position_func for
15535 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15537 * callint.c (Fcall_interactively): Don't truncate prompt string.
15539 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15541 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15542 property that ends at ZV, so that the bidi iteration could be
15543 resumed from there (after widening). (Bug#10360)
15545 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15547 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15549 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15551 * nsterm.m (x_free_frame_resources):
15552 Release f->output_data.ns->miniimage.
15553 (ns_index_color): Fix indentation. Do not retain
15554 color_table->colors[i].
15556 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15559 * nsfns.m (x_set_background_color): Assign return value from
15560 ns_index_color to face-background instead of NSColor*.
15561 (ns_implicitly_set_icon_type): Fix indentation.
15562 Change assignment in for loop to comparison.
15564 * emacs.c (ns_pool): New variable.
15565 (main): Assign ns_pool.
15566 (Fkill_emacs): Call ns_release_autorelease_pool.
15568 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15569 autorelease fdesc, release fdAttrs and tdict.
15570 (ns_get_covering_families): Release charset.
15571 (ns_findfonts): Release NSFontDescriptor created with new.
15572 (ns_uni_to_glyphs): Fix indentation.
15573 (setString): Release attrStr before assigning new value.
15575 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15577 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15579 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15580 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15582 2011-12-18 David Reitter <reitter@cmu.edu>
15584 * nsterm.m (ns_term_init): Subscribe for notifications
15585 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15586 to method trackingNotification in EmacsMenu.
15588 * nsmenu.m (trackingMenu): New variable.
15589 (trackingNotification): New method (from Aquamacs).
15590 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15591 from Aquamacs (Bug#7030).
15593 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15595 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15596 (symbol_to_nsstring): Fix indentation.
15597 (ns_symbol_to_pb): New function.
15598 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15599 (Fns_rotate_cut_buffers_internal): Remove.
15600 (Fns_store_selection_internal): Rename from
15601 Fns_store_cut_buffer_internal.
15602 (ns_get_foreign_selection, Fx_own_selection_internal)
15603 (Fx_disown_selection_internal, Fx_selection_exists_p)
15604 (Fns_get_selection_internal, Fns_store_selection_internal):
15605 Use ns_symbol_to_pb and check if return value is nil.
15606 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15607 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15608 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15609 renamed to Sns_store_selection_internal.
15610 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15611 and remove this function.
15612 (ns_handle_selection_clear): Remove, never used.
15613 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15616 2011-12-17 Ken Brown <kbrown@cornell.edu>
15618 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15619 GID is unknown (Bug#10257).
15621 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15623 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15624 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15625 which caused a build failure on GNU/Linux IA-64. This problem was
15626 introduced by my 2011-10-07 patch.
15628 2011-12-15 Juri Linkov <juri@jurta.org>
15630 * image.c (imagemagick_error): New function. (Bug#10112)
15631 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15632 Use `imagemagick_error' where ImageMagick functions return
15634 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15637 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15639 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15640 fill background (Bug#8992).
15642 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15644 * window.c (Vwindow_combination_resize)
15645 (Vwindow_combination_limit): Use t instead of non-nil in
15647 (Vrecenter_redisplay): Add first sentence of doc-string on
15649 (Frecenter): Fix doc-string typo.
15651 2011-12-11 Kenichi Handa <handa@m17n.org>
15653 * coding.c (Funencodable_char_position): Pay attention to the
15654 buffer text relocation (Bug#9389).
15656 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15658 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15659 gtk_init (Bug#10100).
15661 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15663 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15664 IT->string is nil. (Bug#10263)
15666 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15668 * nsterm.h (x_free_frame_resources): Declare.
15670 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15671 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15673 * nsterm.h (ns_get_defaults_value): Declare.
15675 * nsterm.m (ns_default): Call ns_get_defaults_value.
15677 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15679 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15682 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15684 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15685 that where the value of an _OBJC_* symbol points to is in the .bss
15686 section (Bug#10240).
15688 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15690 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15691 after the loop to call ccl_driver at least once (Bug#8619).
15693 2011-12-08 Kenichi Handa <handa@m17n.org>
15695 * ftfont.c (get_adstyle_property): Fix previous change
15698 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15700 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15701 dirs from the default value of EMACSLOADPATH (bug#10208).
15703 2011-12-07 Glenn Morris <rgm@gnu.org>
15705 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15706 installation and source directories as well. (Bug#10208)
15708 2011-12-06 Chong Yidong <cyd@gnu.org>
15710 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15712 2011-12-06 Glenn Morris <rgm@gnu.org>
15714 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15715 as an error, not just -1. (Bug#10217)
15717 2011-12-05 Chong Yidong <cyd@gnu.org>
15719 * keyboard.c (process_special_events): New function.
15720 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15722 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15724 * coding.c (encode_designation_at_bol): Don't use uninitialized
15725 local variable (Bug#9318).
15727 2011-12-05 Kenichi Handa <handa@m17n.org>
15729 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15730 return Qnil (Bug#8046, Bug#10193).
15732 2011-12-05 Kenichi Handa <handa@m17n.org>
15734 * coding.c (encode_designation_at_bol): New args charbuf_end and
15735 dst. Return the number of produced bytes. Callers changed.
15736 (coding_set_source): Return how many bytes coding->source was
15738 (coding_set_destination): Return how many bytes
15739 coding->destination was relocated.
15740 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15741 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15743 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15745 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15746 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15749 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15751 The following changes are to fix Bug#9318.
15753 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15754 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15755 (encode_coding_iso_2022, encode_coding_sjis)
15756 (encode_coding_big5, encode_coding_charset): Use the above macros.
15758 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15760 * lisp.h (process_quit_flag): Fix external declaration.
15762 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15764 Don't macro-inline non-performance-critical code.
15765 * eval.c (process_quit_flag): New function.
15766 * lisp.h (QUIT): Use it.
15768 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15770 * nsfns.m (get_geometry_from_preferences): New function.
15771 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15773 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15775 * emacs.c (Qkill_emacs): Define.
15776 (syms_of_emacs): Initialize it.
15777 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15778 Qquit_flag to `kill-emacs' instead.
15779 (quit_throw_to_read_char): Add parameter `from_signal'.
15780 All callers changed. Call Fkill_emacs if requested and safe.
15781 * lisp.h (QUIT): Call Fkill_emacs if requested.
15783 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15785 * widget.c (update_wm_hints): Return if wmshell is null.
15786 (widget_update_wm_size_hints): New function.
15788 * widget.h (widget_update_wm_size_hints): Declare.
15790 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15791 widget_update_wm_size_hints (Bug#10104).
15793 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15795 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15796 before a newline, prepare the bidi iterator for consuming the
15797 newline, and keep the current paragraph direction. (Bug#10183)
15798 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15800 2011-12-02 Juri Linkov <juri@jurta.org>
15802 * search.c (Fword_search_regexp): New Lisp function created from
15803 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15804 (Fword_search_backward, Fword_search_forward)
15805 (Fword_search_backward_lax, Fword_search_forward_lax):
15806 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15807 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15809 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15811 * fileio.c (Finsert_file_contents): Move after-change-function call
15812 to before the "handled:" label, since all "goto handled" appear in
15813 cases where the *-change-functions have already been properly called
15816 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15818 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15819 waiting for input. (Bug#10169)
15821 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15823 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15824 verifies glyph row's hash code--we have just reallocated the
15825 glyphs, so their contents can be complete garbage. (Bug#10164)
15827 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15829 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15831 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15833 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15834 attributes are tested _before_ calling verify_row_hash, to protect
15835 against GCC re-ordering of the tests. (Bug#10164)
15837 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15839 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15841 * xterm.c (handle_one_xevent): Only set async_visible and friends
15842 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15843 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15844 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15846 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15848 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15849 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15850 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15851 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15852 All uses changed to use GCPRO1 etc.
15853 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15854 Revert to old implementation (i.e., before 2011-03-11).
15856 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15858 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15859 of scroll runs so as to avoid assigning disabled bogus rows and
15860 unnecessary graphics copy operations.
15862 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15864 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15865 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15866 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15867 (malloc, free, realloc, calloc): Redirect to e_* only when
15870 * lisp.h (GCTYPEBITS): Move before first use.
15871 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15872 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15873 this macro definition.
15875 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15878 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15880 * gtkutil.c (xg_create_frame_widgets):
15881 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15882 present with Gtk+ 2.0.
15884 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15886 * fileio.c (Finsert_file_contents): Undo previous change; see
15887 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15889 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15891 Rename locals to avoid shadowing.
15892 * fileio.c (Finsert_file_contents):
15893 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15894 * process.c (wait_reading_process_output):
15895 Rename inner 'proc' to 'p' to avoid shadowing.
15896 Indent for consistency with usual Emacs style.
15898 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15900 * xdisp.c (redisplay_window): If cursor row is not fully visible
15901 after recentering, and scroll-conservatively is set to a large
15902 number, scroll window by a few more lines to make the cursor fully
15903 visible and out of scroll-margin. (Bug#10105)
15904 (start_display): Don't move to the next line if the display should
15905 start at a newline that is part of a display vector or an overlay
15906 string. (Bug#10119)
15908 2011-11-24 Juri Linkov <juri@jurta.org>
15910 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15911 after the `MagickPingImage' call. (Bug#10112)
15913 2011-11-23 Chong Yidong <cyd@gnu.org>
15915 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15917 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15919 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15920 making another buffer current. (Bug#10114)
15922 2011-11-23 Glenn Morris <rgm@gnu.org>
15924 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15926 2011-11-23 Chong Yidong <cyd@gnu.org>
15928 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15929 using it (Bug#5984).
15931 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15933 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15934 and header-lines, as they don't have one computed for them.
15937 * .gdbinit (prow): Make displayed values more self-explaining.
15938 Add row's hash code.
15940 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15942 * process.c (wait_reading_process_output): Fix asynchrounous
15943 GnuTLS socket handling on some versions of the GnuTLS library.
15944 (wait_reading_process_output): Add comment and URL.
15946 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15948 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15950 2011-11-21 Chong Yidong <cyd@gnu.org>
15952 * window.c (Fnext_window, Fprevious_window): Doc fix.
15954 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15956 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15958 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15960 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15962 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15964 * window.c (Fset_window_combination_limit): Rename argument
15966 (Vwindow_combination_limit): Remove "status" from doc-string.
15968 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15970 * m/ibms390.h: Remove.
15971 * m/ibms390x.h: Don't include "ibms390.h".
15973 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15975 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15976 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15978 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15980 * casetab.c (Fset_case_table):
15981 * charset.c (Fcharset_after): Fix typos.
15983 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15985 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15986 Otherwise, valgrind does not work on some platforms.
15987 Problem reported by Andreas Schwab in
15988 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15989 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15990 is set, removing the need for VIRT_ADDRESS_VARIES.
15991 (PURE_P): Use a more-efficient implementation that needs just one
15992 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15993 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15994 to 4 (xorl, subq, cmpq, setbe).
15995 * alloc.c (pure): Always extern now, since that's the
15996 VIRT_ADDR_VARIES behavior.
15997 (PURE_POINTER_P): Use a single comparison, not two, for
15998 consistency with the new puresize.h.
15999 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16000 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16001 Remove VIRT_ADDR_VARIES no longer needed.
16003 2011-11-19 Eli Zaretskii <eliz@gnu.org>
16005 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16006 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16007 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16008 behave as if the cursor position were at the window margin.
16010 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16011 and the cursor position is out of bounds, behave as if the cursor
16012 position were at the window margin. (Bug#10075)
16014 2011-11-18 Chong Yidong <cyd@gnu.org>
16016 * window.c (Fwindow_combination_limit): Make first argument
16017 non-optional, since it is meaningless for live windows like the
16020 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16022 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16024 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16026 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16027 (graft_intervals_into_buffer): Simplify.
16029 2011-11-18 Eli Zaretskii <eliz@gnu.org>
16031 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16032 hash values of the two rows.
16033 (copy_row_except_pointers): Preserve the used[] arrays and the
16034 hash values of the two rows. (Bug#10035)
16035 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16037 * xdisp.c (row_hash): New function, body extracted from
16038 compute_line_metrics.
16039 (compute_line_metrics): Call row_hash, instead of computing the
16042 * dispnew.c (verify_row_hash): Call row_hash for computing the
16043 hash code of a row, instead of duplicating code from xdisp.c.
16045 * dispextern.h (row_hash): Add prototype.
16047 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16049 * frame.c (delete_frame): Don't delete the terminal when the last
16050 X frame is closed if emacs is built with GTK toolkit.
16052 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
16054 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16056 2011-11-17 Martin Rudalics <rudalics@gmx.at>
16058 * window.c (Vwindow_splits): Rename to
16059 Vwindow_combination_resize. Suggested by Juri Linkov.
16060 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16063 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
16065 * nsfns.m (Fns_font_name):
16066 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16068 2011-11-16 Martin Rudalics <rudalics@gmx.at>
16070 * window.h (window): Rename slot "nest" to "combination_limit".
16071 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16072 (Fset_window_nest): Rename to Fset_window_combination_limit.
16073 (Vwindow_nest): Rename to Vwindow_combination_limit.
16074 (recombine_windows, make_parent_window, make_window)
16075 (Fsplit_window_internal, saved_window)
16076 (Fset_window_configuration, save_window_save): Rename all
16077 occurrences of window_nest to window_combination_limit.
16079 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
16081 * image.c (imagemagick_load_image): Fix typo.
16083 2011-11-14 Eli Zaretskii <eliz@gnu.org>
16085 * xdisp.c (display_line): Move the call to
16086 highlight_trailing_whitespace before the call to
16087 compute_line_metrics, since the latter needs to see the final
16088 faces of all the glyphs to compute ROW's hash value.
16089 Fixes assertion violations in row_equal_p. (Bug#10035)
16091 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
16093 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16094 just return (bug#10044).
16096 2011-11-12 Eli Zaretskii <eliz@gnu.org>
16098 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16099 with user-defined heap size. Bump the default size of the temacs
16100 heap to 27MB, to avoid memory warning when running temacs.
16101 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16103 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16104 current_matrix and desired_matrix. (Bug#9990)
16105 (verify_row_hash) [XASSERTS]: New function.
16106 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16107 that the hash value of glyph rows is correct.
16109 2011-11-12 Martin Rudalics <rudalics@gmx.at>
16111 * window.h (window): Remove splits slot.
16112 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16113 (Fdelete_other_windows_internal, make_parent_window)
16114 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16115 (Fset_window_configuration, save_window_save): Don't deal with
16116 split status of windows.
16117 (saved_window): Remove splits slot.
16118 (Vwindow_splits): Rewrite doc-string.
16120 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16122 * xfns.c (unwind_create_frame):
16123 * nsfns.m (unwind_create_frame):
16124 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16125 Vframe_list (Bug#9999).
16127 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16129 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16131 2011-11-11 Kenichi Handa <handa@m17n.org>
16133 * callproc.c (Fcall_process): Set the member dst_multibyte of
16136 2011-11-11 Johan Bockgård <bojohan@gnu.org>
16138 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16139 avoid a crash (bug#9496).
16141 2011-11-09 Chong Yidong <cyd@gnu.org>
16143 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16144 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16146 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16148 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16150 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16152 Avoid some portability problems by eschewing 'extern inline' functions.
16153 The trivial performance wins aren't worth the portability hassles; see
16154 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16156 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16157 (window_box_width, window_box_left, window_box_left_offset)
16158 (window_box_right, window_box_right_offset): Undo previous change,
16159 by removing the "extern"s.
16160 * intervals.c (adjust_intervals_for_insertion)
16161 (adjust_intervals_for_deletion): Undo previous change,
16162 making these static again.
16163 (offset_intervals, temp_set_point_both, temp_set_point)
16164 (copy_intervals_to_string): No longer inline.
16165 * xdisp.c (window_text_bottom_y, window_box_width)
16166 (window_box_height, window_box_left_offset)
16167 (window_box_right_offset, window_box_left, window_box_right)
16168 (window_box): No longer inline.
16170 2011-11-08 Chong Yidong <cyd@gnu.org>
16172 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16173 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16174 Signal an error if not a live window.
16175 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16176 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16178 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16180 * lisp.h (syms_of_abbrev): Remove declaration.
16181 Reported by CHENG Gao <chenggao@royau.me>.
16183 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16185 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16186 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16187 of temacs in GUI mode.
16189 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16191 * window.h: Declare delete_all_child_windows instead of
16192 delete_all_subwindows.
16193 * window.c (Fwindow_nest, Fset_window_nest)
16194 (Fset_window_new_total, Fset_window_new_normal)
16195 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16196 (delete_all_subwindows): Rename to delete_all_child_windows.
16197 (Fdelete_other_windows_internal, Fset_window_configuration):
16198 Call delete_all_child_windows instead of delete_all_subwindows.
16199 * frame.c (delete_frame): Call delete_all_child_windows instead
16200 of delete_all_subwindows.
16202 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16204 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16205 This is also needed for porting to any host where GC_MARK_STACK is
16206 not GC_MAKE_GCPROS_NOOPS.
16207 (which_symbols): Use it.
16209 2011-11-07 Kenichi Handa <handa@m17n.org>
16211 * coding.c (coding_set_destination): Check coding->src_pos only
16212 when coding->src_object is a buffer (bug#9910).
16214 * process.c (send_process): Set the member src_multibyte of coding
16215 to 0 (bug#9911) when sending a unibyte text.
16217 * callproc.c (Fcall_process): Set the member src_multibyte of
16218 process_coding to 0 (bug#9912).
16220 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16222 * xmenu.c (cleanup_widget_value_tree): New function.
16223 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16224 calling free_menubar_widget_value_tree directly (Bug#9830).
16226 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16228 Fix some portability problems with 'inline'.
16229 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16230 (window_box_width, window_box_left, window_box_left_offset)
16231 (window_box_right, window_box_right_offset): Declare extern.
16232 Otherwise, these inline functions do not conform to C99 and
16233 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16234 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16235 * intervals.c (adjust_intervals_for_insertion)
16236 (adjust_intervals_for_deletion): Now extern, because otherwise the
16237 extern inline functions 'offset_intervals' couldn't refer to it.
16238 (static_offset_intervals): Remove.
16239 (offset_intervals): Rewrite using the old contents of
16240 static_offset_intervals. The old version didn't conform to C99
16241 because an extern inline function contained a reference to an
16242 identifier with static linkage.
16244 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16246 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16249 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16251 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16252 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16253 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16254 return Qleft_to_right.
16256 2011-11-06 Chong Yidong <cyd@gnu.org>
16258 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16259 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16260 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16261 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16262 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16263 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16264 (Fwindow_vscroll): Doc fix.
16265 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16266 argument, since it makes no sense to pass a live window and for
16267 consistency with window-child.
16269 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16271 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16274 2011-11-05 Jason Rumney <jasonr@gnu.org>
16276 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16277 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16279 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16280 bitwise arithmetic preventing use of unicode-sip and non-truetype
16283 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16285 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16288 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16289 initialization code to keep similarity to xfns.c after changes
16292 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16294 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16295 (unwind_create_frame): New function (Bug#9943).
16296 (Fx_create_frame): Restructure code to be more similar to the one in
16297 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16298 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16299 Move terminal->reference_count++ just before making the frame official
16302 * nsterm.m (x_free_frame_resources): New function.
16303 (x_destroy_window): Move code to x_free_frame_resources.
16305 * xfns.c (unwind_create_frame): Fix comment.
16306 (Fx_create_frame, x_create_tip_frame):
16307 Move terminal->reference_count++ just before making the frame
16308 official. Move initialization of image_cache_refcount and
16309 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16311 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16313 Support MSVC build with newer versions of Visual Studio.
16314 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16315 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16318 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16319 which are not supported by MSVC.
16320 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16321 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16323 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16324 types in bitfields.
16325 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16327 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16329 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16331 Support MSVC build with newer versions of Visual Studio.
16332 * w32.c: Don't include w32api.h for MSVC.
16333 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16335 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16336 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16337 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16338 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16340 (alloca) [_MSC_VER]: Define to _alloca.
16342 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16344 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16346 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16348 * xdisp.c (note_mouse_highlight): If either of
16349 previous/next-single-property-change returns nil, treat that as
16350 the beginning or the end of the buffer. (Bug#9955)
16352 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16354 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16355 label is not null (Bug#9951).
16356 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16359 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16361 * window.c (Fwindow_body_size): Mention in the doc string that the
16362 return value is in frame's canonical units. (Bug#9949)
16364 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16366 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16368 * w32fns.c (unwind_create_frame): If needed, free the glyph
16369 matrices of the partially constructed frame. (Bug#9943)
16370 * xfns.c (unwind_create_frame): Likewise.
16372 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16374 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16375 Don't stop backward scan on the continuation glyph, even though
16376 its CHARPOS is positive.
16377 (mouse_face_from_buffer_pos, note_mouse_highlight):
16378 Rename cover_string to disp_string.
16380 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16382 * window.c (temp_output_buffer_show): Don't use
16383 Vtemp_buffer_show_specifiers.
16384 (Vtemp_buffer_show_specifiers): Remove unused variable.
16386 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16388 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16389 past the beginning of the current glyph matrix.
16391 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16393 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16394 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16395 HAVE_GTK3 (Bug#9869).
16397 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16398 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16400 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16402 * xterm.c: Declare x_handle_net_wm_state to return int.
16403 (handle_one_xevent): Check if we are iconified but don't have
16404 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16405 (get_current_wm_state): Return non-zero if not hidden,
16406 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16407 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16408 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16409 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16411 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16413 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16414 so that this new function doesn't get optimized away by a
16415 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16417 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16419 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16421 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16423 Fix the `xbytecode' command.
16424 * .gdbinit (xprintbytestr): New command.
16425 (xwhichsymbols): Rename from `which'; all callers changed.
16426 (xbytecode): Print the byte-code string as well.
16428 2011-10-29 Kim Storm <storm@cua.dk>
16430 * alloc.c (which_symbols): New function.
16432 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16434 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16437 2011-10-29 Glenn Morris <rgm@gnu.org>
16439 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16440 Not clear what it was for, and it causes various bugs. (Bug#9839)
16442 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16444 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16445 possible random value that matches one of those tested as
16446 condition to clear the mouse face.
16448 2011-10-28 Chong Yidong <cyd@gnu.org>
16450 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16452 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16454 * window.c (make_window): Initialize phys_cursor_on_p.
16456 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16458 * lisp.h (struct Lisp_Symbol): Update comments.
16460 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16462 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16464 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16466 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16467 <oslsachem@gmail.com> for helping to debug this.
16469 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16470 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16471 (g_b_init_get_glyph_outline_w): New static variables.
16472 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16473 (GetGlyphOutlineW_Proc): New typedefs.
16474 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16475 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16477 (w32font_open_internal, compute_metrics):
16478 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16479 instead of calling the "wide" APIs directly.
16481 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16483 * w32.h (syms_of_w32font): Add prototype.
16485 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16487 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16488 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16489 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16490 (Fmove_to_window_line): Doc fix.
16492 2011-10-27 Chong Yidong <cyd@gnu.org>
16494 * process.c (make_process): Set gnutls_state to NULL.
16496 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16497 non-NULL, regardless of GNUTLS_INITSTAGE.
16498 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16499 an error. Set process slots as soon as we allocate them.
16501 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16503 2011-10-27 Chong Yidong <cyd@gnu.org>
16505 * gnutls.c (emacs_gnutls_deinit): New function.
16506 Deallocate credentials structures as well as calling gnutls_deinit.
16507 (Fgnutls_deinit, Fgnutls_boot): Use it.
16509 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16510 (deactivate_process): Call emacs_gnutls_deinit.
16512 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16514 * image.c (x_create_x_image_and_pixmap):
16515 * w32.c (sys_rename, w32_delayed_load):
16516 * w32font.c (fill_in_logfont):
16517 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16519 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16521 * w32fns.c (w32_default_color_map): New function,
16522 extracted from Fw32_default_color_map.
16523 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16525 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16527 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16529 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16531 * keyboard.c (test_undefined): New function (bug#9751).
16532 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16534 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16536 * sysdep.c (init_sys_modes): Fix the check for the controlling
16537 terminal (Bug#6649).
16539 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16541 * dispextern.h (struct bidi_it): New member next_en_type.
16543 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16544 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16545 current character, check also for next_en_type being WEAK_EN.
16546 (bidi_resolve_weak): Don't enter the expensive loop if the current
16547 position is before next_en_pos. Record the bidi type of the first
16548 non-ET, non-BN character we find, in addition to its position.
16549 (bidi_level_of_next_char): Invalidate next_en_type when
16550 next_en_pos is over-stepped.
16552 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16554 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16555 * editfns.c: Rewrite current-time-zone so that it invokes
16556 the equivalent of (format-time-string "%Z") to get the time zone name.
16557 This fixes a bug when the time zone name contains characters that
16558 need converting from the system time locale to Emacs internal format.
16559 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16560 that patch fixed format-time-string to do the conversion, but
16561 I forgot to fix current-time-zone.
16562 (format_time_string): New function, containing most of
16563 what Fformat_time_string used to contain.
16564 (Fformat_time_string): Rewrite in terms of format_time_string.
16565 This doesn't change this function's behavior.
16566 (current-time-zone): Rewrite to use format_time_string.
16567 This fixes the bug reported by Michael Schierl in
16568 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16569 Jason Rumney's 2007-06-07 change worked around this bug, but
16571 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16573 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16575 * xdisp.c (start_display): If the character at POS is displayed
16576 via a display vector, reset IT->current.dpvec_index to zero.
16577 (try_window_reusing_current_matrix): If a line ends in a display
16578 vector or the next line starts in a display vector, continue
16579 redrawing the window even though the character position of
16580 start_row was reached.
16583 2011-10-18 Chong Yidong <cyd@gnu.org>
16585 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16586 with nobreak-char-display too.
16588 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16590 Fix part 3 of bug#9771.
16591 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16592 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16593 non-neutral characters if the current character is a paragraph
16594 separator (a.k.a. Newline). This avoids running the same
16595 expensive loop twice, once when we consume the preceding newline
16596 and the other time when the line actually needs to be displayed.
16597 Avoid the loop when we see neutrals on the base embedding level
16598 following a character whose directionality is the same as the
16599 paragraph's. This avoids running the expensive loop when a line
16600 ends in a long sequence of neutrals, like control characters.
16601 Add assertion against STRONG_AL type. Slightly rearrange code
16602 that determines the type of a neutral given the first non-neutral
16604 (bidi_level_of_next_char): Set next_en_pos to zero when
16605 invalidating its info.
16607 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16609 * xdisp.c (push_display_prop): Determine whether to record string
16610 or buffer position by IT->string, not by IT->method. Allow
16611 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16612 (move_it_vertically_backward): Don't look for character position
16613 immediately after the newline when in a continuation line.
16616 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16618 * window.c (coordinates_in_window): Rewrite and delabelize
16619 vertical border check. (Bug#5357) (Bug#9618)
16621 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16623 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16624 errors in XSetWindowBorder (bug#9310).
16626 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16628 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16629 avoid crash when xmalloc overrun checking is enabled.
16631 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16633 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16634 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16635 cursor motion with <left> and <right> arrow keys.
16637 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16638 some callers set that themselves.
16640 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16642 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16643 display string and the previous row comes from the same string and
16644 is empty. (Bug#9739) (Bug#9738)
16646 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16648 * doc.c (get_doc_string): Encode file name (bug#9735).
16650 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16652 * bidi.c (bidi_level_of_next_char):
16653 * xdisp.c (get_visually_first_element): Remove old incorrect
16654 comments regarding the Unicode Line Separator character.
16656 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16658 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16660 * alloc.c (Fgc_status): Do not access beyond zombies array
16661 boundary if nzombies > MAX_ZOMBIES.
16662 * alloc.c (dump_zombies): Add missing format specifier.
16664 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16666 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16667 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16669 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16670 Some packages use them to denote characters with modifiers.
16672 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16674 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16675 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16676 matching a pp-number. Rename parameter var to var1.
16678 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16680 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16682 2011-10-08 Glenn Morris <rgm@gnu.org>
16684 * callint.c (Fcall_interactively): Give a more explicit error for the
16685 'c' case with a non-character input. (Bug#8479)
16687 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16689 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16691 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16692 lines that are hscrolled on the left.
16694 * dispnew.c (buffer_posn_from_coords): Account for a possible
16695 presence of header-line. (Bug#4426)
16697 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16699 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16700 Don't advertise functionality which we discourage or doesn't work.
16702 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16704 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16705 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16706 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16707 this makes Emacs dump core during garbage collection on rare
16708 occasions. sizeof is obviously inferior to offsetof here, so
16709 stick with offsetof.
16710 (GC_POINTER_ALIGNMENT): New macro.
16711 (mark_memory): Omit 3rd (offset) arg; caller changed.
16712 Don't assume EMACS_INT alignment is the same as pointer alignment.
16714 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16716 * keyboard.c (read_key_sequence_remapped): New var.
16717 (read_key_sequence): Compute remapping in the right buffer.
16718 (command_loop_1): Use read_key_sequence's remapping directly.
16720 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16722 * dired.c (file_name_completion): Don't expand file name.
16723 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16724 before checking file name handler.
16726 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16727 they've been requested explicitly (bug#9591).
16729 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16731 * keymap.c (Fsingle_key_description): Use make_specified_string
16732 instead of build_string to build string from push_key_description.
16735 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16737 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16738 This fixes a Y2038 bug on 64-bit hosts.
16739 * buffer.c (reset_buffer):
16740 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16741 (Fclear_buffer_auto_save_failure):
16742 Use 0, not -1, to represent an unset failure time, since time_t
16743 might not be signed.
16745 Remove dependency on glibc malloc internals.
16746 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16747 Move back here from lisp.h, but with their new implementations.
16748 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16749 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16750 * charset.c (charset_table_init): New static var.
16751 (syms_of_charset): Use it instead of xmalloc. This removes a
16752 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16753 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16754 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16755 Move back to alloc.c.
16756 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16757 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16759 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16761 * nsterm.m (windowDidResize): Call x_set_window_size only when
16762 ns_in_resize is true. Otherwise set pixelwidth/height and
16763 call change_frame_size (Bug#9628).
16765 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16767 Port --enable-checking=all to Fedora 14 x86-64.
16768 * charset.c (syms_of_charset): Also account for glibc malloc's
16769 internal overhead when calculating the initial malloc maximum.
16771 Port --enable-checking=all to Fedora 14 x86.
16772 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16774 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16775 (overrun_check_realloc, overrun_check_free):
16776 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16777 That way, xmalloc returns a properly-aligned pointer even if
16778 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16779 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16780 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16781 into account when calculating the initial malloc maximum.
16782 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16783 Move here from alloc.c, so that charset.c can use it too.
16784 Properly align; the old code wasn't right for common 32-bit hosts
16785 when configured with --enable-checking=all.
16786 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16787 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16789 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16791 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16794 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16796 * xdisp.c (compute_display_string_end): If there's no display
16797 string at CHARPOS, return -1.
16799 * bidi.c (bidi_fetch_char): When compute_display_string_end
16800 returns a negative value, treat the character as a normal
16801 character not covered by a display string. (Bug#9624)
16803 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16805 * lread.c (Fread_from_string): Fix typo in docstring.
16807 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16809 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16810 newline, reseat the iterator instead of bidi-iterating there one
16811 character at a time. (Bug#9610)
16812 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16813 TO_CHARPOS if the bidi iterator is at base embedding level.
16815 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16817 * lread.c (readevalloop): Use correct code for NBSP.
16818 (read1): Likewise. (Bug#9608)
16820 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16822 * dbusbind.c (Fdbus_register_signal): When service is not
16823 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16825 2011-09-25 Glenn Morris <rgm@gnu.org>
16827 * buffer.c (truncate-lines): Doc fix.
16829 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16831 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16832 (Fset_window_next_buffers): Doc fix.
16834 2011-09-24 Glenn Morris <rgm@gnu.org>
16836 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16838 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16840 Fix minor problems found by static checking.
16841 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16842 * indent.c (Fvertical_motion): Fix == vs = typo.
16844 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16846 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16847 Default value is now t. Doc fix.
16849 * indent.c (Fvertical_motion): Compute and apply the overshoot
16850 logic when moving up, not only when moving down. Fix the
16851 confusing name and values of the it_overshoot_expected variable;
16852 logic changes accordingly. (Bug#9254) (Bug#9549)
16854 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16855 CHARPOS is covered by a display string which includes newlines.
16856 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16857 is covered by a display string with embedded newlines.
16859 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16861 * dbusbind.c (Fdbus_register_signal): Add match rule to
16862 Vdbus_registered_objects_table. (Bug#9581)
16863 (Fdbus_register_method, Vdbus_registered_objects_table):
16866 2011-09-24 Jim Meyering <meyering@redhat.com>
16868 do not ignore write error for any output size
16869 The previous change was incomplete.
16870 While it makes emacs --batch detect the vast majority of stdout
16871 write failures, errors were still ignored whenever the output size is
16872 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16873 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16874 && echo FAIL: ignored write error
16875 FAIL: ignored write error
16876 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16877 && echo FAIL: ignored write error
16878 FAIL: ignored write error
16879 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16881 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16883 * emacs.c (Fkill_emacs): In noninteractive mode exit
16884 non-successfully if a write error occurred on stdout. (Bug#9574)
16886 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16888 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16891 * dispextern.h (struct it): Update the comment documenting what
16894 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16896 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16897 a display string, extend search for cursor position to end of row.
16898 (find_row_edges): If the row ends in a newline from a display
16899 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16900 Handle the case of a display string with multiple newlines.
16901 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16902 non-empty line. Fixes confusing cursor motion with arrow keys at
16903 the beginning of a line that starts with whitespace.
16905 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16907 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16910 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16912 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16913 boolean (Bug#9154).
16915 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16917 * xdisp.c (display_line): Record maximum and minimum buffer
16918 positions even if no glyphs were produced (e.g., by a zero-width
16919 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16920 buffer positions that will be removed from the glyph row because
16922 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16923 column is beyond frame width: don't subtract 1 "pixel" when
16924 computing width of the stretch.
16925 (reseat_at_next_visible_line_start): Undo the change made on
16926 2011-09-17 that saved paragraph information and restored it after
16927 the call to `reseat'. (Bug#9545)
16929 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16931 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16932 and turn window cursor on if cleared (Bug#9415).
16934 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16936 * search.c (boyer_moore): Take unibyte characters from pattern
16937 literally. (Bug#9458)
16939 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16941 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16943 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16945 Fix minor problem found by static checking.
16946 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16947 initialized, to pacify gcc -Wuninitialized.
16949 * fileio.c: Report proper errno when syscall falls.
16950 (Finsert_file_contents): Save and restore errno,
16951 so that report_file_error outputs the correct diagnostic.
16952 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16954 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16956 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16958 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16960 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16961 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16963 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16965 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16966 about the current paragraph and restore it after the call to reseat.
16968 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16969 (bidi_find_paragraph_start): Search back for paragraph beginning
16970 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16971 (bidi_move_to_visually_next): Only trigger paragraph-related
16972 computations when the last character is a newline or at EOB, not
16973 just any NEUTRAL_B. (Bug#9470)
16975 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16976 truncated lines if point is covered by a display string. (Bug#9524)
16978 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16980 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16981 (cons_to_x_long): New function.
16982 (lisp_data_to_selection_data): Use it. Correct the test for
16983 short-versus-long data; it was negated. Break out of vector
16984 loop, for efficiency, when a long datum is discovered.
16986 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16988 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16990 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16992 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16993 GCC PR/17406) by declaring this function with external scope.
16995 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16997 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16998 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17000 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17002 * editfns.c (Fformat): Correctly handle text properties on "%%".
17004 2011-09-15 Eli Zaretskii <eliz@gnu.org>
17006 * xterm.c (x_draw_composite_glyph_string_foreground):
17007 * w32term.c (x_draw_composite_glyph_string_foreground):
17008 * term.c (encode_terminal_code):
17009 * composite.c (composition_update_it, get_composition_id):
17010 * xdisp.c (get_next_display_element)
17011 (fill_composite_glyph_string): Add comments about special meaning
17012 of TAB characters in a composition.
17014 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17016 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17017 This occurs when processing a multibyte format.
17018 Problem reported by Wolfgang Jenker.
17020 2011-09-15 Johan Bockgård <bojohan@gnu.org>
17022 * xdisp.c (try_cursor_movement): Only check for exact match if
17023 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17025 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17027 Remove unused external symbols.
17028 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17029 * xdisp.c (calc_pixel_width_or_height): Now static.
17030 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17031 * indent.c (check_display_width):
17032 * w32term.c: Fix comment to match code.
17033 * xterm.c, xterm.h (x_catching_errors): Remove.
17035 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17037 * xselect.c: Use signed conversions more consistently (Bug#9498).
17038 (selection_data_to_lisp_data): Assume incoming selection data are
17039 signed integers, not unsigned. This is to be consistent with
17040 outgoing selection data, which was modified to use signed integers
17041 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17042 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17043 expects long, not unsigned long.
17045 2011-09-14 Eli Zaretskii <eliz@gnu.org>
17047 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17048 computation of loop end. Reported by Johan Bockgård
17051 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
17053 * frame.c (Fother_visible_frames_p): Function deleted.
17055 2011-09-12 Eli Zaretskii <eliz@gnu.org>
17057 * indent.c (compute_motion): Process display vector front to back
17058 rather than the other way around. (Bug#2496)
17060 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17062 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17064 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
17066 * minibuf.c (Fread_from_minibuffer): Doc fix.
17068 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17070 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17071 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17073 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17075 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17076 value for non-existent files.
17078 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17080 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17081 set its "size" to -1. This will set the modtime_size field of
17082 the corresponding buffer to -1, which is what
17083 verify-visited-file-modtime expects for files that do not exist.
17086 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17088 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17090 * lisp.h: ... from here. push_key_description is no longer
17091 defined in keyboard.c, so its declaration should not be in
17092 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17093 logically belongs with push_key_description.
17095 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17097 * buffer.h: Include <sys/types.h> instead of <time.h>.
17098 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17099 Problem reported by Herbert J. Skuhra.
17101 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17103 * xml.c (parse_region): Make the parsing work for
17104 non-comment-starting XML files again (bug#9144).
17106 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17108 * image.c (gif_load): Fix calculation of bottom and right corner.
17111 2011-09-10 Eli Zaretskii <eliz@gnu.org>
17113 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17114 redisplay in small windows.
17116 2011-09-09 Eli Zaretskii <eliz@gnu.org>
17118 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17120 2011-09-08 Martin Rudalics <rudalics@gmx.at>
17122 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17123 Operate on live windows only.
17125 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
17127 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17129 2011-09-07 Eli Zaretskii <eliz@gnu.org>
17131 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17132 only under bidi iteration.
17134 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17136 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17138 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17140 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17141 Without this fix, the command to link temacs failed due to an
17142 undefined symbol __builtin_isnan. This is because
17143 /usr/include/iso/math_c99.h #defines isnan(x) to
17144 __builtin_isnan(x), but the bundled gcc, which identifies itself
17145 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17147 * floatfns.c (isnan): #undef, and then #define to a clone of
17149 (Fisnan): Always define, since it's always available now.
17150 (syms_of_floatfns): Always define isnan at the Lisp level.
17152 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17154 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17156 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17158 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17159 The previous code assumed that file offsets (off_t values) fit in
17160 EMACS_INT variables, which is not true on typical 32-bit hosts.
17161 The code messed up by falsely reporting buffer overflow in cases
17162 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17163 when "big" contains more than 2**29 bytes, even though this
17164 inserts just one byte and does not overflow the buffer.
17165 (Finsert_file_contents): Store file offsets as off_t
17166 values, not as EMACS_INT values. Check for overflow when
17167 converting between EMACS_INT and off_t. When checking for
17168 buffer overflow or for overlap, take the offsets into account.
17169 Don't use EMACS_INT for small values where int suffices.
17170 When checking for overlap, fix a typo: ZV was used where
17171 ZV_BYTE was intended.
17172 (Fwrite_region): Don't assume off_t fits into 'long'.
17173 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17175 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17177 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17179 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17181 sprintf-related integer and memory overflow issues (Bug#9412).
17183 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17184 (esprintf, exprintf, evxprintf): New functions.
17185 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17186 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17187 (modify_event_symbol): Do not assume that the length of
17188 name_alist_or_stem is safe to alloca and fits in int.
17189 (Fexecute_extended_command): Likewise for function name and binding.
17190 (Frecursion_depth): Wrap around reliably on integer overflow.
17191 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17192 since some callers pass EMACS_INT values.
17193 (Fsingle_key_description): Don't crash if symbol name contains more
17194 than MAX_ALLOCA bytes.
17195 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17196 (get_minibuffer): Arg is now EMACS_INT, not int.
17197 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17198 (esprintf, exprintf, evxprintf): New decls.
17199 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17201 * dbusbind.c (signature_cat): New function.
17202 (xd_signature, Fdbus_register_signal):
17203 Do not overrun buffer; instead, report string overflow.
17205 * dispnew.c (add_window_display_history): Don't overrun buffer.
17206 Truncate instead; this is OK since it's just a log.
17208 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17209 even if the time zone offset is outlandishly large.
17210 Don't mishandle offset == INT_MIN.
17212 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17213 when creating daemon; the previous buffer-overflow check was incorrect.
17215 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17216 which has the guts of the old verror function.
17218 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17219 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17221 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17222 (font_unparse_xlfd): Don't blindly alloca long strings.
17223 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17224 fits in int, when using sprintf. Use single snprintf to count
17225 length of string rather than counting it via multiple sprintfs;
17226 that's simpler and more reliable.
17227 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17228 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17229 sprintf, in case result does not fit in int.
17231 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17232 (fontset_from_font): Print it.
17234 * frame.c (tty_frame_count): Now printmax_t, not int.
17235 (make_terminal_frame, set_term_frame_name): Print it.
17236 (x_report_frame_params): In X, window IDs are unsigned long,
17237 not signed long, so print them as unsigned.
17238 (validate_x_resource_name): Check for implausibly long names,
17239 and don't assume name length fits in 'int'.
17240 (x_get_resource_string): Don't blindly alloca invocation name;
17241 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17244 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17245 (xg_check_special_colors, xg_set_geometry):
17246 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17248 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17249 Use esprintf, not sprintf, in case result does not fit in int.
17251 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17252 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17253 it as a large positive number.
17254 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17255 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17257 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17258 in case result does not fit in int.
17260 * print.c (float_to_string): Detect width overflow more reliably.
17261 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17262 buffer overrun. Don't assume list length fits in 'int'. Treat
17263 print length of 0 as 0, not as infinity; to be consistent with other
17264 uses of print length in this function. Don't overflow print length
17265 index. Don't assume hash table size fits in 'long', or that
17266 vectorlike size fits in 'unsigned long'.
17268 * process.c (make_process): Use printmax_t, not int, to format
17269 process-name gensyms.
17271 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17273 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17274 to avoid potential buffer overrun.
17276 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17277 if X resource line is longer than 512 bytes.
17279 * xfns.c (x_window): Make sprintf buffer a bit bigger
17280 to avoid potential buffer overrun.
17282 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17284 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17286 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17288 Integer overflow fixes for scrolling, etc.
17289 Without these, Emacs silently mishandles large integers sometimes.
17290 For example, "C-u 4294967297 M-x recenter" was treated as if
17291 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17293 * xdisp.c (try_window_id): Check Emacs fixnum range before
17294 converting to 'int'.
17296 * window.c (window_scroll_line_based, Frecenter):
17297 Check that an Emacs fixnum is in range before assigning it to 'int'.
17298 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17299 values converted from Emacs fixnums.
17300 (Frecenter): Don't wrap around a line count if it is out of 'int'
17301 range; instead, treat it as an extreme value.
17302 (Fset_window_configuration, compare_window_configurations):
17303 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17305 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17306 that can exceed INT_MAX. Check that EMACS_INT value is in range
17307 before assigning it to the (possibly-narrower) index.
17308 (match_limit): Don't assume that a fixnum can fit in 'int'.
17310 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17313 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17314 (Fvertical_motion): Don't wrap around LINES values that don't fit
17315 in 'int'. Instead, treat them as extreme values. This is good
17316 enough for windows, which can't have more than INT_MAX lines anyway.
17318 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17320 * Require libxml/parser.h to avoid compilation warning.
17322 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17324 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17325 since this reportedly can destroy thread storage.
17327 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17329 * syntax.c (find_defun_start): Update all cache variables if
17330 exiting early (Bug#9401).
17332 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17334 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17336 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17337 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17338 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17340 * term.c (tty_append_glyph): New function.
17341 (produce_stretch_glyph): Static function and its prototype deleted.
17343 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17346 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17348 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17349 when checking :margin (Bug#9390).
17350 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17351 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17352 so that the name doesn't mislead. All uses changed.
17354 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17356 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17359 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17361 * xdisp.c (move_it_to): Don't bail out early when reaching
17362 position beyond to_charpos, if we are scanning backwards.
17363 (move_it_vertically_backward): When DY == 0, make sure we get to
17364 the first character in the line after the newline.
17366 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17368 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17369 (ccl_driver): Do not generate an out-of-range pointer.
17370 (Fccl_execute_on_string): Remove unnecessary check for
17371 integer overflow, noted by Stefan Monnier in
17372 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17373 Remove a FIXME that didn't need fixing.
17374 Simplify the newly-introduced buffer reallocation code.
17376 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17378 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17380 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17382 Integer and memory overflow issues (Bug#9196).
17384 * doc.c (get_doc_string): Rework so that
17385 get_doc_string_buffer_size is the actual buffer size, rather than
17386 being 1 less than the actual buffer size; this makes xpalloc more
17389 * image.c (x_allocate_bitmap_record, cache_image):
17390 * xselect.c (Fx_register_dnd_atom):
17391 Simplify previous changes by using xpalloc.
17393 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17394 since either will do and ptrdiff_t is convenient with xpalloc.
17396 * charset.c (charset_table_size)
17397 (struct charset_sort_data.priority): Now ptrdiff_t.
17398 (charset_compare): Don't overflow if priorities differ greatly.
17399 (Fsort_charsets): Don't assume list length fits in int.
17400 Check for size-calculation overflow when allocating sort data.
17401 (syms_of_charset): Allocate an initial charset table that is
17402 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17404 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17406 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17407 The actual value is always <= INT_MAX, and leaving it unsigned made
17408 overflow checking harder.
17410 * dispextern.h (struct glyph_matrix.rows_allocated)
17411 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17412 with xpalloc. The values are still always <= INT_MAX.
17414 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17416 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17417 (SAFE_NALLOCA): New macro.
17419 * region-cache.c (struct boundary.pos, find_cache_boundary)
17420 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17421 (set_cache_region, invalidate_region_cache)
17422 (revalidate_region_cache, know_region_cache, region_cache_forward)
17423 (region_cache_backward, pp_cache):
17424 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17425 so that ptrdiff_t * can be passed to xpalloc.
17426 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17427 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17428 (pp_cache): Don't assume cache_len fits in int.
17429 * region-cache.h: Adjust extern decls to match.
17431 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17432 EMACS_INT, since either will do, for xpalloc.
17434 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17435 (xnmalloc, xnrealloc, xpalloc): New functions.
17437 * bidi.c (bidi_shelve_header_size): New constant.
17438 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17439 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17441 * bidi.c (bidi_cache_shrink):
17442 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17444 Don't update size of array until after memory allocation succeeds,
17445 because xmalloc/xrealloc may not return.
17446 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17447 now that we have proper integer overflow checking.
17448 (record_overlay_string, overlay_strings): Catch overflows when
17449 calculating size of overlay_str_buf.
17451 * callproc.c (Fcall_process): Check for size overflow when
17452 calculating size of args2.
17453 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17454 Normally we prefer signed values, but sticking with ptrdiff_t would
17455 require adding more-complicated checks.
17457 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17458 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17459 Redo buffer-overflow calculations to avoid integer overflow.
17460 Add a FIXME comment where memory seems to be over-allocated.
17462 * character.c (Fstring): Check for size-calculation overflow.
17464 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17465 unnecessary integer overflow. Check for size overflow.
17466 (encode_coding_object): Don't update size until xmalloc succeeds.
17468 * composite.c (get_composition_id): Check for overflow in glyph
17469 length calculations.
17471 Integer and memory overflow fixes for display code.
17472 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17473 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17474 (scrolling_window): Check for overflow in size calculations.
17475 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17476 Don't assume glyph table len fits in int.
17477 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17478 (row_table_size): Now ptrdiff_t, not int.
17479 (scrolling_window): Avoid overflow in size calculations.
17480 Don't update size until allocation succeeds.
17481 * fns.c (concat): Check for overflow in size calculations.
17482 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17483 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17484 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17486 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17487 (get_doc_string): Check for size calculation overflow.
17488 Don't update size until allocation succeeds.
17489 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17490 EMACS_INT, where ptrdiff_t will do.
17491 (Fsubstitute_command_keys): Check for string overflow.
17493 * editfns.c (set_time_zone_rule): Don't assume environment length
17495 (message_length): Now ptrdiff_t, not int.
17496 (Fmessage_box): Don't update size until allocation succeeds.
17497 Don't assume message length fits in int.
17498 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17500 * emacs.c (main): Do not reallocate argv, since there is a null at
17501 the end that can be overwritten, and this way there's no need to
17502 worry about size-calculation overflow.
17503 (sort_args): Check for size-calculation overflow.
17505 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17507 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17509 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17510 (x_set_scroll_bar_width, x_figure_window_size):
17511 Check for integer overflow.
17512 (x_set_alpha): Do not assume XINT fits in int.
17514 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17515 This is for the members text_lines, text_cols, total_lines, total_cols,
17516 where the system imposes an 'int' limit.
17518 * fringe.c (Fdefine_fringe_bitmap):
17519 Don't update size until alloc works.
17521 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17522 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17524 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17525 Check for size-calculation overflow.
17526 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17527 do, as we prefer signed integers.
17528 (id_to_widget.max_size, id_to_widget.used)
17529 (xg_store_widget_in_map, xg_remove_widget_from_map)
17530 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17531 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17532 Use and return ptrdiff_t, not int.
17533 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17534 * gtkutil.h: Change prototypes to match the above.
17536 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17537 are duplicate now that they've been promoted to lisp.h.
17538 (x_allocate_bitmap_record, x_alloc_image_color)
17539 (make_image_cache, cache_image, xpm_load):
17540 Don't update size until alloc is done.
17541 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17543 Check for size calculation overflow.
17544 (ct_colors_allocated_max): New constant.
17545 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17548 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17549 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17550 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17551 Use ptrdiff_t, not int, to count maps.
17552 (read_char_minibuf_menu_prompt): Check for overflow in size
17553 calculations. Don't update size until allocation succeeds.
17554 Redo calculations to avoid overflow.
17555 * keyboard.h: Change prototypes to match the above.
17557 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17559 (current_minor_maps): Check for size calculation overflow.
17560 * keymap.h: Change prototypes to match the above.
17562 * lread.c (read1, init_obarray): Don't update size until alloc done.
17564 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17565 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17567 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17568 Now ptrdiff_t, not int.
17569 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17570 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17572 * process.c (Fnetwork_interface_list): Check for overflow
17573 in size calculation.
17575 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17577 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17578 overflow. Don't bother calling xmalloc when xrealloc will do.
17580 * search.c (Freplace_match): Check for size calculation overflow.
17581 (Fset_match_data): Don't assume list lengths fit in 'int'.
17583 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17584 for command line length. Do not attempt to address one before the
17585 beginning of an array, as that's not portable.
17587 * term.c (max_frame_lines): Remove; unused.
17588 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17590 (encode_terminal_code, calculate_costs): Check for size
17591 calculation overflow.
17592 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17593 table lengths and related sizes. Don't update size until alloc
17594 done. Redo calculations to avoid overflow.
17595 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17597 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17598 subtracting pointers.
17599 (gobble_line): Check for overflow more carefully. Don't update size
17602 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17603 Don't update size until alloc done.
17604 Redo size calculations to avoid overflow.
17605 Check for size calculation overflow.
17606 (main) [DEBUG]: Fix typo in invoking tparam1.
17608 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17609 Use ptrdiff_t, not int, for sizes.
17610 (store_mode_line_noprop_char): Don't update size until alloc done.
17612 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17613 Use ptrdiff_t, not int, for sizes.
17614 (Finternal_make_lisp_face, cache_face):
17615 Check for size calculation overflow.
17616 (cache_face): Treat size calculation overflows as if they were
17617 memory exhaustion (the usual treatment), rather than aborting.
17619 * xfns.c (x_encode_text, x_set_name_internal)
17620 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17621 sizes, since they can exceed INT_MAX in size. Check for size
17622 calculation overflow.
17624 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17625 (xg_select): Check for size calculation overflow.
17626 Don't update size until alloc done.
17628 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17629 as sprintf is limited to int lengths.
17631 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17632 (X_LONG_MIN): New macros.
17633 Use them to make the following changes clearer.
17634 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17635 This change doesn't affect the value now, but it may help remind
17636 future maintainers not to raise the value too much later.
17637 (SELECTION_QUANTUM): Remove, replacing with ...
17638 (selection_quantum): ... new function, which avoids overflow.
17640 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17641 assumption that selection length fits in 'int'.
17642 (x_reply_selection_request, x_handle_selection_request)
17643 (x_get_window_property, receive_incremental_selection)
17644 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17645 (lisp_data_to_selection_data, clean_local_selection_data):
17646 Use ptrdiff_t, not int, to record length of selection.
17647 (x_reply_selection_request, x_get_window_property)
17648 (receive_incremental_selection, x_property_data_to_lisp):
17649 Redo calculations to avoid overflow.
17650 (x_reply_selection_request): When sending hint, ceiling it at
17651 X_LONG_MAX rather than relying on wraparound overflow to send
17653 (x_get_window_property, receive_incremental_selection)
17654 (lisp_data_to_selection_data, x_property_data_to_lisp):
17655 Check for size-calculation overflow.
17656 (x_get_window_property, receive_incremental_selection)
17657 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17658 Don't store size until memory allocation succeeds.
17659 (x_get_window_property): Plug memory leak on memory exhaustion.
17660 Don't double-block input; malloc is safe here. Don't assume 2**34
17661 - 4 fits in unsigned long. Add an xassert to check
17662 XGetWindowProperty overflow. Be more careful about overflow
17663 calculations, and distinguish size from memory overflow better.
17664 (receive_incremental_selection): When tracing, don't assume
17665 unsigned int is less than INT_MAX.
17666 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17667 harmful) conversions of unsigned short to int.
17668 (lisp_data_to_selection_data): Don't assume that integers
17669 in the range -65535 through -1 fit in an X unsigned short.
17670 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17671 result parameters unless successful. Rely on cons_to_unsigned
17672 to report problems with elements; the old code wasn't right anyway.
17673 (x_check_property_data): Check for int overflow; we cannot use
17674 a wider type due to X limits.
17675 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17677 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17679 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17680 (x_term_init): Check for size calculation overflow.
17681 (x_color_cells): Don't store size until memory allocation succeeds.
17682 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17683 Don't assume alloca size is less than MAX_ALLOCA.
17684 (x_term_init): Don't assume length fits in int (sprintf is limited
17687 Use ptrdiff_t for composition IDs.
17688 * character.c (lisp_string_width):
17689 * composite.c (composition_table_size, n_compositions)
17690 (get_composition_id, composition_gstring_from_id):
17691 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17692 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17693 * window.c (Frecenter):
17694 Use ptrdiff_t, not int, for composition IDs.
17695 * composite.c (get_composition_id): Check for integer overflow.
17696 * composite.h: Adjust prototypes to match the above changes.
17698 Use ptrdiff_t for hash table indexes.
17699 * category.c (hash_get_category_set):
17700 * ccl.c (ccl_driver):
17701 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17702 * coding.c (coding_system_charset_list, detect_coding_system):
17703 * coding.h (struct coding_system.id):
17704 * composite.c (get_composition_id, gstring_lookup_cache):
17705 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17706 * image.c (xpm_get_color_table_h):
17707 * lisp.h (hash_lookup, hash_put):
17708 * minibuf.c (Ftest_completion):
17709 Use ptrdiff_t for hash table indexes, not int (which is too
17710 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17711 32-bit --with-wide-int hosts).
17713 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17714 Add a FIXME comment about memory leaks.
17715 (syms_of_charset): Don't assume xmalloc returns.
17717 Don't assume that stated character widths fit in int.
17718 * character.c (Fchar_width, c_string_width, lisp_string_width):
17719 * character.h (CHAR_WIDTH):
17720 * indent.c (MULTIBYTE_BYTES_WIDTH):
17721 Use sanitize_char_width to avoid undefined and/or bad behavior
17722 with outlandish widths.
17723 * character.h (sanitize_tab_width): Rename from sanitize_width,
17724 now that we have two such functions. All uses changed.
17725 (sanitize_char_width): New inline function.
17727 Don't assume that tab-width fits in int.
17728 * character.h (sanitize_width): New inline function.
17729 (SANE_TAB_WIDTH): New macro.
17730 (ASCII_CHAR_WIDTH): Use it.
17731 * indent.c (sane_tab_width): Remove. All uses replaced by
17732 SANE_TAB_WIDTH (current_buffer).
17733 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17735 * fileio.c: Integer overflow issues with file modes.
17736 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17738 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17739 Remove unreachable code.
17740 (read_hex, load_charset_map_from_file): Check for integer overflow.
17742 * xterm.c: Don't go over XClientMessageEvent limit.
17743 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17744 (x_send_scroll_bar_event): Likewise. Check that the size does not
17745 exceed limits imposed by XClientMessageEvent, as well as the usual
17746 ptrdiff_t and size_t limits.
17748 * keyboard.c: Overflow, signedness and related fixes.
17749 (make_lispy_movement): Use same integer type in forward decl
17750 that is used in the definition.
17751 (read_key_sequence, keyremap_step):
17752 Change bufsize argument back to int, undoing my 2011-03-30 change.
17753 We prefer signed types, and int is wide enough here.
17754 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17755 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17756 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17757 length, not size_t. Use ptrdiff_t for index, not int.
17758 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17759 possibility of integer overflow.
17761 Overflow, signedness and related fixes for images.
17763 * dispextern.h (struct it.stack[0].u.image.image_id)
17764 (struct_it.image_id, struct image.id, struct image_cache.size)
17765 (struct image_cache.used, struct image_cache.ref_count):
17766 * gtkutil.c (update_frame_tool_bar):
17767 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17768 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17769 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17770 * nsmenu.m (update_frame_tool_bar):
17771 * xdisp.c (calc_pixel_width_or_height):
17772 * xfns.c (image_cache_refcount):
17773 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17774 on typical 64-bit hosts.
17776 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17777 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17778 Omit unnecessary casts to int.
17779 (parse_image_spec): Check that integers fall into 'int' range
17780 when the callers expect that.
17781 (image_ascent): Redo ascent calculation to avoid int overflow.
17782 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17783 (lookup_image): Remove unnecessary tests.
17784 (xbm_image_p): Locals are now of int, not EMACS_INT,
17785 since parse_image_check makes sure they fit into int.
17786 (png_load, gif_load, svg_load_image):
17787 Prefer int to unsigned where either will do.
17788 (tiff_handler): New function, combining the cores of the
17789 old tiff_error_handler and tiff_warning_handler.
17790 This function is rewritten to use vsnprintf and thereby avoid
17791 stack buffer overflows. It uses only the features of vsnprintf
17792 that are common to both POSIX and native Microsoft.
17793 (tiff_error_handler, tiff_warning_handler): Use it.
17794 (tiff_load, gif_load, imagemagick_load_image):
17795 Don't assume :index value fits in 'int'.
17796 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17797 (imagemagick_load_image): Check that crop parameters fit into
17798 the integer types that MagickCropImage accepts. Don't assume
17799 Vimagemagick_render_type has a nonnegative value. Don't assume
17800 size_t fits in 'long'.
17801 (gs_load): Use printmax_t to print the widest integers possible.
17802 Check for integer overflow when computing image height and width.
17804 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17806 * xdisp.c (redisplay_window): Don't force window start if point
17807 will be invisible in the resulting window. (Bug#9324)
17809 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17811 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17812 the display spec is of the form `(space ...)'.
17813 (handle_display_spec): Return the value returned by
17814 handle_single_display_spec, not just 1 or zero.
17815 (handle_single_display_spec): If the display spec is of the form
17816 `(space ...)', and specifies display in the text area, return 2
17818 (try_cursor_movement): Check for the need to scroll more
17819 accurately, and prefer exact match for point under bidi.
17820 Don't advance `row' beyond the last row of the window.
17822 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17823 into disp_prop; all users changed.
17825 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17826 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17827 for the text covered by the display property.
17829 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17831 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17832 Change return value to nil.
17833 (Frecord_buffer): Delete unused function.
17835 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17837 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17838 buffers, return left-to-right.
17839 (set_cursor_from_row): Consider candidate row a win if its glyph
17840 represents a newline and point is on that newline. Fixes cursor
17841 positioning on the newline at EOL of R2L text within L2R
17842 paragraph, and vice versa.
17843 (try_cursor_movement): Check continued rows, in addition to
17844 continuation rows. Fixes unwarranted scroll when point enters a
17845 continued line of R2L text within an L2R paragraph, or vice versa.
17846 (cursor_row_p): Consider the case of point being equal to
17847 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17848 from the end of a short line to the beginning of a continued line
17849 of R2L text within L2R paragraph.
17850 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17851 composed characters.
17853 * bidi.c (bidi_check_type): Use xassert.
17854 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17857 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17859 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17862 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17864 * nsfont.m (ns_otf_to_script): Fix typo.
17866 2011-08-22 Kenichi Handa <handa@m17n.org>
17868 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17869 extra slot even if the purpose is char-code-property-table.
17871 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17873 * xdisp.c (redisplay_window): When computing centering_position,
17874 account for the height of the header line. (Bug#8874)
17876 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17877 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17878 candidate is selected by the mouse, and that candidate has a
17879 composed character under the mouse.
17881 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17882 coordinates reported by pos-visible-in-window-p for a composed
17883 character in column zero.
17885 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17887 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17889 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17891 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17892 consider it a hit if to_charpos is anywhere in the range of the
17893 composed buffer positions.
17895 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17897 * image.c (gif_load): Don't assume that each subimage has the same
17898 dimensions as the base image. Handle disposal method that is
17899 "undefined" by the gif spec (Bug#9335).
17901 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17903 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17904 (Fcondition_case): Document `debug' symbol in error handler.
17906 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17908 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17909 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17910 from an Org mode buffer to a Speedbar frame.
17912 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17913 a composition, take its buffer position from IT->cmp_it.charpos.
17914 Fixes cursor positioning at the beginning of a line that begins
17915 with a composed character.
17917 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17919 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17920 character bidirectional type, use STRONG_L instead. Fixes crashes
17921 in a buffer produced by `describe-categories'.
17923 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17924 members before the level stack, so they would be saved and
17925 restored when copying iterator state. Fixes incorrect reordering
17926 around TABs covered by display properties.
17928 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17930 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17932 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17934 * eval.c (internal_condition_case, internal_condition_case_1)
17935 (internal_condition_case_2, internal_condition_case_n):
17936 Remove unnecessary aborts (Bug#9081).
17938 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17940 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17941 has no `load' handler, try opening the file locally. (Bug#9311)
17943 2011-08-16 Ken Brown <kbrown@cornell.edu>
17945 * gmalloc.c: Expand comment.
17947 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17949 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17950 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17952 2011-08-16 Ken Brown <kbrown@cornell.edu>
17954 Fix memory allocation problems in Cygwin build (Bug#9273).
17956 * unexcw.c (__malloc_initialized): Declare external variable.
17957 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17959 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17961 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17963 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17964 in the static heap.
17965 [CYGWIN] (special_realloc): New function.
17966 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17967 requests to realloc storage in the static heap.
17969 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17971 * bidi.c (bidi_initialize): Remove unused local.
17973 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17976 * biditype.h: Remove file.
17977 * makefile.w32-in ($(BLD)/bidi.$(O)):
17978 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17980 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17982 * chartab.c: Improve commentary for the uniprop_table API.
17984 * bidi.c (bidi_paragraph_init): Support zero value of
17985 bidi_ignore_explicit_marks_for_paragraph_level.
17986 (bidi_initialize): Use uniprop_table instead of including
17987 biditype.h and bidimirror.h.
17989 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17990 coordinates of the iterator when restoring from ppos_it.
17993 2011-08-14 Kenichi Handa <handa@m17n.org>
17995 * process.c (create_process): Call setup_process_coding_systems
17996 after the pid of the process is set to -1 (Bug#8162).
17998 2011-08-14 Eli Zaretskii <eliz@gnu.org>
18000 * xdisp.c (move_it_in_display_line_to): Don't invoke
18001 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18002 ppos_it. Fixes vertical cursor motion when line beginning is
18003 covered by an image. (Bug#9296)
18005 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18007 * nsterm.h (ns_run_ascript): Declare.
18008 (NSAPP_DATA2_RUNASSCRIPT): Define.
18010 * nsfns.m (as_script, as_result, as_status): New static variables.
18011 (ns_run_ascript): New function.
18012 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18013 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18014 the event loop. Get status from as_status (Bug#7276).
18016 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18017 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18018 the event loop (Bug#7276).
18020 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18022 * gnutls.c (QCgnutls_bootprop_priority)
18023 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18024 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18025 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18026 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18027 (QCgnutls_bootprop_verify_hostname_error)
18028 (QCgnutls_bootprop_callbacks_verify): Rename from
18029 Qgnutls_bootprop_..., all uses changed.
18031 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18034 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18036 * xfaces.c (Qframe_set_background_mode): Now static.
18037 * dispextern.h (Qframe_set_background_mode): Remove decl.
18039 * process.c (Fnetwork_interface_info): Declare local only if needed.
18041 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18043 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18044 (Fnetwork_interface_list): Allocate in increments of bytes instead
18045 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18046 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18048 (struct ifflag_def): notrailers is smart on OSX.
18049 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18050 Get hardware address with getifaddrs if available.
18052 2011-08-12 Eli Zaretskii <eliz@gnu.org>
18054 * xdisp.c (iterate_out_of_display_property): xassert that
18055 IT->position is set to within IT->object's boundaries. Break from
18056 the loop as soon as EOB is reached; avoids infloops in redisplay
18057 when IT->position is set up wrongly due to some bug.
18058 Set IT->current to match the bidi iterator unconditionally.
18059 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18060 entry. Force push_it to save on the stack the current
18061 buffer/string position, to be restored by pop_it. Fix flags in
18062 the iterator structure wrt the object coming from a display
18063 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18064 properties. (Bug#9284)
18066 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18068 * fontset.c (fontset_get_font_group): Add proper type checks.
18071 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18073 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18074 and LC_VERSION_MIN_MACOSX.
18075 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18076 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18078 2011-08-08 Eli Zaretskii <eliz@gnu.org>
18080 * xdisp.c (forward_to_next_line_start): Allow to use the
18081 no-display-properties-and-no-overlays under bidi display.
18082 Set disp_pos in the bidi iterator to avoid searches for display
18083 properties and overlays.
18085 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
18087 * editfns.c (Fset_time_zone_rule): Document relationship with the
18090 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18091 the font entity extracted from the cache (Bug#8109).
18093 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
18095 * composite.c (autocmp_chars): Don't reset point. That is done by
18096 restore_point_unwind (Bug#5984).
18098 2011-08-07 Juri Linkov <juri@jurta.org>
18100 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18101 to show the arg `TIME' instead of `TIMEVAL'.
18103 2011-08-06 Eli Zaretskii <eliz@gnu.org>
18105 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18106 display property strides EOL and includes a newline, as in
18107 longlines-mode. (Bug#9254)
18108 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18109 word-wrap under bidirectional display. (Bug#9224)
18111 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18112 is non-zero, even if the data buffer is NULL. Fixes a crash in
18113 vertical-motion with longlines-mode. (Bug#9254)
18115 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18117 * bidi.c <bidi_cache_total_alloc>: Now static.
18118 (bidi_initialize): Initialize bidi_cache_total_alloc.
18120 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18123 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18124 amount allocated this far in `bidi_cache_total_alloc'.
18125 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18126 non-zero, only free the data buffer without restoring the cache
18127 contents. All callers changed.
18129 * dispextern.h (bidi_unshelve_cache): Update prototype.
18131 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18132 (move_it_in_display_line, move_it_to)
18133 (move_it_vertically_backward, move_it_by_lines): Replace the call
18134 to xfree to an equivalent call to bidi_unshelve_cache.
18135 (move_it_in_display_line_to): Fix logic of returning
18136 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18138 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18140 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18141 came from a string character with a `cursor' property. (Bug#9229)
18143 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18145 * Makefile.in (LIB_PTHREAD): New variable.
18146 (LIBES): Add LIB_PTHREAD (Bug#9216).
18148 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18149 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18151 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18153 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18155 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18157 * xterm.c (x_find_topmost_parent): New function.
18158 (x_set_frame_alpha): Find topmost parent window with
18159 x_find_topmost_parent and set the property there also (bug#9181).
18160 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18162 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18164 * callproc.c (Fcall_process): Avoid vfork clobbering
18165 the local vars buffer, coding_systems, current_dir.
18167 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18169 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18171 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18173 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18174 so that it is not optimized away.
18176 * xdisp.c (compute_display_string_pos): Remove unused local.
18178 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18180 Fix slow cursor motion and scrolling in large buffers with
18181 selective display, like Org Mode buffers. (Bug#9218)
18183 * dispextern.h (struct bidi_it): New member disp_prop_p.
18185 * xdisp.c: Remove one-slot cache of display string positions.
18186 (compute_display_string_pos): Accept an additional argument
18187 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18188 for a display string or property. If found, set DISP_PROP_P
18191 * bidi.c (bidi_fetch_char): Accept an additional argument
18192 DISP_PROP_P, and pass it to compute_display_string_pos.
18193 Only handle text covered by a display string if DISP_PROP_P is returned
18194 non-zero. All callers of bidi_fetch_char changed.
18196 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18198 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18200 2010-12-03 Don March <don@ohspite.net>
18202 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18203 last character M-[char] is translated to ESC [char] (bug#7541).
18205 2011-08-02 Kenichi Handa <handa@m17n.org>
18207 * lisp.h (uniprop_table): Extern it.
18209 * chartab.c (uniprop_table): Make it non-static.
18211 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18213 * xdisp.c (forward_to_next_line_start): Accept additional argument
18214 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18216 (reseat_at_next_visible_line_start): Use the bidi iterator state
18217 returned by forward_to_next_line_start to restore the state of
18218 it->bidi_it after backing up to previous newline. (Bug#9212)
18220 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18222 * regex.c (re_comp): Protoize.
18223 (re_exec): Fix return type.
18224 (regexec): Fix type of `ret'. (Bug#9203)
18226 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18228 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18229 This is needed if max-image-size is a floating-point number.
18231 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18233 * print.c (print_object): Print empty symbol as ##.
18235 * lread.c (read1): Read ## as empty symbol.
18237 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18239 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18240 setting frame foreground color (Bug#9175).
18241 (x_set_background_color): Likewise.
18243 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18244 contents (Bug#9176).
18245 (EmacsTooltip -init): Remove bezels and add shadows to
18248 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18249 or scroll bar (Bug#8470).
18251 * nsfont.m (nsfont_open): Remove assignment to voffset and
18252 unnecessary vars hshink, expand, hd, full_height, min_height.
18253 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18255 * nsterm.h (nsfont_info): Remove voffset field.
18257 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18259 Implement strike-through and overline on NextStep (Bug#8863).
18261 * nsfont.m (nsfont_open): Use underline position provided by font,
18262 instead of hard-coded value of 2.
18263 (nsfont_draw): Call ns_draw_text_decoration instead.
18265 * nsterm.h: Add declaration for ns_draw_text_decoration.
18267 * nsterm.m (ns_draw_text_decoration): New function for drawing
18268 underline, overline, and strike-through.
18269 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18270 ns_draw_text_decoration. Change treatment of cursor drawing to
18271 accommodate underlining, etc.
18273 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18275 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18278 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18280 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18281 Without this fix, if a signal arrives just after memory fills up,
18282 'malloc' might be invoked reentrantly.
18284 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18285 In other words, assume that every image size is allowed, on non-X
18286 hosts. This assumption is probably wrong, but it lets Emacs compile.
18288 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18290 * regex.c (re_iswctype): Convert return values to boolean.
18292 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18294 * xdisp.c (compute_display_string_pos): Don't use cached display
18295 string position if the buffer had its restriction changed.
18298 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18300 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18302 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18304 Integer signedness and overflow and related fixes. (Bug#9079)
18306 * bidi.c: Integer size and overflow fixes.
18307 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18308 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18309 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18310 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18311 (bidi_find_other_level_edge):
18312 Use ptrdiff_t instead of EMACS_INT where either will do.
18313 This works better on 32-bit hosts configured --with-wide-int.
18314 (bidi_cache_ensure_space): Check for size-calculation overflow.
18315 Use % rather than repeated addition, for better worst-case speed.
18316 Don't set bidi_cache_size until after xrealloc returns, because it
18318 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18319 (bidi_cache_ensure_space): Also check that the bidi cache size
18320 does not exceed that of the largest Lisp string or buffer. See Eli
18321 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18323 * alloc.c (__malloc_size_t): Remove.
18324 All uses replaced by size_t. See Andreas Schwab's note
18325 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18327 * image.c: Improve checking for integer overflow.
18328 (check_image_size): Assume that f is nonnull, since
18329 it is always nonnull in practice. This is one less thing to
18330 worry about when checking for integer overflow later.
18331 (x_check_image_size): New function, which checks for integer
18332 overflow issues inside X.
18333 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18334 This removes the need for a memory_full check.
18335 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18336 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18337 (xbm_read_bitmap_data): Change locals back to 'int', since
18338 their values must fit in 'int'.
18339 (xpm_load_image, png_load, tiff_load):
18340 Invoke x_create_x_image_and_pixmap earlier,
18341 to avoid much needless work if the image is too large.
18342 (tiff_load): Treat overly large images as if
18343 x_create_x_image_and_pixmap failed, not as malloc failures.
18344 (gs_load): Use x_check_image_size.
18346 * gtkutil.c: Omit integer casts.
18347 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18348 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18350 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18352 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18353 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18354 would wrongly return t on a 64-bit host.
18356 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18357 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18358 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18359 and therefore cause GCC to emit a bogus diagnostic in some cases.
18361 * image.c: Integer signedness and overflow and related fixes.
18362 This is not an exhaustive set of fixes, but it's time to
18363 record what I've got.
18364 (lookup_pixel_color, check_image_size): Remove redundant decls.
18365 (check_image_size): Don't assume that arbitrary EMACS_INT values
18366 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18367 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18368 (tiff_load, imagemagick_load_image):
18369 Check for overflow in size calculations.
18370 (x_create_x_image_and_pixmap): Remove unnecessary test for
18371 xmalloc returning NULL; that can't happen.
18372 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18373 (xpm_color_bucket): Use better integer hashing function.
18374 (xpm_cache_color): Don't possibly over-allocate memory.
18375 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18376 (gif_memory_source):
18377 Use ptrdiff_t, not int or size_t, to record sizes.
18378 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18379 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18380 either works, as we prefer signed integers.
18381 (tiff_read_from_memory, tiff_write_from_memory):
18382 Return tsize_t, not size_t, since that's what the TIFF API wants.
18383 (tiff_read_from_memory): Don't fail simply because the read would
18384 go past EOF; instead, return a short read.
18385 (tiff_load): Omit no-longer-needed casts.
18386 (Fimagemagick_types): Don't assume size fits into 'int'.
18388 Improve hashing quality when configured --with-wide-int.
18389 * fns.c (hash_string): New function, taken from sxhash_string.
18390 Do not discard information about ASCII character case; this
18391 discarding is no longer needed.
18392 (sxhash-string): Use it. Change sig to match it. Caller changed.
18393 * lisp.h: Declare it.
18394 * lread.c (hash_string): Remove, since we now use fns.c's version.
18395 The fns.c version returns a wider integer if --with-wide-int is
18396 specified, so this should help the quality of the hashing a bit.
18398 * emacs.c: Integer overflow minor fix.
18399 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18400 Define only if GNU_LINUX.
18401 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18403 * dispnew.c: Integer signedness and overflow fixes.
18404 Remove unnecessary forward decls, that were a maintenance hassle.
18405 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18407 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18408 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18409 (prepare_desired_row, line_draw_cost):
18410 Use int, not unsigned, where either works.
18411 (save_current_matrix, restore_current_matrix):
18412 Use ptrdiff_t, not size_t, where either works.
18413 (init_display): Check for overflow more accurately, and without
18414 relying on undefined behavior.
18416 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18417 Remove, replacing with the new symbols in lisp.h. All uses changed.
18418 * fileio.c (make_temp_name):
18419 * filelock.c (lock_file_1, lock_file):
18420 * xdisp.c (message_dolog):
18421 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18422 Use pMd etc. instead.
18423 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18424 replacing the pWIDE etc. symbols removed from editfns.c.
18426 * keyboard.h (num_input_events): Now uintmax_t.
18427 This is (very slightly) less likely to mess up due to wraparound.
18430 * buffer.c: Integer signedness fixes.
18431 (alloc_buffer_text, enlarge_buffer_text):
18432 Use ptrdiff_t rather than size_t when either will do, as we prefer
18435 * alloc.c: Integer signedness and overflow fixes.
18436 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18437 (__malloc_size_t): Default to size_t, not to int.
18438 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18439 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18440 Prefer ptrdiff_t to size_t when either would do, as we prefer
18442 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18443 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18444 Now const. Initialize with values that are in range even if char
18446 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18447 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18448 These functions do the right thing with sizes > 2**32.
18449 (check_depth): Now ptrdiff_t, not int.
18450 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18451 Adjust to new way of storing sizes. Check for size overflow bugs
18453 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18454 slightly wrong anyway, as it missed one instance of
18455 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18456 (refill_memory_reserve): Omit needless cast to size_t.
18457 (mark_object_loop_halt): Mark as externally visible.
18459 * xselect.c: Integer signedness and overflow fixes.
18460 (Fx_register_dnd_atom, x_handle_dnd_message):
18461 Use ptrdiff_t, not size_t, since we prefer signed.
18462 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18463 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18464 x_dnd_atoms_size and x_dnd_atoms_length.
18466 * doprnt.c: Prefer signed to unsigned when either works.
18468 * doprnt.c (doprnt):
18470 * xdisp.c (vmessage):
18471 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18472 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18473 prefer signed arithmetic to avoid comparison confusion.
18474 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18475 but is a bit tricky.
18477 Assume freestanding C89 headers, string.h, stdlib.h.
18478 * data.c, doprnt.c, floatfns.c, print.c:
18479 Include float.h unconditionally.
18480 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18481 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18482 * regex.c: Likewise for stddef.h, string.h.
18483 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18484 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18485 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18486 (STDC_HEADERS): Remove obsolete defines.
18487 * sysdep.c: Include limits.h unconditionally.
18489 Assume support for memcmp, memcpy, memmove, memset.
18490 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18491 * regex.c (memcmp, memcpy):
18492 Remove; we assume C89 now.
18494 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18495 (__malloc_safe_bcopy): Remove; no longer needed.
18497 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18498 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18499 well either way, and we prefer signed to unsigned.
18501 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18503 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18504 closes the connection while we're reading (bug#9182).
18506 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18508 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18509 are specified (Bug#9168).
18511 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18513 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18514 Found by GCC static checking and --with-wide-int on a 32-bit host.
18516 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18518 * xdisp.c (compute_display_string_pos): Fix logic of caching
18519 previous display string position. Initialize cached_prev_pos to
18520 -1. Fixes slow-down at the beginning of a buffer.
18522 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18524 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18525 for attrs[LFACE_FONTSET_INDEX].
18527 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18529 * xml.c (parse_region): Remove unused local
18530 that was recently introduced.
18532 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18534 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18535 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18537 * xdisp.c (move_it_in_display_line_to): Record the best matching
18538 position for TO_CHARPOS while scanning the line, and restore it on
18539 exit if none of the characters scanned was an exact match.
18540 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18541 when exact match is impossible due to invisible text, and the
18542 lines are truncated.
18544 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18546 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18549 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18551 Fix a significant slow-down of cursor motion with C-n, C-p,
18552 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18553 auto-repeat under bidi redisplay in fontified buffers.
18554 * xdisp.c (compute_stop_pos_backwards): New function.
18555 (next_element_from_buffer): Call compute_stop_pos_backwards to
18556 find a suitable prev_stop when we find ourselves before
18558 (reseat): Don't look for prev_stop, as that could mean a very long
18560 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18561 <cached_disp_overlay_modiff>: Cache for last found display string
18563 (compute_display_string_pos): Return the cached position if asked
18564 about the same buffer in the same area of character positions, and
18565 the buffer wasn't changed since the time the display string
18566 position was cached.
18568 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18570 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18571 is an integer, which is important for empty lines. (Bug#9149)
18573 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18575 * frame.c (Fmodify_frame_parameters): In tty case, update the
18576 default face if necessary (Bug#4238).
18578 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18580 * editfns.c (Fstring_to_char): No need to explain what a character
18581 is in the docstring (Bug#6576).
18583 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18585 * xml.c (parse_region): Make sure we always return a tree.
18587 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18589 * xml.c (parse_region): If a document contains only comments,
18592 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18594 * xml.c (make_dom): Return comments, too.
18596 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18599 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18600 and the surrounding thread.
18601 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18602 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18603 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18605 * s/openbsd.h (BROKEN_SIGIO): Define.
18606 * unexelf.c (unexec) [__OpenBSD__]:
18607 Don't update the .mdebug section of the Alpha COFF symbol table.
18609 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18611 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18614 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18616 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18617 This fixes some race conditions on the permissions of any newly
18620 * alloc.c (valid_pointer_p): Use pipe, not open.
18621 This fixes some permissions issues when debugging.
18623 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18624 If fchown fails to set both uid and gid, try to set just gid,
18625 as that is sometimes allowed. Adjust the file's mode to eliminate
18626 setuid or setgid bits that are inappropriate if fchown fails.
18628 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18630 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18631 to compare Lisp_Objects.
18632 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18633 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18634 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18636 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18638 * lread.c (read_integer): Unread even EOF character.
18639 (read1): Likewise. Properly record start position of symbol.
18641 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18642 symbol character follows.
18644 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18646 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18647 This works around a problem with the previous change to Fcopy_file.
18648 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18649 and without this change, GCC might complain about discarding
18650 fchown's return value.
18652 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18654 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18656 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18658 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18660 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18662 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18663 it's used from the C level.
18665 * process.c: Use the same condition for POLL_FOR_INPUT in both
18666 keyboard.c and process.c (bug#1858).
18668 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18670 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18671 (Fgnutls_boot): Use it.
18673 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18675 * doc.c (Fsubstitute_command_keys): Revert last change.
18677 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18679 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18680 quotes the next character, and doesn't affect other longer
18681 sequences (bug#8935).
18683 * lread.c (syms_of_lread): Clarify that is isn't only
18684 `eval-buffer' and `eval-defun' that's affected by
18685 `lexical-binding' (bug#8460).
18687 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18689 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18690 bidi redisplay when a line includes both an image and is truncated.
18692 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18694 Fix minor problems found by static checking.
18695 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18696 (elsz): Now a signed constant, not a size_t var. We prefer signed
18697 types to unsigned, to avoid integer comparison confusion. Without
18698 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18699 "cannot optimize loop, the loop counter may overflow", a symptom
18701 * indent.c (Fvertical_motion): Mark locals as initialized.
18702 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18704 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18706 * search.c (Fre_search_backward): Mention `case-fold-search' in
18707 all the re_search_* functions (bug#8138).
18709 * keyboard.c (Fopen_dribble_file): Document when the file is
18712 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18714 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18717 Support bidi reordering of display and overlay strings.
18718 * xdisp.c (compute_display_string_pos)
18719 (compute_display_string_end): Accept additional argument STRING.
18720 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18721 (reseat_to_string): Initialize bidi_it->string.s and
18722 bidi_it->string.schars.
18723 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18724 NULL (avoids a crash in bidi_paragraph_init).
18725 Initialize itb.string.lstring.
18726 (init_iterator): Call bidi_init_it only of a valid
18727 buffer position was specified. Initialize paragraph_embedding to
18729 (reseat_to_string): Initialize the bidi iterator.
18730 (display_string): If we need to ignore text properties of
18731 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18732 original value of -1 will not work with bidi.)
18733 (compute_display_string_pos): First arg is now struct
18734 `text_pos *'; all callers changed. Support display properties on
18736 (compute_display_string_end): Support display properties on Lisp
18738 (init_iterator, reseat_1, reseat_to_string): Initialize the
18739 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18740 when iterating on a string not from display properties).
18741 (compute_display_string_pos, compute_display_string_end):
18742 Fix calculation of the object to scan. Fixes an error when using
18744 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18745 base_level_stop; instead, set base_level_stop to BEGV.
18746 Fixes crashes in vertical-motion.
18747 (next_element_from_buffer): Improve commentary for when
18748 the iterator is before prev_stop.
18749 (init_iterator): Initialize bidi_p from the default value of
18750 bidi-display-reordering, not from buffer-local value. Use the
18751 buffer-local value only if initializing for buffer iteration.
18752 (handle_invisible_prop): Support invisible properties on strings
18753 that are being bidi-reordered.
18754 (set_iterator_to_next): Support bidi reordering of C strings and
18756 (next_element_from_string): Support bidi reordering of Lisp
18758 (handle_stop_backwards): Support Lisp strings as well.
18759 (display_string): Support display of R2L glyph rows.
18760 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18761 (init_iterator): Don't initialize it->bidi_p for strings
18763 (reseat_to_string): Initialize it->bidi_p for strings here.
18764 (next_element_from_string, next_element_from_c_string)
18765 (next_element_from_buffer): Add xassert's for correspondence
18766 between IT's object being iterated and it->bidi_it.string
18768 (face_before_or_after_it_pos): Support bidi iteration.
18769 (next_element_from_c_string): Handle the case of the first string
18770 character that is not the first one in the visual order.
18771 (get_visually_first_element): New function, refactored from common
18772 parts of next_element_from_buffer, next_element_from_string, and
18773 next_element_from_c_string.
18774 (tool_bar_lines_needed, redisplay_tool_bar)
18775 (display_menu_bar): Force left-to-right direction. Add a FIXME
18776 comment for making that be controlled by a user option.
18777 (push_it, pop_it): Save and restore the state of the
18778 bidi iterator. Save and restore the bidi_p flag.
18779 (pop_it): Iterate out of display property for string iteration as
18781 (iterate_out_of_display_property): Support iteration over strings.
18782 (handle_single_display_spec): Set up it->bidi_it for iteration
18783 over a display string, and call bidi_init_it.
18784 (handle_single_display_spec, next_overlay_string)
18785 (get_overlay_strings_1, push_display_prop): Set up the bidi
18786 iterator for displaying display or overlay strings.
18787 (forward_to_next_line_start): Don't use the shortcut if
18789 (back_to_previous_visible_line_start): If handle_display_prop
18790 pushed the iterator stack, restore the internal state of the bidi
18791 iterator by calling bidi_pop_it same number of times.
18792 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18793 and we are bidi-iterating, don't decrement the iterator position;
18794 instead, set the first_elt flag in the bidi iterator, to produce
18796 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18797 (push_display_prop): xassert that we are iterating a buffer.
18798 (push_it, pop_it): Save and restore paragraph_embedding member.
18799 (handle_single_display_spec, next_overlay_string)
18800 (get_overlay_strings_1, reseat_1, reseat_to_string)
18801 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18802 correctly. Don't assume unibyte strings are not bidi-reordered.
18803 (compute_display_string_pos)
18804 (compute_display_string_end): Fix handling the case of C string.
18805 (push_it, pop_it): Save and restore from_disp_prop_p.
18806 (handle_single_display_spec, push_display_prop): Set the
18807 from_disp_prop_p flag.
18808 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18809 (pop_it): Call iterate_out_of_display_property only if we are
18810 popping after iteration over a string that came from a display
18811 property. Fix a typo in popping stretch info. Add an assertion
18812 for verifying that the iterator position is in sync with the bidi
18814 (handle_single_display_spec, get_overlay_strings_1)
18815 (push_display_prop): Fix initialization of paragraph direction for
18816 string when that of the parent object is not yet determined.
18817 (reseat_1): Call bidi_init_it to resync the bidi
18818 iterator with IT's position. (Bug#7616)
18819 (find_row_edges): If ROW->start.pos gives position
18820 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18821 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18822 Reset the from_disp_prop_p flag.
18823 (SAVE_IT, RESTORE_IT): New macros.
18824 (pos_visible_p, face_before_or_after_it_pos)
18825 (back_to_previous_visible_line_start)
18826 (move_it_in_display_line_to, move_it_in_display_line)
18827 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18828 (try_scrolling, redisplay_window, display_line): Use them when
18829 saving a temporary copy of the iterator and restoring it back.
18830 (back_to_previous_visible_line_start, reseat_1)
18831 (init_iterator): Empty the bidi cache "stack".
18832 (move_it_in_display_line_to): If iterator ended up at
18833 EOL, but we never saw any buffer positions smaller than
18834 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18835 motion in bidi-reordered lines.
18836 (move_it_in_display_line_to): Record prev_method and prev_pos
18837 immediately before the call to set_iterator_to_next. Fixes cursor
18838 motion in bidi-reordered lines with stretch glyphs and strings
18839 displayed in margins. (Bug#8133) (Bug#8867)
18840 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18842 (pos_visible_p): Support positions in bidi-reordered lines.
18843 Save and restore bidi cache.
18845 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18846 (bidi_paragraph_info): Delete unused struct.
18847 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18848 (bidi_cache_start): New variable.
18849 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18851 (bidi_cache_fetch_state, bidi_cache_search)
18852 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18853 (bidi_cache_find, bidi_peek_at_next_level)
18854 (bidi_level_of_next_char, bidi_find_other_level_edge)
18855 (bidi_move_to_visually_next): Compare cache index with
18856 bidi_cache_start rather than with zero.
18857 (bidi_fetch_char): Accept new argument STRING; all callers
18858 changed. Support iteration over a string. Support strings with
18859 display properties. Support unibyte strings. Fix the type of
18860 `len' according to what STRING_CHAR_AND_LENGTH expects.
18861 (bidi_paragraph_init, bidi_resolve_explicit_1)
18862 (bidi_resolve_explicit, bidi_resolve_weak)
18863 (bidi_level_of_next_char, bidi_move_to_visually_next):
18864 Support iteration over a string.
18865 (bidi_set_sor_type, bidi_resolve_explicit_1)
18866 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18867 can now be zero (for strings); special values 0 and -1 were
18868 changed to -1 and -2, respectively.
18869 (bidi_char_at_pos): New function.
18870 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18871 Call it instead of FETCH_MULTIBYTE_CHAR.
18872 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18873 initialized to valid values.
18874 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18876 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18877 the test for valid cached positions. Fix the logic for looking up
18878 the sentinel state in the cache. GCPRO the Lisp string we are
18880 (bidi_push_it, bidi_pop_it): New functions.
18881 (bidi_initialize): Initialize the bidi cache start stack pointer.
18882 (bidi_cache_ensure_space): New function, refactored from part of
18883 bidi_cache_iterator_state. Don't assume the required size is just
18884 one BIDI_CACHE_CHUNK away.
18885 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18886 (bidi_count_bytes, bidi_char_at_pos): New functions.
18887 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18888 always valid if bidi_cache_idx is valid.
18889 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18890 is valid if it's going to be used.
18891 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18892 (bidi_cache_fetch_state, bidi_cache_search)
18893 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18894 (bidi_cache_iterator_state, bidi_cache_find)
18895 (bidi_find_other_level_edge, bidi_cache_start_stack):
18896 All variables related to cache indices are now EMACS_INT.
18898 * dispextern.h (struct bidi_string_data): New structure.
18899 (struct bidi_it): New member `string'. Make flag members be 1-bit
18900 fields, and put them last in the struct.
18901 (compute_display_string_pos, compute_display_string_end):
18903 (bidi_push_it, bidi_pop_it): Add prototypes.
18904 (struct iterator_stack_entry): New members bidi_p,
18905 paragraph_embedding, and from_disp_prop_p.
18906 (struct it): Member bidi_p is now a bit field 1 bit wide.
18907 (bidi_shelve_cache, bidi_unshelve_cache):
18908 Declare prototypes.
18910 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18911 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18912 and vector-like objects.
18914 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18915 cache around display iteration.
18917 * window.c (Fwindow_end, window_scroll_pixel_based)
18918 (displayed_window_lines, Frecenter): Save and restore the bidi
18919 cache around display iteration.
18921 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18923 * editfns.c (Fdelete_region): Clarify the use of the named
18924 parameters (bug#6788).
18926 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18928 * indent.c (Fvertical_motion): Set and restore w->pointm when
18929 saving and restoring the window's buffer (Bug#9006).
18931 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18933 * editfns.c (Fstring_to_char): Clarify just what is returned
18934 (bug#6576). Text by Eli Zaretskii.
18936 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18938 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18940 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18942 * buffer.c (mmap_find): Fix a typo.
18944 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18946 Fix execution of x selection hooks.
18947 * xselect.c (Qx_lost_selection_functions)
18948 (Qx_sent_selection_functions): New vars.
18949 (syms_of_xselect): DEFSYM them.
18950 (x_handle_selection_request): Pass Qx_sent_selection_functions
18951 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18952 (x_handle_selection_clear,x_clear_frame_selections):
18953 Pass Qx_lost_selection_functions rather than
18954 Vx_lost_selection_functions to Frun_hook_with_args.
18956 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18958 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18959 The old code sometimes used this field without initializing it.
18961 * alloc.c (gc_sweep): Don't read past end of array.
18962 In theory, the old code could also have corrupted Emacs internals,
18963 though it'd be very unlikely.
18965 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18967 * character.c (Fcharacterp): Don't advertise optional ignored
18968 argument. (Bug#4026)
18970 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18972 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18975 * window.c (Fset_window_start): Doc fix (bug#4199).
18976 (Fset_window_hscroll): Ditto.
18978 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18980 Fix minor new problems caught by GCC 4.6.1.
18981 * term.c (init_tty): Remove unused local.
18982 * xsettings.c (store_monospaced_changed): Define this function only
18983 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18984 not used otherwise.
18986 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18988 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18990 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18992 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18993 are the mini-buffer and the echo area (bug#3320).
18995 * term.c (init_tty): Remove support for supdup, c10 and perq
18996 terminals, which are no longer supported (bug#1482).
18998 2011-07-10 Johan Bockgård <bojohan@gnu.org>
19000 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19002 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19004 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19005 for non-popups (Bug#3642).
19007 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19009 * alloc.c (reset_malloc_hooks): Protoize.
19010 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19011 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19012 * cm.c (losecursor): Likewise.
19013 * data.c (fmod): Likewise.
19014 * dispnew.c (swap_glyphs_in_rows): Likewise.
19015 * emacs.c (memory_warning_signal): Likewise.
19016 * floatfns.c (float_error): Likewise.
19017 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19018 (otf_open, font_otf_capability, generate_otf_features)
19019 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19021 * image.c (pbm_read_file): Likewise.
19022 * indent.c (string_display_width): Likewise.
19023 * intervals.c (check_for_interval, search_for_interval)
19024 (inc_interval_count, count_intervals, root_interval)
19025 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19026 * lread.c (defalias): Likewise.
19027 * ralloc.c (r_alloc_check): Likewise.
19028 * regex.c (set_image_of_range_1, set_image_of_range)
19029 (regex_grow_registers): Likewise.
19030 * sysdep.c (strerror): Likewise.
19031 * termcap.c (valid_filename_p, tprint, main): Likewise.
19032 * tparam.c (main): Likewise.
19033 * unexhp9k800.c (run_time_remap, save_data_space)
19034 (update_file_ptrs, read_header, write_header, calculate_checksum)
19035 (copy_file, copy_rest, display_header): Likewise.
19036 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19038 * xdisp.c (check_it): Likewise.
19039 * xfaces.c (register_color, unregister_color, unregister_colors):
19041 * xfns.c (print_fontset_result): Likewise.
19042 * xrdb.c (member, fatal, main): Likewise.
19044 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19046 Fix minor problems found by static checking (Bug#9031).
19047 * chartab.c (char_table_set_range, map_sub_char_table):
19048 Remove unused locals.
19049 (uniprop_table): Now static.
19050 * composite.c (_work_char): Remove unused static var.
19052 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
19054 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19056 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19058 * gtkutil.c (qttip_cb): Remove code without function.
19060 2011-07-09 Eli Zaretskii <eliz@gnu.org>
19062 * w32.c (pthread_sigmask): New stub.
19064 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19066 Use pthread_sigmask, not sigprocmask (Bug#9010).
19067 sigprocmask is portable only for single-threaded applications, and
19068 Emacs can be multi-threaded when it uses GTK.
19069 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19071 * callproc.c (Fcall_process):
19072 * process.c (create_process):
19073 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19074 Use pthread_sigmask, not sigprocmask.
19076 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19078 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19079 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19082 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19084 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19085 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19086 (xg_hide_tooltip): Fix comment.
19088 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19089 in registerServicesMenuSendTypes.
19090 (validRequestorForSendType): Don't check ns_return_types.
19092 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19095 2011-07-08 Jason Rumney <jasonr@gnu.org>
19097 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19098 SH_SHOW for hidden windows (Bug#5482).
19100 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19101 frame struct members of non-existent frames (Bug#6284).
19103 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19105 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19106 variable firstTime not needed on OSX >= 10.6.
19107 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19108 >= 10.5. Use setKnobProportion, setDoubleValue.
19110 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19111 (MAC_OS_X_VERSION_10_5): Define if not defined.
19112 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19113 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19114 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19116 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19117 cString and lossyCString on OSX >= 10.4.
19119 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19120 sizeToFit on OSX >= 10.2.
19122 * nsimage.m (allocInitFromFile): Don't use deprecated method
19123 bestRepresentationForDevice on OSX >= 10.6.
19125 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19128 * emacs.c: Declare unexec_init_emacs_zone.
19130 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19132 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19134 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19135 on svcsMenu (Bug#8842).
19137 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19139 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19141 * nsterm.m (QUTF8_STRING): Declare.
19142 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19143 (validRequestorForSendType): Return type is (id).
19144 Change indexOfObjectIdenticalTo to indexOfObject.
19145 Check if we have local selection before returning self (Bug#8842).
19146 (writeSelectionToPasteboard): Put local selection into paste board
19147 if we have a local selection (Bug#8842).
19148 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19150 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19151 (ns_get_local_selection): Declare.
19153 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19155 * keymap.c (describe_map_tree): Don't insert a double newline at
19156 the end of the buffer (bug#1169) and return whether we inserted
19159 * callint.c (Fcall_interactively): Change "reading args" to
19160 "providing args" to try to clarify what it does (bug#1010).
19162 2011-07-07 Kenichi Handa <handa@m17n.org>
19164 * composite.c (composition_compute_stop_pos): Ignore a static
19165 composition starting before CHARPOS (Bug#8915).
19167 * xdisp.c (handle_composition_prop): Likewise.
19169 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19171 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19174 2011-07-07 Kenichi Handa <handa@m17n.org>
19176 * character.h (unicode_category_t): New enum type.
19178 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19179 (Qchar_code_property_table): New variable.
19180 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19181 (UNIPROP_COMPRESSED_FORM_P): New macros.
19182 (char_table_ascii): Uncompress the compressed values.
19183 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19184 Uncompress the compressed values.
19185 (sub_char_table_ref_and_range): Likewise.
19186 (char_table_ref_and_range): Uncompress the compressed values.
19187 (sub_char_table_set): New arg is_uniprop. Callers changed.
19188 Uncompress the compressed values.
19189 (sub_char_table_set_range): Args changed. Callers changed.
19190 (char_table_set_range): Adjuted for the above change.
19191 (map_sub_char_table): Delete args default_val and parent. Add arg
19192 top. Give decoded values to a Lisp function.
19193 (map_char_table): Adjust for the above change. Give decoded
19194 values to a Lisp function. Gcpro more variables.
19195 (uniprop_table_uncompress)
19196 (uniprop_decode_value_run_length): New functions.
19197 (uniprop_decoder, uniprop_decoder_count): New variables.
19198 (uniprop_get_decoder, uniprop_encode_value_character)
19199 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19201 (uniprop_encoder, uniprop_encoder_count): New variables.
19202 (uniprop_get_encoder, uniprop_table)
19203 (Funicode_property_table_internal, Fget_unicode_property_internal)
19204 (Fput_unicode_property_internal): New functions.
19205 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19206 Sunicode_property_table_internal, Sget_unicode_property_internal,
19207 and Sput_unicode_property_internal. Defvar_lisp
19208 char-code-property-alist.
19210 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19211 Vunicode_category_table.
19213 * font.c (font_range): Adjust for the change of
19214 Vunicode_category_table.
19216 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19218 * m/iris4d.h: Remove file, move contents ...
19219 * s/irix6-5.h: ... here.
19221 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19223 Remove unportable assumption about struct layout (Bug#8884).
19224 * alloc.c (mark_buffer):
19225 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19226 (clone_per_buffer_values): Don't assume that
19227 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19228 This isn't true in general, and it's particularly not true
19229 if Emacs is configured with --with-wide-int.
19230 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19231 New macros, used in the buffer.c change.
19233 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19235 * xsettings.c: Use both GConf and GSettings if both are available.
19236 (store_config_changed_event): Add comment.
19237 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19238 (store_tool_bar_style_changed): New functions.
19239 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19240 (struct xsettings): Move font inside HAVE_XFT.
19241 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19242 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19243 Move inside HAVE_XFT.
19244 (something_changed_gsettingsCB): Rename from something_changedCB.
19245 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19247 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19248 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19249 (something_changed_gconfCB): Rename from something_changedCB.
19250 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19251 (parse_settings): Move check for font inside HAVE_XFT.
19252 (read_settings, apply_xft_settings): Add comment.
19253 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19254 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19255 call store_font_name_changed.
19256 (xft_settings_event): Add comment.
19257 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19258 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19259 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19260 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19261 (xsettings_initialize): Call init_gsettings last.
19262 (xsettings_get_system_font, xsettings_get_system_normal_font):
19265 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19267 Random fixes. E.g., (random) never returned negative values.
19268 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19269 subseconds part to the entropy, as that's a bit more random.
19270 Prefer signed to unsigned, since the signedness doesn't matter and
19271 in general we prefer signed. When given a limit, use a
19272 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19273 latter isn't right if USE_2_TAGS_FOR_INTS.
19274 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19275 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19277 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19279 * textprop.c (text_property_stickiness):
19280 Obey Vtext_property_default_nonsticky.
19281 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19282 * w32fns.c (syms_of_w32fns):
19283 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19285 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19287 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19288 This is more efficient than Ffile_directory_p and avoids a minor race.
19290 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19292 * buffer.c (Foverlay_put): Say what the return value is
19295 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19296 is a directory before asking whether to use the file name
19298 (barf_or_query_if_file_exists): Make the "File is a directory"
19299 error be more correct.
19301 * fns.c (Frequire): Remove the mention of the .gz files, since
19302 that's installation-specific, but keep the mention of
19303 `get-load-suffixes'.
19305 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19307 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19308 Report string overflow if the output is too long.
19310 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19312 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19313 (syms_of_gnutls): Remove duplicate DEFSYM for
19314 Qgnutls_bootprop_verify_hostname_error, an error for
19315 Qgnutls_bootprop_verify_error (which is no longer used).
19317 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19318 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19319 Also (re)move comments that are misplaced or no longer relevant.
19321 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19323 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19325 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19327 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19328 and background color parameters if they have been changed.
19330 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19332 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19334 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19336 * xsettings.c (SYSTEM_FONT): Define only when used.
19337 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19339 * keymap.c (access_keymap_1): Now static.
19341 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19343 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19344 leave any prefix arg for the up event (Bug#1586).
19346 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19348 * lread.c (syms_of_lread): Mention single symbols defined by
19349 `defvar' or `defconst' (bug#7154).
19351 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19352 (Frequire): Mention get-load-suffixes.
19354 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19356 * window.h (window): Remove clone_number slot.
19357 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19359 (make_parent_window, make_window, saved_window)
19360 (Fset_window_configuration, save_window_save): Don't deal with
19362 * buffer.c (Qclone_number): Remove declaration.
19363 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19365 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19367 Add multiple inheritance to keymaps.
19368 * keymap.c (Fmake_composed_keymap): New function.
19369 (Fset_keymap_parent): Simplify.
19370 (fix_submap_inheritance): Remove.
19371 (access_keymap_1): New function extracted from access_keymap to handle
19372 embedded parents and handle lists of maps.
19373 (access_keymap): Use it.
19374 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19375 (Fcopy_keymap): Handle embedded parents.
19376 (Fcommand_remapping, define_as_prefix): Simplify.
19377 (Fkey_binding): Simplify.
19378 (syms_of_keymap): Move minibuffer-local-completion-map,
19379 minibuffer-local-filename-completion-map,
19380 minibuffer-local-must-match-map, and
19381 minibuffer-local-filename-must-match-map to Elisp.
19382 (syms_of_keymap): Defsubr make-composed-keymap.
19383 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19384 (parse_menu_item): Trivial simplification.
19386 2011-07-01 Glenn Morris <rgm@gnu.org>
19388 * Makefile.in (SETTINGS_LIBS): Fix typo.
19390 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19392 * coding.c (Fencode_coding_string): Record the last coding system
19393 used, as the function doc string says (bug#8738).
19395 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19397 * xsettings.c (store_monospaced_changed): Take new font as arg and
19398 check for change against current_mono_font.
19399 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19400 (emacs_settings_constructor, emacs_settings_get_property)
19401 (emacs_settings_set_property, emacs_settings_class_init)
19402 (emacs_settings_init, gsettings_obj): Remove.
19403 (something_changedCB): New function for HAVE_GSETTINGS.
19404 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19405 with value as argument.
19406 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19407 g_settings_new (Bug#8967). Do not create gsettings_obj.
19408 Remove calls to g_settings_bind. Connect something_changedCB to
19411 * xgselect.c: Add defined (HAVE_GSETTINGS).
19412 (xgselect_initialize): Ditto.
19414 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19415 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19418 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19420 * eval.c (struct backtrace): Simplify and port the data structure.
19421 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19422 signed bit field, as this assumption is not portable and it makes
19423 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19424 "char debug_on_exit : 1" as this is not portable either; instead,
19425 use the portable "unsigned int debug_on_exit : 1". Remove unused
19426 member evalargs. Remove obsolete comments about cc bombing out.
19428 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19430 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19431 Let HAVE_GSETTINGS override HAVE_GCONF.
19432 (store_monospaced_changed): New function.
19433 (EMACS_SETTINGS): A new type derived from GObject to handle
19434 GSettings notifications.
19435 (emacs_settings_constructor, emacs_settings_get_property)
19436 (emacs_settings_set_property, emacs_settings_class_init):
19438 (gsettings_client, gsettings_obj): New variables.
19439 (GSETTINGS_SCHEMA): New define.
19440 (something_changedCB): Call store_monospaced_changed.
19441 (init_gsettings): New function.
19442 (xsettings_initialize): Call init_gsettings.
19443 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19446 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19449 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19451 * window.c (resize_root_window, grow_mini_window)
19452 (shrink_mini_window): Rename Qresize_root_window to
19453 Qwindow_resize_root_window and Qresize_root_window_vertically to
19454 Qwindow_resize_root_window_vertically.
19456 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19458 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19460 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19462 * makefile.w32-in: Redesign dependencies so they reflect more
19463 clearly which files are directly included by each source file,
19464 and not through other includes.
19466 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19468 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19469 (sort_overlays, overlay_strings): When an overlay's clone number
19470 matches the window's clone number process the overlay even if
19471 the overlay's window property doesn't match the current window.
19473 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19474 (Fwindow_hchild): Rename to Fwindow_left_child.
19475 (Fwindow_next): Rename to Fwindow_next_sibling.
19476 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19477 (resize_window_check): Rename to window_resize_check.
19478 (resize_window_apply): Rename to window_resize_apply.
19479 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19480 (Fdelete_other_windows_internal, resize_frame_windows)
19481 (Fsplit_window_internal, Fdelete_window_internal)
19482 (grow_mini_window, shrink_mini_window)
19483 (Fresize_mini_window_internal): Fix callers accordingly.
19485 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19487 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19488 (emacs_fixed_set_min_size): Remove.
19489 (emacs_fixed_new): Take frame as argument.
19491 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19492 (_EmacsFixedPrivate): Remove minwidth/height.
19493 Add struct frame *f.
19494 (emacs_fixed_init): Initialize priv->f.
19495 (get_parent_class, emacs_fixed_set_min_size): Remove.
19496 (emacs_fixed_new): Set priv->f to argument.
19497 (emacs_fixed_get_preferred_width)
19498 (emacs_fixed_get_preferred_height): Use min_width/height from
19499 frames size_hint to set minimum and natural (Bug#8919).
19500 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19501 and use min_width/height from frames size_hint to set
19502 min_width/height (Bug#8919).
19504 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19505 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19508 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19510 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19511 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19514 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19516 * process.c (wait_reading_process_output): Bypass select if
19517 waiting for a cell while ignoring keyboard input, and input is
19518 pending. Suggested by Jan Djärv (Bug#8869).
19520 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19522 Use gnulib's dup2 module instead of rolling our own.
19523 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19525 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19527 * dispnew.c (scrolling_window): Before scrolling, turn off a
19528 mouse-highlight in the window being scrolled.
19530 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19532 Move DEFSYM to lisp.h and use everywhere.
19534 * character.h (DEFSYM): Move declaration...
19535 * lisp.h (DEFSYM): ...here.
19541 * w32select.c: Don't include character.h.
19543 * alloc.c (syms_of_alloc):
19544 * buffer.c (syms_of_buffer):
19545 * bytecode.c (syms_of_bytecode):
19546 * callint.c (syms_of_callint):
19547 * casefiddle.c (syms_of_casefiddle):
19548 * casetab.c (init_casetab_once):
19549 * category.c (init_category_once, syms_of_category):
19550 * ccl.c (syms_of_ccl):
19551 * cmds.c (syms_of_cmds):
19552 * composite.c (syms_of_composite):
19553 * dbusbind.c (syms_of_dbusbind):
19554 * dired.c (syms_of_dired):
19555 * dispnew.c (syms_of_display):
19556 * doc.c (syms_of_doc):
19557 * editfns.c (syms_of_editfns):
19558 * emacs.c (syms_of_emacs):
19559 * eval.c (syms_of_eval):
19560 * fileio.c (syms_of_fileio):
19561 * fns.c (syms_of_fns):
19562 * frame.c (syms_of_frame):
19563 * fringe.c (syms_of_fringe):
19564 * insdel.c (syms_of_insdel):
19565 * keymap.c (syms_of_keymap):
19566 * lread.c (init_obarray, syms_of_lread):
19567 * macros.c (syms_of_macros):
19568 * msdos.c (syms_of_msdos):
19569 * print.c (syms_of_print):
19570 * process.c (syms_of_process):
19571 * search.c (syms_of_search):
19572 * sound.c (syms_of_sound):
19573 * syntax.c (init_syntax_once, syms_of_syntax):
19574 * terminal.c (syms_of_terminal):
19575 * textprop.c (syms_of_textprop):
19576 * undo.c (syms_of_undo):
19577 * w32.c (globals_of_w32):
19578 * window.c (syms_of_window):
19579 * xdisp.c (syms_of_xdisp):
19580 * xfaces.c (syms_of_xfaces):
19581 * xfns.c (syms_of_xfns):
19582 * xmenu.c (syms_of_xmenu):
19583 * xsettings.c (syms_of_xsettings):
19584 * xterm.c (syms_of_xterm): Use DEFSYM.
19586 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19588 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19590 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19592 Integer and buffer overflow fixes (Bug#8873).
19594 * print.c (printchar, strout): Check for string overflow.
19595 (PRINTPREPARE, printchar, strout):
19596 Don't set size unless allocation succeeds.
19598 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19599 for sizes. Check for string overflow more accurately.
19600 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19602 * macros.c: Integer and buffer overflow fixes.
19603 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19604 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19605 Use ptrdiff_t, not int, for sizes.
19606 Don't increment bufsize until after realloc succeeds.
19607 Check for size-calculation overflow.
19608 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19610 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19612 * lread.c: Integer overflow fixes.
19613 (read_integer): Radix is now EMACS_INT, not int,
19614 to improve quality of diagnostics for out-of-range radices.
19615 Calculate buffer size correctly for out-of-range radices.
19616 (read1): Check for integer overflow in radices, and in
19617 read-circle numbers.
19618 (read_escape): Avoid int overflow.
19619 (Fload, openp, read_buffer_size, read1)
19620 (substitute_object_recurse, read_vector, read_list, map_obarray):
19621 Use ptrdiff_t, not int, for sizes.
19622 (read1): Use EMACS_INT, not int, for sizes.
19623 Check for size overflow.
19625 * image.c (cache_image): Check for size arithmetic overflow.
19627 * lread.c: Integer overflow issues.
19628 (saved_doc_string_size, saved_doc_string_length)
19629 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19630 Now ptrdiff_t, not int.
19631 (read1): Don't assume doc string length fits in int. Check for
19632 out-of-range doc string lengths.
19633 (read_list): Don't assume file position fits in int.
19634 (read_escape): Check for hex character overflow.
19636 2011-06-22 Leo Liu <sdl.web@gmail.com>
19638 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19639 Move to minibuffer.el.
19641 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19643 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19644 The following patches are for when GLYPH_DEBUG && !XASSERT.
19645 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19646 * dispnew.c (flush_stdout):
19647 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19648 Mark as externally visible.
19649 * dispnew.c (check_window_matrix_pointers): Now static.
19650 * dispnew.c (window_to_frame_vpos):
19651 * xfns.c (unwind_create_frame):
19652 * xterm.c (x_check_font): Remove unused local.
19653 * scroll.c (CHECK_BOUNDS):
19654 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19655 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19656 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19657 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19658 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19660 (debug_method_add): Use va_list and vsprintf rather than relying
19661 on undefined behavior with wrong number of arguments.
19662 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19663 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19664 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19665 since we're not interested in debugging glyphs with old libraries.
19666 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19667 GCC 4.6.0's static checking.
19669 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19671 Integer overflow and signedness fixes (Bug#8873).
19672 A few related buffer overrun fixes, too.
19674 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19676 * dispextern.h (struct face.stipple):
19677 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19678 (x_bitmap_mask, x_allocate_bitmap_record)
19679 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19680 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19681 (x_create_bitmap_from_xpm_data):
19682 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19683 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19685 * xfaces.c (load_pixmap):
19686 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19687 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19688 (.bitmaps_last, struct x_output.icon_bitmap):
19689 Use ptrdiff_t, not int, for bitmap indexes.
19690 (x_allocate_bitmap_record): Check for size overflow.
19691 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19693 Use ptrdiff_t, not int, for overlay counts.
19694 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19695 * editfns.c (overlays_around, get_pos_property):
19696 * textprop.c (get_char_property_and_overlay):
19697 * xdisp.c (next_overlay_change, note_mouse_highlight):
19698 * xfaces.c (face_at_buffer_position):
19699 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19700 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19701 (Fnext_overlay_change, Fprevious_overlay_change)
19702 (mouse_face_overlay_overlaps, Foverlays_in):
19703 Use ptrdiff_t, not int, for sizes.
19704 (overlays_at, overlays_in): Check for size-calculation overflow.
19706 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19708 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19709 (x_session_initialize): Do not assume string length fits in int.
19711 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19712 This is unlikely, but can occur if DPI is outlandish.
19714 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19715 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19717 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19718 * xrdb.c (magic_file_p, search_magic_path):
19719 Omit last arg SUFFIX; it was always 0. All callers changed.
19720 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19722 * xfont.c (xfont_match): Avoid need for strlen.
19724 * xfns.c: Don't assume strlen fits in int.
19725 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19727 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19728 not unsigned long, as we prefer signed integers. All callers changed.
19729 Detect integer overflow in repeat count.
19730 (message_dolog): Don't assume print length fits in 39 bytes.
19731 (display_mode_element): Don't assume strlen fits in int.
19733 * termcap.c: Don't assume sizes fit in int and never overflow.
19734 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19735 (gobble_line): Check for size-calculation overflow.
19737 * minibuf.c (Fread_buffer):
19738 * lread.c (intern, intern_c_string):
19739 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19740 Don't assume string length fits in int.
19742 * keyboard.c (parse_tool_bar_item):
19743 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19745 * font.c: Don't assume string length fits in int.
19746 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19747 Use ptrdiff_t, not int.
19748 (font_intern_prop): Don't assume string length fits in int.
19749 Don't assume integer property fits in fixnum.
19750 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19752 * filelock.c: Fix some buffer overrun and integer overflow issues.
19753 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19754 Reformulate so as not to need the command string.
19755 Invoke gzip -cd rather than gunzip, as it's more portable.
19756 (lock_info_type, lock_file_1, lock_file):
19757 Don't assume pid_t and time_t fit in unsigned long.
19758 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19759 (current_lock_owner): Prefer signed type for sizes.
19760 Use memcpy, not strncpy, where memcpy is what is really wanted.
19761 Don't assume (via atoi) that time_t and pid_t fit in int.
19762 Check for time_t and/or pid_t out of range, e.g., via a network share.
19763 Don't alloca where an auto var works fine.
19765 * fileio.c: Fix some integer overflow issues.
19766 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19767 Don't assume string length fits in int.
19768 (directory_file_name): Don't assume string length fits in long.
19769 (make_temp_name): Don't assume pid fits in int, or that its print
19770 length is less than 20.
19772 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19774 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19776 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19778 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19779 We prefer signed integers, even for size calculations.
19781 * emacs.c: Don't assume string length fits in 'int'.
19782 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19783 (main): Don't invoke strlen when not needed.
19785 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19786 (XD_DEBUG_MESSAGE): Don't waste a byte.
19788 * callproc.c (getenv_internal_1, getenv_internal)
19789 (Fgetenv_internal):
19790 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19792 * lread.c (invalid_syntax): Omit length argument.
19793 All uses changed. This doesn't fix a bug, but it simplifies the
19794 code away from its former Hollerith-constant appearance, and it's
19795 one less 'int' to worry about when looking at integer-overflow issues.
19796 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19798 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19799 This didn't break anything, but it didn't help either.
19800 It's confusing to put a bogus integer in a place where the actual
19801 value does not matter.
19802 (LIST_END_P): Remove unused macro and its bogus comment.
19803 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19805 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19806 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19808 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19809 We prefer signed types, and the value cannot exceed the EMACS_INT
19810 range anyway (because otherwise the length would not be representable).
19811 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19812 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19813 This avoids a GCC warning when WIDE_EMACS_INT.
19815 * indent.c (sane_tab_width): New function.
19816 (current_column, scan_for_column, Findent_to, position_indentation)
19817 (compute_motion): Use it. This is just for clarity.
19818 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19820 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19822 * lisp.h (lint_assume): New macro.
19823 * composite.c (composition_gstring_put_cache):
19824 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19826 * editfns.c, insdel.c:
19827 Omit unnecessary forward decls, to simplify future changes.
19829 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19831 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19833 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19834 Use much-faster test for byte-length change.
19835 Don't assume string byte-length fits in 'int'.
19836 Check that character arg fits in 'int'.
19837 (mapcar1): Declare byte as byte, for clarity.
19839 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19841 * fns.c (concat): Catch string overflow earlier.
19842 Do not rely on integer wraparound.
19844 * dispextern.h (struct it.overlay_strings_charpos)
19845 (struct it.selective): Now EMACS_INT, not int.
19846 * xdisp.c (forward_to_next_line_start)
19847 (back_to_previous_visible_line_start)
19848 (reseat_at_next_visible_line_start, next_element_from_buffer):
19849 Don't arbitrarily truncate the value of 'selective' to int.
19851 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19853 * composite.c: Don't truncate sizes to 'int'.
19854 (composition_gstring_p, composition_reseat_it)
19855 (composition_adjust_point): Use EMACS_INT, not int.
19856 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19857 not EMACS_UINT, for indexes.
19859 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19861 * buffer.c: Include <verify.h>.
19862 (struct sortvec.priority, struct sortstr.priority):
19863 Now EMACS_INT, not int.
19864 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19865 (struct sortstr.size, record_overlay_string)
19866 (struct sortstrlist.size, struct sortlist.used):
19867 Don't truncate size to int.
19868 (record_overlay_string): Check for size-calculation overflow.
19869 (init_buffer_once): Check at compile-time, not run-time.
19871 2011-06-22 Jim Meyering <meyering@redhat.com>
19873 Don't leak an XBM-image-sized buffer
19874 * image.c (xbm_load): Free the image buffer after using it.
19876 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19879 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19880 that Sun C diagnosed.
19881 * fns.c (secure_hash): Fix pointer signedness issue.
19882 * intervals.c (static_offset_intervals): New function.
19883 (offset_intervals): Use it.
19885 2011-06-21 Leo Liu <sdl.web@gmail.com>
19888 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19891 * fns.c (secure_hash): Rename from crypto_hash_function and change
19892 the first arg to accept symbols.
19893 (Fsecure_hash): New primitive.
19894 (syms_of_fns): New symbols.
19896 2011-06-20 Deniz Dogan <deniz@dogan.se>
19898 * process.c (Fset_process_buffer): Clarify return value in
19901 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19903 * dispnew.c (add_window_display_history): Use BVAR.
19905 * xdisp.c (debug_method_add): Use BVAR.
19906 (check_window_end, dump_glyph_matrix, dump_glyph)
19907 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19909 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19912 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19913 check till after the cache is created in init_frame_faces.
19915 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19917 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19919 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19921 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19922 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19923 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19925 Improve buffer-overflow checking (Bug#8873).
19926 * fileio.c (Finsert_file_contents):
19927 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19928 Remove the old (too-loose) buffer overflow checks.
19929 They weren't needed, since make_gap checks for buffer overflow.
19930 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19931 The old code merely checked for Emacs fixnum overflow, and relied
19932 on undefined (wraparound) behavior. The new code avoids undefined
19933 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19935 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19936 Tune. Don't use wider integers than needed. Don't use alloca.
19937 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19939 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19941 * insdel.c, lisp.h (buffer_overflow): New function.
19942 (insert_from_buffer_1, replace_range, replace_range_2):
19943 * insdel.c (make_gap_larger):
19944 * editfns.c (Finsert_char):
19945 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19947 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19949 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19951 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19953 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19954 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19956 * fileio.c: Don't assume EMACS_INT fits in off_t.
19957 (emacs_lseek): New static function.
19958 (Finsert_file_contents, Fwrite_region): Use it.
19959 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19961 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19963 * fns.c: Don't overflow int when computing a list length.
19964 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19965 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19966 truncation on 64-bit hosts. Check for QUIT every
19967 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19968 faster and is responsive enough.
19969 (Flength): Report an error instead of overflowing an integer.
19970 (Fsafe_length): Return a float if the value is not representable
19971 as a fixnum. This shouldn't happen except in contrived situations.
19972 (Fnthcdr, Fsort): Don't assume list length fits in int.
19973 (Fcopy_sequence): Don't assume vector length fits in int.
19975 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19976 (header_size, word_size): New constants.
19977 (allocate_vectorlike): Don't check size overflow here.
19978 (allocate_vector): Check it here instead, since this is the only
19979 caller of allocate_vectorlike that could cause overflow.
19980 Check that the new vector's length is representable as a fixnum.
19982 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19983 The previous code was bogus. For example, next_almost_prime (32)
19984 returned 39, which is undesirable as it is a multiple of 3; and
19985 next_almost_prime (24) returned 25, which is a multiple of 5 so
19986 why was the code bothering to check for multiples of 7?
19988 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19990 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19992 Variadic C functions now count arguments with ptrdiff_t.
19993 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19994 Back then I didn't know that the Emacs coding style prefers signed int.
19995 Also, in the meantime I found a few more instances where arguments
19996 were being counted with int, which may truncate counts on 64-bit
19997 machines, or EMACS_INT, which may be unnecessarily wide.
19998 * lisp.h (struct Lisp_Subr.function.aMANY)
19999 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20000 Arg counts are now ptrdiff_t, not size_t.
20001 All variadic functions and their callers changed accordingly.
20002 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20003 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20004 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20005 * callint.c (Fcall_interactively): Check arg count for overflow,
20006 to avoid potential buffer overrun. Use signed char, not 'int',
20007 for 'varies' array, so that we needn't bother to check its size
20008 calculation for overflow.
20009 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20010 * eval.c (apply_lambda):
20011 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20012 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20013 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20015 * callint.c (Fcall_interactively): Don't use index var as event count.
20017 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20018 * mem-limits.h (SIZE): Remove; no longer used.
20020 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20022 Remove unnecessary casts.
20023 * xterm.c (x_term_init):
20024 * xfns.c (x_set_border_pixel):
20025 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20026 These aren't needed now that we assume ANSI C.
20028 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20029 It's more likely to cause problems (due to unsigned overflow)
20032 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20034 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20036 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20038 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20040 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20042 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20044 GLYPH_CODE_FACE returns EMACS_INT, not int.
20045 * dispextern.h (merge_faces):
20046 * xfaces.c (merge_faces):
20047 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20048 Don't assume EMACS_INT fits in int.
20050 * character.h (CHAR_VALID_P): Remove unused parameter.
20051 * fontset.c, lisp.h, xdisp.c: All uses changed.
20053 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20055 * fns.c (concat): Minor tuning based on overflow analysis.
20056 This doesn't fix any bugs. Use int to hold character, instead
20057 of constantly refetching from Emacs object. Use XFASTINT, not
20058 XINT, for value known to be a character. Don't bother comparing
20059 a single byte to 0400, as it's always less.
20061 * floatfns.c (Fexpt):
20062 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20064 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20067 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20069 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20070 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20071 incorrectly succeed when S was a string, because 4294967386 was
20072 truncated before it was used.
20074 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20075 Otherwise, an out-of-range integer could cause undefined behavior
20078 * composite.c: Use int, not EMACS_INT, for characters.
20079 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20080 EMACS_INT, for values that are known to be in character range.
20081 This doesn't fix any bugs but is the usual style inside Emacs and
20082 may generate better code on 32-bit machines.
20084 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20085 This is for reasons similar to the recent CHAR_STRING fix.
20086 * charset.c (Fencode_char): Check that character arg is actually
20087 a character. Pass an int to ENCODE_CHAR.
20088 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20089 wider than 'int', as a compile-time check to prevent future regressions
20092 * character.c (char_string): Remove unnecessary casts.
20094 Make sure a 64-bit char is never passed to CHAR_STRING.
20095 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20096 by silently ignoring the top 32 bits, allowing some values
20097 that were far too large to be valid characters.
20098 * character.h: Include <verify.h>.
20099 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20100 arguments are no wider than unsigned, as a compile-time check
20101 to prevent future regressions in this area.
20103 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20104 (Fsubst_char_in_region):
20106 * xdisp.c (decode_mode_spec_coding):
20107 Adjust to CHAR_STRING's new requirement.
20108 * editfns.c (Finsert_char, Fsubst_char_in_region):
20109 * fns.c (concat): Check that character args are actually
20110 characters. Without this test, these functions did the wrong
20111 thing with wildly out-of-range values on 64-bit hosts.
20113 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20114 These casts should not be needed on 32-bit hosts, either.
20115 * keyboard.c (read_char):
20116 * lread.c (Fload): Remove casts to unsigned.
20118 * lisp.h (UNSIGNED_CMP): New macro.
20119 This fixes comparison bugs on 64-bit hosts.
20120 (ASCII_CHAR_P): Use it.
20121 * casefiddle.c (casify_object):
20122 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20123 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20124 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20125 * dispextern.h (FACE_FROM_ID):
20126 * keyboard.c (read_char): Use UNSIGNED_CMP.
20128 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20129 not to EMACS_INT, to avoid GCC warning.
20131 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20133 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20134 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20135 isn't needed on 32-bit machines.
20137 * buffer.c (Fgenerate_new_buffer_name):
20138 Use EMACS_INT for count, not int.
20139 (advance_to_char_boundary): Return EMACS_INT, not int.
20141 * data.c (Qcompiled_function): Now static.
20143 * window.c (window_body_lines): Now static.
20145 * image.c (gif_load): Rename local to avoid shadowing.
20147 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20148 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20149 * alloc.c (make_save_value): Integer argument is now of type
20150 ptrdiff_t, not int.
20151 (mark_object): Use ptrdiff_t, not int.
20152 * lisp.h (pD): New macro.
20153 * print.c (print_object): Use it.
20155 * alloc.c: Use EMACS_INT, not int, to count objects.
20156 (total_conses, total_markers, total_symbols, total_vector_size)
20157 (total_free_conses, total_free_markers, total_free_symbols)
20158 (total_free_floats, total_floats, total_free_intervals)
20159 (total_intervals, total_strings, total_free_strings):
20160 Now EMACS_INT, not int. All uses changed.
20161 (Fgarbage_collect): Compute overall total using a double, so that
20162 integer overflow is less likely to be a problem. Check for overflow
20163 when converting back to an integer.
20164 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20165 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20166 These were 'int' variables that could overflow on 64-bit hosts;
20167 they were never used, so remove them instead of repairing them.
20168 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20169 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20170 Previously, this ceilinged at INT_MAX, but that doesn't work on
20172 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20174 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20175 (allocate_vectorlike): Check for ptrdiff_t overflow.
20176 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20177 when a (possibly-narrower) signed value would do just as well.
20178 We prefer using signed arithmetic, to avoid comparison confusion.
20180 * alloc.c: Catch some string size overflows that we were missing.
20181 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20182 for convenience in STRING_BYTES_MAX.
20183 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20184 The definition here is exact; the one in lisp.h was approximate.
20185 (allocate_string_data): Check for string overflow. This catches
20186 some instances we weren't catching before. Also, it catches
20187 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20188 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20189 and ptrdiff_t and EMACS_INT are both 64 bits.
20191 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20192 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20193 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20195 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20197 * alloc.c (Fmake_string): Check for out-of-range init.
20199 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20201 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20203 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20205 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20206 xg_get_default_scrollbar_width.
20208 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20209 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20210 (style_changed_cb): Call update_theme_scrollbar_width and call
20211 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20212 all frames (Bug#8505).
20213 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20214 Call gtk_window_set_resizable if HAVE_GTK3.
20215 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20216 and height if HAVE_GTK3 (Bug#8505).
20217 (scroll_bar_width_for_theme): New variable.
20218 (update_theme_scrollbar_width): New function.
20219 (xg_get_default_scrollbar_width): Move code to
20220 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20221 (xg_initialize): Call update_theme_scrollbar_width.
20223 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20225 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20227 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20229 * frame.c (make_frame): Call other_buffer_safely instead of
20232 * window.c (temp_output_buffer_show): Call display_buffer with
20233 second argument Vtemp_buffer_show_specifiers and reset latter
20234 immediately after the call.
20235 (Vtemp_buffer_show_specifiers): New variable.
20236 (auto_window_vscroll_p, next_screen_context_lines)
20237 (Vscroll_preserve_screen_position): Remove leading asterisks from
20240 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20242 Fix minor problems found by GCC 4.6.0 static checking.
20243 * buffer.c (Qclone_number): Remove for now, as it's unused.
20244 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20245 (record_buffer): Remove unused local.
20246 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20247 (set_frame_buffer_list): Remove; unused.
20248 * frame.h (other_visible_frames): Remove decl.
20249 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20250 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20251 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20253 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20254 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20255 Define only if HAVE_GPM.
20256 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20257 (update_hints_inhibit): Remove; never set. All uses removed.
20258 * widgetprv.h (emacsFrameClassRec): Remove decl.
20259 * window.c (delete_deletable_window): Now returns void, since it
20260 wasn't returning anything.
20261 (compare_window_configurations): Remove unused locals.
20262 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20263 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20264 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20265 the same widths as pointers. This follows up on the 2011-05-06 patch.
20266 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20267 * xterm.h: Likewise.
20268 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20270 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20272 * makefile.w32-in: Update dependencies.
20273 (LISP_H): Add lib/intprops.h.
20275 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20277 * image.c (gif_load): Add animation frame delay to the metadata.
20278 (syms_of_image): Use DEFSYM. New symbol `delay'.
20280 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20282 * window.c (delete_deletable_window): Re-add.
20283 (Fset_window_configuration): Rewrite to handle dead buffers and
20284 consequently deletable windows.
20285 (window_tree, Fwindow_tree): Remove. Supply functionality in
20287 (compare_window_configurations): Simplify code.
20289 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20291 * image.c (imagemagick_load_image): Fix type mismatch.
20292 (Fimagemagick_types): Likewise.
20294 * window.h (replace_buffer_in_windows): Declare.
20296 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20298 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20299 Qclone_number. Remove external declaration of Qdelete_window.
20300 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20302 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20303 Run Qbuffer_list_update_hook if allowed.
20304 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20305 buffer list implementation.
20306 (other_buffer_safely): New function.
20307 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20308 calls to replace_buffer_in_windows and
20309 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20311 (record_buffer): Inhibit quitting and rewrite using quittable
20312 functions. Run Qbuffer_list_update_hook if allowed.
20313 (Frecord_buffer, Funrecord_buffer): New functions.
20314 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20315 Move switch-to-buffer to window.el.
20316 (bury-buffer): Move to window.el.
20317 (Vbuffer_list_update_hook): New variable.
20319 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20322 * window.h (resize_frame_windows): Move up in code.
20323 (Fwindow_frame): Remove EXFUN.
20324 (replace_buffer_in_all_windows): Remove prototype.
20325 (replace_buffer_in_windows_safely): Add prototype.
20327 * window.c: Declare Qdelete_window static again. Move down
20328 declaration of select_count.
20329 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20330 (Fother_window): Move to window.el.
20331 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20332 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20333 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20335 (replace_buffer_in_windows): Implement by calling
20336 Qreplace_buffer_in_windows.
20337 (replace_buffer_in_all_windows): Remove with some functionality
20338 moved into replace_buffer_in_windows_safely.
20339 (replace_buffer_in_windows_safely): New function.
20340 (select_window_norecord, select_frame_norecord): Move in front
20341 of run_window_configuration_change_hook. Remove now obsolete
20343 (Fset_window_buffer): Rewrite doc-string.
20344 Call Qrecord_window_buffer.
20345 (keys_of_window): Move binding for other-window to window.el.
20347 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20349 * dispextern.h (struct image): Replace data member, whose int_val
20350 and ptr_val fields were not used by anything, with a single
20353 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20354 (gif_clear_image, gif_load, imagemagick_load_image)
20355 (gs_clear_image, gs_load): Callers changed.
20357 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20359 * buffer.h: Include <time.h>, for time_t.
20360 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20362 Fix minor problems found by static checking.
20364 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20366 Make identifiers static if they are not used in other modules.
20367 * data.c (Qcompiled_function, Qframe, Qvector):
20368 * image.c (QimageMagick, Qsvg):
20369 * minibuf.c (Qmetadata):
20370 * window.c (resize_window_check, resize_root_window): Now static.
20371 * window.h (resize_window_check, resize_root_window): Remove decls.
20373 * window.c (window_deletion_count, delete_deletable_window):
20375 (window_body_lines): Now static.
20376 (Fdelete_other_windows_internal): Mark vars as initialized.
20377 Make sure 'resize_failed' is initialized.
20378 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20379 (resize_window_apply): Remove unused local.
20380 * window.h (delete_deletable_window): Remove decl.
20382 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20383 (imagemagick_load_image): Fix pointer signedness problem by changing
20384 last arg from unsigned char * to char *. All uses changed.
20385 Also, fix a local for similar reasons.
20386 Remove unused locals. Remove locals to avoid shadowing.
20387 (fn_rsvg_handle_free): Remove; unused.
20388 (svg_load, svg_load_image): Fix pointer signedness problem.
20389 (imagemagick_load_image): Don't use garbage pointer image_wand.
20391 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20393 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20395 * image.c (gif_load): Fix omitted cast error introduced by
20398 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20400 * window.h (resize_proportionally, orig_total_lines)
20401 (orig_top_line): Remove from window structure.
20402 (set_window_height, set_window_width, change_window_heights)
20403 (Fdelete_window): Remove prototypes.
20404 (resize_frame_windows): Remove duplicate declaration.
20406 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20408 * window.h (resize_frame_windows, resize_window_check)
20409 (delete_deletable_window, resize_root_window)
20410 (resize_frame_windows): Declare prototypes.
20412 * window.c (resize_window_apply): Make definition be "static" to
20413 match the prototype.
20415 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20417 * window.c: Remove declarations of Qwindow_size_fixed,
20418 window_min_size_1, window_min_size_2, window_min_size,
20419 size_window, window_fixed_size_p, enlarge_window, delete_window.
20420 Remove static from declaration of Qdelete_window, it's
20421 temporarily needed by Fbury_buffer.
20422 (replace_window): Don't assign orig_top_line and
20424 (Fdelete_window, delete_window): Remove. Window deletion is
20425 handled by window.el.
20426 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20427 Replace Fdelete_window calls with calls to Qdelete_window.
20428 (Fdelete_other_windows): Remove. Deleting other windows is
20429 handled by window.el.
20430 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20431 handled in window.el.
20432 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20433 Window minimum sizes are handled in window.el.
20434 (shrink_windows, size_window, set_window_height)
20435 (set_window_width, change_window_heights, window_height)
20436 (window_width, CURBEG, CURSIZE, enlarge_window)
20437 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20438 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20439 handled in window.el.
20440 (make_dummy_parent): Rename to make_parent_window and give it a
20441 second argument horflag.
20442 (make_window): Don't set resize_proportionally any more.
20443 (Fsplit_window): Remove. Windows are split in window.el.
20444 (save_restore_action, save_restore_orig_size)
20445 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20446 Resize mini windows in window.el.
20447 (grow_mini_window, shrink_mini_window): Implement by calling
20448 Qresize_root_window_vertically, resize_window_check and
20449 resize_window_apply.
20450 (saved_window, Fset_window_configuration, save_window_save):
20451 Do not handle orig_top_line, orig_total_lines, and
20452 resize_proportionally.
20453 (window_min_height, window_min_width): Move to window.el.
20454 (keys_of_window): Move bindings for delete-other-windows,
20455 split-window, delete-window and enlarge-window to window.el.
20457 * buffer.c: Temporarily extern Qdelete_window.
20458 (Fbury_buffer): Temporarily call Qdelete_window instead of
20459 Fdelete_window (Fbury_buffer will move to window.el soon).
20461 * frame.c (set_menu_bar_lines_1): Remove code handling
20462 orig_top_line and orig_total_lines.
20464 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20465 set_window_height but set heights directly.
20466 (change_frame_size_1): Use resize_frame_windows.
20468 * xdisp.c (init_xdisp): Don't use set_window_height but set
20471 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20472 Use resize_frame_windows instead of change_window_heights and run
20473 run_window_configuration_change_hook.
20475 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20476 instead of change_window_heights and run
20477 run_window_configuration_change_hook.
20479 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20481 * window.c (replace_window): Rename second argument REPLACEMENT to
20482 NEW. New third argument SETFLAG. Rewrite.
20483 (delete_window, make_dummy_parent): Call replace_window with
20485 (window_list_1): Move down in code.
20486 (run_window_configuration_change_hook): Move set_buffer part
20487 before select_frame_norecord part in order to unwind correctly.
20488 Rename count1 to count.
20489 (recombine_windows, delete_deletable_window, resize_root_window)
20490 (Fdelete_other_windows_internal)
20491 (Frun_window_configuration_change_hook, make_parent_window)
20492 (resize_window_check, resize_window_apply, Fresize_window_apply)
20493 (resize_frame_windows, Fsplit_window_internal)
20494 (Fdelete_window_internal, Fresize_mini_window_internal):
20496 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20498 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20500 * window.h (window): Add some new members to window structure -
20501 normal_lines, normal_cols, new_total, new_normal, clone_number,
20502 splits, nest, prev_buffers, next_buffers.
20503 (WINDOW_TOTAL_SIZE): Move here from window.c.
20504 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20506 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20508 (make_dummy_parent): Set new members of windows structure.
20509 (make_window): Move down in code. Handle new members of window
20511 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20512 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20513 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20514 (Fset_window_prev_buffers, Fwindow_next_buffers)
20515 (Fset_window_next_buffers, Fset_window_clone_number):
20517 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20518 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20520 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20521 Argument WINDOW can be now internal window too.
20522 (Fwindow_use_time): Move up in code.
20523 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20524 Rewrite doc-string.
20525 (Fset_window_configuration, saved_window)
20526 (Fcurrent_window_configuration, save_window_save): Handle new
20527 members of window structure.
20528 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20529 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20530 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20531 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20532 Qget_mru_window, Qresize_root_window,
20533 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20534 Qauto_buffer_name; staticpro them.
20536 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20538 * window.c (Fwindow_total_size, Fwindow_left_column)
20539 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20540 (Fwindow_list_1): New functions.
20541 (window_box_text_cols): Replace with window_body_cols.
20542 (Fwindow_width, Fscroll_left, Fscroll_right):
20543 Use window_body_cols instead of window_box_text_cols.
20544 (delete_window, Fset_window_configuration):
20545 Call delete_all_subwindows with window as argument.
20546 (delete_all_subwindows): Take a window as argument and not a
20547 structure. Rewrite.
20548 (window_loop): Remove handling of GET_LRU_WINDOW and
20549 GET_LARGEST_WINDOW.
20550 (Fget_lru_window, Fget_largest_window): Move to window.el.
20552 * window.h: Extern window_body_cols instead of
20553 window_box_text_cols. delete_all_subwindows now takes a
20554 Lisp_Object as argument.
20556 * indent.c (compute_motion, Fcompute_motion):
20557 Use window_body_cols instead of window_box_text_cols.
20559 * frame.c (delete_frame): Call delete_all_subwindows with root
20560 window as argument.
20562 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20564 * fns.c (Fputhash): Document return value.
20566 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20568 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20570 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20572 Cons<->int and similar integer overflow fixes (Bug#8794).
20574 Check for overflow when converting integer to cons and back.
20575 * charset.c (Fdefine_charset_internal, Fdecode_char):
20576 Use cons_to_unsigned to catch overflow.
20577 (Fencode_char): Use INTEGER_TO_CONS.
20578 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20579 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20580 * data.c (long_to_cons, cons_to_long): Remove.
20581 (cons_to_unsigned, cons_to_signed): New functions.
20582 These signal an error for invalid or out-of-range values.
20583 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20584 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20585 * font.c (Ffont_variation_glyphs):
20586 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20587 * lisp.h: Include <intprops.h>.
20588 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20589 (cons_to_signed, cons_to_unsigned): New decls.
20590 (long_to_cons, cons_to_long): Remove decls.
20591 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20592 (Fprimitive_undo): Use CONS_TO_INTEGER.
20593 * xfns.c (Fx_window_property): Likewise.
20594 * xselect.c: Include <limits.h>.
20595 (x_own_selection, selection_data_to_lisp_data):
20596 Use INTEGER_TO_CONS.
20597 (x_handle_selection_request, x_handle_selection_clear)
20598 (x_get_foreign_selection, Fx_disown_selection_internal)
20599 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20600 (lisp_data_to_selection_data): Use cons_to_unsigned.
20601 (x_fill_property_data): Use cons_to_signed.
20602 Report values out of range.
20604 Check for buffer and string overflow more precisely.
20605 * buffer.h (BUF_BYTES_MAX): New macro.
20606 * lisp.h (STRING_BYTES_MAX): New macro.
20607 * alloc.c (Fmake_string):
20608 * character.c (string_escape_byte8):
20609 * coding.c (coding_alloc_by_realloc):
20610 * doprnt.c (doprnt):
20611 * editfns.c (Fformat):
20613 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20614 since they may not be the same number.
20615 * editfns.c (Finsert_char):
20616 * fileio.c (Finsert_file_contents):
20617 Likewise for BUF_BYTES_MAX.
20619 * image.c: Use ptrdiff_t, not int, for sizes.
20620 (slurp_file): Switch from int to ptrdiff_t.
20622 (slurp_file): Check that file size fits in both size_t (for
20623 malloc) and ptrdiff_t (for sanity and safety).
20625 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20626 if b->modtime has its maximal value.
20628 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20630 Don't assume time_t can fit into int.
20631 * buffer.h (struct buffer.modtime): Now time_t, not int.
20632 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20633 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20635 Minor fixes for signed vs unsigned integers.
20636 * character.h (MAYBE_UNIFY_CHAR):
20637 * charset.c (maybe_unify_char):
20638 * keyboard.c (read_char, reorder_modifiers):
20639 XINT -> XFASTINT, since the integer must be nonnegative.
20640 * ftfont.c (ftfont_spec_pattern):
20641 * keymap.c (access_keymap, silly_event_symbol_error):
20642 XUINT -> XFASTINT, since the integer must be nonnegative.
20643 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20644 since it makes no difference and we prefer signed.
20645 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20646 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20649 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20651 * window.h (Fwindow_frame): Declare.
20653 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20655 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20656 (SPARE_MEMORY): Always define.
20657 (LARGE_REQUEST): Remove.
20658 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20660 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20662 * lisp.h: Move EXFUNS for Fframe_root_window,
20663 Fframe_first_window and Fset_frame_selected_window to window.h.
20665 * window.h: Move EXFUNS for Fframe_root_window,
20666 Fframe_first_window and Fset_frame_selected_window here from
20669 * frame.c (Fwindow_frame, Fframe_first_window)
20670 (Fframe_root_window, Fframe_selected_window)
20671 (Fset_frame_selected_window): Move to window.c.
20672 (Factive_minibuffer_window): Move to minibuf.c.
20673 (Fother_visible_frames_p): New function.
20675 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20677 * window.c (decode_window, decode_any_window): Move up in code.
20678 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20679 (inhibit_frame_unsplittable): Remove unused variable.
20680 (Fwindow_buffer): Move up and rewrite doc-string.
20681 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20682 (Fwindow_prev): New functions.
20683 (Fwindow_frame): Move here from frame.c. Accept any window as
20685 (Fframe_root_window, Fframe_first_window)
20686 (Fframe_selected_window): Move here from frame.c. Accept frame
20687 or arbitrary window as argument. Update doc-strings.
20688 (Fminibuffer_window): Move up in code.
20689 (Fwindow_minibuffer_p): Move up in code and simplify.
20690 (Fset_frame_selected_window): Move here from frame.c.
20692 (Fselected_window, select_window, Fselect_window): Move up in
20693 code. Minor doc-string fixes.
20695 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20697 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20698 Do not assume that spare memory exists; that assumption is valid
20699 only if SYSTEM_MALLOC.
20700 (LARGE_REQUEST): New macro, so that the issue of large requests
20701 is separated from the issue of spare memory.
20703 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20705 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20708 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20710 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20713 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20715 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20717 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20719 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20720 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20722 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20724 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20726 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20728 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20729 (x_clipboard_manager_save): Add return value.
20730 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20731 New error handlers.
20732 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20733 Obey Vx_select_enable_clipboard_manager. Catch errors in
20734 x_clipboard_manager_save (Bug#8779).
20735 (Vx_select_enable_clipboard_manager): New variable.
20736 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20738 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20740 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20742 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20744 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20745 in the current matrix if keep_current_p is non-zero.
20747 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20749 * bidi.c (bidi_level_of_next_char): Fix last change.
20751 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20753 Support bidi reordering of text covered by display properties.
20755 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20756 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20757 (bidi_cache_search, bidi_cache_iterator_state)
20758 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20759 (bidi_level_of_next_char, bidi_move_to_visually_next):
20760 Support character positions inside a run of characters covered by a
20762 (bidi_paragraph_init, bidi_resolve_explicit_1)
20763 (bidi_level_of_next_char): Call bidi_fetch_char and
20764 bidi_fetch_char_advance instead of FETCH_CHAR and
20765 FETCH_CHAR_ADVANCE.
20766 (bidi_init_it): Initialize new members.
20767 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20769 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20770 instead of using explicit *_CHAR codes.
20771 (bidi_resolve_explicit, bidi_resolve_weak):
20772 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20773 bidirectional text is supported only in multibyte buffers.
20774 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20775 it to initialize the frame_window_p member of struct bidi_it.
20776 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20777 (bidi_resolve_explicit, bidi_resolve_weak)
20778 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20779 bidi_it->nchars is non-positive.
20780 (bidi_level_of_next_char): Don't try to lookup the cache for the
20781 next/previous character if nothing is cached there yet, or if we
20782 were just reseat()'ed to a new position.
20784 * xdisp.c (set_cursor_from_row): Set start and stop points
20785 according to the row's direction when priming the loop that looks
20786 for the glyph on which to display cursor.
20787 (single_display_spec_intangible_p): Function deleted.
20788 (display_prop_intangible_p): Reimplement to call
20789 handle_display_spec instead of single_display_spec_intangible_p.
20790 Accept 3 additional arguments needed by handle_display_spec.
20791 This fixes incorrect cursor motion across display property with complex
20792 values: lists, `(when COND...)' forms, etc.
20793 (single_display_spec_string_p): Support property values that are
20794 lists with the argument STRING its top-level element.
20795 (display_prop_string_p): Fix the condition for processing a
20796 property that is a list to be consistent with handle_display_spec.
20797 (handle_display_spec): New function, refactored from the
20798 last portion of handle_display_prop.
20799 (compute_display_string_pos): Accept additional argument
20800 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20801 value of a `display' property is a "replacing spec".
20802 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20803 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20804 the display property, but just return a value indicating whether
20805 the display property will replace the characters it covers.
20806 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20807 frame_window_p members of struct bidi_it.
20808 (compute_display_string_pos, compute_display_string_end):
20810 (push_it): Accept second argument POSITION, where pop_it should
20811 jump to continue iteration.
20812 (reseat_1): Initialize bidi_it.disp_pos.
20814 * keyboard.c (adjust_point_for_property): Adjust the call to
20815 display_prop_intangible_p to its new signature.
20817 * dispextern.h (struct bidi_it): New member frame_window_p.
20818 (bidi_init_it): Update prototypes.
20819 (display_prop_intangible_p): Update prototype.
20820 (compute_display_string_pos, compute_display_string_end):
20821 Declare prototypes.
20822 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20825 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20827 Malloc failure behavior now depends on size of allocation.
20828 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20829 * lisp.h: Change signatures accordingly.
20830 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20831 All callers changed. (Bug#8762)
20833 * gnutls.c: Use Emacs's memory allocators.
20834 Without this change, the gnutls library would invoke malloc etc.
20835 directly, which causes problems on non-SYNC_INPUT hosts, and which
20836 runs afoul of improving memory_full behavior. (Bug#8761)
20837 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20838 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20839 xfree instead of the default malloc, realloc, free.
20840 (Fgnutls_boot): No need to check for memory allocation failure,
20841 since xmalloc does that for us.
20843 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20844 * category.c (hash_get_category_set):
20845 * ccl.c (ccl_driver):
20846 * charset.c (Fdefine_charset_internal):
20847 * charset.h (struct charset.hash_index):
20848 * composite.c (get_composition_id, gstring_lookup_cache)
20849 (composition_gstring_put_cache):
20850 * composite.h (struct composition.hash_index):
20851 * dispextern.h (struct image.hash):
20852 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20853 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20854 (hashfn_equal, hashfn_user_defined, make_hash_table)
20855 (maybe_resize_hash_table, hash_lookup, hash_put)
20856 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20857 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20858 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20859 * image.c (make_image, search_image_cache, lookup_image)
20860 (xpm_put_color_table_h):
20861 * lisp.h (struct Lisp_Hash_Table):
20862 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20863 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20864 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20865 * alloc.c (allocate_vectorlike):
20866 Check for overflow in vector size calculations.
20867 * ccl.c (ccl_driver):
20868 Check for overflow when converting EMACS_INT to int.
20869 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20870 need to be updated by these changes.
20871 * fns.c (make_hash_table, maybe_resize_hash_table):
20872 Check for integer overflow with large hash tables.
20873 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20874 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20875 (SXHASH_REDUCE): New macro.
20876 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20877 Use it instead of discarding useful hash info with large hash values.
20878 (sxhash_float): New function.
20879 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20880 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20881 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20882 Rewrite to use FIXNUM_BITS, as this simplifies things.
20883 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20884 Adjust signatures to match updated version of code.
20885 (consing_since_gc): Now EMACS_INT, since a single hash table can
20886 use more than INT_MAX bytes.
20888 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20890 Make it possible to build with GCC-4.6+ -O2 -flto.
20892 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20894 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20896 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20897 Call minibuffer-inactive-mode.
20899 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20901 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20902 Update dependencies.
20904 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20906 * data.c (init_data): Remove code for UTS, this system is not
20909 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20911 Don't force ./temacs to start in terminal mode.
20913 * frame.c (make_initial_frame): Initialize faces in all cases, not
20914 only when CANNOT_DUMP is defined.
20915 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20917 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20919 * dispnew.c (add_window_display_history): Use const for the string
20920 pointer. Remove declaration, not needed.
20922 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20924 Use 'inline', not 'INLINE'.
20925 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20926 * alloc.c, fontset.c (INLINE): Remove.
20927 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20928 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20929 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20930 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20931 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20933 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20935 Make it possible to run ./temacs.
20937 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20938 syms_of_callproc does the same thing. Remove test for
20939 "initialized", do it in the caller.
20940 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20942 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20944 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20945 (read_minibuf): Use get_minibuffer.
20946 (syms_of_minibuf): Use DEFSYM.
20947 (Qmetadata): New var.
20948 * data.c (Qbuffer): Don't make it static.
20949 (syms_of_data): Use DEFSYM.
20951 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20953 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20954 (CCL_CODE_MIN): New macro.
20956 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20958 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20960 * eval.c (Qdebug): Now static.
20961 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20962 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20963 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20965 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20967 * image.c: Various fixes to ImageMagick code comments.
20968 (Fimagemagick_types): Doc fix.
20970 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20972 Minor fixes prompted by GCC 4.6.0 warnings.
20974 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20976 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20977 (x_clipboard_manager_save_all): Move extern decl to ...
20978 * xterm.h: ... here, so that it can be checked for consistency.
20980 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20982 * xselect.c (x_clipboard_manager_save_frame)
20983 (x_clipboard_manager_save_all): New functions.
20984 (Fx_clipboard_manager_save): Lisp function deleted.
20986 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20987 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20989 * xterm.h: Update prototype.
20991 2011-05-28 William Xu <william.xwl@gmail.com>
20993 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20994 exiting (Bug#8239).
20996 2011-05-28 Jim Meyering <meyering@redhat.com>
20998 Avoid a sign-extension bug in crypto_hash_function.
20999 * fns.c (to_uchar): Define.
21000 (crypto_hash_function): Use it to convert some newly-signed
21001 variables to unsigned, to avoid sign-extension bugs. For example,
21002 without this change, (md5 "truc") would evaluate to
21003 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21004 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21005 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21007 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21009 Integer overflow fixes.
21011 * dbusbind.c: Serial number integer overflow fixes.
21012 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21013 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21014 to hold a serial number that is too large for a fixnum.
21015 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21016 Check for serial numbers out of range. Decode any serial number
21017 that was so large that it became a float. (Bug#8722)
21019 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21020 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21021 Use XFASTINT rather than XUINT when numbers are nonnegative.
21022 (xd_append_arg, Fdbus_method_return_internal):
21023 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21024 arguments, check that Lisp number is nonnegative, rather than
21025 silently wrapping negative numbers around. (Bug#8722)
21026 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21029 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21031 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21033 ccl: Add integer overflow checks.
21034 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21035 (IN_INT_RANGE): New macros.
21036 (ccl_driver): Use them to check for integer overflow when
21037 decoding a CCL program. Many of the new checks are whether XINT (x)
21038 fits in int; it doesn't always, on 64-bit hosts. The new version
21039 doesn't catch all possible integer overflows, but it's an
21040 improvement. (Bug#8719)
21042 * alloc.c (make_event_array): Use XINT, not XUINT.
21043 There's no need for unsigned here.
21045 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21046 This follows up to the 2011-05-06 change that substituted uintptr_t
21047 for EMACS_INT. This case wasn't caught back then.
21049 Rework Fformat to avoid integer overflow issues.
21050 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21051 now (part of C89). Include <verify.h>.
21052 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21053 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21054 (Fformat): Avoid the prepass trying to compute sizes; it was only
21055 approximate and thus did not catch overflow reliably. Instead, walk
21056 through the format just once, formatting and computing sizes as we go,
21057 checking for integer overflow at every step, and allocating a larger
21058 buffer as needed. Keep track separately whether the format is
21059 multibyte. Keep only the most-recently calculated precision, rather
21060 than them all. Record whether each argument has been converted to
21061 string. Use EMACS_INT, not int, for byte and char and arg counts.
21062 Support field widths and precisions larger than INT_MAX. Avoid
21063 sprintf's undefined behavior with conversion specifications such as %#d
21064 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21065 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21066 formatting out-of-range floating point numbers with int
21067 formats. (Bug#8668)
21069 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21071 * data.c: Avoid integer truncation in expressions involving floats.
21072 * data.c: Include <intprops.h>.
21073 (arith_driver): When there's an integer overflow in an expression
21074 involving floating point, convert the integers to floating point
21075 so that the resulting value does not suffer from catastrophic
21076 integer truncation. For example, on a 64-bit host (* 4
21077 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21078 Do not rely on undefined behavior after integer overflow.
21080 merge count_size_as_multibyte, parse_str_to_multibyte
21081 * character.c, character.h (count_size_as_multibyte):
21082 Rename from parse_str_to_multibyte; all uses changed.
21083 Check for integer overflow.
21084 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21085 since it's now a duplicate of the other. This is more of
21086 a character than a buffer op, so better that it's in character.c.
21087 * fns.c, print.c: Adjust to above changes.
21089 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21091 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21093 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21095 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21096 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21097 (x_clipboard_manager_save): Now static.
21098 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21100 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21101 (crypto_hash_function): Now static.
21102 Fix pointer signedness problems. Avoid unnecessary initializations.
21104 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
21106 * termhooks.h (Vselection_alist): Make it terminal-local.
21108 * terminal.c (create_terminal): Initialize it.
21110 * xselect.c: Support for clipboard managers.
21111 (Vselection_alist): Move to termhooks.h as terminal-local var.
21112 (LOCAL_SELECTION): New macro.
21113 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21114 (symbol_to_x_atom): Remove gratuitous arg.
21115 (x_handle_selection_request, lisp_data_to_selection_data)
21116 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21117 (x_own_selection, x_get_local_selection, x_convert_selection):
21118 New arg, specifying work frame. Use terminal-local Vselection_alist.
21119 (some_frame_on_display): Delete unused function.
21120 (Fx_own_selection_internal, Fx_get_selection_internal)
21121 (Fx_disown_selection_internal, Fx_selection_owner_p)
21122 (Fx_selection_exists_p): New optional frame arg.
21123 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21124 (x_handle_selection_clear): Don't treat other terminals with the
21125 same keyboard specially. Use the terminal-local Vselection_alist.
21126 (x_clear_frame_selections): Use Frun_hook_with_args.
21128 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21130 * xterm.h: Add support for those atoms.
21132 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
21134 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21135 (converted_selections, conversion_fail_tag): New global variables.
21136 (x_selection_request_lisp_error): Free the above.
21137 (x_get_local_selection): Remove unnecessary code.
21138 (x_reply_selection_request): Args changed; handle arbitrary array
21139 of converted selections stored in converted_selections.
21140 Separate the XChangeProperty and SelectionNotify steps.
21141 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21142 (x_convert_selection): New function.
21143 (x_handle_selection_event): Simplify.
21144 (x_get_foreign_selection): Don't ignore incoming requests while
21145 waiting for an answer; this will fail when we implement
21146 SAVE_TARGETS, and seems unnecessary anyway.
21147 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21148 (Vx_sent_selection_functions): Doc fix.
21150 2011-05-26 Leo Liu <sdl.web@gmail.com>
21152 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21154 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21156 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21158 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21159 for fringe update if it has periodic bitmap.
21160 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21161 and fringe_bitmap_periodic_p.
21163 * fringe.c (get_fringe_bitmap_data): New function.
21164 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21165 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21166 row. Mark glyph row for fringe update if periodicity changed.
21168 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21169 for fringe update unless it has periodic bitmap.
21171 2011-05-25 Kenichi Handa <handa@m17n.org>
21173 * xdisp.c (get_next_display_element): Set correct it->face_id for
21174 a static composition.
21176 2011-05-24 Leo Liu <sdl.web@gmail.com>
21179 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21181 * fns.c (crypto_hash_function, Fsha1): New function.
21182 (Fmd5): Use crypto_hash_function.
21183 (syms_of_fns): Add Ssha1.
21185 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21187 * gnutls.c: Remove unused macros.
21188 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21189 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21190 Remove macros that are defined and never used.
21191 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21193 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21195 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21196 (Fx_get_selection_internal): Minor cleanup.
21197 (Fx_own_selection_internal): Rename arguments for consistency with
21200 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21202 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21204 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21206 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21208 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21210 * dispnew.c (scrolling_window): Don't exclude the case that the
21211 last enabled row in the desired matrix touches the bottom boundary.
21213 2011-05-21 Glenn Morris <rgm@gnu.org>
21215 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21216 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21217 and add some more files.
21219 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21221 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21222 report_file_error introduced by the change from 2011-05-07.
21224 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21226 * systime.h (Time): Define only if emacs is defined.
21227 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21228 where the include path doesn't have X11/X.h by default. See
21229 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21231 2011-05-20 Kenichi Handa <handa@m17n.org>
21233 * composite.c (find_automatic_composition): Fix previous change.
21235 2011-05-20 Glenn Morris <rgm@gnu.org>
21237 * lisp.mk: New file, split from Makefile.in.
21238 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21239 (shortlisp): Remove.
21240 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21242 2011-05-19 Glenn Morris <rgm@gnu.org>
21244 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21245 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21246 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21247 (lisp): Set the order to that of loadup.el.
21248 (shortlisp): Make it a copy of $lisp.
21249 (SOME_MACHINE_LISP): Remove.
21250 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21251 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21253 2011-05-18 Kenichi Handa <handa@m17n.org>
21255 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21256 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21257 (find_automatic_composition): Mostly rewrite for efficiency.
21259 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21261 * makefile.w32-in: Update dependencies.
21263 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21265 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21266 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21268 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21270 Fix some integer overflow issues, such as string length overflow.
21272 * insdel.c (count_size_as_multibyte): Check for string overflow.
21274 * character.c (lisp_string_width): Check for string overflow.
21275 Use EMACS_INT, not int, for string indexes and lengths; in
21276 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21277 the resulting string length overflows an EMACS_INT; instead,
21278 report a string overflow if no precision given. When checking for
21279 precision exhaustion, use a check that cannot possibly have
21280 integer overflow. (Bug#8675)
21281 * character.h (lisp_string_width): Adjust to new signature.
21283 * alloc.c (string_overflow): New function.
21284 (Fmake_string): Use it. This doesn't change behavior, but saves
21285 a few bytes and will simplify future changes.
21286 * character.c (string_escape_byte8): Likewise.
21287 * lisp.h (string_overflow): New decl.
21289 Fixups, following up to the user-interface timestamp change.
21290 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21291 for UI timestamps, instead of unsigned long.
21292 * msdos.c (mouse_get_pos): Likewise.
21293 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21294 * w32gui.h (Time): Define by including "systime.h" rather than by
21295 declaring it ourselves. (Bug#8664)
21297 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21298 * image.c (clear_image_cache): Likewise.
21300 * term.c (term_mouse_position): Don't assume time_t wraparound.
21302 Be more systematic about user-interface timestamps.
21303 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21304 and sometimes 'EMACS_UINT', to represent these timestamps.
21305 This change causes it to use 'Time' uniformly, as that's what X uses.
21306 This makes the code easier to follow, and makes it easier to catch
21307 integer overflow bugs such as Bug#8664.
21308 * frame.c (Fmouse_position, Fmouse_pixel_position):
21309 Use Time, not unsigned long, for user-interface timestamps.
21310 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21311 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21312 * keyboard.h (last_event_timestamp): Likewise.
21313 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21314 * menu.h (xmenu_show): Likewise.
21315 * term.c (term_mouse_position): Likewise.
21316 * termhooks.h (struct input_event.timestamp): Likewise.
21317 (struct terminal.mouse_position_hook): Likewise.
21318 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21319 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21320 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21321 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21322 what it was before.
21323 * menu.h, termhooks.h: Include "systime.h", for Time.
21325 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21326 Don't assume that the difference between two unsigned long values
21327 can fit into an integer. At this point, we know button_down_time
21328 <= event->timestamp, so the difference must be nonnegative, so
21329 there's no need to cast the result if double-click-time is
21330 nonnegative, as it should be; check that it's nonnegative, just in
21331 case. This bug is triggered when events are more than 2**31 ms
21332 apart (about 25 days). (Bug#8664)
21334 * xselect.c (last_event_timestamp): Remove duplicate decl.
21335 (x_own_selection): Remove needless cast to unsigned long.
21337 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21338 that always fit in int. Use a sentinel instead of a counter, to
21339 avoid a temp and to allay GCC's concerns about possible int overflow.
21340 * frame.h (struct frame): Use int for menu_bar_items_used
21341 instead of EMACS_INT, since it always fits in int.
21343 * menu.c (grow_menu_items): Check for int overflow.
21345 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21347 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21348 Before, the code was not consistent. These values cannot exceed
21349 2**31 - 1 so there's no need to make them unsigned.
21350 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21351 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21352 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21354 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21356 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21357 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21358 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21359 presumably because the widths might not match.
21361 * window.c (size_window): Avoid needless test at loop start.
21363 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21365 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21367 2011-05-12 Drew Adams <drew.adams@oracle.com>
21369 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21371 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21373 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21374 `width' to `bar_area_x' and `bar_area_width', respectively.
21375 (x_scroll_run): Take account of fringe background extension.
21377 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21378 Rename local vars `left' and `width' to `bar_area_x' and
21379 `bar_area_width', respectively.
21380 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21381 background extension.
21383 2011-05-10 Jim Meyering <meyering@redhat.com>
21385 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21387 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21389 * image.c (Finit_image_library): Return t for built-in image types,
21390 like pbm and xbm. (Bug#8640)
21392 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21394 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21396 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21398 * w32console.c (Fset_screen_color): Doc fix.
21399 (Fget_screen_color): New function.
21400 (syms_of_ntterm): Defsubr it.
21402 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21403 unlink the temporary file if Fcall_process didn't create it in the
21405 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21406 child process will be redirected to a file specified with `:file'.
21407 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21408 cue to call_process_cleanup not to close that handle.
21410 2011-05-07 Ben Key <bkey76@gmail.com>
21412 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21413 one of two shell specific rules, either bootstrap-temacs-CMD or
21414 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21415 to the previous implementation of the bootstrap-temacs rule.
21416 The bootstrap-temacs-CMD rule is similar to the previous
21417 implementation of the bootstrap-temacs rule except that it
21418 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21421 These changes, along with some changes to nt/configure.bat,
21422 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21423 earlier fix to add support for --cflags and --ldflags options
21424 that include quotes so that it works whether make uses cmd or
21427 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21429 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21430 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21432 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21433 a string. Handle both cases.
21434 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21435 (Fdbus_register_method): Use Qinvalid_function.
21437 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21439 * makefile.w32-in: Update dependencies.
21440 (LISP_H): Add inttypes.h and stdin.h.
21441 (PROCESS_H): Add unistd.h.
21443 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21445 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21446 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21448 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21450 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21452 * term.c (vfatal): Remove stray call to va_end.
21453 It's not needed and the C Standard doesn't allow it here anyway.
21455 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21456 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21458 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21461 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21463 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21465 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21467 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21469 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21471 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21472 * charset.c (Fdefine_charset_internal): Don't initialize
21473 charset.code_space[15]. The value was garbage, on hosts with
21474 32-bit int (Bug#8600).
21476 * lread.c (read_integer): Be more consistent with string-to-number.
21477 Use string_to_number to do the actual conversion; this avoids
21478 rounding errors and fixes some other screwups. Without this fix,
21479 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21480 (digit_to_number): Move earlier, for benefit of read_integer.
21481 Return -1 if the digit is out of range for the base, -2 if it is
21482 not a digit in any supported base. (Bug#8602)
21484 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21486 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21487 to match comment at start of function. This also removes a
21488 GCC warning about overflow in a 32+64-bit port.
21490 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21492 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21493 Reported by Stefan Monnier in
21494 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21495 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21496 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21498 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21499 (EMACS_UINTPTR): Likewise, with uintptr_t.
21501 * lisp.h: Prefer 64-bit EMACS_INT if available.
21502 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21503 on 32-bit hosts that have 64-bit int, so that they can access
21505 However, temporarily disable this change unless the temporary
21506 symbol WIDE_EMACS_INT is defined.
21508 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21510 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21511 This removes an assumption that EMACS_INT and long are the same
21512 width as pointers. The assumption is true for Emacs porting targets
21513 now, but we want to make other targets possible.
21514 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21515 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21516 In the rest of the code, change types of integers that hold casted
21517 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21518 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21519 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21520 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21521 No need to cast type when ORing.
21522 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21523 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21524 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21525 assume EMACS_INT is the same width as char *.
21526 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21527 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21528 Remove no-longer-needed casts.
21529 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21530 (xg_tool_bar_help_callback, xg_make_tool_item):
21531 Use EMACS_INTPTR to hold an integer
21532 that will be cast to void *; this can avoid a GCC warning
21533 if EMACS_INT is not the same width as void *.
21534 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21535 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21536 (current_message_1, set_message_1):
21537 Use a local to convert to proper width without a cast.
21538 * xmenu.c (dialog_selection_callback): Likewise.
21540 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21541 Also, don't assume VALBITS / RAND_BITS is less than 5,
21542 and don't rely on undefined behavior when shifting a 1 left into
21544 * lisp.h (get_random): Change signature to match.
21546 * lread.c (hash_string): Use size_t, not int, for hash computation.
21547 Normally we prefer signed values; but hashing is special, because
21548 it's better to use unsigned division on hash table sizes so that
21549 the remainder is nonnegative. Also, size_t is the natural width
21550 for hashing into memory. The previous code used 'int', which doesn't
21551 retain enough info to hash well into very large tables.
21552 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21554 * dbusbind.c: Don't possibly lose pointer info when converting.
21555 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21556 Use XPNTR rather than XHASH, so that the high-order bits of
21557 the pointer aren't lost when converting through void *.
21559 * eval.c (Fautoload): Don't double-shift a pointer.
21561 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21563 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21565 * gnutls.c (DEF_GNUTLS_FN):
21566 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21568 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21570 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21573 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21575 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21576 New version that can reserve upto 2GB of heap space.
21578 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21580 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21582 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21584 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21585 `gnutls_certificate_set_x509_key_file'.
21587 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21589 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21590 Update dependencies.
21592 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21594 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21595 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21596 Remove unused parameter `fildes'.
21597 * process.c (read_process_output, send_process): Don't pass it.
21599 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21601 Fix previous change: the library cache is defined in w32.c.
21602 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21603 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21605 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21607 Implement dynamic loading of GnuTLS on Windows.
21609 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21610 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21611 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21614 * gnutls.c (Qgnutls_dll): Define.
21615 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21616 (gnutls_*): Declare function pointers.
21617 (init_gnutls_functions): New function to initialize function pointers.
21618 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21619 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21620 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21621 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21622 (emacs_gnutls_write, emacs_gnutls_read)
21623 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21624 (Fgnutls_available_p): New function.
21625 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21626 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21627 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21629 * image.c: Include w32.h.
21630 (Vimage_type_cache): Delete.
21631 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21632 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21633 (w32_delayed_load): Move to w32.c.
21635 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21637 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21638 (w32_delayed_load): Move from image.c. When loading a library, record
21639 its filename in the :loaded-from property of the library id.
21640 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21641 Initialize and staticpro them.
21642 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21644 * process.c: Include lisp.h before w32.h, not after.
21645 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21646 instead of gnutls_record_check_pending.
21648 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21650 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21652 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21653 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21656 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21658 * xterm.c (x_set_frame_alpha): Do not set property on anything
21659 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21661 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21663 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21665 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21667 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21668 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21669 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21670 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21671 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21672 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21673 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21674 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21675 (Qgnutls_bootprop_callbacks_verify): Make static.
21677 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21679 * callproc.c: Indentation fixup.
21681 * sysdep.c (wait_for_termination_1): Make static.
21682 (wait_for_termination, interruptible_wait_for_termination):
21683 Move after wait_for_termination_1.
21685 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21687 * sysdep.c (interruptible_wait_for_termination): New function
21688 which is like wait_for_termination, but allows keyboard
21691 * callproc.c (Fcall_process): Add (:file "file") as an option for
21693 (Fcall_process_region): Ditto.
21695 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21697 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21698 rather than `XVECTOR (FOO)->size'.
21700 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21701 inttypes.h, as a gnulib replacement is used if it not available in
21704 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21706 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21707 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21708 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21710 * coding.c (coding_alloc_by_realloc): Error out if destination
21711 will grow beyond MOST_POSITIVE_FIXNUM.
21712 (decode_coding_emacs_mule): Abort if there isn't enough place in
21713 charbuf for the composition carryover bytes. Reserve an extra
21714 space for up to 2 characters produced in a loop.
21715 (decode_coding_iso_2022): Abort if there isn't enough place in
21716 charbuf for the composition carryover bytes.
21718 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21720 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21721 aborting when %lld or %lll format is passed.
21722 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21723 %llo or %llx format is passed. (Bug#8545)
21725 * window.c (window_scroll_line_based): Use a marker instead of
21726 simple variables to record original value of point. (Bug#7952)
21728 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21729 produced by %s or %c overflows available buffer space. (Bug#8545)
21731 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21733 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21734 (SIZE_MAX): Move defn after all includes, as they might #define it.
21736 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21738 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21740 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21742 * keyboard.c (Qdelayed_warnings_hook): Define.
21743 (command_loop_1): Run `delayed-warnings-hook'
21744 if Vdelayed_warnings_list is non-nil.
21745 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21746 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21748 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21750 * doprnt.c (doprnt): Don't return value smaller than the buffer
21751 size if the message was truncated. (Bug#8545).
21753 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21755 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21756 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21758 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21760 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21762 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21764 * makefile.w32-in: Update dependencies.
21766 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21768 Improve `doprnt' and its usage. (Bug#8545)
21769 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21770 `format_end'. Remove support for %l as a conversion specifier.
21771 Don't use xrealloc. Improve diagnostics when the %l size modifier
21772 is used. Update the commentary.
21774 * eval.c (verror): Simplify calculation of size_t.
21776 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21779 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21781 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21784 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21786 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21787 This makes this file independent of the recent pseudovector change.
21789 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21791 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21793 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21794 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21795 Remove unused local.
21796 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21798 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21799 GCC 4.6.0 optimizes based on type-based alias analysis.
21800 For example, if b is of type struct buffer * and v of type struct
21801 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21802 != &v->size, and therefore "v->size = 1; b->size = 2; return
21803 v->size;" must therefore return 1. This assumption is incorrect
21804 for Emacs, since it type-puns struct Lisp_Vector * with many other
21805 types. To fix this problem, this patch adds a new type struct
21806 vectorlike_header that documents the constraints on layout of vectors
21807 and pseudovectors, and helps optimizing compilers not get fooled
21808 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21809 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21810 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21812 (XSETPVECTYPE): Rewrite in terms of new macro.
21813 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21814 This is a bit clearer, and further avoids the possibility of
21815 undesirable aliasing.
21816 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21817 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21818 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21819 since Lisp_Subr is a special case (no "next" field).
21820 (ASIZE): Now uses header.size rather than size.
21821 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21822 to avoid the hassle of writing XVECTOR (foo)->header.size.
21823 (struct vectorlike_header): New type.
21824 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21825 object, to help avoid aliasing.
21826 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21827 (SUBRP): Likewise, since Lisp_Subr is a special case.
21828 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21829 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21830 (struct Lisp_Hash_Table): Combine first two members into a single
21831 struct vectorlike_header member. All uses of "size" and "next" members
21832 changed to be "header.size" and "header.next".
21833 * buffer.h (struct buffer): Likewise.
21834 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21835 * frame.h (struct frame): Likewise.
21836 * process.h (struct Lisp_Process): Likewise.
21837 * termhooks.h (struct terminal): Likewise.
21838 * window.c (struct save_window_data, struct saved_window): Likewise.
21839 * window.h (struct window): Likewise.
21840 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21841 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21842 * buffer.c (init_buffer_once): Likewise.
21843 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21845 * process.c (Fformat_network_address): Use local var for size,
21848 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21850 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21851 * data.c (atof): Remove decl; no longer used or needed.
21852 (digit_to_number): Move to lread.c.
21853 (Fstring_to_number): Use new string_to_number function, to be
21854 consistent with how the Lisp reader treats infinities and NaNs.
21855 Do not assume that floating-point numbers represent EMACS_INT
21856 without losing information; this is not true on most 64-bit hosts.
21857 Avoid double-rounding errors, by insisting on integers when
21858 parsing non-base-10 numbers, as the documentation specifies.
21859 * lisp.h (string_to_number): New decl, replacing ...
21860 (isfloat_string): Remove.
21861 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21862 (read1): Do not accept +. and -. as integers; this
21863 appears to have been a coding error. Similarly, do not accept
21864 strings like +-1e0 as floating point numbers. Do not report
21865 overflow for integer overflows unless the base is not 10 which
21866 means we have no simple and reliable way to continue.
21867 Break out the floating-point parsing into a new
21868 function string_to_number, so that Fstring_to_number parses
21869 floating point numbers consistently with the Lisp reader.
21870 (digit_to_number): Move here from data.c. Make it static inline.
21871 (E_CHAR, EXP_INT): Remove, replacing with ...
21872 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21873 (string_to_number): New function, replacing isfloat_string.
21874 This function checks for valid syntax and produces the resulting
21875 Lisp float number too. Rework it so that string-to-number
21876 no longer mishandles examples like "1.0e+". Use strtoumax,
21877 so that overflow for non-base-10 numbers is reported only when
21878 there's no portable and simple way to convert to floating point.
21880 * textprop.c (set_text_properties_1): Rewrite for clarity,
21881 and to avoid GCC warning about integer overflow.
21883 * intervals.h (struct interval): Use EMACS_INT for members
21884 where EMACS_UINT might cause problems. See
21885 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21886 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21887 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21889 (offset_intervals): Tell GCC not to worry about length overflow
21890 when negating a negative length.
21892 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21893 (overrun_check_free): Likewise.
21895 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21896 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21899 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21900 (gnutls_make_error): Rename local to avoid shadowing.
21901 (gnutls_emacs_global_deinit): ifdef out; not used.
21902 (Fgnutls_boot): Use const for pointer to readonly storage.
21903 Comment out unused local. Fix pointer signedness problems.
21905 * lread.c (openp): Don't stuff size_t into an 'int'.
21906 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21907 about possible signed overflow.
21909 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21910 (GDK_KEY_g): Don't define if already defined.
21911 (xg_prepare_tooltip): Avoid pointer signedness problem.
21912 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21914 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21915 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21917 * xfns.c (Fx_window_property): Simplify a bit,
21918 to make a bit faster and to avoid GCC 4.6.0 warning.
21919 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21921 * fns.c (internal_equal): Don't assume size_t fits in int.
21923 * alloc.c (compact_small_strings): Tighten assertion a little.
21925 Replace pEd with more-general pI, and fix some printf arg casts.
21926 * lisp.h (pI): New macro, generalizing old pEd macro to other
21927 conversion specifiers. For example, use "...%"pI"d..." rather
21928 than "...%"pEd"...".
21929 (pEd): Remove. All uses replaced with similar uses of pI.
21930 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21931 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21932 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21933 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21934 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21935 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21936 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21938 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21939 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21940 * print.c (safe_debug_print, print_object): Likewise.
21941 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21943 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21944 avoiding the 0 flag, which is not portable.
21945 * process.c (Fmake_network_process): Use pI to avoid cast.
21946 * region-cache.c (pp_cache): Likewise.
21947 * xdisp.c (decode_mode_spec): Likewise.
21948 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21949 behavior on 64-bit hosts with printf arg.
21950 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21951 (x_stop_queuing_selection_requests): Likewise.
21952 (x_get_window_property): Don't truncate byte count to an 'int'
21955 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21956 here, since it parses constructs like leading '-' and spaces,
21957 which are not wanted; and it overflows with large numbers.
21958 Instead, simply match F[0-9]+, which is what is wanted anyway.
21960 * alloc.c: Remove unportable assumptions about struct layout.
21961 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21962 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21963 (allocate_vectorlike, make_pure_vector): Use the new macros,
21964 plus offsetof, to remove unportable assumptions about struct layout.
21965 These assumptions hold on all porting targets that I know of, but
21966 they are not guaranteed, they're easy to remove, and removing them
21967 makes further changes easier.
21969 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21970 This doesn't fix a bug but makes the code clearer.
21971 (string_overrun_cookie): Now const. Use initializers that
21972 don't formally overflow signed char, to avoid warnings.
21973 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21974 can cause Emacs to crash when string overrun checking is enabled.
21975 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21976 multiple of sizeof (EMACS_INT); it need not be, if
21977 alignof(EMACS_INT) < sizeof (EMACS_INT).
21978 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21980 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21982 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21984 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21986 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21987 supposed to be handshaking. (Bug#8556)
21988 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21990 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21992 * lisp.h (Qdebug): List symbol.
21993 * eval.c (Qdebug): Restore global linkage.
21994 * keyboard.c (debug-on-event): New variable.
21995 (handle_user_signal): Break into debugger when debug-on-event
21996 matches the current signal symbol.
21998 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22000 * alloc.c (check_sblock, check_string_bytes)
22001 (check_string_free_list): Convert to standard C.
22003 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22005 * w32.c (emacs_gnutls_push): Fix typo.
22007 2011-04-25 Eli Zaretskii <eliz@gnu.org>
22009 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22010 "cast to pointer from integer of different size".
22012 Improve doprnt and its use in verror. (Bug#8545)
22013 * doprnt.c (doprnt): Document the set of format control sequences
22014 supported by the function. Use SAFE_ALLOCA instead of always
22017 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22018 is one byte too soon. Don't use xrealloc; instead xfree and
22021 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22023 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22026 * gnutls.c: Renamed global_initialized to
22027 gnutls_global_initialized. Added internals for the
22028 :verify-hostname-error, :verify-error, and :verify-flags
22029 parameters of `gnutls-boot' and documented those parameters in the
22030 docstring. Start callback support.
22031 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22032 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22033 on error. Return error code.
22034 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22035 (emacs_gnutls_read): Likewise.
22036 (Fgnutls_boot): Return handshake error code.
22037 (emacs_gnutls_handle_error): New function.
22038 (wsaerror_to_errno): Likewise.
22040 * w32.h (emacs_gnutls_pull): Add prototype.
22041 (emacs_gnutls_push): Likewise.
22043 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22044 (emacs_gnutls_push): Likewise.
22046 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22048 * process.c (wait_reading_process_output): Check if GnuTLS
22049 buffered some data internally if no FDs are set for TLS
22052 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22053 (LIBS): Link to USER_LIBS.
22054 ($(BLD)/gnutls.$(0)): New target.
22056 2011-04-24 Eli Zaretskii <eliz@gnu.org>
22058 * xdisp.c (handle_single_display_spec): Rename the
22059 display_replaced_before_p argument into display_replaced_p, to
22060 make it consistent with the commentary. Fix typos in the
22063 * textprop.c (syms_of_textprop): Remove dead code.
22064 (copy_text_properties): Delete obsolete commentary about an
22065 interface that was deleted long ago. Fix typos in the description
22068 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22069 to changes in oldXMenu/XMenu.h from 2011-04-16.
22070 <menu_help_message, prev_menu_help_message>: Constify.
22071 (IT_menu_make_room): menu->help_text is now `const char **';
22074 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22075 to changes in oldXMenu/XMenu.h from 2011-04-16.
22076 (struct XMenu): Declare `help_text' `const char **'.
22078 * xfaces.c <Qunspecified>: Make extern again.
22080 * syntax.c: Include sys/types.h before including regex.h, as
22083 * doc.c (get_doc_string): Improve the format passed to `error'.
22085 * doprnt.c (doprnt): Improve commentary.
22087 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22089 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22092 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22093 changes in globals.h immediately force recompilation.
22094 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22095 $(CURDIR)/s/ms-w32.h.
22096 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22098 * character.c (Fchar_direction): Function deleted.
22099 (syms_of_character): Don't defsubr it.
22100 <char-direction-table>: Deleted.
22102 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22104 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22105 * doprnt.c: Include limits.h.
22106 (SIZE_MAX): New macro.
22107 (doprnt): Return a size_t value. 2nd arg is now size_t.
22108 Many local variables are now size_t instead of int or unsigned.
22109 Improve overflow protection. Support `l' modifier for integer
22110 conversions. Support %l conversion. Don't assume an EMACS_INT
22111 argument for integer conversions and for %c.
22113 * lisp.h (doprnt): Restore prototype.
22115 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22116 $(SRC)/character.h.
22118 * Makefile.in (base_obj): Add back doprnt.o.
22120 * deps.mk (doprnt.o): Add back prerequisites.
22121 (callint.o): Depend on character.h.
22123 * eval.c (internal_lisp_condition_case): Include the handler
22124 representation in the error message.
22125 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22126 when breaking from the loop.
22128 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22130 * callint.c (Fcall_interactively): When displaying error message
22131 about invalid control letter, pass the character's codepoint, not
22132 a pointer to its multibyte form. Improve display of the character
22133 in octal and display also its hex code.
22135 * character.c (char_string): Use %x to display the (unsigned)
22136 codepoint of an invalid character, to avoid displaying a bogus
22139 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22140 `error', not SYMBOL_NAME itself.
22142 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22143 character arguments to `error'.
22145 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22146 to `error' in error message about FINAL_CHAR argument. Make sure
22147 FINAL_CHAR is a character, and use %c when it is passed as
22148 argument to `error'.
22150 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22152 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22154 * w32.c: Include <time.h>.
22155 (sys_localtime): New function.
22157 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22159 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22161 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22163 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22165 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22166 zombies (Bug#8467).
22168 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22170 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22171 gl_state.e_property when gl_state.object is Qt.
22173 * insdel.c (make_gap_larger): Remove limitation of buffer size
22176 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22178 * xdisp.c (lookup_glyphless_char_display)
22179 (produce_glyphless_glyph): Handle cons cell entry in
22180 glyphless-char-display.
22181 (Vglyphless_char_display): Document it.
22183 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22184 glyphless-char-display.
22186 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22188 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22190 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22192 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22193 definition for no-X builds.
22195 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22197 Static checks with GCC 4.6.0 and non-default toolkits.
22199 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22201 * process.c (keyboard_bit_set): Define only if SIGIO.
22202 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22203 (send_process): Repair possible setjmp clobbering.
22205 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22207 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22209 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22211 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22212 Define only if needed.
22214 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22215 by pacifying GCC about it. Maybe it's time to retire it?
22216 * xfaces.c (USG, __TIMEVAL__): Likewise.
22218 * dispextern.h (struct redisplay_interface): Rename param
22219 to avoid shadowing.
22220 * termhooks.h (struct terminal): Likewise.
22221 * xterm.c (xembed_send_message): Likewise.
22223 * insdel.c (make_gap_smaller): Define only if
22224 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22226 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22229 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22230 so that we aren't warned about unused symbols.
22232 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22234 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22236 * xfns.c (x_real_positions): Mark locals as initialized.
22238 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22240 * xterm.c: Fix problems found by static analysis with other toolkits.
22241 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22242 (x_dispatch_event): Declare static if USE_GTK, and
22243 define if USE_GTK || USE_X_TOOLKIT.
22244 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22245 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22246 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22247 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22249 * xmenu.c (menu_help_callback): Pointer type fixes.
22250 Use const pointers when pointing at readonly data. Avoid pointer
22251 signedness clashes.
22252 (FALSE): Remove unused macro.
22253 (update_frame_menubar): Remove unused decl.
22255 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22257 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22258 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22259 (single_menu_item): Rename local to avoid shadowing.
22261 * keyboard.c (make_lispy_event): Remove unused local var.
22263 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22264 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22266 * bitmaps: Change bitmaps from unsigned char back to the X11
22267 compatible char. Avoid the old compiler warnings about
22268 out-of-range initializers by using, for example, '\xab' rather
22271 * xgselect.c (xgselect_initialize): Check vs interface
22272 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22274 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22276 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22277 to read-only memory.
22279 * fns.c (vector): Remove; this old hack is no longer needed.
22281 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22283 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22285 * xrdb.c (x_load_resources): Omit unused local.
22287 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22288 (x_window): Rename locals to avoid shadowing.
22289 (USG): Use the kludged USG macro, to pacify gcc.
22291 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22292 (x_term_init): Remove local to avoid shadowing.
22294 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22296 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22297 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22299 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22301 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22303 Fix regex.c, syntax.c and friends for buffers > 2GB.
22304 * syntax.h (struct gl_state_s): Declare character position members
22307 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22309 * textprop.c (verify_interval_modification, interval_of):
22310 Declare arguments EMACS_INT.
22312 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22315 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22317 * indent.c (Fvertical_motion): Local variable it_start is now
22320 * regex.c (re_match, re_match_2, re_match_2_internal)
22321 (bcmp_translate, regcomp, regexec, print_double_string)
22322 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22323 (re_compile_pattern, re_exec): Declare arguments and local
22324 variables `size_t' and `ssize_t' and return values `regoff_t', as
22326 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22327 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22328 <compile_stack_type>: `size' and `avail' are now `size_t'.
22330 * regex.h <regoff_t>: Use ssize_t, not int.
22331 (re_search, re_search_2, re_match, re_match_2): Arguments that
22332 specify buffer/string position and length are now ssize_t and
22333 size_t. Return type is regoff_t.
22335 2011-04-16 Ben Key <bkey76@gmail.com>
22337 * nsfont.m: Fixed bugs in ns_get_family and
22338 ns_descriptor_to_entity that were caused by using free to
22339 deallocate memory blocks that were allocated by xmalloc (via
22340 xstrdup). This caused Emacs to crash when compiled with
22341 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22342 --enable-checking=xmallocoverrun). xfree is now used to
22343 deallocate these memory blocks.
22345 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22347 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22349 emacs_write: Accept and return EMACS_INT for sizes.
22350 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22352 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22353 Accept and return EMACS_INT.
22354 (emacs_gnutls_write): Return the number of bytes written on
22356 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22357 (emacs_read, emacs_write): Remove check for negative size, as the
22358 Emacs source code has been audited now.
22359 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22360 (emacs_read, emacs_write): Use it.
22361 * process.c (send_process): Adjust to the new signatures of
22362 emacs_write and emacs_gnutls_write. Do not attempt to store
22363 a byte offset into an 'int'; it might overflow.
22364 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22366 * sound.c: Don't assume sizes fit in 'int'.
22367 (struct sound_device.period_size, alsa_period_size):
22368 Return EMACS_INT, not int.
22369 (struct sound_device.write, vox_write, alsa_write):
22370 Accept EMACS_INT, not int.
22371 (wav_play, au_play): Use EMACS_INT to store sizes and to
22372 record read return values.
22374 2011-04-15 Ben Key <bkey76@gmail.com>
22376 * keyboard.c (Qundefined): Don't declare static since it is used
22378 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22379 static since they are used in nsfont.m.
22381 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22383 * process.c (Qprocessp): Don't declare static.
22384 * lisp.h (Qprocessp): Declare again.
22386 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22388 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22390 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22392 Improve C-level modularity by making more things 'static'.
22394 Don't publish debugger-only interfaces to other modules.
22395 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22396 (verify_bytepos, count_markers): Move decls to the only modules
22398 * region-cache.h (pp_cache): Likewise.
22399 * window.h (check_all_windows): Likewise.
22400 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22402 * sysdep.c (croak): Now static, if
22403 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22404 * syssignal.h (croak): Declare only if not static.
22406 * alloc.c (refill_memory_reserve): Now static if
22407 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22408 * lisp.h (refill_memory_reserve): Declare only if not static.
22410 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22411 Define only if USE_LUCID.
22413 * xrdb.c (x_customization_string, x_rm_string): Now static.
22415 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22416 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22418 * xdisp.c (draw_row_with_mouse_face): Now static.
22419 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22421 * window.h (check_all_windows): Mark externally visible.
22423 * window.c (window_deletion_count): Now static.
22425 * undo.c: Make symbols static if they're not exported.
22426 (last_undo_buffer, last_boundary_position, pending_boundary):
22429 * textprop.c (interval_insert_behind_hooks): Now static.
22430 (interval_insert_in_front_hooks): Likewise.
22432 * term.c: Make symbols static if they're not exported.
22433 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22434 (max_frame_lines, tty_set_terminal_modes):
22435 (tty_reset_terminal_modes, tty_turn_off_highlight):
22436 (get_tty_terminal): Now static.
22437 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22438 * termhooks.h (term_mouse_moveto): Do not declare if
22439 HAVE_WINDOW_SYSTEM.
22440 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22441 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22443 * sysdep.c: Make symbols static if they're not exported.
22444 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22446 (sigprocmask_set, full_mask): Remove; unused.
22447 (wait_debugging): Mark as visible.
22448 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22449 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22451 * syntax.c (syntax_temp): Define only if !__GNUC__.
22453 * sound.c (current_sound_device, current_sound): Now static.
22455 * search.c (searchbufs, searchbuf_head): Now static.
22457 * scroll.c (scroll_cost): Remove; unused.
22458 * dispextern.h (scroll_cost): Remove decl.
22460 * region-cache.h (pp_cache): Mark as externally visible.
22462 * process.c: Make symbols static if they're not exported.
22463 (process_tick, update_tick, create_process, chan_process):
22464 (Vprocess_alist, proc_buffered_char, datagram_access):
22465 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22466 (deactivate_process): Mark defn as static, as well as decl.
22467 * lisp.h (create_process): Remove decl.
22468 * process.h (chan_process, Vprocess_alist): Remove decls.
22470 * print.c: Make symbols static if they're not exported.
22471 (print_depth, new_backquote_output, being_printed, print_buffer):
22472 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22473 (print_interval, print_number_index, initial_stderr_stream):
22475 * lisp.h (Fprinc): Remove decl.
22476 (debug_output_compilation_hack): Mark as externally visible.
22478 * sysdep.c (croak): Move decl from here to syssignal.h.
22479 * syssignal.h (croak): Put it here, so the API can be checked when
22480 'croak' is called from dissociate_if_controlling_tty.
22482 * minibuf.c: Make symbols static if they're not exported.
22483 (minibuf_save_list, choose_minibuf_frame): Now static.
22484 * lisp.h (choose_minibuf_frame): Remove decl.
22486 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22488 * lread.c: Make symbols static if they're not exported.
22489 (read_objects, initial_obarray, oblookup_last_bucket_number):
22491 (make_symbol): Remove; unused.
22492 * lisp.h (initial_obarray, make_symbol): Remove decls.
22494 * keyboard.c: Make symbols static if they're not exported.
22495 (single_kboard, recent_keys_index, total_keys, recent_keys):
22496 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22497 (this_single_command_key_start, echoing, last_auto_save):
22498 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22499 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22500 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22501 (Vlispy_mouse_stem, double_click_count):
22503 (force_auto_save_soon): Define only if SIGDANGER.
22504 (ignore_mouse_drag_p): Now static if
22505 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22506 (print_help): Remove; unused.
22507 (stop_character, last_timer_event): Mark as externally visible.
22508 * keyboard.h (ignore_mouse_drag_p): Declare only if
22509 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22510 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22511 * lisp.h (echoing): Remove decl.
22512 (force_auto_save_soon): Declare only if SIGDANGER.
22513 * xdisp.c (redisplay_window): Simplify code, to make it more
22514 obvious that ignore_mouse_drag_p is not accessed if !defined
22515 USE_GTK && !defined HAVE_NS.
22517 * intervals.c: Make symbols static if they're not exported.
22518 (merge_properties_sticky, merge_interval_right, delete_interval):
22520 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22522 * insdel.c: Make symbols static if they're not exported.
22523 However, leave prepare_to_modify_buffer alone. It's never
22524 called from outside this function, but that appears to be a bug.
22525 (combine_after_change_list, combine_after_change_buffer):
22526 (adjust_after_replace, signal_before_change): Now static.
22527 (adjust_after_replace_noundo): Remove; unused.
22528 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22529 (signal_before_change): Remove decls.
22531 * indent.c (val_compute_motion, val_vmotion): Now static.
22533 * image.c: Make symbols static if they're not exported.
22534 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22536 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22537 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22539 * fringe.c (standard_bitmaps): Now static.
22540 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22542 * frame.c: Make symbols static if they're not exported.
22543 (x_report_frame_params, make_terminal_frame): Now static.
22544 (get_frame_param): Now static, unless HAVE_NS.
22545 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22546 (x_get_resource_string): Remove; not used.
22547 * frame.h (make_terminal_frame, x_report_frame_params):
22548 (x_get_resource_string); Remove decls.
22549 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22550 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22552 * font.c, fontset.c: Make symbols static if they're not exported.
22553 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22554 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22555 * font.c (font_close_object): Now static.
22556 * font.h (font_close_object): Remove.
22557 * fontset.c (FONTSET_OBJLIST): Remove.
22558 (free_realized_fontset) #if-0 the body, which does nothing.
22559 (face_suitable_for_char_p): #if-0, as it's never called.
22560 * fontset.h (face_suitable_for_char_p): Remove decl.
22561 * xfaces.c (face_at_string_position):
22562 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22563 since 0 is always ASCII.
22565 * fns.c (weak_hash_tables): Now static.
22567 * fileio.c: Make symbols static if they're not exported.
22568 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22569 (Vwrite_region_annotation_buffers): Now static.
22571 * eval.c: Make symbols static if they're not exported.
22572 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22573 * lisp.h (backtrace_list): Remove decl.
22575 * emacs.c: Make symbols static if they're not exported.
22576 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22577 (fatal_error_code, fatal_error_signal_hook, standard_args):
22579 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22580 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22581 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22582 * lisp.h (fatal_error_signal_hook): Remove decl.
22583 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22585 * editfns.c: Move a (normally-unused) function to its only use.
22586 * editfns.c, lisp.h (get_operating_system_release): Remove.
22587 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22588 worth the hassle of breaking this out.
22590 * xterm.c: Make symbols static if they're not exported.
22591 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22592 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22593 (x_destroy_window, x_delete_display):
22595 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22596 (x_mouse_leave): Remove; unused.
22597 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22598 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22599 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22601 (x_mouse_leave): Declare only if WINDOWSNT.
22602 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22603 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22606 * ftxfont.c: Make symbols static if they're not exported.
22607 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22609 * font.h (ftxfont_driver): Likewise.
22611 * xfns.c: Make symbols static if they're not exported.
22612 (x_last_font_name, x_display_info_for_name):
22613 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22614 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22615 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22616 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22617 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22618 (last_show_tip_args): Now static.
22619 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22620 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22621 (x_screen_planes): Remove; unused.
22622 * dispextern.h (x_screen_planes): Remove decl.
22624 * dispnew.c: Make symbols static if they're not exported.
22625 * dispextern.h (redraw_garbaged_frames, scrolling):
22626 (increment_row_positions): Remove.
22627 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22628 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22630 (redraw_garbaged_frames): Remove; unused.
22632 * xfaces.c: Make symbols static if they're not exported.
22633 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22635 * xterm.h (defined_color): Remove decls.
22636 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22637 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22638 (menu_face_changed_default, defined_color, free_realized_face):
22639 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22640 (ascii_face_of_lisp_face): Remove; unused.
22642 * xdisp.c: Make symbols static if they're not exported.
22643 * dispextern.h (scratch_glyph_row, window_box_edges):
22644 (glyph_to_pixel_coords, set_cursor_from_row):
22645 (get_next_display_element, set_iterator_to_next):
22646 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22647 (show_mouse_face): Remove decls
22648 * frame.h (message_buf_print): Likewise.
22649 * lisp.h (pop_message, set_message, check_point_in_composition):
22651 * xterm.h (set_vertical_scroll_bar): Likewise.
22652 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22653 (message_buf_print, scratch_glyph_row, displayed_buffer):
22654 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22655 (get_next_display_element, show_mouse_face, window_box_edges):
22656 (frame_to_window_pixel_xy, check_point_in_composition):
22657 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22658 (glyph_to_pixel_coords): Remove; unused.
22660 * dired.c (file_name_completion): Now static.
22662 * dbusbind.c (xd_in_read_queued_messages): Now static.
22664 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22665 * data.c (circular_list_error): Remove.
22667 * commands.h (last_point_position, last_point_position_buffer):
22668 (last_point_position_window): Remove decls.
22669 * keyboard.c: Make these variables static.
22671 * coding.h (coding, code_convert_region, encode_coding_gap):
22673 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22674 (iso_code_class, detect_coding, code_convert_region): Now static.
22675 (encode_coding_gap): Remove; unused.
22677 * chartab.c (chartab_chars, chartab_bits): Now static.
22679 * charset.h (charset_iso_8859_1): Remove decl.
22680 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22683 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22684 * ccl.c (Vccl_program_table): Now static.
22685 (check_ccl_update): Remove; unused.
22687 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22688 * category.h: ... from here.
22689 * category.c (check_category_table, set_category_set): Now static.
22691 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22692 * lisp.h: Remove these decls.
22694 * buffer.c (buffer_count): Remove unused var.
22696 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22697 so that it's not optimized away.
22698 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22699 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22700 exported only to the debugger.
22702 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22703 * atimer.h (run_all_atimers): Remove; not exported.
22705 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22706 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22707 was inaccessible from Lisp.
22708 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22709 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22711 alloc.c: Import and export fewer symbols, and remove unused items.
22712 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22714 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22715 it's not optimized away by whole-program optimization.
22716 (message_enable_multibyte, free_misc): Remove.
22717 (catchlist, handlerlist, mark_backtrace):
22718 Declare only if BYTE_MARK_STACK.
22719 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22720 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22721 (message_enable_multibyte): Remove decl.
22722 (free_misc, interval_free_list, float_block, float_block_index):
22723 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22724 (cons_free_list, last_marked_index):
22726 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22727 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22728 (mark_backtrace): Define only if BYTE_MARK_STACK.
22729 * xdisp.c (message_enable_multibyte): Now static.
22731 Declare Lisp_Object Q* variables to be 'static' if not exported.
22732 This makes it easier for human readers (and static analyzers)
22733 to see whether these variables are used from other modules.
22734 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22735 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22736 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22737 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22738 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22739 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22740 * xmenu.c, xselect.c:
22741 Declare Q* vars static if they are not used in other modules.
22742 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22743 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22744 Remove decls of unexported vars.
22745 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22747 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22749 Make Emacs functions such as Fatom 'static' by default.
22750 This makes it easier for human readers (and static analyzers)
22751 to see whether these functions can be called from other modules.
22752 DEFUN now defines a static function. To make the function external
22753 so that it can be used in other C modules, use the new macro DEFUE.
22754 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22755 (Finit_image_library):
22756 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22757 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22758 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22759 Remove decls, since these functions are now static.
22760 (Funintern, Fget_internal_run_time): New decls, since these functions
22761 were already external.
22763 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22764 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22765 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22766 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22767 * keyboard.c, keymap.c, lread.c:
22768 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22769 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22770 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22771 Mark functions with DEFUE instead of DEFUN,
22772 if they are used in other modules.
22773 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22774 decls for now-static functions.
22775 * buffer.h (Fdelete_overlay): Remove decl.
22776 * callproc.c (Fgetenv_internal): Mark as internal.
22777 * composite.c (Fremove_list_of_text_properties): Remove decl.
22778 (Fcomposition_get_gstring): New forward static decl.
22779 * composite.h (Fcomposite_get_gstring): Remove decl.
22780 * dired.c (Ffile_attributes): New forward static decl.
22781 * doc.c (Fdocumntation_property): New forward static decl.
22782 * eval.c (Ffetch_bytecode): New forward static decl.
22783 (Funintern): Remove extern decl; now in .h file where it belongs.
22784 * fileio.c (Fmake_symbolic_link): New forward static decl.
22785 * image.c (Finit_image_library): New forward static decl.
22786 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22787 * intervals.h (Fprevious_property_change):
22788 (Fremove_list_of_text_properties): Remove decls.
22789 * keyboard.c (Fthis_command_keys): Remove decl.
22790 (Fcommand_execute): New forward static decl.
22791 * keymap.c (Flookup_key): New forward static decl.
22792 (Fcopy_keymap): Now static.
22793 * keymap.h (Flookup_key): Remove decl.
22794 * process.c (Fget_process): New forward static decl.
22795 (Fprocess_datagram_address): Mark as internal.
22796 * syntax.c (Fsyntax_table_p): New forward static decl.
22797 (skip_chars): Remove duplicate decl.
22798 * textprop.c (Fprevious_property_change): New forward static decl.
22799 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22801 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22802 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22804 * editfns.c (Fformat): Remove unreachable code.
22806 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22808 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22811 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22813 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22814 when at ZV. (Bug#8487)
22816 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22818 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22820 * keyboard.c (parse_tool_bar_item): Likewise.
22821 * sound.c (sound_cleanup, alsa_close): Likewise.
22822 * termcap.c (tgetent): Likewise.
22823 * xfns.c (x_default_font_parameter): Likewise.
22824 * xsettings.c (read_and_apply_settings): Likewise.
22826 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22827 (overrun_check_free): Protoize.
22829 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22831 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22832 since callers should never pass a negative size.
22833 Change the signature to match that of plain 'read' and 'write'; see
22834 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22835 * lisp.h: Update prototypes of emacs_write and emacs_read.
22837 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22839 * xdisp.c (redisplay_window): Don't try to determine the character
22840 position of the scroll margin if the window start point w->startp
22841 is outside the buffer's accessible region. (Bug#8468)
22843 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22845 Fix write-region and its subroutines for buffers > 2GB.
22846 * fileio.c (a_write, e_write): Modify declaration of arguments and
22847 local variables to support buffers larger than 2GB.
22848 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22850 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22851 argument, local variables, and return value.
22853 * lisp.h: Update prototypes of emacs_write and emacs_read.
22855 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22857 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22859 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22861 Fix more problems found by GCC 4.6.0's static checks.
22863 * xdisp.c (vmessage): Use a better test for character truncation.
22865 * charset.c (load_charset_map): <, not <=, for optimization,
22866 and to avoid potential problems with integer overflow.
22867 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22868 * casetab.c (set_identity, shuffle): Likewise.
22869 * editfns.c (Fformat): Likewise.
22870 * syntax.c (skip_chars): Likewise.
22872 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22873 This also lets GCC 4.6.0 generate slightly better loop code.
22875 * callint.c (Fcall_interactively): <, not <=, for optimization.
22876 (Fcall_interactively): Count the number of arguments produced,
22877 not the number of arguments given. This is simpler and lets GCC
22878 4.6.0 generate slightly better code.
22880 * ftfont.c: Distingish more carefully between FcChar8 and char.
22881 The previous code passed unsigned char * to a functions like
22882 strlen and xstrcasecmp that expect char *, which does not
22883 conform to the C standard.
22884 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22885 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22886 char * when the C standard requires it.
22888 * keyboard.c (read_char): Remove unused var.
22890 * eval.c: Port to Windows vsnprintf (Bug#8435).
22891 Include <limits.h>.
22892 (SIZE_MAX): Define if the headers do not.
22893 (verror): Do not give up if vsnprintf returns a negative count.
22894 Instead, grow the buffer. This ports to Windows vsnprintf, which
22895 does not conform to C99. Problem reported by Eli Zaretskii.
22896 Also, simplify the allocation scheme, by avoiding the need for
22897 calling realloc, and removing the ALLOCATED variable.
22899 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22901 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22902 But keep the doprint source code for now, as we might revamp it
22903 and use it again (Bug#8435).
22904 * lisp.h (doprnt): Remove.
22905 * Makefile.in (base_obj): Remove doprnt.o.
22906 * deps.mk (doprnt.o): Remove.
22908 error: Print 32- and 64-bit integers portably (Bug#8435).
22909 Without this change, on typical 64-bit hosts error ("...%d...", N)
22910 was used to print both 32- and 64-bit integers N, which relied on
22911 undefined behavior.
22912 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22913 * lisp.h (error, verror): Mark as printf-like functions.
22914 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22915 Report overflow in size calculations when allocating printf buffer.
22916 Do not truncate output string at its first null byte.
22917 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22918 Truncate the output at a character boundary, since vsnprintf does not
22920 * charset.c (check_iso_charset_parameter): Convert internal
22921 character to string before calling 'error', since %c now has the
22923 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22924 overflow when computing char to be passed to 'error'. Do not
22925 pass Lisp_Object to 'error'; pass the integer instead.
22926 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22927 formatted with plain %d.
22929 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22931 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22933 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22935 * xterm.c (x_catch_errors): Remove duplicate declaration.
22937 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22939 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22941 2011-04-10 Jim Meyering <meyering@redhat.com>
22943 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22944 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22945 return ssize_t not "int", and use size_t as the buffer length.
22946 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22947 * gnutls.h: Update declarations.
22948 * process.c (read_process_output): Use ssize_t, to match.
22949 (send_process): Likewise.
22951 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22953 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22955 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22957 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22958 Use unsigned char, to match FcChar8 type definition.
22960 * xterm.c (handle_one_xevent):
22961 * xmenu.c (create_and_show_popup_menu):
22962 * xselect.c (x_decline_selection_request)
22963 (x_reply_selection_request): Avoid type-punned deref of X events.
22965 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22967 Fix some uses of `int' instead of EMACS_INT.
22968 * search.c (string_match_1, fast_string_match)
22969 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22970 (scan_buffer, find_next_newline_no_quit)
22971 (find_before_next_newline, search_command, Freplace_match)
22972 (Fmatch_data): Make some `int' variables be EMACS_INT.
22974 * xdisp.c (display_count_lines): 3rd argument and return value now
22975 EMACS_INT. All callers changed.
22976 (pint2hrstr): Last argument is now EMACS_INT.
22978 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22979 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22980 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22981 (decode_coding_utf_16, decode_coding_emacs_mule)
22982 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22983 (decode_coding_ccl, decode_coding_charset)
22984 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22985 (decode_coding_iso_2022, decode_coding_emacs_mule)
22986 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22987 <char_offset, last_offset>: Declare EMACS_INT.
22988 (encode_coding_utf_8, encode_coding_utf_16)
22989 (encode_coding_emacs_mule, encode_invocation_designation)
22990 (encode_designation_at_bol, encode_coding_iso_2022)
22991 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22992 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22994 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22995 (encode_invocation_designation): Last argument P_NCHARS is now
22997 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22998 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23000 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23003 * ccl.c (Fccl_execute_on_string): Declare some variables
23006 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23008 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23010 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23012 * process.c (Fformat_network_address): Doc fix.
23014 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23016 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23018 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
23020 * keyboard.c (read_char): Call Lisp function help-form-show,
23021 instead of using internal_with_output_to_temp_buffer.
23022 (Qhelp_form_show): New var.
23023 (syms_of_keyboard): Use DEFSYM macro.
23025 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23027 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23029 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
23031 * process.c (Flist_processes): Remove to Lisp.
23032 (list_processes_1): Delete.
23034 2011-04-06 Eli Zaretskii <eliz@gnu.org>
23036 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23038 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23040 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23042 Fix more problems found by GCC 4.6.0's static checks.
23044 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23046 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23048 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23050 * xdisp.c (vmessage): Mark as a printf-like function.
23052 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23054 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23056 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23057 printf-like functions.
23058 (tiff_load): Add casts to remove these marks before passing them
23059 to system-supplied API.
23061 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23063 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23064 This avoids several warnings with gcc -Wstrict-overflow.
23065 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23066 directly, rather than having caller test rule sign. This avoids
23067 some unnecessary tests.
23068 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23069 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23070 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23072 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23073 (xfont_open): Avoid unnecessary tests.
23075 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23077 * composite.h, composite.c (composition_gstring_put_cache):
23078 Use EMACS_INT, not int, for length.
23080 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23081 breaking out part of COMPOSITION_DECODE_RULE.
23082 (COMPOSITION_DECODE_RULE): Use it.
23083 * composite.c (get_composition_id): Remove unused local vars,
23084 by using the new macro.
23086 * textprop.c (set_text_properties_1): Change while to do-while,
23087 since the condition is always true at first.
23089 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23090 (interval_deletion_adjustment): Return unsigned value.
23093 * process.c (list_processes_1, create_pty, read_process_output):
23094 (exec_sentinel): Remove vars that were set but not used.
23095 (create_pty): Remove unnecessary "volatile"s.
23096 (Fnetwork_interface_info): Avoid possibility of int overflow.
23097 (read_process_output): Do adaptive read buffering even if carryover.
23098 (read_process_output): Simplify nbytes computation if buffered.
23100 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23102 * syntax.c (scan_words): Remove var that was set but not used.
23103 (update_syntax_table): Use unsigned instead of int.
23105 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23106 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23107 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23109 * print.c (print_error_message): Avoid int overflow.
23111 * font.c (font_list_entities): Redo for clarity,
23112 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23114 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23115 (font_score): Avoid potential overflow in diff calculation.
23117 * fns.c (substring_both): Remove var that is set but not used.
23118 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23120 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23122 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23123 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23124 can always succeed if overflow has undefined behavior.
23126 * search.c (boyer_moore, wordify): Remove vars set but not used.
23127 (wordify): Omit three unnecessary tests.
23129 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23130 All callers changed. This avoids the need for an unused var.
23132 * casefiddle.c (casify_region): Remove var that is set but not used.
23134 * dired.c (file_name_completion): Remove var that is set but not used.
23136 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23138 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23139 (Finsert_file_contents): Remove unnecessary code checking fd.
23141 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23142 Check for integer overflow on size calculations.
23144 * buffer.c (Fprevious_overlay_change): Remove var that is set
23147 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23148 Remove vars that are set but not used.
23149 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23150 (timer_check_2): Mark vars as initialized.
23152 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23154 * image.c (lookup_image): Remove var that is set but not used.
23155 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23157 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23158 that are set but not used.
23160 * xfns.c (make_invisible_cursor): Don't return garbage
23161 if XCreateBitmapFromData fails (Bug#8410).
23163 * xselect.c (x_get_local_selection, x_handle_property_notify):
23164 Remove vars that are set but not used.
23166 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23167 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23169 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23170 Remove var that is set but not used.
23171 (scroll_bar_windows_size): Now size_t, not int.
23172 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23173 Check for overflow.
23175 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23176 (map_tty_color) [!defined MSDOS]: Likewise.
23178 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23180 * coding.c: Remove vars that are set but not used.
23181 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23182 All callers changed.
23183 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23184 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23185 (decode_coding_charset): Remove vars that are set but not used.
23187 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23188 that is set but not used.
23190 * print.c (print_object): Remove var that is set but not used.
23192 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23193 The gnulib version avoids calling malloc in the usual case,
23194 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23195 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23196 * filelock.c (current_lock_owner): Likewise.
23197 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23198 * sysdep.c: Include allocator.h, careadlinkat.h.
23199 (emacs_no_realloc_allocator): New static constant.
23200 (emacs_readlink): New function.
23201 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23202 ../lib/careadlinkat.h.
23204 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23206 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23207 first non-nil return value).
23209 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23211 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23212 if not defined (Bug#8403).
23214 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23216 * xdisp.c (display_count_lines): Remove parameter `start',
23217 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23218 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23219 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23220 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23221 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23222 and thereabouts. All callers changed.
23223 (get_per_char_metric): Remove parameter `f', unused since
23224 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23226 2011-04-02 Jim Meyering <meyering@redhat.com>
23228 do not dereference NULL upon failed strdup
23229 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23230 (ns_get_family): Likewise.
23232 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23234 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23236 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23238 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23241 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23243 Add lexical binding.
23245 * window.c (Ftemp_output_buffer_show): New fun.
23246 (Fsave_window_excursion):
23247 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23249 * lread.c (lisp_file_lexically_bound_p): New function.
23250 (Fload): Bind Qlexical_binding.
23251 (readevalloop): Remove `evalfun' arg.
23252 Bind Qinternal_interpreter_environment.
23253 (Feval_buffer): Bind Qlexical_binding.
23254 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23256 (syms_of_lread): Declare `lexical-binding'.
23258 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23260 * keyboard.c (eval_dyn): New fun.
23261 (menu_item_eval_property): Use it.
23263 * image.c (parse_image_spec): Use Ffunctionp.
23265 * fns.c (concat, mapcar1): Accept byte-code-functions.
23267 * eval.c (Fsetq): Handle lexical vars.
23268 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23269 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23270 (FletX, Flet): Obey lexical binding.
23271 (Fcommandp): Handle closures.
23272 (Feval): New `lexical' arg.
23273 (eval_sub): New function extracted from Feval. Use it almost
23274 everywhere where Feval was used. Look up vars in lexical env.
23276 (Ffunctionp): Move from subr.el.
23277 (Ffuncall): Handle closures.
23278 (apply_lambda): Remove `eval_flags'.
23279 (funcall_lambda): Handle closures and new byte-code-functions.
23280 (Fspecial_variable_p): New function.
23281 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23282 but without exporting it to Lisp.
23284 * doc.c (Fdocumentation, store_function_docstring):
23285 * data.c (Finteractive_form): Handle closures.
23287 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23290 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23292 (exec_byte_code): New function extracted from Fbyte_code to handle new
23293 calling convention for byte-code-functions. Add new byte-codes.
23295 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23297 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23299 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23301 * xdisp.c (redisplay_internal): Fix prototype.
23303 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23305 * xdisp.c (SCROLL_LIMIT): New macro.
23306 (try_scrolling): Use it when setting scroll_limit.
23307 Limit scrolling to 100 screen lines.
23308 (redisplay_window): Even when falling back on "recentering",
23309 position point in the window according to scroll-conservatively,
23310 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23312 (try_scrolling): When point is above the window, allow searching
23313 as far as scroll_max, or one screenful, to compute vertical
23314 distance from PT to the scroll margin position. This prevents
23315 try_scrolling from unnecessarily failing when
23316 scroll-conservatively is set to a value slightly larger than the
23317 window height. Clean up the case of PT below the margin at bottom
23318 of window: scroll_max can no longer be INT_MAX. When aggressive
23319 scrolling is in use, don't let point enter the opposite scroll
23320 margin as result of the scroll.
23321 (syms_of_xdisp) <scroll-conservatively>: Document the
23322 threshold of 100 lines for never-recentering scrolling.
23324 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23326 * dispextern.h (move_it_by_lines):
23327 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23328 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23329 (message_log_check_duplicate): Remove parameters `prev_bol' and
23330 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23331 (redisplay_internal): Remove parameter `preserve_echo_area',
23332 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23334 * indent.c (Fvertical_motion):
23335 * window.c (window_scroll_pixel_based, Frecenter):
23336 Don't pass `need_y_p' to `move_it_by_lines'.
23338 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23340 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23341 steal a few bits to be more compact.
23342 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23343 Remove unneeded casts.
23345 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23347 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23349 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23350 binding" message (bug#7967).
23352 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23354 Fix more problems found by GCC 4.6.0's static checks.
23356 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23357 Remove unused local var.
23359 * editfns.c (Fmessage_box): Remove unused local var.
23361 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23362 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23363 Omit unused local vars.
23364 * window.c (shrink_windows): Omit unused local var.
23365 * menu.c (digest_single_submenu): Omit unused local var.
23366 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23367 Omit unused local var.
23369 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23370 Don't assume string length fits in int.
23371 (keyremap_step, read_key_sequence): Use size_t for sizes.
23372 (read_key_sequence): Don't check last_real_key_start redundantly.
23374 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23375 instead of alloca (Bug#8344).
23377 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23378 (Fbacktrace_frame): Don't assume nframes fits in int.
23380 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23382 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23385 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23387 * cm.c (calccost): Turn while-do into do-while, for clarity.
23389 * keyboard.c (syms_of_keyboard): Use the same style as later
23390 in this function when indexing through an array. This also
23391 works around GCC bug 48267.
23393 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23395 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23397 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23398 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23400 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23401 This avoids undefined behavior on integer overflow, and is a bit
23402 more convenient anyway since it is compared to a size_t variable.
23404 Variadic C functions now count arguments with size_t, not int.
23405 This avoids an unnecessary limitation on 64-bit machines, which
23406 caused (substring ...) to crash on large vectors (Bug#8344).
23407 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23408 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23409 All variadic functions and their callers changed accordingly.
23410 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23411 * data.c (arith_driver, float_arith_driver): Likewise.
23412 * editfns.c (general_insert_function): Likewise.
23413 * eval.c (struct backtrace.nargs, interactive_p)
23414 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23415 (funcall_lambda, mark_backtrace): Likewise.
23416 * fns.c (concat): Likewise.
23417 * frame.c (x_set_frame_parameters): Likewise.
23418 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23419 0 if not found, not -1. All callers changed.
23421 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23422 (stack_copy_size): Now size_t, not int.
23423 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23425 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23427 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23428 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23429 All callers changed.
23431 * lisp.h (multibyte_char_to_unibyte):
23432 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23433 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23434 * character.h (CHAR_TO_BYTE8):
23435 * cmds.c (internal_self_insert):
23436 * editfns.c (general_insert_function):
23437 * keymap.c (push_key_description):
23438 * search.c (Freplace_match):
23439 * xdisp.c (message_dolog, set_message_1): All callers changed.
23441 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23443 * keyboard.c (safe_run_hook_funcall): New function.
23444 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23445 don't set the hook to nil, but remove the offending function instead.
23446 (Qcommand_hook_internal): Remove, unused.
23447 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23448 Vcommand_hook_internal.
23450 * eval.c (enum run_hooks_condition): Remove.
23451 (funcall_nil, funcall_not): New functions.
23452 (run_hook_with_args): Call each function through a `funcall' argument.
23453 Remove `cond' argument, now redundant.
23454 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23455 (Frun_hook_with_args_until_failure): Adjust accordingly.
23456 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23458 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23460 * dispextern.h (string_buffer_position): Remove declaration.
23462 * print.c (strout): Remove parameter `multibyte', unused since
23463 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23465 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23466 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23467 All callers changed.
23469 * w32.c (_wsa_errlist): Use braces for struct initializers.
23471 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23472 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23473 All callers changed.
23474 (string_buffer_position): Likewise. Also, make static (it's never
23475 used outside xdisp.c).
23476 (cursor_row_p): Remove parameter `w', unused since
23477 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23478 (decode_mode_spec): Remove parameter `precision', introduced during
23479 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23480 All callers changed.
23482 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23484 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23486 2011-03-27 Anders Lindgren <andlind@gmail.com>
23488 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23489 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23490 (ns_update_auto_hide_menu_bar): New functions.
23491 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23492 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23493 ns_constrain_all_frames.
23494 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23495 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23497 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23499 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23501 2011-03-27 Glenn Morris <rgm@gnu.org>
23503 * syssignal.h: Replace RETSIGTYPE with void.
23504 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23505 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23506 Replace SIGTYPE with void everywhere.
23507 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23508 * s/template.h (SIGTYPE): Remove commented out definition.
23510 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23512 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23513 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23515 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23517 * w32.c (read_unc_volume): Use parameter `henum', instead of
23518 global variable `wget_enum_handle'.
23520 * keymap.c (describe_vector): Remove parameters `indices' and
23521 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23522 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23524 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23526 * keyboard.c (timer_check): Remove parameter `do_it_now',
23527 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23528 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23529 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23531 * keyboard.c (read_char):
23532 * w32menu.c (w32_menu_display_help):
23533 * xmenu.c (show_help_event, menu_help_callback):
23534 Adjust calls to `show_help_echo'.
23536 * gtkutil.c (xg_maybe_add_timer):
23537 * keyboard.c (readable_events):
23538 * process.c (wait_reading_process_output):
23539 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23541 * insdel.c (adjust_markers_gap_motion):
23542 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23543 (gap_left, gap_right): Don't call it.
23545 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23547 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23548 incurred during fontification.
23550 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23552 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23553 (DEFVAR_PER_BUFFER): Don't pass it.
23555 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23556 (scrolling_window): Don't pass it.
23558 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23560 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23562 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23564 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23565 of variables specific to SELinux and computation of `encoded_absname'.
23567 * image.c (XPutPixel): Remove unused variable `height'.
23569 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23571 * unexw32.c (get_section_info): Remove unused variable `section'.
23573 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23574 (system_process_attributes): Remove unused variable `sess'.
23575 (sys_read): Remove unused variable `err'.
23577 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23578 (w32_wnd_proc): Remove unused variable `isdead'.
23579 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23580 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23581 (x_create_tip_frame): Remove unused variable `tem'.
23583 * w32inevt.c (w32_console_read_socket):
23584 Remove unused variable `no_events'.
23586 * w32term.c (x_draw_composite_glyph_string_foreground):
23587 Remove unused variable `width'.
23589 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23591 * w32term.c (x_set_glyph_string_clipping):
23592 Don't pass uninitialized region to CombineRgn.
23594 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23596 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23597 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23598 (Fx_close_connection): Remove unused variable `i'.
23600 * w32font.c (w32font_draw): Return number of glyphs.
23601 (w32font_open_internal): Remove unused variable `i'.
23602 (w32font_driver): Add missing initializer.
23604 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23605 (fill_in_menu): Remove unused variable `items_added'.
23607 * w32term.c (last_mouse_press_frame): Remove static global variable.
23608 (w32_clip_to_row): Remove unused variable `f'.
23609 (x_delete_terminal): Remove unused variable `i'.
23611 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23612 (NOTHING): Remove unused static global variable.
23613 (uniscribe_check_otf): Remove unused variable `table'.
23614 (uniscribe_font_driver): Add missing initializers.
23616 2011-03-23 Julien Danjou <julien@danjou.info>
23618 * term.c (Fsuspend_tty, Fresume_tty):
23619 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23620 * window.c (temp_output_buffer_show):
23621 * insdel.c (signal_before_change):
23622 * frame.c (Fhandle_switch_frame):
23623 * fileio.c (Fdo_auto_save):
23624 * emacs.c (Fkill_emacs):
23625 * editfns.c (save_excursion_restore):
23626 * cmds.c (internal_self_insert):
23627 * callint.c (Fcall_interactively):
23628 * buffer.c (Fkill_all_local_variables):
23629 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23631 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23632 unconditionally since it does the check itself.
23634 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23636 Fix more problems found by GCC 4.5.2's static checks.
23638 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23639 the first time through the loop, since we know p0 < p1 then.
23640 This also avoids a gcc -Wstrict-overflow warning.
23642 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23643 leading to a memory leak, possible in functions like
23644 load_charset_map_from_file that can allocate an unbounded number
23645 of objects (Bug#8318).
23647 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23648 that could (at least in theory) be that large.
23650 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23651 This is less likely to overflow, and avoids undefined behavior if
23652 overflow does occur. All callers changed. Use strtoul to scan
23653 for the unsigned long integer.
23654 (pint2hrstr): Simplify and tune code slightly.
23655 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23657 * scroll.c (do_scrolling): Work around GCC bug 48228.
23658 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23660 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23661 This also avoids a warning with gcc -Wstrict-overflow.
23662 (validate_x_resource_name): Simplify count usage.
23663 This also avoids a warning with gcc -Wstrict-overflow.
23665 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23668 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23670 * process.c (Fmake_network_process): Use socklen_t, not int,
23671 where POSIX says socklen_t is required in portable programs.
23672 This fixes a porting bug on hosts like 64-bit HP-UX, where
23673 socklen_t is wider than int (Bug#8277).
23674 (Fmake_network_process, server_accept_connection):
23675 (wait_reading_process_output, read_process_output):
23678 * process.c: Rename or move locals to avoid shadowing.
23679 (list_processes_1, Fmake_network_process):
23680 (read_process_output_error_handler, exec_sentinel_error_handler):
23681 Rename or move locals.
23682 (Fmake_network_process): Define label "retry_connect" only if needed.
23683 (Fnetwork_interface_info): Fix pointer signedness.
23684 (process_send_signal): Add cast to avoid pointer signedness problem.
23685 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23686 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23688 Make tparam.h and terminfo.c consistent.
23689 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23690 Include tparam.h instead, since it declares them.
23691 * cm.h (PC): Remove extern decl; tparam.h now does this.
23692 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23693 * terminfo.c: Include tparam.h, to check interfaces.
23694 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23695 (tparam): Adjust signature to match interface in tparam.h;
23696 this removes some undefined behavior. Check that outstring and len
23697 are zero, which they always are with Emacs.
23698 * tparam.h (PC, BC, UP): New extern decls.
23700 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23701 (xftfont_open): Rename locals to avoid shadowing.
23703 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23704 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23705 (OTF_TAG_SYM): Omit macro if not needed.
23706 (ftfont_list): Remove unused local.
23707 (get_adstyle_property, ftfont_pattern_entity):
23708 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23709 Rename locals to avoid shadowing.
23711 * xfont.c (xfont_list_family): Mark var as initialized.
23713 * xml.c (make_dom): Now static.
23715 * composite.c (composition_compute_stop_pos): Rename local to
23717 (composition_reseat_it): Remove unused locals.
23718 (find_automatic_composition, composition_adjust_point): Likewise.
23719 (composition_update_it): Mark var as initialized.
23720 (find_automatic_composition): Mark vars as initialized,
23721 with a FIXME (Bug#8290).
23723 character.h: Rename locals to avoid shadowing.
23724 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23725 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23726 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23727 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23728 to avoid shadowing.
23730 * textprop.c (property_change_between_p): Remove; unused.
23732 * intervals.c (interval_start_pos): Now static.
23734 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23736 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23737 Rename locals to avoid shadowing.
23739 * sound.c (wav_play, au_play, Fplay_sound_internal):
23740 Fix pointer signedness.
23741 (alsa_choose_format): Remove unused local var.
23742 (wav_play): Initialize a variable to 0, to prevent undefined
23743 behavior (Bug#8278).
23745 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23747 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23749 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23750 clobbering (Bug#8298).
23751 * sysdep.c (sys_subshell): Likewise.
23752 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23754 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23755 This should get cleaned up, so that child_setup has the
23756 same signature on all platforms.
23758 * callproc.c (call_process_cleanup): Now static.
23759 (relocate_fd): Rename locals to avoid shadowing.
23761 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23763 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23764 not to be necessary, and produces flickering.
23766 2011-03-20 Glenn Morris <rgm@gnu.org>
23768 * config.in: Remove file.
23770 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23772 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23773 are now in src/globals.h.
23774 (syms_of_minibuf): Remove spurious & from previous change.
23776 2011-03-20 Leo Liu <sdl.web@gmail.com>
23778 * minibuf.c (completing-read-function): New variable.
23779 (completing-read-default): Rename from completing-read.
23780 (completing-read): Call completing-read-function.
23782 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23784 * xfaces.c (Fx_load_color_file):
23785 Read color file from absolute filename (bug#8250).
23787 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23789 * makefile.w32-in: Update dependencies.
23791 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23793 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23795 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23797 Fix more problems found by GCC 4.5.2's static checks.
23799 * process.c (make_serial_process_unwind, send_process_trap):
23800 (sigchld_handler): Now static.
23802 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23803 That way, the code declares only the vars that it needs.
23804 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23805 * s/cygwin.h (PTY_ITERATION): Likewise.
23806 * s/darwin.h (PTY_ITERATION): Likewise.
23807 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23809 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23810 * process.c (allocate_pty): Don't declare stb unless it's needed.
23812 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23813 (CONSTANTLIM): Remove; unused.
23814 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23815 Define only if needed.
23817 * unexelf.c (unexec): Name an expression,
23818 to avoid gcc -Wbad-function-cast warning.
23819 Use a different way to cause a compilation error if anyone uses
23820 n rather than nn, a way that does not involve shadowing.
23821 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23823 * deps.mk (unexalpha.o): Remove; unused.
23825 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23826 * unexec.h: New file.
23827 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23828 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23829 Depend on unexec.h.
23830 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23831 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23832 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23833 Change as necessary to match prototype in unexec.h.
23835 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23837 (back_comment, skip_chars): Mark vars as initialized.
23839 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23840 Rename locals to avoid shadowing.
23842 * lread.c (read1): Rewrite so as not to use empty "else".
23843 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23845 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23847 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23848 warning when compiling print.c.
23850 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23851 instead of using an uninitialized var.
23852 (font_sort_entities): Mark var as initialized.
23854 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23856 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23857 pointers to constants.
23858 (font_parse_fcname): Remove unused vars.
23859 (font_delete_unmatched): Now static.
23860 (font_get_spec): Remove; unused.
23861 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23862 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23863 Rename or move locals to avoid shadowing.
23865 * fns.c (require_nesting_list, require_unwind): Now static.
23866 (Ffillarray): Rename locals to avoid shadowing.
23868 * floatfns.c (domain_error2): Define only if needed.
23869 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23871 * alloc.c (mark_backtrace): Move decl from here ...
23872 * lisp.h: ... to here, so that it can be checked.
23874 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23875 (Fdefvar): Rewrite so as not to use empty "else".
23876 (lisp_indirect_variable): Name an expression,
23877 to avoid gcc -Wbad-function-cast warning.
23878 (Fdefvar): Rename locals to avoid shadowing.
23880 * callint.c (quotify_arg, quotify_args): Now static.
23881 (Fcall_interactively): Rename locals to avoid shadowing.
23882 Use const pointer when appropriate.
23884 * lisp.h (get_system_name, get_operating_system_release):
23885 Move decls here, to check interfaces.
23886 * process.c (get_operating_system_release): Move decl to lisp.h.
23887 * xrdb.c (get_system_name): Likewise.
23888 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23889 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23890 some of which prompt warnings from gcc -Wbad-function-cast.
23891 (Fformat_time_string, Fencode_time, Finsert_char):
23892 (Ftranslate_region_internal, Fformat):
23893 Rename or remove local vars to avoid shadowing.
23894 (Ftranslate_region_internal): Mark var as initialized.
23896 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23899 * lisp.h (eassert): Check that the argument compiles, even if
23900 ENABLE_CHECKING is not defined.
23902 * data.c (Findirect_variable): Name an expression, to avoid
23903 gcc -Wbad-function-cast warning.
23904 (default_value, arithcompare, arith_driver, arith_error): Now static.
23905 (store_symval_forwarding): Rename local to avoid shadowing.
23906 (Fmake_variable_buffer_local, Fmake_local_variable):
23907 Mark variables as initialized.
23908 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23910 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23911 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23912 Rename locals to avoid shadowing.
23913 (mark_stack): Move local variables into the #ifdef region where
23915 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23916 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23918 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23919 (GC_STRING_CHARS): Remove; not used.
23920 (Fmemory_limit): Cast sbrk's returned value to char *.
23922 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23923 avoids undefined behavior in theory.
23925 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23927 Use functions, not macros, for up- and down-casing (Bug#8254).
23928 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23929 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23930 to use the following functions instead of these macros.
23931 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23932 EMACS_INT, since callers assume the returned value fits in int.
23933 (upcase1): Likewise, for UPCASE_TABLE.
23934 (uppercasep, lowercasep, upcase): New static inline functions.
23935 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23936 the race-condition problem in the old DOWNCASE.
23938 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23939 Rename locals to avoid shadowing.
23940 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23941 (regex_compile, re_search_2, re_match_2_internal):
23942 Remove unused local vars.
23943 (FREE_VAR): Rewrite so as not to use empty "else",
23944 which gcc can warn about.
23945 (regex_compile, re_match_2_internal): Mark locals as initialized.
23946 (RETALLOC_IF): Define only if needed.
23947 (WORDCHAR_P): Likewise. This one is never needed, but is used
23948 only in a comment talking about a compiler bug, so put inside
23949 the #if 0 of that comment.
23950 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23951 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23954 * search.c (boyer_moore): Rename locals to avoid shadowing.
23955 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23956 (PREV_CHAR_BOUNDARY): Likewise.
23958 * search.c (simple_search): Remove unused var.
23960 * dired.c (compile_pattern): Move decl from here ...
23961 * lisp.h: ... to here, so that it can be checked.
23962 (struct re_registers): New forward decl.
23964 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23966 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23968 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23969 Rename locals to avoid shadowing.
23970 (Fvertical_motion): Mark locals as initialized.
23972 * casefiddle.c (casify_object, casify_region): Now static.
23973 (casify_region): Mark local as initialized.
23975 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23977 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23978 New macros, so that the caller can use some names other than
23979 gcpro1, gcpro2, etc.
23980 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23982 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23983 argument, for consistency with GCPRO2_VAR, etc: it is now the
23984 prefix of the variable, not the variable itself. All uses
23986 * dired.c (directory_files_internal, file_name_completion):
23987 Rename locals to avoid shadowing.
23989 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23990 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23991 dired.c's scmp function, had undefined behavior.
23992 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23993 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23994 * buffer.h: ... to here, because these macros use current_buffer,
23995 and the new implementation with inline functions needs to have
23996 current_buffer in scope now, rather than later when the macros
23998 (downcase, upcase1): New static inline functions.
23999 (DOWNCASE, UPCASE1): Reimplement using these functions.
24000 This avoids undefined behavior in expressions like
24001 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24002 from race conditions in accessing the global variables
24003 case_temp1 and case_temp2.
24004 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24005 * lisp.h (case_temp1, case_temp2): Remove their decls.
24006 * character.h (ASCII_CHAR_P): Move from here ...
24007 * lisp.h: ... to here, so that the inline functions mentioned
24008 above can use them.
24010 * dired.c (directory_files_internal_unwind): Now static.
24012 * fileio.c (file_name_as_directory, directory_file_name):
24013 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24015 (file_name_as_directory): Use const pointers when appropriate.
24016 (Fexpand_file_name): Likewise. In particular, newdir might
24017 point at constant storage, so make it a const pointer.
24018 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24019 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24021 (Fset_file_times, Finsert_file_contents, auto_save_error):
24022 Rename locals to avoid shadowing.
24024 * minibuf.c (choose_minibuf_frame_1): Now static.
24025 (Ftry_completion, Fall_completions): Rename or remove locals
24026 to avoid shadowing.
24028 * marker.c (bytepos_to_charpos): Remove; unused.
24030 * lisp.h (verify_bytepos, count_markers): New decls,
24031 so that gcc does not warn that these functions aren't declared.
24033 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24034 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24035 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24036 (copy_text): Remove unused local var.
24038 * filelock.c (within_one_second): Now static.
24039 (lock_file_1): Rename local to avoid shadowing.
24041 * buffer.c (fix_overlays_before): Mark locals as initialized.
24042 (fix_start_end_in_overlays): Likewise. This function should be
24043 simplified by using pointers-to-pointers, but that's a different
24045 (switch_to_buffer_1): Now static.
24046 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24047 (report_overlay_modification): Rename locals to avoid shadowing.
24049 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24050 Fix pointer signedness issue.
24051 (sys_subshell): Mark local as volatile if checking for lint,
24052 to suppress a gcc -Wclobbered warning that does not seem to be right.
24053 (MAXPATHLEN): Define only if needed.
24055 * process.c (serial_open, serial_configure): Move decls from here ...
24056 * systty.h: ... to here, so that they can be checked.
24058 * fns.c (get_random, seed_random): Move extern decls from here ...
24059 * lisp.h: ... to here, so that they can be checked.
24061 * sysdep.c (reset_io): Now static.
24062 (wait_for_termination_signal): Remove; unused.
24064 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24065 (copy_keymap_item, append_key, push_text_char_description):
24067 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24068 (DENSE_TABLE_SIZE): Remove; unused.
24069 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24070 (describe_map_tree):
24071 Rename locals to avoid shadowing.
24073 * keyboard.c: Declare functions static if they are not used elsewhere.
24074 (echo_char, echo_dash, cmd_error, top_level_2):
24075 (poll_for_input, handle_async_input): Now static.
24076 (read_char, kbd_buffer_get_event, make_lispy_position):
24077 (make_lispy_event, make_lispy_movement, apply_modifiers):
24078 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24079 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24080 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24081 (read_key_sequence, read_char): Mark locals as initialized.
24082 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24084 * keyboard.h (make_ctrl_char): New decl.
24085 (mark_kboards): Move decl here ...
24086 * alloc.c (mark_kboards): ... from here.
24088 * lisp.h (force_auto_save_soon): New decl.
24090 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24091 (DEFINE_DUMMY_FUNCTION): New macro.
24092 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24094 (main): Add casts to avoid warnings
24095 if GCC considers string literals to be constants.
24097 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24099 * dbusbind.c: Pointer signedness fixes.
24100 (xd_signature, xd_append_arg, xd_initialize):
24101 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24102 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24103 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24104 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24106 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24107 if GCC considers string literals to be constants.
24108 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24110 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24112 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24113 (print_preprocess, print_object): New macro to fix last change.
24115 * print.c (print_preprocess): Don't forget font objects.
24117 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
24119 * emacs.c (USAGE3): Doc fixes.
24121 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24123 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24126 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
24128 * lisp.h (VWindow_system, Qfile_name_history):
24129 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24130 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24131 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24133 * w32select.c: Don't #include "keyboard.h".
24134 (run_protected): Add extern declaration for waiting_for_input.
24136 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24137 * w32console.c (detect_input_pending, read_input_pending)
24138 (encode_terminal_code):
24139 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24140 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24141 (w32_system_caret_y, Qfile_name_history):
24142 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24143 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24144 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24145 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24146 * w32proc.c (Qlocal, report_file_error):
24147 * w32term.c (Vwindow_system, updating_frame):
24148 * w32uniscribe.c (initialized, uniscribe_font_driver):
24149 Remove unneeded extern declarations.
24151 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
24153 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24155 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24157 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24158 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24159 These macros can no longer be used for assignment.
24161 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24162 Assign struct members directly, instead of using BUF_BEGV etc.
24163 (record_buffer_markers, fetch_buffer_markers): New functions for
24164 recording and fetching special buffer markers.
24165 (set_buffer_internal_1, set_buffer_temp): Use them.
24167 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24169 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24171 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24172 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24174 * xdisp.c (hscroll_window_tree):
24175 (reconsider_clip_changes): Use PT instead of BUF_PT.
24177 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24179 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24180 $(EMACS_ROOT)/lib/intprops.h.
24182 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24184 Fix more problems found by GCC 4.5.2's static checks.
24186 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24187 to unsigned char * to avoid compiler diagnostic.
24188 (xg_free_frame_widgets): Make it clear that a local variable is
24189 needed only if USE_GTK_TOOLTIP.
24190 (gdk_window_get_screen): Make it clear that this macro is needed
24191 only if USE_GTK_TOOLTIP.
24192 (int_gtk_range_get_value): New function, which avoids a diagnostic
24193 from gcc -Wbad-function-cast.
24194 (xg_set_toolkit_scroll_bar_thumb): Use it.
24195 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24196 diagnostic from gcc -Wbad-function-cast.
24197 (get_utf8_string, xg_get_file_with_chooser):
24198 Rename locals to avoid shadowing.
24199 (create_dialog): Move locals to avoid shadowing.
24201 * xgselect.c (xg_select): Remove unused var.
24203 * image.c (four_corners_best): Mark locals as initialized.
24204 (gif_load): Initialize transparent_p to zero (Bug#8238).
24205 Mark another local as initialized.
24206 (my_png_error, my_error_exit): Mark with NO_RETURN.
24208 * image.c (clear_image_cache): Now static.
24209 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24210 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24211 (x_edge_detection): Remove unnecessary cast that
24212 gcc -Wbad-function-cast diagnoses.
24213 (gif_load): Fix pointer signedness.
24214 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24215 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24217 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24219 Improve quality of tests for time stamp overflow.
24220 For example, without this patch (encode-time 0 0 0 1 1
24221 1152921504606846976) returns the obviously-bogus value (-948597
24222 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24223 reports time overflow. See
24224 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24225 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24226 * editfns.c: Include limits.h and intprops.h.
24227 (TIME_T_MIN, TIME_T_MAX): New macros.
24228 (time_overflow): Move earlier, to before first use.
24229 (hi_time, lo_time): New functions, for an accurate test for
24230 out-of-range times.
24231 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24232 (Fget_internal_run_time): Don't assume time_t fits in int.
24233 (make_time): Use list2 instead of Fcons twice.
24234 (Fdecode_time): More accurate test for out-of-range times.
24235 (check_tm_member): New function.
24236 (Fencode_time): Use it, to test for out-of-range times.
24237 (lisp_time_argument): Don't rely on undefined left-shift and
24238 right-shift behavior when checking for time stamp overflow.
24240 * editfns.c (time_overflow): New function, refactoring common code.
24241 (Fformat_time_string, Fdecode_time, Fencode_time):
24242 (Fcurrent_time_string): Use it.
24244 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24245 * dired.c (make_time): Move to ...
24246 * editfns.c (make_time): ... here.
24247 * systime.h: Note the move.
24249 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24251 * fringe.c (update_window_fringes): Remove unused variables.
24253 * unexmacosx.c (copy_data_segment): Also copy __got section.
24256 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24258 * termcap.c [MSDOS]: Include "msdos.h".
24259 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24260 Constify `char *' arguments and their references according to
24261 prototypes in tparam.h.
24263 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24265 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24266 Adapt all references accordingly.
24268 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24270 2011-03-11 Tom Tromey <tromey@redhat.com>
24272 * buffer.c (syms_of_buffer): Remove obsolete comment.
24274 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24276 * termhooks.h (encode_terminal_code): Declare prototype.
24278 * msdos.c (encode_terminal_code): Don't declare prototype.
24280 * term.c (encode_terminal_code): Now external again, used by
24281 w32console.c and msdos.c.
24283 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24284 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24286 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24288 Fix some minor problems found by GCC 4.5.2's static checks.
24290 * fringe.c (update_window_fringes): Mark locals as initialized
24292 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24294 * alloc.c (mark_fringe_data): Move decl from here ...
24295 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24296 to check its interface.
24297 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24299 * fontset.c (free_realized_fontset): Now static.
24300 (Fset_fontset_font): Rename local to avoid shadowing.
24301 (fontset_font): Mark local as initialized.
24302 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24304 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24306 * xselect.c (x_disown_buffer_selections): Remove; not used.
24307 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24308 (x_own_selection, Fx_disown_selection_internal): Rename locals
24309 to avoid shadowing.
24310 (x_handle_dnd_message): Remove local to avoid shadowing.
24312 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24313 so that the caller can use some name other than gcpro1.
24314 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24315 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24316 (Fx_backspace_delete_keys_p):
24317 Use them to avoid shadowing, and rename vars to avoid shadowing.
24318 (x_decode_color, x_set_name, x_window): Now static.
24319 (Fx_create_frame): Add braces to silence GCC warning.
24320 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24321 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24322 Remove unused locals.
24323 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24324 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24325 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24328 * xterm.h (x_mouse_leave): New decl.
24330 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24331 Remove unused functions.
24332 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24333 (x_calc_absolute_position): Now static.
24334 (XTread_socket): Don't define label "out" unless it's used.
24335 Don't declare local "event" unless it's used.
24336 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24337 unless they are used.
24338 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24339 (x_fatal_error_signal): Remove; not used.
24340 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24341 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24342 (x_error_catcher, x_connection_closed, x_error_handler):
24343 (x_error_quitter, xembed_send_message, x_iconify_frame):
24344 (my_log_handler): Rename locals to avoid shadowing.
24345 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24346 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24348 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24349 Rename or move locals to avoid shadowing.
24350 (tty_defined_color, merge_face_heights): Now static.
24351 (free_realized_faces_for_fontset): Remove; not used.
24352 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24353 does not deduce is never used uninitialized.
24354 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24355 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24357 * terminal.c (store_terminal_param): Now static.
24359 * xmenu.c (menu_highlight_callback): Now static.
24360 (set_frame_menubar): Remove unused local.
24361 (xmenu_show): Rename parameter to avoid shadowing.
24362 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24363 since they might point to immutable storage.
24364 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24365 since it's unused otherwise.
24367 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24368 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24369 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24370 avoids a gcc -Wuninitialized diagnostic.
24371 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24372 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24373 does not deduce are never used uninitialized.
24375 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24377 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24378 * window.c (window_loop, size_window):
24379 (run_window_configuration_change_hook, enlarge_window): Likewise.
24381 * window.c (display_buffer): Now static.
24382 (size_window): Mark variables that gcc -Wuninitialized
24383 does not deduce are never used uninitialized.
24384 * window.h (check_all_windows): New decl, to forestall
24385 gcc -Wmissing-prototypes diagnostic.
24386 * dispextern.h (bidi_dump_cached_states): Likewise.
24388 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24390 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24391 Include <limits.h>.
24392 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24393 and to avoid gcc -Wuninitialized warning.
24394 (load_charset_map): Mark variables that gcc -Wuninitialized
24395 does not deduce are never used uninitialized.
24396 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24398 * coding.c (coding_set_source, coding_set_destination):
24399 Use "else { /* comment */ }" rather than "else /* comment */;"
24400 for clarity, and to avoid gcc -Wempty-body warning.
24401 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24402 a block, when the outer 'i' will do.
24403 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24404 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24405 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24406 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24407 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24408 Rename locals to avoid shadowing.
24409 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24410 * coding.c (emacs_mule_char, encode_invocation_designation):
24411 Now static, since they're not used elsewhere.
24412 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24413 (decode_coding_object, encode_coding_object, detect_coding_system):
24414 (decode_coding_emacs_mule): Mark variables that gcc
24415 -Wuninitialized does not deduce are never used uninitialized.
24416 (detect_coding_iso_2022): Initialize a local variable that might
24417 be used uninitialized. Leave a FIXME because it's not clear that
24418 this initialization is needed. (Bug#8211)
24419 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24420 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24421 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24422 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24423 Remove unused macros.
24425 * category.c (hash_get_category_set): Remove unused local var.
24426 (copy_category_table): Now static, since it's not used elsewhere.
24427 * character.c (string_count_byte8): Likewise.
24429 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24430 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24432 * chartab.c (copy_sub_char_table): Now static, since it's not used
24434 (sub_char_table_ref_and_range, char_table_ref_and_range):
24435 Rename locals to avoid shadowing.
24436 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24438 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24439 (BIDI_BOB): Remove unused macro.
24441 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24442 deduce are never used uninitialized.
24443 * term.c (encode_terminal_code): Likewise.
24445 * term.c (encode_terminal_code): Now static. Remove unused local.
24447 * tparam.h: New file.
24448 * term.c, tparam.h: Include it.
24449 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24450 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24451 Move these decls to tparam.h, and make them agree with what
24452 is actually in tparam.c. The previous trick of using incompatible
24453 decls in different modules does not conform to the C standard.
24454 All callers of tparam changed to use tparam's actual API.
24455 * tparam.c (tparam1, tparam, tgoto):
24456 Use const pointers where appropriate.
24458 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24459 * cm.h (struct cm): Likewise.
24460 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24461 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24462 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24463 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24464 (turn_on_face, init_tty): Likewise.
24465 * termchar.h (struct tty_display_info): Likewise.
24467 * term.c (term_mouse_position): Rename local to avoid shadowing.
24469 * alloc.c (mark_ttys): Move decl from here ...
24470 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24472 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24474 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24476 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24478 * search.c (compile_pattern_1): Remove argument regp, unused since
24479 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24480 (compile_pattern): Don't pass it.
24482 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24484 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24485 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24487 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24489 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24491 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24492 gdk_window_get_screen, gdk_window_get_geometry,
24493 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24494 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24495 (xg_get_pixbuf_from_pixmap): New function.
24496 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24497 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24498 Call xg_get_pixbuf_from_pixmap instead of
24499 gdk_pixbuf_get_from_drawable.
24500 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24501 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24502 (xg_check_special_colors): Use GtkStyleContext and its functions
24504 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24505 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24506 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24507 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24508 Call gtk_widget_get_preferred_size.
24509 (xg_frame_resized): gdk_window_get_geometry only takes 5
24511 (xg_win_to_widget, xg_event_is_for_menubar):
24512 Call gdk_x11_window_lookup_for_display.
24513 (xg_set_widget_bg): New function.
24514 (delete_cb): New function.
24515 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24516 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24517 (xg_set_background_color): Call xg_set_widget_bg.
24518 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24519 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24520 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24521 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24523 (update_frame_tool_bar): Call gtk_widget_hide.
24524 (xg_initialize): Use GDK_KEY_g.
24526 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24528 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24530 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24531 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24532 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24534 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24536 * w32xfns.c (select_palette): Check success of RealizePalette against
24537 GDI_ERROR, not zero.
24539 See ChangeLog.11 for earlier changes.
24541 ;; Local Variables:
24545 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24547 This file is part of GNU Emacs.
24549 GNU Emacs is free software: you can redistribute it and/or modify
24550 it under the terms of the GNU General Public License as published by
24551 the Free Software Foundation, either version 3 of the License, or
24552 (at your option) any later version.
24554 GNU Emacs is distributed in the hope that it will be useful,
24555 but WITHOUT ANY WARRANTY; without even the implied warranty of
24556 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24557 GNU General Public License for more details.
24559 You should have received a copy of the GNU General Public License
24560 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.