1 2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
3 * fileio.c (expand_file_name): Doc fix.
5 2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
7 Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
8 * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
9 Wait for self, not for 0. This can't hurt on GNU or similar
10 system, and may help with Cygwin.
12 * keyboard.c: Don't use PROP (...) as an lvalue.
13 (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
14 Use set_prop (A, B), not PROP (A) = B.
16 2013-06-10 Eli Zaretskii <eliz@gnu.org>
18 * xdisp.c (get_it_property): Use it->window instead of generating
19 a Lisp object from it->w.
21 2013-06-09 Eli Zaretskii <eliz@gnu.org>
23 * xdisp.c (get_it_property): If it->object is a buffer, pass to
24 get-char-property the window that is being rendered, instead of
25 the buffer, to support window-specific overlays. (Bug#14575)
26 (compute_display_string_pos): When W is NULL, use the current
27 buffer as the object to pass to get-char-property.
28 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
29 pointer member of the bidi iterator, since no window is pertinent
32 2013-06-08 Eli Zaretskii <eliz@gnu.org>
34 * bidi.c (bidi_fetch_char): Accept additional argument, the window
35 being displayed, and pass it to compute_display_string_pos.
36 (bidi_level_of_next_char, bidi_resolve_explicit_1)
37 (bidi_paragraph_init): All callers changed.
39 * xdisp.c (init_from_display_pos, init_iterator)
40 (handle_single_display_spec, next_overlay_string)
41 (get_overlay_strings_1, reseat_1, reseat_to_string)
42 (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
43 Set bidi_it.w member from it->w.
44 (compute_display_string_pos): Accept additional argument, the
45 window being displayed, and pass it to Fget_char_property.
48 * dispextern.h (struct bidi_it): New member w, the window being
50 (compute_display_string_pos): Adjust prototype.
52 2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
54 * xgselect.c: Remove unneeded include xterm.h.
56 * process.c (wait_reading_process_output): Check for NS before GLIB.
57 GLIB may be linked in due to rsvg, but ns_select must be called.
59 * xgselect.c (xg_select): Remove call to window_system_available
60 and g_main_context_pending at the top, so Gdk events (i.e. file
61 notify) are processed when Emacs is started with -nw.
63 2013-06-07 Eli Zaretskii <eliz@gnu.org>
65 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
66 (ctagsfiles3): New variable, includes only *.m files.
67 (TAGS): Use an explicit language name in the regular expressions,
68 to avoid transformation of '/SOMETHING' by MSYS to
71 2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
73 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
75 2013-06-06 Eli Zaretskii <eliz@gnu.org>
77 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
78 still need to set the mouse pointer shape and activate help-echo.
81 2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
83 A few porting etc. fixes for the new file monitor code.
84 See the thread containing
85 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
86 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
87 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
88 (dir_monitor_callback, Fgfile_rm_watch):
89 Use assq_no_quit instead of Fassoc, for speed.
90 (dir_monitor_callback, Fgfile_rm_watch):
91 eassert that the monitor is a fixnum.
92 (dir_monitor_callback): No need for CDR_SAFE.
93 Simplify building of lisp with alternative tails.
94 (Fgfile_add_watch, Fgfile_rm_watch):
95 Do not assume glib functions set errno reliably on failure.
96 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
97 and signal an error otherwise.
98 (Fgfile_rm_watch): Prefer CONSP to !NILP.
99 Use Fdelq instead of Fdelete, for speed.
101 2013-06-05 Eli Zaretskii <eliz@gnu.org>
103 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
104 don't insist on being invoked on a highlighted tool-bar button.
105 Avoids losing tool-bar functionality when mouse-highlight is nil.
106 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
107 Don't highlight when mouse-highlight is nil.
108 (note_mouse_highlight): When mouse-highlight is nil, don't return
109 right away; instead, run tool-bar and mode-line highlight
110 subroutine, clear any existing highlight, and revert the mouse
111 pointer to its default shape. (Bug#14558)
113 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
115 * lisp.mk (lisp): Add prog-mode.el.
117 2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
119 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
120 * process.c (dummy_handler): New function.
121 (lib_child_handler): New static var.
122 (handle_child_signal): Invoke it.
123 (catch_child_signal): If a library has set up a signal handler,
124 save it into lib_child_handler.
125 (init_process_emacs): If using glib and not on Windows, tickle glib's
126 child-handling code so that it initializes its private SIGCHLD handler.
127 * syssignal.h (SA_SIGINFO): Default to 0.
128 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
129 31; it should no longer be needed now.
131 2013-06-05 Michael Albinus <michael.albinus@gmx.de>
133 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
135 * gfilenotify.c (globals_of_gfilenotify): New function.
136 (syms_of_gfilenotify): Move global initialization there.
138 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
140 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
142 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
143 * keyboard.c (menu_bar_items, tool_bar_items):
144 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
145 not override local keymaps any more.
147 2013-06-04 Eli Zaretskii <eliz@gnu.org>
149 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
151 2013-06-03 Eli Zaretskii <eliz@gnu.org>
153 * w32console.c (initialize_w32_display): Return the dimensions of
154 the console window via 2 additional arguments, not via the current
155 frame. This avoids crashes due to overrunning the bounds of
156 frame's decode_mode_spec_buffer, which is not resized following
157 the change of the frame dimensions from the initial 10x10.
159 * w32term.h (w32_initialize_display_info): Adjust prototype.
161 * term.c (init_tty): Take dimensions of the frame from the values
162 returned by initialize_w32_display.
164 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
165 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
166 (LIBES): Add $(GFILENOTIFY_LIBS).
168 * w32inevt.c (handle_file_notifications): Add dummy implementation
171 * w32term.c: Wrap code with HAVE_W32NOTIFY.
173 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
175 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
177 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
179 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
181 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
183 Fix minor problems found by static checking.
184 * data.c (pure_write_error):
185 Use xsignal2, not Fsignal, as Fsignal might return.
186 * eval.c (set_backtrace_debug_on_exit): Now static.
187 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
188 No longer inline. EXTERN_INLINE is needed only for functions
189 defined in .h files. Reindent function header as per GNU style.
190 (backtrace_p, backtrace_top, backtrace_next):
191 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
192 compiler or linker. Add extern decls to pacify gcc -Wall.
193 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
195 * frame.c (free_monitors): Define only on platforms that need it.
196 * nsterm.m (ns_term_init):
197 * process.c (catch_child_signal):
198 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
199 defined on all porting targets these days.
200 * process.c, process.h (catch_child_signal):
201 Make it extern only if NS_IMPL_GNUSTEP is defined.
203 2013-06-03 Eli Zaretskii <eliz@gnu.org>
205 * w32.c (gettimeofday): Make the signature identical to prototype
206 in nt/inc/sys/time.h.
208 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
210 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
213 * keyboard.c (safe_run_hooks_error): Improve error message.
215 * data.c (pure_write_error): Add `object' argument.
216 * puresize.h (CHECK_IMPURE): Use it.
218 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
220 * Makefile.in (NOTIFY_OBJ): New variable.
221 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
223 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
224 Call syms_of_gfilenotify.
226 * gfilenotify.c: New file.
228 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
230 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
231 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
233 * lisp.h: Declare syms_of_gfilenotify.
235 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
237 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
239 Merge the specpdl and backtrace stacks. Make the structure of the
240 specpdl entries more obvious via a tagged union of structs.
241 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
242 (enum specbind_tag): New enum.
243 (struct specbinding): Make it a tagged union of structs.
244 Add a case for backtrace records.
245 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
246 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
247 (backtrace_debug_on_exit): New accessors.
248 (struct backtrace): Remove.
249 (struct catchtag): Remove backlist field.
250 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
252 (Flocal_variable_p): Speed up the common case where the binding is
254 * eval.c (backtrace_list): Remove.
255 (set_specpdl_symbol, set_specpdl_old_value): Remove.
256 (set_backtrace_args, set_backtrace_nargs)
257 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
258 (backtrace_next): New functions.
259 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
260 (unwind_to_catch, internal_lisp_condition_case)
261 (internal_condition_case, internal_condition_case_1)
262 (internal_condition_case_2, internal_condition_case_n): Don't bother
263 with backtrace_list any more.
264 (Fsignal): Adjust to new backtrace format.
265 (grow_specpdl): Move up.
266 (record_in_backtrace): New function.
267 (eval_sub, Ffuncall): Use it.
268 (apply_lambda): Adjust to new backtrace format.
269 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
271 (specbind): Adjust to new specpdl format. Simplify.
272 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
273 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
275 (mark_backtrace): Remove.
276 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
277 * xdisp.c (redisplay_internal): Use record_in_backtrace.
278 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
280 * profiler.c (record_backtrace): Use get_backtrace.
281 (handle_profiler_signal): Use backtrace_top_function.
282 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
285 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
287 * process.h (catch_child_signal): Declare.
289 * process.c (catch_child_signal): New function.
290 (init_process_emacs): Call it.
292 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
293 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
295 (x_set_cursor_type): Remove declaration.
296 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
297 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
298 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
299 (ns_get_color): Use F suffix on float.
300 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
301 (ns_get_rgb_color): Remove.
302 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
303 (note_mouse_movement): x and y are CGFloat.
304 (ns_draw_fringe_bitmap): Remove unused rowY.
305 Change #if to COCOA && >= 10_6.
306 (ns_draw_window_cursor): Remove unused overspill.
307 (ns_draw_underwave): width and x are EamcsCGFloat.
308 (ns_draw_box): thickness is CGFloat.
309 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
310 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
311 if not in main thread.
312 (ns_get_pending_menu_title, ns_check_menu_open)
313 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
314 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
315 (sendFromMainThread:): New method.
316 (changeFont:): size is CGFloat.
317 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
318 Disable warning about permanent text.
319 (characterIndexForPoint:): Adjust return type depending on GNUStep
321 (mouseDown:): delta is CGFloat.
322 (updateFrameSize): Remove unised variable f.
323 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
324 Cast float to EmacsCGFloat.
325 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
326 also to -1 when restoring.
327 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
328 inside NS_IMPL_COCOA.
329 (toggleFullScreen:): Put call to toggleFullScreen inside
330 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
331 (setPosition:portion:whole:): por is CGFloat.
332 (getMouseMotionPart:window:x:y:): Add F suffix to float.
333 (mouseDown:): Use CGFloat.
334 (mouseDragged:): Remove unised variable edge.
335 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
337 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
339 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
340 when NS_IMPL_GNUSTEP.
341 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
342 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
343 (EmacsToolbar): Add clearAll. Add tag argument to
344 addDisplayItemWithImage.
345 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
347 * nsselect.m (ns_get_local_selection): Remove unused variable type.
349 * nsmenu.m (ns_update_menubar): Make static.
350 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
351 (fillWithWidgetValue:): Add cast to SEL for setAction.
352 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
353 (update_frame_tool_bar): Update code for GNUStep.
354 (clearAll): New method.
355 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
356 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
357 Move identifierToItem setObject and activeIdentifiers addObject before
358 call to insertItemWithItemIdentifier.
359 (validateVisibleItems): Fix indentation.
360 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
361 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
362 UtilityWindow to aStyle, remove call to setStyleMask.
364 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
366 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
367 (ns_charset_covers, ns_get_covering_families, nsfont_open):
368 Use F suffix on floats.
369 (ns_char_width): Returns CGFloat.
370 (ns_ascii_average_width): w is CGFloat instead of float.
371 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
373 (ns_glyph_metrics): CGFloat instead of float.
375 * nsfns.m (x_set_foreground_color, x_set_background_color):
377 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
378 remove unused variables.
379 (Fns_read_file_name): Keep track if panel is for save.
380 Use ns_filename_from_panel/ns_directory_from_panel.
381 (Fns_list_services): delegate only used for COCOA.
382 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
383 Just return the input if GNUStep.
384 (x_screen_planes): Remove.
385 (Fxw_color_values): Use EmacsCGFloat
386 (Fns_display_monitor_attributes_list): Only get screen number for
388 (getDirectory, getFilename): Removed from EmacsOpenPanel and
390 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
391 ns_directory_from_panel.
393 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
395 * process.c (handle_child_signal): Also use WCONTINUED.
396 This is so that list-processes doesn't mistakenly list the process
397 as stopped, when the process has actually been continued and is
400 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
402 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
403 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
404 not already configured.
406 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
408 2013-05-29 Eli Zaretskii <eliz@gnu.org>
410 * Makefile.in (mostlyclean): Remove *.res files.
412 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
414 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
417 2013-05-27 Eli Zaretskii <eliz@gnu.org>
419 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
420 display vector, and we backtrack, handle the case that the
421 previous character position is also displayed from a display
422 vector or covered by a display string or image. (Bug#14476)
424 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
426 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
427 (struct MonitorInfo, free_monitors): Remove.
428 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
429 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
430 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
433 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
434 (struct MonitorInfo, free_monitors): Remove.
435 (ns_screen_name): Make static.
436 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
437 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
440 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
441 (struct MonitorInfo): New struct.
442 (free_monitors, make_monitor_attribute_list): Declare.
444 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
446 (free_monitors, make_monitor_attribute_list): New functions.
447 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
450 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
452 * callproc.c (call_process): Refine the doc string. (Bug#14045)
454 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
456 * keyboard.c: Apply keyboard decoding only to events that come directly
457 from the tty, not from unread-command-events (bug#14368).
458 (read_event_from_main_queue): New function, extracted from read_char).
459 (read_decoded_char): Remove.
460 (read_decoded_event_from_main_queue): New function to replace it.
462 (read_key_sequence): Use read_char rather than read_decoded_char.
464 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
466 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
468 * casetab.c (init_casetab_once): Fix last change (bug#14424).
470 2013-05-22 Kenichi Handa <handa@gnu.org>
472 The following changes are to fix the setting of
473 buffer-file-coding-system on, for instance, C-x RET c unix RET
474 _FILE_OF_DOS_EOL_TYPE_ RET.
476 * coding.h (struct coding_system): New member detected_utf8_chars.
478 * coding.c (detect_coding_utf_8): Count characters and check EOL
479 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
481 (setup_coding_system): Do not initialize coding->head_ascii.
482 (check_ascii): Do not set coding->eol_seen but update it. Do not
483 call adjust_coding_eol_type here.
484 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
485 If the eol-type of CODING is already specified, adjust the eol type
486 of the found coding-system.
487 (decode_coding_gap): Cancel previous change. Utilize the
488 character numbers counted by detect_coding_utf_8. Fix detection
491 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
493 * search.c (looking_at_1): Only set last_thing_searched if the match
494 changed the match-data (bug#14281).
496 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
498 * xdisp.c (reseat_at_previous_visible_line_start):
499 Already declared in dispextern.h, so remove it here.
500 (move_it_vertically_backward): Likewise.
502 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
504 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
505 (Fx_display_pixel_width, Fx_display_pixel_height)
506 (Fx_display_mm_width, Fx_display_mm_height):
507 Mention `display-monitor-attributes-list' in docstrings.
509 * nsfns.m (ns_get_screen): Remove function. All uses removed.
510 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
511 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
512 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
513 (Fx_display_backing_store, Fx_display_visual_class)
514 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
515 (Fx_display_grayscale_p, Fx_display_pixel_width)
516 (Fx_display_pixel_height, Fx_display_planes)
517 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
518 (Fx_display_screens): Don't confuse X11 screens with NS screens.
519 (Fx_display_mm_width, Fx_display_mm_height)
520 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
521 height for all physical monitors as in X11.
523 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
524 Return pixel width or height for all physical monitors as in X11.
526 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
528 Port --enable-gcc-warnings to clang.
529 * bytecode.c (exec_byte_code):
531 Redo diagnostic pragmas to pacify clang, too.
532 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
533 * editfns.c (Fencode_time):
534 * fileio.c (file_accessible_directory_p):
535 * font.c (font_unparse_xlfd):
536 Use '&"string"[index]' instead of '"string" + (index)'.
537 * undo.c (user_error): Remove; unused.
539 2013-05-16 Eli Zaretskii <eliz@gnu.org>
541 * insdel.c (insert_1_both): Document the arguments, instead of
542 referring to insert_1, which no longer exists.
544 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
545 some window, increment windows_or_buffers_changed, so that
546 *Messages* display in that window is updated. (Bug#14408)
548 * w32.c: Include epaths.h.
549 (init_environment): Use cmdproxy.exe without leading directories.
550 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
552 (gettimeofday): Adjust signature and return value to Posix
555 * unexw32.c (open_output_file): Delete the existing emacs.exe
556 before creating it, to break the hard link to the versioned
559 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
560 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
561 (FIRSTFILE_OBJ): New variables.
562 (W32_RES): Rename to EMACSRES. All users changed.
563 (base_obj): Use $(CM_OBJ).
564 (ALLOBJS): Use $(FIRSTFILE_OBJ).
565 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
566 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
567 $(W32_RES_LINK) before $(LIBES).
568 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
570 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
572 * makefile.w32-in (DOC): Use just "DOC".
574 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
576 * process.c: Export default filters and sentinels to Elisp.
577 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
579 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
580 (Fset_process_sentinel, Fformat_network_address):
581 Default to them instead of nil.
582 (server_accept_connection): Sentinels can't be nil any more.
583 (read_and_dispose_of_process_output): New function, extracted from
585 (read_process_output): Use it; filters can't be nil.
586 (Finternal_default_process_filter): New function, extracted from
588 (exec_sentinel_unwind): Remove function.
589 (exec_sentinel): Don't zilch sentinel while running.
590 (status_notify): Sentinels can't be nil.
591 (Finternal_default_process_sentinel): New function extracted from
593 (setup_process_coding_systems): Default filter is not nil any more.
594 (syms_of_process): Export new Elisp functions and initialize
596 * lisp.h (make_lisp_proc): New function.
598 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
600 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
602 2013-05-14 Eli Zaretskii <eliz@gnu.org>
604 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
605 unless we know that the window w is a leaf window.
606 Another attempt at solving bug#14062.
608 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
610 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
613 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
615 * image.c (gif_load): Check that subimages fit (Bug#14345).
617 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
619 * lread.c (skip_dyn_eof): New function.
620 (read1): Use it to skip the end of a file in response to #@00.
622 * doc.c (get_doc_string): Slightly relax the sanity checking.
624 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
626 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
627 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
628 (MonitorInfo): New struct.
629 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
630 (Fns_display_monitor_attributes_list): New functions.
631 (display-usable-bounds): Remove.
632 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
635 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
637 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
638 (GTK_CHECK_VERSION): New macro, if not already defined.
639 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
640 replaced by GTK_CHECK_VERSION.
642 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
644 * xterm.h (GTK_PREREQ): New macro.
645 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
646 to use this macro instead, for consistency and clarity.
648 2013-05-08 Eli Zaretskii <eliz@gnu.org>
650 * xdisp.c (row_for_charpos_p): New function, with code of
651 cursor_row_p, but accepts an additional argument CHARPOS instead
652 of using a hardcoded PT.
653 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
654 (row_containing_pos): Call row_for_charpos_p instead of partially
655 doing the same. Fixes cursor positioning under longlines-mode
656 when longlines-show-effect includes more than one newline, when
657 moving the cursor vertically up.
659 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
661 * makefile.w32-in (ACL_H): New macro.
662 ($(BLD)/fileio.$(O)): Update dependencies.
664 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
666 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
667 * Makefile.in (LIB_ACL): New macro.
668 (LIBACL_LIBS): Remove.
669 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
670 * fileio.c: Include <acl.h>.
671 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
672 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
674 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
677 * unexelf.c: Don't assume ElfW (Half) fits in int.
678 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
679 when dealing with ElfW (Half) values, since they can exceed 2**31
680 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
681 (entry_address): Omit unused NUM arg. All uses changed.
683 2013-05-07 Juri Linkov <juri@jurta.org>
685 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
686 to the string converted from number with `Fnumber_to_string'.
689 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
691 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
692 This fixes a problem introduced by my previous change.
694 2013-05-07 Glenn Morris <rgm@gnu.org>
696 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
698 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
700 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
702 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
704 Static checking by GCC 4.8.0.
705 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
706 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
707 (x_get_monitor_attributes_fallback)
708 (x_get_monitor_attributes_xinerama)
709 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
710 Define only if USE_GTK.
711 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
712 (x_get_monitor_attributes_fallback): Omit unused locals.
713 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
714 Use double, not float, to avoid mixed-mode floating point arithmetic.
716 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
717 Jan Djärv <jan.h.d@swipnet.se>
719 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
720 (XINERAMA_CFLAGS): New macros.
721 (ALL_CFLAGS, LIBES): Use them.
723 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
724 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
725 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
726 (syms_of_xfns): DEFSYM them.
727 (struct MonitorInfo): New struct.
728 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
729 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
730 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
731 (x_get_monitor_attributes_xinerama): New functions.
732 (Fx_display_monitor_attributes_list): New primitive.
733 (syms_of_xfns): Defsubr it.
735 * xterm.h (x_display_info): Add Xatom_net_workarea and
736 Xatom_net_current_desktop.
738 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
739 and dpyinfo->Xatom_net_current_desktop.
741 2013-05-06 Eli Zaretskii <eliz@gnu.org>
743 * xdisp.c (pos_visible_p): Use the special code for finding the
744 beginning of a display property or overlay for any "replacing"
745 display property, not just for display strings. This solves
746 incorrect reporting of position by posn-at-point. (Bug#14241)
748 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
750 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
751 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
752 Verify that ElfW (Half) fits in int.
753 (fatal): Use same signature as lisp.h.
754 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
755 configure and build with -DUNEXELF_DEBUG without worrying about
756 other modules that use DEBUG.
757 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
758 possibly-wide integers now uses it instead of plain fprintf.
759 (entry_address): New function, which avoids problems with 32-bit
760 overflow on 64-bit hosts.
761 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
762 (round_up): Don't assume the remainder fits in int.
763 (find_section): Use bool for boolean. Simplify debug code.
764 (unexec): Don't assume file sizes fit in int or size_t.
765 Omit unnecessary trailing newline in 'fatal' format.
766 Use strerror rather than outputting decimal error number.
767 Remove unused code when emacs is not defined;
768 this file relies on Emacs now.
769 Don't assume e_phnum and e_shnum are positive.
771 * regex.c: Fix problems when DEBUG is defined.
772 (extract_number, extract_number_and_incr): Define regardless of
773 whether DEBUG is defined; that's simpler and makes the code less
774 likely to go stale in the normal case when DEBUG is not defined.
775 Return int rather than taking an int * arg. All callers changed.
776 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
777 Remove, replacing with ...
778 (DEBUG_PRINT): New macro. All callers changed.
779 (DEBUG_COMPILES_ARGUMENTS): New macro.
780 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
781 (print_compiled_pattern, print_double_string) [DEBUG]:
782 Use prototype rather than old-style definition.
783 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
784 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
785 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
786 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
787 Don't assume ptrdiff_t, size_t, and long are the same width as int.
788 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
789 This matters only when DEBUG is defined.
791 2013-05-05 Eli Zaretskii <eliz@gnu.org>
793 * xdisp.c (set_iterator_to_next): Set the
794 ignore_overlay_strings_at_pos_p flag only if we are _really_
795 iterating over an overlay string, as indicated by the
796 current.overlay_string_index member. (Bug#14306)
798 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
800 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
801 to where it is used, to avoid autorelease issues (Bug#14050).
803 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
805 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
806 * fileio.c (syms_of_fileio): Implement this.
807 * filelock.c (create_lock_file): If symbolic links don't work, so
808 we use a regular file as a lock file, do not fsync the lock file;
811 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
813 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
814 (syms_of_minibuf): Adjust accodingly.
816 * callint.c (Fcall_interactively): Adjust calls accordingly.
818 2013-05-04 Eli Zaretskii <eliz@gnu.org>
820 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
821 w->contents is a buffer before computing everything else.
822 Use parentheses to disambiguate last part of the condition.
824 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
825 assertion violations. (Bug#14062)
827 2013-05-01 David Reitter <david.reitter@gmail.com>
829 * nsfns.m (ns_tooltip): Initialize.
831 2013-04-28 Eli Zaretskii <eliz@gnu.org>
833 * coding.c (decode_coding_gap): Don't remove the character before
834 a newline unless it's a CR character. (Bug#14287)
836 2013-04-28 Dan Nicolaescu <dann@gnu.org>
838 * dispextern.h (struct face): Move enum face_underline_type
839 earlier so that bitfields can be in the same word.
841 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
843 * nsfns.m (handlePanelKeys): New function.
844 (EmacsOpenPanel:performKeyEquivalent:)
845 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
846 arrows/function/control and copy/paste keys (Bug#14296).
848 2013-04-27 Juri Linkov <juri@jurta.org>
850 * callint.c (Fcall_interactively): Call `Qread_number' for
851 interactive code letter `n' instead of using duplicate code.
854 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
856 * systime.h (make_timeval): Declare as 'const'.
858 2013-04-27 Kenichi Handa <handa@gnu.org>
860 * font.c (font_open_entity): Always open a font of manageable
863 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
865 Port better to AIX (Bug#14258).
866 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
869 2013-04-24 Kenichi Handa <handa@gnu.org>
871 * coding.c (decode_coding_iso_2022): When an invalid escape
872 sequence is encountered, reset the invocation and designation
873 status to the safest one.
875 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
877 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
878 Without this fix, "make distclean" leaves stamp-h1 behind.
880 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
882 * w32fns.c (w32_fullscreen_rect): New function to compute the
883 window rectangle for the given fullscreen mode.
884 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
885 longer tunes the window size. This keeps the window's edges flush
886 with the screen and allows the taskbar to hide itself in fullboth.
888 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
889 window decorations and uses the entire screen.
891 * w32term.h (w32_fullscreen_rect) Add prototype.
892 (struct w32_output): Replace normal_width, normal_height,
893 normal_top, and normal_left members with a single normal_placement
895 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
897 (FRAME_NORMAL_PLACEMENT): New macro.
899 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
901 * minibuf.c (Ftest_completion): Silence compiler warning.
903 2013-04-15 Eli Zaretskii <eliz@gnu.org>
905 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
908 * frame.h (WINDOW_FRAME): Protect macro and its argument with
911 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
912 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
913 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
914 parentheses where appropriate.
916 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
918 * keyboard.c (timer_start_idle): Remove no-longer-used local.
920 2013-04-14 Eli Zaretskii <eliz@gnu.org>
922 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
923 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
924 Mention in the doc string that setting these variables takes
925 effect only after a call to set-window-buffer. (Bug#14200)
927 2013-04-13 Eli Zaretskii <eliz@gnu.org>
929 * indent.c (Fvertical_motion): Don't consider display strings on
930 overlay strings as display strings on the buffer position we
931 started from. This prevents vertical cursor motion from jumping
932 more than one line when there's an overlay string with a display
933 property at end of line.
934 Reported by Karl Chen <Karl.Chen@quarl.org> in
935 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
937 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
939 * window.c (select_window): `record_buffer' even if window is
940 already selected (bug#14191).
942 2013-04-11 Eli Zaretskii <eliz@gnu.org>
944 * window.c (Fwindow_end): Test more flags, including the buffer's
945 last_overlay_modified flag, to determine whether the window's
946 display is really up-to-date. Prevents the function from
947 returning a stale value. (Bug#14170)
948 (Fwindow_line_height): Fix the test for up-to-date-ness of the
951 2013-04-10 Eli Zaretskii <eliz@gnu.org>
953 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
954 garbaged only if it is not already the top frame on its TTY.
955 This prevents flickering due to constant redrawing of TTY frames when
956 there are GUI frames open in the same session. (Bug#13864)
958 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
960 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
961 of marking the idle timers directly.
963 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
965 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
968 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
970 * window.c (select_window): Don't record_buffer while the invariant is
971 temporarily broken (bug#14161).
973 * fns.c (Fdelq): Don't assume !NILP => CONSP.
975 2013-04-07 Eli Zaretskii <eliz@gnu.org>
977 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
979 2013-04-07 Romain Francoise <romain@orebokech.com>
981 Ignore additional platform-specific ACL errors (Bug#13702).
982 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
983 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
985 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
987 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
990 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
992 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
993 This bug was introduced by my 2013-02-25 change that simplified
994 data_start configuration. Without this change, on GNU/Linux
995 an Emacs configured with --enable-profiling fails immediately
996 due to a profiler signal.
997 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
998 with these flags. On platforms where special flags are needed
999 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
1000 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
1001 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
1003 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
1005 Get rid of some platform-specific functions examining window
1006 system and its capabilities. This is a partial rework of the
1008 * lisp.h (have_menus_p): Remove prototype. This function is
1009 replaced with platform-independent window_system_available.
1010 (check_window_system): Move to...
1011 * frame.h (decode_window_system_frame, window_system_available):
1012 ...here, add new prototypes.
1013 * frame.c (window_system_available, decode_window_system_frame):
1015 (check_window_system): Platform-independent now.
1016 * xterm.h (x_in_use): Remove declaration.
1018 * w32term.h (check_x_frame):
1019 * nsterm.h (check_x_frame): Remove prototypes. This function
1020 is replaced with platform-independent decode_window_system_frame.
1021 * msdos.c (have_menus_p): Remove.
1022 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
1023 Remove platform-specific functions. Use check_window_system,
1024 decode_window_system_frame and check_ns_display_info where
1025 appropriate. Minor style and comment tweaks.
1026 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
1027 (check_x_frame): Likewise.
1028 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
1030 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
1031 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
1032 * xmenu.c, xselect.c: All related users changed.
1034 2013-04-03 Kenichi Handa <handa@gnu.org>
1036 The following changes is to optimize the code for reading UTF-8
1039 * coding.c (check_ascii): Rename from detect_ascii. Return value
1040 changed. Check EOL format. Do not call adjust_coding_eol_type
1042 (check_utf_8): New function.
1043 (adjust_coding_eol_type): Do nothing if already adjusted.
1044 (detect_coding): Compare the return value of check_ascii with
1045 coding->src_bytes. Call adjust_coding_eol_type if necessary.
1046 (decode_coding_gap): Optimize for valid UTF-8.
1048 2013-03-21 Kenichi Handa <handa@gnu.org>
1050 * coding.c (syms_of_coding): Cancel previous change.
1052 * insdel.c (insert_from_gap): Fix previous change.
1054 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
1056 Consistently use platform-specific function to detect window system.
1057 * lisp.h (check_window_system): New prototype. This function is
1058 going to replace check_x, check_w32 and check_ns.
1059 (have_menus_p): Mention msdos.c in comment.
1060 * fontset.c (check_window_system_func): Remove. Adjust all users.
1061 * fontset.h (check_window_system_func): Remove prototype.
1062 * nsterm.h (check_ns):
1063 * xterm.h (check_x):
1064 * w32term.h (check_w32): Likewise.
1065 * menu.c (Fx_popup_menu): Use check_window_system.
1066 * msdos.c (check_window_system): Define for MS-DOS.
1067 * nsfns.m (check_window_system): Define for NS. Adjust all users.
1068 * w32fns.c (check_window_system): Likewise for MS-Windows.
1069 * xfns.c (check_window_system): Likewise for X.
1070 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
1071 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
1073 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
1075 Prefer < to > in range checks such as 0 <= i && i < N.
1076 This makes it easier to visualize quantities on a number line.
1077 This patch doesn't apply to all such range checks,
1078 only to the range checks affected by the 2013-03-24 change.
1079 This patch reverts most of the 2013-03-24 change.
1080 * alloc.c (xpalloc, Fgarbage_collect):
1081 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
1082 * character.c (string_escape_byte8):
1083 * charset.c (read_hex):
1084 * data.c (cons_to_unsigned):
1085 * dispnew.c (update_frame_1):
1086 * doc.c (Fsubstitute_command_keys):
1087 * doprnt.c (doprnt):
1088 * editfns.c (hi_time, decode_time_components):
1089 * fileio.c (file_offset):
1090 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1091 * font.c (font_intern_prop):
1092 * frame.c (x_set_alpha):
1093 * gtkutil.c (get_utf8_string):
1094 * indent.c (check_display_width):
1095 * keymap.c (Fkey_description):
1096 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
1098 * minibuf.c (read_minibuf_noninteractive):
1099 * process.c (wait_reading_process_output):
1100 * search.c (Freplace_match):
1101 * window.c (get_phys_cursor_glyph):
1102 * xdisp.c (redisplay_internal):
1103 * xsmfns.c (smc_save_yourself_CB):
1104 Prefer < to > for range checks.
1105 * dispnew.c (sit_for): Don't mishandle NaNs.
1106 This fixes a bug introduced in the 2013-03-24 change.
1107 * editfns.c (decode_time_components): Don't hoist comparison.
1108 This fixes another bug introduced in the 2013-03-24 change.
1110 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
1112 * frame.h (struct frame): Drop scroll_bottom_vpos
1113 member becaue all real users are dead long ago.
1114 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
1115 * xdisp.c (redisplay_internal): Adjust user.
1117 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
1119 * nsmenu.m (showAtX:Y:for:): setLevel to
1120 NSPopUpMenuWindowLevel (Bug#13998).
1122 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
1124 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
1125 (ns_check_pending_open_menu): Declare.
1127 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
1128 (x_activate_menubar): Update the menu with title that matches
1129 ns_get_pending_menu_title, and call
1130 ns_check_pending_openmenu (Bug#12698).
1131 (menuWillOpen:): New method.
1132 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
1134 * nsterm.m (menu_will_open_state, menu_mouse_point)
1135 (menu_pending_title): New varaibles.
1136 (ns_get_pending_menu_title, ns_check_menu_open)
1137 (ns_check_pending_open_menu): New functions.
1139 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
1141 * indent.c (current_column_bol_cache): Remove leftover which is not
1142 used in Fmove_to_column any more.
1143 (current_column, scan_for_column): Adjust users.
1144 * keyboard.c (last_point_position_buffer, last_point_position_window):
1145 Remove leftovers which are not used for recording undo any more.
1146 (command_loop_1, syms_of_keyboard): Adjust users.
1147 * xdisp.c (last_max_ascent): Remove leftover which is not used in
1148 redisplay_window any more.
1149 (move_it_to): Adjust user.
1151 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
1153 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1154 Update dependencies.
1156 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1158 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1159 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1162 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1164 * window.h (struct window): Replace hchild, vchild and buffer slots
1165 with the only contents slot. This is possible because each valid
1166 window may have either the child window (in vertical or horizontal
1167 combination) or buffer to display (for the leaf window). Using that,
1168 a lof of operations to traverse and/or change window hierarchies may
1169 be simplified. New member horizontal is used to distinguish between
1170 horizontal and vertical combinations of internal windows.
1171 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1172 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1173 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1174 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1175 Use contents slot, not buffer, where appropriate.
1176 (wset_combination): New function.
1177 (wset_buffer): Add eassert.
1178 (Fframe_first_window): Simplify the loop reaching first window.
1179 (Fwindow_buffer): Use WINDOW_LEAF_P.
1180 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1181 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1182 (unshow_buffer): Convert initial debugging check to eassert.
1183 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1184 (make_parent_window, window_resize_check, window_resize_apply)
1185 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1186 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1187 Adjust to match struct window changes.
1188 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1189 (mark_window_cursors_off, count_windows, get_leaf_windows)
1190 (foreach_window_1): Simplify the loop.
1191 * alloc.c (mark_object): Do not check for the leaf window because
1192 internal windows has no glyph matrices anyway.
1193 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1194 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1195 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1196 (build_frame_matrix_from_window_tree, mirror_make_current)
1197 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1198 (update_window_tree, set_window_update_flags): Simplify the loop.
1199 (sync_window_with_frame_matrix_rows): Enforce live window.
1200 Use contents slot, not buffer, where appropriate.
1201 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1202 and WINDOW_HORIZONTAL_COMBINATION_P.
1203 (make_frame_visible_1): Simplify the loop.
1204 Use contents slot, not buffer, where appropriate.
1205 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1206 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1207 (expose_window_tree): Likewise.
1208 Use contents slot, not buffer, where appropriate.
1209 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1210 to avoid deleted windows. Use contents slot instead of buffer.
1211 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1212 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1213 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1214 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1216 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1218 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1219 identify the reasons for assertion violations in bug#14062 and
1221 (Fx_show_tip): Fix compilation error under
1222 "--enable-check-lisp-object-type". (Bug#14073)
1224 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1225 Reported by <rzl24ozi@gmail.com>.
1227 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1229 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1231 (unwind_with_echo_area_buffer): ...to restore it here.
1232 This is needed to ensure that...
1233 (redisplay_window): ...both window markers are valid here,
1234 which is verified by eassert.
1235 * editfns.c (save_excursion_save): Do not assume that
1236 selected_window always displays the buffer.
1237 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1240 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1242 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1245 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1247 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1249 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1251 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1252 since MinGW's w32api headers do. This avoids compiler warnings.
1254 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1257 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1259 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1261 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1263 * gtkutil.c (style_changed_cb): Check if frame is live and an
1264 X frame (Bug#14038).
1266 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1268 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1269 Define only for _WIN32_WINNT less than 0x0500.
1270 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1272 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1273 see its own definitions of 'struct timeval' and 'struct timezone'.
1275 Fix incompatibilities between MinGW.org and MinGW64 headers.
1276 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1278 * w32.c (REPARSE_DATA_BUFFER): Guard with
1279 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1281 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1283 * xterm.c: Include X11/XKBlib.h
1284 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1286 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1288 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1290 * blockinput.h (input_blocked_p): Likewise.
1291 * bytecode.c (exec_byte_code): Likewise.
1292 * callproc.c (call_process_kill, call_process_cleanup)
1293 (Fcall_process): Likewise.
1294 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1295 (Fccl_execute_on_string): Likewise.
1296 * character.c (string_escape_byte8): Likewise.
1297 * charset.c (read_hex): Likewise.
1298 * cm.c (calccost): Likewise.
1299 * data.c (cons_to_unsigned): Likewise.
1300 * dired.c (directory_files_internal, file_name_completion):
1302 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1303 (sit_for): Likewise.
1304 * doc.c (Fsubstitute_command_keys): Likewise.
1305 * doprnt.c (doprnt): Likewise.
1306 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1307 * emacsgtkfixed.c: Likewise.
1308 * fileio.c (file_offset, Fwrite_region): Likewise.
1309 * floatfns.c (Fexpt, fmod_float): Likewise.
1310 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1312 * font.c (font_intern_prop): Likewise.
1313 * frame.c (x_set_alpha): Likewise.
1314 * gtkutil.c (get_utf8_string): Likewise.
1315 * indent.c (check_display_width): Likewise.
1316 * intervals.c (create_root_interval, rotate_right, rotate_left)
1317 (split_interval_right, split_interval_left)
1318 (adjust_intervals_for_insertion, delete_node)
1319 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1320 (merge_interval_right, merge_interval_left, copy_intervals)
1321 (set_intervals_multibyte_1): Likewise.
1322 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1323 * keymap.c (Fkey_description): Likewise.
1324 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1325 * lread.c (openp, read_integer, read1, string_to_number):
1327 * menu.c (ensure_menu_items): Likewise.
1328 * minibuf.c (read_minibuf_noninteractive): Likewise.
1329 * print.c (printchar, strout): Likewise.
1330 * process.c (create_process, Faccept_process_output)
1331 (wait_reading_process_output, read_process_output, send_process)
1332 (wait_reading_process_output): Likewise.
1333 * profiler.c (make_log, handle_profiler_signal): Likewise.
1334 * regex.c (re_exec): Likewise.
1335 * regex.h: Likewise.
1336 * search.c (looking_at_1, Freplace_match): Likewise.
1337 * sysdep.c (get_child_status, procfs_ttyname)
1338 (procfs_get_total_memory): Likewise.
1339 * systime.h (EMACS_TIME_VALID_P): Likewise.
1340 * term.c (dissociate_if_controlling_tty): Likewise.
1341 * window.c (get_phys_cursor_glyph): Likewise.
1342 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1343 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1345 * xfns.c (Fx_window_property): Likewise.
1346 * xmenu.c (set_frame_menubar): Likewise.
1347 * xselect.c (x_get_window_property, x_handle_dnd_message):
1349 * xsmfns.c (smc_save_yourself_CB): Likewise.
1350 * xterm.c (x_scroll_bar_set_handle): Likewise.
1352 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1354 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1355 to be optional or nil. Adjust comment and convert it to docstring.
1356 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1357 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1359 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1361 Static checking by GCC 4.8-20130319.
1362 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1363 * process.c (Fset_process_datagram_address)
1364 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1365 * xdisp.c (get_char_face_and_encoding):
1366 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1367 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1368 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1370 2013-03-24 Ken Brown <kbrown@cornell.edu>
1372 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1373 fix compilation on 64-bit Cygwin, where underscores are not
1374 automatically prepended.
1376 * w32term.c (w32_initialize): Silence compiler warning.
1378 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1380 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1381 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1382 variables, to save and restore frame dimensions.
1383 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1384 after returning from a 'fullscreen' configuration.
1385 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1386 to avoid races between the main thread and the input thread.
1388 * w32term.h (struct w32_output): New members normal_width,
1389 normal_height, normal_top, normal_left, and prev_fsmode.
1390 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1391 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1394 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1395 'fullscreen' parameter. Always record previous width and height
1396 of the frame, except when switching out of maximized modes, so
1397 that they could be restored correctly, instead of resetting to the
1398 default frame dimensions. Send SC_RESTORE command to the frame,
1399 unless we are going to send SC_MAXIMIZE, to restore the frame
1400 resize hints in the mouse pointer shown by the window manager.
1403 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1405 * lisp.h (get_frame_param): Adjust conditions for prototype
1408 2013-03-22 Ken Brown <kbrown@cornell.edu>
1410 * unexcw.c: Drop unneeded inclusion of w32common.h.
1411 (report_sheap_usage): Declare.
1412 (read_exe_header): Add magic numbers for x86_64.
1413 (fixup_executable): Fix printf format specifier for unsigned long
1416 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1418 * frame.h (struct frame): Put menu_bar_window under #ifdef
1419 because this member is not needed when X toolkit is in use.
1420 (fset_menu_bar_window):
1421 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1422 (free_glyphs, update_frame):
1423 * xdisp.c (expose_frame): Likewise.
1424 (display_menu_bar): Likewise. Remove redundant eassert.
1425 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1428 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1430 Use functions and constants to manipulate Lisp_Save_Value objects.
1431 This replaces code that used macros and strings and token-pasting.
1432 The change makes the C source a bit easier to follow,
1433 and shrinks the Emacs executable a bit.
1434 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1435 (make_save_value): Change 1st arg from string to enum. All callers
1438 (mark_object): Use if, not #if, for GC_MARK_STACK.
1439 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1440 (XSAVE_OBJECT): Now functions, not macros.
1441 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1442 the constant was never used.
1443 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1444 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1445 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1446 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1448 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1449 type3 with a single member save_type. All uses changed.
1450 (save_type, set_save_pointer, set_save_integer): New functions.
1451 * print.c (PRINTX): Remove.
1453 * alloc.c: Remove redundant static declarations.
1455 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1457 * window.h (struct window): Convert left_col, top_line, total_lines
1458 and total_cols from Lisp_Objects to integers. Adjust comments.
1459 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1461 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1462 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1463 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1464 Adjust users where appropriate.
1466 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1468 * frame.h (struct frame): Drop resx and resy because the same data is
1469 available from window system-specific output context. Adjust users.
1470 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1471 New functions to provide defaults when no window system available.
1472 (FRAME_RES_X, FRAME_RES_Y): New macros.
1473 (NUMVAL): Move from xdisp.c.
1474 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1475 (Ffont_face_attributes, Fopen_font):
1476 * image.c (gs_load):
1477 * w32font.c (fill_in_logfont):
1478 * xdisp.c (calc_pixel_width_or_height):
1479 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1480 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1482 2013-03-20 Kenichi Handa <handa@gnu.org>
1484 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1485 to 1 (temporary workaround until a bug related to ASCII
1486 optimization is fixed).
1488 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1490 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1491 Signal error if window is not internal. Adjust docstring.
1492 (delete_all_child_windows): Use combination_limit to save the buffer.
1493 (Fset_window_configuration): Adjust accordingly.
1494 * print.c (syms_of_print): Initialize debugging output not here...
1495 (init_print_once): ...but in a new function here.
1496 * lisp.h (init_print_once): Add prototype.
1497 * emacs.c (main): Add call to init_print_once. Adjust comments.
1499 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1501 * window.c (window_resize_check, window_resize_apply)
1502 (window_from_coordinates, recombine_windows, set_window_buffer)
1503 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1504 (Fsplit_window_internal, Fdelete_window_internal)
1505 (freeze_window_starts): Use bool for booleans.
1506 * window.h (window_frame_coordinates, resize_frame_windows)
1507 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1509 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1511 * dispnew.c (bitch_at_user): Use `user-error'.
1513 2013-03-17 Ken Brown <kbrown@cornell.edu>
1515 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1516 as return type of image_background. (Bug#13981)
1517 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1519 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1521 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1522 (ns_select): Don't return with result uninitialized.
1524 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1527 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1529 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1530 directories. If filename is nil, get directory name (Bug#13932).
1531 Use getFilename and getDirectory.
1532 (getFilename, getDirectory): New methods for EmacsSavePanel and
1534 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1536 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1538 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1540 2013-03-15 Kenichi Handa <handa@gnu.org>
1542 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1543 (adjust_after_replace): Make it back to static. Delete the third
1544 arg text_at_gap_tail. Cancel the code for handling it.
1546 * coding.h (struct coding_system): New member eol_seen.
1548 * coding.c (detect_ascii): New function.
1549 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1550 when the source bytes are actually scanned. On detecting for
1551 coding_category_utf_8_auto, call detect_ascii instead of scanning
1552 source bytes directly.
1553 (produce_chars): Call insert_from_gap with the new arg 0.
1554 (encode_coding): Likewise.
1555 (decode_coding_gap): Control ASCII optimization by the variable
1556 disable_ascii_optimization instead of #ifndef .. #endif.
1557 Deccode EOL format according to coding->eol_seen.
1558 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1561 * lisp.h (adjust_after_replace): Cancel externing it.
1562 (insert_from_gap): Adjust prototype.
1564 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1566 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1567 FULLSCREEN_MAXIMIZED. (Bug#13935)
1569 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1571 * region-cache.c (find_cache_boundary, move_cache_gap)
1572 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1573 Simplify debugging check and convert to eassert. Adjust comment.
1574 (pp_cache): Put under ENABLE_CHECKING.
1576 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1578 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1579 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1581 (w32fullscreen_hook): If the frame is visible, reset
1582 f->want_fullscreen flag after changing the frame size. If the
1583 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1586 2013-03-13 Daniel Colascione <dancol@dancol.org>
1588 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1589 too so that these builds can use Cygwin's file conversion
1590 functions. (We've been building and linking cygw32.o all along
1591 and just not using it.)
1593 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1595 File synchronization fixes (Bug#13944).
1596 * Makefile.in (LIB_FDATASYNC): New macro.
1598 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1599 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1600 Don't worry about HAVE_FSYNC, since a substitute fsync is
1601 available if the system lacks one.
1602 (Fwrite_regin): Retry fsync if interrupted.
1604 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1606 * w32term.c (w32_read_socket): If the Emacs frame is being
1607 activated, call w32fullscreen_hook, to make sure the new frame
1608 dimensions are in effect. (Bug#13937)
1610 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1612 * xdisp.c (init_iterator): Simplify because both character and byte
1613 positions are either specified or -1. Add eassert. Adjust comment.
1614 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1615 character and byte positions can be obtained from marker.
1617 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1619 Static checking by Sun C 5.12.
1620 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1621 * bytecode.c (exec_byte_code):
1622 * dispnew.c (init_display):
1624 * fileio.c (Fsubstitute_in_file_name):
1625 * keyboard.c (Fevent_convert_list):
1626 * keymap.c (Fsingle_key_description):
1627 * term.c (maybe_fatal, fatal):
1628 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1629 * xsmfns.c (Fhandle_save_session):
1630 Omit unreachable code.
1631 * keymap.c (map_keymap_char_table_item): Cast void * to
1632 a function pointer type; the C Standard requires this.
1634 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1635 Include <sys/param.h> unconditionally, as that works elsewhere and
1636 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1637 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1640 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1642 * insdel.c (adjust_after_replace): Use bool for boolean.
1644 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1646 * keyboard.c: Move keyboard decoding to read_key_sequence.
1647 (decode_keyboard_code): Remove.
1648 (tty_read_avail_input): Don't try to decode input.
1649 (read_decoded_char): New function.
1650 (read_key_sequence): Use it.
1652 2013-03-10 Daniel Colascione <dancol@dancol.org>
1654 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1655 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1656 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1659 * w32term.c (construct_drag_n_drop): Use the above macros to make
1660 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1662 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1663 properly display non-ASCII frame titles in cygw32 builds.
1665 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1666 call ShellExecute in cygw32 builds.
1668 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1669 common file dialog code.
1671 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1672 can just use du like other systems.
1674 * coding.c (from_unicode_buffer): Declare.
1675 * coding.c (from_unicode_buffer): Implement.
1677 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1679 * lread.c: Minor cleanup.
1680 (FROM_FILE_P): New macro.
1681 (skip_dyn_bytes, unreadchar, read1): Use it.
1682 (read_list): Consolidate duplicated code.
1684 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1686 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1688 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1689 (redisplay_internal, set_cursor_from_row, try_window)
1690 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1691 (display_line, notice_overwritten_cursor)
1692 (mouse_face_from_buffer_pos, note_mouse_highlight):
1693 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1694 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1695 (mouse_face_from_string_pos, fast_find_string_pos):
1696 Use MATRIX_ROW_VPOS.
1698 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1700 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1702 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1703 MATRIX_MODE_LINE_ROW.
1705 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1707 2013-03-10 handa <handa@gnu.org>
1709 * lisp.h (adjust_after_replace): Extern it.
1711 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1712 case of detection for coding_category_utf_8_auto.
1713 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1714 Skip decoding if all bytes are ASCII.
1716 * insdel.c (adjust_after_replace): Make it public. New arg
1718 (adjust_after_insert): Call adjust_after_replace with the new arg
1721 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1723 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1724 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1725 from Elisp via unread-command-events.
1727 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1728 functions to mean "no change".
1730 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1732 region-cache.c, scroll.c, search.c: Use bool for booleans.
1733 * lisp.h (compile_pattern):
1734 * scroll.c (do_scrolling, do_direct_scrolling):
1735 * search.c (struct regexp_cache, compile_pattern_1)
1736 (compile_pattern, string_match_1, search_command)
1737 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1738 (search_regs_saved, Fregexp_quote):
1739 Use bool for boolean.
1740 * region-cache.c (region_cache_forward, region_cache_backward):
1741 Fix comments to match code: these functions return int, not boolean.
1743 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1745 * search.c (find_newline): Accept start and end byte positions
1746 as arguments and allow -1 if not known.
1747 (find_newline_no_quit): Likewise for start position.
1748 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1749 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1750 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1751 * editfns.c (Fconstrain_to_field): Break long line.
1752 Adjust call to find_newline.
1753 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1754 Use DEC_BOTH to start next search from the previous buffer
1755 position, where appropriate.
1756 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1757 (get_visually_first_element, move_it_vertically_backward): Likewise.
1758 Obtain byte position from the display iterator, where appropriate.
1760 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1762 print.c, process.c: Use bool for booleans.
1763 * lisp.h (wait_reading_process_output):
1764 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1765 (strout, debug_output_compilation_hack, float_to_string, print)
1767 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1768 (decode_status, status_message, create_process, create_pty)
1769 (Fmake_network_process, Fnetwork_interface_info)
1770 (wait_reading_process_output, read_process_output)
1771 (write_queue_push, write_queue_pop, process_send_signal)
1772 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1773 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1774 Use bool for booleans.
1775 * process.c (Fnetwork_interface_list): Remove unused local.
1776 (connect_counter): Now EMACS_INT, not int.
1778 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1780 * bidi.c (bidi_fetch_char): Swap first and second arguments
1781 to match other functions accepting character and byte positions.
1783 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1784 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1785 when you need just to move to the previous buffer position.
1786 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1788 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1790 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1792 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1794 Avoid character to byte conversions in motion subroutines.
1795 * indent.h (compute_motion, vmotion): Add byte position argument.
1796 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1798 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1799 Use list5 for return value.
1800 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1801 Adjust comments, style and calls to compute_motion.
1802 (Fvertical_motion): Adjust call to vmotion.
1803 * window.c (Fdelete_other_windows_internal): Record window start
1804 byte position and adjust call to vmotion.
1805 (window_scroll_line_based): Likewise with call to compute_motion.
1807 (Frecenter): Adjust calls to vmotion.
1809 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1811 * lisp.h (list2i, list3i): New functions.
1812 (list4i): Move from window.c and make LISP_INLINE.
1813 * editfns.c (make_lisp_time):
1814 * fns.c (Flocale_info):
1815 * keyboard.c (parse_modifiers):
1816 * xterm.c (x_ewmh_activate_frame): Use list2i.
1817 * instel.c (signal_after_change):
1818 * nsfns.m (Fx_server_version, Fxw_color_values):
1819 * w32fns.c (Fxw_color_values, Fx_server_version):
1820 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1821 * fileio.c (Fvisited_file_modtime):
1822 * nsfns.m (Fns_display_usable_bounds):
1823 * w32.c (ltime): Use list4i.
1825 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1827 * search.c (find_newline_no_quit): Rename from find_next_newline.
1830 * lisp.h (find_newline_no_quit): Rename prototype.
1832 * xdisp.c (back_to_previous_line_start)
1833 (forward_to_next_line_start, get_visually_first_element)
1834 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1835 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1836 * bidi.c (bidi_find_paragraph_start): Callers of
1837 find_newline_no_quit changed.
1839 * msdos.c: Change encoding to cp850. (Bug#13879)
1840 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1842 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1844 Coding system support cleanup and minor refactoring.
1845 * coding.h (enum coding_result_code): Remove
1846 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1847 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1848 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1849 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1850 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1851 (decode_coding_region, encode_coding_region, decode_coding_string):
1852 Remove unused compatibility macros.
1853 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1854 (record_conversion_result): Adjust user.
1855 (syms_of_coding): Likewise.
1856 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1857 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1858 (decode_coding_object): Simplify since xrealloc never returns NULL.
1861 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1863 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1864 * sysdep.c (list_system_processes)
1865 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1866 Make it a stub in this case; otherwise the build might fail,
1867 and this code hasn't been tested on such hosts anyway.
1868 Problem reported by Nelson H. F. Beebe in
1869 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1870 and analyzed by Jérémie Courrèges-Anglas in
1871 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1873 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1875 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1876 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1877 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1878 * bidi.c (bidi_find_paragraph_start): Likewise.
1879 * indent.c (vmotion): Likewise.
1881 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1883 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1884 * filelock.c: Include <c-ctype.h>.
1885 (MAX_LFINFO): New top-level constant.
1886 (lock_info_type): Remove members pid, boot_time. Add members at,
1887 dot, colon. Change user member to be the entire buffer, not a
1888 pointer. This allows us to handle the case where a foreign
1889 pid or boot time exceeds the local range. All uses changed.
1890 (LINKS_MIGHT_NOT_WORK): New constant.
1891 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1892 (defined_WINDOWSNT): Remove.
1893 (MAKE_LOCK_NAME, file_in_lock_file_name):
1894 Always use .#FILE (not .#-FILE) for the file lock,
1895 even if it is a regular file.
1896 (rename_lock_file): New function.
1897 (create_lock_file): Use it.
1898 (create_lock_file, read_lock_data):
1899 Prefer a symbolic link for the lock file, falling back on a
1900 regular file if symlinks don't work. Do not try to create
1901 symlinks on MS-Windows, due to security hassles. Stick with
1902 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1903 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1904 host may be using a Windowsish file system, and cannot use
1905 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1906 doesn't work. Don't fail merely because of a symlink-contents
1907 length limit in the current file system; fall back on regular
1908 files. Increase the symlink contents length limit to 8 KiB, this
1909 should be big enough for any real use and doesn't crunch the
1911 (create_lock_file, lock_file_1, read_lock_data):
1912 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1913 (lock_file_1): Return error number, not bool. All callers changed.
1914 (ELOOP): New macro, if not already defined.
1915 (read_lock_data): Return size of lock file contents, not Lisp object.
1916 All callers changed. Handle a race condition if some other process
1917 replaces a regular-file lock with a symlink lock or vice versa,
1918 while we're trying to read the lock.
1919 (current_lock_owner): Parse contents more carefully, to help avoid
1920 confusing a regular-file lock with some other application's use
1921 of the file. Check for lock file contents being too long, or
1922 not parsing correctly.
1923 (current_lock_owner, lock_file):
1924 Allow foreign pid and boot times that exceed the local range.
1925 (current_lock_owner, lock_if_free, lock_file):
1926 Simplify allocation of lock file contents.
1927 * w32.c (sys_rename_replace): New function, containing most of
1928 the contents of the old sys_rename.
1929 (sys_rename): Use it.
1930 (fchmod): New dummy function.
1931 * w32.h (sys_rename_replace, fchmod): New decls.
1933 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1935 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1936 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1937 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1938 <dmantipov@yandex.ru>.
1940 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1942 * composite.c (get_composition_id, fill_gstring_header):
1943 Use make_uninit_vector where appropriate.
1944 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1945 * xselect.c (clean_local_selection_data): Likewise.
1947 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1949 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1950 * image.c (imagemagick_load_image): Calculate height and width
1951 after flattening the image, not before.
1953 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1955 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1956 * ftfont.c (ftfont_shape_by_flt): Likewise.
1957 * w32uniscribe.c (uniscribe_shape): Likewise.
1959 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1961 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1962 The old approach, which fell back on DIR/.#FILE.0 through
1963 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1964 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1965 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1966 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1967 because the locking mechanism was never reliable in that case).
1968 This patch fixes this and other bugs discovered by a code
1969 inspection that was prompted by
1970 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1971 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1972 to avoid interoperability problems between the MS-Windows and
1973 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1974 instances of Emacs now ignore each others' locks.
1975 * filelock.c (defined_WINDOWSNT): New constant.
1976 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1977 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1978 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1979 regular files on MS-Windows hosts.
1980 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1981 Use SAFE_ALLOCA to avoid problems with long file names.
1982 (MAX_LFINFO): Now a local constant, not a global macro.
1983 (IS_LOCK_FILE): Remove.
1984 (lock_file_1): Don't inspect errno if symlink call succeeds;
1985 that's not portable.
1986 (lock_file): Document that this function can return if lock
1988 (lock_file): Don't access freed storage.
1990 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1992 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1994 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1996 * textprop.c: Use bool for booleans.
1997 (validate_interval_range, Fadd_text_properties)
1998 (Fremove_text_properties): Prefer bool to int when either works.
2000 2013-03-02 Eli Zaretskii <eliz@gnu.org>
2002 * textprop.c (Fadd_text_properties, Fremove_text_properties):
2003 If the interval tree changes as a side effect of calling
2004 modify_region, re-do processing starting from the call to
2005 validate_interval_range. (Bug#13743)
2007 2013-02-28 Eli Zaretskii <eliz@gnu.org>
2009 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
2012 2013-02-27 Eli Zaretskii <eliz@gnu.org>
2014 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
2015 _SH_DENYRW flag, instead of emacs_open, to deny any other process
2016 access to the lock file until it is written and closed.
2019 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
2021 * callint.c (Qcall_interactively):
2022 * macros.c (Qexecute_kbd_macro):
2025 2013-02-26 Bastien Guerry <bzg@gnu.org>
2027 * window.c (Frecenter): Tiny docstring enhancement.
2029 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2031 Minor textprop integer cleanup.
2032 * intervals.h, textprop.c (add_text_properties_from_list):
2033 Return void, not int, since nobody uses the return value.
2034 * textprop.c (validate_plist, add_properties, remove_properties)
2035 (Fadd_text_properties):
2036 Don't assume list length fits in int.
2037 (interval_has_all_properties, interval_has_some_properties)
2038 (interval_has_some_properties_list, add_properties, remove_properties)
2039 (Fadd_text_properties, Fremove_text_properties)
2040 (Fremove_list_of_text_properties, text_property_stickiness):
2041 Use bool for booleans.
2042 (Fadd_text_properties, Fremove_text_properties):
2043 (Fremove_list_of_text_properties):
2044 Reindent do-while as per GNU style.
2046 2013-02-25 Eli Zaretskii <eliz@gnu.org>
2048 Implement CLASH_DETECTION for MS-Windows.
2050 * filelock.c [WINDOWSNT]: Include w32.h.
2051 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2052 function of that name. Up-case the macro arguments.
2053 (IS_LOCK_FILE): New macro.
2054 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2055 (create_lock_file): New function, with body extracted from
2057 [WINDOWSNT]: Implement lock files by writing a regular file with
2058 the lock information as its contents.
2059 (read_lock_data): New function, on Posix platforms just calls
2061 [WINDOWSNT]: Read the lock info from the file.
2062 (current_lock_owner): Call read_lock_data instead of calling
2063 emacs_readlinkat directly.
2064 (lock_file) [WINDOWSNT]: Run the file name through
2067 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2068 just check if the process by that PID exists.
2070 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2071 also present, as doing so will fail to error out if the file
2074 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2076 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2077 (Fremove_list_of_text_properties): Skip all of the intervals in
2078 the region between START and END that already have resp. don't
2079 have the requested properties, not just the first one.
2080 Add assertions that the loop afterwards always modifies the
2081 properties. (Bug#13743)
2083 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2085 * callint.c (Fcall_interactively): Use the right lexical environment
2086 for `interactive' specs (bug#13811).
2087 * eval.c (Feval): Accept a lexical environment.
2089 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2091 Simplify data_start configuration (Bug#13783).
2092 This is a followon simplification to the fix for Bug#13650.
2093 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2094 (START_FILES): Remove. All uses removed.
2095 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2096 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2097 (buildobj.h): Use it.
2098 ($(ALLOBJS)): Depend on globals.h.
2099 (temacs$(EXEEXT)): Use $(ALLOBJS).
2100 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2101 * deps.mk (vm-limit.o):
2102 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2103 Do not depend on mem-limits.h.
2104 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2105 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2106 [__GNUC__ && !ORDINARY_LINK]: Remove.
2107 * mem-limits.h, pre-crt0.c: Remove.
2108 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2109 * unexcoff.c (etext): New decl.
2110 (make_hdr): Use DATA_START instead of start_of_data.
2111 * vm-limit.c: Move most of mem-limits.h's contents here.
2112 (data_start): New decl. It's OK if this is approximate,
2113 so simplify-away some unnecessary exactness.
2114 (POINTER): Remove; all uses removed.
2115 (data_space_start): Now char *, to avoid casts.
2116 (exceeds_lisp_ptr): New function, replacing the old
2117 EXCEEDS_LISP_PTR macro. All uses changed.
2118 (check_memory_limits): Simplify and remove casts.
2119 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2120 (memory_warnings): Use data_start instead of start_of_data.
2122 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2124 * xdisp.c (set_message): Only check for debug-on-message if STRING
2125 is a string. (Bug#13797)
2127 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2129 Fix regression introduced by July 10 filelock.c patch.
2130 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2131 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2132 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2133 and diagnosed by Andreas Schwab in
2134 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2136 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2138 Assume C89 or better.
2139 * ralloc.c (SIZE, POINTER, NIL):
2140 * vm-limit.c (POINTER):
2141 Remove, replacing all uses with C89 equivalents. These old
2142 symbols were present only for porting to pre-C89 platforms.
2144 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
2146 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2147 This avoids warning messages reported as part of Bug#13546.
2149 2013-02-21 Ken Brown <kbrown@cornell.edu>
2151 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2153 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2155 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2157 * keyboard.c (Qcommand_execute): New var.
2158 (command_loop_1, read_char): Use it.
2159 (Fcommand_execute): Remove, replace by an Elisp implementation.
2160 (syms_of_keyboard): Adjust accordingly.
2162 2013-02-19 Daniel Colascione <dancol@dancol.org>
2164 * sheap.c (report_sheap_usage): Use message, not message1, so
2165 that we don't try to create a buffer while we're in the middle
2166 of dumping Emacs. Explain why.
2168 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2170 * search.c (find_newline): Return byte position in bytepos.
2172 (find_next_newline_no_quit, find_before_next_newline):
2173 Add bytepos argument.
2174 * lisp.h (find_newline, find_next_newline_no_quit)
2175 (find_before_next_newline): Adjust prototypes.
2176 * bidi.c (bidi_find_paragraph_start):
2177 * editfns.c (Fconstrain_to_field, Fline_end_position):
2178 * indent.c (compute_motion, vmotion):
2179 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2180 (get_visually_first_element, move_it_vertically_backward):
2181 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2183 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2185 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2186 resources were not orderly released.
2188 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2190 * xdisp.c (x_draw_vertical_border): For a window that is neither
2191 the leftmost nor the rightmost, redraw both the left and the right
2192 vertical borders. (Bug#13723)
2194 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2196 * xml.c (init_libxml2_functions):
2197 * sound.c (sound_warning):
2198 * sheap.c (report_sheap_usage):
2199 * process.c (wait_reading_process_output):
2200 * msdos.c (XMenuActivate):
2201 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2202 * keyboard.c (top_level_1):
2203 * editfns.c (Fmessage, Fmessage_box):
2204 * callint.c (Fcall_interactively):
2205 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2207 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2209 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2210 * frame.c (syms_of_frame): ... to here.
2212 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2214 * w32.c (sys_chown): Remove unused function.
2216 * w32term.c <input_signal_count>: Declare 'volatile'
2217 unconditionally. (Bug#9066)
2219 * w32.c (set_errno): Reset h_errno and don't set it to any other
2220 value. Set errno instead.
2221 (check_errno): Reset h_errno.
2222 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2223 (sys_gethostname, sys_getservbyname, sys_getpeername)
2224 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2225 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2227 (sys_gethostbyname): Set h_errno only errors detected.
2229 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2231 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2233 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2235 * keyboard.c (read_char): Fix calculation of auto-save time out
2236 when auto-save-timeout is less than 4. (Bug#13720)
2238 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2239 time. Improve diagnostics in DebPrint. (Bug#13546)
2241 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2242 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2243 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2244 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2245 make sure errno is set to an appropriate value. (Bug#13546)
2246 (socket_to_fd): Add assertion against indexing fd_info[] with a
2247 value that is out of bounds.
2248 (sys_accept): If fd is negative, do not set up the child_process
2249 structure for reading.
2251 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2253 * composite.c (fill_gstring_header): Remove useless prototype.
2255 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2256 * print.c (PRINTDECLARE, print_object):
2257 * search.c (compile_pattern, fast_looking_at, search_buffer):
2258 (simple_search, boyer_moore, Freplace_match):
2259 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2260 (get_overlay_arrow_glyph_row, display_mode_element):
2261 (decode_mode_spec_coding, message3):
2262 * xfaces.c (face_at_string_position): Use bool for booleans.
2265 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2267 Fix AIX port (Bug#13650).
2268 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2269 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2270 was #undeffed earlier, so it cannot be used as a macro here.
2271 Use the constant and not the macro.
2273 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2275 * w32proc.c (new_child): If no vacant slots are found in
2276 child_procs[], make another pass looking for slots whose process
2277 has exited or died. (Bug#13546)
2279 * w32.c (sys_pipe): When failing due to file descriptors above
2280 MAXDESC, set errno to EMFILE.
2281 (_sys_read_ahead): Update cp->status when failing to read serial
2282 communications input, so that the status doesn't stay at
2283 STATUS_READ_IN_PROGRESS. (Bug#13546)
2285 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2287 * gtkutil.c (tb_size_cb): New function.
2288 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2290 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2292 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2295 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2297 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2299 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2301 * font.c (font_range): Add pos_byte argument. Adjust comment
2302 and break long line.
2303 * font.h (font_range): Adjust prototype.
2304 * composite.c (autocmp_chars): Pass byte position to font_range.
2305 Break long line. Remove useless prototype and format comment.
2307 2013-02-13 Glenn Morris <rgm@gnu.org>
2309 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2311 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2313 Improve AIX port some more (Bug#13650).
2314 With this, it should be as good as it was in 23.3, though it's
2315 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2316 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2317 * unexaix.c (start_of_text): Remove.
2318 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2319 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2320 (orig_load_scnptr, orig_data_scnptr):
2321 Now off_t, not long, since they are file offsets.
2322 (make_hdr): Use _data, not start_of_data ().
2323 This is the key part of the fix.
2324 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2325 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2327 * pre-crt0.c (data_start): Initialize to 1.
2328 This ports to compilers that optimize the external declaration
2329 'int x = 0;' as if it were 'int x;' to shrink the executable.
2331 Improve AIX port (Bug#13650).
2332 This doesn't fix the bug, but it makes progress: Emacs builds now.
2333 * unexaix.c: Include inttypes.h, stdarg.h.
2334 (report_error, report_error_1): Mark as _Noreturn.
2335 (report_error): Don't report the wrong errno.
2336 (report_error_1): Now varargs. All callers changed.
2337 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2338 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2339 (write_ptr): Use %p to print address rather than %lx and a cast
2340 to unsigned long. Grow buffer a bit, to be safer.
2342 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2344 * bidi.c (bidi_resolve_neutral): After finding the next
2345 non-neutral character, accept NEUTRAL_ON type as well, because
2346 directional control characters, such as LRE and RLE, have their
2347 type converted to that by bidi_resolve_weak. This avoids aborts
2348 when LRE/RLE follows a run of neutrals.
2349 (bidi_move_to_visually_next): Assert that return value of
2350 bidi_peek_at_next_level is non-negative. Negative values will
2353 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2355 Minor getenv-related fixes.
2356 * callproc.c (Fcall_process_region) [!DOS_NT]:
2357 Avoid unnecessary duplicate call to getenv.
2358 * callproc.c (init_callproc):
2359 * dispnew.c (init_display):
2360 * sysdep.c (sys_subshell):
2361 Omit unnecessary cast of getenv or egetenv.
2363 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2365 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2366 Update dependencies.
2368 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2370 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2372 (display_line): Set w->region_showing to the value of
2373 it->region_beg_charpos, not to -1. This fixes redisplay
2374 optimization when cursor is moved up after M->. (Bug#13623)
2376 (try_scrolling): Scroll text up more if point is too close to ZV
2377 and inside the scroll margin. This makes sure point is moved
2378 outside the scroll margin in these cases.
2380 * window.h (struct window): region_showing can no longer be
2383 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2385 Tune by using memchr and memrchr.
2386 * doc.c (Fsnarf_documentation):
2387 * fileio.c (Fsubstitute_in_file_name):
2388 * search.c (find_newline, scan_newline):
2389 * xdisp.c (pos_visible_p, display_count_lines):
2390 Use memchr and memrchr rather than scanning byte-by-byte.
2391 * search.c (find_newline): Rename from scan_buffer.
2392 Omit first arg TARGET, as it's always '\n'. All callers changed.
2394 Clean up read_key_sequence a tiny bit more.
2395 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2396 (read_key_sequence): Remove unused locals.
2398 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2400 Clean up read_key_sequence a bit; reread active keymaps after first event.
2401 * keyboard.c (read_char, read_char_x_menu_prompt)
2402 (read_char_minibuf_menu_prompt):
2403 Replace nmaps+maps with a single `map' arg.
2404 (follow_key): Operate on a single map.
2405 (active_maps): New function.
2406 (test_undefined): Also return true for nil bindings.
2407 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2408 a single (composed) keymap. Remember `first_event' to choose the right
2409 set of active keymaps. Recompute the set of keymaps after receiving
2410 the first event. Remove GOBBLE_FIRST_EVENT.
2411 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2412 * keyboard.h (read_char): Update declaration.
2413 * lread.c (read_filtered_event): Adjust call to read_char.
2415 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2417 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2418 Don't use the limitation on backwards movement when lines are truncated
2419 in the window. (Bug#13675)
2421 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2423 * marker.c (set_marker_internal): If desired position is passed
2424 as a marker, avoid call to buf_charpos_to_bytepos.
2425 * window.c (Fset_window_point): Omit redundant type checking.
2426 (Fset_window_start): Likewise. Format comment.
2427 (window_scroll_pixel_based): Use set_marker_restricted_both
2428 with character and byte positions obtained from an iterator.
2429 (Fset_window_configuration): Use set_marker_restricted_both.
2430 * xdisp.c (message_dolog): Likewise.
2432 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2434 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2435 When text lines are longer than window's screen lines, don't move back
2436 too far. This speeds up some redisplay operations. (Bug#13675)
2438 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2440 * syntax.c (scan_sexps_forward): Fix byte position calculation
2441 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2443 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2445 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2446 that was not needed.
2448 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2450 Minor hashing refactoring.
2451 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2452 (sxhash_float): Return EMACS_UINT, for consistency with the other
2454 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2455 non-static inline function and therefore can't use static vars.
2456 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2457 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2458 with the other hash functions.
2460 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2462 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2463 XXXXXX part of the temporary file pattern is not downcased even
2464 when w32-downcase-file-names is non-nil. (Bug#13661)
2466 * xdisp.c (decode_mode_spec): Remove handling of %t.
2468 * msdos.c (careadlinkatcwd): Remove.
2470 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2472 * lread.c (skip_dyn_bytes): New function (bug#12598).
2473 (read1): Use it. Use getc instead of READCHAR to read bytes.
2474 (load_each_byte): Remove. Update users.
2476 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2478 * search.c (scan_buffer): Calculate end byte position just once.
2479 (scan_newline): Do not recalculate start_byte.
2480 (search_command): Use eassert.
2481 * syntax.c (struct lisp_parse_state): New member location_byte.
2482 (scan_sexps_forward): Record from_byte and avoid redundant
2483 character to byte position calculation ...
2484 (Fparse_partial_sexp): ... here. Break too long line.
2486 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2488 * lisp.h (make_uninit_vector): New function.
2489 * alloc.c (Fvector, Fmake_byte_code):
2490 * ccl.c (Fregister_ccl_program):
2491 * charset.c (Fdefine_charset_internal, define_charset_internal):
2492 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2493 * composite.c (syms_of_composite):
2494 * font.c (Fquery_font, Ffont_info, syms_of_font):
2495 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2496 * ftfont.c (ftfont_shape_by_flt):
2497 * indent.c (recompute_width_table):
2498 * nsselect.m (clean_local_selection_data):
2499 * syntax.c (init_syntax_once):
2500 * w32unsubscribe.c (uniscribe_shape):
2501 * window.c (Fcurrent_window_configuration):
2502 * xfaces.c (Fx_family_fonts):
2503 * xselect.c (selection_data_to_lisp_data): Use it.
2505 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2507 * coding.c (Fdefine_coding_system_internal): Use AREF where
2508 argument is known to be a vector.
2509 * fns.c (Flocale_info): Likewise for ASET.
2510 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2511 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2513 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2515 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2518 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2519 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2520 updateCollectionBehaviour.
2522 * nsterm.m (NEW_STYLE_FS): Remove.
2523 (ns_last_use_native_fullscreen): New variable.
2524 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2525 (x_set_window_size): Do not take title bar and tool bar into account
2526 if isFullscreen returns YES.
2527 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2528 (check_native_fs): New function.
2529 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2530 (ns_term_init): Remove NEW_STYLE_FS.
2531 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2532 and tool bar if isFullscreen returns NO.
2533 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2534 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2535 with HAVE_NATIVE_FS.
2536 (window:willUseFullScreenPresentationOptions:): New method.
2537 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2538 Hide toolbar if not enabled (Bug#13444).
2539 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2540 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2541 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2542 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2543 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2544 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2545 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2546 (syms_of_nsterm): Add ns-use-native-fullscreen.
2548 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2550 * fileio.c (Qchoose_write_coding_system): Now static.
2552 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2554 * xdisp.c (window_buffer_changed): region_showing can be negative,
2555 which still means region is being displayed.
2556 (redisplay_internal): Resurrect code that forced redisplay of the
2557 whole window when showing region and the mark has changed.
2558 Record the new mark position to allow redisplay optimizations.
2559 (display_line): If it->region_beg_charpos is non-zero, set the
2560 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2562 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2563 not bitfield of 1 bit.
2565 2013-02-03 Daniel Colascione <dancol@dancol.org>
2567 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2568 daemon mode works on cygw32 when Emacs is installed and not just
2571 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2573 Avoid file time stamp bug on MS-Windows (Bug#13149).
2574 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2575 as FAT32 doesn't update time stamps when truncating them.
2576 Also, check that a file time stamp is not a multiple of 100 ns;
2577 this should catch all instances of the problem on MS-Windows,
2578 as its native file system resolution is 100 ns or worse, and
2579 checking for a non-multiple of 100 ns should impose only a small
2580 overhead on systems with ns resolution.
2582 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2584 Avoid encoding file names on MS-Windows when they need to be run
2585 through dostounix_filename.
2586 * w32.c (normalize_filename): Accept an additional argument
2587 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2588 downcase it even if w32-downcase-file-names is non-nil.
2589 (dostounix_filename): Accept an additional argument MULTIBYTE and
2590 pass it to normalize_filename.
2591 (emacs_root_dir): Adjust.
2593 * msdos.h (dostounix_filename): Adjust prototype.
2595 * w32.h (dostounix_filename): Adjust prototype.
2597 * msdos.c (dostounix_filename): Accept an additional argument and
2599 (init_environment): Adjust callers of dostounix_filename.
2601 * fileio.c (Ffile_name_directory, file_name_as_directory)
2602 (directory_file_name, Fexpand_file_name)
2603 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2605 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2607 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2608 variables, as egetenv is case-insensitive for DOS_NT.
2610 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2611 with an encoded file name.
2613 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2614 Adjust calls to dostounix_filename.
2616 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2618 * unexw32.c (unexec): Adjust call to dostounix_filename.
2620 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2622 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2625 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2628 * callproc.c (Fcall_process): Make sure program name in PATH and
2629 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2630 is passed to exec/spawnve, which fails unless the file-name
2633 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2634 even if w32-quote-process-args is nil.
2636 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2638 Fix timestamp bug when write-region appends nothing (Bug#13149).
2639 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2640 the file's time stamp doesn't change if Emacs happens to write nothing
2641 to the file, and on a buggy file system this could cause Emacs to
2642 incorrectly infer that the file system doesn't have the bug.
2643 Avoid this problem by inhibiting the inference in this case.
2645 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2647 * window.h (struct window): Convert base_line_number, base_line_pos
2648 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2649 Convert region_showing member from Lisp_Object to bitfield.
2650 Remove sequence_number member. Adjust comments.
2651 * window.c (sequence_number): Remove.
2652 (make_window): Initialize column_number_displayed.
2653 * print.c (print_object): Follow the printed representation of
2654 frames and print window pointer to distinguish between windows.
2655 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2656 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2657 (wset_column_number_displayed, wset_region_showing): Remove.
2658 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2659 (try_scrolling, try_cursor_movement, redisplay_window)
2660 (try_window_reusing_current_matrix, try_window_id, display_line)
2661 (display_mode_lines, decode_mode_spec): Adjust users.
2662 * .gdbinit (pwinx): Do not print sequence_number.
2664 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2666 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2667 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2668 * dired.c: Include <fcntl.h>.
2669 (open_directory): New function, which uses open and fdopendir
2670 rather than opendir. DOS_NT platforms still use opendir, though.
2671 (directory_files_internal, file_name_completion): Use it.
2672 (file_attributes): New function, with most of the old Ffile_attributes.
2673 (directory_files_internal, Ffile_attributes): Use it.
2674 (file_attributes, file_name_completion_stat): First arg is now fd,
2675 not dir name. All uses changed. Use fstatat rather than lstat +
2677 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2678 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2679 (emacs_readlinkat): New function, with much of the old
2680 Ffile_symlink_p, but with an fd argument for speed.
2681 It uses readlinkat rather than careadlinkatcwd, so that it
2682 need not assume the working directory.
2683 (Ffile_symlink_p): Use it.
2684 * filelock.c (current_lock_owner): Use emacs_readlinkat
2685 rather than emacs_readlink.
2686 * lisp.h (emacs_readlinkat): New decl.
2687 (READLINK_BUFSIZE, emacs_readlink): Remove.
2688 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2689 (emacs_norealloc_allocator, emacs_readlink): Remove.
2690 This stuff is moved to fileio.c.
2691 * w32.c (fstatat, readlinkat): New functions.
2692 (careadlinkat): Don't check that fd == AT_FDCWD.
2693 (careadlinkatcwd): Remove; no longer needed.
2695 2013-01-31 Glenn Morris <rgm@gnu.org>
2697 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2698 (Fwrite_region): Update for new choose_write_coding_system args.
2699 Move the last piece of choose_write_coding_system here. (Bug#13522)
2700 (syms_of_fileio): Add choose-write-coding-system.
2702 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2704 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2705 (sys_close): Zero out the flags for the file descriptor before
2706 closing it. (Bug#13546)
2708 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2709 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2710 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2713 * w32.c (w32_get_long_filename, init_environment, readlink):
2714 Support file names encoded in DBCS codepages.
2715 (readlink): Use the current file-name-coding-system, not the ANSI
2716 codepage, to decode and handle targets of symlinks.
2718 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2720 * w32.c (opendir): Now accepts a 'const char *'.
2722 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2724 Remove obsolete redisplay code. See the discussion at
2725 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2726 * dispnew.c (preemption_period, preemption_next_check): Remove.
2727 (Vredisplay_preemption_period): Likewise.
2728 (update_frame, update_single_window, update_window, update_frame_1):
2729 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2730 used, following the 2012-06-22 change.
2732 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2734 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2736 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2738 * font.c (num_fonts): Remove the leftover from old
2739 debugging code. Adjust comment style here and there.
2740 * insdel.c (insert_1): Remove.
2741 * lisp.h (insert_1): Remove prototype.
2742 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2744 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2746 * w32.c (max_filename_mbslen): New function.
2747 (normalize_filename, readdir): Use it to detect locales where ANSI
2748 encoding of file names uses a double-byte character set (DBCS).
2749 If a DBCS encoding is used, advance by characters using
2750 CharNextExA, instead of incrementing a 'char *' pointer.
2751 Use _mbslwr instead of _strlwr. (Bug#13515)
2753 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2754 request of memory reservation to 1.7GB. (Bug#13065)
2756 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2758 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2759 at check_extra_latin label. (Bug#13505)
2761 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2763 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2764 Avoid redundant calls to strlen.
2766 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2768 Drop async_visible and async_iconified fields of struct frame.
2769 This is possible because async input is gone; for details, see
2770 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2771 * frame.h (struct frame): Remove async_visible and async_iconified
2772 members, convert garbaged to unsigned bitfield. Adjust comments.
2773 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2774 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2775 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2776 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2777 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2779 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2780 properly. Likewise for obscured.
2782 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2785 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2787 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2789 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2790 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2792 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2794 * xdisp.c (message2, message2_nolog): Remove functions.
2795 (message3, message3_nolog): Extract nbytes and multibyteness directly
2796 from the string. Change all callers.
2797 (message3_nolog): Don't set message_enable_multibyte since set_message
2798 will reset it anyway.
2799 (message1, message1_nolog): Use message3.
2800 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2801 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2802 (set_message): Drop all but the second arg, which has to be a string.
2803 (set_message_1): Simplify now that we know that a1 is NULL and the
2804 second arg is a string.
2805 * frame.h (struct frame): Remove `message_buf' field.
2806 Use glyphs_initialized_p instead.
2807 (FRAME_MESSAGE_BUF): Remove macro.
2808 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2809 * lisp.h (message2, message2_nolog): Remove declarations.
2810 (message3, message3_nolog): Update declarations.
2811 * keyboard.c (read_char_minibuf_menu_text)
2812 (read_char_minibuf_menu_width): Remove vars.
2813 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2814 to correctly handle multibyte strings.
2815 * frame.c (delete_frame): Don't free message_buf any more.
2816 * editfns.c (message_text, message_length): Remove vars.
2817 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2818 * fileio.c (auto_save_error): Use message3 instead of message2.
2819 * dispnew.c (adjust_frame_message_buffer): Remove function.
2821 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2823 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2824 real estate used for the tool bar and the menu bar.
2826 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2828 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2829 hidden buffer is prepared to modification (Bug#13164).
2831 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2833 * window.h (struct window): Change window_end_valid member from
2834 Lisp_Object to a bitfield. Adjust comments.
2835 (wset_window_end_valid): Remove.
2836 * window.c (adjust_window_count): Clear window_end_valid.
2837 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2838 (Fwindow_line_height, set_window_buffer, Frecenter)
2839 (Fsplit_window_internal, Fdelete_other_windows_internal)
2840 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2841 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2842 * xdisp.c (check_window_end, reconsider_clip_changes)
2843 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2844 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2845 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2847 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2849 * xdisp.c (mark_window_display_accurate): Simplify the loop
2850 assuming that the only one of vchild, hchild or buffer window
2851 slots is non-nil. Call mark_window_display_accurate_1 for
2852 the leaf windows only.
2853 (mark_window_display_accurate_1): Always assume leaf window.
2856 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2858 * emacs.c (Qkill_emacs_hook): Now static.
2860 * fileio.c (Finsert_file_contents): Simplify.
2861 Remove unnecessary assignments and tests.
2863 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2865 * w32.c (acl_set_file): Don't test for errors unless
2866 set_file_security returns FALSE. Avoids spurious errors when
2869 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2871 * fileio.c (Finsert_file_contents): Revert code introduced at
2872 2013-01-18 in favor of the simpler and generally better fix.
2873 Save stack space by removing 'buffer' and reusing 'read_buf'
2876 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2878 * lisp.h (eabs): Define unconditionally (Bug#13419).
2879 The old "#if !defined (eabs)" was an unnecessary revenant of back
2880 when this macro was called "abs". Document 'eabs' better.
2882 2013-01-19 Glenn Morris <rgm@gnu.org>
2884 * fns.c (Frandom): Doc fix.
2886 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2888 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2889 segfault when there are lots of overlays.
2891 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2892 when there are lots of overlays.
2893 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2894 for the details and a way to reproduce.
2896 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2898 * fileio.c: Use O_APPEND to append.
2899 This corresponds better to the natural interpretation of "append",
2900 and avoids the need to open the output file twice, or to invoke
2901 lseek when APPEND is neither nil nor a number.
2902 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2903 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2904 file possibly twice, and lseeking to its end; this avoids the
2905 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2906 at the same time: the combination is never needed and apparently
2907 it doesn't work with DOS_NT.
2909 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2910 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2912 Allow floating-point file offsets.
2913 Problem reported by Vitalie Spinu in
2914 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2915 * fileio.c (emacs_lseek): Remove.
2916 (file_offset): New function.
2917 (Finsert_file_contents, Fwrite_region): Use it.
2919 2013-01-19 Chong Yidong <cyd@gnu.org>
2921 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2922 aborting on Fsignal (Bug#13289).
2924 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2926 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2927 set_file_security as failure due to insufficient privileges.
2928 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2929 (fstat): Return owner and group like 'stat' and 'lstat' do.
2931 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2933 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2934 The bug was observed on Ubuntu operating inside a virtual machine,
2935 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2936 The workaround introduces a race condition on non-buggy hosts,
2937 but it's an unlikely race and anyway there's a nearly identical
2938 nearby race that can't be fixed.
2939 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2941 (Fwrite_region): Test for file system time stamp bug.
2942 (init_fileio): New function.
2943 * lisp.h (init_fileio): Declare it.
2944 * emacs.c (main): Call it.
2946 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2947 and make it more consistent with other stat-failure diagnostics.
2949 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2951 Fix crash when inserting data from non-regular files.
2952 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2953 for the error description produced by valgrind.
2954 * fileio.c (read_non_regular): Rename to read_contents.
2955 Free Lisp_Save_Value object used to pass parameters.
2956 (read_non_regular_quit): Rename to read_contents_quit.
2957 (Finsert_file_contents): Redesign internal file reading loop to adjust
2958 gap and end positions after each read and so help make_gap to work
2959 properly. Do not signal an I/O error too early and so do not leave
2960 not yet decoded characters in a buffer, which was the reason of
2961 redisplay crash. Use list2 to build return value. Adjust comments.
2963 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2965 Close a race when statting and reading files (Bug#13149).
2966 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2967 This avoids a race if the file is renamed between stat and open.
2968 This race is not the problem originally noted in Bug#13149;
2969 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2971 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2973 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2974 objects, related functions and macros.
2975 (make_save_value): Adjust prototype.
2976 (make_save_pointer): New prototype.
2977 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2978 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2979 * alloc.c (format_save_value): Rename to make_save_value.
2980 (make_save_pointer): New function.
2981 (record_xmalloc): Use make_save_pointer.
2982 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2983 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2984 Change users of make_save_value to make_save_pointer.
2985 Likewise for format_save_value and make_save_value.
2987 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2989 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2990 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2991 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2994 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2996 * alloc.c (free_save_value): Now static.
2998 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3000 * keymap.c (map_keymap_internal): Use format_save_value.
3001 (map_keymap_char_table_item): Adjust accordingly.
3002 * fileio.c (non_regular_fd, non_regular_inserted)
3003 (non_regular_nbytes): Remove.
3004 (Finsert_file_contents): Convert trytry to ptrdiff_t.
3005 Use format_save_value to pass parameters to read_non_regular.
3006 (read_non_regular): Use XSAVE_ macros to extract parameters.
3008 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
3010 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
3012 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3014 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
3015 extraction from any Lisp_Save_Value slot. Add type checking.
3016 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
3017 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
3018 * xselect.c: All users changed.
3020 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3022 Some convenient bits to deal with Lisp_Save_Values.
3023 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
3024 (allocate_misc): Remove prototype.
3025 (format_save_value): New prototype.
3026 * alloc.c (allocate_misc): Revert back to static.
3027 (format_save_value): New function to build Lisp_Save_Value
3028 object with the specified internal structure.
3029 (make_save_value): Reimplement using format_save_value.
3030 * editfns.c (save_excursion_save): Use format_save_value.
3031 (save_excursion_restore): Use XSAVE_OBJECT.
3033 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3035 Avoid needless casts with XSAVE_POINTER.
3036 * alloc.c (mark_object) [GC_MARK_STACK]:
3037 * dired.c (directory_files_internal_unwind):
3038 * fileio.c (do_auto_save_unwind):
3039 * gtkutil.c (pop_down_dialog):
3040 * keymap.c (map_keymap_char_table_item):
3041 * lread.c (load_unwind):
3042 * nsmenu.m (pop_down_menu):
3043 * print.c (print_object) [GC_MARK_STACK]:
3044 * xfns.c (clean_up_file_dialog):
3045 * xmenu.c (cleanup_widget_value_tree):
3046 Omit casts between XSAVE_POINTER and a pointer type.
3048 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3050 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3051 * eval.c (eval_sub): Protect `form' from being GCed before its
3052 car and cdr becomes protected with the backtrace entry.
3054 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3056 Make Lisp_Save_Value more versatile storage for up to four objects.
3057 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3058 (struct Lisp_Save_Value): New layout. Adjust comments.
3059 (XSAVE_POINTER): New macro.
3060 (XSAVE_INTEGER): Likewise.
3061 (allocate_misc): Add prototype.
3062 (free_misc): Likewise.
3063 * alloc.c (allocate_misc): Now global.
3064 (free_misc): Likewise. Adjust comment.
3065 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3066 (free_save_value): Likewise.
3067 (mark_object): Likewise.
3068 * editfns.c (save_excursion_save): Pack everything within
3069 Lisp_Save_Value and so avoid xmalloc.
3070 (save_excursion_restore): Adjust to match new layout. Use free_misc
3071 because we do not allocate extra memory any more. Add eassert.
3072 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3073 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3074 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3075 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3076 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3078 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3080 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3081 (nsfont_draw): Remove disabling of LCD smoothing.
3082 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3083 Bug#11484 with LCD smoothing on.
3085 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3087 Fix SIGDANGER handlers, for AIX (Bug#13408).
3088 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3089 Move handlers here from emacs.c; they were out of place.
3091 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3093 * xterm.c (syms_of_xterm): Adjust documentation for
3094 scroll-bar-adjust-thumb-portion.
3096 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3098 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3099 determine whether scroll bar thumb size should be adjusted or not.
3100 Use variable for MOTIF.
3102 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
3104 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3106 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3108 (doCommandBySelector:): Set processingCompose to NO.
3110 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3111 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3112 (nsfont_list_family): Add block/unblock_input calls.
3113 (nsfont_open): Move block_input earlier. Add unblock_input before early
3115 (nsfont_draw): Add block/unblock_input calls.
3117 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3119 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3120 for old_charpos and old_bytepos.
3122 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3124 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3125 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3126 Clear tzvalbuf_in_environ if this workaround is in effect.
3127 Problem and fix reported by Kazuhiro Ito.
3129 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3131 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3132 Fix ambiguous doc string cross-reference(s).
3134 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3135 doc string cross-reference(s).
3137 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3138 string cross-reference(s).
3140 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3142 Avoid unnecessary byte position calculation for the gap movement.
3143 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3144 anyway, all of them should use move_gap_both instead.
3145 * lisp.h (move_gap): Remove prototype.
3146 * insdel.c (move_gap): Remove.
3147 (move_gap_both): Add eassert.
3148 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3149 * xml.c (parse_region): Likewise.
3151 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3153 emacsclient -t should not suspend Emacs server (Bug#13387)
3154 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3156 * term.c (init_tty): Use them instead of rolling our own code.
3157 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3158 switches from 'signal' to 'pthread_sigmask', which is safer in
3159 multithreaded applications.
3160 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3161 which has already arranged for that.
3162 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3163 This is the main part of the bug fix.
3165 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3167 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3168 x_last_font_name (Bug#13403).
3170 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3172 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3173 the type of per-buffer values where appropriate.
3174 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3175 predicate, which is how it's really used now. Adjust comment.
3176 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3177 * buffer.c (buffer_slot_type_mismatch): Remove.
3178 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3179 predicate. Adjust comment.
3180 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3181 fill-column, left-margin, tab-width, buffer-saved-size,
3182 left-margin-width, right-margin-width, left-fringe-width,
3183 right-fringe-width, scroll-bar-width and buffer-display-count.
3184 Use Qstringp for default-directory, buffer-file-name,
3185 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3186 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3188 * data.c (store_symval_forwarding): Adjust to call the predicate.
3190 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3192 * w32.c (get_name_and_id, acl_set_file):
3193 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3195 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3197 * lisp.h (make_gap_1): New prototype.
3198 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3200 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3202 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3203 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3204 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3205 (make_gap_1): New function to adjust the gap of any buffer.
3206 * coding.c (coding_alloc_by_making_gap): Use it.
3207 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3208 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3210 2013-01-08 Juri Linkov <juri@jurta.org>
3212 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3213 of (supports :underline (:style wave)). (Bug#13000)
3215 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3217 * undo.c (Fprimitive_undo): Move to simple.el.
3218 (syms_of_undo): Remove declarations for Sprimitive_undo.
3220 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3222 * keyboard.c (echo_add_key): Rename from echo_add_char.
3224 2013-01-06 Chong Yidong <cyd@gnu.org>
3226 * keyboard.c (echo_add_char): New function, factored out from
3227 echo_char. Don't add a space if the previous echo string was
3229 (echo_char): Use it.
3230 (read_key_sequence): When echoing mock input, ensure that the
3231 trailing dash is properly added.
3233 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3235 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3236 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3237 digits for buffer positions, before misalignment starts.
3238 Display "0" for integer "object" field.
3239 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3240 Display the newline glyph more unambiguously.
3242 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3244 * nsterm.m (ns_draw_underwave):
3245 * w32term.c (w32_draw_underwave):
3246 * xterm.c (x_draw_underwave): Make underwave look more triangular
3247 and also degrade gracefully for small fonts. (Bug#13000)
3249 * nsterm.m (ns_draw_text_decoration):
3250 * w32term.c (x_draw_glyph_string):
3251 * xterm.c (x_draw_glyph_string): Don't use previous underline
3252 thickness and position if previous underline type is underwave.
3254 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3256 * fileio.c (Ffile_acl): Undocument return format.
3258 2013-01-02 Glenn Morris <rgm@gnu.org>
3260 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3262 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3265 * dired.c (file_name_completion):
3266 * doc.c (get_doc_string):
3267 * floatfns.c (round2):
3268 * font.c (font_score, font_delete_unmatched):
3269 * fringe.c (compute_fringe_widths):
3270 * lread.c (read_list):
3271 * minibuf.c (Ftry_completion):
3272 * term.c (tty_ins_del_lines):
3273 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3274 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3276 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3278 * w32.c (unsetenv): Set up the string passed to _putenv
3280 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3281 for the bug this caused.
3283 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3285 * coding.c (Qmac): Now static.
3287 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3289 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3290 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3291 handlebox_widget. Set toolbar_in_hbox to false/true, set
3292 toolbar_is_packed to true.
3293 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3294 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3295 Show all on TOOLBAR_TOP_WIDGET.
3296 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3297 by TOOLBAR_TOP_WIDGET.
3298 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3299 Check toolbar_is_packed.
3300 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3301 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3302 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3304 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3305 (xg_update_menubar): Update title only if
3306 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3307 (xg_update_submenu): Skip tearoff only if
3308 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3309 (xg_initialize): Initialize xg_detached_menus only if
3310 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3312 * xterm.h (struct x_output): Surround handlebox_widget with
3313 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3314 toolbar_in_hbox is bool.
3316 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3318 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3319 (LIBS_GNUSTEP): Define.
3320 (LIBES): Add $(LIBS_GNUSTEP).
3321 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3323 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3325 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3326 continuation glyph on a TTY with an indication of an empty line.
3329 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3331 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3332 file's SELinux context or ACLs successfully set, nil otherwise.
3334 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3336 * w32proc.c (reader_thread): Avoid passing NULL handles to
3337 SetEvent and WaitForSingleObject.
3339 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3341 Port EXTERNALLY_VISIBLE to Clang 3.2.
3342 * conf_post.h (__has_attribute): New macro.
3343 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3345 2012-12-27 Glenn Morris <rgm@gnu.org>
3347 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3348 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3350 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3352 * fileio.c (file_name_as_directory, directory_file_name):
3353 Accept an additional argument MULTIBYTE to indicate whether the input C
3354 came from a multibyte or a unibyte Lisp string; all callers
3355 adjusted. Don't assume the input string is always multibyte.
3357 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3358 don't ENCODE_FILE them, and return a unibyte string if the input
3360 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3361 don't assume the input strings will always be multibyte. If the
3362 input strings are multibyte, decode strings obtained from C
3365 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3367 * lisp.h (toplevel): Add two notices to the comment about
3368 defining a new Lisp data type.
3369 * print.c (print_object): If Lisp_Save_Value object's pointer
3370 is the address of a memory area containing Lisp_Objects, try
3372 * alloc.c (valid_lisp_object_p): Adjust comment.
3374 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3376 * keyboard.c (record_asynch_buffer_change): Initialize an event
3377 only if it's really needed.
3378 * frame.h (enum output_method): Remove output_mac member since
3379 it's a leftover from the deleted code.
3380 * frame.c (Fframep): Adjust user here ...
3381 * terminal.c (Fterminal_live_p): ... and here.
3382 * coding.c (Qmac): Now here because it's only used to denote
3383 end-of-line encoding type.
3384 (syms_of_coding): DEFSYM it.
3385 * frame.h (Qmac): Remove duplicated declaration.
3387 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3389 * window.c (select_window_1): Now static, since it's used only here.
3391 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3393 * window.c (window_body_cols): Subtract display margins from the
3394 window body width on TTYs as well. See
3395 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3396 for the original report.
3398 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3400 * xdisp.c (redisplay_window): Remove inner local variable
3401 because the outer shadowed one has the same meaning.
3402 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3404 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3405 (xg_create_tool_bar): Adjust users.
3407 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3409 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3410 * buffer.c (Fget_buffer_create): Use it to set compact field of
3411 struct buffer_text to avoid accessing an uninitialized value
3412 when compact_buffer is called for the first time.
3413 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3414 (Fset_buffer_modified_p): Use buffer_window_count to check
3415 whether the buffer is displayed in some window.
3416 * xdisp.c (message_dolog): Likewise.
3418 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3420 * w32.c (acl_set_file): If setting the file security descriptor
3421 fails, and the new DACL is identical to the existing one, silently
3422 return success. This fixes problems for users backing up their
3423 own files without having the necessary privileges for setting
3424 security descriptors.
3426 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3428 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3429 after WaitForSingleObject returns normally. This expedites reader
3430 thread shutdown when delete_child triggers it.
3431 (reap_subprocess): More accurate commentary for why we call
3432 delete_child only when cp->fd is negative.
3434 * w32.c (sys_close): Do not call delete_child on a subprocess
3435 whose handle is not yet closed. Instead, set its file descriptor
3436 to a negative value, so that reap_subprocess will call
3437 delete_child on that subprocess when its SIGCHLD arrives.
3438 This avoids closing handles used for communications between sys_select
3439 and reader_thread, which doesn't give sys_select a chance to
3440 notice that the process exited and invoke the SIGCHLD handler for
3443 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3445 * nsfns.m (Fns_do_applescript): Run event loop until script has
3446 been executed (Bug#12969).
3447 (ns_run_ascript): Chech as_script for nil, set to nil after
3450 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3452 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3454 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3456 * w32term.c (w32fullscreen_hook): New function.
3457 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3459 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3461 * fileio.c (Finsert_file_contents): Doc fix.
3463 * w32proc.c (new_child, delete_child, find_child_pid): For a
3464 subprocess, consider its slot being in use as long as its process
3465 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3466 slot when a new process is started immediately after killing
3467 another one, without waiting enough time for the first process to
3468 be reaped and resources allocated for it be orderly freed.
3470 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3472 2012-12-21 Chong Yidong <cyd@gnu.org>
3474 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3476 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3478 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3480 * w32.c (get_name_and_id): Always pass NULL as the first argument
3481 of lookup_account_sid. Avoids crashes with UNC file names that
3482 refer to DFS domains, not to specific machine names. (Bug#12621)
3483 Remove now unused argument FNAME; all callers changed.
3484 (get_file_owner_and_group): Remove now unused argument FNAME; all
3487 2012-12-21 Chong Yidong <cyd@gnu.org>
3489 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3490 error for invalid chars, don't check for a nil return value.
3492 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3494 Avoid calls to CHAR_TO_BYTE if byte position is known.
3495 * editfns.c (make_buffer_string_both): Use move_gap_both.
3496 (Fbuffer_string): Use make_buffer_string_both.
3497 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3499 (buf_bytepos_to_charpos): Likewise.
3500 (charpos_to_bytepos): Remove.
3501 * fileio.c (Finsert_file_contents): Use move_gap_both.
3502 * search.c (Freplace_match): Likewise.
3503 * process.c (process_send_region): Likewise. Use convenient
3504 names for byte positions.
3505 * lisp.h (charpos_to_bytepos): Remove prototype.
3506 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3507 * insdel.c (move_gap): Likewise.
3509 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3511 * xdisp.c (redisplay_internal): Remove now-unused local.
3513 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3515 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3516 (redisplay_internal): Don't bother selecting the frame to get the
3517 proper value of frame-local variables (bug#13225).
3519 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3521 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3522 Rename 4th argument since it may be buffer or string. Adjust comment.
3523 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3525 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3527 * coding.c (Fdetect_coding_region): Do not check start and end with
3528 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3529 (code_convert_region): Likewise.
3531 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3533 * w32.c (acl_get_file, acl_set_file): Run the file name through
3534 map_w32_filename, and resolve any symlinks in the file name, like
3536 (acl_set_file): Call revert_to_self, if any privileges were
3539 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3541 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3542 ($(BLD)/w32.$(O)): Update dependencies.
3544 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3546 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3547 propagate redisplay's scrolling (if any) to the right window.
3548 (redisplay_internal): Use ensure_selected_frame.
3549 (display_mode_lines): Complete last fix.
3550 * window.c (select_window_1): New func, extracted from select_window.
3551 (select_window): Use it.
3552 * window.h (select_window_1): Declare.
3554 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3556 Emulate Posix ACL APIs on MS-Windows.
3557 * w32.c: Include sddl.h and sys/acl.h.
3558 (SDDL_REVISION_1): Define if not already defined.
3559 (g_b_init_get_security_descriptor_dacl)
3560 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3561 (g_b_init_is_valid_security_descriptor)
3562 (g_b_init_set_file_security): New static flags.
3563 (globals_of_w32): Initialize them to zero.
3564 (SetFileSecurity_Name): New string constant.
3565 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3566 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3567 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3568 (IsValidSecurityDescriptor_Proc): New typedefs.
3569 (get_file_security, get_security_descriptor_owner)
3570 (get_security_descriptor_group): Set errno to ENOTSUP.
3571 (set_file_security, get_security_descriptor_dacl)
3572 (is_valid_security_descriptor, convert_sd_to_sddl)
3573 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3574 (acl_free, acl_get_file, acl_set_file): New functions.
3576 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3578 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3580 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3581 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3582 for some of that bug's symptoms can now cause Emacs to abort.
3583 Remove the workaround.
3584 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3585 The bug that caused SIGCHLD to get lost has been fixed, and the
3586 workaround for it can now cause Emacs to abort.
3588 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3590 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3591 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3592 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3594 2012-12-16 Romain Francoise <romain@orebokech.com>
3596 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3597 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3598 and copy ACL entries of file in addition to SELinux context if set.
3599 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3601 * Makefile.in (LIBACL_LIBS): New macro.
3604 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3606 * fileio.c (internal_delete_file): Use bool for boolean.
3608 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3610 Fix bug #13079 on MS-Windows with temp files not being deleted.
3611 * w32.h (_child_process): New members input_file and
3613 (register_child): First argument is now pid_t.
3614 (record_infile, record_pending_deletion): New prototypes.
3616 * w32proc.c (new_child): Initialize input_file and
3617 pending_deletion members of the child.
3618 (delete_child): Delete the child's temporary input file, if any,
3619 that is pending deletion.
3620 (register_child): First argument is now pid_t.
3621 (record_infile, record_pending_deletion): New functions.
3622 (reap_subprocess): Fix a typo in DebPrint string.
3623 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3625 * fileio.c (internal_delete_file): Return an int again: non-zero
3626 if delete-file succeeds, zero otherwise.
3628 * lisp.h (internal_delete_file): Adjust prototype.
3630 * callproc.c (Fcall_process): Don't overwrite infile with result
3632 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3633 asynchronous subprocess, record the name of the input file name,
3635 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3636 delete the file, record it as pending deletion when the subprocess
3639 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3641 * editfns.c [HAVE_PWD_H]: Include grp.h.
3643 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3645 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3647 Fix permissions bugs with setgid directories etc. (Bug#13125)
3648 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3649 to mark it as a placeholder. The old value was often wrong.
3650 The only user of this attribute has been changed to use
3651 file-ownership-preserved-p instead, with its new group arg.
3652 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3654 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3656 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3657 Keep selected_window and selected_frame in sync.
3659 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3661 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3662 try to get accurate owner and group information from NT file
3663 security APIs. This is to make most callers of 'stat' and
3664 'lstat', which don't need that information, much faster.
3666 * dired.c (Ffile_attributes) [WINDOWSNT]:
3667 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3668 owner and group information from 'lstat'.
3670 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3672 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3673 as that confuses set-auto-coding, so insist on the head-read
3674 returning the full 1024 bytes. Let lseek compute the tail offset;
3675 less work for us. Do not ignore I/O errors when reading the tail.
3677 * xdisp.c: Minor style fixes.
3678 (init_iterator): Hoist assignment out of if-expression.
3679 (markpos_of_region): Callers now test for sign, not for -1.
3681 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3683 Minor redisplay optimization when the region length is zero.
3684 * xdisp.c (markpos_of_region): New function.
3685 (init_iterator): Do not highlight the region of zero length.
3686 (redisplay_window): Check whether the region is of non-zero length.
3687 (try_cursor_movement): Allow if the region length is zero.
3688 (try_window_reusing_current_matrix, try_window_id): Likewise.
3690 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3692 * search.c (search_buffer): Check the inverse translations of each
3693 character in pattern when the buffer being searched is unibyte.
3696 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3698 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3699 files, fixing a regression from 24.2.
3700 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3702 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3704 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3705 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3706 Remove unnecessary S_ISLNK test, as (contra the comments) this
3707 function can't copy symlinks. Improve quality of error message
3708 when attempting to copy files that are neither regular files nor
3711 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3713 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3714 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3715 * window.c (Frecenter):
3716 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3717 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3719 2012-12-12 Daniel Colascione <dancol@dancol.org>
3721 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3722 the dumped Emacs is not a sparse file, greatly improving Cygwin
3723 "make bootstrap" performance.
3725 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3727 * inotify.c (inotify_callback): Generate an Emacs event for every
3728 incoming inotify event.
3730 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3732 * xdisp.c (handle_face_prop): Fix logic of computing
3733 it->start_of_box_run_p.
3734 (append_space_for_newline): If the glyph row is R2L, reset the
3735 iterator's end_of_box_run_p flag before prepending the space glyph.
3736 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3737 iterator's start_of_box_run_p flag before prepending the stretch.
3738 (append_glyph, produce_image_glyph, append_composite_glyph)
3739 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3740 left_box_line_p and right_box_line_p flags of the glyph for R2L
3741 glyph rows. (Bug#13011)
3743 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3745 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3746 if changed buffer is not shown in a window.
3747 * insdel.c (prepare_to_modify_buffer): Likewise.
3748 * window.c (replace_buffer_in_windows_safely): Do nothing
3749 if buffer is not shown in a window.
3750 (Fforce_window_update): Likewise if string or buffer argument
3753 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3755 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3756 encoded_file_name, which is what it is.
3758 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3760 Consistently use marker_position and marker_byte_position.
3761 * fringe.c (Ffringe_bitmaps_at_pos):
3762 * indent.c (Fvertical_motion):
3763 * insdel.c (prepare_to_modify_buffer):
3764 * keyboard.c (make_lispy_position):
3765 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3766 (window_scroll_pixel_based, displayed_window_lines)
3767 (Fset_window_configuration):
3768 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3769 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3770 Replace direct access to marker fields with calls
3771 to marker_position and/or marker_byte_position.
3773 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3775 * makefile.w32-in (SIG2STR_H): New macro.
3776 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3777 ($(BLD)/w32notify.$(O)): Update dependencies.
3779 2012-12-10 Daniel Colascione <dancol@dancol.org>
3781 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3782 Windows file notification functionality unless WINDOWSNT.
3784 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3787 * w32fns.c (cache_system_info): Initialize the global hinst
3788 variable here so various initialization calls DTRT.
3790 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3791 (hinst): Remove unneeded extern declaration.
3792 (_start): Remove initialization of above variables; remove
3793 initialization of hinst, as cache_system_info now does that.
3795 * emacs.c (main): Call cache_system_info early in startup; we
3796 previously weren't calling it in Cygwin builds.
3798 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3799 Teach the autoconf build system how to compile a Windows resource file
3800 and link it to Emacs.
3802 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3804 Per-buffer window counters.
3805 * buffer.h (struct buffer): New member window_count.
3806 (buffer_window_count): New function.
3807 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3808 Initialize window_count.
3809 (Fkill_buffer): Verify window_count for the buffer being killed.
3810 (modify_overlay): Do not force redisplay if buffer is not shown
3812 (init_buffer_once): Initialize window_count for buffer_defaults
3813 and buffer_local_symbols.
3814 * window.h (buffer_shared): Remove declaration.
3815 (wset_buffer): Convert from inline ...
3816 * window.c (wset_buffer): ... to an ordinary function.
3817 (adjust_window_count): New function.
3818 (make_parent_window): Use it.
3819 * xdisp.c (buffer_shared): Remove.
3820 (redisplay_internal, redisplay_window): Adjust users.
3821 (buffer_shared_and_changed): Use per-buffer window counter.
3823 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3825 Support for filesystem notifications on MS-Windows.
3826 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3827 and this is a TTY frame, signal the caller that keyboard input is
3830 * w32xfns.c (drain_message_queue): Now returns an int: an
3831 indication whether any WM_EMACS_FILENOTIFY messages were found in
3834 * w32inevt.c (handle_file_notifications): New function.
3835 (w32_console_read_socket): Call it to process file notifications.
3837 * w32console.c (initialize_w32_display): Record the main thread ID
3840 * deps.mk (inotify.o): New dependency list.
3842 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3844 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3845 (WM_EMACS_END): Bump value by 1.
3846 (notification_buffer_in_use, file_notifications)
3847 (notifications_size, notifications_desc): Declare.
3848 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3851 * w32term.c (lispy_file_action, queue_notifications): New functions.
3852 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3853 <Qrenamed_to>: New symbols.
3854 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3856 * w32notify.c: New file, implements file event notifications for
3859 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3860 by posting it to the w32_read_socket queue.
3862 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3864 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3865 (GLOBAL_SOURCES): Add w32notify.c
3866 ($(BLD)/w32notify.$(O)): New set of dependencies.
3868 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3870 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3871 Handle FILE_NOTIFY_EVENT.
3872 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3873 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3874 w32notify-handle-event by default.
3876 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3879 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3881 Support for filesystem notifications on GNU/Linux via inotify.
3882 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3884 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3886 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3887 (syms_of_keyboard): DEFSYM it.
3888 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3889 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3890 Qfile_inotify events.
3891 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3892 special-event-map to inotify-handle-event.
3894 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3896 * Makefile.in (base_obj): Add inotify.o.
3898 * inotify.c: New file.
3900 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3902 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3904 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3906 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3907 DWORD_PTR, for compatibility with 64-bit builds.
3909 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3910 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3911 (system_process_attributes): Use SIZE_T rather than DWORD, for
3912 compatibility with 64-bit builds.
3914 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3916 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3918 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3920 * indent.c (Fvertical_motion): If a display string will be
3921 displayed on the left or the right margin, don't consider it as a
3922 factor in cursor positioning. (Bug#13108)
3924 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3926 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3928 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3930 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3933 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3935 * w32.c (unsetenv): Return 0 if the input string is too long.
3937 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3939 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3940 * alloc.c (xputenv): New function.
3941 * dbusbind.c (Fdbus_init_bus):
3943 * xterm.c (x_term_init):
3944 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3945 * editfns.c (initial_tz): Move static var decl up.
3946 (tzvalbuf_in_environ): New static var.
3947 (init_editfns): Initialize these two static vars.
3948 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3949 Save old TZ value on stack, if it's small.
3950 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3951 instead, use xputenv+unsetenv to set and restore TZ.
3952 (environbuf): Remove static var. All uses removed.
3953 (Fset_time_zone_rule): Do not save TZ and environ;
3954 no longer needed here.
3955 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3956 Move to inside set_time_zone_rule; they don't need file scope any more.
3957 (set_time_zone_rule): Maintain the TZ=value string separately.
3958 (syms_of_editfns): Don't initialize initial_tz;
3959 init_editfns now does it.
3960 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3961 * lisp.h (xputenv): New decl.
3963 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3965 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3967 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3969 * w32.c (unsetenv, sys_putenv): New functions.
3971 2012-12-08 Chong Yidong <cyd@gnu.org>
3973 * editfns.c (Finsert_char): Make the error message more
3974 informative (Bug#12992).
3976 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3978 Simplify get_lim_data.
3979 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3980 Remove USG and vlimit methods; no longer used these days.
3981 Add #error catchall just in case.
3983 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3984 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3985 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3986 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3987 (deleted_pid_list, Fdelete_process, create_process)
3988 (record_child_status_change, handle_child_signal, deliver_child_signal)
3989 (init_process_emacs, syms_of_process):
3990 Assume SIGCHLD is defined.
3991 (parse_signal): Remove. All uses removed.
3992 (abbr_to_signal): New static function.
3993 (Fsignal_process): Use it to convert signal names to ints.
3994 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3995 kill (getpgrp (), ...).
3996 (emacs_sigaction_init): Assume SIGCHLD is defined.
3997 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3998 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3999 * syssignal.h (EMACS_KILLPG): Remove.
4000 All uses replaced by 'kill' with a negative pid.
4001 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
4002 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
4004 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
4006 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
4007 This will cause a production Emacs to dump core instead of
4010 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4012 * frame.c (make_frame): Do not set window's buffer to t.
4013 * window.c (Fsplit_window_internal): Likewise. Previously it was
4014 used to indicate that the window is being set up. Now we use
4015 set_window_buffer for all new windows, so the condition in ...
4016 (Fset_window_buffer): ... is always true and can be removed.
4018 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4020 Convenient macro to check whether the buffer is hidden.
4021 * buffer.h (BUFFER_HIDDEN_P): New macro.
4022 * frame.c (make_frame): Use it. Adjust comment.
4023 * buffer.c (candidate_buffer): New function.
4024 (Fother_buffer, other_buffer_safely): Use it.
4026 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4028 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4029 if the child process is still running. Instead, exit the wait
4030 loop and return zero. (Bug#13086)
4032 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4034 * frame.h (x_char_width, x_char_height): Remove prototypes.
4035 * w32term.h (x_char_width, x_char_height): Likewise.
4036 * xfns.c (x_char_width, x_char_height): Remove.
4037 * w32fns.c (x_char_width, x_char_height): Likewise.
4038 * nsfns.c (x_char_width, x_char_height): Likewise.
4039 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4041 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4042 * keyboard.c (command_loop_1): Remove prototype.
4043 (command_loop_2, top_level_1): Add static to match prototype.
4045 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4047 Fix a recently-introduced delete-process race condition.
4048 * callproc.c, process.h (record_kill_process):
4049 New function, containing part of the old call_process_kill.
4050 (call_process_kill): Use it.
4051 This does not change call_process_kill's behavior.
4052 * process.c (Fdelete_process): Use record_kill_process to fix a
4053 race condition that could cause Emacs to lose track of a child.
4055 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4057 Avoid code duplication between prev_frame and next_frame.
4058 * frame.c (candidate_frame): New function. Add comment.
4059 (prev_frame, next_frame): Use it. Adjust comment.
4061 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4063 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4064 fails, signal an error instead of continuing with an empty
4066 Encode expanded temp file pattern before passing it to mkstemp or
4069 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4070 Encode the file name before passing it to dostounix_filename, in
4071 case it will downcase it (under w32-downcase-file-names).
4074 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4076 Minor call-process cleanups.
4077 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4078 at the same time as other platforms, to simplify analysis.
4079 No need for fd0_volatile since we have synch_process_fd.
4080 Avoid needless emacs_close; arg is always negative.
4082 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4084 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4087 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4089 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4090 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4091 and mouse_face_hidden members to a bitfields.
4092 * frame.h (struct frame): Remove set-but-not-used space_width member.
4093 (FRAME_SPACE_WIDTH): Remove.
4094 * nsterm.m, w32term.c, xterm.c: Adjust users.
4095 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4096 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4097 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4098 members to a bitfields.
4100 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4102 Don't let call-process be a zombie factory (Bug#12980).
4103 Fixing this bug required some cleanup of the signal-handling code.
4104 As a side effect, this change also fixes a longstanding rare race
4105 condition whereby Emacs could mistakenly kill unrelated processes,
4106 and it fixes a bug where a second C-g does not kill a recalcitrant
4107 synchronous process in GNU/Linux and similar platforms.
4108 The patch should also fix the last vestiges of Bug#9488,
4109 a bug which has mostly been fixed on the trunk by other changes.
4110 * callproc.c, process.h (synch_process_alive, synch_process_death)
4111 (synch_process_termsig, sync_process_retcode):
4112 Remove. All uses removed, to simplify analysis and so that
4113 less consing is done inside critical sections.
4114 * callproc.c (call_process_exited): Remove. All uses replaced
4115 with !synch_process_pid.
4116 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4117 These take the role of what used to be in unwind-protect arg.
4119 (block_child_signal, unblock_child_signal):
4120 New functions, to avoid races that could kill innocent-victim processes.
4121 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4122 (call_process_kill): Record killed processes as deleted, so that
4123 zombies do not clutter up the system. Do this inside a critical
4124 section, to avoid a race that would allow the clutter.
4125 (call_process_cleanup): Fix code so that the second C-g works again
4126 on common platforms such as GNU/Linux.
4127 (Fcall_process): Create the child process in a critical section,
4128 to fix a race condition. If creating an asynchronous process,
4129 record it as deleted so that zombies do not clutter up the system.
4130 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4131 light of these changes. Omit unnecessary call to emacs_close
4132 before failure, as the unwind-protect code does that.
4133 * callproc.c (call_process_cleanup):
4134 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4135 * process.c (record_deleted_pid): New function, containing
4136 code refactored out of Fdelete_process.
4137 (Fdelete_process): Use it.
4138 (process_status_retrieved): Remove. All callers changed to use
4139 child_status_change.
4140 (record_child_status_change): Remove, folding its contents into ...
4141 (handle_child_signal): ... this signal handler. Now, this
4142 function is purely a handler for SIGCHLD, and is not called after
4143 a synchronous waitpid returns; the synchronous code is moved to
4144 wait_for_termination. There is no need to worry about reaping
4145 more than one child now.
4146 * sysdep.c (get_child_status, child_status_changed): New functions.
4147 (wait_for_termination): Now takes int * status and bool
4148 interruptible arguments, too. Do not record child status change;
4149 that's now the caller's responsibility. All callers changed.
4150 Reimplement in terms of get_child_status.
4151 (wait_for_termination_1, interruptible_wait_for_termination):
4152 Remove. All callers changed to use wait_for_termination.
4153 * syswait.h: Include <stdbool.h>, for bool.
4154 (record_child_status_change, interruptible_wait_for_termination):
4156 (record_deleted_pid, child_status_changed): New decls.
4157 (wait_for_termination): Adjust to API changes noted above.
4159 * bytecode.c, lisp.h (Qbytecode): Remove.
4160 No longer needed after 2012-11-20 interactive-p changes.
4162 2012-12-03 Eli Zaretskii <eliz@gnu.org>
4164 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4165 the scroll margin, move point outside the margin. (Bug#13055)
4167 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4169 * gtkutil.c (my_log_handler): New function.
4170 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4172 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4174 * lisp.h (modify_region): Rename to...
4175 (modify_region_1): ...new prototype.
4176 * textprop.c (modify_region): Now static. Adjust users.
4177 * insdel.c (modify_region): Rename to...
4178 (modify_region_1): ...new function to work with current buffer.
4179 Adjust comment and users. Use true and false for booleans.
4181 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4183 * alloc.c (free_save_value): New function.
4184 (safe_alloca_unwind): Use it.
4185 * lisp.h (free_save_value): New prototype.
4186 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4188 (save_excursion_restore): Adjust to match saved data structure.
4189 Use free_save_value to offload some work from GC. Drop obsolete
4192 2012-12-03 Chong Yidong <cyd@gnu.org>
4194 * fileio.c (Vauto_save_list_file_name): Doc fix.
4196 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4198 * w32fns.c: Remove prototype of atof.
4199 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4201 (file_dialog_callback): Make it UINT_PTR.
4203 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4206 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4207 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4210 2012-12-03 Glenn Morris <rgm@gnu.org>
4212 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4214 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4216 Fix xpalloc confusion after memory is exhausted.
4217 * alloc.c (xpalloc): Comment fix.
4218 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4219 and signals an error, do not clear charset_table_size, as
4220 charset_table is still valid.
4221 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4223 Use execve to avoid need to munge environ (Bug#13054).
4224 * callproc.c (Fcall_process):
4225 * process.c (create_process):
4226 Don't save and restore environ; no longer needed.
4227 * callproc.c (child_setup):
4228 Use execve, not execvp, to preserve environ.
4230 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4232 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4234 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4236 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4237 display for sliced images (Bug#10500).
4239 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4241 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4243 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4244 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4246 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4248 * xdisp.c (window_outdated): Remove eassert since it hits
4249 some suspicious corner cases (see Bug#13007 and Bug#13012).
4250 (mode_line_update_needed): New function.
4251 (redisplay_internal, redisplay_window): Use it.
4252 (ensure_selected_frame): New function.
4253 (redisplay_internal, unwind_redisplay): Use it.
4254 (redisplay_internal): Move comment about buffer_shared...
4255 (buffer_shared_and_changed): ...near to its real use.
4257 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4259 * callproc.c (Fcall_process): Don't misreport vfork failure.
4261 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4263 * callproc.c (Fcall_process): Fix vfork portability problems.
4264 Do not assume that fd[0], count, filefd, and save_environ survive
4265 vfork. Fix bug whereby wrong errno value could be reported for
4266 pipe failure. Some minor cleanups, too, as follows. Move buf and
4267 bufsize to the context where they're needed. Change new_argv to
4268 be of type char **, as this is more convenient and avoids casts.
4269 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4270 Now local constants, not macros.
4272 2012-11-18 Kenichi Handa <handa@gnu.org>
4274 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4275 for the variable "f".
4277 2012-11-13 Kenichi Handa <handa@gnu.org>
4279 * font.c (font_unparse_xlfd): Exclude special characters from the
4280 generating XLFD name.
4282 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4284 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4285 * dired.c (stat_uname, stat_gname):
4286 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4288 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4289 * dired.c (directory_files_internal, file_name_completion):
4290 Assume EAGAIN and EINTR are defined.
4292 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4293 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4294 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4295 * lread.c (readbyte_from_file): Assume EINTR is defined.
4296 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4297 Assume EIO and EAGAIN are defined.
4298 * unexcoff.c (write_segment): Assume EFAULT is defined.
4300 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4302 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4305 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4306 highlighting on the frame was cleared. Prevents assertion
4307 violations when repeatedly clicking on the "Top" link of the
4308 "bread-crumbs" in Info buffers.
4310 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4312 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4314 2012-11-24 Ken Brown <kbrown@cornell.edu>
4316 * keyboard.c (HAVE_MOUSE):
4317 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4318 were always defined.
4320 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4322 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4323 between bpos_covered and bpos_max. This fixes cursor display when
4324 several display strings follow each other.
4326 * .gdbinit (pgx): If the glyph's object is a string, display the
4327 pointer to string data, rather than the value of the string object
4328 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4330 * indent.c (Fvertical_motion): If the starting position is covered
4331 by a display string, return to one position before that, to avoid
4332 overshooting it inside move_it_to. (Bug#12930)
4334 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4336 * frame.h (struct frame): Remove display_preempted member
4337 since all users are dead long ago.
4338 * nsterm.h (struct x_output): Use the only dummy member.
4339 * w32menu.c (pending_menu_activation): Remove since not
4341 (set_frame_menubar): Adjust user.
4342 * w32term.h (struct x_output): Drop outdated #if 0 code.
4343 (struct w32_output): Use bitfields for explicit_parent,
4344 asked_for_visible and menubar_active members.
4345 Drop unused pending_menu_activation member.
4346 * xterm.h (struct x_output): Drop outdated #if 0 code.
4347 Use bitfields for explicit_parent, asked_for_visible,
4348 has_been_visible and net_wm_state_hidden_seen members.
4350 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4352 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4353 of a literal "/". (Bug#12955)
4354 (gl-stamp): Invoke fc.exe directly, not through cmd.
4356 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4358 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4359 * dired.c: Assume HAVE_DIRENT_H.
4360 (NAMLEN): Remove, replacing with ...
4361 (dirent_namelen): New function. All uses changed. Use the GNU macro
4362 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4363 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4364 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4365 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4367 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4368 * ndir.h: Rename to ../nt/inc/dirent.h.
4369 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4370 Do not include <dirent.h>; no longer needed.
4371 * w32.c: Include <dirent.h> rather than "ndir.h".
4373 2012-11-23 Chong Yidong <cyd@gnu.org>
4375 * xftfont.c (xftfont_open): Remove duplicate assignment.
4377 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4379 * alloc.c (Fgarbage_collect): Unblock input after clearing
4380 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4381 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4382 * msdos.c (IT_frame_up_to_date): Use it here...
4383 * w32term.c (w32_frame_up_to_date): ...here...
4384 * xterm.c (XTframe_up_to_date): ...and here...
4385 * nsterm.m (ns_frame_up_to_date): ...but not here.
4386 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4388 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4389 Do not check whether GC is in progress.
4391 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4393 * xdisp.c (window_buffer_changed): New function.
4394 (update_menu_bar, update_tool_bar): Use it to
4395 simplify large 'if' statements.
4396 (redisplay_internal): Generalize commonly used
4397 'tail' and 'frame' local variables.
4399 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4401 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4402 with Windows system header.
4404 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4406 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4407 * alloc.c: Assume unistd.h exists.
4408 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4409 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4410 (getwd) [USG]: Remove; no longer needed.
4411 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4412 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4413 * w32.h (getcwd): Remove decl.
4415 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4417 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4418 Make it set selected_window as well.
4419 (update_tool_bar): Use it.
4421 2012-11-21 Ken Brown <kbrown@cornell.edu>
4423 * emacs.c (main): Set the G_SLICE environment variable for all
4424 Cygwin builds, not just GTK builds. See
4425 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4427 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4429 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4430 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4431 Define for the MSVC compiler.
4433 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4435 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4436 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4437 dostounix_filename. Prevents crashes down the road, because
4438 dostounix_filename assumes it gets a unibyte string.
4439 Reported by Michel de Ruiter <michel@sentient.nl>, see
4440 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4442 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4444 Conflate Qnil and Qunbound for `symbol-function'.
4445 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4446 * lread.c (init_obarray): Set `function' fields to Qnil.
4447 * eval.c (Fcommandp): Ignore Qunbound.
4448 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4449 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4450 Test NILP rather than Qunbound.
4451 (Ffmakunbound): Set to Qnil.
4452 (Fsymbol_function): Never signal an error.
4453 (Finteractive_form): Ignore Qunbound.
4455 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4457 * eval.c (interactive_p): Remove no-longer-used decl.
4459 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4461 * xdisp.c (buffer_shared): Adjust comment.
4462 (buffer_shared_and_changed): New function.
4463 (prepare_menu_bars, redisplay_internal): Use it to
4464 decide whether all windows or frames should be updated.
4465 (window_outdated): New function.
4466 (text_outside_line_unchanged_p, redisplay_window): Use it.
4467 (redisplay_internal): Likewise. Fix indentation.
4469 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4471 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4472 (syms_of_eval): Remove corresponding defsubr.
4473 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4475 2012-11-19 Daniel Colascione <dancol@dancol.org>
4477 * w32fns.c (Fx_file_dialog):
4478 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4479 cygwin_convert_file_name*.
4481 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4482 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4484 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4486 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4488 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4490 * w32select.c: Include w32common.h before w32term.h, so that
4491 windows.h gets included before w32term.h uses some of its
4492 features, see below.
4494 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4496 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4498 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4500 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4502 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4503 (ns_select): Return at once if events are held (Bug#12834).
4505 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4507 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4508 Needed following 2012-10-20 change. (Bug#12902)
4510 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4512 * w32proc.c (waitpid): Remove unused label get_result.
4514 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4516 * makefile.w32-in (SYSWAIT_H): New macro.
4517 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4518 ($(BLD)/sysdep.$(O)): Update dependencies.
4520 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4522 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4523 * callproc.c (relocate_fd): Assume F_DUPFD.
4524 * emacs.c, term.c (O_RDWR): Remove.
4525 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4526 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4527 * nsterm.m: Assume <fcntl.h> exists.
4528 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4529 (create_pty, Fmake_network_process, server_accept_connection)
4530 (wait_reading_process_output, init_process_emacs):
4532 (wait_reading_process_output): Put in a special case for WINDOWSNT
4533 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4534 It's not clear this is needed, but it's a more-conservative change.
4535 (create_process): Assume FD_CLOEXEC.
4536 (create_process, create_pty): Assume O_NOCTTY.
4537 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4538 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4539 Omit if not DOS_NT, since F_GETFL is not defined there.
4540 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4541 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4543 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4544 lack it, since gnulib guarantees this.
4545 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4547 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4549 * w32.c (faccessat): Pretend that directories have the execute bit
4550 set. Emacs expects that, e.g., in files.el:cd-absolute.
4552 * w32proc.c (create_child): Don't clip the PID of the child
4553 process to fit into an Emacs integer, as this is no longer a
4555 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4556 reaping only the process specified by PID argument, if that is
4557 positive. Use PID instead of dead_child to know which process to
4558 reap. Wait for the child to die only if WNOHANG is not in
4560 (sys_select): Don't set dead_child.
4562 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4563 as it is no longer needed.
4565 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4567 (record_child_status_change): Remove the setting of
4568 record_at_most_one_child for the !WNOHANG case.
4570 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4572 Fix problems in ns port found by static checking.
4573 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4574 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4575 not to process group.
4576 (ns_select): Use emacs_write, not write, as that's more robust
4577 in the presence of signals.
4578 (fd_handler:): Check for read errors.
4580 2012-11-16 Glenn Morris <rgm@gnu.org>
4582 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4584 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4586 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4588 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4590 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4591 use the same value of thread handle.
4592 (start_timer_thread): If the timer thread exited (due to error),
4593 clean up by closing the two handles it used. Duplicate the caller
4594 thread's handle here, so it gets duplicated only once, when
4595 launching the timer thread. Set priority of the timer thread, not
4597 (getitimer): Don't duplicate the caller thread's handle here.
4600 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4602 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4605 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4607 Remove no-longer-used pty_max_bytes variable.
4608 * process.c (pty_max_bytes): Remove; unused.
4609 (send_process): Do not set it.
4611 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4613 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4614 Update dependencies.
4616 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4618 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4619 This follows up on the 2012-09-29 patch that removed indirection
4620 for the 'function' field. Reported by Sergey Vinokurov in
4621 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4623 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4625 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4626 different name, as the MS runtime does not have such a function,
4627 and probably never will.) All callers changed. Ignore DIRFD
4628 value if PATH is an absolute file name, to match Posix spec
4629 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4632 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4634 * xdisp.c (echo_area_display, redisplay_internal):
4635 Omit redundant check whether frame_garbaged is set.
4637 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4639 Use faccessat, not access, when checking file permissions (Bug#12632).
4640 This fixes a bug that has been present in Emacs since its creation.
4641 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4642 which must set some sort of record. (Torek's bug report was against
4643 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4644 same common flaw.) See Torek's Usenet posting
4645 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4646 Posted: Fri Apr 8 14:18:56 1983.
4647 * Makefile.in (LIB_EACCESS): New macro.
4649 * callproc.c (init_callproc):
4650 * charset.c (init_charset):
4651 * fileio.c (check_existing, check_executable, check_writable)
4653 * lread.c (openp, load_path_check):
4654 * process.c (allocate_pty):
4656 Use effective UID when checking permissions, not real UID.
4657 * callproc.c (init_callproc):
4658 * charset.c (init_charset):
4659 * lread.c (load_path_check, init_lread):
4660 Test whether directories are accessible, not merely whether they exist.
4661 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4662 * fileio.c (check_existing, check_executable, check_writable)
4664 Use symbolic names instead of integers for the flags, as they're
4666 (check_writable): New arg AMODE. All uses changed.
4667 Set errno on failure.
4668 (Ffile_readable_p): Use faccessat, not stat + open + close.
4669 (Ffile_writable_p): No need to call check_existing + check_writable.
4670 Just call check_writable and then look at errno. This saves a syscall.
4671 dir should never be nil; replace an unnecessary runtime check
4672 with an eassert. When checking the parent directory of a nonexistent
4673 file, check that the directory is searchable as well as writable, as
4674 we can't create files in unsearchable directories.
4675 (file_directory_p): New function, which uses 'stat' on most platforms
4676 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4677 (Ffile_directory_p, Fset_file_times): Use it.
4678 (file_accessible_directory_p): New function, which uses a single
4679 syscall for efficiency.
4680 (Ffile_accessible_directory_p): Use it.
4681 * xrdb.c (file_p): Use file_directory_p.
4682 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4683 * lread.c (openp): When opening a file, use fstat rather than
4684 stat, as that avoids a permissions race. When not opening a file,
4685 use file_directory_p rather than stat.
4686 (dir_warning): First arg is now a usage string, not a format.
4687 Use errno. All uses changed.
4688 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4689 that merely introduced a race.
4690 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4691 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4692 and similarly for the other O_* flags.
4693 * w32.c (sys_faccessat): Rename from sys_access and switch to
4694 faccessat's API. All uses changed.
4695 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4696 (magic_db): Rename from magic_file_p.
4697 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4698 char *, so that we don't have to test for file existence
4699 separately from opening the file for reading. This removes a race
4700 fixes a permission-checking problem, and simplifies the code.
4702 (file_p): Remove; no longer needed.
4704 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4706 Omit glyphs initialization at startup.
4707 * dispnew.c (glyphs_initialized_initially_p): Remove.
4708 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4709 (Fredraw_frame): Move actual code from here...
4710 (redraw_frame): ...to here. Add eassert. Adjust comment.
4711 (Fredraw_display): Use redraw_frame.
4712 * xdisp.c (clear_garbaged_frames): Likewise.
4714 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4716 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4717 passed to pint2str and pint2hrstr to be at most the size of the
4718 frame's decode_mode_spec_buffer. This avoids crashes with very
4719 large values of FIELD_WIDTH argument to decode_mode_spec.
4722 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4724 Fix a race with verify-visited-file-modtime (Bug#12863).
4725 Since at least 1991 Emacs has ignored an mtime difference of no
4726 more than one second, but my guess is that this was to work around
4727 file system bugs that were fixed long ago. Since the race is
4728 causing problems now, let's remove that code.
4729 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4730 whose time stamp is off by no more than a second. Insist that the
4731 file time stamps match exactly.
4733 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4735 * frame.h (struct frame): Convert external_tool_bar member to
4736 1-bit unsigned bitfield.
4737 * termhooks.h (struct terminal): Remove mouse_moved member since
4738 all users are long dead. Adjust comment on mouse_position_hook.
4740 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4742 Simplify by using FOR_EACH_FRAME here and there.
4743 * frame.c (next_frame, prev_frame, other_visible_frames)
4744 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4745 * w32term.c (x_window_to_scroll_bar): Likewise.
4746 * window.c (window_list): Likewise.
4747 * xdisp.c (x_consider_frame_title): Likewise.
4748 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4749 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4750 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4751 * xmenu.c (menubar_id_to_frame): Likewise.
4752 * xselect.c (frame_for_x_selection): Likewise.
4753 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4754 (x_window_to_menu_bar): Likewise.
4755 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4757 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4759 * data.c (Qdefalias_fset_function): Now static.
4761 Another tweak to vectorlike_header change.
4762 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4763 Remove, and replace all uses with ...
4764 (next_in_free_list, set_next_in_free_list):
4765 New functions, which respect C's aliasing rules better.
4767 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4769 * window.c (list4i): Rename from 'quad'. All uses changed.
4770 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4772 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4774 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4775 warning about mixing declarations and code in ISO C90.
4777 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4779 * window.c (Fsplit_window_internal): Set combination limit of
4780 new parent window to t iff Vwindow_combination_limit is t;
4781 fixing a regression introduced with the change from 2012-09-22.
4782 (Fset_window_combination_limit): Fix doc-string.
4784 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4786 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4787 amount when the scroll margins are too large. When scrolling
4788 backwards in the buffer, give up if cannot reach point or the
4789 scroll margin within a reasonable number of screen lines.
4790 Fixes point position in window under scroll-up/down-aggressively when
4791 point is positioned many lines beyond the window top/bottom.
4794 * ralloc.c (relinquish): If real_morecore fails to return memory
4795 to the system, don't crash; instead, leave the last heap
4796 unchanged and return. (Bug#12774)
4798 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4800 * lisp.h (AUTOLOADP): New macro.
4801 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4802 * data.c (Ffset): Remove special ad-advice-info handling.
4803 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4805 (Finteractive_form): Simplify.
4806 (Fquo): Don't insist on having at least 2 arguments.
4807 (Qdefalias_fset_function): New var.
4809 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4811 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4813 * nsfont.m (Qcondensed, Qexpanded): New variables.
4814 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4815 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4817 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4819 Fix recently introduced crash on MS-Windows (Bug#12839).
4820 * w32term.h (struct scroll_bar): Use convenient header.
4821 (SCROLL_BAR_VEC_SIZE): Remove.
4822 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4824 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4826 Tweak last vectorlike_header change.
4827 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4828 vectorlike object on the free list. This is introduced to avoid
4829 some (but not all) pointer casting and aliasing problems, see
4830 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4831 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4833 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4835 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4837 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4838 been removed, so remove them here also.
4840 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4842 * doc.c (Fdocumentation): Handle new property
4843 dynamic-docstring-function to replace the old ad-advice-info.
4845 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4847 * fns.c (Qeql, hashtest_eq): Now static.
4849 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4851 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4852 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4853 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4854 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4856 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4858 Use same hash function for hashfn_profiler as for hash_string etc.
4859 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4860 * lisp.h (sxhash_combine): New inline function, with the contents
4861 of the old SXHASH_COMBINE.
4862 * profiler.c (hashfn_profiler): Use it, instead of having a
4863 special hash function containing a comparison that always yields 1.
4865 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4867 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4868 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4869 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4872 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4874 * image.c (xpm_make_color_table_h): Fix compiler error because
4875 make_hash_table changed.
4877 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4879 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4881 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4883 Use ad-hoc comparison function for the profiler's hash-tables.
4884 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4885 (make_log): Use them.
4886 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4887 call Fequal any more.
4888 (Ffunction_equal): New function.
4889 (cmpfn_profiler, hashfn_profiler): New functions.
4890 (syms_of_profiler): Initialize them.
4891 * lisp.h (struct hash_table_test): New struct.
4892 (struct Lisp_Hash_Table): Use it.
4893 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4894 * fns.c (make_hash_table): Take a struct to describe the test.
4895 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4896 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4897 (hash_lookup, hash_remove_from_table): Move assertion checking of
4898 hashfn result here. Check hash-equality before calling cmpfn.
4899 (Fmake_hash_table): Adjust call to make_hash_table.
4900 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4901 (syms_of_fns): Initialize them.
4902 * emacs.c (main): Move syms_of_fns earlier.
4903 * xterm.c (syms_of_xterm):
4904 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4905 * print.c (print_object): Adjust to new hash-table struct.
4906 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4908 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4910 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4911 value of w32-scroll-lock-modifier is neither nil nor one of the
4912 known key modifiers. (Bug#12806)
4914 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4916 Shrink struct vectorlike_header to the only size field.
4917 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4919 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4920 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4921 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4922 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4923 information from the vector header. Adjust comment.
4924 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4925 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4927 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4928 (struct vectorlike_header): Remove next member. Adjust comment.
4929 (struct Lisp_Subr): Add convenient header. Adjust comment.
4930 (allocate_pseudovector): Adjust prototype.
4931 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4932 (sweep_string, lisp_malloc): Remove useless prototypes.
4933 (enum mem_type): Adjust comment.
4934 (NEXT_IN_FREE_LIST): New macro.
4935 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4936 (Fmake_bool_vector): Likewise.
4937 (struct large_vector): New type to represent allocation unit for
4938 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4939 (large_vectors): Change type to struct large_vector.
4940 (allocate_vector_from_block): Simplify.
4941 (PSEUDOVECTOR_NBYTES): Replace with...
4942 (vector_nbytes): ...new function. Adjust users.
4943 (sweep_vectors): Adjust processing of large vectors.
4944 (allocate_vectorlike): Likewise.
4945 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4946 Add easserts. Adjust XSETPVECTYPESIZE usage.
4947 (allocate_buffer): Use BUFFER_PVEC_INIT.
4948 (live_vector_p): Adjust to match large vector.
4949 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4950 * buffer.h (struct buffer): Add next member.
4951 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4953 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4954 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4955 (copy_hash_table): Adjust to match vector header change.
4956 * lread.c (defsubr): Use XSETPVECTYPE.
4957 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4958 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4959 (xvecsize): New command.
4961 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4963 * keyboard.c (event_to_kboard): Do not dereference
4964 frame_or_window field of SELECTION_REQUEST_EVENT
4965 and SELECTION_CLEAR_EVENT events (Bug#12814).
4966 * xterm.h (struct selection_input_event): Adjust comment.
4968 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4970 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4971 such as Scroll Lock, if the respective keys are treated as
4972 function keys, not as modifiers. This avoids destroying non-ASCII
4973 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4975 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4977 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4979 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4981 Restore some duplicate definitions (Bug#12814).
4982 This undoes part of the 2012-11-03 changes. Some people build
4983 with plain -g rather than with -g3, and they need the duplicate
4984 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4985 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4986 Define as macros, as well as as enums or as constants.
4988 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4990 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4991 to keypad keys (Bug#12816).
4993 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4995 Minor adjustments of recently-changed frame functions.
4996 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4997 known to be a frame (we're in the FRAMEP branch).
4998 * lisp.h (Qframep): Remove decl. frame.h declares this.
4999 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
5000 since they're meant for Lisp fixnum values.
5002 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5004 * window.c (Fwindow_combination_limit): Revert to the only
5005 required argument and adjust docstring as suggested in
5006 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
5007 by Martin Rudalics <rudalics@gmx.at>.
5009 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5011 Widely used frame validity and checking functions.
5012 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
5013 * frame.c (decode_live_frame, decode_any_frame): New functions.
5014 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
5015 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
5016 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
5017 (Fframe_pointer_visible_p): Use decode_any_frame.
5018 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
5019 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
5020 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
5021 (Fframe_focus): Likewise. Allow zero number of arguments.
5023 (frame_buffer_list, frame_buffer_predicate): Remove.
5024 * lisp.h (frame_buffer_predicate): Remove prototype.
5025 * buffer.c (Fother_buffer): Use decode_any_frame.
5026 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5027 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5028 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5029 (Fclose_font, Ffont_info): Use decode_live_frame.
5030 * fontset.c (check_fontset_name): Likewise.
5031 * terminal.c (Fframe_terminal): Likewise.
5032 * w32fns.c (check_x_frame): Likewise.
5033 * window.c (Fminibuffer_window, Fwindow_at)
5034 (Fcurrent_window_configuration): Likewise.
5035 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5036 Likewise. Allow zero number of arguments. Adjust docstring.
5037 * dispnew.c (Fredraw_frame): Likewise.
5038 * xfaces.c (frame_or_selected_frame): Remove.
5039 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5040 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5041 (Fframe_face_alist): Use decode_live_frame.
5042 * xfns.c (check_x_frame): Likewise.
5044 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5046 * window.c (quad): New function.
5047 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5048 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5049 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5050 (Fwindow_line_height): Use it.
5051 (Fwindow_fringes): Use list3.
5052 (Fwindow_scroll_bars): Use list4.
5053 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5054 (Fwindow_combination_limit): Allow zero number of arguments.
5056 2012-11-05 Eli Zaretskii <eliz@gnu.org>
5058 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5060 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5061 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5062 file descriptor 2 for standard error. (Bug#12805)
5064 2012-11-05 Chong Yidong <cyd@gnu.org>
5066 * process.c (wait_reading_process_output): Revert previous change.
5068 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5070 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5071 This removes code that has been obsolete since around 1990.
5072 * callproc.c (Fcall_process):
5074 * process.c (create_process):
5075 * term.c (dissociate_if_controlling_tty):
5076 Assume setsid exists.
5077 * callproc.c (child_setup): Assume setpgid exists and behaves as
5078 per POSIX.1-1988 or later.
5079 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5080 * emacs.c (shut_down_emacs):
5081 * sysdep.c (sys_suspend, init_foreground_group):
5082 Assume getpgrp behaves as per POSIX.1-1998 or later.
5083 * msdos.c (setpgrp): Remove.
5084 (tcgetpgrp, setpgid, setsid): New functions.
5085 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5086 * term.c (no_controlling_tty): Remove; unused.
5087 * w32proc.c (setpgrp): Remove.
5088 (setsid, tcgetpgrp): New functions.
5090 Simplify by assuming __fpending.
5091 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5092 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5093 Do not assume that __fpending's result fits in int.
5095 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5097 Remove EMACS_OUTQSIZE+sleep hack.
5098 * dispnew.c (update_frame_1): Remove hack for terminals slower
5099 than 2400 bps, which throttled Emacs by having it sleep.
5100 This code hasn't worked since at least 2007, when the multi-tty stuff
5101 was added, and anyway those old terminals are long dead.
5102 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5103 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5105 Fix data-loss with --version (Bug#9574).
5106 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5107 as we can't assume that emacs_strerror is initialized, and strerror
5108 is good enough here.
5109 (main): Invoke atexit earlier, to catch earlier instances of
5110 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5112 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5114 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5115 (keyDown): Remap keypad keys to X11 virtual key codes.
5117 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5119 Fix data-loss with --batch (Bug#9574).
5120 * emacs.c: Include <close-stream.h>.
5121 (close_output_streams): New function.
5122 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5123 and handles errors appropriately.
5124 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5127 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5128 The symptom is a diagnostic "GLib-WARNING **: In call to
5129 g_spawn_sync(), exit status of a child process was requested but
5130 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5131 waitpid(), so exit status can't be returned." The diagnostic
5132 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5133 The real bug is a race condition between Emacs and glib: Emacs
5134 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5135 so that glib can't find it. Work around the bug by invoking
5136 waitpid only on subprocesses that Emacs itself creates.
5137 * process.c (create_process, record_child_status_change):
5138 Don't use special value -1 in pid field, as the caller now must
5139 know the pid rather than having the callee infer it.
5140 The inference was sometimes incorrect anyway, due to another race.
5141 (create_process): Set new 'alive' member if child is created.
5142 (process_status_retrieved): New function.
5143 (record_child_status_change): Use it.
5144 Accept negative 1st argument, which means to wait for the
5145 processes that Emacs already knows about. Move special-case code
5146 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5147 processes that have already been waited for, by testing and
5148 clearing new 'alive' member.
5149 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5150 now does this internally.
5151 (handle_child_signal): Let record_child_status_change do all
5152 the work, since we do not want to reap all exited child processes,
5153 only the child processes that Emacs itself created.
5154 * process.h (Lisp_Process): New boolean member 'alive'.
5156 Omit duplicate definitions no longer needed with gcc -g3.
5157 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5158 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5159 Define only as macros. There's no longer any need to also define
5160 these symbols as enums or as constants, since we now assume
5161 gcc -g3 when debugging.
5163 2012-11-03 Eli Zaretskii <eliz@gnu.org>
5165 * lisp.mk: Adjust comments to the fact that term/internal is now
5166 loaded from loadup.el.
5168 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5169 (msdos_fatal_signal): New function.
5170 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5173 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5174 for GCC versions before 4.
5175 (emacs_raise): Define to call msdos_fatal_signal.
5177 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5178 iterator when starting in the middle of a display or overlay
5181 2012-11-03 Chong Yidong <cyd@gnu.org>
5183 * process.c (wait_reading_process_output): Clean up the last
5186 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5188 * process.c (wait_reading_process_output): Avoid a race condition
5189 with SIGIO delivery (Bug#11536).
5191 2012-11-03 Chong Yidong <cyd@gnu.org>
5193 * buffer.c (cursor_type): Untabify docstring.
5195 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5197 * frame.h (struct frame): Drop can_have_scroll_bars member
5198 which is meaningless for a long time. Adjust comments.
5199 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5200 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5202 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5204 * window.c (decode_next_window_args): Update window arg after
5205 calling decode_live_window and so fix crash reported at
5206 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5207 by Juanma Barranquero <lekktu@gmail.com>.
5208 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5209 * font.c (Ffont_at): Likewise.
5211 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5213 * widget.c (resize_cb): New function.
5214 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5215 (EmacsFrameResize): Check if all is up to date before changing frame
5218 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5220 Implement backtrace output for fatal errors on MS-Windows.
5221 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5222 (BACKTRACE_LIMIT_MAX): New macro.
5223 (w32_backtrace): New function.
5224 (emacs_abort): Use w32_backtrace when the user chooses not to
5225 attach a debugger. Update the text of the abort dialog.
5227 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5229 Window-related stuff cleanup here and there.
5230 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5231 Use decode_any_window.
5232 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5233 * xdisp.c (Fformat_mode_line): Likewise.
5234 * font.c (Ffont_at): Use decode_live_window.
5235 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5236 * window.c (decode_next_window_args): Likewise.
5237 (decode_any_window): Remove static.
5238 * window.h (decode_any_window): Add prototype.
5239 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5240 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5243 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5245 Remove pad from struct input_event.
5246 * termhooks.h (struct input_event): Remove padding field.
5248 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5249 member is never cons for a long time. Adjust comment.
5250 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5251 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5252 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5253 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5255 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5257 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5259 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5261 Fix crash when using Emacs as commit editor for git (Bug#12697).
5262 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5263 and it is configured in conf_post.h.
5264 (Fcall_process): Don't invoke both setsid and setpgid; the former
5265 is enough, if it exists.
5266 * callproc.c (Fcall_process, child_setup):
5267 * process.c (create_process): Use setpgid.
5268 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5270 * dispnew.c (init_display): Initialize the foreground group
5271 if we are running a tty display.
5272 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5273 * lisp.h (init_foreground_group): New decl.
5274 * sysdep.c (inherited_pgroup): New static var.
5275 (init_foreground_group, tcsetpgrp_without_stopping)
5276 (narrow_foreground_group, widen_foreground_group): New functions.
5277 (init_sys_modes): Narrow foreground group.
5278 (reset_sys_modes): Widen foreground group.
5280 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5282 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5284 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5286 * minibuf.c (read_minibuf): Restore current buffer since
5287 choose_minibuf_frame calling Fset_frame_selected_window may
5288 change it (Bug#12766).
5290 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5292 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5294 2012-10-30 Kenichi Handa <handa@gnu.org>
5296 * font.c (Ffont_at): If WINDOW is specified and it is not
5297 displaying the current buffer, signal an error.
5299 2012-10-29 Daniel Colascione <dancol@dancol.org>
5301 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5302 In preparation for fixing bug#12739, move these functions from
5305 * coding.h, coding.c: ... to here, and compile them only when
5306 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5307 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5309 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5311 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5312 (timer_loop, getitimer, setitimer): Use it instead of
5313 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5315 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5318 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5320 * nsterm.m (NO_APPDEFINED_DATA): New define.
5321 (last_appdefined_event_data): New variable
5322 (last_appdefined_event): Remove.
5323 (ns_select): Initialize t from last_appdefined_event_data instead
5324 of [last_appdefined_event data1].
5325 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5326 remove last_appdefined_event (Bug#12698).
5328 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5330 * frame.c (x_set_font): Catch internal error.
5332 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5334 Avoid overflow in w32 implementation of interval timers.
5335 When possible, for ITIMER_PROF count only times the main thread
5337 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5338 'volatile ULONGLONG' types. All the other data which was
5339 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5340 (GetThreadTimes_Proc): New typedef.
5341 (w32_get_timer_time): New function, returns a suitable time value
5343 (timer_loop): Enter critical section when accessing ULONGLONG
5344 values of the itimer_data struct, as these accesses are no longer
5345 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5346 Remove unused variable.
5347 (init_timers): Initialize s_pfn_Get_Thread_Times.
5348 (start_timer_thread): Don't assign itimer->caller_thread here.
5349 (getitimer): Assign itimer->caller_thread here.
5350 (setitimer): Always call getitimer to get the value of ticks_now.
5351 (sys_spawnve): Avoid compiler warning about format mismatch.
5353 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5355 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5356 mouse movement events if the menu bar is active. This avoids
5357 producing a busy "hour-glass" cursor by Windows if the mouse
5358 pointer is positioned over a tooltip shown for some menu item.
5360 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5362 Don't assume process IDs fit in int.
5363 * emacs.c (shut_down_emacs) [!DOS_NT]:
5364 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5365 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5366 Use pid_t, not int, to store process IDs, as 'int'
5367 is not wide enough on a few platforms (e.g., AIX and IRIX).
5369 2012-10-23 Kenichi Handa <handa@gnu.org>
5371 The following change is to make face-font-rescale-alist work
5372 correctly for non-ASCII fonts.
5374 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5375 (font_open_for_lface): Handle Vface_font_rescale_alist.
5377 2012-10-23 Chong Yidong <cyd@gnu.org>
5379 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5381 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5383 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5385 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5387 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5390 2012-10-21 Glenn Morris <rgm@gnu.org>
5392 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5394 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5396 Port to OpenBSD 5.1.
5397 * frame.c (Fmouse_position, Fmouse_pixel_position):
5398 * xdisp.c (produce_stretch_glyph):
5399 Declare local vars only when they're needed.
5400 This is clearer and avoids a warning on OpenBSD about unused vars.
5401 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5402 This is safer, and avoids OpenBSD warnings about unused vars.
5403 * keyboard.c (record_menu_key): Remove unnecessary decl.
5404 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5405 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5406 as our definition clashes with OpenBSD's.
5407 * xfaces.c (load_face_colors, check_lface_attrs)
5408 (get_lface_attributes_no_remap, get_lface_attributes)
5409 (lface_fully_specified_p, x_supports_face_attributes_p)
5410 (tty_supports_face_attributes_p, face_fontset, realize_face)
5411 (realize_x_face, realize_tty_face):
5412 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5413 merely Lisp_Object *. This is more informative and avoids
5414 a warning on OpenBSD about accessing beyond an object's size.
5416 2012-10-20 Chong Yidong <cyd@gnu.org>
5418 * lread.c (Fload): Doc fix (Bug#12592).
5420 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5422 * font.c (Ffont_at): Fix previous change.
5424 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5426 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5427 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5430 * alloc.c (NSTATICS): Decrease to 0x800.
5432 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5434 * fns.c (Fnreverse): Include the problem element when signaling an
5437 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5439 * nsterm.m (ns_select): Check writefds before call to
5440 FD_ISSET (Bug#12668).
5442 2012-10-18 Daniel Colascione <dancol@dancol.org>
5444 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5445 (staticpro): If we run out of staticpro slots, die with an
5446 informative error instead of just calling emacs_abort.
5448 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5450 Fix two flaws reported by Dmitry Antipov.
5451 * window.c (Ftemp_output_buffer_show): Remove.
5452 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5453 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5455 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5457 * makefile.w32-in ($(BLD)/w32.$(O)):
5458 ($(BLD)/vm-limit.$(O)):
5460 ($(BLD)/unexw32.$(O)):
5461 ($(BLD)/fileio.$(O)):
5462 ($(BLD)/dispnew.$(O)): Update dependencies.
5464 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5467 * w32proc.c: Include ctype.h.
5469 * w32.h (init_environment, check_windows_init_file)
5470 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5471 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5472 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5473 (sys_link): Add prototypes.
5475 * w32.c: Include w32select.h.
5476 (sys_access, e_malloc, sys_select): Add prototypes.
5477 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5479 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5481 * unexw32.c: Include lisp.h and w32.h.
5483 * term.c [WINDOWSNT]: Include w32term.h.
5485 * process.c [WINDOWSNT]: Add prototype of sys_select.
5487 * fileio.c [WINDOWSNT]: Include w32.h.
5489 * dispnew.c [WINDOWSNT]: Include w32.h.
5491 * cygw32.c (Fcygwin_convert_path_to_windows)
5492 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5493 Lisp_Object values. (Bug#12661)
5495 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5496 to Lisp_Object. (Bug#12661)
5498 2012-10-17 Kenichi Handa <handa@gnu.org>
5500 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5503 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5505 * buffer.c (Fkill_buffer): When unchaining the marker,
5506 reset its buffer pointer to NULL (Bug#12652).
5508 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5510 Do not verify indirection counters of killed buffers (Bug#12579).
5511 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5512 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5514 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5516 * alloc.c (Fmake_byte_code): Fix typo in comment.
5517 * print.c (print_interval): Define as static to match prototype.
5518 * indent.c (disptab_matches_widthtab, recompute_width_table):
5521 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5523 * editfns.c (get_system_name): Remove.
5524 * lisp.h (get_system_name): Remove prototype.
5525 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5526 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5528 2012-10-15 Daniel Colascione <dancol@dancol.org>
5530 * dbusbind.c: Add comment explaining reason for previous change.
5532 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5534 * window.c (Fwindow_end): Rewrite check whether cached position
5535 can be used (Bug#12600).
5536 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5537 Set windows_or_buffers_changed.
5539 2012-10-15 Daniel Colascione <dancol@dancol.org>
5541 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5542 enabled by undefining the symbol "interface", which the platform
5543 headers define to something incompatible.
5545 2012-10-14 Daniel Colascione <dancol@dancol.org>
5547 * image.c (init_tiff_functions, init_imagemagick_functions)
5548 (init_svg_functions): Fix cygw32 build break by using these
5549 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5551 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5553 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5555 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5557 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5559 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5561 * coding.c (detect_coding): Set coding->id before calling
5564 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5566 * fileio.c: Formatting fixes.
5568 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5570 Fix some stat-related races.
5571 * fileio.c (Fwrite_region): Avoid race condition if a file is
5572 removed or renamed by some other process immediately after Emacs
5573 writes it but before Emacs stats it. Do not assume that stat (or
5575 * image.c (slurp_file): Resolve the file name with fopen + fstat
5576 rather than stat + fopen.
5577 (pbm_read_file) [0]: Remove unused code with stat race.
5578 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5579 Remove ineffective code with stat race.
5581 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5583 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5585 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5587 * nsterm.m (hold_event_q): New static variable.
5588 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5590 (hold_event): New function.
5591 (ns_read_socket): If hold_event_q have events, store them and
5593 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5594 is zero (Bug#12384).
5596 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5598 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5600 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5602 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5604 * fileio.c (check_existing): New function.
5605 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5606 instead of calling 'stat', when what's needed is to check whether
5607 a file exists. This avoids expensive system calls on MS-Windows.
5610 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5612 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5613 determine whether a file exists and is not a directory.
5615 * lisp.h (check_existing): Add prototype.
5617 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5619 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5621 2012-10-12 Glenn Morris <rgm@gnu.org>
5623 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5625 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5627 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5629 * eval.c (Fautoload): Remember previous autoload status in load-history.
5631 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5633 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5634 * lread.c (load_each_byte, new_backquote_flag, readchar)
5635 (read_filtered_event, lisp_file_lexically_bound_p)
5636 (safe_to_load_version, Fload, complete_filename_p, openp)
5637 (build_load_history, readevalloop, read_escape, read1)
5638 (string_to_number, read_vector, read_list):
5639 * macros.c (Fstart_kbd_macro):
5640 * marker.c (CONSIDER):
5641 * menu.c (parse_single_submenu, digest_single_submenu)
5642 (find_and_return_menu_selection, Fx_popup_menu):
5643 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5645 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5647 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5648 (xmenu_show, xdialog_show):
5649 Use bool for booleans.
5650 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5651 as it's not a predicate. All uses changed. Omit unnecessary
5654 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5656 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5657 (save_excursion_restore): Do not restore mark if it was not saved.
5659 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5661 * marker.c (cached_modiff): EMACS_INT, not int.
5663 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5664 instead of having a wrong decl.
5665 * nsmenu.m (waiting_for_input): Remove wrong decl.
5667 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5669 keyboard.c, keymap.c: Use bool for booleans.
5670 * dispnew.c (sit_for): Distinguish between 3-way display_option
5671 and boolean do_display.
5672 * keyboard.c (single_kboard, this_command_key_count_reset)
5673 (waiting_for_input, echoing, immediate_quit, input_pending)
5674 (interrupt_input, interrupts_deferred, pop_kboard)
5675 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5676 (command_loop_1, adjust_point_for_property)
5677 (safe_run_hooks_error, input_polling_used, read_char):
5678 (help_char_p, readable_events, kbd_buffer_events_waiting)
5679 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5680 (lucid_event_type_list_p, get_input_pending):
5681 (gobble_input, menu_separator_name_p, menu_bar_item)
5682 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5683 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5684 (keyremap_step, test_undefined, read_key_sequence)
5685 (detect_input_pending, detect_input_pending_ignore_squeezables)
5686 (detect_input_pending_run_timers, requeued_events_pending_p)
5687 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5688 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5689 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5690 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5691 (accessible_keymaps_1, Fkey_description, push_key_description):
5692 (shadow_lookup, struct where_is_internal_data)
5693 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5694 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5695 (describe_map, describe_vector):
5696 * menu.c (single_menu_item):
5697 * nsmenu.m (ns_update_menubar):
5698 * process.c (wait_reading_process_output):
5699 * search.c (scan_buffer, scan_newline):
5700 Use bool for boolean.
5701 * keyboard.c (timers_run, swallow_events)
5702 (detect_input_pending_run_timers):
5703 * process.c (wait_reading_process_output):
5704 Use unsigned for counter where wraparound-on-overflow is desired,
5705 since unsigned is guaranteed to have that behavior and signed is not.
5706 (read_char): Use ptrdiff_t for string length.
5707 (get_input_pending): Remove first argument, since it was always
5708 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5709 and behave as if it had that value. Return new value of
5710 input_pending. All callers changed.
5711 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5712 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5714 * keymap.c (push_key_description): Omit last arg, which was always 1.
5715 All callers changed.
5717 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5719 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5721 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5722 ($(BLD)/term.$(O)): Update dependencies.
5724 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5726 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5727 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5728 initializer for PVEC_NORMAL_VECTOR.
5730 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5732 Clean out old termopts cruft.
5733 * termopts.h (flow_control, meta_key): Remove unused decls.
5734 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5735 Don't include termopts.h.
5737 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5739 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5741 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5743 * commands.h (immediate_quit): Remove duplicate decl.
5745 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5747 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5749 (nsfont_open): Remove setting of Vfonts_in_cache.
5750 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5752 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5754 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5755 match what GetLastError returns. Explain why the function is
5758 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5759 'is_tooltip_frame', to avoid confusion with its global namesake.
5761 2012-10-08 Daniel Colascione <dancol@dancol.org>
5763 * xdisp.c (start_hourglass): Call w32_note_current_window when
5764 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5765 build that caused Emacs to display the hourglass cursor forever.
5767 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5768 which is broken under remote desktop, calculate the number of
5769 colors available for a display based on the display's number of
5770 planes and number of bits per pixel per plane. (bug#10397).
5772 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5774 * nsfont.m (Vfonts_in_cache): New variable.
5775 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5776 are used. Add cached fonts to Vfonts_in_cache.
5777 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5779 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5781 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5783 (FONT_H): Define after FRAME_H.
5784 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5785 Update dependencies.
5787 * w32term.c: Remove leftover declaration of keyboard_codepage.
5789 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5791 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5792 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5793 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5794 (GLOBAL_SOURCES): Add cygw32.c.
5795 ($(BLD)/unexw32.$(O)):
5797 ($(BLD)/w32console.$(O)):
5798 ($(BLD)/w32fns.$(O)):
5799 ($(BLD)/w32heap.$(O)):
5800 ($(BLD)/w32menu.$(O)):
5801 ($(BLD)/w32proc.$(O)): Add w32common.h.
5803 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5805 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5807 2012-10-08 Daniel Colascione <dancol@dancol.org>
5809 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5810 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5811 accidental message numbering hole. Change other messages to
5814 * w32select.h (HAVE_W32SELECT): Remove.
5816 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5817 w32common.h instead of w32heap.h.
5819 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5820 (get_allocation_unit, get_processor_type, get_w32_major_version)
5821 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5822 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5823 (OS_NT, os_subtype, cache_system_info): Move declarations to
5826 * w32heap.c: Include w32common.h.
5827 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5828 (w32_minor_version, w32_build_number, w32_subtype):
5829 Remove duplicate definitions.
5831 * w32fns.c: Include w32common.h; include w32heap.h only in
5834 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5835 Use `report_file_error' instead of `error' in order to better
5836 inform users of what went wrong. Increase NTGUI_UNICODE file
5837 dialog box file name length to 32k, the maximum allowed by the NT
5840 * w32common.h: New file.
5841 (ROUND_UP, ROUND_DOWN, get_page_size)
5842 (get_allocation_unit, get_processor_type, get_w32_major_version)
5843 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5844 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5845 (OS_NT, os_subtype, cache_system_info): Move here.
5847 * unexw32.c, unexcw.c: Include w32common.h.
5849 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5850 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5851 to call syms_of_w32select.
5853 * cygw32.h: Remove obsolete EXFUN declarations.
5855 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5857 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5858 of w32inevt.o from SOME_MACHINE_OBJECTS.
5860 2012-10-08 Daniel Colascione <dancol@dancol.org>
5862 * image.c: Permanent fix for JPEG compilation issue --- limit
5863 jpeglib `boolean' redefinition to Cygwin builds.
5865 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5867 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5869 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5872 2012-10-08 Daniel Colascione <dancol@dancol.org>
5874 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5875 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5876 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5877 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5878 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5879 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5880 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5881 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5882 now a supported configuration.
5884 * Makefile.in: consolidate image variables into LIBIMAGE; add
5885 W32_OBJ and W32_LIBS. Compile new files.
5888 (_DebPrint) declare tracing facility for W32 debugging. We need
5889 to unify tracing later.
5891 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5892 unconditional use of W32 Unicode functions. Cygwin runs only on
5893 100% Unicode operating systems.
5895 * cygw32.c: New file. Define Cygwin-specific facilities.
5896 (Fcygwin_convert_path_to_windows)
5897 (Fcygwin_convert_path_from_windows): New user functions for
5898 accessing Cygwin path-munging routines.
5900 * cygw32.h: New file.
5901 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5902 UTF-16LE strings temporarily inside non-Lisp-visible string
5905 (w32_strerror): Just what it says on the tin.
5907 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5908 also run for Cygwin; both systems have the same problem with using
5909 GUI facilities in a forked child. Also call syms_of_cygw32,
5910 syms_of_w32select in correct places.
5912 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5913 needs fork-then-exec for daemon launching.
5915 * font.h: Include frame.h.
5917 * image.c: Use the image library cache machinery only when we're
5918 compiling for native WINDOWSNT; Cygwin can use shared libraries
5919 like any other Unixlike system.
5921 * keyboard.c: Clarify a comment regarding the input loop.
5923 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5924 functions directly instead of trying to detect at runtime that our
5925 host operating system supports them. We make this change for two
5926 reasons: Cygwin lacks support for the multibyte character
5927 conversion functions used by the legacy menu code, and Cygwin
5928 never needs to rely on non-Unicode APIs.
5930 * unexw32.c (hinst): Declare extern.
5932 * w32.c: Change header order;
5933 (w32_strerror): Move to w32fns.c because we need it for
5934 non-WINDOWSNT builds.
5936 * w32.h: Add #error macro to make sure we don't include w32.h for
5937 Cygwin builds. Remove w32select declarations.
5939 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5940 w32fns.c. w32console.c is WINDOWSNT-only.
5942 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5943 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5945 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5946 (w32_major_version, w32_minor_version, w32_build_number)
5947 (os_subtype, sound_type): Define here
5948 (w32_defined_color): Make color parameter const for consistency
5949 with other _defined_color functions.
5950 (w32_createwindow): Unconditionally call w32_init_class instead of
5951 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5952 through the code is complex and unnecessary because class
5953 registration is practically free.
5954 (w32_name_of_message): New EMACSDEBUG-only function.
5955 (Fset_message_beep): Move here
5956 (Fx_open_connection): Require that the display name for Windows be
5957 "w32" for consistency, emacsclient disambiguation, and maybe, one
5958 day, multi-window-system support.
5959 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5960 Cygwin files for W32 GUI facilities, since these clearly don't
5961 expect Cygwin names.
5962 (_DebPrint): Define.
5963 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5964 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5965 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5966 (w32_last_error): Remove.
5968 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5970 * w32heap.c (syspage_mask): Declare here.
5971 (cache_system_info): Remove.
5973 * w32inevt.c (faked_key): Define globally, not statically.
5974 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5975 (w32_console_toggle_lock_key): Move to w32fns.c.
5977 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5979 * w32proc.c (_DebPrint): Move to w32fns.c.
5980 * w32select.c: Include string.h, stdio.h for Cygwin.
5981 * w32select.h: New File.
5983 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5985 (w32_message_fd): New variable. Under Cygwin, holds the file
5986 descriptor the system used to tell us about pending thread
5989 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5990 that prevented compilation under non-WINDOWSNT systems.
5992 (w32_initialize): Open /dev/windows and assign it to
5993 w32_message_fd. Provide w32 feature.
5995 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5996 (WM_EMACS_INPUT_READY): add.
5997 (prepend_msg, w32_message_fd): Declare globally.
6000 (keyboard_handle): Use only when WINDOWSNT.
6001 (notify_msg_ready): New function. Posts a message to the main
6002 thread's message queue under CYGWIN, which wakes up the main
6003 thread from select(2) by making the /dev/windows file descriptor
6004 ready. Under WINDOWSNT, it sets an event the same way the old
6007 (post, prepend_msg): Actually call notify_msg_ready instead of
6008 setting the input event directly.
6010 2012-10-07 Eli Zaretskii <eliz@gnu.org>
6012 * ralloc.c (relinquish): If a heap is ready to be relinquished,
6013 but it still has blocs in it, don't return it to the system,
6014 instead of aborting. (Bug#12402)
6016 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
6018 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
6020 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6021 MAC_OS_X_VERSION_10_6.
6022 (syms_of_nsterm): Remove comment about Panther and above for
6024 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6025 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6026 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6028 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6029 MAC_OS_X_VERSION_10_4.
6031 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6032 MAC_OS_X_VERSION_10_2.
6034 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6036 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6037 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6039 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6040 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6041 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6042 Remove ns_in_resize check.
6043 (ns_clear_frame_area): Remove resize handle code.
6045 * nsfns.m (ns_in_resize): Remove.
6046 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6047 Remove ns_in_resize check.
6049 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6051 Improve sys_siglist detection.
6052 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6053 defined as a macro, as is done in Solaris.
6054 (sys_siglist_entries): New macro.
6055 (save_strsignal): Use it.
6056 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6057 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6059 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6061 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6062 fullscreen/Fullscreen.
6064 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6065 tobar_height is new.
6067 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6068 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6069 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6070 (windowDidResize:): Check for correct window if old style fullscreen.
6071 Capitalize word in comment. Remove incorrect comment.
6072 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6073 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6074 error in drawing background.
6075 (toggleFullScreen:): Remove comment. Rearrange calls.
6076 Set toolbar values to zero, save old height in tobar_height.
6077 Restore tool bar height when leaving fullscreen.
6078 (canBecomeMainWindow): New function.
6080 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6082 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6084 2012-10-05 Eli Zaretskii <eliz@gnu.org>
6086 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6088 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6089 that time stamps of directories could also be changed.
6090 Don't request the too broad GENERIC_WRITE, only the more restrictive
6091 FILE_WRITE_ATTRIBUTES access rights.
6093 * fileio.c (Fset_file_times): Special-case ignoring errors for
6094 directories only on MSDOS, not on MS-Windows.
6096 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6098 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6100 2012-10-04 Eli Zaretskii <eliz@gnu.org>
6102 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6103 see whether CreateFile failed.
6105 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6107 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6108 to avoid similar races.
6109 * keyboard.c (pending_signals): Now bool, not int.
6111 Port timers to OpenBSD, plus check for timer failures.
6112 OpenBSD problem reported by Han Boetes.
6113 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6115 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6116 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6117 like OpenBSD, which has timer_settime but does not declare it.
6118 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6119 whether to use itimerspec-related primitives. All uses of
6120 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6122 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6124 * profiler.c (handle_profiler_signal): Fix a malloc race
6125 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6127 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6129 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6131 2012-10-02 Eli Zaretskii <eliz@gnu.org>
6133 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6134 consistent with the change in return value of 'safe_strsignal'.
6136 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6138 Prefer plain 'static' to 'static inline' (Bug#12541).
6139 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6140 (bidi_set_sor_type, bidi_push_embedding_level)
6141 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6142 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6143 (bidi_cache_search, bidi_cache_ensure_space)
6144 (bidi_cache_iterator_state, bidi_cache_find)
6145 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6146 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6147 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6148 Now 'static', not 'static inline'.
6150 Count overruns when profiling; change units to ns.
6151 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6152 Give extra weight to samples after overruns, to attempt to count
6153 the time more accurately.
6154 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6155 the underlying primitives nominally do ns.
6156 (Fprofiler_cpu_start): Document the change. Mention that
6157 the sampling intervals are only approximate.
6159 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6161 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6163 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6164 case for the special 0 coding-system.
6166 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6167 (Fmake_overlay): Remove redundant tests.
6168 (fix_start_end_in_overlays): Remove redundant recentering.
6170 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
6172 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6173 Update dependencies.
6175 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6177 Fix a malloc race condition involving strsignal.
6178 A signal can arrive in the middle of a malloc, and Emacs's signal
6179 handler can invoke strsignal, which can invoke malloc, which is
6180 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6181 Fix it by altering the signal handler so that it does not invoke
6183 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6184 * process.c (status_message): Use const pointer, in case strsignal
6185 is #defined to safe_strsignal.
6186 * sysdep.c (sys_siglist, init_signals): Always define and
6187 initialize a substitute sys_siglist if the system does not define
6188 one, even if HAVE_STRSIGNAL.
6189 (safe_strsignal): Rename from strsignal. Always define,
6190 using sys_siglist. Return a const pointer.
6191 * syssignal.h (safe_strsignal): New decl.
6192 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6194 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6196 * w32proc.c (timer_loop): Fix code that waits for timer
6197 expiration, to avoid high CPU usage.
6199 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6201 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6202 (sweep_weak_table): Remove redundant prototypes.
6204 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6206 * emacs.c: Move the inclusion of TERM_HEADER after including
6207 windows.h on WINDOWSNT. This avoids compilation problems with
6210 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6212 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6213 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6214 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6215 as the previous version used 'void *'.
6217 * ralloc.c (ROUNDUP): Fix last change.
6218 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6221 * w32proc.c <disable_itimers>: New static flag.
6222 (init_timers): Initialize it to zero, after creating the critical
6223 sections used by the timer threads.
6224 (term_timers): Set to 1 before deleting the critical sections.
6225 (getitimer, setitimer): If disable_itimers is non-zero, return an
6226 error indication without doing anything. Reported by Fabrice
6227 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6228 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6230 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6233 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6234 term_ntproc after all the other bookkeeping, to get timers working
6235 as long as possible.
6237 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6239 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6240 Suggested by Juri Linkov in
6241 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6243 Prefer plain 'static' to 'static inline' (Bug#12541).
6244 With static functions, modern compilers inline pretty well by
6245 themselves; advice from programmers often hurts as much as it helps.
6246 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6247 this change shrinks the text size of the Emacs executable by 1.1%
6248 without affecting CPU significantly in my benchmark.
6249 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6250 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6251 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6252 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6253 (bset_auto_fill_function, bset_auto_save_file_format)
6254 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6255 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6256 (bset_cache_long_line_scans, bset_case_fold_search)
6257 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6258 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6259 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6260 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6261 (bset_header_line_format, bset_indicate_buffer_boundaries)
6262 (bset_indicate_empty_lines, bset_invisibility_spec)
6263 (bset_left_fringe_width, bset_major_mode, bset_mark)
6264 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6265 (bset_name, bset_overwrite_mode, bset_pt_marker)
6266 (bset_right_fringe_width, bset_save_length)
6267 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6268 (bset_scroll_up_aggressively, bset_selective_display)
6269 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6270 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6271 (set_buffer_overlays_after):
6272 * category.c (bset_category_table):
6273 * charset.c (read_hex):
6274 * coding.c (produce_composition, produce_charset)
6275 (handle_composition_annotation, handle_charset_annotation)
6277 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6278 (assign_row, set_frame_matrix_frame, make_current)
6280 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6281 * fns.c (maybe_resize_hash_table):
6282 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6283 * gmalloc.c (register_heapinfo):
6284 * image.c (lookup_image_type):
6285 * intervals.c (set_interval_object, set_interval_left)
6286 (set_interval_right, copy_interval_parent, rotate_right)
6287 (rotate_left, balance_possible_root_interval):
6288 * keyboard.c (kset_echo_string, kset_kbd_queue)
6289 (kset_keyboard_translate_table, kset_last_prefix_arg)
6290 (kset_last_repeatable_command, kset_local_function_key_map)
6291 (kset_overriding_terminal_local_map, kset_real_last_command)
6292 (kset_system_key_syms, clear_event, set_prop):
6293 * lread.c (digit_to_number):
6294 * marker.c (attach_marker, live_buffer, set_marker_internal):
6295 * nsterm.m (ns_compute_glyph_string_overhangs):
6296 * process.c (pset_buffer, pset_command)
6297 (pset_decode_coding_system, pset_decoding_buf)
6298 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6299 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6300 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6301 * syntax.c (bset_syntax_table, dec_bytepos):
6302 * terminal.c (tset_param_alist):
6303 * textprop.c (interval_has_some_properties)
6304 (interval_has_some_properties_list):
6305 * window.c (wset_combination_limit, wset_dedicated)
6306 (wset_display_table, wset_hchild, wset_left_fringe_width)
6307 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6308 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6309 (wset_right_fringe_width, wset_right_margin_cols)
6310 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6311 (wset_vertical_scroll_bar_type, wset_window_parameters):
6312 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6313 (wset_column_number_displayed, wset_region_showing)
6314 (window_box_edges, run_window_scroll_functions)
6315 (append_glyph_string_lists, prepend_glyph_string_lists)
6316 (append_glyph_string, set_glyph_string_background_width)
6317 (append_glyph, append_composite_glyph)
6318 (take_vertical_position_into_account):
6319 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6320 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6321 (lface_hash, lface_same_font_attributes_p, lookup_face):
6322 * xml.c (libxml2_loaded_p):
6323 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6324 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6325 Now 'static', not 'static inline'.
6328 (bidi_copy_it): Do the whole copy with a single memcpy.
6329 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6331 Revert the FOLLOW-SYMLINKS change for file-attributes.
6332 Doing it right would require several changes to Tramp, and there's
6333 not enough time to get that tested before the freeze today.
6334 * dired.c (directory_files_internal, Ffile_attributes):
6337 * frame.c (x_report_frame_params): Port better to wider ints.
6338 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6339 or that pointers can be printed in 15 decimal digits.
6340 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6342 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6344 Support x64 build on MS-Windows.
6345 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6346 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6347 compatibility with x64.
6348 (x_get_focus_frame): Add prototype.
6350 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6351 defining an XRectangle structure.
6353 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6354 arithmetics for compatibility with x64.
6356 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6357 compatibility with x64.
6359 * w32heap.h: Adjust prototypes and declarations.
6361 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6362 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6363 DWORD, long, and unsigned long, for compatibility with x64.
6364 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6365 (sbrk): Argument is now of type ptrdiff_t.
6367 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6369 (w32_msg_pump): Use WPARAM type for 'result'.
6371 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6373 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6374 compatibility with x64.
6376 * vm-limit.c (lim_data): Now size_t.
6377 (check_memory_limits): Adjust prototypes of real_morecore and
6378 __morecore to receive argument of type ptrdiff_t. Use size_t for
6379 five_percent and data_size.
6381 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6382 variables, for compatibility with x64.
6383 (rva_to_section, offset_to_section, relocate_offset)
6384 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6385 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6386 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6387 for compatibility with x64.
6389 * sysdep.c (STDERR_FILENO): Define if not already defined.
6391 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6392 (__morecore): Argument type is now ptrdiff_t.
6393 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6394 (relinquish): Use ptrdiff_t type for 'excess'.
6395 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6397 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6398 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6399 instead of a literal number.
6401 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6402 (min): Define only if not already defined.
6404 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6405 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6408 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6409 'bitmaps' is a pointer.
6411 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6413 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6415 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6417 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6418 * dired.c (directory_files_internal, Ffile_attributes):
6419 New arg follow_symlinks. All uses changed.
6421 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6423 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6425 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6427 Support atimers and CPU profiler via profile.c on MS-Windows.
6428 * w32proc.c (sig_mask, crit_sig): New static variables.
6429 (sys_signal): Support SIGALRM and SIGPROF.
6430 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6431 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6432 sigfillset, and sigprocmask are no longer no-ops.
6433 (sigismember): New function.
6434 (struct itimer_data): New definition.
6435 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6436 (crit_prof): New static variables.
6437 (MAX_SINGLE_SLEEP): New definition.
6438 (timer_loop, stop_timer_thread, term_timers, init_timers)
6439 (start_timer_thread, getitimer, setitimer): New functions.
6440 (alarm): No longer a no-op, calls setitimer.
6442 * w32.c (term_ntproc): Call term_timers.
6443 (init_ntproc): Make sure all signals are unblocked at startup, to
6444 erase any traces of dumping. Call init_timers.
6446 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6447 Windows-specific code to display the hourglass mouse pointer is no
6449 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6450 to hourglass timer expiration.
6451 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6452 Remove, no longer used.
6453 (w32_note_current_window, show_hourglass, hide_hourglass):
6454 New functions, in support of hourglass cursor display similar to other
6456 (syms_of_w32fns): Don't initialize hourglass_timer.
6458 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6460 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6462 * w32.h (init_timers, term_timers): Add prototypes.
6464 2012-09-30 Kenichi Handa <handa@gnu.org>
6466 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6467 to the buffer relocation which may be caused by ccl_driver.
6469 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6471 * xfns.c (Fx_file_dialog): Update comment.
6473 * w32fns.c (Fx_file_dialog): Update comment.
6475 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6476 Initialize panel name field if OSX >= 10.6.
6478 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6480 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6482 * nsterm.m (NEW_STYLE_FS): New define.
6483 (ns_fullscreen_hook, windowWillEnterFullScreen)
6484 (windowDidEnterFullScreen, windowWillExitFullScreen)
6485 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6486 (setFSValue): New functions.
6487 (EmacsFSWindow): New implementation.
6488 (canBecomeKeyWindow): New function for EmacsFSWindow.
6489 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6490 (dealloc): Release nonfs_window if in fullscreen.
6491 (updateFrameSize:): Call windowDidMove to update top/left.
6492 (windowWillResize:toSize:): Check if frame is still maximized.
6493 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6494 next_maximized, maximized_width, maximized_height and nonfs_window.
6495 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6497 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6498 fullscreen. Set maximized_width/height. Act on next_maximized.
6500 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6501 (EmacsView): Add variables for fullscreen.
6502 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6503 (EmacsFSWindow): New interface for fullscreen.
6505 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6507 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6509 2012-09-30 Chong Yidong <cyd@gnu.org>
6511 * fns.c (Frandom): Doc fix.
6513 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6515 * window.c (Vwindow_combination_limit): New default value.
6516 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6518 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6520 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6521 Suggested by Eli Zaretskii in
6522 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6524 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6526 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6527 HAVE_TIMER_SETTIME is defined.
6529 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6531 Profiler improvements: more-accurate timers, overflow checks.
6532 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6533 signal.h, setjmp.h. Include systime.h instead.
6534 (saturated_add): New function.
6535 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6536 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6537 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6539 (enum profiler_cpu_running): New enum.
6540 (profiler_cpu_running): Now of that enum type, not bool.
6541 All uses changed to store the new value.
6542 (handle_profiler_signal): Rename from sigprof_handler_1,
6543 for consistency with other handlers. Do not check whether
6544 cpu_log is a hash-table if garbage collecting, since it
6545 doesn't matter in that case.
6546 (deliver_profiler_signal): Rename from sigprof_handler,
6547 for consistency with other handlers.
6548 (setup_cpu_timer): New function, with much of what used to be in
6549 Fprofiler_cpu_start. Check for out-of-range argument.
6550 Prefer timer_settime if available, and prefer
6551 thread cputime clocks, then process cputime clocks, then
6552 monotonic clocks, to the old realtime clock. Use make_timeval
6553 to round more-correctly when falling back to setitimer.
6554 (Fprofiler_cpu_start): Use it.
6555 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6556 Don't assume that passing NULL as the 2nd argument of setitimer
6557 is the same as passing a pointer to all-zero storage.
6558 Ignore SIGPROF afterwards.
6559 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6560 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6561 non-fatal signal handlers. Ignore SIGPROF on startup.
6562 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6563 in profiler.c, since sysdep.c now uses it.
6565 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6566 Suggested by Eli Zaretskii in
6567 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6569 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6571 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6573 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6575 * lisp.h (struct backtrace): Remove indirection for `function' field.
6576 * xdisp.c (redisplay_internal):
6577 * profiler.c (record_backtrace, sigprof_handler_1):
6578 * alloc.c (Fgarbage_collect):
6579 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6580 (Fbacktrace_frame): Adjust accordingly.
6582 2012-09-28 Glenn Morris <rgm@gnu.org>
6584 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6585 (Frun_hook_with_args_until_failure): Doc fixes.
6587 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6589 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6590 Qautomatic_redisplay and change the symbol name. All users changed.
6592 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6594 * profiler.c (sigprof_handler): Fix race condition.
6596 2012-09-28 Glenn Morris <rgm@gnu.org>
6598 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6600 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6602 Check more robustly for timer_settime.
6603 * Makefile.in (LIB_TIMER_TIME): New macro.
6605 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6606 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6609 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6611 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6613 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6615 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6617 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6619 * character.h (MAYBE_UNIFY_CHAR): Remove.
6620 * charset.c, charset.h (maybe_unify_char): Now static.
6621 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6622 Since this stuff is now private to charset.c, there's no need for
6623 a public macro and no need to inline by hand.
6625 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6626 Stefan Monnier <monnier@iro.umontreal.ca>
6627 Juanma Barranquero <lekktu@gmail.com>
6629 * profiler.c: New file.
6630 * Makefile.in (base_obj): Add profiler.o.
6631 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6632 ($(BLD)/profiler.$(O)): New target.
6633 * emacs.c (main): Call syms_of_profiler.
6634 * alloc.c (Qautomatic_gc): New constant.
6635 (MALLOC_PROBE): New macro.
6636 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6637 (total_bytes_of_live_objects): New function.
6638 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6639 Call malloc_probe for the memory profiler.
6640 (syms_of_alloc): Define Qautomatic_gc.
6641 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6643 (struct backtrace): Move definition...
6644 * lisp.h (struct backtrace): ..here.
6645 (Qautomatic_gc, profiler_memory_running): Declare vars.
6646 (malloc_probe, syms_of_profiler): Declare functions.
6647 * xdisp.c (Qautomatic_redisplay): New constant.
6648 (redisplay_internal): Record itself in backtrace_list.
6649 (syms_of_xdisp): Define Qautomatic_redisplay.
6651 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6652 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6654 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6656 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6658 Prefer POSIX timers if available.
6659 They avoid a race if the timer is too close to the current time.
6660 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6661 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6662 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6664 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6666 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6667 CHAR_STRING_ADVANCE.
6668 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6669 STRING_CHAR_ADVANCE.
6671 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6673 Move Vlibrary_cache to emacs.c and reset before dumping.
6675 * lisp.h (reset_image_types): Declare.
6676 [WINDOWSNT] (Vlibrary_cache): Declare.
6678 * image.c (reset_image_types): New function.
6680 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6681 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6682 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6684 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6685 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6687 * w32.h (Vlibrary_cache): Do not declare.
6689 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6691 * w32proc.c (sys_signal): Handle all signals defined by the
6692 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6693 handlers for signals supported by Windows. Don't override
6694 term_ntproc as the handler for SIGABRT.
6695 (sigaction): Rewrite to call sys_signal instead of duplicating its
6697 (sys_kill): Improve commentary.
6699 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6700 consistency with a signature of a signal handler. All callers
6702 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6703 install term_ntproc as a signal handler for SIGABRT, as that
6704 should be done by the dumped Emacs.
6706 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6708 * w32select.c (term_w32select): Protect against repeated
6709 invocation by setting clipboard_owner to NULL after calling
6712 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6713 and term_ntproc to their modified signatures.
6715 * character.c (char_string, string_char): Remove calls to
6716 MAYBE_UNIFY_CHAR. See the discussion starting at
6717 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6720 2012-09-25 Chong Yidong <cyd@gnu.org>
6722 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6724 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6726 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6727 when encountering an unknown bytecode.
6729 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6731 image.c, indent.c: Use bool for booleans.
6732 * dispextern.h (struct image_type): Members valid_p, load, init
6733 now return bool, not int. All uses changed.
6734 * image.c: Omit unnecessary static decls.
6735 (x_create_bitmap_mask, x_build_heuristic_mask):
6736 Return void, not int, since callers don't care about the return value.
6737 (x_create_bitmap_mask, define_image_type, valid_image_p)
6738 (struct image_keyword, parse_image_spec, image_spec_value)
6739 (check_image_size, image_background)
6740 (image_background_transparent, x_clear_image_1)
6741 (postprocess_image, lookup_image, x_check_image_size)
6742 (x_create_x_image_and_pixmap, xbm_image_p)
6743 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6744 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6745 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6746 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6747 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6748 (png_image_p, init_png_functions, png_load_body, png_load)
6749 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6750 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6751 (init_gif_functions, gif_load, imagemagick_image_p)
6752 (imagemagick_load_image, imagemagick_load, svg_image_p)
6753 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6755 * nsimage.m (ns_load_image):
6756 * nsterm.m (ns_defined_color):
6757 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6758 * xfns.c (x_defined_color):
6759 * xterm.c (x_alloc_lighter_color_for_widget)
6760 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6761 (x_alloc_lighter_color):
6762 * indent.c (disptab_matches_widthtab, current_column)
6763 (scan_for_column, string_display_width, indented_beyond_p)
6764 (compute_motion, vmotion, Fvertical_motion):
6765 Use bool for booleans.
6767 2012-09-24 Chong Yidong <cyd@gnu.org>
6769 * chartab.c (Fset_char_table_default): Obsolete function removed.
6771 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6773 Move pid_t related decls out of lisp.h.
6774 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6775 (interruptible_wait_for_termination):
6776 Move these decls from lisp.h to syswait.h, since they use pid_t.
6777 Needed on FreeBSD; see Herbert J. Skuhra in
6778 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6779 * callproc.c: Include syswait.h.
6781 gnutls.c, gtkutil.c: Use bool for boolean.
6782 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6783 (emacs_gnutls_handle_error):
6784 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6785 (xg_hide_tooltip, xg_create_frame_widgets)
6786 (create_dialog, xg_uses_old_file_dialog)
6787 (xg_get_file_with_chooser, xg_get_file_with_selection)
6788 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6789 (xg_item_label_same_p, xg_update_menubar)
6790 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6791 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6792 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6793 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6794 (update_frame_tool_bar, free_frame_tool_bar):
6795 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6796 * nsmenu.m (ns_update_menubar):
6797 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6798 * xfns.c (Fx_show_tip) [USE_GTK]:
6799 Use bool for boolean.
6800 * gtkutil.c (xg_update_frame_menubar):
6801 * xmenu.c (update_frame_menubar):
6802 Return void, not int, since caller ignores return value.
6803 * gtkutil.c (xg_change_toolbar_position):
6806 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6808 * makefile.w32-in (BLOCKINPUT_H): Remove.
6809 (SYSSIGNAL_H): New macro.
6810 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6811 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6812 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6813 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6814 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6815 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6816 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6817 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6818 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6819 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6820 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6821 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6822 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6823 ($(BLD)/w32xfns.$(O)): Update dependencies.
6825 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6827 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6828 fatal_error_backtrace.
6830 * w32proc.c (sys_kill): Undo last change: don't do anything when
6831 invoked to deliver SIGABRT to our own process. This is now
6832 handled by emacs_raise.
6834 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6836 * w32term.c (w32_read_socket): Remove leftover reference to
6837 interrupt_input_pending.
6839 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6841 Do not use SA_NODEFER.
6842 Problem reported by Dani Moncayo in
6843 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6845 * sysdep.c (emacs_abort): Do not reset signal handler.
6846 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6847 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6848 wanted even on POSIXish hosts, and it doesn't work on Windows.
6850 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6852 * xterm.c (x_term_init): Call fixup_locale before and after calling
6853 gtk_init (Bug#12392).
6855 2012-09-23 Chong Yidong <cyd@gnu.org>
6857 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6858 Vdynamic_library_alist.
6860 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6861 (Fgnutls_available_p): Caller changed.
6863 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6864 (Flibxml_parse_xml_region): Likewise.
6866 * dispextern.h (struct image_type): Remove arg from init function.
6868 * image.c (Finit_image_library, lookup_image_type)
6869 (define_image_type): Remove now-unneeded second arg.
6870 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6871 (init_tiff_functions, init_gif_functions, init_svg_functions):
6872 Arglist and w32_delayed_load calling convention changed.
6873 (gs_type): Remove init_gs_functions; there is no such function.
6874 (valid_image_p, make_image): Fix caller to lookup_image_type.
6876 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6878 Simplify and avoid signal-handling races (Bug#12471).
6880 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6881 Avoid recursive loop if there's a fatal error in the function itself.
6882 * atimer.c (pending_atimers):
6883 * blockinput.h: Don't include "atimer.h"; no longer needed.
6884 (interrupt_input_pending): Remove. All uses removed.
6885 pending_signals now counts both atimers and ordinary interrupts.
6886 This is less racy than having three separate pending-signal flags.
6887 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6889 Rename from their upper-case counterparts BLOCK_INPUT,
6890 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6891 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6892 This makes it easier to access volatile variables more accurately.
6893 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6894 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6895 that's more reliable if the code is buggy and sets
6896 interrupt_input_blocked to a negative value. All uses changed.
6897 * atimer.c (deliver_alarm_signal):
6898 Remove. No need to deliver this to the parent; any thread can
6899 handle this signal now. All uses replaced by underlying handler.
6900 * atimer.c (turn_on_atimers):
6901 * dispnew.c (handle_window_change_signal):
6902 * emacs.c (handle_danger_signal):
6903 * keyboard.c (kbd_buffer_get_event):
6904 Don't reestablish signal handler; not needed with sigaction.
6905 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6907 Rework to avoid unnecessary accesses to volatile variables.
6908 (UNBLOCK_INPUT_TO): Now a function.
6909 (totally_unblock_input, unblock_input): New decls.
6910 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6911 (init_data): Remove. Necessary stuff now done in init_signal.
6912 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6913 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6914 (fatal_error_code): Remove; no longer needed.
6915 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6916 it doesn't always backtrace. All uses changed. No need to reset
6917 signal to default, since sigaction and/or die does that for us now.
6918 Use emacs_raise (FOO), not kill (getpid (), FOO).
6919 (main): Check more-accurately whether we're dumping.
6920 Move fatal-error setup to sysdep.c
6921 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6922 * gtkutil.c (xg_get_file_name, xg_get_font):
6923 Remove no-longer-needed signal-mask manipulation.
6924 * keyboard.c, process.c (POLL_FOR_INPUT):
6925 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6926 * keyboard.c (read_avail_input): Remove.
6927 All uses replaced by gobble_input.
6928 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6929 (kbd_buffer_store_event_hold, gobble_input):
6930 (record_asynch_buffer_change) [USABLE_SIGIO]:
6931 (store_user_signal_events):
6932 No need to mess with signal mask.
6933 (gobble_input): If blocking input and there are terminals, simply
6934 set pending_signals to 1 and return. All hooks changed to not
6935 worry about whether input is blocked.
6936 (process_pending_signals): Clear pending_signals before processing
6937 them, in case a signal comes in while we're processing.
6938 By convention callers now test pending_signals before calling us.
6939 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6940 New functions, to support changes to blockinput.h.
6941 (handle_input_available_signal): Now extern.
6942 (reinvoke_input_signal): Remove. All uses replaced by
6944 (quit_count): Now volatile, since a signal handler uses it.
6945 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6946 All callers changed. Block SIGINT only if not already blocked.
6947 Clear sigmask reliably, even if Fsignal returns, which it can.
6948 Omit unnecessary accesses to volatile var.
6949 (quit_throw_to_read_char): No need to restore sigmask.
6950 * keyboard.c (gobble_input, handle_user_signal):
6951 * process.c (wait_reading_process_output):
6952 Call signal-handling code rather than killing ourselves.
6953 * lisp.h: Include <float.h>, for...
6954 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6955 (pending_signals): Now volatile.
6956 (syms_of_data): Now const if IEEE floating point.
6957 (handle_input_available_signal) [USABLE_SIGIO]:
6958 (terminate_due_to_signal, record_child_status_change): New decls.
6959 * process.c (create_process): Avoid disaster if memory is exhausted
6960 while we're processing a vfork, by tightening the critical section
6962 (send_process_frame, process_sent_to, handle_pipe_signal)
6963 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6965 (send_process): No need for setjmp/longjmp any more, since the
6966 SIGPIPE stuff is now gone. Instead, report an error if errno
6968 (record_child_status_change): Now extern. PID and W are now args.
6969 Return void, not bool. All callers changed.
6970 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6971 Remove. All uses removed. This bug should be fixed now in a
6973 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6974 and record the child status change directly. This avoids the
6975 need to futz with the signal mask.
6976 (process_fatal_action): Move here from emacs.c.
6977 (emacs_sigaction_flags): New function, containing
6978 much of what used to be in emacs_sigaction_init.
6979 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6980 caught by emacs, to make races less likely.
6981 (deliver_process_signal): Rename from handle_on_main_thread.
6983 (BACKTRACE_LIMIT_MAX): Now at top level.
6984 (thread_backtrace_buffer, threadback_backtrace_pointers):
6986 (deliver_thread_signal, deliver_fatal_thread_signal):
6987 New functions, for more-accurate delivery of thread-specific signals.
6988 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6989 (deliver_arith_signal): Handle in this thread, not
6990 in the main thread, since it's triggered by this thread.
6991 (maybe_fatal_sig): New function.
6992 (init_signals): New arg DUMPING so that we can be more accurate
6993 about whether we're dumping. Caller changed.
6994 Treat thread-specific signals differently from process-general signals.
6995 Block all signals while handling fatal error; that's safer.
6996 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6998 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6999 Ignore SIGPIPE unless batch.
7000 (emacs_backtrace): Output backtrace for the appropriate thread,
7001 which is not necessarily the main thread.
7002 * syssignal.h: Include <stdbool.h>.
7003 (emacs_raise): New macro.
7004 * xterm.c (x_connection_signal): Remove; no longer needed
7005 now that we use sigaction.
7006 (x_connection_closed): No need to mess with sigmask now.
7007 (x_initialize): No need to reset SIGPIPE handler here, since
7008 init_signals does this for us now.
7010 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7012 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
7013 background rect may be larger (Bug#12245).
7015 2012-09-23 Chong Yidong <cyd@gnu.org>
7017 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
7019 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7021 * .gdbinit: Just stop at fatal_error_backtrace.
7022 See Stefan Monnier's request in
7023 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7024 Remove no-longer-used query of system type.
7026 2012-09-22 Chong Yidong <cyd@gnu.org>
7028 * search.c (Freplace_match): Doc fix (Bug#12325).
7030 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7032 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7033 (Fline_end_position): Doc fix.
7035 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7037 2012-09-22 Chong Yidong <cyd@gnu.org>
7039 * dispextern.h (struct image_type): Add new slot, storing a type
7040 initialization function.
7042 * image.c (define_image_type): Call the image initializer function
7043 if it is defined. Arguments and return value changed.
7044 (valid_image_p, make_image): Callers changed.
7045 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7046 (gif_type, imagemagick_type, svg_type, gs_type):
7047 Add initialization functions.
7048 (Finit_image_library): Call lookup_image_type.
7049 (CHECK_LIB_AVAILABLE): Macro deleted.
7050 (lookup_image_type): Call define_image_type here, rather than via
7051 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7052 (syms_of_image): Move define_image_type calls for xbm_type and
7053 pbm_type to lookup_image_type.
7055 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7057 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7058 'idle_timers' from here ...
7059 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7060 lists, to avoid infloops when the timer does something stupid,
7061 like reinvoke itself with the same or smaller time-out.
7064 2012-09-22 Martin Rudalics <rudalics@gmx.at>
7066 * window.c (Fsplit_window_internal): Handle only Qt value of
7067 Vwindow_combination_limit separately.
7068 (Qtemp_buffer_resize): New symbol.
7069 (Vwindow_combination_limit): New default value.
7072 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7074 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7075 the new overlay string. (Bug#10159)
7077 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7079 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7080 or that fprintf is async-signal-safe. POSIX doesn't require
7083 2012-09-22 Chong Yidong <cyd@gnu.org>
7085 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7088 2012-09-22 Kenichi Handa <handa@gnu.org>
7090 * composite.c (composition_reseat_it): Handle the case that a
7091 grapheme cluster is not covered by a single font (Bug#12352).
7093 2012-09-21 Chong Yidong <cyd@gnu.org>
7095 * image.c (define_image_type): Avoid adding duplicate types to
7096 image_types (Bug#12463). Suggested by Jörg Walter.
7098 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7100 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7101 (print_load_command_name): Add case LC_DATA_IN_CODE.
7102 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7104 2012-09-21 Glenn Morris <rgm@gnu.org>
7106 * eval.c (Frun_hook_with_args_until_success)
7107 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7109 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7111 * fileio.c (Ffile_selinux_context): Only call freecon when
7112 lgetfilecon succeeded.
7113 (Fset_file_selinux_context): Likewise. (Bug#12444)
7115 2012-09-21 Eli Zaretskii <eliz@gnu.org>
7117 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7118 reordering, locate the cursor by calling set_cursor_from_row; if
7119 that fails, clear the desired glyph matrix before returning a
7120 failure indication to the caller. Fixes leaving garbled display
7121 when fast scrolling with a down-key. (Bug#12403)
7122 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7123 scrolling through multibyte text.
7125 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7127 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7128 calling mark_vectorlike since that's the one that marks the window.
7129 (mark_discard_killed_buffers): Mark the final cdr.
7130 * window.h (struct window): Move prev/next_buffers to the
7131 non-standard fields.
7132 * window.c (make_window): Initialize prev/next_buffers manually.
7134 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7136 Omit unused arg EXPECTED from socket hooks.
7137 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7138 * nsterm.m (ns_term_init):
7139 * termhooks.h (struct terminal.read_socket_hook):
7140 * w32inevt.c (w32_console_read_socket):
7141 * w32term.c (w32_read_socket):
7142 * xterm.c (XTread_socket):
7143 Omit unused arg EXPECTED. All callers changed.
7144 (store_user_signal_events): Return void, not int, since callers no
7145 longer care about the return value. All uses changed.
7147 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
7149 * w32gui.h (XParseGeometry): Do not declare.
7151 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7153 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7154 Ignore 'expected'. See Eli Zaretskii in
7155 <http://bugs.gnu.org/12471#8> (last line).
7157 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7158 (XParseGeometry): Now static. Substitute extremal values for
7159 values that are out of range.
7161 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7163 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7165 * nsfns.m (XParseGeometry): Remove.
7166 (Fx_create_frame): Call x_set_offset to correctly interpret
7167 top_pos in geometry.
7169 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7170 (Fx_parse_geometry): If there is a space in string, call
7171 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7173 2012-09-17 Eli Zaretskii <eliz@gnu.org>
7175 * search.c (scan_buffer): Use character positions in calls to
7176 region_cache_forward and region_cache_backward, not byte
7177 positions. (Bug#12196)
7179 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7180 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7182 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7183 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7184 emacs_blocked_malloc, now deleted.
7186 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7188 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7189 The workaround was for improving performance on Solaris 2.4, but
7190 is getting in the way now. Emacs will still work if someone is
7191 still running Solaris 2.4 in a museum somewhere; Sun dropped
7192 support for Solaris 2.4 in 2003.
7193 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7194 * process.c (create_process) [HAVE_WORKING_VFORK]:
7195 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7196 since Emacs no longer uses vfork on that platform.
7198 2012-09-17 Glenn Morris <rgm@gnu.org>
7200 * emacs.c: Use COPYRIGHT.
7202 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7204 Remove configure's --without-sync-input option (Bug#12450).
7205 When auditing signal-handling in preparation for cleaning it up,
7206 I found that SYNC_INPUT has race conditions and would be a real
7207 pain to fix. Since it's an undocumented and deprecated
7208 configure-time option, now seems like a good time to remove it.
7209 Also see <http://bugs.gnu.org/11080#16>.
7210 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7211 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7212 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7213 (malloc_hysteresis):
7214 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7215 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7216 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7217 (dont_register_blocks, bytes_used_when_reconsidered)
7218 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7219 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7220 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7221 Remove. All uses removed.
7222 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7223 implementation, one that depends on whether the new macro
7224 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7226 * atimer.c (run_timers, handle_alarm_signal):
7227 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7228 (handle_async_input, process_pending_signals)
7229 (handle_input_available_signal, init_keyboard):
7230 * nsterm.m (ns_read_socket):
7231 * process.c (wait_reading_process_output):
7232 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7233 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7235 * xterm.c (XTread_socket):
7237 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7238 * eval.c (handling_signal): Remove. All uses removed.
7239 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7240 All uses replaced with the SYNC_INPUT version.
7241 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7243 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7246 * font.c (Ffont_shape_gstring): Remove unused local.
7248 2012-09-16 Glenn Morris <rgm@gnu.org>
7250 * Makefile.in (clean): No longer run nextstep's clean.
7252 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7254 (ns-app): Move here from ns.mk, and simplify.
7255 (clean): Simplify nextstep entry.
7256 * ns.mk: Remove file.
7258 2012-09-17 Kenichi Handa <handa@gnu.org>
7260 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7261 not covert the last few charactes.
7263 2012-09-16 Kenichi Handa <handa@gnu.org>
7265 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7266 here, but just check the validity of glyphs in the glyph-string.
7268 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7270 * window.c (Fwindow_parameter, Fset_window_parameter):
7271 Accept any window as argument (Bug#12452).
7273 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7275 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7276 to ns_term_init to avoid memory leak.
7278 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7279 explicit retain/release.
7280 (ns_term_init): Only allow one display. Initialize outerpool and
7283 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7285 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7286 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7287 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7288 the Microsoft problem in a different way, by altering ../nt/config.nt.
7290 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7305 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7306 by lisp.h. This completes removal of setjmp.h inclusion
7307 erroneously announced in the previous commit. (Bug#12446)
7309 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7312 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7313 not defined as a macro. The latter happens on MS-Windows.
7316 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7318 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7319 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7320 Some instances of '#include <setjmp.h>' removed, if the
7321 only reason for the instance was because "lisp.h" was included.
7322 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7323 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7324 and _longjmp with the new symbols. Emacs already uses _setjmp if
7325 available, so this change affects only POSIXish hosts that have
7326 sigsetjmp but not _setjmp, such as some versions of Solaris and
7327 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7328 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7329 (png_load_body) [HAVE_PNG]:
7330 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7331 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7332 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7333 since PNG requires jmp_buf. This is the only exception to the
7334 general rule that we now use sys_setjmp and sys_longjmp.
7335 This exception is OK since this code does not change the signal
7336 mask or longjmp out of a signal handler.
7338 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7340 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7341 Include "syssignal.h", for 'main_thread'.
7343 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7345 Avoid out-of-range marker position (Bug#12426).
7346 * insdel.c (replace_range, replace_range_2):
7347 Adjust markers before overlays, as suggested by comments.
7348 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7349 Remove redundant check before calling offset_intervals.
7351 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7353 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7354 current buffer (Bug#12387).
7356 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7358 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7360 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7362 Use a more backwards-compatible timer format (Bug#12430).
7363 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7364 vector element, not from the 4th, since PSECS is now at the end.
7365 (Fcurrent_idle_time): Doc fix.
7367 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7369 Function to mark objects and remove killed buffers at once.
7370 * alloc.c (discard_killed_buffers): Rename to ...
7371 (mark_discard_killed buffers) ... new name. Add marking
7372 of remaining objects. Fix comment. Adjust users.
7373 (mark_object): Do not touch frame buffer lists here.
7374 * frame.c (delete_frame): Reset frame buffer lists here.
7376 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7378 Better workaround for GNOME bug when --enable-gcc-warnings.
7379 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7380 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7381 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7383 Simplify SIGIO usage (Bug#12408).
7384 The code that dealt with SIGIO was crufty and confusing, e.g., it
7385 played tricks like "#undef SIGIO" but these tricks were not used
7386 consistently. Simplify mostly by not #undeffing standard symbols,
7387 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7388 or not as we please) rather than "defined SIGIO" (standard symbol
7389 that we probably shouldn't #undef).
7390 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7391 Modules that need it can include it.
7392 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7393 * dispextern.h (ignore_sigio): New decl.
7394 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7395 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7396 * emacs.c (shut_down_emacs):
7397 * keyboard.c (kbd_buffer_store_event_hold):
7398 Use ignore_sigio rather than invoking 'signal' directly.
7399 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7401 (FIONREAD, SIGIO): Do not #undef.
7402 (tty_read_avail_input): Use #error rather than a syntax error.
7403 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7404 for I_PIPE, used by SETUP_SLAVE_PTY.
7405 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7406 * sysdep.c (croak): Remove; no longer needed. This bit of
7407 temporary code, with Fred N. Fish's comment that it's temporary,
7408 has been in Emacs since at least 1992!
7409 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7410 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7411 * syssignal.h (croak): Remove decl.
7412 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7413 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7414 now that we're termios-only.
7415 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7416 * term.c (dissociate_if_controlling_tty): Use #error rather than
7419 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7420 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7421 to work around GNOME bug 683906.
7422 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7423 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7424 This works around GCC bug 54561.
7426 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7428 More fixes for 'volatile' and setjmp/longjmp.
7429 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7430 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7431 (png_load_body) [HAVE_PNG]:
7432 (jpeg_load_body) [HAVE_JPEG]:
7433 New function, with most of the old parent function's body.
7434 (png_load) [HAVE_PNG]:
7435 (jpeg_load) [HAVE_JPEG]:
7436 Invoke the new function, to avoid longjmp munging our locals.
7437 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7438 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7439 longjmp is passed 2, as the C standard doesn't guarantee this.
7440 Instead, store the failure code into mgr->failure_code.
7442 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7444 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7445 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7446 (syms_of_keyboard): Remove support for unread-command-char.
7448 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7450 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7451 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7452 violation. (Bug#12426)
7454 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7456 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7458 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7460 * eval.c: Add `inhibit-debugger'.
7461 (Qinhibit_debugger): New symbol.
7462 (call_debugger): Bind it instead of Qdebug_on_error.
7463 (maybe_call_debugger): Test Vinhibit_debugger.
7464 (syms_of_eval): Define inhibit-debugger.
7465 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7466 (syms_of_xdisp): Remove inhibit-debug-on-message.
7468 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7470 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7471 If a nonvolatile local variable is written before a _longjmp to
7472 the frame containing the variable, and is read after the _longjmp,
7473 the value read is indeterminate. Some local variables of type
7474 'struct handler' and 'struct catchtag' are used in this way, so
7475 mark each of their slots as volatile if the slot can be set before
7476 _longjmp and read afterwards.
7477 * lisp.h (struct handler): var and chosen_clause are now volatile.
7478 (struct catchtag): val, next, and pdlcount are now volatile.
7480 * bidi.c (bidi_push_it, bidi_pop_it):
7481 * fns.c (copy_hash_table):
7482 * image.c (define_image_type):
7483 * keyboard.c (kbd_buffer_store_event_hold):
7484 * process.c (Fprocess_send_eof):
7485 * xfaces.c (x_create_gc) [HAVE_NS]:
7486 * xgselect.c (xg_select):
7487 Prefer assignment to memcpy when either will do.
7489 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7490 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7491 time an item is removed. No need to mark this function 'inline';
7492 the compiler knows better than we do.
7494 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7496 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7497 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7498 to change_frame_size (Bug#12388).
7499 (windowDidResize:): Pass YES to updateFrameSize.
7501 * nsterm.h: Add delay parameter to updateFrameSize.
7503 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7505 Discard killed buffers from deleted window and frame objects.
7506 This reduces an amount of references to killed buffers and
7507 helps GC to reclaim them faster.
7508 * alloc.c (discard_killed_buffers): New function.
7509 (mark_object): Use it for deleted windows and frames.
7510 (mark_object): If symbol's value is set up for a killed buffer
7511 or deleted frame, restore its global binding.
7512 * data.c (swap_in_global_binding): Add GC notice.
7513 (swap_in_symval_forwarding): Use convenient set_blv_where.
7514 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7515 * window.h: ... to here.
7517 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7519 Convenient macro to check whether the buffer is live.
7520 * buffer.h (BUFFER_LIVE_P): New macro.
7521 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7522 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7524 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7526 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7527 composition cases (Bug#12364).
7529 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7530 overhang of succeeding glyphs overlapping box cursor.
7532 * w32term.c (x_draw_glyph_string): Likewise.
7534 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7536 Simplify, document, and port floating-point (Bug#12381).
7537 The porting part of this patch fixes bugs on non-IEEE platforms
7538 with frexp, ldexp, logb.
7539 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7541 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7542 support, by removing commented-out code and briefly listing the
7543 C89 functions excluded. The commented-out stuff was confusing
7544 maintenance, e.g., we thought we needed cbrt but it was commented out.
7545 (logb): Remove decl; no longer needed.
7546 (isfinite): New macro, if not already supplied.
7547 (isnan): Don't replace any existing macro.
7548 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7549 are present on all C89 platforms.
7550 (Ffrexp): Do not special-case zero, as frexp does the right thing
7552 (Flogb): Do not use logb, as it doesn't have the desired meaning
7553 on hosts that use non-base-2 floating point. Instead, stick with
7554 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7555 frexp, to avoid getting an unspecified result.
7557 * xdisp.c (Qinhibit_debug_on_message): Now static.
7559 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7561 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7562 NSBezierPath (Bug#12131).
7564 2012-09-10 Chong Yidong <cyd@gnu.org>
7566 * fns.c (Fdelq, Fdelete): Doc fix.
7568 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7570 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7571 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7573 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7575 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7576 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7579 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7581 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7582 left fringe if the window has a left margin. This avoids leaving
7583 traces of the cursor because its leftmost pixel is not drawn over.
7585 * dispnew.c (update_window_line): When the left margin area of a
7586 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7587 that screen line. (Bug#12277)
7589 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7591 Assume C89 or later for math functions (Bug#12381).
7592 This simplifies the code, and makes it a bit smaller and faster,
7593 and (most important) makes it easier to clean up signal handling
7594 since we can stop worring about floating-point exceptions in
7595 library code. That was a problem before C89, but the problem
7596 went away many years ago on all practical Emacs targets.
7597 * data.c, image.c, lread.c, print.c:
7598 Don't include <math.h>; no longer needed.
7599 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7600 might be autoconfigured, as that never happens.
7602 * doprnt.c (DBL_MAX_10_EXP):
7603 * print.c (DBL_DIG):
7604 Remove. C89 or later always defines these.
7605 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7606 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7607 (arith_error, domain_error, domain_error2):
7608 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7609 no longer needed -- we simply return what C returns. All uses removed.
7610 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7612 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7613 Remove. All uses expanded, as these macros are no longer used
7614 more than once and are now more trouble than they're worth.
7615 (Ftan): Use tan, not sin / cos.
7616 (Flogb): Assume C89 frexp.
7617 (fmod_float): Assume C89 fmod.
7618 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7619 (init_floatfns): Remove. All uses removed.
7621 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7623 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7624 compositeToPoint for OSX < 10.6 (Bug#12390).
7626 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7628 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7629 This produces more-accurate results.
7631 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7633 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7634 changes (Bug#12088).
7636 2012-09-08 Chong Yidong <cyd@gnu.org>
7638 * syntax.c (Fstring_to_syntax): Doc fix.
7640 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7642 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7643 in the internal border.
7644 (x_set_window_size): Remove static variables and their usage.
7645 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7646 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7647 Remove fringe/internal border adjustment (Bug#11052).
7648 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7649 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7650 (ns_fix_rect_ibw): Remove.
7651 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7652 (ns_dumpglyphs_box_or_relief): Ditto.
7653 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7655 (ns_dumpglyphs_image): Ditto.
7656 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7658 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7659 their usage. Add fringe_extended_p and its use as in other terms.
7660 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7661 scroll bar was removed.
7662 (updateFrameSize): New function.
7663 (windowDidResize): Move code to updateFrameSize and call it.
7665 * nsterm.h (EmacsView): Add updateFrameSize.
7667 2012-09-07 Chong Yidong <cyd@gnu.org>
7669 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7671 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7673 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7675 More signal-handler cleanup (Bug#12327).
7676 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7677 Problem introduced when merging patches. Noted by Eli Zaretskii in
7678 <http://bugs.gnu.org/12327#67>.
7679 * floatfns.c: Comment fix.
7680 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7681 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7682 and anyway the declaration is harmless even if SIGDANGER is not defined.
7683 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7684 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7685 source files not surprisingly expected syssignal.h to define, or
7686 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7687 Include <sys/ioctl.h>, for FIONREAD.
7688 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7689 This eliminates a problem whereby other files mysteriously had
7690 to include "syssignal.h" before including "systty.h" if they
7691 wanted to use "#ifdef SIGIO".
7693 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7695 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7697 * w32.c (sigemptyset): Empty the set.
7698 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7700 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7702 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7704 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7705 (mark_object): Likewise for frame objects.
7707 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7709 * syssignal.h (handle_on_main_thread): Always declare,
7710 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7711 This ports to platforms without HAVE_PTHREAD.
7713 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7715 Signal-handler cleanup (Bug#12327).
7716 Emacs's signal handlers were written in the old 4.2BSD style with
7717 sigblock and sigmask and so forth, and this led to some
7718 inefficiencies and confusion. Rewrite these to use
7719 pthread_sigmask etc. without copying signal sets around. Also,
7720 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7721 'signal', and instead use functions that do not attempt to take
7722 over the system name space. This patch causes Emacs's text
7723 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7724 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7725 Do not include <signal.h> or "syssignal.h", as these
7726 modules do not use signals.
7727 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7728 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7729 Do not include <signal.h>, as "syssignal.h" does that for us now.
7730 * atimer.c (sigmask_atimers): New function.
7731 (block_atimers, unblock_atimers): New functions,
7732 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7734 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7735 no longer needed here.
7736 * emacs.c (main): Inspect existing signal handler with sigaction,
7737 so that there's no need to block and unblock SIGHUP.
7738 * sysdep.c (struct save_signal): New member 'action', replacing
7739 old member 'handler'.
7740 (save_signal_handlers, restore_signal_handlers):
7741 Use sigaction instead of 'signal' to save and restore.
7742 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7743 New function. All users of 'signal' modified to use set_sighandler
7744 if they're writeonly, and to use sys_signal if they're read+write.
7745 (emacs_sigaction_init, forwarded_signal): New functions.
7746 (sys_signal): Remove. All uses replaced by calls to sigaction
7747 and emacs_sigaction_init, or by direct calls to 'signal'.
7748 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7749 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7750 all uses replaced by pthread_sigmask etc. calls.
7751 * syssignal.h: Include <signal.h>.
7752 (emacs_sigaction_init, forwarded_signal): New decls.
7753 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7754 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7755 (sigmask, sys_sigmask): Remove; no longer needed.
7756 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7757 (sigblock, sigunblock, sigfree):
7758 (sigsetmask) [!defined sigsetmask]:
7759 Remove. All uses replaced by pthread_sigmask.
7760 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7761 no longer need to be replaced, and its typical old uses
7762 are now done via emacs_sigaction_init and sigaction.
7763 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7764 (sys_sigdel): Remove; unused.
7765 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7767 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7769 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7770 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7772 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7774 Explicitly mark buffer_defaults and buffer_local_symbols.
7775 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7776 mark_local_symbols here.
7777 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7778 since special buffers aren't marked here any more.
7779 (allocate_buffer): Chain new buffer with all_buffers here...
7780 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7782 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7783 (syms_of_buffer): Remove staticpro of the above.
7784 (init_buffer_once): Set names for buffer_defaults and
7785 buffer_local_symbols.
7787 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7789 Use bool for booleans in font-related modules.
7790 * font.c (font_intern_prop, font_style_to_value)
7791 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7792 (generate_otf_features, font_check_otf_features, font_check_otf)
7793 (font_match_p, font_list_entities, font_at):
7794 * fontset.c (fontset_id_valid_p, reorder_font_vector
7795 (fontset_find_font, Fset_fontset_font)
7796 (face_suitable_for_char_p) [0]:
7797 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7798 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7799 (m17n_flt_initialized, ftfont_shape_by_flt):
7800 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7801 * nsfont.m (nsfont_draw):
7802 * w32font.c (w32font_draw):
7803 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7804 Use bool for booleans.
7805 * font.h: Adjust to above API changes.
7806 (struct font, struct font_driver, struct font_driver_list):
7807 Use bool for booleans.
7808 (struct font): Remove useless member encoding_type.
7810 * fontset.c, xftfont.c: Omit unnecessary static decls.
7812 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7814 * alloc.c (mark_object): Revert window marking code
7815 since it's unsafe for the Fset_window_configuration.
7817 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7819 Fix race conditions with signal handlers and errno (Bug#12327).
7820 Be more systematic about preserving errno whenever a signal
7821 handler returns, even if it's not in the main thread. Do this by
7822 renaming signal handlers to distinguish between signal delivery
7823 and signal handling. All uses changed.
7824 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7825 * data.c (deliver_arith_signal): Rename from arith_error.
7826 * dispnew.c (deliver_window_change_signal): Rename from
7827 window_change_signal.
7828 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7829 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7830 * keyboard.c (deliver_input_available_signal): Rename from
7831 input_available_signal.
7832 (deliver_user_signal): Rename from handle_user_signal.
7833 (deliver_interrupt_signal): Rename from interrupt_signal.
7834 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7835 (deliver_child_signal): Rename from sigchld_handler.
7836 * atimer.c (handle_alarm_signal):
7837 * data.c (handle_arith_signal):
7838 * dispnew.c (handle_window_change_signal):
7839 * emacs.c (handle_fatal_signal, handle_danger_signal):
7840 * keyboard.c (handle_input_available_signal):
7841 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7842 * process.c (handle_pipe_signal, handle_child_signal):
7843 New functions, with the actual signal-handling code taken from the
7844 original respective signal handlers, sans the sporadic attempts to
7845 preserve errno, since that's now done by handle_on_main_thread.
7846 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7847 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7848 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7850 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7851 Move initialization of main_thread to sysdep.c's init_signals.
7852 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7853 our usage, and simplifies the mainline code.
7854 (record_child_status_change): New static function, as a helper
7855 for handle_child_signal, and with most of the old child handler's
7857 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7858 (handle_child_signal): Use the above.
7859 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7860 Moved here from emacs.c.
7861 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7862 code moved here from emacs.c's main function.
7863 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7864 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7865 This lets callers save and restore errno properly.
7867 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7869 Remove redundant or unused things here and there.
7870 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7871 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7872 * editfns.c (Fcompare_buffer_substrings): Likewise.
7873 * frame.h (struct terminal, struct font_driver_list):
7874 Remove redundant declarations.
7875 * window.h (Qleft, Qright): Likewise.
7877 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7879 Do not mark objects from deleted buffers, windows and frames.
7880 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7881 (mark_object): Likewise for windows and frames.
7883 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7885 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7886 buffer_defaults and buffer_local_symbols as valid objects.
7887 Return special value to denote them.
7889 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7891 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7892 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7893 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7894 (file_name_absolute_p, Fsubstitute_in_file_name):
7895 (check_executable, check_writable, Ffile_accessible_directory_p)
7896 (Fset_file_selinux_context, Fdefault_file_modes)
7897 (Finsert_file_contents, choose_write_coding_system)
7898 (Fwrite_region, build_annotations, a_write, e_write)
7900 * filelock.c (boot_time_initialized, get_boot_time)
7901 (get_boot_time_1, lock_file_1, within_one_second):
7902 * floatfns.c (in_float):
7903 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7904 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7905 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7906 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7907 * window.c (compare_window_configurations):
7908 Use bool for booleans.
7909 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7910 (Fdefault_file_modes): Now mode_t, not int, for modes.
7911 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7912 (internal_delete_file): Now returns void, not a (boolean) int,
7913 since nobody was looking at the return value.
7914 * lisp.h, window.h: Adjust to above API changes.
7916 * xdisp.c (set_message): Simplify and reindent last change.
7918 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7920 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7922 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7924 * eval.c (call_debugger): Make the function non-static so that we
7925 can call it from set_message.
7927 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7928 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7930 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7932 Give more-useful info on a fatal error (Bug#12328).
7933 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7934 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7935 of doing the work ourselves.
7936 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7937 do most of the work.
7938 (fatal_error_backtrace): New function, taken from the guts
7939 of the old fatal_error_signal, but with a new option to output
7941 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7942 info about the signal than just its number.
7943 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7944 * sysdep.c: Include <execinfo.h>
7945 (emacs_backtrace): New function, taken partly from the previous
7946 code of the 'die' function.
7947 (emacs_abort): Call fatal_error_backtrace rather than abort.
7949 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7951 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7952 eager (load-time) macro-expansion.
7953 * lisp.mk (lisp): Add macroexp.
7955 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7957 Simplify redefinition of 'abort' (Bug#12316).
7958 Do not try to redefine the 'abort' function. Instead, redo
7959 the code so that it calls 'emacs_abort' rather than 'abort'.
7960 This removes the need for the NO_ABORT configure-time macro
7961 and makes it easier to change the abort code to do a backtrace.
7962 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7963 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7964 Remove; sysdep.c's emacs_abort now takes its place.
7965 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7966 'abort' changed to use 'emacs_abort'.
7967 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7968 (abort) [!defined abort]: Rename to ...
7969 (emacs_abort): ... new name.
7970 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7971 the place of the old 'abort' in emacs.c.
7972 * w32.c, w32fns.c (abort): Do not #undef.
7973 * w32.c (emacs_abort): Rename from w32_abort.
7975 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7977 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7978 offsets[j].dv, since the y axis of the screen coordinates points
7979 down, while the y axis of the font definition coordinates points
7980 up. This fixes display of Arabic diacritics such as KASRA and
7981 KASRATAN. (Bug#11860)
7983 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7985 Be more systematic about _setjmp vs setjmp.
7986 * alloc.c (test_setjmp, mark_stack):
7987 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7988 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7989 (png_load, my_error_exit, jpeg_load):
7990 * process.c (send_process_trap, send_process):
7991 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7992 The underscored versions are up to 30x faster on some hosts.
7993 Formerly, the code used setjmp+longjmp sometimes and
7994 _setjmp+_longjmp at other times, with no particular reason to
7995 prefer setjmp+longjmp.
7997 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7999 Fix minor problem found by static checking.
8000 * buffer.c (Fdelete_all_overlays): Return nil.
8002 2012-09-03 Martin Rudalics <rudalics@gmx.at>
8004 * buffer.c (Fdelete_all_overlays): New function.
8006 2012-09-03 Chong Yidong <cyd@gnu.org>
8008 * gtkutil.c: Add extern decl for Qxft.
8010 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8012 * emacs.c, eval.c: Use bool for boolean.
8013 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
8014 (malloc_using_checking) [DOUG_LEA_MALLOC]:
8015 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
8016 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8017 (main, decode_env_path, Fdaemon_initialized):
8018 * eval.c (call_debugger, Finteractive_p, interactive_p):
8019 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
8020 (maybe_call_debugger, Fbacktrace):
8021 * process.c (read_process_output, exec_sentinel):
8022 Use bool for booleans.
8023 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8024 All callers changed.
8025 * eval.c (interactive_p): Omit always-true boolean argument
8026 EXCLUDE_SUBRS_P. All callers changed.
8027 * dispextern.h, lisp.h: Reflect above API changes.
8028 * firstfile.c (dummy): Use the address of 'main', whose signature
8029 won't change, instead of the address of 'initialize', whose
8030 signature just changed from int to bool.
8031 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8032 * msdos.c (fatal_error_in_progress): ... from here.
8033 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8035 (redisplay_internal, unwind_redisplay): Simply clear
8036 REDISPLAYING_P when unwinding, instead of saving its previous,
8037 always-false value and then restoring it.
8039 Clean up some extern decls.
8040 Mostly, this hoists extern decls out of .c files and into .h files.
8041 That way, we're more likely to catch errors if the interfaces change.
8042 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8043 declare xg_mark_data.
8044 * dispextern.h (x_frame_parm_handlers):
8046 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8047 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8048 (Qultra_bold, Qoblique, Qitalic):
8049 Move extern decl here from .c file.
8050 * alloc.c (xg_mark_data) [USE_GTK]:
8052 * eval.c (Qlexical_binding):
8053 * fns.c (time) [!HAVE_UNISTD_H]:
8054 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8055 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8056 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8057 * lread.c (Qinternal_interpreter_environment):
8058 * minibuf.c (Qbuffer):
8059 * process.c (QCfamily, QCfilter):
8060 * widget.c (free_frame_faces):
8061 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8062 * xfont.c (x_clear_errors):
8063 * xterm.c (x_frame_parm_handlers):
8064 Remove now-redundant extern decls.
8065 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8066 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8068 * xfaces.c: Remove unnecessary static decls.
8069 * xterm.c (updating_frame): Remove decl of nonexistent object.
8071 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8072 when building globals.h, as the objects that are not built on
8073 this host are not needed to compile C files on this host.
8075 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8077 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8079 * frame.h: Add missing prototype for x_wm_set_size_hint.
8081 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8083 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8084 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8085 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8086 (Fsubstitute_command_keys):
8087 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8088 (save_excursion_save, save_excursion_restore)
8089 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8090 (format_time_string, general_insert_function)
8091 (make_buffer_string, make_buffer_string_both)
8092 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8093 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8094 (copy_text, insert_1, insert_1_both, insert_from_string)
8095 (insert_from_string_before_markers, insert_from_string_1)
8096 (insert_from_buffer, insert_from_buffer_1, replace_range)
8097 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8098 (del_range_2, modify_region):
8099 * intervals.c (intervals_equal, balance_possible_root_interval)
8100 (adjust_intervals_for_insertion, merge_properties_sticky)
8101 (graft_intervals_into_buffer, lookup_char_property)
8102 (adjust_for_invis_intang, set_point_both)
8103 (get_property_and_range, compare_string_intervals)
8104 (set_intervals_multibyte_1, set_intervals_multibyte):
8105 * keyboard.c (decode_timer):
8106 Use bool for boolean.
8107 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8108 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8110 2012-09-02 Chong Yidong <cyd@gnu.org>
8112 * keymap.c (push_key_description): Print M-TAB as C-M-i
8115 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
8117 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8118 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8119 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8120 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8121 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8122 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8123 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8125 2012-09-01 Eli Zaretskii <eliz@gnu.org>
8127 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8128 more than one grapheme cluster passed to the shaper: compute the
8129 offset adjustment values separately for each cluster. (Bug#11860)
8131 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8132 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8133 about implicit conversions from integer to pointer.
8135 2012-09-01 Daniel Colascione <dancol@dancol.org>
8137 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8138 system used too early.
8140 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8142 Better seed support for (random).
8143 * emacs.c (main): Call init_random.
8144 * fns.c (Frandom): Set the seed from a string argument, if given.
8145 Remove long-obsolete Gentzel cruft.
8146 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8147 (init_random): New function.
8149 2012-09-01 Daniel Colascione <dancol@dancol.org>
8151 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8152 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8153 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8154 x_wm_set_size_hint, x_query_colors, x_real_positions,
8155 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8156 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8157 all of which have been moved to common code.
8159 * xfaces.c: Include TERM_HEADER instead of listing all possible
8160 window-system headers.
8162 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8165 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8166 directly accessing frame internals.
8168 * w32font.h: Include font.h. Define syms_of_w32font and
8171 * process.c: Include TERM_HEADER instead of listing all possible
8172 window-system headers.
8174 * nsterm.h: Remove declarations now in frame.h.
8175 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8177 * menu.c: Include TERM_HEADER instead of listing all possible
8178 window-system headers.
8180 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8183 * keyboard.c: Include TERM_HEADER instead of listing all possible
8184 window-system headers.
8186 * image.c: Include TERM_HEADER instead of listing all possible
8187 window-system headers. Declare Vlibrary_cache when compiling for
8190 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8191 window system declarations.
8193 * frame.h: Move common functions here: set_frame_menubar,
8194 x_set_window_size, x_sync, x_get_focus_frame,
8195 x_set_mouse_position, x_set_mouse_pixel_position,
8196 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8197 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8198 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8199 x_activate_menubar, x_real_positions, x_bitmap_icon,
8200 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8203 * frame.c: Include TERM_HEADER instead of listing all possible
8204 window-system headers.
8206 * font.c: Include TERM_HEADER instead of listing all possible
8207 window-system headers.
8209 * emacs.c: Include TERM_HEADER.
8211 * dispnew.c: Include TERM_HEADER instead of listing all possible
8212 window-system headers.
8214 * ccl.h: Include character.h.
8216 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8217 the current window system; include in list of objects to link into
8220 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8222 Remove mark_ttys function and fix tty_display_info initialization.
8223 * lisp.h (mark_ttys): Remove prototype.
8224 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8225 to mark_ttys because all possible values of 'top_frame' slot are
8226 the frames which are reachable from Vframe_list.
8227 * term.c (mark_ttys): Remove.
8228 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8230 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8232 Change struct frame bitfields from unsigned char to unsigned.
8233 * frame.h (struct frame): Change type of 'display_preempted',
8234 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8235 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8236 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8237 bitfields from unsigned char to unsigned.
8239 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8241 Remove unused member of struct x_output and struct w32_output.
8242 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8243 * w32term.h (struct w32_output): Likewise.
8245 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8247 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8248 does not become zero (Bug#12234).
8250 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8252 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8253 for GCC 4.7.1 x86-64.
8255 2012-08-30 Glenn Morris <rgm@gnu.org>
8257 * lread.c (init_lread): For out-of-tree builds, only add the
8258 source directory's site-lisp dir to the load-path if it exists,
8259 consistent with in-tree builds. (Bug#12302)
8261 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8263 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8264 button_values to NULL. Call setStykeMask so dialogs get a close button.
8265 (windowShouldClose:): Set window_closed.
8266 (dealloc): New member, free button_values.
8267 (process_dialog:): Make member function. Remove window argument,
8268 replace window with self. Count buttons and allocate and store values
8270 (addButton:value:row:): value is int with the name tag. Call setTag
8271 with tag. Remove return self, declare return value as void.
8272 (addString:row:): Remove return self, declare return value as void.
8273 (addSplit): Remove return self, declare return value as void.
8274 (clicked:): Remove return self, declare return value as void.
8275 Set dialog_return to button_values[seltag]. Code formatting change.
8276 (initFromContents:isQuestion:): Adjust call to process_dialog.
8277 Code formatting change.
8278 (timeout_handler:): Set timer_fired to YES.
8279 (runDialogAt:): Set timer_fired to NO.
8280 Handle click on close button as quit.
8282 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8283 Add window_closed and button_values. Add void as return value for
8284 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8285 Add process_dialog as new member.
8287 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8289 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8290 is not one of the heaps we manage. (Bug#12242)
8292 2012-08-28 Glenn Morris <rgm@gnu.org>
8294 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8296 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8298 * window.c (Fset_window_configuration): Remove handling of
8299 auto-buffer-name window parameter. Install revision of reverted
8302 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8304 Do not allow to set major mode for a dead buffer.
8305 * buffer.c (Fset_buffer_major_mode): Signal an error
8306 if the buffer is dead.
8307 (Fother_buffer, other_buffer_safely): Remove redundant
8310 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8312 Always use set_buffer_if_live to restore original buffer at unwind.
8313 * buffer.h (record_unwind_current_buffer): New function.
8314 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8315 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8316 * undo.c, window.c: Adjust users.
8317 * buffer.c (set_buffer_if_live): Fix comment.
8319 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8321 Fix usage of set_buffer_internal.
8322 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8323 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8324 * coding.c (decode_coding): Omit redundant test.
8325 * fileio.c (decide_coding_unwind): Likewise.
8326 * fns.c (secure_hash): Likewise.
8327 * insdel.c (modify_region): Likewise.
8328 * keyboard.c (command_loop_1): Likewise.
8329 * print.c (PRINTFINISH): Likewise.
8330 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8332 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8334 * dispnew.c: Use bool for boolean.
8335 (frame_garbaged, display_completed, delayed_size_change)
8336 (fonts_changed_p, add_window_display_history)
8337 (add_frame_display_history, verify_row_hash)
8338 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8339 (row_equal_p, realloc_glyph_pool)
8340 (allocate_matrices_for_frame_redisplay)
8341 (showing_window_margins_p)
8342 (adjust_frame_glyphs_for_frame_redisplay)
8343 (build_frame_matrix_from_leaf_window, make_current)
8344 (mirrored_line_dance, mirror_line_dance, update_frame)
8345 (update_window_tree, update_single_window)
8346 (check_current_matrix_flags, update_window, update_text_area)
8347 (update_window_line, set_window_update_flags, scrolling_window)
8348 (update_frame_1, scrolling, buffer_posn_from_coords)
8349 (do_pending_window_change, change_frame_size)
8350 (change_frame_size_1, sit_for):
8351 Use bool for boolean.
8352 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8353 and remove last int (actually boolean) argument, which was always 0.
8354 All callers changed.
8355 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8356 * dispextern.h (struct composition_it): Use bool for boolean.
8357 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8358 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8359 * dired.c (file_name_completion):
8360 Use bool for boolean. (This was missed in an earlier change.)
8362 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8364 * window.c (Fset_window_configuration): Revert first part of
8367 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8369 * nsterm.h (NSPanel): New class variable dialog_return.
8371 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8372 Initialize dialog_return.
8373 (windowShouldClose:): Use stop instead of stopModalWithCode.
8374 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8375 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8377 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8380 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8382 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8383 * composite.c (find_composition, composition_gstring_p)
8384 (composition_reseat_it, find_automatic_composition):
8385 * data.c (let_shadows_buffer_binding_p)
8386 (let_shadows_global_binding_p, set_internal, make_blv)
8387 (Fmake_variable_buffer_local, Fmake_local_variable)
8388 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8389 (cons_to_signed, arith_driver):
8390 * dbusbind.c (xd_in_read_queued_messages):
8391 * dired.c (directory_files_internal, file_name_completion):
8392 Use bool for booleans.
8393 * dired.c (file_name_completion):
8394 * process.h (fd_callback):
8395 Omit int (actually boolean) argument. It wasn't being used.
8397 * composite.h, lisp.h: Reflect above API changes.
8399 * cmds.c, coding.c: Use bool for booleans.
8400 * cmds.c (move_point, Fself_insert_command):
8401 * coding.h (struct composition status, struct coding_system):
8402 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8403 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8404 (emacs_mule_char, decode_coding_emacs_mule)
8405 (encode_coding_emacs_mule, detect_coding_iso_2022)
8406 (decode_coding_iso_2022, encode_invocation_designation)
8407 (encode_designation_at_bol, encode_coding_iso_2022)
8408 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8409 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8410 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8411 (encode_coding_raw_text, detect_coding_charset)
8412 (decode_coding_charset, encode_coding_charset, detect_eol)
8413 (detect_coding, get_translation_table, produce_chars)
8414 (consume_chars, reused_workbuf_in_use)
8415 (make_conversion_work_buffer, code_conversion_save)
8416 (decode_coding_object, encode_coding_object)
8417 (detect_coding_system, char_encodable_p)
8418 (Funencodable_char_position, code_convert_region)
8419 (code_convert_string, code_convert_string_norecord)
8420 (Fset_coding_system_priority):
8421 * fileio.c (Finsert_file_contents):
8422 Use bool for booleans.
8423 * coding.h, lisp.h: Reflect above API changes.
8424 * coding.c: Remove unnecessary static function decls.
8425 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8426 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8427 not a boolean 'int', since callers never look at the return value.
8428 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8429 * coding.h (decoding_buffer_size, encoding_buffer_size)
8430 (emacs_mule_string_char): Remove unused extern decls.
8431 (struct iso_2022_spec, struct coding_system):
8432 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8433 (struct emacs_mule_spec): Remove unused field 'full_support'.
8434 All initializations removed.
8435 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8437 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8439 Fix spare memory change (Bug#12286).
8440 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8441 (valid_lisp_object_p): Likewise.
8443 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8445 * window.c (Fset_window_configuration): Record any window's old
8446 buffer if it's replaced (see Bug#8789). If the new current
8447 buffer doesn't appear in the selected window, go to its old
8450 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8452 Special MEM_TYPE_SPARE to denote reserved memory.
8453 * alloc.c (enum mem_type): New memory type.
8454 (refill_memory_reserve): Use new type for spare memory.
8455 This prevents live_cons_p and live_string_p from incorrect
8456 detection of uninitialized objects from spare memory as live.
8458 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8461 * Makefile.in (.PHONY): versioclean -> versionclean.
8463 Remove unused external symbols.
8464 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8465 * window.c (Qwindow_valid_p, decode_valid_window):
8466 Now static, not extern.
8467 * data.c (Qinterval): Remove; unused.
8468 (syms_of_data): Do not define 'interval'.
8469 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8470 * window.h (decode_valid_window):
8473 * character.c, charset.c, chartab.c: Use bool for booleans.
8474 * character.c (lisp_string_width, string_count_byte8)
8475 (string_escape_byte8):
8476 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8477 (load_charset_map_from_file, map_charset_chars)
8478 (Fdefine_charset_internal, define_charset_internal)
8479 (Fdeclare_equiv_charset, find_charsets_in_text)
8480 (Ffind_charset_region, char_charset, Fiso_charset):
8481 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8482 (sub_char_table_set, sub_char_table_set_range)
8483 (char_table_set_range, optimize_sub_char_table)
8484 (map_sub_char_table):
8485 Use bool for boolean.
8486 * character.c (str_to_unibyte): Omit last boolean argument; it was
8487 always 0. All callers changed.
8488 * character.h, charset.h: Adjust to match previous changes.
8489 * character.h (char_printable_p): Remove decl of nonexistent function.
8490 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8491 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8492 are all boolean, so make them single-bit bitfields.
8494 * lisp.h (ASET): Remove attempt to detect side effects.
8495 It was meant to be temporary and it often doesn't work,
8496 because when IDX has side effects the behavior of IDX==IDX
8497 is undefined. See Stefan Monnier in
8498 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8500 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8502 * lisp.h (functionp): New function (extracted from Ffunctionp).
8503 (FUNCTIONP): Use it.
8504 * eval.c (Ffunctionp): Use it.
8506 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8508 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8509 as that's faster and simpler than static storage. Don't bother
8510 with the g_main_context_query overhead if g_main_context_pending
8511 says no events are pending.
8512 (gfds, gfds_size): Remove these static vars.
8513 (xgselect_initialize): Remove; no longer needed.
8514 All uses and decls removed.
8516 * emacs.c (fatal_error_signal_hook): Remove.
8517 All uses removed. This leftover from old code was always 0.
8519 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8520 * casefiddle.c (casify_object, casify_region):
8521 * casetab.c (set_case_table):
8522 * category.c, category.h (word_boundary_p):
8523 * category.h (CHAR_HAS_CATEGORY):
8524 Use bool for booleans, instead of int.
8526 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8528 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8530 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8532 On assertion failure, print backtrace if available.
8533 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8534 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8535 * Makefile.in (LIB_EXECINFO): New macro.
8538 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8539 * bytecode.c (exec_byte_code):
8540 * callint.c (check_mark, Fcall_interactively):
8541 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8542 (getenv_internal, sync_process_alive, call_process_exited):
8543 * lisp.h (USE_SAFE_ALLOCA):
8544 Use bool for booleans, instead of int.
8545 * lisp.h, process.h: Adjust prototypes to match above changes.
8546 * callint.c (Fcall_interactively): Don't assume the mark's
8547 offset fits in 'int'.
8549 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8551 * buffer.c, buffer.h: Use bool for boolean.
8552 * buffer.c (reset_buffer_local_variables)
8553 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8554 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8555 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8556 (overlay_touches_p, overlay_strings, Foverlay_put)
8557 (report_overlay_modification, call_overlay_mod_hooks):
8558 (mmap_enlarge, mmap_set_vars):
8559 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8560 Use bool for booleans, instead of int.
8561 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8562 since the 1-or-0 return value is always ignored anyway.
8563 (mmap_initialized_p):
8564 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8565 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8567 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8569 * bidi.c: Use bool for boolean.
8570 This is a bit more readable, and makes the text segment of bidi.o
8571 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8572 Presumably it's faster too.
8573 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8575 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8576 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8577 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8578 (bidi_explicit_dir_char, bidi_level_of_next_char)
8579 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8580 Use bool for booleans, instead of int.
8581 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8582 (bidi_unshelve_cache): Adjust decls to match code.
8584 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8586 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8589 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8591 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8592 * atimer.h: Include <stdbool.h>.
8594 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8596 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8597 compile time tests instead of run time tests on systems that do
8599 (FRAME_MAC_P): Remove leftover from deleted code.
8600 * frame.c (syms_of_frame): Remove leftover from deleted code.
8602 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8604 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8606 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8608 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8609 Otherwise, the compiler complains about (A?B:C) where B is void
8610 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8611 (fontset_add): Return void, for FONTSET_ADD.
8613 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8615 * alloc.c: Use bool for booleans.
8616 (gc_in_progress, abort_on_gc)
8617 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8618 (dont_register_blocks) [GC_MALLOC_CHECK]:
8619 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8620 (check_string_bytes, make_specified_string, memory_full)
8621 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8622 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8623 (mark_stack, valid_pointer_p, make_pure_string)
8624 (Fgarbage_collect, survives_gc_p, gc_sweep):
8625 Use bool for booleans, instead of int.
8626 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8627 Remove unused local.
8628 * alloc.c (PURE_POINTER_P):
8629 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8630 * editfns.c (Fformat):
8631 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8633 * fns.c (sweep_weak_table):
8634 * lisp.h (suppress_checking, push_message, survives_gc_p)
8635 (make_pure_string, gc_in_progress, abort_on_gc):
8636 * lread.c (readchar, read1):
8637 * print.c (Fprin1_to_string):
8638 * xdisp.c (push_message):
8639 Use bool for booleans affected directly or indirectly by
8642 Make recently-introduced setters macros.
8643 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8644 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8645 (set_fontset_default, set_fontset_fallback): Rename from their
8646 upper-case counterparts, and make them functions rather than macros.
8647 This is more consistent with the other recently-introduced setters.
8648 These don't need to be inline, since they're local.
8650 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8652 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8653 the loop (Bug#12247).
8655 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8657 * lisp.h (vcopy): Use memcpy rather than our own loop.
8658 This fixes a performance regression introduced by the recent
8659 addition of vcopy. This means 'vcopy' will need to be modified
8660 for a copying collector, but that's OK. Also, tighten the
8661 checking in the assertion.
8663 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8665 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8666 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8667 non-base glyph for the width of the base character, according to
8668 what x_draw_composite_glyph_string_foreground expects.
8669 Generate WADJUST value according to composition_gstring_width's
8670 expectations, to produce correct width of the composed character.
8671 Reverse the sign of the DU offset produced by ScriptPlace.
8673 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8675 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8677 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8679 Avoid direct writes to contents member of struct Lisp_Vector.
8680 * lisp.h (vcopy): New function to copy data into vector.
8681 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8682 * fns.c (Ffillarray): Use ASET.
8683 * keyboard.c (timer_check_2): Use AREF and ASET.
8684 (append_tool_bar_item, Frecent_keys): Use vcopy.
8685 * lread.c (read_vector): Use ASET.
8686 * msdos.c (Frecent_doskeys): Use vcopy.
8687 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8688 (Finternal_merge_in_global_face): Use ASET and vcopy.
8689 * xfont.c (xfont_list_pattern): Likewise.
8691 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8693 * window.c (Fwindow_point): For the selected window always return
8694 the position of its buffer's point.
8695 (Fset_window_point): For the selected window always go in its
8696 buffer to the specified position.
8698 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8700 Setter macros for fontsets.
8701 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8702 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8703 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8706 2012-08-20 Glenn Morris <rgm@gnu.org>
8708 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8709 Don't assume that `ln -f' works.
8711 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8713 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8714 and later about non-assignments with no effect. See discussion at
8715 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8718 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8720 Inline setter functions for Lisp_Objects slots of struct specbinding.
8721 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8724 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8726 * window.c (select_window): Always make selected window's buffer
8729 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8731 Use AREF and ASET for docstrings of category tables.
8732 * category.h (CATEGORY_DOCSTRING): Use AREF.
8733 (SET_CATEGORY_DOCSTRING): Use ASET.
8734 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8736 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8738 Inline setter functions for hash table members.
8739 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8740 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8741 (set_hash_key_and_value, set_hash_index, set_hash_next)
8742 (set_hash_hash): New functions.
8743 * charset.c, fns.c: Adjust users.
8745 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8747 Inline getter and setter functions for per-buffer values.
8748 * buffer.h (per_buffer_default, set_per_buffer_default)
8749 (per_buffer_value, set_per_buffer_value): New functions.
8750 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8751 * buffer.c, data.c: Adjust users.
8753 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8755 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8757 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8759 Rely on <config.h> + <unistd.h> to declare 'environ',
8760 as gnulib does this if the system doesn't.
8761 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8762 Remove declaration. MS-Windows declares it on stdlib.h which is
8763 included by conf_post.h.
8764 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8765 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8766 * vm-limit.c: Include <unistd.h>, for 'environ'.
8768 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8769 (start_of_data): Remove decl; mem-limits.h provides it.
8771 * xdisp.c (handle_invisible_prop): Make it a bit faster
8772 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8774 2012-08-19 Chong Yidong <cyd@gnu.org>
8776 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8779 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8781 * .gdbinit: Use call instead of set when calling a function in the
8784 * data.c (set_internal): Don't use set_blv_found.
8785 (Fkill_local_variable): Likewise.
8787 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8789 * nsfont.m (ns_ascii_average_width): Ensure the string
8790 ascii_printable is initialized with a null-terminated character
8791 array. Otherwise, it can contain undesired extra characters.
8793 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8795 port new setting code to Sun C 5.8 2005/10/13
8796 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8797 Return void, not Lisp_Object. Otherwise, the compiler
8798 complains about (A?B:C) where B is void and C is Lisp_Object
8799 when compiling CHAR_TABLE_SET, due to the recent change to
8800 the API of sub_char_table_set_contents.
8802 2012-08-18 Chong Yidong <cyd@gnu.org>
8804 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8805 for the string case (Bug#3874).
8807 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8809 * buffer.h (BSET): Remove (Bug#12215).
8810 Replace all uses with calls to new setter functions.
8811 (bset_bidi_paragraph_direction, bset_case_canon_table)
8812 (bset_case_eqv_table, bset_directory, bset_display_count)
8813 (bset_display_time, bset_downcase_table)
8814 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8815 (bset_last_selected_window, bset_local_var_alist)
8816 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8817 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8819 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8820 (bset_auto_fill_function, bset_auto_save_file_format)
8821 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8822 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8823 (bset_cache_long_line_scans, bset_case_fold_search)
8824 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8825 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8826 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8827 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8828 (bset_header_line_format, bset_indicate_buffer_boundaries)
8829 (bset_indicate_empty_lines, bset_invisibility_spec)
8830 (bset_left_fringe_width, bset_major_mode, bset_mark)
8831 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8832 (bset_name, bset_overwrite_mode, bset_pt_marker)
8833 (bset_right_fringe_width, bset_save_length)
8834 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8835 (bset_scroll_up_aggressively, bset_selective_display)
8836 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8837 (bset_word_wrap, bset_zv_marker):
8838 * category.c (bset_category_table):
8839 * syntax.c (bset_syntax_table):
8840 New setter functions.
8842 * process.h (PSET): Remove (Bug#12215).
8843 Replace all uses with calls to new setter functions.
8844 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8845 (PROCESS_INLINE): New macro.
8846 (pset_childp): New setter function.
8847 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8848 * process.c (PROCESS_INLINE):
8849 Define to EXTERN_INLINE, so that the corresponding functions
8850 are compiled into code.
8851 (pset_buffer, pset_command, pset_decode_coding_system)
8852 (pset_decoding_buf, pset_encode_coding_system)
8853 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8854 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8855 (pset_type, pset_write_queue): New setter functions.
8857 * window.h (WSET): Remove (Bug#12215).
8858 Replace all uses with calls to new setter functions.
8859 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8860 (WINDOW_INLINE): New macro.
8861 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8862 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8863 (wset_total_lines, wset_vertical_scroll_bar)
8864 (wset_window_end_pos, wset_window_end_valid)
8865 (wset_window_end_vpos): New setter functions.
8866 * window.c (WINDOW_INLINE):
8867 Define to EXTERN_INLINE, so that the corresponding functions
8868 are compiled into code.
8869 (wset_combination_limit, wset_dedicated, wset_display_table)
8870 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8871 (wset_new_normal, wset_new_total, wset_next_buffers)
8872 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8873 (wset_prev_buffers, wset_right_fringe_width)
8874 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8875 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8876 (wset_window_parameters):
8877 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8878 (wset_column_number_displayed, wset_region_showing):
8879 New setter functions.
8881 * termhooks.h (TSET): Remove (Bug#12215).
8882 Replace all uses with calls to new setter functions.
8883 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8884 (TERMHOOKS_INLINE): New macro.
8885 (tset_charset_list, tset_selection_alist): New setter functions.
8886 * terminal.c (TERMHOOKS_INLINE):
8887 Define to EXTERN_INLINE, so that the corresponding functions
8888 are compiled into code.
8889 (tset_param_alist): New setter function.
8891 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8893 * keyboard.h (KSET): Remove (Bug#12215).
8894 Replace all uses with calls to new setter functions.
8895 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8896 (KEYBOARD_INLINE): New macro.
8897 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8898 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8899 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8900 New setter functions.
8901 * keyboard.c (KEYBOARD_INLINE):
8902 Define to EXTERN_INLINE, so that the corresponding functions
8903 are compiled into code.
8904 (kset_echo_string, kset_kbd_queue)
8905 (kset_keyboard_translate_table, kset_last_prefix_arg)
8906 (kset_last_repeatable_command, kset_local_function_key_map)
8907 (kset_overriding_terminal_local_map, kset_real_last_command)
8908 (kset_system_key_syms): New setter functions.
8910 * frame.h (FSET): Remove (Bug#12215).
8911 Replace all uses with calls to new setter functions.
8912 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8913 (FRAME_INLINE): New macro.
8914 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8915 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8916 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8917 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8918 (fset_param_alist, fset_root_window, fset_scroll_bars)
8919 (fset_selected_window, fset_title, fset_tool_bar_items)
8920 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8921 * frame.c (FRAME_INLINE):
8922 Define to EXTERN_INLINE, so that the corresponding functions
8923 are compiled into code.
8924 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8926 A few more naming-convention fixes for getters and setters.
8927 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8928 and rename from buffer_overlays_set_before.
8929 (set_buffer_overlays_after): Move here from buffer.h, and rename
8930 from buffer_overlays_set_after.
8931 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8933 (set_buffer_intervals): Rename from buffer_set_intervals.
8934 * intervals.c (set_interval_object): Move here from intervals.h,
8935 and rename from interval_set_object.
8936 (set_interval_left): Move here from intervals.h, and rename from
8938 (set_interval_right): Move here from intervals.h, and rename from
8940 (copy_interval_parent): Move here from intervals.h, and rename from
8941 interval_copy_parent.
8942 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8943 (set_interval_plist): Rename from interval_set_plist.
8944 Return void, not Lisp_Object, since no caller uses the result.
8945 * lisp.h (string_intervals): Rename from string_get_intervals.
8946 (set_string_intervals): Rename from string_set_intervals.
8948 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8949 (set_char_table_contents): Rename from char_table_set_contents.
8950 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8951 All uses changed. See the end of
8952 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8954 * lisp.h (CSET): Remove (Bug#12215).
8955 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8956 (set_char_table_purpose): New functions,
8957 replacing CSET. All uses changed. For example, replace
8958 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8959 "set_char_table_parent (char_table, parent);".
8960 The old version was confusing because it used the same name
8961 'parent' for two different things.
8963 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8965 Functions to get and set Lisp_Object fields of buffer-local variables.
8966 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8967 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8968 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8969 * data.c, eval.c, frame.c: Adjust users.
8971 2012-08-17 Chong Yidong <cyd@gnu.org>
8973 * xfaces.c (merge_face_vectors): If the target font specfies a
8974 font spec, make the font's attributes take precedence over
8975 directly-specified attributes.
8976 (merge_face_ref): Recognize :font.
8978 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8980 Do not use memcpy for copying intervals.
8981 * intervals.c (reproduce_interval): New function.
8982 (reproduce_tree, reproduce_tree_obj): Use it.
8983 (reproduce_tree_obj): Remove prototype.
8985 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8987 * lisp.h (duration_to_sec_usec): Remove unused decl.
8989 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8991 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8992 to an allocated instance of NSString, not to the class itself.
8994 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8996 * makefile.w32-in (C_CTYPE_H): New macro.
8997 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8998 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8999 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
9001 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
9003 Use ASCII tests for character types.
9004 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
9006 Don't include <ctype.h>; was not needed.
9007 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
9008 * sysdep.c, xfaces.c:
9009 Include <c-ctype.h> instead of <ctype.h>.
9010 * nsterm.m: Include <c-ctype.h>.
9011 * charset.c (read_hex):
9012 * doc.c (Fsnarf_documentation):
9013 * fileio.c (IS_DRIVE) [WINDOWSNT]:
9014 (DRIVE_LETTER) [DOS_NT]:
9015 (Ffile_name_directory, Fexpand_file_name)
9016 (Fsubstitute_in_file_name):
9017 * font.c (font_parse_xlfd, font_parse_fcname):
9018 * frame.c (x_set_font_backend):
9019 * gtkutil.c (xg_get_font):
9020 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
9021 * nsimage.m (hexchar):
9022 * nsterm.m (ns_xlfd_to_fontname):
9023 * sysdep.c (system_process_attributes):
9024 * xfaces.c (hash_string_case_insensitive):
9025 Use C-locale tests instead of locale-specific tests for character
9026 types, since we want the ASCII interpretation here, not the
9027 interpretation suitable for whatever happens to be the current locale.
9029 2012-08-16 Martin Rudalics <rudalics@gmx.at>
9031 Consistently check windows for validity/liveness
9032 (Bug#11984, Bug#12025, Bug#12026).
9033 * lisp.h (CHECK_VALID_WINDOW): New macro.
9034 * window.c (decode_window): Rename to decode_live_window.
9035 (decode_valid_window, Fwindow_valid_p): New functions.
9036 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9037 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9038 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9039 (Fwindow_prev_sibling, Fwindow_combination_limit)
9040 (Fset_window_combination_limit, Fwindow_use_time)
9041 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9042 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9043 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9044 (Fwindow_hscroll, Fset_window_hscroll)
9045 (Fwindow_redisplay_end_trigger)
9046 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9047 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9048 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9049 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9050 (Fwindow_end, Fset_window_point, Fset_window_start)
9051 (Fpos_visible_in_window_p, Fwindow_line_height)
9052 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9053 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9054 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9055 (Fset_window_parameter, Fwindow_display_table)
9056 (Fset_window_display_table, Fdelete_other_windows_internal)
9057 (Fset_window_buffer, Fset_window_new_total)
9058 (Fset_window_new_normal, Fdelete_window_internal)
9059 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9060 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9061 (Fwindow_scroll_bars): Check whether argument window is a valid or
9062 live window. Update doc-strings.
9063 (syms_of_window): New symbol Qwindow_valid_p.
9064 * keyboard.c (Fposn_at_x_y): Check whether argument
9065 frame_or_window denotes a valid window.
9067 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9069 Fix previous char table change.
9070 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9071 * chartab.c (optimize_sub_char_table): Likewise.
9073 2012-08-16 Chong Yidong <cyd@gnu.org>
9075 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9077 * xfont.c (xfont_open):
9078 * xftfont.c (xftfont_open): Set the font's max_width field.
9080 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9081 min_width to space_width and average_width to the average over
9082 printable ASCII characters.
9083 (ns_char_width): Code cleanup.
9084 (ns_ascii_average_width): New utility function.
9086 * font.h (struct font): Update comments.
9088 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9090 Simple interface to set Lisp_Object fields of character tables.
9091 * lisp.h (CSET): New macro.
9092 (char_table_set_extras, char_table_set_contents)
9093 (sub_char_table_set_contents): New function.
9094 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9095 * syntax.c: Adjust users.
9097 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9099 * eval.c (eval_sub): Bind lexical-binding.
9100 * lread.c (Qlexical_binding): Make non-static.
9102 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9104 * nsmenu.m (popupSession): Remove.
9105 (pop_down_menu): Remove endModalSession.
9106 (timeout_handler:): New method.
9107 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9108 Call runModalForWindow. Check timer_fired when it returns.
9109 If not set, cancel timer and break out of loop.
9110 Otherwise loop again, with a new timeout.
9112 * nsterm.m: Include fcntl.h if present.
9113 (fd_entry, t_readfds, inNsSelect): Remove.
9114 (select_writefds, select_valid, select_timeout, selfds)
9115 (select_mutex, apploopnr): Add.
9116 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9117 Otherwise call kbd_buffer_store_event.
9118 (ns_send_appdefined): Remove release of fd_entry.
9119 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9120 Increment and decrement apploopnr.
9121 (ns_select): If no file descriptors, just do a NSTimer.
9122 Otherwise copy read/write masks and start select thread (fd_handler).
9123 Start main loop and wait for application defined event.
9124 Inform select thread to stop selecting after main loop is exited.
9125 (ns_term_init): Create selfds pipe and set non-blocking.
9126 Initialize select_mutex. Start the select thread (fd_handler).
9127 (fd_handler:): Loop forever, wait for info from the main thread
9128 to either start or stop selecting. When select returns, send
9129 and appdefined event.
9130 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9131 If not call kbd_buffer_store_event.
9133 * nsterm.h (EmacsApp): fd_handler takes id argument.
9134 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9136 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9138 2012-08-15 Eli Zaretskii <eliz@gnu.org>
9140 * region-cache.c (move_cache_gap): Update gap_len using the actual
9141 growth of the boundaries array. Do not change cache_len.
9144 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9146 Generalize and cleanup font subsystem checks.
9147 * font.h (FONT_DEBUG, font_assert): Remove.
9148 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9149 Change font_assert to eassert. Use eassert where appropriate.
9151 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9153 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9155 2012-08-15 Chong Yidong <cyd@gnu.org>
9157 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9158 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9159 extract the font descriptor instead of just the font name.
9160 In that case, return a font spec instead of a string.
9161 (x_last_font_name): Move to this file from xfns.c.
9163 * xfns.c (Fx_select_font): The return value can also be a font
9164 spec. Move x_last_font_name management to gtkutil.c.
9166 * xfaces.c: Make font weight and style symbols non-static.
9168 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9170 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9173 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9175 * alloc.c (Fgarbage_collect): Use plural form consistently.
9177 2012-08-14 Eli Zaretskii <eliz@gnu.org>
9179 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9180 iteration through the command loop. Fixes a problem whereby mouse
9181 movements are ignored until the first mouse click.
9183 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9185 Use bool, not int, for Lisp booleans.
9186 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9187 makes Emacs a bit smaller and presumably a bit faster.
9188 * lisp.h: Include <stdbool.h>.
9189 (struct Lisp_Boolfwd, defvar_bool):
9190 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9191 * regex.c [!emacs]: Include <stdbool.h>.
9192 (false, true): Remove; <stdbool.h> does this for us now.
9194 2012-08-14 Chong Yidong <cyd@gnu.org>
9196 * character.c (Fcharacterp): Doc fix (Bug#12076).
9198 * data.c (Findirect_variable): Doc fix (Bug#11040).
9200 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9202 * editfns.c (Fformat): Doc fix (Bug#12059).
9203 (Fsave_current_buffer): Doc fix (Bug#11542).
9205 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9207 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9210 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9212 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9213 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9214 * minibuf.c (choose_minibuf_frame, read_minibuf):
9215 * w32fns.c (x_create_tip_frame):
9216 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9217 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9219 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9221 * intervals.c (offset_intervals): Remove obsolete comment.
9223 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9225 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9227 2012-08-14 Gergely Risko <gergely@risko.hu>
9229 * coding.c (decode_coding): Record buffer modification before
9230 disabling undo_list (Bug#11773).
9232 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9234 Revert and cleanup some recent overlay changes.
9235 * buffer.h (enum overlay_type): Remove.
9236 (buffer_get_overlays, buffer_set_overlays): Likewise.
9237 (buffer_set_overlays_before, buffer_set_overlays_after):
9238 New function. Adjust users.
9239 (unchain_both): Add eassert.
9241 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9243 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9245 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9247 * gtkutil.c (xg_mark_data): Don't assume C99.
9249 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9251 * gtkutil.c (xg_frame_tb_info): New struct.
9252 (TB_INFO_KEY): New define.
9253 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9254 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9255 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9257 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9258 is up to date. Otherwise store new data.
9259 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9261 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9263 Use KSET for write access to Lisp_Object members of struct kboard.
9264 * keyboard.h (KSET): New macro.
9265 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9266 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9267 * xterm.c: Adjust users.
9269 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9271 Use BSET for write access to Lisp_Object members of struct buffer.
9272 * buffer.h (BSET): New macro.
9273 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9274 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9275 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9276 * window.c, xdisp.c, xfns.c: Adjust users.
9278 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9280 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9282 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9284 * nsterm.m (not_in_argv): New function.
9285 (application:openFile, application:openTempFile:):
9286 (application:openFileWithoutUI:, application:openFiles:): Open file
9287 if not_in_argv returns non-zero (bug#12171).
9289 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9290 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9291 Define for Gtk+ versions less than 3.2.
9292 (xg_get_font_name): Use those functions/macros here.
9293 Reported by Frans Oilinki <moilinki@gmail.com>.
9295 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9297 * unexmacosx.c (copy_data_segment): Copy initialized data in
9298 statically linked libraries from input file rather than memory.
9300 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9301 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9302 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9304 2012-08-10 Glenn Morris <rgm@gnu.org>
9306 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9307 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9309 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9311 Fix last change to allow compilation with low optimization levels.
9312 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9313 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9315 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9317 Use common inline syntax in intervals.h.
9318 * intervals.h (INTERVALS_INLINE): New macro.
9319 Change all users from LISP_INLINE.
9321 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9323 Define Qnone once for all platforms.
9324 * frame.c (Qnone): Define here.
9325 (syms_of_frame): DEFSYM it.
9326 * lisp.h (Qnone): New declaration.
9327 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9328 * xfns.c: Remove duplication. Adjust users.
9330 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9332 Remove unused macros from intervals.h.
9333 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9334 * intervals.c: Adjust comment.
9336 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9338 * w32fns.c <w32_unicode_gui>: New static variable.
9339 (globals_of_w32fns): Initialize it according to os_subtype.
9340 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9343 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9344 Eli Zaretskii <eliz@gnu.org>
9346 Fix bug #10299 with Unicode characters sent by customized
9347 keyboards created by MSKLC.
9348 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9349 (w32_init_class): Use it to initialize the Emacs class with either
9350 ANSI or Unicode API calls.
9351 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9353 (w32_wnd_proc): If the character code sent by WM_CHAR or
9354 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9355 original message. Call DefWindowProcW on NT and later.
9357 2012-08-10 Glenn Morris <rgm@gnu.org>
9359 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9361 * lisp.h (DIRECTORY_SEP): Let configure set it.
9363 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9365 Use TSET for write access to Lisp_Object slots of struct terminal.
9366 * termhooks.h (TSET): New macro.
9367 * coding.c, terminal.c, xselect.c: Adjust users.
9369 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9371 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9372 the failing expression, include them in the error message.
9373 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9374 * lisp.h (internal_condition_case_n): Update declaration.
9376 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9378 Inline functions to examine and change buffer overlays.
9379 * buffer.c (unchain_both): New function.
9380 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9381 (buffer_has_overlays): New function.
9382 (enum overlay_type): New enum.
9383 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9384 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9386 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9388 Inline functions to examine and change buffer intervals.
9389 * alloc.c (mark_interval_tree): Remove.
9390 (MARK_INTERVAL_TREE): Simplify.
9391 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9392 * intervals.c (buffer_balance_intervals): New function.
9393 (graft_intervals_into_buffer): Adjust indentation.
9394 (set_intervals_multibyte): Simplify.
9395 * buffer.h (BUF_INTERVALS): Remove.
9396 (buffer_get_intervals, buffer_set_intervals): New function.
9397 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9398 * intervals.c, textprop.c: Adjust users.
9400 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9402 Inline functions to examine and change string intervals.
9403 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9404 (string_get_intervals, string_set_intervals): New function.
9405 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9406 * lread.c, print.c, textprop.c: Adjust users.
9408 2012-08-08 Glenn Morris <rgm@gnu.org>
9410 * lisp.mk (lisp): Remove language/persian.elc.
9412 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9415 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9416 (NULL_INTERVAL_P): Likewise. Adjust users.
9417 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9418 Adjust comment. Move under #if 0.
9419 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9420 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9422 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9424 Check total length of intervals with eassert.
9425 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9426 * intervals.c: Change all users to eassert.
9428 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9430 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9431 Rename fields to match removal of FGET and WGET and disuse of
9432 INTERNAL_FIELD in Lisp_Cons.
9434 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9436 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9437 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9438 name since all xname users are fixed long time ago. Do not
9440 (set_symbol_name, set_symbol_function, set_symbol_plist):
9441 (set_symbol_next, set_overlay_plist): New function.
9442 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9443 (struct Lisp_Overlay): Likewise.
9444 (CVAR, MVAR, SVAR): Remove.
9445 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9446 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9447 * xterm.c: Adjust users.
9448 * .gdbinit: Change to use name field of struct Lisp_Symbol
9451 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9453 Basic functions to set Lisp_Object and pointer slots of intervals.
9454 * intervals.h (interval_set_parent, interval_set_object):
9455 (interval_set_left, interval_set_right, interval_set_plist):
9456 (interval_copy_parent): New function.
9457 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9458 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9460 (INTERVAL_SIZE): Remove. Adjust users.
9461 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9463 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9465 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9466 * process.h (PGET): Remove.
9467 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9468 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9470 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9472 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9473 * window.h (WGET): Remove.
9474 (struct window): Do not use INTERNAL_FIELD.
9475 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9476 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9477 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9478 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9479 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9482 2012-08-07 Chong Yidong <cyd@gnu.org>
9484 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9485 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9486 (Fdelete_window_internal): Signal an error if the window is not on
9487 a live frame (Bug#12025).
9489 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9491 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9492 * frame.h (FGET): Remove.
9493 (struct frame): Do not use INTERNAL_FIELD.
9494 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9495 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9496 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9497 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9499 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9501 * w32.c: Silence compiler warnings.
9502 (map_w32_filename): Remove unused variable `is_fat'.
9503 (chase_symlinks): Add parentheses around expression.
9505 2012-08-06 Glenn Morris <rgm@gnu.org>
9507 * sysdep.c: Respect BROKEN_GETWD.
9509 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9510 Let configure handle it.
9511 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9513 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9515 Use GCALIGNMENT where appropriate.
9516 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9517 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9518 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9520 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9522 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9523 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9525 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9527 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9528 that should be sufficient for everyone.
9530 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9532 * keyboard.c (timer_check_2): Add break so timer_check returns next
9535 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9537 Fix Windows build errors introduced after converting to WGET and WSET.
9538 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9539 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9541 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9543 * nsterm.m (ns_frame_rehighlight): Use FSET.
9545 * nsmenu.m (ns_update_menubar): Use FSET.
9547 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9549 Separate read and write access to Lisp_Object slots of Lisp_Process.
9550 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9551 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9553 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9555 Separate read and write access to Lisp_Object slots of struct window.
9556 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9557 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9558 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9559 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9560 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9561 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9564 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9566 Fix Windows build errors introduced after converting to FGET and FSET.
9567 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9568 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9569 (w32_judge_scroll_bars): Change to use FSET.
9570 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9572 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9574 Fix replacement typo.
9575 * window.c (replace_window): Set root_window instead of
9576 selected_window. This fixes a total window subsystem
9577 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9579 2012-08-06 Glenn Morris <rgm@gnu.org>
9581 * lisp.mk (lisp): Add language/persian.elc.
9583 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9585 Separate read and write access to Lisp_Object slots of struct frame.
9586 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9587 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9588 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9589 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9590 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9592 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9594 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9596 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9598 Generalize common compile-time constants.
9599 * lisp.h (header_size, bool_header_size, word_size): Now here.
9600 (struct Lisp_Vector): Add comment.
9601 (struct Lisp_Bool_Vector): Move up to define handy constants.
9602 (VECSIZE, PSEUDOVECSIZE): Simplify.
9603 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9604 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9605 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9606 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9607 * xfont.c, xmenu.c: Use word_size where appropriate.
9609 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9611 * search.c (Freplace_match): Treat \? in the replacement text
9612 literally (Bug#8161).
9614 2012-08-05 Chong Yidong <cyd@gnu.org>
9616 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9617 * frame.c (Vdelete_frame_functions):
9618 * emacs.c (Vkill_emacs_hook): Doc fix.
9620 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9622 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9623 --with-x-toolkit=no builds.
9624 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9626 2012-08-04 Chong Yidong <cyd@gnu.org>
9628 * syntax.c (Fmodify_syntax_entry): Doc fix.
9630 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9632 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9633 * w32.c (init_environment): Change the default values of many
9634 environment variables in dflt_envvars[] to NULL, to avoid pushing
9635 them into environment when they were not already defined.
9636 Remove the code that deletes site-lisp subdirectories from the default
9637 value of EMACSLOADPATH, as it is no longer needed.
9638 (check_windows_init_file): Now external, not static.
9639 Use Vload_path as is, without adding anything, as this function is now
9640 called when Vload_path is already set up.
9642 * w32.h (check_windows_init_file): Add prototype.
9644 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9645 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9646 compatibility with Posix platforms.
9647 (main): Move the call to check_windows_init_file to here from
9649 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9650 any, in the DEFALT argument into the root of the Emacs build or
9651 installation tree, as appropriate.
9653 * callproc.c (init_callproc_1): Call decode_env_path instead of
9654 doing its equivalent by hand.
9655 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9656 the code that sets Vexec_path run on MS-Windows.
9658 * lread.c (init_lread): Add comments to #ifdef's.
9660 * msdos.c (dos_set_window_size, IT_update_begin)
9661 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9662 instead of direct references.
9664 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9666 Export DEFAULT_REHASH_* to GDB.
9667 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9668 Now constants, not macros.
9670 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9672 Remove unnecessary casts involving pointers.
9673 These casts are no longer needed now that we assume C89 or later,
9674 since they involve casting to or from void *.
9675 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9676 (make_pure_float, make_pure_vector):
9677 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9678 * macros.c (Fstart_kbd_macro):
9679 * menu.c (find_and_return_menu_selection):
9680 * minibuf.c (read_minibuf_noninteractive):
9681 * sysdep.c (closedir):
9682 * xdisp.c (x_produce_glyphs):
9683 * xfaces.c (compare_fonts_by_sort_order):
9684 * xfns.c (x_real_positions, select_visual):
9685 * xselect.c (x_stop_queuing_selection_requests)
9686 (x_get_window_property, x_get_window_property_as_lisp_data):
9687 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9688 Remove unnecessary pointer casts.
9689 * alloc.c (record_xmalloc): New function.
9690 * lisp.h (record_xmalloc): New decl.
9691 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9692 more like a function. This is because the pointer cast is not
9693 needed. All uses changed.
9694 * print.c (print_string, print_error_message): Avoid length recalc.
9696 Improve fix for macroexp crash with debugging (Bug#12118).
9697 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9698 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9699 not supposed to be invoked from the garbage collector.
9700 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9701 (gc_aset): New function, which is like ASET but can be
9702 used in the garbage collector.
9703 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9704 (set_hash_index): Use it instead of ASET.
9706 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9708 Support symlinks on latest versions of MS-Windows.
9709 * w32.c: Include winioctl.h and aclapi.h.
9710 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9711 (revert_to_self): Forward declarations of static functions.
9712 <static BOOL g_b_init_get_security_info>:
9713 <g_b_init_create_symbolic_link>: New static flags.
9714 (globals_of_w32): Initialize them to zero.
9715 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9716 (map_w32_filename): Improve commentary. Simplify switch.
9717 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9718 headers (most versions of MinGW w32api don't).
9719 (get_security_info, create_symbolic_link)
9720 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9722 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9723 in the argument file name.
9724 (sys_access): Call unc_volume_file_attributes only if
9725 GetFileAttributes fails with network-related error codes.
9726 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9727 have the required privileges.
9728 (get_file_security_desc_by_name): Rename from
9729 get_file_security_desc.
9730 (stat_worker): New function, with most of the guts of 'stat', and
9731 with addition of handling of symlinks and support for 'lstat'.
9732 If possible, get file's attributes and security information by
9733 handle, not by name. Produce S_IFLNK bit for symlinks, when
9734 called from 'lstat'.
9735 (stat, lstat): New functions, call 'stat_worker'.
9736 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9737 symlinks when the underlying filesystem supports them.
9739 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9741 Fix macroexp crash on Windows with debugging (Bug#12118).
9742 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9743 checking subscripts; problem introduced with the recent
9744 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9745 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9746 since it's used in non-static inline functions now.
9748 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9749 Don't assume buffer size fits in 'int'. Remove unused local.
9751 Use C99-style 'extern inline' if available.
9752 * buffer.h (BUFFER_INLINE):
9753 * category.h (CATEGORY_INLINE):
9754 * character.h (CHARACTER_INLINE):
9755 * charset.h (CHARSET_INLINE):
9756 * composite.h (COMPOSITE_INLINE):
9757 * dispextern.h (DISPEXTERN_INLINE):
9758 * lisp.h (LISP_INLINE):
9759 * systime.h (SYSTIME_INLINE):
9760 New macro, replacing 'static inline' in this header.
9761 * buffer.h, category.h, character.h, charset.h, composite.h:
9762 * dispextern.h, lisp.h, systime.h:
9763 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9764 * alloc.c (LISP_INLINE):
9765 * buffer.c (BUFFER_INLINE):
9766 * category.c (CATEGORY_INLINE):
9767 * character.c (CHARACTER_INLINE):
9768 * charset.c (CHARSET_INLINE):
9769 * composite.c (COMPOSITE_INLINE):
9770 * dispnew.c (DISPEXTERN_INLINE):
9771 * sysdep.c (SYSTIME_INLINE):
9772 Define to EXTERN_INLINE, so that the corresponding functions
9773 are compiled into code.
9774 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9775 (INLINE_HEADER_END): New macros.
9776 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9777 since it's used in non-static inline functions now.
9778 (VALMASK) [!USE_LSB_TAG]: Likewise.
9780 2012-08-02 Glenn Morris <rgm@gnu.org>
9782 * s/: Remove empty directory.
9784 * s/ms-w32.h: Move to ../nt/inc.
9785 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9786 Update for new ms-w32.h location.
9788 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9791 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9793 2012-08-02 Glenn Morris <rgm@gnu.org>
9795 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9796 hard-coding the path separator.
9798 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9800 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9801 This how ASET and AREF are supposed to work, and makes
9802 it easier to think about future improvements. See
9803 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9804 * charset.h (set_charset_attr): New function.
9805 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9806 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9807 (aref_addr): New function. All uses of &AREF(...) changed.
9808 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9809 (set_hash_index): New functions. All lvalue-style uses of
9810 HASH_KEY etc. changed.
9811 * keyboard.c (set_prop): New function. All lvalue-style uses
9814 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9816 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9817 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9818 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9819 * nsfns.m (ns_set_name_as_filename): Likewise.
9820 * nsmenu.m (ns_update_menubar): Likewise.
9821 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9823 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9825 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9826 Adapt to latest changes in field names of the corresponding Lisp
9829 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9831 2012-08-01 Glenn Morris <rgm@gnu.org>
9833 * s/msdos.h: Remove file.
9834 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9835 * Makefile.in (S_FILE): Remove.
9836 (config_h): Remove S_FILE.
9838 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9840 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9841 Remove; moved to nt/config.nt.
9843 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9845 Use INTERNAL_FIELD for conses and overlays.
9846 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9847 Remove obsolete comment.
9849 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9850 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9852 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9854 Use INTERNAL_FIELD for symbols.
9855 * lisp.h (SVAR): New macro. Adjust users.
9856 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9857 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9859 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9861 Use INTERNAL_FIELD for processes.
9862 * process.h (PVAR): New macro. Adjust style.
9863 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9864 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9866 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9868 Use INTERNAL_FIELD for windows.
9869 * window.h (WVAR): New macro.
9870 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9871 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9872 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9873 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9874 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9875 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9877 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9879 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9881 2012-08-01 Glenn Morris <rgm@gnu.org>
9883 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9884 Move to configure.ac.
9886 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9888 * makefile.w32-in (CONFIG_H): Update dependencies.
9889 (CONF_POST_H): New macro.
9891 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9893 2012-07-31 Glenn Morris <rgm@gnu.org>
9895 * Makefile.in (S_FILE): No longer set by configure.
9897 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9899 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9901 * process.h (NULL_DEVICE):
9902 * emacs.c (SEPCHAR):
9903 * editfns.c (USER_FULL_NAME): Let configure set them.
9905 * s/README, s/template.h: Remove files.
9907 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9909 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9910 Move to configure.ac.
9912 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9914 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9915 resulting renaming of 'struct frame' members.
9917 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9919 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9920 after introduction of FVAR.
9922 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9924 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9926 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9927 instead of compositeToPoint.
9928 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9930 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9932 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9934 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9935 * lisp.h (INTERNAL_FIELD): New macro.
9936 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9937 (BVAR): Change to use INTERNAL_FIELD.
9938 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9939 (KVAR): Change to use INTERNAL_FIELD.
9940 * frame.h (FVAR): New macro.
9941 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9942 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9943 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9944 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9945 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9947 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9949 Miscellaneous fixes for non-default X toolkits.
9950 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9951 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9952 Move under #ifdef USE_LUCID.
9953 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9954 definition and usage to avoid warnings.
9956 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9958 * nsterm.m (openFiles): Fix previous checkin.
9960 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9962 * indent.c (compute_motion): Remove unused local.
9964 2012-07-31 Glenn Morris <rgm@gnu.org>
9966 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9968 * conf_post.h [USG5_4]:
9969 Move remaining contents of s/usg5-4-common.h here.
9970 * s/usg5-4-common.h: Remove file.
9972 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9973 * s/irix6-5.h: Remove file.
9975 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9976 * s/darwin.h: Remove file.
9978 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9979 * s/hpux10-20.h: Remove file, which is now empty.
9981 2012-07-30 Glenn Morris <rgm@gnu.org>
9983 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9984 * Makefile.in (config_h): Add conf_post.h.
9985 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9987 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9989 * nsterm.m (ns_do_open_file): New variable.
9990 (ns_term_init): Set ns_do_open_file to YES after run returns.
9991 (openFile, openTempFile, openFileWithoutUI, openFiles):
9992 Open files only if ns_do_open_file.
9994 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9996 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9997 This no-op macro hasn't been needed for many years.
9998 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
10000 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
10001 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
10002 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
10003 gdb_make_enums_visible.
10004 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
10005 (DIRECTORY_SEP): Now a constant, not a macro.
10007 2012-07-30 Eli Zaretskii <eliz@gnu.org>
10009 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
10010 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
10012 * w32term.c <w32_keyboard_codepage>: Renamed from
10013 keyboard_codepage and now external. All users changed.
10015 * w32term.h: Add declaration of w32_keyboard_codepage.
10017 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
10018 the codepage to translate keys to Unicode. If this argument is
10019 -1, use the value returned by GetConsoleCP. All callers changed.
10021 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10023 Update .PHONY listings in makefiles.
10024 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10025 bootstrap-clean, distclean, maintainer-clean, versioclean,
10028 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10029 This is a bit clearer. Fix some commentary typos.
10031 2012-07-30 Glenn Morris <rgm@gnu.org>
10033 * s/netbsd.h: Let configure include signal.h if needed.
10034 Remove file, which is now empty.
10036 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10037 Let configure set them.
10038 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10039 No more need to undefine.
10041 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10043 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10044 non-single-byte char when adding meta modifier. (Bug#12090)
10046 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10048 Convert safe_call to use variable number of arguments.
10049 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10050 (safe_call2): Fix comment.
10051 * lisp.h (safe_call): Adjust prototype.
10052 * coding.c (encode_coding_object): Change to use safe_call2.
10053 * xfaces.c (merge_face_heights): Change to use safe_call1.
10055 2012-07-30 Glenn Morris <rgm@gnu.org>
10057 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10058 does that unconditionally. Remove file, which is now empty.
10060 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10061 Remove empty files.
10063 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10065 Export to GDB most of lisp.h's remaining object-like macros.
10066 * lisp.h (min, max): Move earlier, because they're used earlier now.
10067 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10068 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10069 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10070 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10071 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10072 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10073 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10074 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10075 Now constants, for GDB. They need not be macros.
10076 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10077 Now constants, for GDB, as well as macros, for static initializers.
10078 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10079 Move to after the definition of struct Lisp_Char_Table,
10080 since the former now needs that type defined.
10081 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10082 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10083 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10084 New enums, for gdb_make_enums_visible.
10085 (GLYPH_MODE_LINE_FACE): Remove; unused.
10086 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10087 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10088 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10089 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10090 enum maxargs, enum MAX_ALLOCA.
10091 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10092 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10093 no longer needed, now that they are done in lisp.h.
10095 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10097 Cleanup string bytes checking.
10098 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10099 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10100 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10101 (check_sblock, compact_small_strings): Simplify.
10103 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10105 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10106 These macros are confusing and no longer need to be defined, as
10107 the enum values now suffice. All uses replaced with definiens.
10108 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10110 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
10112 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10113 ($(BLD)/w32console.$(O)): Update dependencies.
10115 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10117 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10118 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10119 time. Adjust users.
10120 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10122 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10124 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10125 setting sitelisp (Bug#12010).
10127 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10129 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10131 * w32heap.c (cache_system_info):
10132 * w32.c (sys_rename):
10133 * w32proc.c (find_child_console, sys_kill): All users changed.
10135 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10137 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10139 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10141 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10143 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10145 Cleanup statistics calculation in Fgarbage_collect.
10146 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10147 Fix zombies percentage calculation. Simplify elapsed time calculation.
10149 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10151 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10152 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10153 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10154 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10155 (replace_range, replace_range_2, del_range_2): Change to eassert.
10156 * marker.c (byte_char_debug_check): Adjust style.
10158 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10160 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10161 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10162 long-ago-commented-out code that talks about "WIN32".
10163 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10166 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10168 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10169 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10170 Simplify by using alignof.
10171 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10172 * lisp.h: Include <stdalign.h>.
10173 (GCALIGNMENT): New macro and constant.
10174 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10175 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10176 (stdalign): New macro, if not already defined.
10178 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10180 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10181 * w32inevt.c: Include w32inevt.h.
10182 (w32_read_console_input): New inline function, calls either
10183 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10184 w32_console_unicode_input.
10185 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10186 (w32_kbd_patch_key, key_event): Use the codepage returned by
10187 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10188 (key_event): use uChar.UnicodeChar only if
10189 w32_console_unicode_input is non-zero.
10191 * w32console.c: Include w32heap.h.
10192 <w32_console_unicode_input>: New global variable.
10193 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10194 family of Windows, zero otherwise.
10196 * w32inevt.h: Declare w32_console_unicode_input.
10198 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10199 --without-x. (Bug#11742)
10201 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10203 Adjust GDB to reflect pvec_type changes (Bug#12036).
10204 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10205 2012-07-04 changes to pseudovector representation.
10206 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10208 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10210 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10212 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10214 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10216 * alloc.c (listn): Fix the order the arguments are consed onto the
10219 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10220 enumeration constants, as PURE and HEAP are too general, and clash
10221 with other headers and sources, such as gmalloc.c and the
10222 MS-Windows system headers. All users changed.
10224 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10226 Revert last save_excursion_save and save_excursion_restore changes.
10227 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10228 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10230 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10232 Fix recently-introduced typos in Windows port.
10233 Reported by Martin Rudalics <rudalics@gmx.at>.
10234 * w32.c (init_environment): Replace comma with semicolon.
10235 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10237 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10239 Improve GDB symbol export (Bug#12036).
10240 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10241 arms of an 'if', not using conditional expressions; otherwise GDB
10242 complains about the types in the unevaluated arm when the argument
10243 is an integer literal.
10244 (xgetint): Simplify expression.
10245 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10246 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10247 Zaretskii in <http://bugs.gnu.org/12036#13>.
10248 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10249 needed now that we have gdb_make_enums_visible.
10250 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10251 (enum enum_USE_LSB_TAG):
10252 New enum types, packaging up enums that need to be exported to GDB.
10254 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10256 Utility function to make a list from specified amount of objects.
10257 * lisp.h (enum constype): New datatype.
10258 (listn): New prototype.
10259 * alloc.c (listn): New function.
10260 (Fmemory_use_count, syms_of_alloc): Use it.
10261 * buffer.c (syms_of_buffer): Likewise.
10262 * callint.c (syms_of_callint): Likewise.
10263 * charset.c (define_charset_internal): Likewise.
10264 * coding.c (syms_of_coding): Likewise.
10265 * keymap.c (syms_of_keymap): Likewise.
10266 * search.c (syms_of_search): Likewise.
10267 * syntax.c (syms_of_syntax): Likewise.
10268 * w32.c (init_environment): Likewise.
10269 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10270 * xdisp.c (syms_of_xdisp): Likewise.
10271 * xfns.c (syms_of_xfns): Likewise.
10273 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10275 Fast save_excursion_save and save_excursion_restore.
10276 * lisp.h (struct Lisp_Excursion): New data type.
10277 (PVEC_EXCURSION): New pseudovector type.
10278 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10279 to deal with it. Adjust comments.
10280 (init_marker, attach_marker): New prototype.
10281 (unchain_marker): Adjust prototype.
10282 * marker.c (attach_marker): Change to global.
10283 (init_marker): New function.
10284 * alloc.c (Fmake_marker, build_marker): Use it.
10285 (build_marker): More easserts.
10286 (mark_object): Handle struct Lisp_Excursion.
10287 * editfns.c (save_excursion_save, save_excursion_restore):
10288 Reimplement to use struct Lisp_Excursion. Add comments.
10290 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10292 Fix export of symbols to GDB (Bug#12036).
10293 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10294 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10295 emacs.c, as this is a more-suitable home. Had this been done earlier
10296 the fix for 12036 would have avoided some of the problems noted in
10297 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10298 would have been more obvious.
10299 * emacs.c: Do not include <verify.h>; no longer needed.
10300 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10301 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10302 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10303 Remove; now done in lisp.h.
10304 * lisp.h (PUBLISH_TO_GDB): New macro.
10305 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10306 (DATA_SEG_BITS): Use it.
10307 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10308 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10309 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10310 not be usable in #if. This simplifies things.
10312 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10314 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10316 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10318 Simplify export of symbols to GDB (Bug#12036).
10319 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10320 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10321 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10322 Adjust to changes in lisp.h and emacs.c, by using
10323 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10324 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10325 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10326 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10327 instead of gdb_valbits.
10328 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10329 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10330 instead of gdb_array_mark_flag.
10331 (xboolvector): Get size from $->size, not $->header.size.
10332 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10333 (xreload, hook-run, hookpost-run): Remove.
10334 * emacs.c: Include <verify.h>.
10335 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10336 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10338 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10339 (gdb_USE_LSB_TAG): New enum constants.
10340 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10341 Also define these as enum constants, so they're visible to GDB.
10342 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10343 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10344 as constants, so they're visible to GDB.
10345 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10346 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10347 Now enum constants, not macros, so they're visible to GDB.
10348 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10349 more convenient now. All uses changed.
10350 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10351 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10353 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10355 Explicitly free restriction data that are not needed anymore.
10356 * editfns.c (save_restriction_restore): Free restriction data.
10358 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10360 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10361 add argument, tune behavior, and adjust all callers.
10363 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10365 Use typedef for EMACS_INT, EMACS_UINT.
10366 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10367 than macros. This simplifies debugging in the usual case, since
10368 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10369 and it allows expressions involving EMACS_INT casts.
10370 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10372 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10374 * nsterm.m (ns_read_socket): Return early if there is a modal
10375 window (Bug#12043).
10377 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10379 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10380 that FOCUS-FRAME can be omitted.
10382 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10384 Adjust buffer text indirection counters at the end of Fkill_buffer.
10385 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10386 buffer is definitely dead. This should really fix an issue reported
10387 by Christoph Scholtes again. (Bug#12007).
10388 (init_buffer_once): Initialize indirection counters of
10389 buffer_defaults and buffer_local_symbols (for sanity and safety).
10391 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10393 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10394 and continuation glyphs on tooltip frames, leave them at zero.
10395 Avoids continued lines in tooltips. (Bug#11832)
10397 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10399 Simplify copy_overlay.
10400 * buffer.c (copy_overlay): Simplify. Use build_marker.
10401 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10403 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10405 * print.c (print_object): Don't crash when a frame's name is nil
10406 or invalid. (Bug#12025)
10408 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10409 it signals an error when a tooltip frame is being created.
10411 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10413 Cleanup miscellaneous objects allocation and initialization.
10414 * alloc.c (allocate_misc): Change to static. Add argument to
10415 specify the subtype. Adjust comment and users.
10416 (build_overlay): New function.
10417 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10418 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10419 (allocate_misc): Remove prototype.
10420 (build_overlay): Add prototype.
10422 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10424 Swap buffer text indirection counters in Fbuffer_swap_text.
10425 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10426 This avoids crash reported by Christoph Scholtes at
10427 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10429 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10431 * nsmenu.m (Popdown_data): New struct.
10432 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10434 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10435 (initWithContentRect): Make imgView and contentView non-static
10436 and autorelease them. Also autorelease img and matrix (Bug#12005).
10437 (dealloc): Remove (Bug#12005).
10439 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10441 Adjust consing_since_gc when objects are explicitly freed.
10442 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10443 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10444 (free_cons, free_misc): Subtract object size from consing_since_gc.
10446 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10448 Simplify and cleanup markers positioning code.
10449 * marker.c (attach_marker): More useful eassert.
10450 (live_buffer, set_marker_internal): New function.
10451 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10452 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10454 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10456 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10457 as it's limited by the amount of memory, not by INT_MAX.
10459 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10461 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10462 in special-event-map. See the discussion at
10463 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10466 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10467 info.dwItemData. Fixes crashes on 64-bit Windows.
10468 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10470 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10472 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10473 (conversationIdentifier): Return value is NSInteger.
10474 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10476 2012-07-21 Chong Yidong <cyd@gnu.org>
10478 * window.c (decode_any_window): Signal an error if the window is
10479 on a dead frame (Bug#11984).
10481 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10483 Add indirection counting to speed up Fkill_buffer.
10484 * buffer.h (struct buffer): New member.
10485 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10486 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10487 base buffer indirection counter.
10488 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10489 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10490 through buffer list if indirection counter is 0.
10492 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10494 Extend the value returned by Fgarbage_collect with heap statistics.
10495 * alloc.c (Qheap): New symbol.
10496 (syms_of_alloc): DEFSYM it.
10497 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10498 (Fmemory_free): Remove.
10499 (syms_of_alloc): Don't defsubr it.
10500 * buffer.c (Fcompact_buffer): Remove.
10501 (syms_of_buffer): Don't defsubr it.
10503 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10505 Make maybe_gc inline.
10506 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10507 * lisp.h (consing_since_gc, gc_relative_threshold)
10508 (memory_full_cons_threshold): Revert declaration.
10509 (maybe_gc): Remove prototype, define as inline.
10510 * alloc.c: Remove old commented-out code.
10511 (consing_since_gc, gc_relative_threshold)
10512 (memory_full_cons_threshold): Revert to global.
10513 (maybe_gc): Remove.
10515 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10517 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10518 * lisp.h (build_unibyte_string): New function.
10519 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10520 * sysdep.c, w32fns.c, xfns.c: Use it.
10521 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10522 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10523 Adjust users accordingly.
10524 * font.h (font_open_by_name): Adjust prototype.
10526 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10528 Cleanup calls to Fgarbage_collect.
10529 * lisp.h (maybe_gc): New prototype.
10530 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10531 Remove declarations.
10532 * alloc.c (maybe_gc): New function.
10533 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10535 * bytecode.c (MAYBE_GC): Use maybe_gc.
10536 * eval.c (eval_sub, Ffuncall): Likewise.
10537 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10538 to avoid dependency from auto-save feature.
10540 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10542 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10543 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10544 'for_each_per_buffer_object_at'.
10545 All uses changed. It's better to use upper-case for macros that
10546 cannot be implemented as functions, to give the reader a clue
10547 that they're special.
10549 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10551 * alloc.c (Fgarbage_collect): Tweak docstring.
10553 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10555 Tweak the value returned from Fgarbage_collect again.
10556 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10557 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10558 Adjust documentation.
10559 (total_vector_bytes): Rename to total_vector_slots, adjust
10561 (total_free_vector_bytes): Rename to total_free_vector_slots,
10563 (Qstring_bytes, Qvector_slots): New symbols.
10564 (syms_of_alloc): DEFSYM them.
10566 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10568 Buffer compaction primitive which may be used from Lisp.
10569 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10570 (syms_of_buffer): Register Fcompact_buffer.
10571 * alloc.c (Fgarbage_collect): Use compact_buffer.
10572 * buffer.h (compact_buffer): New prototype.
10573 (struct buffer_text): New member.
10575 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10577 New macro to iterate over all buffers, miscellaneous cleanups.
10578 * lisp.h (all_buffers): Remove declaration.
10579 * buffer.h (all_buffers): Add declaration, with comment.
10580 (for_each_buffer): New macro.
10581 * alloc.c (Fgarbage_collect, mark_object): Use it.
10582 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10583 (init_buffer): Likewise.
10584 * data.c (Fset_default): Likewise.
10585 * coding.c (code_conversion_restore): Remove redundant check
10587 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10589 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10591 Fix bug that created negative-length intervals.
10592 * intervals.c (merge_interval_right, merge_interval_left):
10593 Do not zero out this interval if it is absorbed by its children,
10594 as this interval's total length doesn't change in that case. See
10595 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10597 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10599 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10600 when invoking (make-bool-vector N t) and N is a positive
10601 multiple of 8 -- the last 8 bits were mistakenly cleared.
10603 Remove some struct layout assumptions in bool vectors.
10604 * alloc.c (bool_header_size): New constant.
10605 (header_size, word_size): Move earlier, as they're now used earlier.
10606 Use 'word_size' in a few more places, where it's appropriate.
10607 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10608 padding before the data member of a bool vector.
10609 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10610 than doing the check by hand with an abort ().
10612 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10614 * eval.c (Fdefvar): Don't check constants since we only set the var if
10615 it's not yet defined anyway (bug#11904).
10617 * lisp.h (last_undo_boundary): Declare new var.
10618 * keyboard.c (command_loop_1): Set it.
10619 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10620 were auto-added by the command loop (bug#11774).
10622 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10624 * w32font.c (Qsymbol): Remove local definition.
10625 (syms_of_w32font): Don't DEFSYM it.
10627 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10629 Fix sweep_vectors to handle large bool vectors correctly.
10630 * alloc.c (sweep_vectors): Account total_vector_bytes for
10631 bool vectors larger than VBLOCK_BYTES_MAX.
10633 2012-07-18 Chong Yidong <cyd@gnu.org>
10635 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10636 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10638 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10640 Return more descriptive data from Fgarbage_collect.
10641 Suggested by Stefan Monnier in
10642 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10643 * alloc.c (bounded_number): New function.
10644 (total_buffers, total_vectors): New variable.
10645 (total_string_size): Rename to total_string_bytes, adjust users.
10646 (total_vector_size): Rename to total_vector_bytes, adjust users.
10647 (sweep_vectors): Account total_vectors and total_vector_bytes.
10648 (Fgarbage_collect): New return value. Adjust documentation.
10649 (gc_sweep): Account total_buffers.
10650 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10651 (VECTOR_SIZE): Remove.
10652 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10653 (Qinterval, Qmisc): New symbols.
10654 (syms_of_data): Initialize them.
10655 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10656 (Qcons, Qbuffer): New declarations.
10658 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10660 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10661 Round up, not down. Improve doc.
10663 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10665 Restore old code in allocate_string_data to avoid Faset breakage.
10666 Reported by Julien Danjou <julien@danjou.info> in
10667 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10668 * alloc.c (allocate_string_data): Restore old code with minor
10669 adjustments, fix comment to explain this subtle issue.
10671 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10673 Remove FILE_SYSTEM_CASE.
10674 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10676 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10677 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10678 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10679 call-process-region passes it through expand-file-name.
10681 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10683 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10685 Fix crash when creating indirect buffer (Bug#11917)
10686 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10687 Don't handle unbound variables specially if non-zero.
10688 (Fbuffer_local_variables): Pass zero.
10689 (clone_per_buffer_values): Pass non-zero.
10691 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10693 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10694 to make the loop interruptible.
10696 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10698 * gnutls.c (emacs_gnutls_handshake): Only retry if
10699 GNUTLS_E_INTERRUPTED.
10701 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10703 Cleanup and convert miscellaneous checks to eassert.
10704 * alloc.c (mark_interval): Fix comment, partially rephrase
10705 old comment from intervals.h (see below).
10706 * intervals.c (find_interval, adjust_intervals_for_insertion)
10707 (delete_interval, adjust_intervals_for_deletion)
10708 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10709 Convert to eassert.
10710 (adjust_intervals_for_insertion, make_new_interval):
10711 Remove obsolete and unused code.
10712 * intervals.h (struct interval): Remove obsolete comment.
10713 * textprotp.c (erase_properties): Remove unused code.
10714 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10715 (Fremove_list_of_text_properties): Convert to eassert.
10717 2012-07-17 Chong Yidong <cyd@gnu.org>
10719 * editfns.c (Finsert_char): Doc fix.
10721 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10723 Fix previous change to make Fmemory_free always accurate.
10724 * alloc.c (make_interval): Update total_free_intervals.
10725 (make_float): Likewise for total_free_floats.
10726 (free_cons, Fcons): Likewise for total_free_conses.
10727 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10728 Likewise for total_free_vector_bytes.
10729 (Fmake_symbol): Likewise for total_free_symbols.
10730 (bytes_free): Remove.
10732 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10734 Simple free memory accounting feature.
10735 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10736 (sweep_vectors): Accumulate size of free vectors.
10737 (Fgarbage_collect): Setup bytes_free.
10738 (Fmemory_free): New function.
10739 (syms_of_alloc): Register it.
10741 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10743 Cleanup overlays checking.
10744 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10745 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10746 eassert and OVERLAYP.
10747 (sort_overlays): Change to use OVERLAYP.
10749 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10751 * editfns.c (Finsert_char): Make it interactive, and make the
10752 second arg optional. Copy interactive spec and docstring from
10755 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10757 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10758 Unlike the other wrapped functions, fabs has an unspecified
10761 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10763 * nsterm.m (keyDown): Interpret flags without left/right bits
10764 as the left key (Bug#11670).
10766 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10768 Remove empty and useless init functions.
10769 * lisp.h (init_character_once, init_fns, init_image)
10770 (init_filelock, init_sound): Remove prototype.
10771 * character.c (init_character_once): Remove.
10772 * filelock.c (init_filelock): Likewise.
10773 * fns.c (init_fns): Likewise.
10774 * image.c (init_image): Likewise.
10775 * sound.c (init_sound): Likewise.
10776 * emacs.c (main): Adjust accordingly.
10778 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10780 * gtkutil.h: Tiny cleanups.
10781 (use_old_gtk_file_dialog): Remove useless declaration.
10782 (xg_uses_old_file_dialog): Add suggested const attribute.
10784 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10786 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10787 (bidi_paragraph_init): Use it to limit search forward for a strong
10788 directional character in abnormally large paragraphs full of
10789 neutral or weak characters. (Bug#11943)
10791 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10793 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10794 the toolbar (Bug#9451).
10795 (xg_make_tool_item): Give the widget event box a transparent
10798 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10800 Cleanup basic allocation variables and functions.
10801 * alloc.c (ignore_warnings, init_intervals, init_float)
10802 (init_cons, init_symbol, init_marker): Remove.
10803 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10804 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10805 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10806 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10807 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10808 (staticidx, init_alloc_once, init_strings, free_ablock):
10809 Remove redundant initialization.
10810 * fns.c (init_weak_hash_tables): Remove.
10811 * lisp.h (init_weak_hash_tables): Remove prototype.
10813 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10815 Use zero_vector where appropriate.
10816 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10818 * lisp.h (zero_vector): New declaration.
10819 * font.c (null_vector): Remove.
10820 (syms_of_font): Remove initialization and staticpro.
10821 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10822 * keymap.c (Faccessible_keymaps): Likewise.
10824 2012-07-15 Leo Liu <sdl.web@gmail.com>
10826 * fringe.c: Fix typo in comments.
10828 2012-07-14 Leo Liu <sdl.web@gmail.com>
10830 * fringe.c: Add a new bitmap exclamation-mark.
10832 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10834 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10836 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10837 (HAVE_MENUS): Don't define, defined by editing config.in with
10839 (GMALLOC_INHIBIT_VALLOC): Don't define.
10840 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10842 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10844 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10846 2012-07-14 Glenn Morris <rgm@gnu.org>
10848 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10849 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10850 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10852 2012-07-13 Glenn Morris <rgm@gnu.org>
10854 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10856 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10857 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10859 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10861 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10862 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10863 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10864 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10866 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10867 as boolean expression.
10868 (x_set_window_size): Remove unused variable toolbar.
10869 (ns_get_color_default, ns_mod_to_lisp): Remove.
10870 (ns_mouse_position): Remove unused variables xchar and ychar.
10871 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10872 (ns_set_vertical_scroll_bar): Remove unused variable count.
10873 (ns_delete_terminal): Remove unused variable i.
10874 (ns_term_init): Remove unused variables r, g and b.
10875 (mouseDown): Remove unused variable window.
10876 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10877 (initFrameFromEmacs): Remove unused variable vbextra.
10878 (mouseEntered): Remove unused variables p and dpyinfo.
10879 (mouseExited): Remove unused variables p and r.
10880 (ns_define_frame_cursor, ns_clear_frame_area)
10881 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10882 (menuDown): Assign [sender tag] to variable and cast the variable.
10884 * nsterm.h (menuDown): Add id as type to argument sender.
10885 (ns_display_info_for_name): Add Lisp_Object argument.
10886 (ns_term_init): Add Lisp_Object argument.
10887 (ns_map_event_to_object): Add void argument.
10888 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10889 prototype with arguments and only declare if __OBJC__.
10890 (nxatoms_of_nsselect): Add void argument.
10891 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10892 (ns_alloc_autorelease_pool): Add void argument.
10893 (ns_release_autorelease_pool): Add void* argument.
10894 (ns_get_defaults_value): Add const char* argument.
10896 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10897 (initFromContents): Use SSDATA where appropriate.
10898 (ns_update_menubar): Add braces to ambigous if-else.
10899 (initWithTitle): Put () around assignment in if statement.
10900 (ns_menu_show): Remove unused variables window and keymap.
10901 (update_frame_tool_bar): Remove unused variable selected_p.
10902 (initWithContentRect): Remove unused variable this_cmd_name.
10904 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10906 (setXBMColor): Remove unused variable len.
10907 (setPixmapData): Put () around assignment in loop statement.
10909 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10910 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10912 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10913 around assignment in loop statement.
10914 (nsfont_open): Remove unused variable i.
10915 (nsfont_open): Remove unused variable len.
10916 (nsfont_draw): Remove unused variable cs.
10918 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10919 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10920 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10921 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10922 (Fns_font_name, Fns_perform_service)
10923 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10924 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10925 (ns_set_name): Remove unused variable view.
10926 (x_set_menu_bar_lines): Remove unused variable olines.
10927 (x_set_tool_bar_lines): Remove unused variable root_window.
10928 (Fns_list_colors): Put () around assignment in while statement.
10929 (Fns_perform_service): Remove unused variable len.
10930 (Fns_display_usable_bounds): Remove unused variable top.
10931 (syms_of_nsfns): Remove unused variable i.
10933 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10934 memcpy (Bug#11907).
10936 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10938 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10939 and free it with DestroyExceptionInfo (Bug#11558).
10941 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10943 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10944 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10945 Set here, not in nt/config.nt.
10947 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10949 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10950 cursor overflow into the last glyph on display line when the right
10951 fringe is off. (Bug#11832)
10953 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10955 * xdisp.c (produce_special_glyphs): Now static.
10956 * dispextern.h (produce_special_glyphs): Remove decl.
10958 2012-07-13 Glenn Morris <rgm@gnu.org>
10960 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10961 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10963 * s/usg5-4-common.h (USG, USG5):
10964 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10965 * s/sol2-6.h (SOLARIS2):
10966 * s/irix6-5.h (IRIX6_5):
10967 * s/hpux10-20.h (USG, USG5, HPUX):
10968 * s/gnu-linux.h (USG, GNU_LINUX):
10969 * s/freebsd.h (BSD_SYSTEM):
10970 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10971 * s/cygwin.h (CYGWIN):
10972 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10973 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10975 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10977 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10979 2012-07-13 Glenn Morris <rgm@gnu.org>
10981 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10983 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10985 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10986 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10988 2012-07-12 Glenn Morris <rgm@gnu.org>
10990 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10992 * process.c (init_process_emacs): Rename from init_process.
10993 The old name is also the name of a Mach system call.
10994 * lisp.h, emacs.c: Update for this name change.
10995 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10998 2012-07-12 Eli Zaretskii <eliz@gnu.org>
11000 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
11001 memmove call that removes glyphs covered by the left truncation
11002 glyph. Improve commentary.
11003 (display_line): Fix display of continuation glyphs on GUI frames
11004 when the right fringe is turned off and variable-size fonts are
11005 used in the window. Move the code that appends a stretch glyph to
11006 produce_special_glyphs, so that it could be used for truncation
11007 and continuation glyphs alike.
11008 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
11009 glyph of a suitably computed width, to align the special glyphs at
11010 the window margin. Code moved from display_line. (Bug#11832)
11012 2012-07-12 Glenn Morris <rgm@gnu.org>
11014 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
11016 * s/gnu-linux.h, s/hpux10-20.h:
11017 Do not unconditionally define HAVE_XRMSETDATABASE.
11019 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
11021 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
11023 Fix typos that broke OS X build.
11024 Reported by Randal L. Schwartz in
11025 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11026 * nsterm.m (ns_timeout): Add missing local decl.
11027 (ns_get_color): snprintf -> sprintf, to fix typo.
11029 2012-07-12 Glenn Morris <rgm@gnu.org>
11031 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11032 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11033 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11034 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11036 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11037 Move PTY_OPEN to configure.
11039 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11040 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11041 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11043 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11045 Use empty_unibyte_string where applicable.
11046 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11047 * lread.c (read1): Likewise.
11048 * xsettings.c (syms_of_xsettings): Likewise.
11050 2012-07-12 Glenn Morris <rgm@gnu.org>
11052 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11053 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11054 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11055 * s/hpux10-20.h (RUN_TIME_REMAP):
11056 * s/bsd-common.h (TABDLY): Move to configure.
11058 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11060 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11062 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11063 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11065 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11067 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11068 * s/template.h: Move NARROWPROTO to configure.
11070 2012-07-11 Glenn Morris <rgm@gnu.org>
11072 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11073 unused since 2011-01-17 change to systty.h.
11075 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11076 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11077 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11079 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11081 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11083 2012-07-11 Glenn Morris <rgm@gnu.org>
11085 * s/darwin.h, s/gnu-linux.h, s/template.h:
11086 Move INTERRUPT_INPUT to configure.
11088 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11090 Minor adjustments to interning code.
11091 * lisp.h (intern, intern_c_string): Redefine as static inline
11092 wrappers for intern_1 and intern_c_string_1, respectively.
11093 (intern_1, intern_c_string_1): Rename prototypes.
11094 * lread.c (intern_1, intern_c_string_1, oblookup):
11095 Simplify Vobarray checking.
11096 * font.c (font_intern_prop): Likewise. Adjust comment.
11097 * w32font.c (intern_font_name): Likewise.
11099 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11101 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11103 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11104 of Fcar/Fcdr if possible.
11105 * font.c (check_otf_features): Likewise.
11106 * fontset.c (Fnew_fontset): Likewise.
11107 * gnutls.c (Fgnutls_boot): Likewise.
11108 * minibuf.c (read_minibuf): Likewise.
11109 * msdos.c (IT_set_frame_parameters): Likewise.
11110 * xmenu.c (Fx_popup_dialog): Likewise.
11111 * w32menu.c (Fx_popup_dialog): Likewise.
11113 2012-07-11 Glenn Morris <rgm@gnu.org>
11115 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11116 since nothing has defined it on these platforms.
11118 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11119 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11121 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11122 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11123 Move CLASH_DETECTION to configure.
11125 * s/gnu.h: Remove file, which is now empty.
11127 * s/gnu.h, s/gnu-linux.h:
11128 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11130 2012-07-11 John Wiegley <johnw@newartisans.com>
11132 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11133 function attribute, so we only use it if it exists in the
11136 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11138 Avoid call to strlen in fast_c_string_match_ignore_case.
11139 * search.c (fast_c_string_match_ignore_case): Change to use
11140 length argument. Adjust users accordingly.
11141 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11143 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11145 Assume mkdir, rmdir.
11146 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11147 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11150 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11153 * s/hpux10-20.h (HAVE_PERROR): Remove.
11154 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11155 Remove dummy definition, as this problem was obsolete long ago.
11158 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11160 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11162 Avoid calls to strlen in font processing functions.
11163 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11164 (font_open_by_name): Change to use length argument.
11165 Adjust users accordingly.
11166 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11168 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11169 Change to return ptrdiff_t.
11170 (xfont_list_pattern, xfont_match): Use length returned by
11171 xfont_decode_coding_xlfd.
11172 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11174 2012-07-11 Glenn Morris <rgm@gnu.org>
11176 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11177 Move DONT_REOPEN_PTY to configure.
11179 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11180 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11182 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11184 Remove "#define unix" that is no longer needed (Bug#11905).
11185 * s/aix4-2.h (unix): Remove; no longer needed.
11187 EMACS_TIME simplification (Bug#11875).
11188 This replaces macros (which typically do not work in GDB)
11189 with functions, typedefs and enums, making the code easier to debug.
11190 The functional style also makes code easier to read and maintain.
11191 * systime.h: Include <sys/time.h> on all hosts, not just if
11192 WINDOWSNT, since 'struct timeval' is needed in general.
11193 (EMACS_TIME): Now a typedef, not a macro.
11194 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11196 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11197 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11198 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11199 (EMACS_TIME_LE): Now functions, not macros.
11200 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11201 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11202 which are not functions. All uses rewritten to use:
11203 (make_emacs_time): New function.
11204 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11205 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11206 not functions. All uses rewritten to use the following, respectively:
11207 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11208 (add_emacs_time, sub_emacs_time): New functions.
11209 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11210 * fileio.c (Fcopy_file):
11211 * xterm.c (XTflash): Get the current time closer to when it's used.
11212 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11214 * bytecode.c (targets): Suppress -Woverride-init warnings.
11216 Simplify by avoiding confusing use of strncpy etc.
11217 * doc.c (Fsnarf_documentation):
11218 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11219 * frame.c (Fmake_terminal_frame):
11220 * gtkutil.c (get_utf8_string):
11222 * nsmenu.m (ns_update_menubar):
11223 * regex.c (regerror):
11224 Prefer memcpy to strncpy and strncat when either will do.
11225 * fileio.c (Fsubstitute_in_file_name):
11226 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11227 (menu_separator_name_p):
11228 * nsmenu.m (ns_update_menubar):
11229 Prefer memcmp to strncmp when either will do.
11230 * nsterm.m: Include <ftoastr.h>.
11232 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11233 Prefer snprintf to strncpy.
11234 * nsterm.m (ns_term_init):
11235 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11236 * nsterm.m (ns_term_init):
11237 Avoid the need for strncpy, by using build_string or
11238 make_unibyte_string directly. Use dtoastr, not snprintf.
11239 * process.c (Fmake_network_process): Diagnose service names that
11240 are too long, rather than silently truncating them or creating
11241 non-null-terminated names.
11242 (Fnetwork_interface_info): Likewise, for interface names.
11243 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11244 Prefer sprintf to strncat.
11245 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11246 Prefer vsnprintf to vsprintf + strncpy.
11248 2012-07-10 Glenn Morris <rgm@gnu.org>
11250 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11251 Clarify fallback case.
11253 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11255 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11256 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11257 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11258 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11259 where argument type is known to be a Lisp_Cons.
11261 2012-07-10 Tom Tromey <tromey@redhat.com>
11263 * bytecode.c (BYTE_CODE_THREADED): New macro.
11264 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11265 (enum byte_code_op): New type.
11266 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11267 (exec_byte_code): Use them. Use token threading when applicable.
11269 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11271 Optimize pure C strings initialization.
11272 * lisp.h (make_pure_string): Fix prototype.
11273 (build_pure_c_string): New function, defined as static inline. This
11274 provides a better opportunity to optimize away calls to strlen when
11275 the function is called with compile-time constant argument.
11276 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11277 argument, adjust users accordingly. Use build_pure_c_string where
11279 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11280 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11281 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11283 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11285 Avoid calls to strlen in miscellaneous functions.
11286 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11287 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11288 * lread.c (openp): Likewise.
11290 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11292 Avoid calls to strlen in path processing functions.
11293 * fileio.c (file_name_as_directory): Add comment. Change to add
11294 srclen argument and return the length of result. Adjust users
11296 (directory_file_name): Fix comment. Change to add srclen argument,
11297 swap 1st and 2nd arguments to obey the common convention.
11298 Adjust users accordingly.
11299 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11301 2012-07-10 Glenn Morris <rgm@gnu.org>
11303 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11304 Move PENDING_OUTPUT_COUNT definition to configure.
11306 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11307 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11308 * s/gnu.h (DATA_START): Move definitions to configure.
11310 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11311 We include usg5-4-common.h, which defines them both.
11313 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11314 O_RDONLY already includes it).
11316 Stop ns builds setting the EMACSLOADPATH environment variable.
11317 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11318 Now it does not set EMACSLOADPATH, just returns the load-path string.
11319 * nsterm.h: Update accordingly.
11320 * lread.c [HAVE_NS]: Include nsterm.h.
11321 (init_lread) [HAVE_NS]: Use ns_load_path.
11322 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11324 2012-07-09 Glenn Morris <rgm@gnu.org>
11326 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11327 since the included bsd-common.h does so.
11329 Stop ns builds setting the EMACSPATH environment variable.
11330 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11331 (ns_init_paths): Do not set EMACSPATH.
11332 * nsterm.h (ns_exec_path): Add it.
11333 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11336 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11338 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11340 * process.c (wait_reading_process_output): 'waitchannels' was unset
11341 when read_kbd || !NILP (wait_for_cell); fix this.
11343 Add GCC-style 'const' attribute to functions that can use it.
11344 * character.h (char_resolve_modifier_mask):
11345 * keyboard.h (make_ctrl_char):
11346 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11347 (init_character_once, next_almost_prime, init_fns, init_image)
11348 (flush_pending_output, init_sound):
11349 * mem-limits.h (start_of_data):
11350 * menu.h (finish_menu_items):
11351 Add ATTRIBUTE_CONST.
11352 * emacs.c (DEFINE_DUMMY_FUNCTION):
11353 Declare the dummy function with ATTRIBUTE_CONST.
11354 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11355 Add decls with ATTRIBUTE_CONST.
11357 Minor improvements to make_formatted_string.
11358 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11359 where int is good enough, as vsprintf returns an int.
11360 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11362 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11364 Use make_formatted_string to avoid double length calculation.
11365 * lisp.h (make_formatted_string): New prototype.
11366 * alloc.c (make_formatted_string): New function.
11367 * buffer.c (Fgenerate_new_buffer_name): Use it.
11368 * dbusbind.c (syms_of_dbusbind): Likewise.
11369 * editfns.c (Fcurrent_time_zone): Likewise.
11370 * filelock.c (get_boot_time): Likewise.
11371 * frame.c (make_terminal_frame, set_term_frame_name)
11372 (x_report_frame_params): Likewise.
11373 * image.c (gs_load): Likewise.
11374 * minibuf.c (get_minibuffer): Likewise.
11375 * msdos.c (dos_set_window_size): Likewise.
11376 * process.c (make_process): Likewise.
11377 * xdisp.c (ensure_echo_area_buffers): Likewise.
11378 * xsettings.c (apply_xft_settings): Likewise.
11380 2012-07-09 Glenn Morris <rgm@gnu.org>
11382 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11383 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11384 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11385 * nsterm.h (ns_etc_directory): Add it.
11386 * callproc.c [HAVE_NS]: Include nsterm.h.
11387 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11389 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11391 Move marker debugging code under MARKER_DEBUG.
11392 * marker.c (MARKER_DEBUG): Move marker debugging code under
11393 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11394 for bootstrap with --enable-checking (~3x slowdown reported
11395 by Juanma Barranquero <lekktu@gmail.com>).
11396 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11398 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11400 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11401 See <http://bugs.gnu.org/11825#29>.
11403 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11405 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11406 has no font, use the frame's font. (Bug#11813)
11407 (display_line): Add commentary about displaying truncation glyphs
11409 (produce_special_glyphs): Move here from term.c.
11411 * term.c (produce_special_glyphs): Move to xdisp.c.
11413 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11416 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11418 * xdisp.c (display_line): Avoid warning about implicit declaration
11421 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11423 * lisp.h: Remove empty conditional.
11425 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11427 * lread.c (load_path_check): Now static.
11429 Fix some minor --with-ns problems found by static checking.
11430 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11431 (x_set_font) [!HAVE_X_WINDOWS]:
11432 * image.c (xpm_load_image) [HAVE_NS]:
11433 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11434 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11435 Remove unused local.
11436 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11437 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11438 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11439 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11440 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11441 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11442 Fix pointer signedness problem.
11443 * xfaces.c (FRAME_X_FONT_TABLE):
11444 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11446 2012-07-07 Glenn Morris <rgm@gnu.org>
11448 * lread.c (load_path_check): New function, split from init_lread.
11449 (init_lread): Reorganize. Motivation:
11450 If EMACSLOADPATH is set, check/warn about that rather than the
11451 defaults, which we are not going to use. Hence we can remove
11452 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11453 Don't warn if site-lisp directories are missing.
11454 If not installed, start from a blank load-path, since
11455 PATH_LOADSEARCH refers to the eventual installation directories.
11457 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11459 Support truncation and continuation glyphs on GUI frames, when
11460 fringes are disabled. (Bug#11832)
11461 * xdisp.c (init_iterator): Get dimensions of truncation and
11462 continuation glyphs even if on GUI frames.
11463 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11464 or both, are absent.
11465 (start_display, move_it_in_display_line_to): Handle the case of a
11466 GUI frame without a fringe to display continuation or truncation
11468 (insert_left_trunc_glyphs): Support GUI frames: make sure
11469 truncation glyphs overwrite enough glyphs from the current line to
11470 have sufficient space in pixels.
11471 (display_line): Support truncation and continuation glyphs on GUI
11472 frames. If some spare pixels are left on the line after inserting
11473 the truncation glyphs, fill that space with a stretch glyph of a
11474 suitably computed width.
11476 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11477 produce_glyphs, to support GUI sessions.
11479 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11481 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11483 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11485 Do not require float-time's arg to fit in time_t (Bug#11825).
11486 This works better on hosts where time_t is unsigned, and where
11487 float-time is applied to the (negative) difference between two times.
11488 * editfns.c (decode_time_components): Last arg is now double *,
11489 not int *, and means to store all the result as a double, without
11490 worrying about whether the seconds part fits in time_t.
11491 All callers changed.
11492 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11493 All callers changed.
11494 (Ffloat_time): Do not fail merely because the specified time falls
11495 outside of time_t range.
11497 2012-07-07 Glenn Morris <rgm@gnu.org>
11499 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11500 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11501 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11503 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11505 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11506 Update dependencies.
11508 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11510 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11512 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11513 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11514 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11515 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11516 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11517 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11519 * xfont.c (compare_font_names): Redo to omit the need for casts.
11521 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11523 * xfns.c (Fx_change_window_property): Doc fix.
11524 * w32fns.c (Fx_change_window_property): Doc fix.
11526 * w32fns.c (Fx_window_property): Accept the same arguments as the
11527 X Windows version. Doc fix.
11528 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11530 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11531 Eli Zaretskii <eliz@gnu.org>
11533 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11534 Windows-specific code from nt/config.nt moved here.
11535 Obsolete settings removed.
11537 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11539 * process.c: Avoid unnecessary calls to gettime.
11540 (wait_reading_process_output): Don't get the time of day
11541 when gobbling data immediately and not waiting, as there's no need
11542 for it in that case. This removes a FIXME.
11544 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11546 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11547 is defined (Bug#11768).
11549 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11551 Fix marker debugging code.
11552 * marker.c (byte_char_debug_check): Do not perform the check
11553 if buffer is not multibyte.
11554 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11555 Call byte_char_debug_check with correct arguments.
11557 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11559 Compile marker debugging code only if ENABLE_CHECKING is defined.
11560 * marker.c (byte_char_debug_check, count_markers):
11561 Use only if ENABLE_CHECKING is defined.
11562 (byte_debug_flag): Remove.
11563 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11564 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11566 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11568 Avoid code repetition in marker-related functions.
11569 * marker.c (attach_marker): New function.
11570 (Fset_marker, set_marker_restricted, set_marker_both)
11571 (set_marker_restricted_both): Use it.
11572 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11573 Consistently rename charno to charpos.
11574 (marker_position): Add eassert.
11575 (marker_byte_position): Convert to eassert.
11577 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11579 Simplify list operations in unchain_overlay and unchain_marker.
11580 * buffer.c (unchain_overlay): Simplify. Add comment.
11581 * marker.c (unchain_marker): Simplify. Fix comments.
11583 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11585 Introduce fast path for the widely used marker operation.
11586 * alloc.c (build_marker): New function.
11587 * lisp.h (build_marker): New prototype.
11588 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11589 * composite.c (autocmp_chars): Likewise.
11590 * editfns.c (buildmark): Remove.
11591 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11592 (save_restriction_save): Use build_marker.
11593 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11594 * window.c (save_window_save): Likewise.
11596 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11598 Do not use Fdelete_overlay in delete_all_overlays
11599 to avoid redundant calls to unchain_overlay.
11600 * buffer.c (drop_overlay): New function.
11601 (delete_all_overlays, Fdelete_overlay): Use it.
11602 * minibuf.c (get_minibuffer): Fix comment.
11604 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11606 Port to OpenBSD 5.1 amd64.
11607 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11608 This is needed for OpenBSD, and should be harmless on all BSD systems.
11609 Also, include <sys/sysctl.h>, as it should be available on all
11610 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11611 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11612 use p_pid member, not kp_proc.pid.
11614 2012-07-06 Glenn Morris <rgm@gnu.org>
11616 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11618 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11620 More xmalloc and related cleanup.
11621 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11622 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11623 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11624 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11625 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11626 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11627 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11628 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11629 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11631 Omit needless casts involving void * pointers and allocation.
11632 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11633 as the former is more robust if P's type is changed.
11634 Prefer xzalloc to xmalloc + memset 0.
11635 Simplify malloc-or-realloc to realloc.
11636 Don't worry about xmalloc returning a null pointer.
11637 Prefer xstrdup to xmalloc + strcpy.
11638 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11640 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11641 alloca of a constant.
11643 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11645 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11646 hscroll is larger than the line width. Fixes long and futile
11647 looping inside extend_face_to_end_of_line (on a TTY) producing
11648 glyphs that are not needed and thrown away.
11650 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11652 * marker.c (set_marker_restricted_both): Simplify by using
11655 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11657 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11659 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11661 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11662 not defined (Bug#11768).
11663 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11664 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11665 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11666 followed by gtk_box_set_homogeneous (Bug#11768).
11667 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11668 (update_theme_scrollbar_width, xg_create_scroll_bar):
11669 Use gtk_scrollbar_new (Bug#11768).
11670 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11671 (is_box_type): New function (Bug#11768).
11672 (xg_tool_item_stale_p): Call is_box_type.
11673 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11674 with default display (Bug#11768).
11676 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11678 * xdisp.c (window_hscroll_limited): New function.
11679 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11680 coordinates when window's hscroll is set to insanely large
11681 values. (Bug#11857)
11683 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11685 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11686 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11688 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11691 * lisp.h (xzalloc): New prototype. Omit needless casts.
11692 * alloc.c (xzalloc): New function. Omit needless casts.
11693 * charset.c: Omit needless casts. Convert all calls to
11694 xmalloc with following memset to xzalloc.
11695 * dispnew.c: Likewise.
11696 * fringe.c: Likewise.
11697 * image.c: Likewise.
11698 * sound.c: Likewise.
11699 * term.c: Likewise.
11700 * w32fns.c: Likewise.
11701 * w32font.c: Likewise.
11702 * w32term.c: Likewise.
11703 * xfaces.c: Likewise.
11704 * xfns.c: Likewise.
11705 * xterm.c: Likewise.
11706 * atimer.c: Omit needless casts.
11707 * buffer.c: Likewise.
11708 * callproc.c: Likewise.
11710 * coding.c: Likewise.
11711 * composite.c: Likewise.
11713 * doprnt.c: Likewise.
11714 * editfns.c: Likewise.
11715 * emacs.c: Likewise.
11716 * eval.c: Likewise.
11717 * filelock.c: Likewise.
11719 * gtkutil.c: Likewise.
11720 * keyboard.c: Likewise.
11721 * lisp.h: Likewise.
11722 * lread.c: Likewise.
11723 * minibuf.c: Likewise.
11724 * msdos.c: Likewise.
11725 * print.c: Likewise.
11726 * process.c: Likewise.
11727 * region-cache.c: Likewise.
11728 * search.c: Likewise.
11729 * sysdep.c: Likewise.
11730 * termcap.c: Likewise.
11731 * terminal.c: Likewise.
11732 * tparam.c: Likewise.
11733 * w16select.c: Likewise.
11735 * w32reg.c: Likewise.
11736 * w32select.c: Likewise.
11737 * w32uniscribe.c: Likewise.
11738 * widget.c: Likewise.
11739 * xdisp.c: Likewise.
11740 * xmenu.c: Likewise.
11741 * xrdb.c: Likewise.
11742 * xselect.c: Likewise.
11744 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11746 * fileio.c (time_error_value): Check the right error number.
11747 Problem reported by Troels Nielsen in
11748 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11750 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11752 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11753 This should be fixed in a better way; see Eli Zaretskii in
11754 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11755 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11757 * fileio.c (time_error_value): Rename from special_mtime.
11758 The old name's problems were noted by Eli Zaretskii in
11759 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11761 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11762 This variable's comment says Emacs needs at least one GDB-visible
11763 symbol of type enum pvec_type, to work around GDB problems.
11764 The symbol's value doesn't matter.
11766 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11767 that causes compilation to fail on pre-C99 compilers.
11769 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11771 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11772 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11774 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11776 * buffer.c (init_buffer_once): Fix initialization of
11777 headers for buffer_defaults and buffer_local_symbols.
11778 Reported by Juanma Barranquero <lekktu@gmail.com>.
11780 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11782 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11783 * lisp.h (enum pvec_type): Use fewer bits.
11784 (PSEUDOVECTOR_SIZE_BITS): New constant.
11785 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11786 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11787 change in pvec_type.
11788 (PSEUDOVECTOR_TYPEP): New macro.
11789 (TYPED_PSEUDOVECTORP): Use it.
11790 * fns.c (internal_equal): Adapt code to extract pvectype.
11791 * emacs.c (gdb_pvec_type): Update type.
11792 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11793 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11794 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11795 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11796 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11797 abusing vector->header.next.nbytes.
11798 (live_vector_p): Use PVEC_TYPE.
11799 (mark_object): Adapt code to extract pvectype. Use switch.
11801 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11803 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11804 Tighten new eassert a bit.
11806 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11808 Fix compilation with --enable-gcc-warnings and -O1
11809 optimization level.
11810 * doprnt.c (doprnt): Change type of tem to int, initialize
11811 to avoid compiler warning. Add eassert.
11812 * search.c (simple_search): Initialize match_byte to avoid
11813 compiler warning. Add eassert.
11815 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11817 Avoid weird behavior with large horizontal scrolls.
11818 Without this change, for example, large hscroll values would
11819 mess up Emacs's display on Fedora 15 x86, presumably due to
11820 overflows in int calculations in the display code.
11821 Also, if buffers had long lines, Emacs would freeze.
11822 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11823 (set_window_hscroll): New function, containing the old guts of
11824 Fset_window_hscroll. Return the clipped value.
11825 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11826 This avoids the need to check against PTRDIFF_MAX.
11828 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11830 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11832 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11834 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11836 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11837 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11838 since GCC 4.4.6 issues a bogus warning for them.
11840 Fix bugs in file timestamp newness comparisons.
11841 * fileio.c (Ffile_newer_than_file_p):
11842 * lread.c (Fload): Use full timestamp resolution of files,
11843 not just the 1-second resolution, so that files that are only
11844 slightly newer still count as newer.
11845 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11846 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11848 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11850 * fileio.c: Improve handling of file time marker. (Bug#11852)
11851 (special_mtime): New function.
11852 (Finsert_file_contents, Fverify_visited_file_modtime):
11853 Use it to set special mtime values consistently.
11855 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11857 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11858 marker for non-existing file. (Bug#11852)
11860 2012-07-03 Glenn Morris <rgm@gnu.org>
11862 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11863 and did not make it into globals.h).
11865 2012-07-03 Tom Tromey <tromey@redhat.com>
11867 * window.c (Fset_window_margins, Fset_window_fringes)
11868 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11869 * textprop.c (Fprevious_property_change): No longer static.
11870 * syntax.c (Fsyntax_table_p): No longer static.
11871 * process.c (Fget_process, Fprocess_datagram_address): No longer
11873 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11874 * keyboard.c (Fcommand_execute): No longer static.
11876 * insdel.c (Fcombine_after_change_execute): No longer static.
11877 * image.c (Finit_image_library): No longer static.
11878 * fileio.c (Fmake_symbolic_link): No longer static.
11879 * eval.c (Ffetch_bytecode): No longer static.
11880 * editfns.c (Fuser_full_name): No longer static.
11881 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11883 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11885 * dired.c (Ffile_attributes): No longer static.
11886 * composite.c (Fcomposition_get_gstring): No longer static.
11887 * callproc.c (Fgetenv_internal): No longer static.
11889 * ccl.h: Remove EXFUNs.
11890 * buffer.h: Remove EXFUNs.
11891 * dispextern.h: Remove EXFUNs.
11892 * intervals.h: Remove EXFUNs.
11893 * fontset.h: Remove EXFUN.
11894 * font.h: Remove EXFUNs.
11895 * dosfns.c (system_process_attributes): Remove EXFUN.
11896 * keymap.h: Remove EXFUNs.
11897 * lisp.h: Remove EXFUNs.
11898 * w32term.h: Remove EXFUNs.
11899 * window.h: Remove EXFUNs.
11900 * xsettings.h: Remove EXFUN.
11901 * xterm.h: Remove EXFUN.
11903 2012-07-03 Glenn Morris <rgm@gnu.org>
11905 * lisp.h (Frandom): Make it visible to C.
11906 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11907 buffer for invisible buffers. (Bug#1229)
11909 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11911 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11912 values which aren't power of 2.
11913 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11914 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11917 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11919 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11921 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11923 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11925 * alloc.c (allocate_vector_block): Remove redundant
11926 calls to mallopt if DOUG_LEA_MALLOC is defined.
11927 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11928 avoid calls to mallopt if zero_vector is returned.
11930 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11932 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11933 is enabled, avoid dereferencing NULL current_sblock if
11936 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11938 Cleanup basic buffer management.
11939 * buffer.h (struct buffer): Change layout to use generic vector
11940 marking code. Fix some comments. Change type of 'clip_changed'
11941 to bitfield. Remove unused #ifndef old.
11942 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11943 (GET_OVERLAYS_AT): Fix indentation.
11944 (for_each_per_buffer_object_at): New macro.
11945 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11946 (Fbuffer_local_variables): Use it.
11947 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11948 * alloc.c (allocate_buffer): Adjust to match new layout of
11949 struct buffer. Fix comment.
11950 (mark_overlay): New function.
11951 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11952 Lisp area of struct buffer.
11953 (mark_object): Use it. Adjust marking of misc objects
11954 and related comments.
11956 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11958 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11959 wrapper that is not needed because the wrapped code is a no-op (zero
11960 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11961 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11963 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11965 * alloc.c (mark_buffer): Simplify. Remove prototype.
11966 (mark_object): Add comment. Reorganize marking of vector-like
11967 objects. Use CHECK_LIVE for all vector-like objects except buffers
11968 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11969 Avoid redundant calls to mark_vectorlike for bool vectors.
11971 2012-06-30 Glenn Morris <rgm@gnu.org>
11973 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11975 * epaths.in (PATH_SITELOADSEARCH): New.
11976 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11977 This is rather than relying on --enable-locallisppath elements
11978 having "site-lisp" in their names. (Bug#10208#25, 11658)
11980 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11982 * w32proc.c (sys_select): Accept and ignore one more argument.
11984 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11986 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11987 (pselect) [!MS_DOS]: Redirect to sys_select.
11989 * sysdep.c: Don't include dos.h and dosfns.h.
11991 * process.c (sys_select):
11992 * msdos.c (sys_select): Accept one more argument and ignore it.
11994 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11995 adapt data types and code to that.
11998 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11999 which clashes with the gnulib function of the same name.
12001 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
12003 * font.c (font_style_to_value, font_style_symbolic)
12004 (font_prop_validate_style): Add type checks for values in
12007 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
12009 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
12012 2012-06-29 Eli Zaretskii <eliz@gnu.org>
12014 * xdisp.c (try_window_id): Undo last change.
12016 * w32.c (getwd): Adjust commentary about startup_dir.
12017 (init_environment): Always call sys_access, even in non-MSVC
12018 builds. Don't chdir to the directory of the Emacs executable.
12019 This undoes code from 1997 which was justified by the need to
12020 "avoid conflicts when removing and renaming directories". But its
12021 downside was that every relative file name was being interpreted
12022 relative to the directory of the Emacs executable, which can never
12023 be TRT. In particular, it broke sys_access when called with
12024 relative file names.
12025 (sys_access): Map GetLastError to errno.
12027 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12029 * window.h (struct window): Change type of 'fringes_outside_margins'
12030 to bitfield. Fix comment. Adjust users accordingly.
12031 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12033 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12036 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12038 * gnutls.c (emacs_gnutls_handshake):
12039 Add QUIT to make the loop interruptible.
12041 2012-06-29 Glenn Morris <rgm@gnu.org>
12043 * charset.c (init_charset): Make lack of etc/charsets fatal.
12045 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12047 * editfns.c (region_limit): Fix type mismatch.
12049 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12051 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12052 undefined. Convert from xassert to eassert.
12053 * nsmenu.m: Convert from xassert to eassert.
12054 * nsterm.m: Likewise.
12056 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12058 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12060 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12062 Avoid integer overflow on scroll-left and scroll-right.
12063 * window.c (HSCROLL_MAX): New macro.
12064 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12065 overflow when requested scroll falls outside ptrdiff_t range.
12067 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12069 * window.h (struct window): Change type of 'hscroll',
12070 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12071 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12072 Adjust users accordingly.
12073 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12074 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12075 from EMACS_INT to ptrdiff_t.
12076 (make_window): Omit redundant initialization.
12078 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
12080 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12082 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12084 * window.h (struct window): Change type of 'use_time' and
12085 'sequence_number' from Lisp_Object to int.
12086 * frame.c (make_frame): Adjust users accordingly.
12087 * print.c (print_object): Likewise.
12088 * window.c (select_window, Fwindow_use_time, make_parent_window)
12089 (make_window): Likewise.
12091 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12093 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12094 enabled with --enable-checking=[all,glyphs] configure option.
12095 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12096 adjust comments accordingly.
12097 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12098 undefined, adjust comments accordingly.
12099 * image.c: Likewise.
12100 * scroll.c: Likewise.
12101 * w32fns.c: Likewise.
12102 * w32term.c: Likewise.
12103 * xdisp.c: Likewise.
12104 * xfaces.c: Likewise.
12105 * xfns.c: Likewise.
12106 * xterm.c: Likewise.
12108 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12110 Generalize run-time debugging checks.
12111 * dispextern.h (XASSERTS): Remove.
12112 * fontset.c (xassert): Remove.
12113 Convert from xassert to eassert.
12114 * alloc.c: Convert from xassert to eassert.
12115 * bidi.c: Likewise.
12116 * dispnew.c: Likewise.
12118 * fringe.c: Likewise.
12119 * ftfont.c: Likewise.
12120 * gtkutil.c: Likewise.
12121 * image.c: Likewise.
12122 * keyboard.c: Likewise.
12123 * menu.c: Likewise.
12124 * process.c: Likewise.
12125 * scroll.c: Likewise.
12126 * sound.c: Likewise.
12127 * term.c: Likewise.
12128 * w32console.c: Likewise.
12129 * w32fns.c: Likewise.
12130 * w32term.c: Likewise.
12131 * window.c: Likewise.
12132 * xdisp.c: Likewise.
12133 * xfaces.c: Likewise.
12134 * xfns.c: Likewise.
12135 * xselect.c: Likewise.
12136 * xterm.c: Likewise.
12138 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12140 * fns.c (maybe_resize_hash_table): Output message when growing the
12143 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12145 * alloc.c (allocate_string_data): Remove dead code.
12146 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12147 avoid GCC warning about unused macro.
12149 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12151 * alloc.c (allocate_string): Omit intervals initialization.
12152 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12153 as in make_pure_string and make_pure_c_string.
12155 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12157 * alloc.c (allocate_string): Fix last change.
12159 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12161 * alloc.c (allocate_string): Remove two redundant calls
12162 to memset, add explicit initialization where appropriate.
12164 2012-06-27 Glenn Morris <rgm@gnu.org>
12166 * lisp.mk (lisp): Remove paths.elc.
12168 2012-06-27 Chong Yidong <cyd@gnu.org>
12170 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12172 2012-06-26 John Wiegley <johnw@newartisans.com>
12174 * unexmacosx.c (copy_data_segment): Add two section names used
12175 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12177 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12178 when building with Clang.
12180 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12182 * eval.c (Fapply): Allow calling it with a single argument.
12184 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12186 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12187 _stricmp and _strnicmp.
12188 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12190 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12192 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12194 (allocate_process): Likewise for new process.
12195 (allocate_terminal): Change to use offsetof.
12196 (allocate_frame): Likewise.
12197 * frame.c (make_frame): Omit redundant initialization.
12198 * window.c (make_parent_window): Use memset.
12199 (make_window): Omit redundant initialization.
12200 * process.c (make_process): Omit redundant initialization.
12201 * terminal.c (create_terminal): Likewise.
12203 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12205 * term.c (delete_tty): Remove redundant call to memset.
12207 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12209 * alloc.c: Remove build_string.
12210 * lisp.h: Define build_string as static inline. This provides
12211 a better opportunity to optimize away calls to strlen when the
12212 function is called with compile-time constant argument.
12213 * image.c (imagemagick_error): Convert to build_string.
12214 * w32proc.c (sys_spawnve): Likewise.
12215 * xterm.c (x_term_init): Likewise.
12217 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12219 Use sprintf return value instead of invoking strlen on result.
12220 In the old days this wasn't portable, since some sprintf
12221 implementations returned char *. But they died out years ago and
12222 Emacs already assumes sprintf returns int.
12223 Similarly for float_to_string.
12224 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12225 * ccl.c (ccl_driver):
12226 * character.c (string_escape_byte8):
12227 * data.c (Fnumber_to_string):
12228 * doprnt.c (doprnt):
12229 * print.c (print_object):
12230 * xdisp.c (message_dolog):
12231 * xfns.c (syms_of_xfns):
12232 Use sprintf or float_to_string result to avoid need to call strlen.
12233 * data.c (Fnumber_to_string):
12234 Use make_unibyte_string, since the string must be ASCII.
12235 * lisp.h, print.c (float_to_string): Now returns int length.
12236 * term.c (produce_glyphless_glyph):
12237 Use sprintf result rather than recomputing it.
12239 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12240 * Makefile.in (ALL_CFLAGS):
12241 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12242 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12244 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12246 * dispextern.h (xstrcasecmp): Define to library function
12247 strcasecmp if available.
12248 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12250 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12252 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12253 Avoid comma operator.
12254 * menu.c (push_submenu_start, push_submenu_end)
12255 (push_left_right_boundary, push_menu_pane): Likewise.
12256 * msdos.c (dos_rawgetc): Likewise.
12258 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12260 * xfns.c (xic_create_fontsetname): Remove redundant calls
12263 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12265 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12266 sprintf already null-terminates its output.
12268 * xfns.c (x_window): Remove redundant cast.
12270 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12272 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12273 `const char *' to `char *' to avoid compiler warning.
12275 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12277 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12278 instead of truncating it to 63 (admittedly a generous limit).
12280 * process.c: Fix spelling and caps in comments.
12282 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12284 * emacs.c (setpgrp): Remove definition, unused.
12285 * sysdep.c (setpgrp): Remove definition, not used in this file.
12287 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12289 * makefile.w32-in: Update dependencies.
12291 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12293 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12294 (SYSTIME_H): Add nt/inc/sys/time.h.
12296 * systime.h [WINDOWSNT]: Include sys/time.h.
12298 * s/ms-w32.h (struct timespec): Definition moved from
12299 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12301 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12303 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12304 * buffer.h (buffer_slot_type_mismatch):
12305 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12306 * eval.c (unwind_to_catch):
12307 * image.c (my_png_error, my_error_exit):
12308 * keyboard.c (quit_throw_to_read_char, user_error)
12309 (Fexit_recursive_edit, Fabort_recursive_edit):
12310 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12311 (wrong_type_argument, buffer_overflow, __executable_start)
12312 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12313 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12314 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12316 (child_setup) [!DOS_NT]:
12317 * lread.c (end_of_file_error, invalid_syntax):
12318 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12319 * puresize.h (pure_write_error):
12320 * search.c (matcher_overflow):
12321 * sound.c (sound_perror, alsa_sound_perror):
12322 * sysdep.c, syssignal.h (croak):
12323 * term.c (maybe_fatal, vfatal):
12324 * textprop.c (text_read_only):
12325 * undo.c (user_error):
12326 * unexmacosx.c (unexec_error):
12327 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12328 Use _Noreturn rather than NO_RETURN.
12329 No need for separate decl merely because of _Noreturn.
12330 * sound.c (sound_warning, parse_sound):
12331 Remove unnecessary forward decls.
12333 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12335 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12336 * lisp.h (WAIT_READING_MAX): New macro.
12337 * dispnew.c (Fsleep_for, sit_for):
12338 * keyboard.c (kbd_buffer_get_event):
12339 * process.c (Faccept_process_output):
12340 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12341 This improves on the previous patch, which introduced a bug
12342 when time_t is unsigned and as wide as intmax_t.
12343 See <http://bugs.gnu.org/9000#51>.
12345 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12347 * dispnew.c (sit_for, Fsleep_for):
12348 * keyboard.c (kbd_buffer_get_event):
12349 * process.c (Faccept_process_output): Avoid compiler warnings when
12350 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12352 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12354 * makefile.w32-in: Update dependencies.
12356 * w32.c (ltime): Add return type and declare static.
12357 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12359 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12361 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12362 Privately reported by Herbert J. Skuhra.
12363 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12365 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12366 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12368 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12370 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12371 last argument of make_unibyte_string.
12373 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12374 language ID in the event parameters.
12376 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12377 event.code, not the obscure "character set ID".
12379 2012-06-23 Chong Yidong <cyd@gnu.org>
12381 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12383 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12385 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12386 * w32.c (fdutimens): New function.
12388 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12390 * s/ms-w32.h (pselect): Redirect to sys_select.
12392 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12394 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12395 in the logic of incrementing and decrementing the value of
12396 use_relocatable_buffers.
12398 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12400 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12401 Privately reported by Herbert J. Skuhra.
12402 [__FreeBSD__]: Remove "*/" typo after "#include".
12403 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12404 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12405 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12406 Don't assume EMACS_TIME and struct timeval are the same type.
12408 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12410 Support higher-resolution time stamps (Bug#9000).
12411 The time stamps are only nanosecond-resolution at the C level,
12412 since that's the best that any real-world system supports now.
12413 But they are picosecond-resolution at the Lisp level, as that's
12414 easy, and leaves room for future OS improvements.
12416 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12419 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12420 Don't get current time unless it's needed.
12422 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12423 now provides it if it's absent.
12424 (start_atimer): Port to higher-res time stamps.
12425 Check for time stamp overflow. Don't get current time more
12426 often than is needed.
12428 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12429 Include systime.h, not time.h.
12430 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12432 * dired.c: Include stat-time.h.
12433 (Ffile-attributes): File times now have higher resolution.
12435 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12436 (struct image): Timestamp now has higher resolution.
12438 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12439 has at least microseconds now. All uses removed.
12440 (update_frame, update_single_window, update_window, update_frame_1)
12441 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12442 (duration_to_sec_usec): Remove; no longer needed.
12444 * editfns.c (time_overflow): Now extern.
12445 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12446 (float-time, Fformat_time_string, Fcurrent_time_string)
12447 (Fcurrent_time_zone): Accept and generate higher-resolution
12449 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12450 (decode_time_components, lisp_seconds_argument): New functions.
12451 (make_time): Now static.
12452 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12453 Report an error if the time is invalid, rather than having the caller
12456 * fileio.c: Include <stat-time.h>
12457 (Fcopy_file): Copy higher-resolution time stamps.
12458 Prefer to set the time stamp via a file descriptor if that works.
12459 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12460 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12461 (Fvisited_file_modtime, Fset_visited_file_modtime):
12462 Support higher-resolution time stamps.
12464 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12466 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12468 * image.c (prepare_image_for_display, clear_image_cache)
12469 (lookup_image): Port to higer-resolution time stamps.
12471 * keyboard.c (start_polling, bind_polling_period):
12472 Check for time stamp overflow.
12473 (read_char, kbd_buffer_get_event, timer_start_idle)
12474 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12475 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12476 Port to higher-resolution time stamps. Do not assume time_t is signed.
12477 (decode_timer): New function. Timers are now vectors of length 9,
12478 not 8, to accommodate the picosecond component.
12479 (timer_check_2): Use it.
12481 * nsterm.m (select_timeout, timeval_subtract): Remove.
12482 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12483 as they're a bit more accurate and handle overflow better.
12484 (ns_select): Change prototype to be compatible with pselect.
12485 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12486 * nsterm.h (ns_select): Adjust prototype.
12488 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12489 us-resolution time stamps.
12490 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12492 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12494 * lisp.h (time_overflow): New decl.
12495 (wait_reading_process_output): First arg is now intmax_t, not int,
12496 to accommodate larger waits.
12498 * process.h (struct Lisp_Process.read_output_delay):
12499 Now counts nanoseconds, not microseconds.
12500 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12502 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12503 (wait_reading_process_output):
12504 Port to ns-resolution time stamps.
12505 (Faccept_process_output, wait_reading_process_output):
12506 Check for time stamp overflow. Do not assume time_t is signed.
12507 (select_wrapper): Remove; we now use pselect.
12508 (Fprocess_attributes): Now generates ns-resolution time stamps.
12510 * sysdep.c: Include utimens.h. Don't include utime.h
12511 or worry about struct utimbuf; gnulib does that for us now.
12512 (gettimeofday): Remove; gnulib provides a substitute.
12513 (make_timeval): New function.
12514 (set_file_times): Now sets ns-resolution time stamps.
12515 New arg FD; all uses changed.
12516 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12517 (system_process_attributes):
12518 Now returns ns-resolution time stamp. All uses changed.
12519 Check for time stamp overflow.
12521 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12522 provides a substitute now.
12524 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12525 since it guarantees struct timespec.
12526 (EMACS_TIME): Now struct timespec, so that we can support
12527 ns-resolution time stamps.
12528 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12529 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12530 (EMACS_USECS): Remove.
12531 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12532 so multiply the arg by 1000 before storing it.
12533 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12535 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12536 Port to ns-resolution time stamps.
12537 (EMACS_TIME_NEG_P): Remove; replaced by....
12538 (EMACS_TIME_SIGN): New macro.
12539 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12540 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12541 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12542 (make_timeval, make_lisp_time, decode_time_components): New decls.
12543 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12544 that it mishandled time_t overflow. You can't compare by subtracting!
12545 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12546 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12548 * term.c: Include <sys/time.h>.
12549 (timeval_to_Time): New function, for proper overflow wraparound.
12550 (term_mouse_position, term_mouse_click): Use it.
12552 * undo.c (record_first_change): Support higher-resolution time stamps
12553 in the undo buffer.
12554 (Fprimitive_undo): Use them when restoring time stamps.
12556 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12557 (w32_get_internal_run_time):
12558 Port to higher-resolution Emacs time stamps.
12559 (ltime): Now accepts single 64-bit integer, as that's more convenient
12562 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12564 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12565 for compatibility with pselect. Support ns-resolution time stamps.
12567 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12569 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12570 Check for time stamp overflow, and support ns-resolution time stamps.
12572 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12573 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12574 (timeval_subtract): Remove; no longer needed.
12575 (XTflash, XTring_bell, x_wait_for_event):
12576 Port to ns-resolution time stamps. Don't assume time_t is signed.
12578 2012-06-22 Chong Yidong <cyd@gnu.org>
12580 * xdisp.c (x_consider_frame_title): Revert last change.
12582 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12584 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12585 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12586 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12587 staticidx goes up to 1597 out of 1600 = 0x640.)
12589 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12591 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12592 Otherwise, the umask might be mistakenly 0 while handling input signals.
12594 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12596 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12598 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12600 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12601 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12602 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12603 access to `contents' member of Lisp_Vector objects with AREF and ASET
12606 2012-06-19 Chong Yidong <cyd@gnu.org>
12608 * frame.c (delete_frame): When selecting a frame on a different
12609 text terminal, do not alter the terminal's top-frame.
12611 * xdisp.c (format_mode_line_unwind_data): Record the target
12612 frame's selected window and its terminal's top-frame.
12613 (unwind_format_mode_line): Restore them.
12614 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12616 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12617 since tty frames can be explicitly named.
12618 (prepare_menu_bars): Likewise.
12620 * term.c (Ftty_top_frame): New function.
12622 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12624 Port byte-code-meter to modern targets.
12625 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12626 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12627 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12628 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12629 (METER_1, METER_2): Simplify.
12631 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12633 * data.c (Fdefalias): Return `symbol' (bug#11686).
12635 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12637 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12638 gets killed during executing of this function (Bug#11665).
12639 Try to always return Qt when the buffer has been actually killed.
12640 (Vkill_buffer_query_functions): In doc-string say that functions
12641 run by this hook should not change the current buffer.
12643 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12645 Fix recently-introduced process.c problems found by static checking.
12646 * process.c (write_queue_push, write_queue_pop, send_process):
12647 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12648 (write_queue_pop): Fix pointer signedness problem.
12649 (send_process): Remove unused local.
12651 2012-06-17 Chong Yidong <cyd@gnu.org>
12653 * xdisp.c (redisplay_internal): No need to redisplay terminal
12654 frames that are not on top.
12656 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12658 * process.c (make_process): Initialize write_queue.
12659 (write_queue_push, write_queue_pop): New functions.
12660 (send_process): Use them to maintain correct ordering of process
12661 writes (Bug#10815).
12663 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12665 * lisp.h (eassert): Assume C89 or later.
12666 This removes the need for CHECK.
12667 (CHECK): Remove. Its comments about always evaluating its
12668 argument were confusing, as 'eassert' typically does not evaluate
12671 * coding.c (produce_chars): Use ptrdiff_t, not int.
12673 * xterm.c (x_draw_underwave): Check for integer overflow.
12674 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12676 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12678 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12679 referenced (Bug#11583).
12681 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12683 Implement wave-style variant of underlining.
12684 * dispextern.h (face_underline_type): New enum.
12685 (face): Add field for underline type.
12686 * nsterm.m (ns_draw_underwave): New function.
12687 (ns_draw_text_decoration): Use it.
12688 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12690 (x_draw_glyph_string): Use them.
12691 * xfaces.c (Qline, Qwave): New Lisp objects.
12692 (check_lface_attrs, merge_face_ref)
12693 (Finternal_set_lisp_face_attribute, realize_x_face):
12694 Handle wave-style underline face attributes.
12695 * xterm.c (x_draw_underwave): New function.
12696 (x_draw_glyph_string): Use it.
12698 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12700 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12701 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12702 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12703 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12704 ($(BLD)/w32select.$(O)): Update dependencies.
12706 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12708 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12709 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12710 * character.c (_fetch_multibyte_char_p): Remove.
12711 * alloc.c: Include "character.h" before "buffer.h".
12712 * bidi.c: Likewise.
12713 * buffer.c: Likewise.
12714 * bytecode.c: Likewise.
12715 * callint.c: Likewise.
12716 * callproc.c: Likewise.
12717 * casefiddle.c: Likewise.
12718 * casetab.c: Likewise.
12719 * category.c: Likewise.
12720 * cmds.c: Likewise.
12721 * coding.c: Likewise.
12722 * composite.c: Likewise.
12723 * dired.c: Likewise.
12724 * dispnew.c: Likewise.
12726 * dosfns.c: Likewise.
12727 * editfns.c: Likewise.
12728 * emacs.c: Likewise.
12729 * fileio.c: Likewise.
12730 * filelock.c: Likewise.
12731 * font.c: Likewise.
12732 * fontset.c: Likewise.
12733 * fringe.c: Likewise.
12734 * indent.c: Likewise.
12735 * insdel.c: Likewise.
12736 * intervals.c: Likewise.
12737 * keyboard.c: Likewise.
12738 * keymap.c: Likewise.
12739 * lread.c: Likewise.
12740 * macros.c: Likewise.
12741 * marker.c: Likewise.
12742 * minibuf.c: Likewise.
12743 * nsfns.m: Likewise.
12744 * nsmenu.m: Likewise.
12745 * print.c: Likewise.
12746 * process.c: Likewise.
12747 * regex.c: Likewise.
12748 * region-cache.c: Likewise.
12749 * search.c: Likewise.
12750 * syntax.c: Likewise.
12751 * term.c: Likewise.
12752 * textprop.c: Likewise.
12753 * undo.c: Likewise.
12754 * unexsol.c: Likewise.
12755 * w16select.c: Likewise.
12756 * w32fns.c: Likewise.
12757 * w32menu.c: Likewise.
12758 * window.c: Likewise.
12759 * xdisp.c: Likewise.
12760 * xfns.c: Likewise.
12761 * xmenu.c: Likewise.
12763 * xselect.c: Likewise.
12765 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12767 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12768 If all the glyphs of the glyph row came from strings, and we have no
12769 cursor positioning clues, put the cursor on the first glyph of the
12771 (handle_face_prop): Use chunk-relative overlay string index when
12772 indexing into it->string_overlays array. (Bug#11653)
12773 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12774 the rightmost. (Bug#11720)
12776 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12778 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12779 (CATEGORY_MEMBER): Enforce 1/0 value.
12780 * category.c (_temp_category_set): Remove.
12782 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12784 * window.c (Fdelete_other_windows_internal)
12785 (Fdelete_window_internal): Don't access frame's mouse highlight
12786 info of the initial frame. (Bug#11677)
12788 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12790 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12791 Assume USE_2_TAGS_FOR_INTS.
12792 (xreload): Adjust $tagmask width to match recent lisp.h change.
12794 Simplify lisp.h in minor ways that should not affect code.
12795 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12796 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12797 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12798 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12799 (INTTYPEBITS): New macro, for clarity.
12800 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12801 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12802 Simplify now that USE_LSB_TAG is always defined.
12803 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12804 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12806 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12808 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12810 2012-06-13 Glenn Morris <rgm@gnu.org>
12812 * s/bsd-common.h (BSD4_3):
12813 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12815 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12817 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12819 (XLI, XIL): Define.
12820 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12822 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12823 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12824 * alloc.c (widen_to_Lisp_Object): Remove.
12825 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12826 * frame.c (delete_frame): Remove outdated comment.
12827 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12828 USE_LISP_UNION_TYPE.
12829 (Fw32_unregister_hot_key): Likewise.
12830 (Fw32_toggle_lock_key): Likewise.
12831 * w32menu.c (add_menu_item): Likewise.
12832 (w32_menu_display_help): Use XIL instead of checking
12833 USE_LISP_UNION_TYPE.
12834 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12835 (init_heap): Likewise.
12836 * w32term.c (w32_read_socket): Update comment.
12838 2012-06-13 Glenn Morris <rgm@gnu.org>
12840 * s/usg5-4-common.h, src/s/unixware.h:
12841 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12843 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12845 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12847 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12848 * alloc.c (make_number) [!defined make_number]:
12849 Remove, as lisp.h always defines this now.
12850 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12851 (roundup_size): Verify that it is a power of 2.
12852 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12853 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12854 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12855 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12856 USE_LSB_TAG now is always defined to be either 0 or 1.
12858 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12859 code works fine either way, and efficiency is not a concern here,
12860 as the union type is for debugging, not for production.
12861 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12862 Use an inline function on all platforms when using the union type,
12863 since this is simpler and 'static inline' can be used portably
12865 (LISP_INITIALLY_ZERO): New macro.
12866 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12867 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12869 2012-06-12 Glenn Morris <rgm@gnu.org>
12871 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12873 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12875 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12876 Move BROKEN_SIGIO to configure.
12878 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12879 Move NO_TERMIO to configure.
12881 2012-06-12 Chong Yidong <cyd@gnu.org>
12883 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12884 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12885 MagickExportImagePixels is undefined.
12887 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12889 * image.c (imagemagick_load_image): Remove unused label.
12891 2012-06-11 Glenn Morris <rgm@gnu.org>
12893 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12894 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12895 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12896 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12898 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12900 * alloc.c (make_byte_code): New function.
12901 (Fmake_byte_code): Use it. Don't purify here.
12902 * lread.c (read1): Use it as well to avoid extra allocation.
12904 2012-06-11 Chong Yidong <cyd@gnu.org>
12906 * image.c (imagemagick_load_image): Implement transparency.
12908 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12910 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12911 account for preceding backslashes. (Bug#11663)
12913 2012-06-09 Chong Yidong <cyd@gnu.org>
12915 * term.c: Support italics in capable terminals (Bug#9652).
12916 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12917 (turn_on_face): Output using TS_enter_italic_mode if available.
12918 Don't handle unused blinking and alt-charset cases.
12919 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12920 and tty_alt_charset_p cases.
12921 (tty_capable_p, init_tty): Support italics.
12923 * termchar.h (struct tty_display_info): Add field for italics.
12924 Remove unused blink field.
12926 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12929 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12930 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12931 tty_alt_charset_p. Add tty_italic_p.
12933 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12935 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12936 dbus_type_is_basic if available.
12937 (xd_extract_signed, xd_extract_unsigned): Rename from
12938 extract_signed and extract_unsigned, respectively. Adapt callers.
12940 2012-06-09 Chong Yidong <cyd@gnu.org>
12942 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12944 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12947 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12949 * xdisp.c (vmessage): Treat frame message as multibyte.
12950 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12951 would generate the diagnostic "Making \302\247 buffer-local while
12954 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12956 * dispnew.c (showing_window_margins_p): Undo last change, which
12957 was done due to an inadvertent commit.
12958 (adjust_frame_glyphs_for_frame_redisplay): Do call
12959 showing_window_margins_p.
12961 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12963 * eval.c (Fmake_var_non_special): New primitive.
12964 (syms_of_eval): Defsubr it.
12965 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12967 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12969 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12970 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12972 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12974 * alloc.c (allocate_vectorlike): Fix last change.
12976 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12978 Block-based vector allocation of small vectors.
12979 * lisp.h (struct vectorlike_header): New field `nbytes',
12980 adjust comment accordingly.
12981 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12982 to denote vector blocks. Adjust users (live_vector_p,
12983 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12984 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12985 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12986 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12987 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12988 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12989 (roundup_size): New constant.
12990 (struct vector_block): New data type.
12991 (vector_blocks, vector_free_lists, zero_vector): New variables.
12992 (all_vectors): Rename to `large_vectors'.
12993 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12994 (sweep_vectors): New functions.
12995 (allocate_vectorlike): Return `zero_vector' as the only vector of
12996 0 items. Allocate new vector from block if vector size is less than
12997 or equal to VBLOCK_BYTES_MAX.
12998 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12999 (init_alloc_once): Add call to init_vectors.
13001 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13003 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
13005 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
13007 * doprnt.c (doprnt): Truncate multibyte char correctly.
13008 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
13009 would mishandle a string argument "Xc" if X was a multibyte
13010 character of length 2: it would truncate after X's first byte
13011 rather than including all of X.
13013 2012-06-06 Chong Yidong <cyd@gnu.org>
13015 * buffer.c (word_wrap): Doc fix.
13017 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
13019 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
13021 2012-06-03 Glenn Morris <rgm@gnu.org>
13023 * xdisp.c (tool-bar-style): Doc fix.
13025 2012-06-03 Ulrich Müller <ulm@gentoo.org>
13027 * Makefile.in (PAXCTL): Define.
13028 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13029 binary via PaX flags if the paxctl utility is available.
13030 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13031 Restore PaX flags to their default. (Bug#11398)
13033 2012-06-03 Chong Yidong <cyd@gnu.org>
13035 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13036 buffer (Bug#11226).
13038 2012-06-03 Chong Yidong <cyd@gnu.org>
13040 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13041 (note_mode_line_or_margin_highlight): If there is no help echo,
13042 use mode-line-default-help-echo. Handle the case where the mouse
13043 position is past the end of the mode line string.
13045 * buffer.c (buffer_local_value_1): New function, split from
13046 Fbuffer_local_value; can return Qunbound.
13047 (Fbuffer_local_value): Use it.
13048 (Vmode_line_format): Docstring tweaks.
13050 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13052 * sysdep.c (system_process_attributes): Improve comment.
13054 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13056 * keyboard.c: Export real-this-command to Elisp.
13057 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13058 and DEFVAR it. Update all users.
13060 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13062 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13064 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13065 Convert pctcpu and pctmem to Lisp float properly.
13066 Let the compiler fold better, as 100.0/0x8000 is exact.
13068 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13070 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13073 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13075 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13077 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13079 For a 'struct window', replace some Lisp_Object fields to
13080 bitfields where appropriate, remove unused fields.
13081 * window.h (struct window): Remove unused 'last_mark_x' and
13082 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13083 change its type from Lisp_Object to bitfield.
13084 Change type of 'force_start', 'optional_new_start',
13085 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13086 fields from Lisp_Object to bitfield. Adjust users accordingly.
13088 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13090 Pacify gcc -Wdouble-precision when using Xaw.
13091 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13092 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13093 Use 'float' consistently, rather than 'float' in most places
13094 and 'double' in a couple of places.
13096 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13098 * xdisp.c (handle_stop): Detect whether we have overlay strings
13099 loaded by testing it->current.overlay_string_index to be
13100 non-negative, instead of checking whether n_overlay_strings is
13101 positive. (Bug#11587)
13103 2012-05-31 Chong Yidong <cyd@gnu.org>
13105 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13107 * doc.c (Fsubstitute_command_keys): Doc fix.
13109 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13111 * search.c (search_buffer): Remove calls to
13112 r_alloc_inhibit_buffer_relocation, as it is now called by
13113 maybe_unify_char, which was the cause of relocation of buffer text
13116 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13118 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13119 for the duration of call to load_charset, to avoid problems with
13120 callers of maybe_unify_char that access buffer text through C
13123 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13124 decrement the inhibition flag, instead of just setting or
13127 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13129 Remove obsolete '#define static' cruft.
13130 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13131 This #undef was "temporary" in 2000; it is no longer needed
13132 now that '#define static' has gone away.
13133 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13134 (gray_bitmap_bits): Remove; no longer needed.
13135 All uses replaced with definiens.
13136 * xterm.c: Include "bitmaps/gray.xbm".
13138 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13140 Clean up __executable_start, monstartup when --enable-profiling.
13141 The following changes affect the code only when profiling.
13142 * dispnew.c (__executable_start): Rename from safe_bcopy.
13143 Define only on platforms that need it.
13144 * emacs.c: Include <sys/gmon.h> when profiling.
13145 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13146 (__executable_start): Remove decl, since lisp.h does it now.
13147 (safe_bcopy): Remove decl; no longer has that name.
13148 (main): Coalesce #if into single bit of code, for simplicity.
13149 Cast pointers to uintptr_t, since standard libraries want integers
13151 * lisp.h (__executable_start): New decl.
13153 2012-05-31 Glenn Morris <rgm@gnu.org>
13155 * image.c (Fimagemagick_types): Doc fix.
13157 2012-05-30 Jim Meyering <meyering@redhat.com>
13159 * callproc.c (Fcall_process_region): Include directory component
13160 in mkstemp error message (Bug#11586).
13162 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13164 * alloc.c, lisp.h (make_pure_vector): Now static.
13166 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13168 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13169 Move to byte-run.el.
13170 (Fautoload): Do the hash-doc more carefully.
13171 * data.c (Fdefalias): Purify definition, except for keymaps.
13172 (Qdefun): Move from eval.c.
13173 * lisp.h (Qdefun): Remove.
13174 * lread.c (read1): Tiny simplification.
13176 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
13178 Do not create empty overlays with the evaporate property (Bug#9642).
13179 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13180 Bug#9642, but explicitly check that the buffer the overlay would
13181 be moved to is live and rearrange lines to make sure that errors
13182 will not put the overlay in an inconsistent state.
13183 (Fdelete_overlay): Cosmetics.
13185 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13187 * w32term.c (my_bring_window_to_top): New function.
13188 (x_raise_frame): Use handle returned by DeferWindowPos, which
13189 could be different from the original one.
13190 Call my_bring_window_to_top instead of my_set_foreground_window.
13193 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13194 by calling BringWindowToTop.
13196 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13197 (WM_EMACS_END): Increase by one.
13199 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13201 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13202 This avoids undefined behavior that might cause the eassert
13203 to not catch an out-of-range value.
13205 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13207 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13208 Update dependencies.
13210 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13212 * bidi.c (bidi_mirror_char): Fix last change.
13214 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13216 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13217 when referring to sectname field in printf format.
13219 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13221 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13222 Only r_alloc_inhibit_buffer_relocation needed to be added;
13223 the others were already declared.
13225 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13226 before checking whether it's out of range. Put the check inside
13228 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13230 2012-05-27 Ken Brown <kbrown@cornell.edu>
13232 * callproc.c (Fcall_process): Restore a line that was accidentally
13233 commented out in the 2011-02-13 change (bug#11547).
13235 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13237 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13238 defined on ralloc.c.
13240 * buffer.c [REL_ALLOC]: Remove prototypes of
13241 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13242 they are now on lisp.h.
13244 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13246 * search.c (search_buffer): Use it to inhibit relocation of buffer
13247 text while re_search_2 is doing its job, because re_search_2 is
13248 passed C pointers to buffer text. (Bug#11519)
13250 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13251 Update value to 24.
13253 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13254 state after an additional call to move_it_in_display_line_to, keep
13255 the values of it->max_ascent and it->max_descent found for the
13257 (pos_visible_p): Revert the comparison against bottom_y to what it
13258 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13261 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13263 Fix coding-related core dumps with gcc -ftrapv.
13264 The code was computing A - B, where A and B are pointers, and B is
13265 random garbage. This can lead to core dumps on platforms that
13266 have special pointer registers, and it also leads to core dumps on
13267 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13268 A - B only when B is initialized properly.
13269 * coding.c (coding_set_source, coding_set_destination): Return void.
13270 (coding_change_source, coding_change_destinations): New functions,
13271 with the old behaviors of coding_set_source and coding_set_destination.
13272 All callers that need an offset changed to use these new functions.
13274 2012-05-26 Glenn Morris <rgm@gnu.org>
13276 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13278 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13280 Extend mouse support on W32 text-mode console.
13281 * xdisp.c (draw_row_with_mouse_face):
13282 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13284 * w32console.c: Include window.h.
13285 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13287 (initialize_w32_display): Initialize mouse-highlight data.
13289 * w32inevt.c: Include termchar.h and window.h.
13290 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13291 moves, call note_mouse_highlight. If help_echo changed, call
13292 gen_help_event to produce help-echo message in the echo area.
13293 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13296 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13298 * lread.c (read1): Simplify slightly to avoid an overflow warning
13299 with GCC 4.7.0 on x86-64.
13301 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13303 * bidi.c (bidi_mirror_char): Revert last change: an int is
13304 definitely wide enough here.
13306 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13308 Fix integer width and related bugs (Bug#9874).
13309 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13310 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13311 (string_bytes, check_sblock, allocate_string_data):
13312 (compact_small_strings, Fmake_bool_vector, make_string)
13313 (make_unibyte_string, make_multibyte_string)
13314 (make_string_from_bytes, make_specified_string)
13315 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13316 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13319 (allocate_pseudovector):
13320 Use int, not EMACS_INT, where int is wide enough.
13321 (inhibit_garbage_collection, Fgarbage_collect):
13322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13323 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13324 int might not be wide enough.
13325 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13326 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13327 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13328 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13329 (bidi_level_of_next_char, bidi_move_to_visually_next):
13330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13331 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13332 (Fkill_buffer, Fset_buffer_major_mode)
13333 (advance_to_char_boundary, Fbuffer_swap_text)
13334 (Fset_buffer_multibyte, overlays_at, overlays_in)
13335 (overlay_touches_p, struct sortvec, record_overlay_string)
13336 (overlay_strings, recenter_overlay_lists)
13337 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13338 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13339 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13340 (Foverlay_recenter, last_overlay_modification_hooks_used)
13341 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13343 (validate_region): Omit unnecessary test for b <= e,
13344 since that's guaranteed by the previous test.
13345 (adjust_overlays_for_delete): Avoid pos + length overflow.
13346 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13347 (report_overlay_modification):
13348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13349 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13350 Omit pointer cast, which isn't needed anyway, and doesn't work
13351 after the EMACS_INT -> ptrdiff_t change.
13352 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13353 * buffer.h: Adjust decls to match defn changes elsewhere.
13354 (struct buffer_text, struct buffer):
13355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13356 Use EMACS_INT, not int, where int might not be wide enough.
13357 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13358 not int, to avoid needless 32-bit limit on 64-bit hosts.
13359 (exec_byte_code): Use tighter memory-full test, one that checks
13360 for alloca overflow. Don't compute the address of the object just
13361 before an array, as that's not portable. Use EMACS_INT, not
13362 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13363 * callint.c (Fcall_interactively):
13364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13365 * callproc.c (call_process_kill, Fcall_process):
13366 Don't assume pid_t fits into an Emacs fixnum.
13367 (call_process_cleanup, Fcall_process, child_setup):
13368 Don't assume pid_t fits into int.
13369 (call_process_cleanup, Fcall_process, delete_temp_file)
13370 (Fcall_process_region):
13371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13372 (Fcall_process): Simplify handling of volatile integers.
13373 Use int, not EMACS_INT, where int will do.
13374 * casefiddle.c (casify_object, casify_region, operate_on_word)
13375 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13377 (casify_object): Avoid integer overflow when overallocating buffer.
13378 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13379 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13380 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13381 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13382 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13383 integers are now checked earlier. All uses replaced with XINT.
13385 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13386 For CCL_MapSingle, check that content and value are in int range.
13387 (ccl_driver, Fregister_code_conversion_map):
13388 Check that Vcode_version_map_vector is a vector.
13389 (resolve_symbol_ccl_program): Check that vector header is in range.
13390 Always copy the vector, so that we can check its contents reliably
13391 now rather than having to recheck each instruction as it's being
13392 executed. Check that vector words fit in 'int'.
13393 (ccl_get_compiled_code, Fregister_ccl_program)
13394 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13395 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13396 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13397 contents are in range.
13398 (Fccl_execute_on_string): Check that status is in range.
13399 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13400 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13401 Accept and return EMACS_INT, not int, because callers can pass values
13402 out of 'int' range.
13403 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13404 (multibyte_chars_in_text, parse_str_as_multibyte)
13405 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13406 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13407 (string_escape_byte8, Fget_byte):
13408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13409 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13410 avoid mishandling large integers.
13411 * character.h: Adjust decls to match defn changes elsewhere.
13412 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13413 (Ffind_charset_region):
13414 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13415 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13416 (load_charset_map_from_vector, Fdefine_charset_internal):
13417 Don't assume fixnum fits in int.
13418 (load_charset_map_from_vector, Fmap_charset_chars):
13419 Remove now-unnecessary CHECK_NATNUMs.
13420 (Fdefine_charset_internal): Check ranges here, more carefully.
13421 Don't rely on undefined behavior with signed left shift overflow.
13422 Don't assume unsigned int fits into fixnum, or that fixnum fits
13423 into unsigned int. Don't require max_code to be a valid fixnum;
13424 that's not true for gb10830 4-byte on a 32-bit host. Allow
13425 invalid_code to be a cons, for the same reason. Require code_offset
13426 to be a character. Avoid int overflow if max_char is close
13428 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13429 this is intended anyway and avoids some undefined behavior.
13430 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13431 INDEX_TO_CODE_POINT, as that's what it expects.
13432 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13433 * charset.h (DECODE_CHAR): Return int, not unsigned;
13434 this is what was intended anyway, and it avoids undefined behavior.
13435 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13436 integer-overflow issues.
13437 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13438 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13439 where the argument is EMACS_INT, and this behavior is not intended.
13440 * chartab.c (Fmake_char_table, Fset_char_table_range)
13441 (uniprop_get_decoder, uniprop_get_encoder):
13442 Don't assume fixnum fits in int.
13443 * cmds.c (move_point): New function, that does the gist of
13444 Fforward_char and Fbackward_char, but does so while checking
13445 for integer overflow more accurately.
13446 (Fforward_char, Fbackward_char): Use it.
13447 (Fforward_line, Fend_of_line, internal_self_insert)
13448 (internal_self_insert):
13449 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13450 Fix a FIXME, by checking for integer overflow when calculating
13451 target_clm and actual_clm.
13452 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13453 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13454 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13455 (coding_alloc_by_making_gap, alloc_destination)
13456 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13457 (encode_coding_utf_16, detect_coding_emacs_mule)
13458 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13459 (detect_coding_iso_2022, decode_coding_iso_2022)
13460 (encode_invocation_designation, encode_designation_at_bol)
13461 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13462 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13463 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13464 (encode_coding_ccl, encode_coding_raw_text)
13465 (detect_coding_charset, decode_coding_charset)
13466 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13467 (produce_composition, produce_charset, produce_annotation)
13468 (decode_coding, handle_composition_annotation)
13469 (handle_charset_annotation, consume_chars, decode_coding_gap)
13470 (decode_coding_object, encode_coding_object, detect_coding_system)
13471 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13472 (code_convert_region, code_convert_string)
13473 (Fdefine_coding_system_internal)
13474 (coding_set_source, coding_set_destination):
13475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13476 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13477 (Fdefine_coding_system_internal):
13478 Don't assume fixnums fit in int.
13479 (decode_coding_gap, decode_coding_object, encode_coding_object)
13480 (Fread_coding_system, Fdetect_coding_region)
13481 (Funencodable_char_position, Fcheck_coding_systems_region)
13482 (get_translation, handle_composition_annotation, consume_chars):
13483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13484 (consume_chars): Rewrite to not calculate an address outside buffer.
13485 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13486 Don't access memory outside of the args array.
13487 (Fdefine_coding_system_internal): Check for charset-id overflow.
13488 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13489 result of ENCODE_CHAR.
13490 * coding.h: Adjust decls to match defn changes elsewhere.
13491 (struct coding_system):
13492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13493 * composite.c (get_composition_id, find_composition)
13494 (run_composition_function, update_compositions)
13495 (compose_text, composition_gstring_put_cache)
13496 (composition_gstring_p, composition_gstring_width)
13497 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13498 (composition_compute_stop_pos, composition_reseat_it)
13499 (composition_update_it, struct position_record)
13500 (find_automatic_composition, composition_adjust_point)
13501 (Fcomposition_get_gstring, Ffind_composition_internal):
13502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13503 (update_compositions):
13504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13505 * composite.h: Adjust decls to match defn changes elsewhere.
13506 (struct composition):
13507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13508 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13509 Do not attempt to compute the address of the object just before a
13510 buffer; this is not portable.
13512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13513 (Faset): Use int, not EMACS_INT, where int is wide enough.
13514 (Fstring_to_number): Don't assume fixnums fit in int.
13515 (Frem): Don't assume arg is nonnegative.
13516 * dbusbind.c (xd_append_arg): Check for integers out of range.
13517 (Fdbus_call_method): Don't overflow the timeout int.
13518 (extract_signed, extract_unsigned): New functions.
13519 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13520 (xd_get_connection_references): Return ptrdiff_t, not int.
13522 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13523 (xd_read_message_1):
13524 Use int, not unsigned, where the dbus API uses int.
13525 (Fdbus_message_internal): Don't overflow mtype.
13526 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13527 * dired.c (directory_files_internal, file_name_completion, scmp)
13528 (file_name_completion_stat):
13529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13530 (file_name_completion): Don't overflow matchcount.
13531 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13532 * dispextern.h: Adjust decls to match defn changes elsewhere.
13533 (struct text_pos, struct glyph, struct bidi_saved_info)
13534 (struct bidi_string_data, struct bidi_it, struct composition_it)
13536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13537 (struct display_pos, struct composition_it, struct it):
13538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13539 * dispnew.c (increment_matrix_positions)
13540 (increment_row_positions, mode_line_string)
13541 (marginal_area_string):
13542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13543 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13545 (duration_to_sec_usec): New function, to check for overflow better.
13546 (Fsleep_for, sit_for): Use it.
13547 * doc.c (get_doc_string, store_function_docstring):
13548 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13549 (get_doc_string, Fsnarf_documentation):
13550 Use int, not EMACS_INT, where int is wide enough.
13552 Use SAFE_ALLOCA, not alloca.
13553 Check for overflow when converting EMACS_INT to off_t.
13554 * doprnt.c (doprnt):
13555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13556 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13557 Don't assume uid_t fits into fixnum.
13558 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13559 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13560 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13561 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13562 (general_insert_function)
13563 (Finsert_char, make_buffer_string, make_buffer_string_both)
13564 (update_buffer_properties, Fbuffer_substring)
13565 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13566 (Fsubst_char_in_region, check_translation)
13567 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13568 (transpose_markers, Ftranspose_regions):
13569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13570 (clip_to_bounds): Move to lisp.h as an inline function).
13571 (Fconstrain_to_field): Don't assume integers are nonnegative.
13572 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13573 (Fsubst_char_in_region, Fsave_restriction):
13574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13575 (Femacs_pid): Don't assume pid_t fits into fixnum.
13576 (lo_time): Use int, not EMACS_INT, when int suffices.
13577 (lisp_time_argument): Check for usec out of range.
13578 (Fencode_time): Don't assume fixnum fits in int.
13579 (Fuser_login_name, Fuser_full_name): Signal an error
13580 if a uid argument is out of range, rather than relying on
13581 undefined behavior.
13582 (Fformat_time_string): Remove now-unnecessary check.
13583 lisp_time_argument checks for out-of-range usec now.
13584 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13585 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13586 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13587 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13588 (init_cmdargs, Fdump_emacs):
13589 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13590 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13591 the bottom (typically) 32 bits of the fixnum.
13592 * eval.c (specpdl_size, call_debugger):
13593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13594 (when_entered_debugger, Fbacktrace_debug):
13595 Don't assume fixnum can fit in int.
13596 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13597 the object just before a buffer; this is not portable.
13598 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13599 (grow_specpdl, unbind_to):
13600 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13601 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13602 (grow_specpdl): Simplify allocation by using xpalloc.
13603 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13604 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13605 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13607 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13608 (a_write, e_write):
13609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13610 (Fcopy_file, non_regular_nbytes, read_non_regular)
13611 (Finsert_file_contents):
13612 Use int, not EMACS_INT, where int is wide enough.
13613 (READ_BUF_SIZE): Verify that it fits in int.
13614 (Finsert_file_contents): Check that counts are in proper range,
13615 rather than assuming fixnums fit into ptrdiff_t etc.
13616 Don't assume fixnums fit into int.
13617 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13618 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13619 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13620 (string_char_to_byte, string_byte_to_char)
13621 (string_make_multibyte, string_to_multibyte)
13622 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13623 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13624 (substring_both, Fdelete, internal_equal, Ffillarray)
13625 (Fclear_string, mapcar1)
13626 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13627 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13628 (larger_vector, make_hash_table, maybe_resize_hash_table)
13629 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13630 (Fmaphash, secure_hash):
13631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13632 (concat): Check for string index and length overflow.
13633 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13635 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13636 (larger_vector): New API (vec, incr_min, size_max) replaces old
13637 one (vec, new_size, init). This catches size overflow.
13638 INIT was removed because it was always Qnil.
13639 All callers changed.
13640 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13641 the upper bound on a hash table index size.
13642 (make_hash_table, maybe_resize_hash_table): Use it.
13643 (secure_hash): Computer start_byte and end_byte only after
13644 they're known to be in ptrdiff_t range.
13645 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13646 (Ffont_get_glyphs, Ffont_at):
13647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13648 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13649 (Flist_fonts, Fopen_font):
13650 Don't assume fixnum can fit in int.
13651 (check_gstring): Don't assume index can fit in int.
13652 (font_match_p): Check that fixnum is a character, not a nonnegative
13653 fixnum, since the later code needs to stuff it into an int.
13654 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13655 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13656 conversion overflow issues.
13657 (Fopen_font): Check for integer out of range.
13658 (Ffont_get_glyphs): Don't assume index can fit in int.
13659 * font.h: Adjust decls to match defn changes elsewhere.
13660 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13662 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13663 printmax_t, where ptrdiff_t is wide enough.
13664 (Finternal_char_font):
13665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13666 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13667 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13668 (Fset_frame_position, x_set_frame_parameters)
13669 (x_set_line_spacing, x_set_border_width)
13670 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13671 Check that fixnums are in proper range for system types.
13672 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13674 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13675 Use SAFE_ALLOCA_LISP, not alloca.
13676 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13677 intptr_t is wide enough.
13678 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13679 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13680 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13681 Check for fixnum out of range.
13682 * ftfont.c (ftfont_list): Don't assume index fits in int.
13683 Check that fixnums are in proper range for system types.
13684 (ftfont_shape_by_flt):
13685 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13686 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13688 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13689 Check that fixnums are in proper range for system types.
13690 * gnutls.h: Adjust decls to match defn changes elsewhere.
13691 * gtkutil.c (xg_dialog_run):
13692 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13693 (update_frame_tool_bar):
13694 Check that fixnums are in proper range for system types.
13695 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13696 (lookup_image): Check that fixnums are in range for system types.
13697 * indent.c (last_known_column, last_known_column_point):
13698 (current_column_bol_cache):
13699 (skip_invisible, current_column, check_display_width):
13700 (check_display_width, scan_for_column, current_column_1)
13701 (Findent_to, Fcurrent_indentation, position_indentation)
13702 (indented_beyond_p, Fmove_to_column, compute_motion):
13703 (Fcompute_motion, Fvertical_motion):
13704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13705 (last_known_column_modified): Use EMACS_INT, not int.
13706 (check_display_width):
13708 Check that fixnums and floats are in proper range for system types.
13709 (compute_motion): Don't assume index or fixnum fits in int.
13710 (compute_motion, Fcompute_motion):
13711 Use int, not EMACS_INT, when it is wide enough.
13712 (vmotion): Omit local var start_hpos that is always 0; that way
13713 we don't need to worry about overflow in expressions involving it.
13714 * indent.h: Adjust decls to match defn changes elsewhere.
13716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13717 Use int, not EMACS_INT, where int is wide enough.
13718 Remove unused members ovstring_chars_done and tab_offset;
13720 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13721 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13722 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13723 (make_gap, copy_text, insert, insert_and_inherit)
13724 (insert_before_markers, insert_before_markers_and_inherit)
13725 (insert_1, count_combining_before, count_combining_after)
13726 (insert_1_both, insert_from_string)
13727 (insert_from_string_before_markers, insert_from_string_1)
13728 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13729 (adjust_after_replace, adjust_after_insert, replace_range)
13730 (replace_range_2, del_range, del_range_1, del_range_byte)
13731 (del_range_both, del_range_2, modify_region)
13732 (prepare_to_modify_buffer, signal_before_change)
13733 (signal_after_change, Fcombine_after_change_execute):
13734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13735 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13736 (balance_an_interval, split_interval_right, split_interval_left)
13737 (find_interval, next_interval, update_interval)
13738 (adjust_intervals_for_insertion, delete_node, delete_interval)
13739 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13740 (static_offset_intervals, offset_intervals)
13741 (merge_interval_right, merge_interval_left, make_new_interval)
13742 (graft_intervals_into_buffer, temp_set_point_both)
13743 (temp_set_point, set_point, adjust_for_invis_intang)
13744 (set_point_both, move_if_not_intangible, get_property_and_range)
13745 (get_local_map, copy_intervals, copy_intervals_to_string)
13746 (compare_string_intervals, set_intervals_multibyte_1):
13747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13748 * intervals.h: Adjust decls to match defn changes elsewhere.
13750 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13751 * keyboard.c (this_command_key_count, this_single_command_key_start)
13752 (before_command_key_count, before_command_echo_length, echo_now)
13753 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13754 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13755 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13756 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13758 (last_non_minibuf_size, last_point_position, echo_truncate)
13759 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13760 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13761 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13762 (stuff_buffered_input):
13763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13764 (last_auto_save, command_loop_1, read_char):
13765 Use EMACS_INT, not int, to avoid integer overflow.
13766 (record_char): Avoid overflow in total_keys computation.
13767 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13768 * keyboard.h: Adjust decls to match defn changes elsewhere.
13769 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13770 (Fkey_description, Fdescribe_vector, Flookup_key):
13771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13772 (click_position): New function, to check that positions are in range.
13773 (Fcurrent_active_maps):
13774 (describe_command):
13775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13776 (Faccessible_keymaps, Fkey_description):
13777 (preferred_sequence_p):
13778 Don't assume fixnum can fit into int.
13779 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13780 Check for integer overflow in size calculations.
13781 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13782 avoid mishandling large integers.
13783 * lisp.h: Adjust decls to match defn changes elsewhere.
13784 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13785 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13786 (struct Lisp_Marker):
13787 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13788 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13789 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13790 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13791 All callers changed.
13792 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13793 Assume the arg has valid form, since it always does.
13794 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13795 unsigned integer system type.
13796 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13797 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13798 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13799 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13800 (duration_to_sec_usec): New decl.
13801 * lread.c (read_from_string_index, read_from_string_index_byte)
13802 (read_from_string_limit, readchar, unreadchar, openp)
13803 (read_internal_start, read1, oblookup):
13804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13805 (Fload, readevalloop, Feval_buffer, Feval_region):
13806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13807 (openp): Check for out-of-range argument to 'access'.
13808 (read1): Use int, not EMACS_INT, where int is wide enough.
13809 Don't assume fixnum fits into int.
13810 Fix off-by-one error that can read outside a buffer.
13811 (read_filtered_event): Use duration_to_sec_usec
13812 to do proper overflow checking on durations.
13813 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13814 in size calculation.
13815 (Fexecute_kbd_macro):
13816 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13817 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13818 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13819 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13820 (set_marker_both, set_marker_restricted_both, marker_position)
13821 (marker_byte_position, Fbuffer_has_markers_at):
13822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13823 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13824 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13825 It now merely ensures that the menu is large enough, without
13826 necessarily growing it, as this avoids some integer overflow issues.
13827 All callers changed.
13828 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13830 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13831 Use SAFE_ALLOCA_LISP, not alloca.
13832 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13833 to EMACS_INT. Check that fixnums are in proper range for system types.
13834 * minibuf.c (minibuf_prompt_width, string_to_object)
13835 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13836 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13838 (get_minibuffer, read_minibuf_unwind):
13839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13840 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13841 this simplifies overflow checking. All callers changed.
13842 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13843 (Ftest_completion):
13844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13845 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13846 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13847 Check that fixnums are in proper range for system types.
13848 (Fx_create_frame, Fx_show_tip):
13849 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13850 * nsfont.m (ns_findfonts, nsfont_list_family):
13851 Don't assume fixnum fits in long.
13852 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13854 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13856 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13858 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13859 (PRINTDECLARE, PRINTPREPARE):
13860 (strout, print_string):
13861 (print, print_preprocess, print_check_string_charset_prop)
13863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13865 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13867 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13868 (printchar, strout): Use xpalloc to catch size calculation overflow.
13869 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13870 (print_error_message): Use SAFE_ALLOCA, not alloca.
13871 (print_object): Use int, not EMACS_INT, where int is wide enough.
13872 (print_depth, new_backquote_output, print_number_index):
13873 Use ptrdiff_t, not int, where int might not be wide enough.
13874 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13875 (Fset_process_window_size, Fformat_network_address)
13876 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13878 Check that fixnums are in proper range for system types.
13879 (Fsignal_process): Simplify by avoiding a goto.
13880 Check for process-ids out of pid_t range rather than relying on
13881 undefined behavior.
13882 (process_tick, update_tick): Use EMACS_INT, not int.
13883 (Fformat_network_address, read_process_output, send_process)
13884 (Fprocess_send_region, status_notify):
13885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13886 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13887 (wait_reading_process_output, read_process_output, exec_sentinel):
13888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13889 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13890 (Faccept_process_output): Use duration_to_sec_usec to do proper
13891 overflow checking on durations.
13892 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13893 Don't assume pid_t fits in int.
13894 * process.h (struct Lisp_Process): Members tick and update_tick
13895 are now of type EMACS_INT, not int.
13896 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13897 configured --with-wide-int.
13898 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13899 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13900 * search.c (looking_at_1, string_match_1):
13901 (fast_string_match, fast_c_string_match_ignore_case)
13902 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13903 (scan_newline, find_before_next_newline, search_command)
13904 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13905 (set_search_regs, wordify):
13908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13909 (string_match_1, search_buffer, set_search_regs):
13911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13912 (wordify): Check for overflow in size calculation.
13913 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13914 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13915 Check that fixnums are in proper range for system types.
13916 * sound.c (struct sound_device)
13917 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13918 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13919 (Fplay_sound_internal):
13920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13921 * syntax.c (struct lisp_parse_state, find_start_modiff)
13922 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13923 (Fparse_partial_sexp):
13924 Don't assume fixnums can fit in int.
13925 (struct lisp_parse_state, find_start_pos, find_start_value)
13926 (find_start_value_byte, find_start_begv)
13927 (update_syntax_table, char_quoted, dec_bytepos)
13928 (find_defun_start, prev_char_comend_first, back_comment):
13929 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13930 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13932 (Finternal_describe_syntax_value): Check that match_lisp is a
13933 character, not an integer, since the code stuffs it into int.
13934 (scan_words, scan_sexps_forward):
13935 Check that fixnums are in proper range for system types.
13937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13938 (scan_sexps_forward):
13939 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13940 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13941 * syntax.h: Adjust decls to match defn changes elsewhere.
13942 (struct gl_state_s):
13943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13944 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13945 MOST_POSITIVE_FIXNUM.
13946 * sysdep.c (wait_for_termination_1, wait_for_termination)
13947 (interruptible_wait_for_termination, mkdir):
13948 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13949 (emacs_read, emacs_write):
13950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13951 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13952 and double all fit in int.
13953 * term.c (set_tty_color_mode):
13954 Check that fixnums are in proper range for system types.
13955 * termhooks.h (struct input_event):
13956 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13957 * textprop.c (validate_interval_range, interval_of)
13958 (Fadd_text_properties, set_text_properties_1)
13959 (Fremove_text_properties, Fremove_list_of_text_properties)
13960 (Ftext_property_any, Ftext_property_not_all)
13961 (copy_text_properties, text_property_list, extend_property_ranges)
13962 (verify_interval_modification):
13963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13964 (Fnext_single_char_property_change)
13965 (Fprevious_single_char_property_change):
13966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13967 (copy_text_properties):
13968 Check for integer overflow in index calculation.
13969 * undo.c (last_boundary_position, record_point, record_insert)
13970 (record_delete, record_marker_adjustment, record_change)
13971 (record_property_change):
13972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13973 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13975 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13976 (Fx_hide_tip, Fx_file_dialog):
13977 * w32menu.c (set_frame_menubar):
13978 Use ptrdiff_t, not int, for consistency with rest of code.
13979 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13980 (select_window, Fdelete_other_windows_internal)
13981 (window_scroll_pixel_based, window_scroll_line_based)
13982 (Frecenter, Fset_window_configuration):
13983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13984 (Fset_window_hscroll, run_window_configuration_change_hook)
13985 (set_window_buffer, temp_output_buffer_show, scroll_command)
13986 (Fscroll_other_window, Frecenter):
13987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13988 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13989 Don't assume fixnum fits in int.
13990 (Fset_window_scroll_bars):
13991 Check that fixnums are in proper range for system types.
13992 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13993 (string_pos, c_string_pos, number_of_chars, init_iterator)
13994 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13995 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13996 (compute_display_string_end, handle_face_prop)
13997 (face_before_or_after_it_pos, handle_invisible_prop)
13998 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13999 (display_prop_intangible_p, string_buffer_position_lim)
14000 (string_buffer_position, handle_composition_prop, load_overlay_strings)
14001 (get_overlay_strings_1, get_overlay_strings)
14002 (iterate_out_of_display_property, forward_to_next_line_start)
14003 (back_to_previous_visible_line_start, reseat, reseat_to_string)
14004 (get_next_display_element, set_iterator_to_next)
14005 (get_visually_first_element, compute_stop_pos_backwards)
14006 (handle_stop_backwards, next_element_from_buffer)
14007 (move_it_in_display_line_to, move_it_in_display_line)
14008 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14009 (add_to_log, message_dolog, message_log_check_duplicate)
14010 (message2, message2_nolog, message3, message3_nolog
14011 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
14012 (current_message_1, truncate_echo_area, truncate_message_1)
14013 (set_message, set_message_1, store_mode_line_noprop)
14014 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
14015 (text_outside_line_unchanged_p, check_point_in_composition)
14016 (reconsider_clip_changes)
14017 (redisplay_internal, set_cursor_from_row, try_scrolling)
14018 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
14019 (redisplay_window, find_last_unchanged_at_beg_row)
14020 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
14021 (trailing_whitespace_p, find_row_edges, display_line)
14022 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
14023 (display_mode_element, store_mode_line_string)
14024 (pint2str, pint2hrstr, decode_mode_spec)
14025 (display_count_lines, display_string, draw_glyphs)
14026 (x_produce_glyphs, x_insert_glyphs)
14027 (rows_from_pos_range, mouse_face_from_buffer_pos)
14028 (fast_find_string_pos, mouse_face_from_string_pos)
14029 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14030 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14031 (safe_call, init_from_display_pos, handle_fontified_prop)
14032 (handle_single_display_spec, load_overlay_strings)
14033 (with_echo_area_buffer, setup_echo_area_for_printing)
14034 (display_echo_area, echo_area_display)
14035 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14036 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14037 (redisplay_window, dump_glyph_row, display_mode_line)
14038 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14039 (handle_display_spec, display_prop_string_p):
14040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14041 (handle_single_display_spec, build_desired_tool_bar_string)
14042 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14043 (get_specified_cursor_type):
14044 Check that fixnums are in proper range for system types.
14045 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14046 (Flookup_image_map):
14047 Don't assume fixnums fit in int.
14048 (compare_overlay_entries):
14049 Avoid mishandling comparisons due to subtraction overflow.
14050 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14051 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14052 (handle_tool_bar_click):
14053 Use int, not unsigned, since we prefer signed and the signedness
14054 doesn't matter here.
14055 (get_next_display_element, next_element_from_display_vector):
14056 Use int, not EMACS_INT, when int is wide enough.
14057 (start_hourglass): Use duration_to_sec_usec to do proper
14058 overflow checking on durations.
14059 * xfaces.c (Fbitmap_spec_p):
14060 Check that fixnums are in proper range for system types.
14061 (compare_fonts_by_sort_order):
14062 Avoid mishandling comparisons due to subtraction overflow.
14063 (Fx_family_fonts, realize_basic_faces):
14064 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14066 Don't assume fixnum fits in int.
14067 Use SAFE_ALLOCA_LISP, not alloca.
14068 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14069 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14070 (face_at_buffer_position, face_for_overlay_string)
14071 (face_at_string_position):
14072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14073 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14074 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14076 Check that fixnums are in proper range for system types.
14077 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14078 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14079 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14080 (Fx_change_window_property): Don't assume fixnums fit in int.
14081 * xfont.c (xfont_chars_supported):
14082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14083 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14084 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14086 * xml.c (parse_region):
14087 * xrdb.c (magic_file_p):
14088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14089 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14090 (x_get_local_selection, x_reply_selection_request)
14091 (x_handle_selection_request, wait_for_property_change):
14092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14093 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14094 short is wide enough.
14095 (x_send_client_event): Don't assume fixnum fits in int.
14096 * xterm.c (x_x_to_emacs_modifiers):
14097 Don't assume EMACS_INT overflows nicely into int.
14098 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14099 may come from Lisp.
14100 (handle_one_xevent): NATNUMP can eval its arg twice.
14101 (x_connection_closed):
14102 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14103 * xterm.h: Adjust decls to match defn changes elsewhere.
14104 (struct scroll_bar): Use struct vectorlike_header
14105 rather than rolling our own approximation.
14106 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14108 2012-05-25 Glenn Morris <rgm@gnu.org>
14110 * lisp.mk (lisp): Update for more files being compiled now.
14112 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14114 * lread.c: Remove `read_pure' which makes no difference.
14115 (read_pure): Remove var.
14116 (unreadpure): Remove function.
14117 (readevalloop): Don't call read_list with -1 flag.
14118 (read1, read_vector): Don't test read_pure any more.
14119 (read_list): Simplify.
14121 * fileio.c, character.h: Minor style tweaks.
14123 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14125 * window.h (clip_changed): Remove useless declaration.
14127 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
14129 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14130 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14132 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14135 This directory predates autoconf and is no longer needed nowadays.
14136 Move its few remaining bits of functionality to where they're needed.
14137 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14138 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14139 * m/template.h: Remove.
14140 * Makefile.in (M_FILE): Remove. All uses removed.
14141 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14142 * lisp.h (USE_LSB_TAG):
14143 * mem-limits.h (EXCEEDS_LISP_PTR):
14144 Use VAL_MAX, not VALBITS, in #if.
14145 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14146 (EMACS_UINT): Define unconditionally now.
14147 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14148 (BITS_PER_EMACS_INT): New constants, replacing
14149 what used to be in config.h, but not useful in #if.
14150 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14151 define them any more.
14152 (VAL_MAX): New macro.
14154 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14155 BITS_PER_EMACS_INT, in #if.
14156 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14157 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14158 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14159 * s/ms-w32.h (DATA_START):
14160 Move here from removed file m/intel386.h.
14161 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14162 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14164 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14166 Assume C89 or later.
14167 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14168 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14170 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14171 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14172 * textprop.c, tparam.c (NULL): Remove.
14173 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14174 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14175 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14176 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14177 * xterm.c (input_signal_count): Assume volatile works.
14179 2012-05-21 Ken Brown <kbrown@cornell.edu>
14181 * xgselect.c (xg_select): Fix first argument in call to 'select'
14184 2012-05-20 Ken Brown <kbrown@cornell.edu>
14186 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14187 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14189 2012-05-19 Ken Brown <kbrown@cornell.edu>
14191 * xfns.c (x_in_use): Remove `static' qualifier.
14192 * xterm.h (x_in_use): Declare.
14193 * xgselect.c: Include xterm.h.
14194 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14195 and `display_arg' (bug#9754).
14197 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14199 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14201 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14202 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14204 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14206 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14208 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14209 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14211 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14212 reference to image_cache->refcount.
14213 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14215 2012-05-17 Juri Linkov <juri@jurta.org>
14217 * search.c (Fword_search_regexp, Fword_search_backward)
14218 (Fword_search_forward, Fword_search_backward_lax)
14219 (Fword_search_forward_lax): Move functions to isearch.el
14220 (bug#10145, bug#11381).
14222 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14224 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14226 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14228 * lread.c (init_obarray): Declare Qt and Qnil as special.
14230 2012-05-14 Glenn Morris <rgm@gnu.org>
14232 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14233 Put "libexec" before "bin", for the sake of init_callproc_1.
14235 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14237 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14239 * unexaix.c: Port to more-recent AIX compilers.
14240 (report_error, report_error_1, make_hdr, copy_sym)
14241 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14242 Make arguments const char *, not char *, to avoid violations of C
14243 standard and to fix some AIX warnings reported by Gilles Pion.
14245 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14247 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14248 already have overlays loaded.
14249 (handle_single_display_spec): Before returning without displaying
14250 fringe bitmap, synchronize the bidi iterator with the main display
14251 iterator, by calling iterate_out_of_display_property.
14252 (iterate_out_of_display_property): Detect buffer iteration by
14253 testing that it->string is a Lisp string.
14254 (get_next_display_element): When the current object is exhausted,
14255 and there's something on it->stack, call set_iterator_to_next to
14256 proceed with what's on the stack, instead of returning zero.
14257 (set_iterator_to_next): If called at the end of a Lisp string,
14258 proceed to consider_string_end without incrementing string
14259 position. Don't increment display vector index past the end of
14260 the display vector. (Bug#11417)
14261 (pos_visible_p): Don't report a position visible when move_it_to
14262 stopped at the last line of window, which happens to be scanned
14263 backwards by the bidi iteration. (Bug#11464)
14265 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14267 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14268 and right-margin display specs even if the spec is invalid or we
14269 are on a TTY, and thus unable to display on the fringes.
14270 That's because the text with the property will not be displayed anyway,
14271 so we need to signal to the caller that this is a "replacing"
14272 display spec. This fixes display when the spec is invalid or we
14275 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14277 * unexaix.c (make_hdr): Fix typo in prototype.
14278 This bug broke the build on AIX. Problem reported by Gilles Pion.
14280 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14282 * keyboard.c (kbd_buffer_get_event): Read special events also in
14283 batch mode. (Bug#11415)
14285 2012-05-12 Glenn Morris <rgm@gnu.org>
14287 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14289 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14291 * lisp.mk (lisp): Add newcomment.elc.
14293 2012-05-12 Glenn Morris <rgm@gnu.org>
14295 * Makefile.in (MKDIR_P): New, set by configure.
14296 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14298 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14300 Remove unused function hourglass_started.
14301 * dispextern.h (hourglass_started):
14302 * w32fns.c (hourglass_started):
14303 * xdisp.c (hourglass_started): Remove.
14305 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14307 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14308 Update dependencies.
14310 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14312 * xgselect.c (xg_select): Put maxfds+1 into a var.
14313 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14315 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14317 2012-05-10 Dave Abrahams <dave@boostpro.com>
14319 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14320 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14322 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14324 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14325 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14326 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14327 Initialize xd_registered_buses.
14329 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14331 Untag more efficiently if USE_LSB_TAG.
14332 This is based on a proposal by YAMAMOTO Mitsuharu in
14333 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14334 For an admittedly artificial (nth 8000 longlist) benchmark on
14335 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14336 Emacs's overall text size by 1%.
14337 * lisp.h (XUNTAG): New macro.
14338 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14339 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14340 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14341 * eval.c (Fautoload):
14342 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14343 * frame.h (XFRAME): Use XUNTAG.
14345 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14346 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14347 Remove unportable assumptions about print widths of types like
14349 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14350 intptr_t when converting between pointer and integer, to avoid GCC
14351 warnings about wrong width.
14353 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14355 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14356 stack for each reader_thread, instead of defaulting to 8MB
14357 determined by the linker. This avoids failures in creating
14358 subprocesses on Windows 7, see the discussion in this thread:
14359 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14361 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14363 Fix up display of the *Minibuf-0* buffer in the mini window.
14364 * keyboard.c (read_char): Don't clear the echo area if there's no
14366 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14367 contents of *Minibuf-0*) if there's no message displayed in its stead.
14369 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14371 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14374 2012-05-06 Chong Yidong <cyd@gnu.org>
14376 * lisp.mk (lisp): Update.
14378 2012-05-05 Jim Meyering <meyering@redhat.com>
14380 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14382 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14384 * data.c (PUT_ERROR): New macro.
14385 (syms_of_data): Use it. Add new error type `user-error'.
14386 * undo.c (user_error): New function.
14387 (Fprimitive_undo): Use it.
14388 * print.c (print_error_message): Adjust print style for `user-error'.
14389 * keyboard.c (user_error): New function.
14390 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14392 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14394 Do not limit current-time-string to years 1000..9999.
14395 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14396 (Fcurrent_time_string): Support any year that is supported by the
14397 underlying localtime representation. Don't use asctime, as it
14398 has undefined behavior for years outside the range -999..9999.
14400 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14402 Fix race conditions involving setenv, gmtime, localtime, asctime.
14403 Without this fix, interrupts could mess up code that uses these
14404 nonreentrant functions, since setting TZ invalidates existing
14405 tm_zone or tzname values, and since most of these functions return
14406 pointers to static storage.
14407 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14408 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14409 Grow the critical sections to include not just invoking
14410 localtime/gmtime, but also accessing these functions' results
14411 including their tm_zone values if any, and any related TZ setting.
14412 (format_time_string): Last arg is now struct tm *, not struct tm **,
14413 so that the struct tm is saved in the critical section.
14414 All callers changed. Simplify allocation of initial buffer, partly
14415 motivated by the fact that memory allocation needs to be outside
14416 the critical section.
14418 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14420 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14421 with RESET_INTERVAL.
14423 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14424 Remove duplicated buffer name initialization.
14426 2012-05-02 Jim Meyering <jim@meyering.net>
14428 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14430 * xfns.c (x_window): Use xstrdup (Bug#11375).
14432 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14434 * xdisp.c (pos_visible_p): If already at a newline from the
14435 display string before the 'while' loop, don't walk back the glyphs
14436 from it3.glyph_row. Solves assertion violation when the display
14437 string begins with a newline (egg.el). (Bug#11367)
14439 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14441 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14444 2012-05-01 Glenn Morris <rgm@gnu.org>
14446 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14447 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14448 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14449 All were removed before 23.1.
14451 * dispnew.c: Remove HAVE_LIBNCURSES test;
14452 it is always true on relevant platforms.
14454 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14455 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14457 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14459 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14461 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14462 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14465 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14467 Do not avoid creating empty evaporating overlays (Bug#9642).
14468 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14469 That is, do not delete an evaporating overlay if it becomes
14470 empty after its bounds are adjusted to fit within its buffer.
14471 This fix caused other problems, and I'm reverting it until we get
14472 to the bottom of them.
14474 2012-04-27 Chong Yidong <cyd@gnu.org>
14476 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14478 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14480 * xdisp.c (pos_visible_p): If the window start position is beyond
14481 ZV, start the display from buffer beginning. Prevents assertion
14482 violation in init_iterator when the minibuffer window is scrolled
14483 via the scroll bar.
14485 * window.c (window_scroll_pixel_based): Likewise.
14487 2012-04-27 Chong Yidong <cyd@gnu.org>
14489 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14491 2012-04-27 Glenn Morris <rgm@gnu.org>
14493 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14494 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14496 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14498 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14499 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14501 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14503 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14504 display element, check also the underlying string or buffer
14505 character. (Bug#11341)
14507 * w32menu.c: Include w32heap.h.
14508 (add_menu_item): If the call to AppendMenuW (via
14509 unicode_append_menu) fails, disable Unicode menus only if we are
14510 running on Windows 9X/Me.
14512 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14514 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14515 (xgetint): Add missing shift for LSB tags.
14517 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14519 * keyboard.c (read_char): Don't wipe echo area for select window
14520 events: These might get delayed via `mouse-autoselect-window'
14523 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14525 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14526 manipulation of :loaded-from data.
14528 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14530 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14531 now a cons (bug#11311).
14533 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14535 Do not create empty overlays with the evaporate property (Bug#9642).
14536 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14537 if it becomes empty after its bounds are adjusted to fit within
14538 its buffer. Without this fix, in a nonempty buffer (let ((o
14539 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14540 yields an empty overlay that has the evaporate property, which is
14541 not supposed to happen.
14543 Fix minor GTK3 problems found by static checking.
14544 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14545 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14546 (struct _EmacsFixedClass, emacs_fixed_get_type):
14547 Move decls here from emacsgtkfixed.h, since they needn't be public.
14548 (emacs_fixed_get_type): Now static.
14549 (emacs_fixed_class_init): Omit unused local.
14550 (emacs_fixed_child_type): Remove; unused.
14551 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14552 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14553 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14554 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14555 (EMACS_FIXED_GET_CLASS): Remove; unused.
14556 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14558 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14559 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14561 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14563 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14564 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14565 (__malloc_size_t, __malloc_ptrdiff_t):
14566 Remove. All uses removed, replaced by the definiens if needed,
14567 since we can assume C89 or better now.
14568 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14569 (protect_malloc_state, align, get_contiguous_space)
14570 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14571 (malloc_atfork_handler_child, malloc_enable_thread)
14572 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14573 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14574 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14575 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14576 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14577 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14578 Define using prototypes, not old style.
14579 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14580 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14581 (align): Don't assume that signed integer overflow wraps around.
14582 Omit unused local var.
14583 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14584 (_free_internal_nolock, memalign, mallochook, reallochook):
14585 Omit no-longer-needed casts.
14586 (valloc): Use getpagesize, not __getpagesize.
14587 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14588 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14590 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14592 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14594 Move functions from C to Lisp. Make non-blocking method calls
14595 the default. Implement further D-Bus standard interfaces.
14597 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14598 (QCdbus_request_name_allow_replacement)
14599 (QCdbus_request_name_replace_existing)
14600 (QCdbus_request_name_do_not_queue)
14601 (QCdbus_request_name_reply_primary_owner)
14602 (QCdbus_request_name_reply_in_queue)
14603 (QCdbus_request_name_reply_exists)
14604 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14605 (QCdbus_registered_serial, QCdbus_registered_method)
14606 (QCdbus_registered_signal): New Lisp objects.
14607 (XD_DEBUG_MESSAGE): Use sizeof.
14608 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14609 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14610 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14611 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14612 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14613 (xd_signature, xd_append_arg): Allow float for integer types.
14614 (xd_get_connection_references): New function.
14615 (xd_get_connection_address): Rename from xd_initialize.
14616 Return cached address.
14617 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14618 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14620 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14621 Return number of refcounts.
14622 (Fdbus_get_unique_name): Make stronger parameter check.
14623 (Fdbus_message_internal): New defun.
14624 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14625 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14626 (Fdbus_send_signal, Fdbus_register_service)
14627 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14628 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14629 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14630 (Vdbus_compiled_version, Vdbus_runtime_version)
14631 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14632 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14633 (Vdbus_message_type_signal): New defvars.
14634 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14637 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14639 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14640 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14641 Do not assume ptrdiff_t is the same width as 'int'.
14643 * alloc.c: Handle unusual debugging option combinations.
14644 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14645 since the two debugging options are incompatible.
14646 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14648 (mem_init, mem_insert, mem_insert_fixup):
14649 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14650 (NEED_MEM_INSERT): Remove; no longer needed.
14652 2012-04-22 Leo Liu <sdl.web@gmail.com>
14654 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14656 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14658 * sysdep.c [__FreeBSD__]: Minor cleanups.
14659 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14660 Use Emacs indenting style more consistently. Avoid some casts.
14661 Use 'double' consistently rather than mixing 'float' and 'double'.
14663 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14665 * sysdep.c (list_system_processes, system_process_attributes):
14666 Add implementation for FreeBSD (Bug#5243).
14668 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14670 * lisp.mk (lisp): Update.
14672 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14674 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14675 It is never used otherwise.
14677 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14679 * print.c (print_preprocess): Only check print_depth if print-circle
14681 (print_object): Check for cycles even when print-circle is nil and
14682 print-gensym is t, but only check print_depth if print-circle is nil.
14684 2012-04-20 Chong Yidong <cyd@gnu.org>
14686 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14687 set the status to "failed" and ensure that sentinel is run.
14689 2012-04-20 Glenn Morris <rgm@gnu.org>
14691 * process.c (Fset_process_inherit_coding_system_flag)
14692 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14693 (Fmake_network_process, Fmake_serial_process): Doc fix.
14695 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14697 * xdisp.c (string_buffer_position_lim): Limit starting position to
14699 (set_cursor_from_row): If called for a mode-line or header-line
14700 row, return zero immediately.
14701 (try_cursor_movement): If inside continuation line, don't back up
14702 farther than the first row after the header line, if any.
14703 Don't consider the header-line row as "partially visible", even if
14704 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14706 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14708 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14711 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14712 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14714 configure: new option --enable-gcc-warnings (Bug#11207)
14715 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14716 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14717 (ALL_CFLAGS): Use new macros rather than old.
14718 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14719 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14720 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14721 -Wunused-result, -Wunused-variable. This should go away once
14722 the Emacs and Gnulib regex code is merged.
14723 (xmalloc, xrealloc): Now static.
14725 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14727 * dired.c (Fsystem_groups): Remove unused local.
14729 2012-04-17 Glenn Morris <rgm@gnu.org>
14731 * dired.c (Fsystem_users): Doc fix.
14733 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14735 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14736 (syms_of_dired): Add them.
14738 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14740 Fix minor alloc.c problems found by static checking.
14741 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14742 New extern decls, to avoid calling undeclared functions.
14743 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14744 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14745 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14746 (NEED_MEM_INSERT): New macro.
14747 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14748 Remove one incorrect comment and fix another.
14750 Fix minor ralloc.c problems found by static checking.
14751 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14752 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14753 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14754 (r_alloc_sbrk): Now static.
14756 Improve ralloc.c interface checking.
14757 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14758 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14759 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14760 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14761 [REL_ALLOC]: ... to here, to check interface.
14762 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14763 Remove decls. This fixes an "It stinks!".
14765 * alloc.c (which_symbols): Fix alignment issue / type clash.
14767 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14769 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14770 (struct Lisp_Misc_Any): Likewise.
14771 (struct Lisp_Free): Likewise.
14772 * alloc.c (union aligned_Lisp_Symbol): Define.
14773 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14774 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14775 (union aligned_Lisp_Misc): Define.
14776 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14777 aligned_Lisp_Misc instead of union Lisp_Misc.
14778 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14780 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14782 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14783 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14784 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14785 * s/netbsd.h, s/sol2-6.h:
14786 Remove definition of GC_MARK_STACK, since the default now works.
14787 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14788 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14789 no longer the default.
14790 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14792 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14794 * lread.c (lisp_file_lexically_bound_p):
14795 Fix hang at ";-*-\n" (bug#11238).
14797 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14799 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14800 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14802 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14804 * nsterm.m (constrainFrameRect): Always constrain when there is only
14805 one screen (Bug#10962).
14807 2012-04-13 Ken Brown <kbrown@cornell.edu>
14809 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14811 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14813 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14815 2012-04-11 Daniel Colascione <dancol@dancol.org>
14817 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14818 against is gone. It's better to use vfork now so that when Cygwin
14819 gains a new, working vfork, we use it automatically (bug#10398).
14821 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14823 * window.c (save_window_save): Obey window-point-insertion-type.
14825 2012-04-11 Glenn Morris <rgm@gnu.org>
14827 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14829 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14831 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14833 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14835 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14836 (force_quit_count): New var.
14837 (handle_interrupt): Use it.
14839 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14841 * w32.c (w32_delayed_load): Record the full path of the library
14842 being loaded (bug#10424).
14844 2012-04-09 Glenn Morris <rgm@gnu.org>
14846 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14847 not just in the obarray, before snarfing them. (Bug#11036)
14849 * Makefile.in ($(leimdir)/leim-list.el):
14850 Pass EMACS rather than BUILT_EMACS.
14852 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14854 * process.c (make_process):
14855 * process.h: Add integer `gnutls_handshakes_tried' member to
14858 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14859 Add convenience `GNUTLS_LOG2i' macro.
14861 * gnutls.c (gnutls_log_function2i): Convenience log function.
14862 (emacs_gnutls_read): Use new log functions,
14863 `gnutls_handshakes_tried' process member, and
14864 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14865 attempts per process (connection).
14867 2012-04-09 Chong Yidong <cyd@gnu.org>
14869 * eval.c (Fuser_variable_p, user_variable_p_eh)
14870 (lisp_indirect_variable): Functions deleted.
14871 (Fdefvar): Caller changed.
14873 * callint.c (Finteractive, Fcall_interactively):
14874 * minibuf.c (Fread_variable): Callers changed.
14876 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14878 * xdisp.c (set_cursor_from_row): If the display string appears in
14879 the buffer at position that is closer to point than the position
14880 after the display string, display the cursor on the first glyph of
14881 the display string. Fixes cursor display when a 'display' text
14882 property immediately follows invisible text. (Bug#11094)
14884 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14886 composite.c: use 'double' consistently
14887 * composite.c (get_composition_id): Use 'double' consistently
14888 instead of converting 'float' to 'double' and vice versa; this is
14889 easier to understand and avoids a GCC warning.
14891 2012-04-09 Glenn Morris <rgm@gnu.org>
14893 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14894 preparation for dumping it with emacs. (Bug#4789)
14895 (leimdir): New variable.
14896 ($(leimdir)/leim-list.el): New rule.
14897 (emacs$(EXEEXT)): Depend on leim-list.el.
14899 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14900 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14901 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14903 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14905 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14908 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14910 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14911 Remove unused local variable.
14913 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14915 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14916 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14917 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14918 objects, as mark_maybe_pointer will catch them otherwise.
14919 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14920 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14922 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14924 Fix typo that broke non-Windows builds.
14925 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14927 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14929 Support building on MS-Windows with libxml2.
14931 * makefile.w32-in (OBJ2): Add xml.$(O).
14932 (GLOBAL_SOURCES): Add xml.c.
14933 ($(BLD)/xml.$(O)): New dependency list.
14935 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14936 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14937 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14938 [!WINDOWSNT]: New macros.
14939 (init_libxml2_functions, libxml2_loaded_p): New functions.
14940 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14941 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14942 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14943 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14945 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14946 Call init_libxml2_functions before calling libxml2 functions.
14947 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14949 * emacs.c: Don't include libxml/parser.h.
14950 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14951 xmlCleanupParser directly.
14953 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14955 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14957 * indent.c (Fvertical_motion): If there is a display string at
14958 point, use it.vpos to compute how many lines to backtrack after
14959 move_it_to point. (Bug#11133)
14961 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14963 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14964 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14965 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14966 macros related to unification of CJK characters. For the details,
14967 see the discussion following the message here:
14968 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14970 2012-04-04 Chong Yidong <cyd@gnu.org>
14972 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14974 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14976 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14977 instead of alloca. (Bug#11138)
14979 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14981 * w32menu.c (is_simple_dialog): Properly check lisp types.
14984 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14986 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14987 position we get to after a call to move_it_to fails the
14988 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14989 only if we wind up in a string from display property. (Bug#11063)
14991 * window.c (Fdelete_other_windows_internal): Invalidate the row
14992 and column information about mouse highlight, so that redisplay
14993 restores it after reallocating the glyph matrices. (Bug#7464)
14995 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14996 string comes from a `display' text property, use the buffer
14997 position of that property as if we actually saw that position in
14999 (move_it_by_lines): Remove the assertion that
15000 "it->current_x == 0 && it->hpos == 0" which can be legitimately
15001 violated when there's a before-string at the beginning of a line.
15004 2012-03-30 Eli Zaretskii <eliz@gnu.org>
15006 * xdisp.c (append_space_for_newline): If the default face was
15007 remapped, use the remapped face for the appended newline.
15008 (extend_face_to_end_of_line): Use the remapped default face for
15009 extending the face to the end of the line.
15010 (display_line): Call extend_face_to_end_of_line when the default
15011 face was remapped. (Bug#11068)
15013 2012-03-29 Eli Zaretskii <eliz@gnu.org>
15015 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
15017 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15019 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
15021 2012-03-27 Glenn Morris <rgm@gnu.org>
15023 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15026 2012-03-26 Kenichi Handa <handa@m17n.org>
15028 * dispextern.h (struct glyph): Fix previous change. Change the
15029 bit length of glyphless.ch to 25 (Bug#11082).
15031 2012-03-26 Chong Yidong <cyd@gnu.org>
15033 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15034 (command_loop_1): Use it; inhibit selection update for
15035 handle-select-window too (Bug#8996).
15037 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15039 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15041 2012-03-25 Kenichi Handa <handa@m17n.org>
15043 * dispextern.h (struct glyph): Change the bit length of
15044 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15046 2012-03-24 Eli Zaretskii <eliz@gnu.org>
15048 * s/ms-w32.h (tzname): Include time.h before redirecting to
15049 _tzname. Fixes the MSVC build. (Bug#9960)
15051 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15053 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15056 * xterm.c (XTread_socket): Only modify handling_signal if
15057 !SYNC_INPUT. (Bug#11080)
15059 2012-03-23 Eli Zaretskii <eliz@gnu.org>
15061 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15062 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15063 when fetching a multibyte character consumes more bytes than
15064 CHAR_BYTES returns, due to unification of CJK characters in
15065 string_char. (Bug#11073)
15067 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15069 * process.c (wait_reading_process_output): Handle pty disconnect
15070 by refraining from sending oneself a SIGCHLD (bug#10933).
15072 2012-03-22 Chong Yidong <cyd@gnu.org>
15074 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15076 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15077 Mark string as coming from a prefix property.
15078 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15079 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15081 2012-03-21 Chong Yidong <cyd@gnu.org>
15083 * xfaces.c (Vface_remapping_alist): Doc fix.
15085 2012-03-20 Eli Zaretskii <eliz@gnu.org>
15087 * w32proc.c (Fw32_set_console_codepage)
15088 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15091 2012-03-20 Chong Yidong <cyd@gnu.org>
15093 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15094 to reflect default non-nil value of redisplay-dont-pause.
15096 2012-03-19 Kenichi Handa <handa@m17n.org>
15098 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15099 it fit in a valid range (Bug#11003).
15101 2012-03-18 Eli Zaretskii <eliz@gnu.org>
15103 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15104 that is not from display property, accept the row as a "cursor
15105 row" if one of the string's character has a non-nil `cursor'
15106 property. Fixes cursor positioning when there are newlines in
15107 overlay strings, e.g. in icomplete.el. (Bug#11035)
15109 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15111 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15113 2012-03-12 Chong Yidong <cyd@gnu.org>
15115 * eval.c (inhibit_lisp_code): Rename from
15116 inhibit_window_configuration_change_hook; move from window.c.
15118 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15119 * window.c (run_window_configuration_change_hook)
15120 (syms_of_window): Callers changed.
15122 2012-03-11 Chong Yidong <cyd@gnu.org>
15124 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15126 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15128 2012-03-10 Chong Yidong <cyd@gnu.org>
15130 * frame.c (other_visible_frames): Don't assume the selected frame
15131 is visible (Bug#10955).
15133 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15135 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15137 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15139 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15140 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15143 2012-03-03 Glenn Morris <rgm@gnu.org>
15145 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15147 2012-03-02 Eli Zaretskii <eliz@gnu.org>
15149 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15150 position past the first glyph_row that ends at ZV. (Bug#10902)
15151 (redisplay_window, next_element_from_string): Fix typos in
15153 (redisplay_window): Pass to move_it_vertically the margin in
15154 pixels, not in screen lines.
15156 2012-03-02 Glenn Morris <rgm@gnu.org>
15158 * buffer.c (buffer-list-update-hook): Doc fix.
15160 2012-02-29 Eli Zaretskii <eliz@gnu.org>
15162 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15163 push_it before setting up the iterator for the first overlay
15164 string, even if we have an empty string loaded.
15165 (next_overlay_string): If there's an empty string on the iterator
15166 stack, pop the stack. (Bug#10903)
15168 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15170 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15171 Suggested by Stefan Monnier in
15172 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15173 * alloc.c (widen_to_Lisp_Object): New static function.
15174 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15175 and widening them to Lisp_Objects. This would work even if
15176 USE_LSB_TAG is defined and wide integers are used, which might
15177 happen in a future version of Emacs.
15179 2012-02-25 Chong Yidong <cyd@gnu.org>
15181 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15184 * xselect.c (Fx_selection_exists_p): Doc fix.
15185 (x_clipboard_manager_save_all): Print an informative message
15186 before saving to clipboard manager.
15188 2012-02-24 Chong Yidong <cyd@gnu.org>
15190 * keyboard.c (process_special_events): Handle all X selection
15191 requests in kbd_buffer, not just the next one (Bug#8869).
15193 2012-02-23 Chong Yidong <cyd@gnu.org>
15195 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15196 call when setting menu-bar-lines and tool-bar-lines parameters.
15197 (unwind_create_frame_1): New helper function.
15199 * window.c (inhibit_window_configuration_change_hook): New var.
15200 (run_window_configuration_change_hook): Obey it.
15201 (syms_of_window): Initialize it.
15203 2012-02-22 Chong Yidong <cyd@gnu.org>
15205 * xterm.c (x_draw_image_relief): Add missing type check for
15206 Vtool_bar_button_margin (Bug#10743).
15208 2012-02-21 Chong Yidong <cyd@gnu.org>
15210 * fileio.c (Vfile_name_handler_alist): Doc fix.
15212 * buffer.c (Fget_file_buffer): Protect against invalid file
15213 handler return value.
15215 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15217 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15218 when computing $valmask.
15220 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15221 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15222 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15223 It's useless in that case, and it can cause problems on hosts
15224 that allocate halves of EMACS_INT values separately.
15225 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15226 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15227 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15228 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15229 it avoids undefined behavior on hosts where shifting right by more
15230 than the word width has undefined behavior.
15232 2012-02-19 Chong Yidong <cyd@gnu.org>
15234 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15235 (Funhandled_file_name_directory, Ffile_name_as_directory)
15236 (Fdirectory_file_name, Fexpand_file_name)
15237 (Fsubstitute_in_file_name): Protect against invalid file handler
15238 return values (Bug#10845).
15240 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15242 * .gdbinit (pitx): Fix incorrect references to fields of the
15245 2012-02-17 Chong Yidong <cyd@gnu.org>
15247 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15249 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15251 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15252 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15254 2012-02-15 Chong Yidong <cyd@gnu.org>
15256 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15257 marked as special. Also, starting docstrings with * is obsolete.
15259 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15261 * gnutls.c (emacs_gnutls_write): Fix last change.
15263 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15265 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15268 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15270 * keymap.c (Fsingle_key_description): Handle char ranges.
15272 2012-02-12 Chong Yidong <cyd@gnu.org>
15274 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15275 as that creates a dangerous corner case.
15277 * window.c (Fdelete_window_internal): Invalidate the mouse
15278 highlight (Bug#9904).
15280 2012-02-12 Glenn Morris <rgm@gnu.org>
15282 * xselect.c (Fx_own_selection_internal)
15283 (Fx_get_selection_internal, Fx_disown_selection_internal)
15284 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15285 * nsselect.m (Fx_own_selection_internal)
15286 (Fx_disown_selection_internal, Fx_selection_exists_p)
15287 (Fx_selection_owner_p, Fx_get_selection_internal):
15288 Sync docs and argument specs with the xselect.c versions.
15290 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15292 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15294 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15296 * w32select.c (Fx_selection_exists_p): Sync doc string and
15297 argument list with xselect.c. (Bug#10783)
15299 * w16select.c (Fx_selection_exists_p): Sync doc string and
15300 argument list with xselect.c. (Bug#10783)
15302 2012-02-10 Glenn Morris <rgm@gnu.org>
15304 * fns.c (Fsecure_hash): Doc fix.
15306 2012-02-09 Kenichi Handa <handa@m17n.org>
15308 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15310 2012-02-07 Chong Yidong <cyd@gnu.org>
15312 * buffer.c (Fbuffer_local_variables)
15313 (buffer_lisp_local_variables): Handle unbound vars correctly;
15314 don't let Qunbound leak into Lisp.
15316 2012-02-07 Glenn Morris <rgm@gnu.org>
15318 * image.c (Fimagemagick_types): Doc fix.
15320 * image.c (imagemagick-render-type): Change it from a lisp object
15321 to an integer. Move the doc here from the lisp manual.
15322 Treat all values not equal to 0 the same.
15324 2012-02-06 Chong Yidong <cyd@gnu.org>
15326 * doc.c (store_function_docstring): Avoid applying docstring of
15327 alias to base function (Bug#2603).
15329 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15331 * .gdbinit (pp1, pv1): Remove redundant defines.
15334 2012-02-04 Chong Yidong <cyd@gnu.org>
15336 * nsterm.m: Declare a global (Bug#10694).
15338 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15340 * w32.c (get_emacs_configuration_options):
15341 Include --enable-checking, if specified, in the return value.
15343 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15345 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15346 after rounding frame sizes. (Bug#9723)
15348 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15350 * keyboard.c (adjust_point_for_property): Don't position point
15351 before BEGV. (Bug#10696)
15353 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15355 Handle overflow when computing char display width (Bug#9496).
15356 * character.c (char_width): Return EMACS_INT, not int.
15357 (char_width, c_string_width): Check for overflow when
15358 computing the width; this is possible now that individual
15359 characters can have unbounded width. Problem introduced
15360 by merge from Emacs 23 on 2012-01-19.
15362 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15364 * dbusbind.c (Fdbus_register_method): Mention the return value
15365 :ignore in the docstring.
15367 2012-02-02 Glenn Morris <rgm@gnu.org>
15369 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15371 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15372 Unconditionally set to t. (Bug#10673)
15373 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15374 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15375 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15377 2012-02-02 Kenichi Handa <handa@m17n.org>
15379 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15380 0, do not call append_composite_glyph.
15382 2012-02-02 Kenichi Handa <handa@m17n.org>
15384 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15386 (x_produce_glyphs): If the component of a composition is a null
15387 string, set it->pixel_width to 1 to avoid zero-width glyph.
15389 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15391 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15392 first 2 arguments are identical. This makes inserting large
15393 output from a subprocess an order of magnitude faster on
15394 MS-Windows, where all sbrk'ed memory is always contiguous.
15396 2012-01-31 Glenn Morris <rgm@gnu.org>
15398 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15399 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15400 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15402 2012-01-29 Glenn Morris <rgm@gnu.org>
15404 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15406 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15408 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15410 2012-01-28 Chong Yidong <cyd@gnu.org>
15412 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15414 2012-01-26 Chong Yidong <cyd@gnu.org>
15416 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15418 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15419 repeat counts (Bug#10507).
15421 2012-01-26 Glenn Morris <rgm@gnu.org>
15423 * lread.c (syms_of_lread): Doc fix.
15425 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15427 * coding.c (encode_designation_at_bol): Change return value to
15430 2012-01-25 Chong Yidong <cyd@gnu.org>
15432 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15434 2012-01-21 Chong Yidong <cyd@gnu.org>
15436 * floatfns.c (Fcopysign): Make the second argument non-optional,
15437 since nil is not allowed anyway.
15439 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15441 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15442 (send_process): Likewise.
15444 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15446 * window.c (save_window_save, Fcurrent_window_configuration)
15447 (Vwindow_persistent_parameters): Do not use Qstate.
15448 Rewrite doc-strings.
15450 2012-01-19 Kenichi Handa <handa@m17n.org>
15452 * character.c (char_width): New function.
15453 (Fchar_width, c_string_width, lisp_string_width):
15454 Use char_width (Bug#9496).
15456 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15458 * window.c (Vwindow_persistent_parameters): New variable.
15459 (Fset_window_configuration, save_window_save): Handle persistent
15462 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15464 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15465 thrashing the stack of the thread. (Bug#9087)
15467 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15469 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15471 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15473 * xdisp.c (rows_from_pos_range): Handle the case where the
15474 highlight ends on a newline. (Bug#10464)
15475 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15476 he end column for display of highlight that ends on a newline
15479 2012-01-11 Glenn Morris <rgm@gnu.org>
15481 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15482 from load-path also when installation-directory is nil. (Bug#10208)
15484 2012-01-10 Glenn Morris <rgm@gnu.org>
15486 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15488 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15489 Update template values to be closer to their typical values these days.
15491 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15493 * xdisp.c (rows_from_pos_range): Accept additional argument
15494 DISP_STRING, and accept any glyph in a row whose object is that
15495 string as eligible for mouse highlight. Fixes mouse highlight of
15496 display strings from overlays. (Bug#10464)
15498 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15500 emacs: fix an auto-save permissions race condition (Bug#10400)
15501 * fileio.c (auto_saving_dir_umask): New static var.
15502 (Fmake_directory_internal): Use it.
15503 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15504 creating the directory. The old code temporarily assigns
15505 too-generous permissions to the directory.
15506 (do_auto_save_eh): Clear it.
15507 (Fdo_auto_save): Catch all errors, not just file errors, so
15508 that the var is always cleared.
15510 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15512 * search.c (scan_buffer): Pass character positions to
15513 know_region_cache, not byte positions. (Bug#6540)
15515 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15517 * w32.c (sys_rename): Report EXDEV when rename of a directory
15518 fails because the target is on another logical disk. (Bug#10284)
15520 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15522 * xterm.c (x_embed_request_focus): New function.
15524 * xterm.h: Add prototype.
15526 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15528 2012-01-05 Glenn Morris <rgm@gnu.org>
15530 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15532 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15534 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15535 Load gnutls_transport_set_lowat only if GnuTLS version is below
15537 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15538 GnuTLS versions below 2.11.1.
15540 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15542 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15543 to the doc string advising against its use for altering the way
15544 windows are scrolled.
15546 2011-12-28 Kenichi Handa <handa@m17n.org>
15548 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15549 coding-system ASCII compatible only when it does not produce BOM
15550 on encoding (Bug#10383).
15552 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15554 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15556 (create_and_show_popup_menu): Always use menu_position_func for
15559 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15561 * callint.c (Fcall_interactively): Don't truncate prompt string.
15563 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15565 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15566 property that ends at ZV, so that the bidi iteration could be
15567 resumed from there (after widening). (Bug#10360)
15569 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15571 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15573 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15575 * nsterm.m (x_free_frame_resources):
15576 Release f->output_data.ns->miniimage.
15577 (ns_index_color): Fix indentation. Do not retain
15578 color_table->colors[i].
15580 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15583 * nsfns.m (x_set_background_color): Assign return value from
15584 ns_index_color to face-background instead of NSColor*.
15585 (ns_implicitly_set_icon_type): Fix indentation.
15586 Change assignment in for loop to comparison.
15588 * emacs.c (ns_pool): New variable.
15589 (main): Assign ns_pool.
15590 (Fkill_emacs): Call ns_release_autorelease_pool.
15592 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15593 autorelease fdesc, release fdAttrs and tdict.
15594 (ns_get_covering_families): Release charset.
15595 (ns_findfonts): Release NSFontDescriptor created with new.
15596 (ns_uni_to_glyphs): Fix indentation.
15597 (setString): Release attrStr before assigning new value.
15599 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15601 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15603 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15604 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15606 2011-12-18 David Reitter <reitter@cmu.edu>
15608 * nsterm.m (ns_term_init): Subscribe for notifications
15609 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15610 to method trackingNotification in EmacsMenu.
15612 * nsmenu.m (trackingMenu): New variable.
15613 (trackingNotification): New method (from Aquamacs).
15614 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15615 from Aquamacs (Bug#7030).
15617 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15619 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15620 (symbol_to_nsstring): Fix indentation.
15621 (ns_symbol_to_pb): New function.
15622 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15623 (Fns_rotate_cut_buffers_internal): Remove.
15624 (Fns_store_selection_internal): Rename from
15625 Fns_store_cut_buffer_internal.
15626 (ns_get_foreign_selection, Fx_own_selection_internal)
15627 (Fx_disown_selection_internal, Fx_selection_exists_p)
15628 (Fns_get_selection_internal, Fns_store_selection_internal):
15629 Use ns_symbol_to_pb and check if return value is nil.
15630 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15631 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15632 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15633 renamed to Sns_store_selection_internal.
15634 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15635 and remove this function.
15636 (ns_handle_selection_clear): Remove, never used.
15637 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15640 2011-12-17 Ken Brown <kbrown@cornell.edu>
15642 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15643 GID is unknown (Bug#10257).
15645 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15647 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15648 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15649 which caused a build failure on GNU/Linux IA-64. This problem was
15650 introduced by my 2011-10-07 patch.
15652 2011-12-15 Juri Linkov <juri@jurta.org>
15654 * image.c (imagemagick_error): New function. (Bug#10112)
15655 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15656 Use `imagemagick_error' where ImageMagick functions return
15658 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15661 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15663 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15664 fill background (Bug#8992).
15666 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15668 * window.c (Vwindow_combination_resize)
15669 (Vwindow_combination_limit): Use t instead of non-nil in
15671 (Vrecenter_redisplay): Add first sentence of doc-string on
15673 (Frecenter): Fix doc-string typo.
15675 2011-12-11 Kenichi Handa <handa@m17n.org>
15677 * coding.c (Funencodable_char_position): Pay attention to the
15678 buffer text relocation (Bug#9389).
15680 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15682 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15683 gtk_init (Bug#10100).
15685 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15687 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15688 IT->string is nil. (Bug#10263)
15690 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15692 * nsterm.h (x_free_frame_resources): Declare.
15694 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15695 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15697 * nsterm.h (ns_get_defaults_value): Declare.
15699 * nsterm.m (ns_default): Call ns_get_defaults_value.
15701 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15703 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15706 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15708 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15709 that where the value of an _OBJC_* symbol points to is in the .bss
15710 section (Bug#10240).
15712 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15714 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15715 after the loop to call ccl_driver at least once (Bug#8619).
15717 2011-12-08 Kenichi Handa <handa@m17n.org>
15719 * ftfont.c (get_adstyle_property): Fix previous change
15722 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15724 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15725 dirs from the default value of EMACSLOADPATH (bug#10208).
15727 2011-12-07 Glenn Morris <rgm@gnu.org>
15729 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15730 installation and source directories as well. (Bug#10208)
15732 2011-12-06 Chong Yidong <cyd@gnu.org>
15734 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15736 2011-12-06 Glenn Morris <rgm@gnu.org>
15738 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15739 as an error, not just -1. (Bug#10217)
15741 2011-12-05 Chong Yidong <cyd@gnu.org>
15743 * keyboard.c (process_special_events): New function.
15744 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15746 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15748 * coding.c (encode_designation_at_bol): Don't use uninitialized
15749 local variable (Bug#9318).
15751 2011-12-05 Kenichi Handa <handa@m17n.org>
15753 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15754 return Qnil (Bug#8046, Bug#10193).
15756 2011-12-05 Kenichi Handa <handa@m17n.org>
15758 * coding.c (encode_designation_at_bol): New args charbuf_end and
15759 dst. Return the number of produced bytes. Callers changed.
15760 (coding_set_source): Return how many bytes coding->source was
15762 (coding_set_destination): Return how many bytes
15763 coding->destination was relocated.
15764 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15765 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15767 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15769 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15770 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15773 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15775 The following changes are to fix Bug#9318.
15777 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15778 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15779 (encode_coding_iso_2022, encode_coding_sjis)
15780 (encode_coding_big5, encode_coding_charset): Use the above macros.
15782 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15784 * lisp.h (process_quit_flag): Fix external declaration.
15786 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15788 Don't macro-inline non-performance-critical code.
15789 * eval.c (process_quit_flag): New function.
15790 * lisp.h (QUIT): Use it.
15792 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15794 * nsfns.m (get_geometry_from_preferences): New function.
15795 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15797 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15799 * emacs.c (Qkill_emacs): Define.
15800 (syms_of_emacs): Initialize it.
15801 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15802 Qquit_flag to `kill-emacs' instead.
15803 (quit_throw_to_read_char): Add parameter `from_signal'.
15804 All callers changed. Call Fkill_emacs if requested and safe.
15805 * lisp.h (QUIT): Call Fkill_emacs if requested.
15807 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15809 * widget.c (update_wm_hints): Return if wmshell is null.
15810 (widget_update_wm_size_hints): New function.
15812 * widget.h (widget_update_wm_size_hints): Declare.
15814 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15815 widget_update_wm_size_hints (Bug#10104).
15817 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15819 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15820 before a newline, prepare the bidi iterator for consuming the
15821 newline, and keep the current paragraph direction. (Bug#10183)
15822 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15824 2011-12-02 Juri Linkov <juri@jurta.org>
15826 * search.c (Fword_search_regexp): New Lisp function created from
15827 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15828 (Fword_search_backward, Fword_search_forward)
15829 (Fword_search_backward_lax, Fword_search_forward_lax):
15830 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15831 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15833 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15835 * fileio.c (Finsert_file_contents): Move after-change-function call
15836 to before the "handled:" label, since all "goto handled" appear in
15837 cases where the *-change-functions have already been properly called
15840 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15842 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15843 waiting for input. (Bug#10169)
15845 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15847 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15848 verifies glyph row's hash code--we have just reallocated the
15849 glyphs, so their contents can be complete garbage. (Bug#10164)
15851 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15853 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15855 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15857 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15858 attributes are tested _before_ calling verify_row_hash, to protect
15859 against GCC re-ordering of the tests. (Bug#10164)
15861 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15863 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15865 * xterm.c (handle_one_xevent): Only set async_visible and friends
15866 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15867 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15868 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15870 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15872 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15873 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15874 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15875 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15876 All uses changed to use GCPRO1 etc.
15877 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15878 Revert to old implementation (i.e., before 2011-03-11).
15880 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15882 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15883 of scroll runs so as to avoid assigning disabled bogus rows and
15884 unnecessary graphics copy operations.
15886 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15888 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15889 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15890 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15891 (malloc, free, realloc, calloc): Redirect to e_* only when
15894 * lisp.h (GCTYPEBITS): Move before first use.
15895 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15896 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15897 this macro definition.
15899 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15902 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15904 * gtkutil.c (xg_create_frame_widgets):
15905 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15906 present with Gtk+ 2.0.
15908 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15910 * fileio.c (Finsert_file_contents): Undo previous change; see
15911 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15913 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15915 Rename locals to avoid shadowing.
15916 * fileio.c (Finsert_file_contents):
15917 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15918 * process.c (wait_reading_process_output):
15919 Rename inner 'proc' to 'p' to avoid shadowing.
15920 Indent for consistency with usual Emacs style.
15922 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15924 * xdisp.c (redisplay_window): If cursor row is not fully visible
15925 after recentering, and scroll-conservatively is set to a large
15926 number, scroll window by a few more lines to make the cursor fully
15927 visible and out of scroll-margin. (Bug#10105)
15928 (start_display): Don't move to the next line if the display should
15929 start at a newline that is part of a display vector or an overlay
15930 string. (Bug#10119)
15932 2011-11-24 Juri Linkov <juri@jurta.org>
15934 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15935 after the `MagickPingImage' call. (Bug#10112)
15937 2011-11-23 Chong Yidong <cyd@gnu.org>
15939 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15941 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15943 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15944 making another buffer current. (Bug#10114)
15946 2011-11-23 Glenn Morris <rgm@gnu.org>
15948 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15950 2011-11-23 Chong Yidong <cyd@gnu.org>
15952 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15953 using it (Bug#5984).
15955 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15957 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15958 and header-lines, as they don't have one computed for them.
15961 * .gdbinit (prow): Make displayed values more self-explaining.
15962 Add row's hash code.
15964 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15966 * process.c (wait_reading_process_output): Fix asynchrounous
15967 GnuTLS socket handling on some versions of the GnuTLS library.
15968 (wait_reading_process_output): Add comment and URL.
15970 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15972 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15974 2011-11-21 Chong Yidong <cyd@gnu.org>
15976 * window.c (Fnext_window, Fprevious_window): Doc fix.
15978 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15980 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15982 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15984 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15986 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15988 * window.c (Fset_window_combination_limit): Rename argument
15990 (Vwindow_combination_limit): Remove "status" from doc-string.
15992 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15994 * m/ibms390.h: Remove.
15995 * m/ibms390x.h: Don't include "ibms390.h".
15997 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15999 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
16000 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
16002 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
16004 * casetab.c (Fset_case_table):
16005 * charset.c (Fcharset_after): Fix typos.
16007 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
16009 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
16010 Otherwise, valgrind does not work on some platforms.
16011 Problem reported by Andreas Schwab in
16012 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
16013 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
16014 is set, removing the need for VIRT_ADDRESS_VARIES.
16015 (PURE_P): Use a more-efficient implementation that needs just one
16016 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16017 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
16018 to 4 (xorl, subq, cmpq, setbe).
16019 * alloc.c (pure): Always extern now, since that's the
16020 VIRT_ADDR_VARIES behavior.
16021 (PURE_POINTER_P): Use a single comparison, not two, for
16022 consistency with the new puresize.h.
16023 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16024 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16025 Remove VIRT_ADDR_VARIES no longer needed.
16027 2011-11-19 Eli Zaretskii <eliz@gnu.org>
16029 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16030 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16031 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16032 behave as if the cursor position were at the window margin.
16034 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16035 and the cursor position is out of bounds, behave as if the cursor
16036 position were at the window margin. (Bug#10075)
16038 2011-11-18 Chong Yidong <cyd@gnu.org>
16040 * window.c (Fwindow_combination_limit): Make first argument
16041 non-optional, since it is meaningless for live windows like the
16044 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16046 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16048 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16050 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16051 (graft_intervals_into_buffer): Simplify.
16053 2011-11-18 Eli Zaretskii <eliz@gnu.org>
16055 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16056 hash values of the two rows.
16057 (copy_row_except_pointers): Preserve the used[] arrays and the
16058 hash values of the two rows. (Bug#10035)
16059 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16061 * xdisp.c (row_hash): New function, body extracted from
16062 compute_line_metrics.
16063 (compute_line_metrics): Call row_hash, instead of computing the
16066 * dispnew.c (verify_row_hash): Call row_hash for computing the
16067 hash code of a row, instead of duplicating code from xdisp.c.
16069 * dispextern.h (row_hash): Add prototype.
16071 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16073 * frame.c (delete_frame): Don't delete the terminal when the last
16074 X frame is closed if emacs is built with GTK toolkit.
16076 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
16078 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16080 2011-11-17 Martin Rudalics <rudalics@gmx.at>
16082 * window.c (Vwindow_splits): Rename to
16083 Vwindow_combination_resize. Suggested by Juri Linkov.
16084 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16087 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
16089 * nsfns.m (Fns_font_name):
16090 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16092 2011-11-16 Martin Rudalics <rudalics@gmx.at>
16094 * window.h (window): Rename slot "nest" to "combination_limit".
16095 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16096 (Fset_window_nest): Rename to Fset_window_combination_limit.
16097 (Vwindow_nest): Rename to Vwindow_combination_limit.
16098 (recombine_windows, make_parent_window, make_window)
16099 (Fsplit_window_internal, saved_window)
16100 (Fset_window_configuration, save_window_save): Rename all
16101 occurrences of window_nest to window_combination_limit.
16103 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
16105 * image.c (imagemagick_load_image): Fix typo.
16107 2011-11-14 Eli Zaretskii <eliz@gnu.org>
16109 * xdisp.c (display_line): Move the call to
16110 highlight_trailing_whitespace before the call to
16111 compute_line_metrics, since the latter needs to see the final
16112 faces of all the glyphs to compute ROW's hash value.
16113 Fixes assertion violations in row_equal_p. (Bug#10035)
16115 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
16117 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16118 just return (bug#10044).
16120 2011-11-12 Eli Zaretskii <eliz@gnu.org>
16122 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16123 with user-defined heap size. Bump the default size of the temacs
16124 heap to 27MB, to avoid memory warning when running temacs.
16125 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16127 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16128 current_matrix and desired_matrix. (Bug#9990)
16129 (verify_row_hash) [XASSERTS]: New function.
16130 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16131 that the hash value of glyph rows is correct.
16133 2011-11-12 Martin Rudalics <rudalics@gmx.at>
16135 * window.h (window): Remove splits slot.
16136 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16137 (Fdelete_other_windows_internal, make_parent_window)
16138 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16139 (Fset_window_configuration, save_window_save): Don't deal with
16140 split status of windows.
16141 (saved_window): Remove splits slot.
16142 (Vwindow_splits): Rewrite doc-string.
16144 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16146 * xfns.c (unwind_create_frame):
16147 * nsfns.m (unwind_create_frame):
16148 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16149 Vframe_list (Bug#9999).
16151 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16153 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16155 2011-11-11 Kenichi Handa <handa@m17n.org>
16157 * callproc.c (Fcall_process): Set the member dst_multibyte of
16160 2011-11-11 Johan Bockgård <bojohan@gnu.org>
16162 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16163 avoid a crash (bug#9496).
16165 2011-11-09 Chong Yidong <cyd@gnu.org>
16167 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16168 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16170 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16172 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16174 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16176 Avoid some portability problems by eschewing 'extern inline' functions.
16177 The trivial performance wins aren't worth the portability hassles; see
16178 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16180 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16181 (window_box_width, window_box_left, window_box_left_offset)
16182 (window_box_right, window_box_right_offset): Undo previous change,
16183 by removing the "extern"s.
16184 * intervals.c (adjust_intervals_for_insertion)
16185 (adjust_intervals_for_deletion): Undo previous change,
16186 making these static again.
16187 (offset_intervals, temp_set_point_both, temp_set_point)
16188 (copy_intervals_to_string): No longer inline.
16189 * xdisp.c (window_text_bottom_y, window_box_width)
16190 (window_box_height, window_box_left_offset)
16191 (window_box_right_offset, window_box_left, window_box_right)
16192 (window_box): No longer inline.
16194 2011-11-08 Chong Yidong <cyd@gnu.org>
16196 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16197 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16198 Signal an error if not a live window.
16199 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16200 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16202 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16204 * lisp.h (syms_of_abbrev): Remove declaration.
16205 Reported by CHENG Gao <chenggao@royau.me>.
16207 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16209 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16210 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16211 of temacs in GUI mode.
16213 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16215 * window.h: Declare delete_all_child_windows instead of
16216 delete_all_subwindows.
16217 * window.c (Fwindow_nest, Fset_window_nest)
16218 (Fset_window_new_total, Fset_window_new_normal)
16219 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16220 (delete_all_subwindows): Rename to delete_all_child_windows.
16221 (Fdelete_other_windows_internal, Fset_window_configuration):
16222 Call delete_all_child_windows instead of delete_all_subwindows.
16223 * frame.c (delete_frame): Call delete_all_child_windows instead
16224 of delete_all_subwindows.
16226 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16228 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16229 This is also needed for porting to any host where GC_MARK_STACK is
16230 not GC_MAKE_GCPROS_NOOPS.
16231 (which_symbols): Use it.
16233 2011-11-07 Kenichi Handa <handa@m17n.org>
16235 * coding.c (coding_set_destination): Check coding->src_pos only
16236 when coding->src_object is a buffer (bug#9910).
16238 * process.c (send_process): Set the member src_multibyte of coding
16239 to 0 (bug#9911) when sending a unibyte text.
16241 * callproc.c (Fcall_process): Set the member src_multibyte of
16242 process_coding to 0 (bug#9912).
16244 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16246 * xmenu.c (cleanup_widget_value_tree): New function.
16247 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16248 calling free_menubar_widget_value_tree directly (Bug#9830).
16250 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16252 Fix some portability problems with 'inline'.
16253 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16254 (window_box_width, window_box_left, window_box_left_offset)
16255 (window_box_right, window_box_right_offset): Declare extern.
16256 Otherwise, these inline functions do not conform to C99 and
16257 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16258 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16259 * intervals.c (adjust_intervals_for_insertion)
16260 (adjust_intervals_for_deletion): Now extern, because otherwise the
16261 extern inline functions 'offset_intervals' couldn't refer to it.
16262 (static_offset_intervals): Remove.
16263 (offset_intervals): Rewrite using the old contents of
16264 static_offset_intervals. The old version didn't conform to C99
16265 because an extern inline function contained a reference to an
16266 identifier with static linkage.
16268 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16270 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16273 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16275 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16276 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16277 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16278 return Qleft_to_right.
16280 2011-11-06 Chong Yidong <cyd@gnu.org>
16282 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16283 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16284 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16285 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16286 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16287 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16288 (Fwindow_vscroll): Doc fix.
16289 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16290 argument, since it makes no sense to pass a live window and for
16291 consistency with window-child.
16293 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16295 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16298 2011-11-05 Jason Rumney <jasonr@gnu.org>
16300 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16301 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16303 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16304 bitwise arithmetic preventing use of unicode-sip and non-truetype
16307 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16309 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16312 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16313 initialization code to keep similarity to xfns.c after changes
16316 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16318 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16319 (unwind_create_frame): New function (Bug#9943).
16320 (Fx_create_frame): Restructure code to be more similar to the one in
16321 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16322 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16323 Move terminal->reference_count++ just before making the frame official
16326 * nsterm.m (x_free_frame_resources): New function.
16327 (x_destroy_window): Move code to x_free_frame_resources.
16329 * xfns.c (unwind_create_frame): Fix comment.
16330 (Fx_create_frame, x_create_tip_frame):
16331 Move terminal->reference_count++ just before making the frame
16332 official. Move initialization of image_cache_refcount and
16333 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16335 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16337 Support MSVC build with newer versions of Visual Studio.
16338 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16339 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16342 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16343 which are not supported by MSVC.
16344 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16345 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16347 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16348 types in bitfields.
16349 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16351 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16353 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16355 Support MSVC build with newer versions of Visual Studio.
16356 * w32.c: Don't include w32api.h for MSVC.
16357 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16359 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16360 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16361 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16362 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16364 (alloca) [_MSC_VER]: Define to _alloca.
16366 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16368 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16370 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16372 * xdisp.c (note_mouse_highlight): If either of
16373 previous/next-single-property-change returns nil, treat that as
16374 the beginning or the end of the buffer. (Bug#9955)
16376 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16378 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16379 label is not null (Bug#9951).
16380 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16383 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16385 * window.c (Fwindow_body_size): Mention in the doc string that the
16386 return value is in frame's canonical units. (Bug#9949)
16388 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16390 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16392 * w32fns.c (unwind_create_frame): If needed, free the glyph
16393 matrices of the partially constructed frame. (Bug#9943)
16394 * xfns.c (unwind_create_frame): Likewise.
16396 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16398 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16399 Don't stop backward scan on the continuation glyph, even though
16400 its CHARPOS is positive.
16401 (mouse_face_from_buffer_pos, note_mouse_highlight):
16402 Rename cover_string to disp_string.
16404 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16406 * window.c (temp_output_buffer_show): Don't use
16407 Vtemp_buffer_show_specifiers.
16408 (Vtemp_buffer_show_specifiers): Remove unused variable.
16410 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16412 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16413 past the beginning of the current glyph matrix.
16415 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16417 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16418 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16419 HAVE_GTK3 (Bug#9869).
16421 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16422 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16424 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16426 * xterm.c: Declare x_handle_net_wm_state to return int.
16427 (handle_one_xevent): Check if we are iconified but don't have
16428 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16429 (get_current_wm_state): Return non-zero if not hidden,
16430 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16431 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16432 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16433 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16435 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16437 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16438 so that this new function doesn't get optimized away by a
16439 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16441 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16443 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16445 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16447 Fix the `xbytecode' command.
16448 * .gdbinit (xprintbytestr): New command.
16449 (xwhichsymbols): Rename from `which'; all callers changed.
16450 (xbytecode): Print the byte-code string as well.
16452 2011-10-29 Kim Storm <storm@cua.dk>
16454 * alloc.c (which_symbols): New function.
16456 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16458 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16461 2011-10-29 Glenn Morris <rgm@gnu.org>
16463 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16464 Not clear what it was for, and it causes various bugs. (Bug#9839)
16466 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16468 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16469 possible random value that matches one of those tested as
16470 condition to clear the mouse face.
16472 2011-10-28 Chong Yidong <cyd@gnu.org>
16474 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16476 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16478 * window.c (make_window): Initialize phys_cursor_on_p.
16480 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16482 * lisp.h (struct Lisp_Symbol): Update comments.
16484 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16486 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16488 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16490 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16491 <oslsachem@gmail.com> for helping to debug this.
16493 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16494 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16495 (g_b_init_get_glyph_outline_w): New static variables.
16496 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16497 (GetGlyphOutlineW_Proc): New typedefs.
16498 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16499 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16501 (w32font_open_internal, compute_metrics):
16502 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16503 instead of calling the "wide" APIs directly.
16505 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16507 * w32.h (syms_of_w32font): Add prototype.
16509 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16511 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16512 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16513 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16514 (Fmove_to_window_line): Doc fix.
16516 2011-10-27 Chong Yidong <cyd@gnu.org>
16518 * process.c (make_process): Set gnutls_state to NULL.
16520 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16521 non-NULL, regardless of GNUTLS_INITSTAGE.
16522 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16523 an error. Set process slots as soon as we allocate them.
16525 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16527 2011-10-27 Chong Yidong <cyd@gnu.org>
16529 * gnutls.c (emacs_gnutls_deinit): New function.
16530 Deallocate credentials structures as well as calling gnutls_deinit.
16531 (Fgnutls_deinit, Fgnutls_boot): Use it.
16533 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16534 (deactivate_process): Call emacs_gnutls_deinit.
16536 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16538 * image.c (x_create_x_image_and_pixmap):
16539 * w32.c (sys_rename, w32_delayed_load):
16540 * w32font.c (fill_in_logfont):
16541 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16543 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16545 * w32fns.c (w32_default_color_map): New function,
16546 extracted from Fw32_default_color_map.
16547 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16549 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16551 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16553 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16555 * keyboard.c (test_undefined): New function (bug#9751).
16556 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16558 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16560 * sysdep.c (init_sys_modes): Fix the check for the controlling
16561 terminal (Bug#6649).
16563 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16565 * dispextern.h (struct bidi_it): New member next_en_type.
16567 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16568 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16569 current character, check also for next_en_type being WEAK_EN.
16570 (bidi_resolve_weak): Don't enter the expensive loop if the current
16571 position is before next_en_pos. Record the bidi type of the first
16572 non-ET, non-BN character we find, in addition to its position.
16573 (bidi_level_of_next_char): Invalidate next_en_type when
16574 next_en_pos is over-stepped.
16576 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16578 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16579 * editfns.c: Rewrite current-time-zone so that it invokes
16580 the equivalent of (format-time-string "%Z") to get the time zone name.
16581 This fixes a bug when the time zone name contains characters that
16582 need converting from the system time locale to Emacs internal format.
16583 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16584 that patch fixed format-time-string to do the conversion, but
16585 I forgot to fix current-time-zone.
16586 (format_time_string): New function, containing most of
16587 what Fformat_time_string used to contain.
16588 (Fformat_time_string): Rewrite in terms of format_time_string.
16589 This doesn't change this function's behavior.
16590 (current-time-zone): Rewrite to use format_time_string.
16591 This fixes the bug reported by Michael Schierl in
16592 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16593 Jason Rumney's 2007-06-07 change worked around this bug, but
16595 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16597 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16599 * xdisp.c (start_display): If the character at POS is displayed
16600 via a display vector, reset IT->current.dpvec_index to zero.
16601 (try_window_reusing_current_matrix): If a line ends in a display
16602 vector or the next line starts in a display vector, continue
16603 redrawing the window even though the character position of
16604 start_row was reached.
16607 2011-10-18 Chong Yidong <cyd@gnu.org>
16609 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16610 with nobreak-char-display too.
16612 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16614 Fix part 3 of bug#9771.
16615 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16616 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16617 non-neutral characters if the current character is a paragraph
16618 separator (a.k.a. Newline). This avoids running the same
16619 expensive loop twice, once when we consume the preceding newline
16620 and the other time when the line actually needs to be displayed.
16621 Avoid the loop when we see neutrals on the base embedding level
16622 following a character whose directionality is the same as the
16623 paragraph's. This avoids running the expensive loop when a line
16624 ends in a long sequence of neutrals, like control characters.
16625 Add assertion against STRONG_AL type. Slightly rearrange code
16626 that determines the type of a neutral given the first non-neutral
16628 (bidi_level_of_next_char): Set next_en_pos to zero when
16629 invalidating its info.
16631 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16633 * xdisp.c (push_display_prop): Determine whether to record string
16634 or buffer position by IT->string, not by IT->method. Allow
16635 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16636 (move_it_vertically_backward): Don't look for character position
16637 immediately after the newline when in a continuation line.
16640 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16642 * window.c (coordinates_in_window): Rewrite and delabelize
16643 vertical border check. (Bug#5357) (Bug#9618)
16645 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16647 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16648 errors in XSetWindowBorder (bug#9310).
16650 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16652 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16653 avoid crash when xmalloc overrun checking is enabled.
16655 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16657 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16658 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16659 cursor motion with <left> and <right> arrow keys.
16661 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16662 some callers set that themselves.
16664 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16666 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16667 display string and the previous row comes from the same string and
16668 is empty. (Bug#9739) (Bug#9738)
16670 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16672 * doc.c (get_doc_string): Encode file name (bug#9735).
16674 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16676 * bidi.c (bidi_level_of_next_char):
16677 * xdisp.c (get_visually_first_element): Remove old incorrect
16678 comments regarding the Unicode Line Separator character.
16680 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16682 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16684 * alloc.c (Fgc_status): Do not access beyond zombies array
16685 boundary if nzombies > MAX_ZOMBIES.
16686 * alloc.c (dump_zombies): Add missing format specifier.
16688 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16690 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16691 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16693 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16694 Some packages use them to denote characters with modifiers.
16696 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16698 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16699 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16700 matching a pp-number. Rename parameter var to var1.
16702 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16704 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16706 2011-10-08 Glenn Morris <rgm@gnu.org>
16708 * callint.c (Fcall_interactively): Give a more explicit error for the
16709 'c' case with a non-character input. (Bug#8479)
16711 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16713 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16715 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16716 lines that are hscrolled on the left.
16718 * dispnew.c (buffer_posn_from_coords): Account for a possible
16719 presence of header-line. (Bug#4426)
16721 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16723 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16724 Don't advertise functionality which we discourage or doesn't work.
16726 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16728 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16729 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16730 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16731 this makes Emacs dump core during garbage collection on rare
16732 occasions. sizeof is obviously inferior to offsetof here, so
16733 stick with offsetof.
16734 (GC_POINTER_ALIGNMENT): New macro.
16735 (mark_memory): Omit 3rd (offset) arg; caller changed.
16736 Don't assume EMACS_INT alignment is the same as pointer alignment.
16738 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16740 * keyboard.c (read_key_sequence_remapped): New var.
16741 (read_key_sequence): Compute remapping in the right buffer.
16742 (command_loop_1): Use read_key_sequence's remapping directly.
16744 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16746 * dired.c (file_name_completion): Don't expand file name.
16747 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16748 before checking file name handler.
16750 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16751 they've been requested explicitly (bug#9591).
16753 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16755 * keymap.c (Fsingle_key_description): Use make_specified_string
16756 instead of build_string to build string from push_key_description.
16759 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16761 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16762 This fixes a Y2038 bug on 64-bit hosts.
16763 * buffer.c (reset_buffer):
16764 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16765 (Fclear_buffer_auto_save_failure):
16766 Use 0, not -1, to represent an unset failure time, since time_t
16767 might not be signed.
16769 Remove dependency on glibc malloc internals.
16770 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16771 Move back here from lisp.h, but with their new implementations.
16772 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16773 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16774 * charset.c (charset_table_init): New static var.
16775 (syms_of_charset): Use it instead of xmalloc. This removes a
16776 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16777 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16778 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16779 Move back to alloc.c.
16780 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16781 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16783 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16785 * nsterm.m (windowDidResize): Call x_set_window_size only when
16786 ns_in_resize is true. Otherwise set pixelwidth/height and
16787 call change_frame_size (Bug#9628).
16789 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16791 Port --enable-checking=all to Fedora 14 x86-64.
16792 * charset.c (syms_of_charset): Also account for glibc malloc's
16793 internal overhead when calculating the initial malloc maximum.
16795 Port --enable-checking=all to Fedora 14 x86.
16796 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16798 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16799 (overrun_check_realloc, overrun_check_free):
16800 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16801 That way, xmalloc returns a properly-aligned pointer even if
16802 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16803 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16804 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16805 into account when calculating the initial malloc maximum.
16806 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16807 Move here from alloc.c, so that charset.c can use it too.
16808 Properly align; the old code wasn't right for common 32-bit hosts
16809 when configured with --enable-checking=all.
16810 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16811 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16813 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16815 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16818 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16820 * xdisp.c (compute_display_string_end): If there's no display
16821 string at CHARPOS, return -1.
16823 * bidi.c (bidi_fetch_char): When compute_display_string_end
16824 returns a negative value, treat the character as a normal
16825 character not covered by a display string. (Bug#9624)
16827 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16829 * lread.c (Fread_from_string): Fix typo in docstring.
16831 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16833 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16834 newline, reseat the iterator instead of bidi-iterating there one
16835 character at a time. (Bug#9610)
16836 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16837 TO_CHARPOS if the bidi iterator is at base embedding level.
16839 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16841 * lread.c (readevalloop): Use correct code for NBSP.
16842 (read1): Likewise. (Bug#9608)
16844 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16846 * dbusbind.c (Fdbus_register_signal): When service is not
16847 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16849 2011-09-25 Glenn Morris <rgm@gnu.org>
16851 * buffer.c (truncate-lines): Doc fix.
16853 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16855 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16856 (Fset_window_next_buffers): Doc fix.
16858 2011-09-24 Glenn Morris <rgm@gnu.org>
16860 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16862 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16864 Fix minor problems found by static checking.
16865 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16866 * indent.c (Fvertical_motion): Fix == vs = typo.
16868 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16870 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16871 Default value is now t. Doc fix.
16873 * indent.c (Fvertical_motion): Compute and apply the overshoot
16874 logic when moving up, not only when moving down. Fix the
16875 confusing name and values of the it_overshoot_expected variable;
16876 logic changes accordingly. (Bug#9254) (Bug#9549)
16878 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16879 CHARPOS is covered by a display string which includes newlines.
16880 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16881 is covered by a display string with embedded newlines.
16883 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16885 * dbusbind.c (Fdbus_register_signal): Add match rule to
16886 Vdbus_registered_objects_table. (Bug#9581)
16887 (Fdbus_register_method, Vdbus_registered_objects_table):
16890 2011-09-24 Jim Meyering <meyering@redhat.com>
16892 do not ignore write error for any output size
16893 The previous change was incomplete.
16894 While it makes emacs --batch detect the vast majority of stdout
16895 write failures, errors were still ignored whenever the output size is
16896 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16897 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16898 && echo FAIL: ignored write error
16899 FAIL: ignored write error
16900 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16901 && echo FAIL: ignored write error
16902 FAIL: ignored write error
16903 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16905 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16907 * emacs.c (Fkill_emacs): In noninteractive mode exit
16908 non-successfully if a write error occurred on stdout. (Bug#9574)
16910 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16912 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16915 * dispextern.h (struct it): Update the comment documenting what
16918 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16920 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16921 a display string, extend search for cursor position to end of row.
16922 (find_row_edges): If the row ends in a newline from a display
16923 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16924 Handle the case of a display string with multiple newlines.
16925 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16926 non-empty line. Fixes confusing cursor motion with arrow keys at
16927 the beginning of a line that starts with whitespace.
16929 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16931 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16934 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16936 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16937 boolean (Bug#9154).
16939 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16941 * xdisp.c (display_line): Record maximum and minimum buffer
16942 positions even if no glyphs were produced (e.g., by a zero-width
16943 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16944 buffer positions that will be removed from the glyph row because
16946 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16947 column is beyond frame width: don't subtract 1 "pixel" when
16948 computing width of the stretch.
16949 (reseat_at_next_visible_line_start): Undo the change made on
16950 2011-09-17 that saved paragraph information and restored it after
16951 the call to `reseat'. (Bug#9545)
16953 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16955 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16956 and turn window cursor on if cleared (Bug#9415).
16958 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16960 * search.c (boyer_moore): Take unibyte characters from pattern
16961 literally. (Bug#9458)
16963 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16965 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16967 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16969 Fix minor problem found by static checking.
16970 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16971 initialized, to pacify gcc -Wuninitialized.
16973 * fileio.c: Report proper errno when syscall falls.
16974 (Finsert_file_contents): Save and restore errno,
16975 so that report_file_error outputs the correct diagnostic.
16976 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16978 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16980 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16982 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16984 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16985 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16987 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16989 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16990 about the current paragraph and restore it after the call to reseat.
16992 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16993 (bidi_find_paragraph_start): Search back for paragraph beginning
16994 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16995 (bidi_move_to_visually_next): Only trigger paragraph-related
16996 computations when the last character is a newline or at EOB, not
16997 just any NEUTRAL_B. (Bug#9470)
16999 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
17000 truncated lines if point is covered by a display string. (Bug#9524)
17002 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
17004 * xselect.c: Relax test for outgoing X longs (Bug#9498).
17005 (cons_to_x_long): New function.
17006 (lisp_data_to_selection_data): Use it. Correct the test for
17007 short-versus-long data; it was negated. Break out of vector
17008 loop, for efficiency, when a long datum is discovered.
17010 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
17012 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
17014 2011-09-16 Eli Zaretskii <eliz@gnu.org>
17016 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
17017 GCC PR/17406) by declaring this function with external scope.
17019 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17021 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
17022 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17024 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17026 * editfns.c (Fformat): Correctly handle text properties on "%%".
17028 2011-09-15 Eli Zaretskii <eliz@gnu.org>
17030 * xterm.c (x_draw_composite_glyph_string_foreground):
17031 * w32term.c (x_draw_composite_glyph_string_foreground):
17032 * term.c (encode_terminal_code):
17033 * composite.c (composition_update_it, get_composition_id):
17034 * xdisp.c (get_next_display_element)
17035 (fill_composite_glyph_string): Add comments about special meaning
17036 of TAB characters in a composition.
17038 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17040 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17041 This occurs when processing a multibyte format.
17042 Problem reported by Wolfgang Jenker.
17044 2011-09-15 Johan Bockgård <bojohan@gnu.org>
17046 * xdisp.c (try_cursor_movement): Only check for exact match if
17047 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17049 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17051 Remove unused external symbols.
17052 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17053 * xdisp.c (calc_pixel_width_or_height): Now static.
17054 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17055 * indent.c (check_display_width):
17056 * w32term.c: Fix comment to match code.
17057 * xterm.c, xterm.h (x_catching_errors): Remove.
17059 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17061 * xselect.c: Use signed conversions more consistently (Bug#9498).
17062 (selection_data_to_lisp_data): Assume incoming selection data are
17063 signed integers, not unsigned. This is to be consistent with
17064 outgoing selection data, which was modified to use signed integers
17065 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17066 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17067 expects long, not unsigned long.
17069 2011-09-14 Eli Zaretskii <eliz@gnu.org>
17071 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17072 computation of loop end. Reported by Johan Bockgård
17075 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
17077 * frame.c (Fother_visible_frames_p): Function deleted.
17079 2011-09-12 Eli Zaretskii <eliz@gnu.org>
17081 * indent.c (compute_motion): Process display vector front to back
17082 rather than the other way around. (Bug#2496)
17084 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17086 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17088 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
17090 * minibuf.c (Fread_from_minibuffer): Doc fix.
17092 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17094 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17095 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17097 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17099 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17100 value for non-existent files.
17102 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17104 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17105 set its "size" to -1. This will set the modtime_size field of
17106 the corresponding buffer to -1, which is what
17107 verify-visited-file-modtime expects for files that do not exist.
17110 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17112 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17114 * lisp.h: ... from here. push_key_description is no longer
17115 defined in keyboard.c, so its declaration should not be in
17116 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17117 logically belongs with push_key_description.
17119 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17121 * buffer.h: Include <sys/types.h> instead of <time.h>.
17122 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17123 Problem reported by Herbert J. Skuhra.
17125 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17127 * xml.c (parse_region): Make the parsing work for
17128 non-comment-starting XML files again (bug#9144).
17130 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17132 * image.c (gif_load): Fix calculation of bottom and right corner.
17135 2011-09-10 Eli Zaretskii <eliz@gnu.org>
17137 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17138 redisplay in small windows.
17140 2011-09-09 Eli Zaretskii <eliz@gnu.org>
17142 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17144 2011-09-08 Martin Rudalics <rudalics@gmx.at>
17146 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17147 Operate on live windows only.
17149 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
17151 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17153 2011-09-07 Eli Zaretskii <eliz@gnu.org>
17155 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17156 only under bidi iteration.
17158 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17160 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17162 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17164 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17165 Without this fix, the command to link temacs failed due to an
17166 undefined symbol __builtin_isnan. This is because
17167 /usr/include/iso/math_c99.h #defines isnan(x) to
17168 __builtin_isnan(x), but the bundled gcc, which identifies itself
17169 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17171 * floatfns.c (isnan): #undef, and then #define to a clone of
17173 (Fisnan): Always define, since it's always available now.
17174 (syms_of_floatfns): Always define isnan at the Lisp level.
17176 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17178 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17180 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17182 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17183 The previous code assumed that file offsets (off_t values) fit in
17184 EMACS_INT variables, which is not true on typical 32-bit hosts.
17185 The code messed up by falsely reporting buffer overflow in cases
17186 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17187 when "big" contains more than 2**29 bytes, even though this
17188 inserts just one byte and does not overflow the buffer.
17189 (Finsert_file_contents): Store file offsets as off_t
17190 values, not as EMACS_INT values. Check for overflow when
17191 converting between EMACS_INT and off_t. When checking for
17192 buffer overflow or for overlap, take the offsets into account.
17193 Don't use EMACS_INT for small values where int suffices.
17194 When checking for overlap, fix a typo: ZV was used where
17195 ZV_BYTE was intended.
17196 (Fwrite_region): Don't assume off_t fits into 'long'.
17197 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17199 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17201 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17203 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17205 sprintf-related integer and memory overflow issues (Bug#9412).
17207 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17208 (esprintf, exprintf, evxprintf): New functions.
17209 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17210 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17211 (modify_event_symbol): Do not assume that the length of
17212 name_alist_or_stem is safe to alloca and fits in int.
17213 (Fexecute_extended_command): Likewise for function name and binding.
17214 (Frecursion_depth): Wrap around reliably on integer overflow.
17215 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17216 since some callers pass EMACS_INT values.
17217 (Fsingle_key_description): Don't crash if symbol name contains more
17218 than MAX_ALLOCA bytes.
17219 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17220 (get_minibuffer): Arg is now EMACS_INT, not int.
17221 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17222 (esprintf, exprintf, evxprintf): New decls.
17223 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17225 * dbusbind.c (signature_cat): New function.
17226 (xd_signature, Fdbus_register_signal):
17227 Do not overrun buffer; instead, report string overflow.
17229 * dispnew.c (add_window_display_history): Don't overrun buffer.
17230 Truncate instead; this is OK since it's just a log.
17232 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17233 even if the time zone offset is outlandishly large.
17234 Don't mishandle offset == INT_MIN.
17236 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17237 when creating daemon; the previous buffer-overflow check was incorrect.
17239 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17240 which has the guts of the old verror function.
17242 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17243 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17245 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17246 (font_unparse_xlfd): Don't blindly alloca long strings.
17247 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17248 fits in int, when using sprintf. Use single snprintf to count
17249 length of string rather than counting it via multiple sprintfs;
17250 that's simpler and more reliable.
17251 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17252 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17253 sprintf, in case result does not fit in int.
17255 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17256 (fontset_from_font): Print it.
17258 * frame.c (tty_frame_count): Now printmax_t, not int.
17259 (make_terminal_frame, set_term_frame_name): Print it.
17260 (x_report_frame_params): In X, window IDs are unsigned long,
17261 not signed long, so print them as unsigned.
17262 (validate_x_resource_name): Check for implausibly long names,
17263 and don't assume name length fits in 'int'.
17264 (x_get_resource_string): Don't blindly alloca invocation name;
17265 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17268 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17269 (xg_check_special_colors, xg_set_geometry):
17270 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17272 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17273 Use esprintf, not sprintf, in case result does not fit in int.
17275 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17276 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17277 it as a large positive number.
17278 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17279 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17281 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17282 in case result does not fit in int.
17284 * print.c (float_to_string): Detect width overflow more reliably.
17285 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17286 buffer overrun. Don't assume list length fits in 'int'. Treat
17287 print length of 0 as 0, not as infinity; to be consistent with other
17288 uses of print length in this function. Don't overflow print length
17289 index. Don't assume hash table size fits in 'long', or that
17290 vectorlike size fits in 'unsigned long'.
17292 * process.c (make_process): Use printmax_t, not int, to format
17293 process-name gensyms.
17295 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17297 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17298 to avoid potential buffer overrun.
17300 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17301 if X resource line is longer than 512 bytes.
17303 * xfns.c (x_window): Make sprintf buffer a bit bigger
17304 to avoid potential buffer overrun.
17306 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17308 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17310 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17312 Integer overflow fixes for scrolling, etc.
17313 Without these, Emacs silently mishandles large integers sometimes.
17314 For example, "C-u 4294967297 M-x recenter" was treated as if
17315 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17317 * xdisp.c (try_window_id): Check Emacs fixnum range before
17318 converting to 'int'.
17320 * window.c (window_scroll_line_based, Frecenter):
17321 Check that an Emacs fixnum is in range before assigning it to 'int'.
17322 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17323 values converted from Emacs fixnums.
17324 (Frecenter): Don't wrap around a line count if it is out of 'int'
17325 range; instead, treat it as an extreme value.
17326 (Fset_window_configuration, compare_window_configurations):
17327 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17329 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17330 that can exceed INT_MAX. Check that EMACS_INT value is in range
17331 before assigning it to the (possibly-narrower) index.
17332 (match_limit): Don't assume that a fixnum can fit in 'int'.
17334 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17337 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17338 (Fvertical_motion): Don't wrap around LINES values that don't fit
17339 in 'int'. Instead, treat them as extreme values. This is good
17340 enough for windows, which can't have more than INT_MAX lines anyway.
17342 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17344 * Require libxml/parser.h to avoid compilation warning.
17346 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17348 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17349 since this reportedly can destroy thread storage.
17351 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17353 * syntax.c (find_defun_start): Update all cache variables if
17354 exiting early (Bug#9401).
17356 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17358 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17360 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17361 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17362 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17364 * term.c (tty_append_glyph): New function.
17365 (produce_stretch_glyph): Static function and its prototype deleted.
17367 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17370 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17372 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17373 when checking :margin (Bug#9390).
17374 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17375 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17376 so that the name doesn't mislead. All uses changed.
17378 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17380 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17383 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17385 * xdisp.c (move_it_to): Don't bail out early when reaching
17386 position beyond to_charpos, if we are scanning backwards.
17387 (move_it_vertically_backward): When DY == 0, make sure we get to
17388 the first character in the line after the newline.
17390 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17392 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17393 (ccl_driver): Do not generate an out-of-range pointer.
17394 (Fccl_execute_on_string): Remove unnecessary check for
17395 integer overflow, noted by Stefan Monnier in
17396 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17397 Remove a FIXME that didn't need fixing.
17398 Simplify the newly-introduced buffer reallocation code.
17400 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17402 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17404 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17406 Integer and memory overflow issues (Bug#9196).
17408 * doc.c (get_doc_string): Rework so that
17409 get_doc_string_buffer_size is the actual buffer size, rather than
17410 being 1 less than the actual buffer size; this makes xpalloc more
17413 * image.c (x_allocate_bitmap_record, cache_image):
17414 * xselect.c (Fx_register_dnd_atom):
17415 Simplify previous changes by using xpalloc.
17417 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17418 since either will do and ptrdiff_t is convenient with xpalloc.
17420 * charset.c (charset_table_size)
17421 (struct charset_sort_data.priority): Now ptrdiff_t.
17422 (charset_compare): Don't overflow if priorities differ greatly.
17423 (Fsort_charsets): Don't assume list length fits in int.
17424 Check for size-calculation overflow when allocating sort data.
17425 (syms_of_charset): Allocate an initial charset table that is
17426 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17428 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17430 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17431 The actual value is always <= INT_MAX, and leaving it unsigned made
17432 overflow checking harder.
17434 * dispextern.h (struct glyph_matrix.rows_allocated)
17435 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17436 with xpalloc. The values are still always <= INT_MAX.
17438 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17440 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17441 (SAFE_NALLOCA): New macro.
17443 * region-cache.c (struct boundary.pos, find_cache_boundary)
17444 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17445 (set_cache_region, invalidate_region_cache)
17446 (revalidate_region_cache, know_region_cache, region_cache_forward)
17447 (region_cache_backward, pp_cache):
17448 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17449 so that ptrdiff_t * can be passed to xpalloc.
17450 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17451 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17452 (pp_cache): Don't assume cache_len fits in int.
17453 * region-cache.h: Adjust extern decls to match.
17455 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17456 EMACS_INT, since either will do, for xpalloc.
17458 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17459 (xnmalloc, xnrealloc, xpalloc): New functions.
17461 * bidi.c (bidi_shelve_header_size): New constant.
17462 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17463 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17465 * bidi.c (bidi_cache_shrink):
17466 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17468 Don't update size of array until after memory allocation succeeds,
17469 because xmalloc/xrealloc may not return.
17470 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17471 now that we have proper integer overflow checking.
17472 (record_overlay_string, overlay_strings): Catch overflows when
17473 calculating size of overlay_str_buf.
17475 * callproc.c (Fcall_process): Check for size overflow when
17476 calculating size of args2.
17477 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17478 Normally we prefer signed values, but sticking with ptrdiff_t would
17479 require adding more-complicated checks.
17481 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17482 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17483 Redo buffer-overflow calculations to avoid integer overflow.
17484 Add a FIXME comment where memory seems to be over-allocated.
17486 * character.c (Fstring): Check for size-calculation overflow.
17488 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17489 unnecessary integer overflow. Check for size overflow.
17490 (encode_coding_object): Don't update size until xmalloc succeeds.
17492 * composite.c (get_composition_id): Check for overflow in glyph
17493 length calculations.
17495 Integer and memory overflow fixes for display code.
17496 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17497 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17498 (scrolling_window): Check for overflow in size calculations.
17499 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17500 Don't assume glyph table len fits in int.
17501 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17502 (row_table_size): Now ptrdiff_t, not int.
17503 (scrolling_window): Avoid overflow in size calculations.
17504 Don't update size until allocation succeeds.
17505 * fns.c (concat): Check for overflow in size calculations.
17506 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17507 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17508 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17510 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17511 (get_doc_string): Check for size calculation overflow.
17512 Don't update size until allocation succeeds.
17513 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17514 EMACS_INT, where ptrdiff_t will do.
17515 (Fsubstitute_command_keys): Check for string overflow.
17517 * editfns.c (set_time_zone_rule): Don't assume environment length
17519 (message_length): Now ptrdiff_t, not int.
17520 (Fmessage_box): Don't update size until allocation succeeds.
17521 Don't assume message length fits in int.
17522 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17524 * emacs.c (main): Do not reallocate argv, since there is a null at
17525 the end that can be overwritten, and this way there's no need to
17526 worry about size-calculation overflow.
17527 (sort_args): Check for size-calculation overflow.
17529 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17531 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17533 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17534 (x_set_scroll_bar_width, x_figure_window_size):
17535 Check for integer overflow.
17536 (x_set_alpha): Do not assume XINT fits in int.
17538 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17539 This is for the members text_lines, text_cols, total_lines, total_cols,
17540 where the system imposes an 'int' limit.
17542 * fringe.c (Fdefine_fringe_bitmap):
17543 Don't update size until alloc works.
17545 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17546 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17548 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17549 Check for size-calculation overflow.
17550 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17551 do, as we prefer signed integers.
17552 (id_to_widget.max_size, id_to_widget.used)
17553 (xg_store_widget_in_map, xg_remove_widget_from_map)
17554 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17555 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17556 Use and return ptrdiff_t, not int.
17557 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17558 * gtkutil.h: Change prototypes to match the above.
17560 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17561 are duplicate now that they've been promoted to lisp.h.
17562 (x_allocate_bitmap_record, x_alloc_image_color)
17563 (make_image_cache, cache_image, xpm_load):
17564 Don't update size until alloc is done.
17565 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17567 Check for size calculation overflow.
17568 (ct_colors_allocated_max): New constant.
17569 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17572 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17573 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17574 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17575 Use ptrdiff_t, not int, to count maps.
17576 (read_char_minibuf_menu_prompt): Check for overflow in size
17577 calculations. Don't update size until allocation succeeds.
17578 Redo calculations to avoid overflow.
17579 * keyboard.h: Change prototypes to match the above.
17581 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17583 (current_minor_maps): Check for size calculation overflow.
17584 * keymap.h: Change prototypes to match the above.
17586 * lread.c (read1, init_obarray): Don't update size until alloc done.
17588 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17589 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17591 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17592 Now ptrdiff_t, not int.
17593 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17594 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17596 * process.c (Fnetwork_interface_list): Check for overflow
17597 in size calculation.
17599 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17601 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17602 overflow. Don't bother calling xmalloc when xrealloc will do.
17604 * search.c (Freplace_match): Check for size calculation overflow.
17605 (Fset_match_data): Don't assume list lengths fit in 'int'.
17607 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17608 for command line length. Do not attempt to address one before the
17609 beginning of an array, as that's not portable.
17611 * term.c (max_frame_lines): Remove; unused.
17612 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17614 (encode_terminal_code, calculate_costs): Check for size
17615 calculation overflow.
17616 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17617 table lengths and related sizes. Don't update size until alloc
17618 done. Redo calculations to avoid overflow.
17619 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17621 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17622 subtracting pointers.
17623 (gobble_line): Check for overflow more carefully. Don't update size
17626 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17627 Don't update size until alloc done.
17628 Redo size calculations to avoid overflow.
17629 Check for size calculation overflow.
17630 (main) [DEBUG]: Fix typo in invoking tparam1.
17632 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17633 Use ptrdiff_t, not int, for sizes.
17634 (store_mode_line_noprop_char): Don't update size until alloc done.
17636 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17637 Use ptrdiff_t, not int, for sizes.
17638 (Finternal_make_lisp_face, cache_face):
17639 Check for size calculation overflow.
17640 (cache_face): Treat size calculation overflows as if they were
17641 memory exhaustion (the usual treatment), rather than aborting.
17643 * xfns.c (x_encode_text, x_set_name_internal)
17644 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17645 sizes, since they can exceed INT_MAX in size. Check for size
17646 calculation overflow.
17648 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17649 (xg_select): Check for size calculation overflow.
17650 Don't update size until alloc done.
17652 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17653 as sprintf is limited to int lengths.
17655 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17656 (X_LONG_MIN): New macros.
17657 Use them to make the following changes clearer.
17658 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17659 This change doesn't affect the value now, but it may help remind
17660 future maintainers not to raise the value too much later.
17661 (SELECTION_QUANTUM): Remove, replacing with ...
17662 (selection_quantum): ... new function, which avoids overflow.
17664 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17665 assumption that selection length fits in 'int'.
17666 (x_reply_selection_request, x_handle_selection_request)
17667 (x_get_window_property, receive_incremental_selection)
17668 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17669 (lisp_data_to_selection_data, clean_local_selection_data):
17670 Use ptrdiff_t, not int, to record length of selection.
17671 (x_reply_selection_request, x_get_window_property)
17672 (receive_incremental_selection, x_property_data_to_lisp):
17673 Redo calculations to avoid overflow.
17674 (x_reply_selection_request): When sending hint, ceiling it at
17675 X_LONG_MAX rather than relying on wraparound overflow to send
17677 (x_get_window_property, receive_incremental_selection)
17678 (lisp_data_to_selection_data, x_property_data_to_lisp):
17679 Check for size-calculation overflow.
17680 (x_get_window_property, receive_incremental_selection)
17681 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17682 Don't store size until memory allocation succeeds.
17683 (x_get_window_property): Plug memory leak on memory exhaustion.
17684 Don't double-block input; malloc is safe here. Don't assume 2**34
17685 - 4 fits in unsigned long. Add an xassert to check
17686 XGetWindowProperty overflow. Be more careful about overflow
17687 calculations, and distinguish size from memory overflow better.
17688 (receive_incremental_selection): When tracing, don't assume
17689 unsigned int is less than INT_MAX.
17690 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17691 harmful) conversions of unsigned short to int.
17692 (lisp_data_to_selection_data): Don't assume that integers
17693 in the range -65535 through -1 fit in an X unsigned short.
17694 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17695 result parameters unless successful. Rely on cons_to_unsigned
17696 to report problems with elements; the old code wasn't right anyway.
17697 (x_check_property_data): Check for int overflow; we cannot use
17698 a wider type due to X limits.
17699 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17701 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17703 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17704 (x_term_init): Check for size calculation overflow.
17705 (x_color_cells): Don't store size until memory allocation succeeds.
17706 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17707 Don't assume alloca size is less than MAX_ALLOCA.
17708 (x_term_init): Don't assume length fits in int (sprintf is limited
17711 Use ptrdiff_t for composition IDs.
17712 * character.c (lisp_string_width):
17713 * composite.c (composition_table_size, n_compositions)
17714 (get_composition_id, composition_gstring_from_id):
17715 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17716 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17717 * window.c (Frecenter):
17718 Use ptrdiff_t, not int, for composition IDs.
17719 * composite.c (get_composition_id): Check for integer overflow.
17720 * composite.h: Adjust prototypes to match the above changes.
17722 Use ptrdiff_t for hash table indexes.
17723 * category.c (hash_get_category_set):
17724 * ccl.c (ccl_driver):
17725 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17726 * coding.c (coding_system_charset_list, detect_coding_system):
17727 * coding.h (struct coding_system.id):
17728 * composite.c (get_composition_id, gstring_lookup_cache):
17729 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17730 * image.c (xpm_get_color_table_h):
17731 * lisp.h (hash_lookup, hash_put):
17732 * minibuf.c (Ftest_completion):
17733 Use ptrdiff_t for hash table indexes, not int (which is too
17734 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17735 32-bit --with-wide-int hosts).
17737 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17738 Add a FIXME comment about memory leaks.
17739 (syms_of_charset): Don't assume xmalloc returns.
17741 Don't assume that stated character widths fit in int.
17742 * character.c (Fchar_width, c_string_width, lisp_string_width):
17743 * character.h (CHAR_WIDTH):
17744 * indent.c (MULTIBYTE_BYTES_WIDTH):
17745 Use sanitize_char_width to avoid undefined and/or bad behavior
17746 with outlandish widths.
17747 * character.h (sanitize_tab_width): Rename from sanitize_width,
17748 now that we have two such functions. All uses changed.
17749 (sanitize_char_width): New inline function.
17751 Don't assume that tab-width fits in int.
17752 * character.h (sanitize_width): New inline function.
17753 (SANE_TAB_WIDTH): New macro.
17754 (ASCII_CHAR_WIDTH): Use it.
17755 * indent.c (sane_tab_width): Remove. All uses replaced by
17756 SANE_TAB_WIDTH (current_buffer).
17757 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17759 * fileio.c: Integer overflow issues with file modes.
17760 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17762 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17763 Remove unreachable code.
17764 (read_hex, load_charset_map_from_file): Check for integer overflow.
17766 * xterm.c: Don't go over XClientMessageEvent limit.
17767 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17768 (x_send_scroll_bar_event): Likewise. Check that the size does not
17769 exceed limits imposed by XClientMessageEvent, as well as the usual
17770 ptrdiff_t and size_t limits.
17772 * keyboard.c: Overflow, signedness and related fixes.
17773 (make_lispy_movement): Use same integer type in forward decl
17774 that is used in the definition.
17775 (read_key_sequence, keyremap_step):
17776 Change bufsize argument back to int, undoing my 2011-03-30 change.
17777 We prefer signed types, and int is wide enough here.
17778 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17779 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17780 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17781 length, not size_t. Use ptrdiff_t for index, not int.
17782 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17783 possibility of integer overflow.
17785 Overflow, signedness and related fixes for images.
17787 * dispextern.h (struct it.stack[0].u.image.image_id)
17788 (struct_it.image_id, struct image.id, struct image_cache.size)
17789 (struct image_cache.used, struct image_cache.ref_count):
17790 * gtkutil.c (update_frame_tool_bar):
17791 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17792 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17793 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17794 * nsmenu.m (update_frame_tool_bar):
17795 * xdisp.c (calc_pixel_width_or_height):
17796 * xfns.c (image_cache_refcount):
17797 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17798 on typical 64-bit hosts.
17800 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17801 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17802 Omit unnecessary casts to int.
17803 (parse_image_spec): Check that integers fall into 'int' range
17804 when the callers expect that.
17805 (image_ascent): Redo ascent calculation to avoid int overflow.
17806 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17807 (lookup_image): Remove unnecessary tests.
17808 (xbm_image_p): Locals are now of int, not EMACS_INT,
17809 since parse_image_check makes sure they fit into int.
17810 (png_load, gif_load, svg_load_image):
17811 Prefer int to unsigned where either will do.
17812 (tiff_handler): New function, combining the cores of the
17813 old tiff_error_handler and tiff_warning_handler.
17814 This function is rewritten to use vsnprintf and thereby avoid
17815 stack buffer overflows. It uses only the features of vsnprintf
17816 that are common to both POSIX and native Microsoft.
17817 (tiff_error_handler, tiff_warning_handler): Use it.
17818 (tiff_load, gif_load, imagemagick_load_image):
17819 Don't assume :index value fits in 'int'.
17820 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17821 (imagemagick_load_image): Check that crop parameters fit into
17822 the integer types that MagickCropImage accepts. Don't assume
17823 Vimagemagick_render_type has a nonnegative value. Don't assume
17824 size_t fits in 'long'.
17825 (gs_load): Use printmax_t to print the widest integers possible.
17826 Check for integer overflow when computing image height and width.
17828 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17830 * xdisp.c (redisplay_window): Don't force window start if point
17831 will be invisible in the resulting window. (Bug#9324)
17833 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17835 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17836 the display spec is of the form `(space ...)'.
17837 (handle_display_spec): Return the value returned by
17838 handle_single_display_spec, not just 1 or zero.
17839 (handle_single_display_spec): If the display spec is of the form
17840 `(space ...)', and specifies display in the text area, return 2
17842 (try_cursor_movement): Check for the need to scroll more
17843 accurately, and prefer exact match for point under bidi.
17844 Don't advance `row' beyond the last row of the window.
17846 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17847 into disp_prop; all users changed.
17849 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17850 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17851 for the text covered by the display property.
17853 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17855 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17856 Change return value to nil.
17857 (Frecord_buffer): Delete unused function.
17859 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17861 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17862 buffers, return left-to-right.
17863 (set_cursor_from_row): Consider candidate row a win if its glyph
17864 represents a newline and point is on that newline. Fixes cursor
17865 positioning on the newline at EOL of R2L text within L2R
17866 paragraph, and vice versa.
17867 (try_cursor_movement): Check continued rows, in addition to
17868 continuation rows. Fixes unwarranted scroll when point enters a
17869 continued line of R2L text within an L2R paragraph, or vice versa.
17870 (cursor_row_p): Consider the case of point being equal to
17871 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17872 from the end of a short line to the beginning of a continued line
17873 of R2L text within L2R paragraph.
17874 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17875 composed characters.
17877 * bidi.c (bidi_check_type): Use xassert.
17878 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17881 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17883 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17886 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17888 * nsfont.m (ns_otf_to_script): Fix typo.
17890 2011-08-22 Kenichi Handa <handa@m17n.org>
17892 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17893 extra slot even if the purpose is char-code-property-table.
17895 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17897 * xdisp.c (redisplay_window): When computing centering_position,
17898 account for the height of the header line. (Bug#8874)
17900 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17901 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17902 candidate is selected by the mouse, and that candidate has a
17903 composed character under the mouse.
17905 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17906 coordinates reported by pos-visible-in-window-p for a composed
17907 character in column zero.
17909 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17911 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17913 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17915 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17916 consider it a hit if to_charpos is anywhere in the range of the
17917 composed buffer positions.
17919 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17921 * image.c (gif_load): Don't assume that each subimage has the same
17922 dimensions as the base image. Handle disposal method that is
17923 "undefined" by the gif spec (Bug#9335).
17925 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17927 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17928 (Fcondition_case): Document `debug' symbol in error handler.
17930 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17932 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17933 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17934 from an Org mode buffer to a Speedbar frame.
17936 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17937 a composition, take its buffer position from IT->cmp_it.charpos.
17938 Fixes cursor positioning at the beginning of a line that begins
17939 with a composed character.
17941 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17943 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17944 character bidirectional type, use STRONG_L instead. Fixes crashes
17945 in a buffer produced by `describe-categories'.
17947 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17948 members before the level stack, so they would be saved and
17949 restored when copying iterator state. Fixes incorrect reordering
17950 around TABs covered by display properties.
17952 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17954 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17956 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17958 * eval.c (internal_condition_case, internal_condition_case_1)
17959 (internal_condition_case_2, internal_condition_case_n):
17960 Remove unnecessary aborts (Bug#9081).
17962 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17964 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17965 has no `load' handler, try opening the file locally. (Bug#9311)
17967 2011-08-16 Ken Brown <kbrown@cornell.edu>
17969 * gmalloc.c: Expand comment.
17971 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17973 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17974 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17976 2011-08-16 Ken Brown <kbrown@cornell.edu>
17978 Fix memory allocation problems in Cygwin build (Bug#9273).
17980 * unexcw.c (__malloc_initialized): Declare external variable.
17981 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17983 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17985 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17987 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17988 in the static heap.
17989 [CYGWIN] (special_realloc): New function.
17990 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17991 requests to realloc storage in the static heap.
17993 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17995 * bidi.c (bidi_initialize): Remove unused local.
17997 2011-08-15 Eli Zaretskii <eliz@gnu.org>
18000 * biditype.h: Remove file.
18001 * makefile.w32-in ($(BLD)/bidi.$(O)):
18002 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
18004 * dispextern.h: Fix a typo in the comment to bidi_type_t.
18006 * chartab.c: Improve commentary for the uniprop_table API.
18008 * bidi.c (bidi_paragraph_init): Support zero value of
18009 bidi_ignore_explicit_marks_for_paragraph_level.
18010 (bidi_initialize): Use uniprop_table instead of including
18011 biditype.h and bidimirror.h.
18013 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
18014 coordinates of the iterator when restoring from ppos_it.
18017 2011-08-14 Kenichi Handa <handa@m17n.org>
18019 * process.c (create_process): Call setup_process_coding_systems
18020 after the pid of the process is set to -1 (Bug#8162).
18022 2011-08-14 Eli Zaretskii <eliz@gnu.org>
18024 * xdisp.c (move_it_in_display_line_to): Don't invoke
18025 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18026 ppos_it. Fixes vertical cursor motion when line beginning is
18027 covered by an image. (Bug#9296)
18029 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18031 * nsterm.h (ns_run_ascript): Declare.
18032 (NSAPP_DATA2_RUNASSCRIPT): Define.
18034 * nsfns.m (as_script, as_result, as_status): New static variables.
18035 (ns_run_ascript): New function.
18036 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18037 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18038 the event loop. Get status from as_status (Bug#7276).
18040 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18041 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18042 the event loop (Bug#7276).
18044 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18046 * gnutls.c (QCgnutls_bootprop_priority)
18047 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18048 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18049 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18050 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18051 (QCgnutls_bootprop_verify_hostname_error)
18052 (QCgnutls_bootprop_callbacks_verify): Rename from
18053 Qgnutls_bootprop_..., all uses changed.
18055 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18058 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18060 * xfaces.c (Qframe_set_background_mode): Now static.
18061 * dispextern.h (Qframe_set_background_mode): Remove decl.
18063 * process.c (Fnetwork_interface_info): Declare local only if needed.
18065 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18067 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18068 (Fnetwork_interface_list): Allocate in increments of bytes instead
18069 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18070 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18072 (struct ifflag_def): notrailers is smart on OSX.
18073 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18074 Get hardware address with getifaddrs if available.
18076 2011-08-12 Eli Zaretskii <eliz@gnu.org>
18078 * xdisp.c (iterate_out_of_display_property): xassert that
18079 IT->position is set to within IT->object's boundaries. Break from
18080 the loop as soon as EOB is reached; avoids infloops in redisplay
18081 when IT->position is set up wrongly due to some bug.
18082 Set IT->current to match the bidi iterator unconditionally.
18083 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18084 entry. Force push_it to save on the stack the current
18085 buffer/string position, to be restored by pop_it. Fix flags in
18086 the iterator structure wrt the object coming from a display
18087 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18088 properties. (Bug#9284)
18090 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18092 * fontset.c (fontset_get_font_group): Add proper type checks.
18095 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18097 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18098 and LC_VERSION_MIN_MACOSX.
18099 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18100 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18102 2011-08-08 Eli Zaretskii <eliz@gnu.org>
18104 * xdisp.c (forward_to_next_line_start): Allow to use the
18105 no-display-properties-and-no-overlays under bidi display.
18106 Set disp_pos in the bidi iterator to avoid searches for display
18107 properties and overlays.
18109 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
18111 * editfns.c (Fset_time_zone_rule): Document relationship with the
18114 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18115 the font entity extracted from the cache (Bug#8109).
18117 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
18119 * composite.c (autocmp_chars): Don't reset point. That is done by
18120 restore_point_unwind (Bug#5984).
18122 2011-08-07 Juri Linkov <juri@jurta.org>
18124 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18125 to show the arg `TIME' instead of `TIMEVAL'.
18127 2011-08-06 Eli Zaretskii <eliz@gnu.org>
18129 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18130 display property strides EOL and includes a newline, as in
18131 longlines-mode. (Bug#9254)
18132 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18133 word-wrap under bidirectional display. (Bug#9224)
18135 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18136 is non-zero, even if the data buffer is NULL. Fixes a crash in
18137 vertical-motion with longlines-mode. (Bug#9254)
18139 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18141 * bidi.c <bidi_cache_total_alloc>: Now static.
18142 (bidi_initialize): Initialize bidi_cache_total_alloc.
18144 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18147 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18148 amount allocated this far in `bidi_cache_total_alloc'.
18149 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18150 non-zero, only free the data buffer without restoring the cache
18151 contents. All callers changed.
18153 * dispextern.h (bidi_unshelve_cache): Update prototype.
18155 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18156 (move_it_in_display_line, move_it_to)
18157 (move_it_vertically_backward, move_it_by_lines): Replace the call
18158 to xfree to an equivalent call to bidi_unshelve_cache.
18159 (move_it_in_display_line_to): Fix logic of returning
18160 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18162 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18164 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18165 came from a string character with a `cursor' property. (Bug#9229)
18167 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18169 * Makefile.in (LIB_PTHREAD): New variable.
18170 (LIBES): Add LIB_PTHREAD (Bug#9216).
18172 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18173 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18175 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18177 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18179 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18181 * xterm.c (x_find_topmost_parent): New function.
18182 (x_set_frame_alpha): Find topmost parent window with
18183 x_find_topmost_parent and set the property there also (bug#9181).
18184 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18186 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18188 * callproc.c (Fcall_process): Avoid vfork clobbering
18189 the local vars buffer, coding_systems, current_dir.
18191 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18193 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18195 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18197 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18198 so that it is not optimized away.
18200 * xdisp.c (compute_display_string_pos): Remove unused local.
18202 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18204 Fix slow cursor motion and scrolling in large buffers with
18205 selective display, like Org Mode buffers. (Bug#9218)
18207 * dispextern.h (struct bidi_it): New member disp_prop_p.
18209 * xdisp.c: Remove one-slot cache of display string positions.
18210 (compute_display_string_pos): Accept an additional argument
18211 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18212 for a display string or property. If found, set DISP_PROP_P
18215 * bidi.c (bidi_fetch_char): Accept an additional argument
18216 DISP_PROP_P, and pass it to compute_display_string_pos.
18217 Only handle text covered by a display string if DISP_PROP_P is returned
18218 non-zero. All callers of bidi_fetch_char changed.
18220 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18222 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18224 2010-12-03 Don March <don@ohspite.net>
18226 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18227 last character M-[char] is translated to ESC [char] (bug#7541).
18229 2011-08-02 Kenichi Handa <handa@m17n.org>
18231 * lisp.h (uniprop_table): Extern it.
18233 * chartab.c (uniprop_table): Make it non-static.
18235 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18237 * xdisp.c (forward_to_next_line_start): Accept additional argument
18238 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18240 (reseat_at_next_visible_line_start): Use the bidi iterator state
18241 returned by forward_to_next_line_start to restore the state of
18242 it->bidi_it after backing up to previous newline. (Bug#9212)
18244 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18246 * regex.c (re_comp): Protoize.
18247 (re_exec): Fix return type.
18248 (regexec): Fix type of `ret'. (Bug#9203)
18250 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18252 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18253 This is needed if max-image-size is a floating-point number.
18255 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18257 * print.c (print_object): Print empty symbol as ##.
18259 * lread.c (read1): Read ## as empty symbol.
18261 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18263 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18264 setting frame foreground color (Bug#9175).
18265 (x_set_background_color): Likewise.
18267 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18268 contents (Bug#9176).
18269 (EmacsTooltip -init): Remove bezels and add shadows to
18272 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18273 or scroll bar (Bug#8470).
18275 * nsfont.m (nsfont_open): Remove assignment to voffset and
18276 unnecessary vars hshink, expand, hd, full_height, min_height.
18277 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18279 * nsterm.h (nsfont_info): Remove voffset field.
18281 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18283 Implement strike-through and overline on NextStep (Bug#8863).
18285 * nsfont.m (nsfont_open): Use underline position provided by font,
18286 instead of hard-coded value of 2.
18287 (nsfont_draw): Call ns_draw_text_decoration instead.
18289 * nsterm.h: Add declaration for ns_draw_text_decoration.
18291 * nsterm.m (ns_draw_text_decoration): New function for drawing
18292 underline, overline, and strike-through.
18293 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18294 ns_draw_text_decoration. Change treatment of cursor drawing to
18295 accommodate underlining, etc.
18297 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18299 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18302 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18304 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18305 Without this fix, if a signal arrives just after memory fills up,
18306 'malloc' might be invoked reentrantly.
18308 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18309 In other words, assume that every image size is allowed, on non-X
18310 hosts. This assumption is probably wrong, but it lets Emacs compile.
18312 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18314 * regex.c (re_iswctype): Convert return values to boolean.
18316 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18318 * xdisp.c (compute_display_string_pos): Don't use cached display
18319 string position if the buffer had its restriction changed.
18322 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18324 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18326 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18328 Integer signedness and overflow and related fixes. (Bug#9079)
18330 * bidi.c: Integer size and overflow fixes.
18331 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18332 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18333 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18334 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18335 (bidi_find_other_level_edge):
18336 Use ptrdiff_t instead of EMACS_INT where either will do.
18337 This works better on 32-bit hosts configured --with-wide-int.
18338 (bidi_cache_ensure_space): Check for size-calculation overflow.
18339 Use % rather than repeated addition, for better worst-case speed.
18340 Don't set bidi_cache_size until after xrealloc returns, because it
18342 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18343 (bidi_cache_ensure_space): Also check that the bidi cache size
18344 does not exceed that of the largest Lisp string or buffer. See Eli
18345 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18347 * alloc.c (__malloc_size_t): Remove.
18348 All uses replaced by size_t. See Andreas Schwab's note
18349 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18351 * image.c: Improve checking for integer overflow.
18352 (check_image_size): Assume that f is nonnull, since
18353 it is always nonnull in practice. This is one less thing to
18354 worry about when checking for integer overflow later.
18355 (x_check_image_size): New function, which checks for integer
18356 overflow issues inside X.
18357 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18358 This removes the need for a memory_full check.
18359 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18360 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18361 (xbm_read_bitmap_data): Change locals back to 'int', since
18362 their values must fit in 'int'.
18363 (xpm_load_image, png_load, tiff_load):
18364 Invoke x_create_x_image_and_pixmap earlier,
18365 to avoid much needless work if the image is too large.
18366 (tiff_load): Treat overly large images as if
18367 x_create_x_image_and_pixmap failed, not as malloc failures.
18368 (gs_load): Use x_check_image_size.
18370 * gtkutil.c: Omit integer casts.
18371 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18372 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18374 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18376 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18377 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18378 would wrongly return t on a 64-bit host.
18380 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18381 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18382 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18383 and therefore cause GCC to emit a bogus diagnostic in some cases.
18385 * image.c: Integer signedness and overflow and related fixes.
18386 This is not an exhaustive set of fixes, but it's time to
18387 record what I've got.
18388 (lookup_pixel_color, check_image_size): Remove redundant decls.
18389 (check_image_size): Don't assume that arbitrary EMACS_INT values
18390 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18391 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18392 (tiff_load, imagemagick_load_image):
18393 Check for overflow in size calculations.
18394 (x_create_x_image_and_pixmap): Remove unnecessary test for
18395 xmalloc returning NULL; that can't happen.
18396 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18397 (xpm_color_bucket): Use better integer hashing function.
18398 (xpm_cache_color): Don't possibly over-allocate memory.
18399 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18400 (gif_memory_source):
18401 Use ptrdiff_t, not int or size_t, to record sizes.
18402 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18403 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18404 either works, as we prefer signed integers.
18405 (tiff_read_from_memory, tiff_write_from_memory):
18406 Return tsize_t, not size_t, since that's what the TIFF API wants.
18407 (tiff_read_from_memory): Don't fail simply because the read would
18408 go past EOF; instead, return a short read.
18409 (tiff_load): Omit no-longer-needed casts.
18410 (Fimagemagick_types): Don't assume size fits into 'int'.
18412 Improve hashing quality when configured --with-wide-int.
18413 * fns.c (hash_string): New function, taken from sxhash_string.
18414 Do not discard information about ASCII character case; this
18415 discarding is no longer needed.
18416 (sxhash-string): Use it. Change sig to match it. Caller changed.
18417 * lisp.h: Declare it.
18418 * lread.c (hash_string): Remove, since we now use fns.c's version.
18419 The fns.c version returns a wider integer if --with-wide-int is
18420 specified, so this should help the quality of the hashing a bit.
18422 * emacs.c: Integer overflow minor fix.
18423 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18424 Define only if GNU_LINUX.
18425 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18427 * dispnew.c: Integer signedness and overflow fixes.
18428 Remove unnecessary forward decls, that were a maintenance hassle.
18429 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18431 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18432 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18433 (prepare_desired_row, line_draw_cost):
18434 Use int, not unsigned, where either works.
18435 (save_current_matrix, restore_current_matrix):
18436 Use ptrdiff_t, not size_t, where either works.
18437 (init_display): Check for overflow more accurately, and without
18438 relying on undefined behavior.
18440 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18441 Remove, replacing with the new symbols in lisp.h. All uses changed.
18442 * fileio.c (make_temp_name):
18443 * filelock.c (lock_file_1, lock_file):
18444 * xdisp.c (message_dolog):
18445 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18446 Use pMd etc. instead.
18447 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18448 replacing the pWIDE etc. symbols removed from editfns.c.
18450 * keyboard.h (num_input_events): Now uintmax_t.
18451 This is (very slightly) less likely to mess up due to wraparound.
18454 * buffer.c: Integer signedness fixes.
18455 (alloc_buffer_text, enlarge_buffer_text):
18456 Use ptrdiff_t rather than size_t when either will do, as we prefer
18459 * alloc.c: Integer signedness and overflow fixes.
18460 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18461 (__malloc_size_t): Default to size_t, not to int.
18462 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18463 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18464 Prefer ptrdiff_t to size_t when either would do, as we prefer
18466 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18467 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18468 Now const. Initialize with values that are in range even if char
18470 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18471 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18472 These functions do the right thing with sizes > 2**32.
18473 (check_depth): Now ptrdiff_t, not int.
18474 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18475 Adjust to new way of storing sizes. Check for size overflow bugs
18477 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18478 slightly wrong anyway, as it missed one instance of
18479 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18480 (refill_memory_reserve): Omit needless cast to size_t.
18481 (mark_object_loop_halt): Mark as externally visible.
18483 * xselect.c: Integer signedness and overflow fixes.
18484 (Fx_register_dnd_atom, x_handle_dnd_message):
18485 Use ptrdiff_t, not size_t, since we prefer signed.
18486 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18487 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18488 x_dnd_atoms_size and x_dnd_atoms_length.
18490 * doprnt.c: Prefer signed to unsigned when either works.
18492 * doprnt.c (doprnt):
18494 * xdisp.c (vmessage):
18495 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18496 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18497 prefer signed arithmetic to avoid comparison confusion.
18498 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18499 but is a bit tricky.
18501 Assume freestanding C89 headers, string.h, stdlib.h.
18502 * data.c, doprnt.c, floatfns.c, print.c:
18503 Include float.h unconditionally.
18504 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18505 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18506 * regex.c: Likewise for stddef.h, string.h.
18507 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18508 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18509 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18510 (STDC_HEADERS): Remove obsolete defines.
18511 * sysdep.c: Include limits.h unconditionally.
18513 Assume support for memcmp, memcpy, memmove, memset.
18514 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18515 * regex.c (memcmp, memcpy):
18516 Remove; we assume C89 now.
18518 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18519 (__malloc_safe_bcopy): Remove; no longer needed.
18521 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18522 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18523 well either way, and we prefer signed to unsigned.
18525 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18527 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18528 closes the connection while we're reading (bug#9182).
18530 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18532 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18533 are specified (Bug#9168).
18535 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18537 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18538 Found by GCC static checking and --with-wide-int on a 32-bit host.
18540 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18542 * xdisp.c (compute_display_string_pos): Fix logic of caching
18543 previous display string position. Initialize cached_prev_pos to
18544 -1. Fixes slow-down at the beginning of a buffer.
18546 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18548 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18549 for attrs[LFACE_FONTSET_INDEX].
18551 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18553 * xml.c (parse_region): Remove unused local
18554 that was recently introduced.
18556 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18558 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18559 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18561 * xdisp.c (move_it_in_display_line_to): Record the best matching
18562 position for TO_CHARPOS while scanning the line, and restore it on
18563 exit if none of the characters scanned was an exact match.
18564 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18565 when exact match is impossible due to invisible text, and the
18566 lines are truncated.
18568 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18570 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18573 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18575 Fix a significant slow-down of cursor motion with C-n, C-p,
18576 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18577 auto-repeat under bidi redisplay in fontified buffers.
18578 * xdisp.c (compute_stop_pos_backwards): New function.
18579 (next_element_from_buffer): Call compute_stop_pos_backwards to
18580 find a suitable prev_stop when we find ourselves before
18582 (reseat): Don't look for prev_stop, as that could mean a very long
18584 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18585 <cached_disp_overlay_modiff>: Cache for last found display string
18587 (compute_display_string_pos): Return the cached position if asked
18588 about the same buffer in the same area of character positions, and
18589 the buffer wasn't changed since the time the display string
18590 position was cached.
18592 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18594 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18595 is an integer, which is important for empty lines. (Bug#9149)
18597 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18599 * frame.c (Fmodify_frame_parameters): In tty case, update the
18600 default face if necessary (Bug#4238).
18602 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18604 * editfns.c (Fstring_to_char): No need to explain what a character
18605 is in the docstring (Bug#6576).
18607 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18609 * xml.c (parse_region): Make sure we always return a tree.
18611 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18613 * xml.c (parse_region): If a document contains only comments,
18616 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18618 * xml.c (make_dom): Return comments, too.
18620 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18623 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18624 and the surrounding thread.
18625 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18626 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18627 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18629 * s/openbsd.h (BROKEN_SIGIO): Define.
18630 * unexelf.c (unexec) [__OpenBSD__]:
18631 Don't update the .mdebug section of the Alpha COFF symbol table.
18633 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18635 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18638 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18640 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18641 This fixes some race conditions on the permissions of any newly
18644 * alloc.c (valid_pointer_p): Use pipe, not open.
18645 This fixes some permissions issues when debugging.
18647 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18648 If fchown fails to set both uid and gid, try to set just gid,
18649 as that is sometimes allowed. Adjust the file's mode to eliminate
18650 setuid or setgid bits that are inappropriate if fchown fails.
18652 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18654 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18655 to compare Lisp_Objects.
18656 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18657 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18658 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18660 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18662 * lread.c (read_integer): Unread even EOF character.
18663 (read1): Likewise. Properly record start position of symbol.
18665 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18666 symbol character follows.
18668 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18670 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18671 This works around a problem with the previous change to Fcopy_file.
18672 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18673 and without this change, GCC might complain about discarding
18674 fchown's return value.
18676 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18678 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18680 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18682 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18684 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18686 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18687 it's used from the C level.
18689 * process.c: Use the same condition for POLL_FOR_INPUT in both
18690 keyboard.c and process.c (bug#1858).
18692 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18694 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18695 (Fgnutls_boot): Use it.
18697 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18699 * doc.c (Fsubstitute_command_keys): Revert last change.
18701 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18703 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18704 quotes the next character, and doesn't affect other longer
18705 sequences (bug#8935).
18707 * lread.c (syms_of_lread): Clarify that is isn't only
18708 `eval-buffer' and `eval-defun' that's affected by
18709 `lexical-binding' (bug#8460).
18711 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18713 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18714 bidi redisplay when a line includes both an image and is truncated.
18716 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18718 Fix minor problems found by static checking.
18719 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18720 (elsz): Now a signed constant, not a size_t var. We prefer signed
18721 types to unsigned, to avoid integer comparison confusion. Without
18722 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18723 "cannot optimize loop, the loop counter may overflow", a symptom
18725 * indent.c (Fvertical_motion): Mark locals as initialized.
18726 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18728 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18730 * search.c (Fre_search_backward): Mention `case-fold-search' in
18731 all the re_search_* functions (bug#8138).
18733 * keyboard.c (Fopen_dribble_file): Document when the file is
18736 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18738 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18741 Support bidi reordering of display and overlay strings.
18742 * xdisp.c (compute_display_string_pos)
18743 (compute_display_string_end): Accept additional argument STRING.
18744 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18745 (reseat_to_string): Initialize bidi_it->string.s and
18746 bidi_it->string.schars.
18747 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18748 NULL (avoids a crash in bidi_paragraph_init).
18749 Initialize itb.string.lstring.
18750 (init_iterator): Call bidi_init_it only of a valid
18751 buffer position was specified. Initialize paragraph_embedding to
18753 (reseat_to_string): Initialize the bidi iterator.
18754 (display_string): If we need to ignore text properties of
18755 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18756 original value of -1 will not work with bidi.)
18757 (compute_display_string_pos): First arg is now struct
18758 `text_pos *'; all callers changed. Support display properties on
18760 (compute_display_string_end): Support display properties on Lisp
18762 (init_iterator, reseat_1, reseat_to_string): Initialize the
18763 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18764 when iterating on a string not from display properties).
18765 (compute_display_string_pos, compute_display_string_end):
18766 Fix calculation of the object to scan. Fixes an error when using
18768 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18769 base_level_stop; instead, set base_level_stop to BEGV.
18770 Fixes crashes in vertical-motion.
18771 (next_element_from_buffer): Improve commentary for when
18772 the iterator is before prev_stop.
18773 (init_iterator): Initialize bidi_p from the default value of
18774 bidi-display-reordering, not from buffer-local value. Use the
18775 buffer-local value only if initializing for buffer iteration.
18776 (handle_invisible_prop): Support invisible properties on strings
18777 that are being bidi-reordered.
18778 (set_iterator_to_next): Support bidi reordering of C strings and
18780 (next_element_from_string): Support bidi reordering of Lisp
18782 (handle_stop_backwards): Support Lisp strings as well.
18783 (display_string): Support display of R2L glyph rows.
18784 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18785 (init_iterator): Don't initialize it->bidi_p for strings
18787 (reseat_to_string): Initialize it->bidi_p for strings here.
18788 (next_element_from_string, next_element_from_c_string)
18789 (next_element_from_buffer): Add xassert's for correspondence
18790 between IT's object being iterated and it->bidi_it.string
18792 (face_before_or_after_it_pos): Support bidi iteration.
18793 (next_element_from_c_string): Handle the case of the first string
18794 character that is not the first one in the visual order.
18795 (get_visually_first_element): New function, refactored from common
18796 parts of next_element_from_buffer, next_element_from_string, and
18797 next_element_from_c_string.
18798 (tool_bar_lines_needed, redisplay_tool_bar)
18799 (display_menu_bar): Force left-to-right direction. Add a FIXME
18800 comment for making that be controlled by a user option.
18801 (push_it, pop_it): Save and restore the state of the
18802 bidi iterator. Save and restore the bidi_p flag.
18803 (pop_it): Iterate out of display property for string iteration as
18805 (iterate_out_of_display_property): Support iteration over strings.
18806 (handle_single_display_spec): Set up it->bidi_it for iteration
18807 over a display string, and call bidi_init_it.
18808 (handle_single_display_spec, next_overlay_string)
18809 (get_overlay_strings_1, push_display_prop): Set up the bidi
18810 iterator for displaying display or overlay strings.
18811 (forward_to_next_line_start): Don't use the shortcut if
18813 (back_to_previous_visible_line_start): If handle_display_prop
18814 pushed the iterator stack, restore the internal state of the bidi
18815 iterator by calling bidi_pop_it same number of times.
18816 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18817 and we are bidi-iterating, don't decrement the iterator position;
18818 instead, set the first_elt flag in the bidi iterator, to produce
18820 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18821 (push_display_prop): xassert that we are iterating a buffer.
18822 (push_it, pop_it): Save and restore paragraph_embedding member.
18823 (handle_single_display_spec, next_overlay_string)
18824 (get_overlay_strings_1, reseat_1, reseat_to_string)
18825 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18826 correctly. Don't assume unibyte strings are not bidi-reordered.
18827 (compute_display_string_pos)
18828 (compute_display_string_end): Fix handling the case of C string.
18829 (push_it, pop_it): Save and restore from_disp_prop_p.
18830 (handle_single_display_spec, push_display_prop): Set the
18831 from_disp_prop_p flag.
18832 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18833 (pop_it): Call iterate_out_of_display_property only if we are
18834 popping after iteration over a string that came from a display
18835 property. Fix a typo in popping stretch info. Add an assertion
18836 for verifying that the iterator position is in sync with the bidi
18838 (handle_single_display_spec, get_overlay_strings_1)
18839 (push_display_prop): Fix initialization of paragraph direction for
18840 string when that of the parent object is not yet determined.
18841 (reseat_1): Call bidi_init_it to resync the bidi
18842 iterator with IT's position. (Bug#7616)
18843 (find_row_edges): If ROW->start.pos gives position
18844 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18845 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18846 Reset the from_disp_prop_p flag.
18847 (SAVE_IT, RESTORE_IT): New macros.
18848 (pos_visible_p, face_before_or_after_it_pos)
18849 (back_to_previous_visible_line_start)
18850 (move_it_in_display_line_to, move_it_in_display_line)
18851 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18852 (try_scrolling, redisplay_window, display_line): Use them when
18853 saving a temporary copy of the iterator and restoring it back.
18854 (back_to_previous_visible_line_start, reseat_1)
18855 (init_iterator): Empty the bidi cache "stack".
18856 (move_it_in_display_line_to): If iterator ended up at
18857 EOL, but we never saw any buffer positions smaller than
18858 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18859 motion in bidi-reordered lines.
18860 (move_it_in_display_line_to): Record prev_method and prev_pos
18861 immediately before the call to set_iterator_to_next. Fixes cursor
18862 motion in bidi-reordered lines with stretch glyphs and strings
18863 displayed in margins. (Bug#8133) (Bug#8867)
18864 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18866 (pos_visible_p): Support positions in bidi-reordered lines.
18867 Save and restore bidi cache.
18869 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18870 (bidi_paragraph_info): Delete unused struct.
18871 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18872 (bidi_cache_start): New variable.
18873 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18875 (bidi_cache_fetch_state, bidi_cache_search)
18876 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18877 (bidi_cache_find, bidi_peek_at_next_level)
18878 (bidi_level_of_next_char, bidi_find_other_level_edge)
18879 (bidi_move_to_visually_next): Compare cache index with
18880 bidi_cache_start rather than with zero.
18881 (bidi_fetch_char): Accept new argument STRING; all callers
18882 changed. Support iteration over a string. Support strings with
18883 display properties. Support unibyte strings. Fix the type of
18884 `len' according to what STRING_CHAR_AND_LENGTH expects.
18885 (bidi_paragraph_init, bidi_resolve_explicit_1)
18886 (bidi_resolve_explicit, bidi_resolve_weak)
18887 (bidi_level_of_next_char, bidi_move_to_visually_next):
18888 Support iteration over a string.
18889 (bidi_set_sor_type, bidi_resolve_explicit_1)
18890 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18891 can now be zero (for strings); special values 0 and -1 were
18892 changed to -1 and -2, respectively.
18893 (bidi_char_at_pos): New function.
18894 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18895 Call it instead of FETCH_MULTIBYTE_CHAR.
18896 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18897 initialized to valid values.
18898 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18900 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18901 the test for valid cached positions. Fix the logic for looking up
18902 the sentinel state in the cache. GCPRO the Lisp string we are
18904 (bidi_push_it, bidi_pop_it): New functions.
18905 (bidi_initialize): Initialize the bidi cache start stack pointer.
18906 (bidi_cache_ensure_space): New function, refactored from part of
18907 bidi_cache_iterator_state. Don't assume the required size is just
18908 one BIDI_CACHE_CHUNK away.
18909 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18910 (bidi_count_bytes, bidi_char_at_pos): New functions.
18911 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18912 always valid if bidi_cache_idx is valid.
18913 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18914 is valid if it's going to be used.
18915 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18916 (bidi_cache_fetch_state, bidi_cache_search)
18917 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18918 (bidi_cache_iterator_state, bidi_cache_find)
18919 (bidi_find_other_level_edge, bidi_cache_start_stack):
18920 All variables related to cache indices are now EMACS_INT.
18922 * dispextern.h (struct bidi_string_data): New structure.
18923 (struct bidi_it): New member `string'. Make flag members be 1-bit
18924 fields, and put them last in the struct.
18925 (compute_display_string_pos, compute_display_string_end):
18927 (bidi_push_it, bidi_pop_it): Add prototypes.
18928 (struct iterator_stack_entry): New members bidi_p,
18929 paragraph_embedding, and from_disp_prop_p.
18930 (struct it): Member bidi_p is now a bit field 1 bit wide.
18931 (bidi_shelve_cache, bidi_unshelve_cache):
18932 Declare prototypes.
18934 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18935 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18936 and vector-like objects.
18938 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18939 cache around display iteration.
18941 * window.c (Fwindow_end, window_scroll_pixel_based)
18942 (displayed_window_lines, Frecenter): Save and restore the bidi
18943 cache around display iteration.
18945 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18947 * editfns.c (Fdelete_region): Clarify the use of the named
18948 parameters (bug#6788).
18950 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18952 * indent.c (Fvertical_motion): Set and restore w->pointm when
18953 saving and restoring the window's buffer (Bug#9006).
18955 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18957 * editfns.c (Fstring_to_char): Clarify just what is returned
18958 (bug#6576). Text by Eli Zaretskii.
18960 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18962 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18964 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18966 * buffer.c (mmap_find): Fix a typo.
18968 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18970 Fix execution of x selection hooks.
18971 * xselect.c (Qx_lost_selection_functions)
18972 (Qx_sent_selection_functions): New vars.
18973 (syms_of_xselect): DEFSYM them.
18974 (x_handle_selection_request): Pass Qx_sent_selection_functions
18975 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18976 (x_handle_selection_clear,x_clear_frame_selections):
18977 Pass Qx_lost_selection_functions rather than
18978 Vx_lost_selection_functions to Frun_hook_with_args.
18980 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18982 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18983 The old code sometimes used this field without initializing it.
18985 * alloc.c (gc_sweep): Don't read past end of array.
18986 In theory, the old code could also have corrupted Emacs internals,
18987 though it'd be very unlikely.
18989 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18991 * character.c (Fcharacterp): Don't advertise optional ignored
18992 argument. (Bug#4026)
18994 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18996 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18999 * window.c (Fset_window_start): Doc fix (bug#4199).
19000 (Fset_window_hscroll): Ditto.
19002 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
19004 Fix minor new problems caught by GCC 4.6.1.
19005 * term.c (init_tty): Remove unused local.
19006 * xsettings.c (store_monospaced_changed): Define this function only
19007 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
19008 not used otherwise.
19010 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
19012 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
19014 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
19016 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
19017 are the mini-buffer and the echo area (bug#3320).
19019 * term.c (init_tty): Remove support for supdup, c10 and perq
19020 terminals, which are no longer supported (bug#1482).
19022 2011-07-10 Johan Bockgård <bojohan@gnu.org>
19024 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19026 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19028 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19029 for non-popups (Bug#3642).
19031 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19033 * alloc.c (reset_malloc_hooks): Protoize.
19034 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19035 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19036 * cm.c (losecursor): Likewise.
19037 * data.c (fmod): Likewise.
19038 * dispnew.c (swap_glyphs_in_rows): Likewise.
19039 * emacs.c (memory_warning_signal): Likewise.
19040 * floatfns.c (float_error): Likewise.
19041 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19042 (otf_open, font_otf_capability, generate_otf_features)
19043 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19045 * image.c (pbm_read_file): Likewise.
19046 * indent.c (string_display_width): Likewise.
19047 * intervals.c (check_for_interval, search_for_interval)
19048 (inc_interval_count, count_intervals, root_interval)
19049 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19050 * lread.c (defalias): Likewise.
19051 * ralloc.c (r_alloc_check): Likewise.
19052 * regex.c (set_image_of_range_1, set_image_of_range)
19053 (regex_grow_registers): Likewise.
19054 * sysdep.c (strerror): Likewise.
19055 * termcap.c (valid_filename_p, tprint, main): Likewise.
19056 * tparam.c (main): Likewise.
19057 * unexhp9k800.c (run_time_remap, save_data_space)
19058 (update_file_ptrs, read_header, write_header, calculate_checksum)
19059 (copy_file, copy_rest, display_header): Likewise.
19060 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19062 * xdisp.c (check_it): Likewise.
19063 * xfaces.c (register_color, unregister_color, unregister_colors):
19065 * xfns.c (print_fontset_result): Likewise.
19066 * xrdb.c (member, fatal, main): Likewise.
19068 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19070 Fix minor problems found by static checking (Bug#9031).
19071 * chartab.c (char_table_set_range, map_sub_char_table):
19072 Remove unused locals.
19073 (uniprop_table): Now static.
19074 * composite.c (_work_char): Remove unused static var.
19076 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
19078 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19080 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19082 * gtkutil.c (qttip_cb): Remove code without function.
19084 2011-07-09 Eli Zaretskii <eliz@gnu.org>
19086 * w32.c (pthread_sigmask): New stub.
19088 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19090 Use pthread_sigmask, not sigprocmask (Bug#9010).
19091 sigprocmask is portable only for single-threaded applications, and
19092 Emacs can be multi-threaded when it uses GTK.
19093 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19095 * callproc.c (Fcall_process):
19096 * process.c (create_process):
19097 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19098 Use pthread_sigmask, not sigprocmask.
19100 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19102 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19103 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19106 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19108 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19109 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19110 (xg_hide_tooltip): Fix comment.
19112 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19113 in registerServicesMenuSendTypes.
19114 (validRequestorForSendType): Don't check ns_return_types.
19116 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19119 2011-07-08 Jason Rumney <jasonr@gnu.org>
19121 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19122 SH_SHOW for hidden windows (Bug#5482).
19124 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19125 frame struct members of non-existent frames (Bug#6284).
19127 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19129 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19130 variable firstTime not needed on OSX >= 10.6.
19131 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19132 >= 10.5. Use setKnobProportion, setDoubleValue.
19134 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19135 (MAC_OS_X_VERSION_10_5): Define if not defined.
19136 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19137 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19138 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19140 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19141 cString and lossyCString on OSX >= 10.4.
19143 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19144 sizeToFit on OSX >= 10.2.
19146 * nsimage.m (allocInitFromFile): Don't use deprecated method
19147 bestRepresentationForDevice on OSX >= 10.6.
19149 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19152 * emacs.c: Declare unexec_init_emacs_zone.
19154 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19156 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19158 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19159 on svcsMenu (Bug#8842).
19161 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19163 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19165 * nsterm.m (QUTF8_STRING): Declare.
19166 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19167 (validRequestorForSendType): Return type is (id).
19168 Change indexOfObjectIdenticalTo to indexOfObject.
19169 Check if we have local selection before returning self (Bug#8842).
19170 (writeSelectionToPasteboard): Put local selection into paste board
19171 if we have a local selection (Bug#8842).
19172 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19174 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19175 (ns_get_local_selection): Declare.
19177 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19179 * keymap.c (describe_map_tree): Don't insert a double newline at
19180 the end of the buffer (bug#1169) and return whether we inserted
19183 * callint.c (Fcall_interactively): Change "reading args" to
19184 "providing args" to try to clarify what it does (bug#1010).
19186 2011-07-07 Kenichi Handa <handa@m17n.org>
19188 * composite.c (composition_compute_stop_pos): Ignore a static
19189 composition starting before CHARPOS (Bug#8915).
19191 * xdisp.c (handle_composition_prop): Likewise.
19193 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19195 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19198 2011-07-07 Kenichi Handa <handa@m17n.org>
19200 * character.h (unicode_category_t): New enum type.
19202 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19203 (Qchar_code_property_table): New variable.
19204 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19205 (UNIPROP_COMPRESSED_FORM_P): New macros.
19206 (char_table_ascii): Uncompress the compressed values.
19207 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19208 Uncompress the compressed values.
19209 (sub_char_table_ref_and_range): Likewise.
19210 (char_table_ref_and_range): Uncompress the compressed values.
19211 (sub_char_table_set): New arg is_uniprop. Callers changed.
19212 Uncompress the compressed values.
19213 (sub_char_table_set_range): Args changed. Callers changed.
19214 (char_table_set_range): Adjuted for the above change.
19215 (map_sub_char_table): Delete args default_val and parent. Add arg
19216 top. Give decoded values to a Lisp function.
19217 (map_char_table): Adjust for the above change. Give decoded
19218 values to a Lisp function. Gcpro more variables.
19219 (uniprop_table_uncompress)
19220 (uniprop_decode_value_run_length): New functions.
19221 (uniprop_decoder, uniprop_decoder_count): New variables.
19222 (uniprop_get_decoder, uniprop_encode_value_character)
19223 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19225 (uniprop_encoder, uniprop_encoder_count): New variables.
19226 (uniprop_get_encoder, uniprop_table)
19227 (Funicode_property_table_internal, Fget_unicode_property_internal)
19228 (Fput_unicode_property_internal): New functions.
19229 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19230 Sunicode_property_table_internal, Sget_unicode_property_internal,
19231 and Sput_unicode_property_internal. Defvar_lisp
19232 char-code-property-alist.
19234 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19235 Vunicode_category_table.
19237 * font.c (font_range): Adjust for the change of
19238 Vunicode_category_table.
19240 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19242 * m/iris4d.h: Remove file, move contents ...
19243 * s/irix6-5.h: ... here.
19245 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19247 Remove unportable assumption about struct layout (Bug#8884).
19248 * alloc.c (mark_buffer):
19249 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19250 (clone_per_buffer_values): Don't assume that
19251 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19252 This isn't true in general, and it's particularly not true
19253 if Emacs is configured with --with-wide-int.
19254 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19255 New macros, used in the buffer.c change.
19257 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19259 * xsettings.c: Use both GConf and GSettings if both are available.
19260 (store_config_changed_event): Add comment.
19261 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19262 (store_tool_bar_style_changed): New functions.
19263 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19264 (struct xsettings): Move font inside HAVE_XFT.
19265 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19266 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19267 Move inside HAVE_XFT.
19268 (something_changed_gsettingsCB): Rename from something_changedCB.
19269 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19271 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19272 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19273 (something_changed_gconfCB): Rename from something_changedCB.
19274 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19275 (parse_settings): Move check for font inside HAVE_XFT.
19276 (read_settings, apply_xft_settings): Add comment.
19277 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19278 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19279 call store_font_name_changed.
19280 (xft_settings_event): Add comment.
19281 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19282 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19283 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19284 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19285 (xsettings_initialize): Call init_gsettings last.
19286 (xsettings_get_system_font, xsettings_get_system_normal_font):
19289 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19291 Random fixes. E.g., (random) never returned negative values.
19292 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19293 subseconds part to the entropy, as that's a bit more random.
19294 Prefer signed to unsigned, since the signedness doesn't matter and
19295 in general we prefer signed. When given a limit, use a
19296 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19297 latter isn't right if USE_2_TAGS_FOR_INTS.
19298 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19299 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19301 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19303 * textprop.c (text_property_stickiness):
19304 Obey Vtext_property_default_nonsticky.
19305 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19306 * w32fns.c (syms_of_w32fns):
19307 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19309 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19311 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19312 This is more efficient than Ffile_directory_p and avoids a minor race.
19314 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19316 * buffer.c (Foverlay_put): Say what the return value is
19319 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19320 is a directory before asking whether to use the file name
19322 (barf_or_query_if_file_exists): Make the "File is a directory"
19323 error be more correct.
19325 * fns.c (Frequire): Remove the mention of the .gz files, since
19326 that's installation-specific, but keep the mention of
19327 `get-load-suffixes'.
19329 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19331 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19332 Report string overflow if the output is too long.
19334 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19336 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19337 (syms_of_gnutls): Remove duplicate DEFSYM for
19338 Qgnutls_bootprop_verify_hostname_error, an error for
19339 Qgnutls_bootprop_verify_error (which is no longer used).
19341 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19342 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19343 Also (re)move comments that are misplaced or no longer relevant.
19345 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19347 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19349 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19351 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19352 and background color parameters if they have been changed.
19354 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19356 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19358 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19360 * xsettings.c (SYSTEM_FONT): Define only when used.
19361 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19363 * keymap.c (access_keymap_1): Now static.
19365 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19367 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19368 leave any prefix arg for the up event (Bug#1586).
19370 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19372 * lread.c (syms_of_lread): Mention single symbols defined by
19373 `defvar' or `defconst' (bug#7154).
19375 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19376 (Frequire): Mention get-load-suffixes.
19378 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19380 * window.h (window): Remove clone_number slot.
19381 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19383 (make_parent_window, make_window, saved_window)
19384 (Fset_window_configuration, save_window_save): Don't deal with
19386 * buffer.c (Qclone_number): Remove declaration.
19387 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19389 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19391 Add multiple inheritance to keymaps.
19392 * keymap.c (Fmake_composed_keymap): New function.
19393 (Fset_keymap_parent): Simplify.
19394 (fix_submap_inheritance): Remove.
19395 (access_keymap_1): New function extracted from access_keymap to handle
19396 embedded parents and handle lists of maps.
19397 (access_keymap): Use it.
19398 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19399 (Fcopy_keymap): Handle embedded parents.
19400 (Fcommand_remapping, define_as_prefix): Simplify.
19401 (Fkey_binding): Simplify.
19402 (syms_of_keymap): Move minibuffer-local-completion-map,
19403 minibuffer-local-filename-completion-map,
19404 minibuffer-local-must-match-map, and
19405 minibuffer-local-filename-must-match-map to Elisp.
19406 (syms_of_keymap): Defsubr make-composed-keymap.
19407 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19408 (parse_menu_item): Trivial simplification.
19410 2011-07-01 Glenn Morris <rgm@gnu.org>
19412 * Makefile.in (SETTINGS_LIBS): Fix typo.
19414 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19416 * coding.c (Fencode_coding_string): Record the last coding system
19417 used, as the function doc string says (bug#8738).
19419 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19421 * xsettings.c (store_monospaced_changed): Take new font as arg and
19422 check for change against current_mono_font.
19423 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19424 (emacs_settings_constructor, emacs_settings_get_property)
19425 (emacs_settings_set_property, emacs_settings_class_init)
19426 (emacs_settings_init, gsettings_obj): Remove.
19427 (something_changedCB): New function for HAVE_GSETTINGS.
19428 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19429 with value as argument.
19430 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19431 g_settings_new (Bug#8967). Do not create gsettings_obj.
19432 Remove calls to g_settings_bind. Connect something_changedCB to
19435 * xgselect.c: Add defined (HAVE_GSETTINGS).
19436 (xgselect_initialize): Ditto.
19438 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19439 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19442 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19444 * eval.c (struct backtrace): Simplify and port the data structure.
19445 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19446 signed bit field, as this assumption is not portable and it makes
19447 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19448 "char debug_on_exit : 1" as this is not portable either; instead,
19449 use the portable "unsigned int debug_on_exit : 1". Remove unused
19450 member evalargs. Remove obsolete comments about cc bombing out.
19452 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19454 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19455 Let HAVE_GSETTINGS override HAVE_GCONF.
19456 (store_monospaced_changed): New function.
19457 (EMACS_SETTINGS): A new type derived from GObject to handle
19458 GSettings notifications.
19459 (emacs_settings_constructor, emacs_settings_get_property)
19460 (emacs_settings_set_property, emacs_settings_class_init):
19462 (gsettings_client, gsettings_obj): New variables.
19463 (GSETTINGS_SCHEMA): New define.
19464 (something_changedCB): Call store_monospaced_changed.
19465 (init_gsettings): New function.
19466 (xsettings_initialize): Call init_gsettings.
19467 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19470 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19473 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19475 * window.c (resize_root_window, grow_mini_window)
19476 (shrink_mini_window): Rename Qresize_root_window to
19477 Qwindow_resize_root_window and Qresize_root_window_vertically to
19478 Qwindow_resize_root_window_vertically.
19480 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19482 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19484 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19486 * makefile.w32-in: Redesign dependencies so they reflect more
19487 clearly which files are directly included by each source file,
19488 and not through other includes.
19490 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19492 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19493 (sort_overlays, overlay_strings): When an overlay's clone number
19494 matches the window's clone number process the overlay even if
19495 the overlay's window property doesn't match the current window.
19497 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19498 (Fwindow_hchild): Rename to Fwindow_left_child.
19499 (Fwindow_next): Rename to Fwindow_next_sibling.
19500 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19501 (resize_window_check): Rename to window_resize_check.
19502 (resize_window_apply): Rename to window_resize_apply.
19503 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19504 (Fdelete_other_windows_internal, resize_frame_windows)
19505 (Fsplit_window_internal, Fdelete_window_internal)
19506 (grow_mini_window, shrink_mini_window)
19507 (Fresize_mini_window_internal): Fix callers accordingly.
19509 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19511 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19512 (emacs_fixed_set_min_size): Remove.
19513 (emacs_fixed_new): Take frame as argument.
19515 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19516 (_EmacsFixedPrivate): Remove minwidth/height.
19517 Add struct frame *f.
19518 (emacs_fixed_init): Initialize priv->f.
19519 (get_parent_class, emacs_fixed_set_min_size): Remove.
19520 (emacs_fixed_new): Set priv->f to argument.
19521 (emacs_fixed_get_preferred_width)
19522 (emacs_fixed_get_preferred_height): Use min_width/height from
19523 frames size_hint to set minimum and natural (Bug#8919).
19524 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19525 and use min_width/height from frames size_hint to set
19526 min_width/height (Bug#8919).
19528 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19529 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19532 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19534 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19535 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19538 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19540 * process.c (wait_reading_process_output): Bypass select if
19541 waiting for a cell while ignoring keyboard input, and input is
19542 pending. Suggested by Jan Djärv (Bug#8869).
19544 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19546 Use gnulib's dup2 module instead of rolling our own.
19547 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19549 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19551 * dispnew.c (scrolling_window): Before scrolling, turn off a
19552 mouse-highlight in the window being scrolled.
19554 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19556 Move DEFSYM to lisp.h and use everywhere.
19558 * character.h (DEFSYM): Move declaration...
19559 * lisp.h (DEFSYM): ...here.
19565 * w32select.c: Don't include character.h.
19567 * alloc.c (syms_of_alloc):
19568 * buffer.c (syms_of_buffer):
19569 * bytecode.c (syms_of_bytecode):
19570 * callint.c (syms_of_callint):
19571 * casefiddle.c (syms_of_casefiddle):
19572 * casetab.c (init_casetab_once):
19573 * category.c (init_category_once, syms_of_category):
19574 * ccl.c (syms_of_ccl):
19575 * cmds.c (syms_of_cmds):
19576 * composite.c (syms_of_composite):
19577 * dbusbind.c (syms_of_dbusbind):
19578 * dired.c (syms_of_dired):
19579 * dispnew.c (syms_of_display):
19580 * doc.c (syms_of_doc):
19581 * editfns.c (syms_of_editfns):
19582 * emacs.c (syms_of_emacs):
19583 * eval.c (syms_of_eval):
19584 * fileio.c (syms_of_fileio):
19585 * fns.c (syms_of_fns):
19586 * frame.c (syms_of_frame):
19587 * fringe.c (syms_of_fringe):
19588 * insdel.c (syms_of_insdel):
19589 * keymap.c (syms_of_keymap):
19590 * lread.c (init_obarray, syms_of_lread):
19591 * macros.c (syms_of_macros):
19592 * msdos.c (syms_of_msdos):
19593 * print.c (syms_of_print):
19594 * process.c (syms_of_process):
19595 * search.c (syms_of_search):
19596 * sound.c (syms_of_sound):
19597 * syntax.c (init_syntax_once, syms_of_syntax):
19598 * terminal.c (syms_of_terminal):
19599 * textprop.c (syms_of_textprop):
19600 * undo.c (syms_of_undo):
19601 * w32.c (globals_of_w32):
19602 * window.c (syms_of_window):
19603 * xdisp.c (syms_of_xdisp):
19604 * xfaces.c (syms_of_xfaces):
19605 * xfns.c (syms_of_xfns):
19606 * xmenu.c (syms_of_xmenu):
19607 * xsettings.c (syms_of_xsettings):
19608 * xterm.c (syms_of_xterm): Use DEFSYM.
19610 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19612 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19614 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19616 Integer and buffer overflow fixes (Bug#8873).
19618 * print.c (printchar, strout): Check for string overflow.
19619 (PRINTPREPARE, printchar, strout):
19620 Don't set size unless allocation succeeds.
19622 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19623 for sizes. Check for string overflow more accurately.
19624 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19626 * macros.c: Integer and buffer overflow fixes.
19627 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19628 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19629 Use ptrdiff_t, not int, for sizes.
19630 Don't increment bufsize until after realloc succeeds.
19631 Check for size-calculation overflow.
19632 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19634 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19636 * lread.c: Integer overflow fixes.
19637 (read_integer): Radix is now EMACS_INT, not int,
19638 to improve quality of diagnostics for out-of-range radices.
19639 Calculate buffer size correctly for out-of-range radices.
19640 (read1): Check for integer overflow in radices, and in
19641 read-circle numbers.
19642 (read_escape): Avoid int overflow.
19643 (Fload, openp, read_buffer_size, read1)
19644 (substitute_object_recurse, read_vector, read_list, map_obarray):
19645 Use ptrdiff_t, not int, for sizes.
19646 (read1): Use EMACS_INT, not int, for sizes.
19647 Check for size overflow.
19649 * image.c (cache_image): Check for size arithmetic overflow.
19651 * lread.c: Integer overflow issues.
19652 (saved_doc_string_size, saved_doc_string_length)
19653 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19654 Now ptrdiff_t, not int.
19655 (read1): Don't assume doc string length fits in int. Check for
19656 out-of-range doc string lengths.
19657 (read_list): Don't assume file position fits in int.
19658 (read_escape): Check for hex character overflow.
19660 2011-06-22 Leo Liu <sdl.web@gmail.com>
19662 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19663 Move to minibuffer.el.
19665 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19667 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19668 The following patches are for when GLYPH_DEBUG && !XASSERT.
19669 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19670 * dispnew.c (flush_stdout):
19671 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19672 Mark as externally visible.
19673 * dispnew.c (check_window_matrix_pointers): Now static.
19674 * dispnew.c (window_to_frame_vpos):
19675 * xfns.c (unwind_create_frame):
19676 * xterm.c (x_check_font): Remove unused local.
19677 * scroll.c (CHECK_BOUNDS):
19678 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19679 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19680 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19681 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19682 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19684 (debug_method_add): Use va_list and vsprintf rather than relying
19685 on undefined behavior with wrong number of arguments.
19686 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19687 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19688 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19689 since we're not interested in debugging glyphs with old libraries.
19690 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19691 GCC 4.6.0's static checking.
19693 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19695 Integer overflow and signedness fixes (Bug#8873).
19696 A few related buffer overrun fixes, too.
19698 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19700 * dispextern.h (struct face.stipple):
19701 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19702 (x_bitmap_mask, x_allocate_bitmap_record)
19703 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19704 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19705 (x_create_bitmap_from_xpm_data):
19706 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19707 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19709 * xfaces.c (load_pixmap):
19710 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19711 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19712 (.bitmaps_last, struct x_output.icon_bitmap):
19713 Use ptrdiff_t, not int, for bitmap indexes.
19714 (x_allocate_bitmap_record): Check for size overflow.
19715 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19717 Use ptrdiff_t, not int, for overlay counts.
19718 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19719 * editfns.c (overlays_around, get_pos_property):
19720 * textprop.c (get_char_property_and_overlay):
19721 * xdisp.c (next_overlay_change, note_mouse_highlight):
19722 * xfaces.c (face_at_buffer_position):
19723 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19724 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19725 (Fnext_overlay_change, Fprevious_overlay_change)
19726 (mouse_face_overlay_overlaps, Foverlays_in):
19727 Use ptrdiff_t, not int, for sizes.
19728 (overlays_at, overlays_in): Check for size-calculation overflow.
19730 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19732 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19733 (x_session_initialize): Do not assume string length fits in int.
19735 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19736 This is unlikely, but can occur if DPI is outlandish.
19738 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19739 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19741 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19742 * xrdb.c (magic_file_p, search_magic_path):
19743 Omit last arg SUFFIX; it was always 0. All callers changed.
19744 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19746 * xfont.c (xfont_match): Avoid need for strlen.
19748 * xfns.c: Don't assume strlen fits in int.
19749 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19751 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19752 not unsigned long, as we prefer signed integers. All callers changed.
19753 Detect integer overflow in repeat count.
19754 (message_dolog): Don't assume print length fits in 39 bytes.
19755 (display_mode_element): Don't assume strlen fits in int.
19757 * termcap.c: Don't assume sizes fit in int and never overflow.
19758 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19759 (gobble_line): Check for size-calculation overflow.
19761 * minibuf.c (Fread_buffer):
19762 * lread.c (intern, intern_c_string):
19763 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19764 Don't assume string length fits in int.
19766 * keyboard.c (parse_tool_bar_item):
19767 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19769 * font.c: Don't assume string length fits in int.
19770 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19771 Use ptrdiff_t, not int.
19772 (font_intern_prop): Don't assume string length fits in int.
19773 Don't assume integer property fits in fixnum.
19774 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19776 * filelock.c: Fix some buffer overrun and integer overflow issues.
19777 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19778 Reformulate so as not to need the command string.
19779 Invoke gzip -cd rather than gunzip, as it's more portable.
19780 (lock_info_type, lock_file_1, lock_file):
19781 Don't assume pid_t and time_t fit in unsigned long.
19782 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19783 (current_lock_owner): Prefer signed type for sizes.
19784 Use memcpy, not strncpy, where memcpy is what is really wanted.
19785 Don't assume (via atoi) that time_t and pid_t fit in int.
19786 Check for time_t and/or pid_t out of range, e.g., via a network share.
19787 Don't alloca where an auto var works fine.
19789 * fileio.c: Fix some integer overflow issues.
19790 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19791 Don't assume string length fits in int.
19792 (directory_file_name): Don't assume string length fits in long.
19793 (make_temp_name): Don't assume pid fits in int, or that its print
19794 length is less than 20.
19796 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19798 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19800 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19802 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19803 We prefer signed integers, even for size calculations.
19805 * emacs.c: Don't assume string length fits in 'int'.
19806 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19807 (main): Don't invoke strlen when not needed.
19809 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19810 (XD_DEBUG_MESSAGE): Don't waste a byte.
19812 * callproc.c (getenv_internal_1, getenv_internal)
19813 (Fgetenv_internal):
19814 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19816 * lread.c (invalid_syntax): Omit length argument.
19817 All uses changed. This doesn't fix a bug, but it simplifies the
19818 code away from its former Hollerith-constant appearance, and it's
19819 one less 'int' to worry about when looking at integer-overflow issues.
19820 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19822 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19823 This didn't break anything, but it didn't help either.
19824 It's confusing to put a bogus integer in a place where the actual
19825 value does not matter.
19826 (LIST_END_P): Remove unused macro and its bogus comment.
19827 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19829 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19830 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19832 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19833 We prefer signed types, and the value cannot exceed the EMACS_INT
19834 range anyway (because otherwise the length would not be representable).
19835 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19836 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19837 This avoids a GCC warning when WIDE_EMACS_INT.
19839 * indent.c (sane_tab_width): New function.
19840 (current_column, scan_for_column, Findent_to, position_indentation)
19841 (compute_motion): Use it. This is just for clarity.
19842 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19844 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19846 * lisp.h (lint_assume): New macro.
19847 * composite.c (composition_gstring_put_cache):
19848 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19850 * editfns.c, insdel.c:
19851 Omit unnecessary forward decls, to simplify future changes.
19853 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19855 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19857 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19858 Use much-faster test for byte-length change.
19859 Don't assume string byte-length fits in 'int'.
19860 Check that character arg fits in 'int'.
19861 (mapcar1): Declare byte as byte, for clarity.
19863 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19865 * fns.c (concat): Catch string overflow earlier.
19866 Do not rely on integer wraparound.
19868 * dispextern.h (struct it.overlay_strings_charpos)
19869 (struct it.selective): Now EMACS_INT, not int.
19870 * xdisp.c (forward_to_next_line_start)
19871 (back_to_previous_visible_line_start)
19872 (reseat_at_next_visible_line_start, next_element_from_buffer):
19873 Don't arbitrarily truncate the value of 'selective' to int.
19875 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19877 * composite.c: Don't truncate sizes to 'int'.
19878 (composition_gstring_p, composition_reseat_it)
19879 (composition_adjust_point): Use EMACS_INT, not int.
19880 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19881 not EMACS_UINT, for indexes.
19883 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19885 * buffer.c: Include <verify.h>.
19886 (struct sortvec.priority, struct sortstr.priority):
19887 Now EMACS_INT, not int.
19888 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19889 (struct sortstr.size, record_overlay_string)
19890 (struct sortstrlist.size, struct sortlist.used):
19891 Don't truncate size to int.
19892 (record_overlay_string): Check for size-calculation overflow.
19893 (init_buffer_once): Check at compile-time, not run-time.
19895 2011-06-22 Jim Meyering <meyering@redhat.com>
19897 Don't leak an XBM-image-sized buffer
19898 * image.c (xbm_load): Free the image buffer after using it.
19900 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19903 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19904 that Sun C diagnosed.
19905 * fns.c (secure_hash): Fix pointer signedness issue.
19906 * intervals.c (static_offset_intervals): New function.
19907 (offset_intervals): Use it.
19909 2011-06-21 Leo Liu <sdl.web@gmail.com>
19912 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19915 * fns.c (secure_hash): Rename from crypto_hash_function and change
19916 the first arg to accept symbols.
19917 (Fsecure_hash): New primitive.
19918 (syms_of_fns): New symbols.
19920 2011-06-20 Deniz Dogan <deniz@dogan.se>
19922 * process.c (Fset_process_buffer): Clarify return value in
19925 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19927 * dispnew.c (add_window_display_history): Use BVAR.
19929 * xdisp.c (debug_method_add): Use BVAR.
19930 (check_window_end, dump_glyph_matrix, dump_glyph)
19931 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19933 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19936 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19937 check till after the cache is created in init_frame_faces.
19939 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19941 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19943 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19945 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19946 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19947 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19949 Improve buffer-overflow checking (Bug#8873).
19950 * fileio.c (Finsert_file_contents):
19951 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19952 Remove the old (too-loose) buffer overflow checks.
19953 They weren't needed, since make_gap checks for buffer overflow.
19954 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19955 The old code merely checked for Emacs fixnum overflow, and relied
19956 on undefined (wraparound) behavior. The new code avoids undefined
19957 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19959 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19960 Tune. Don't use wider integers than needed. Don't use alloca.
19961 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19963 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19965 * insdel.c, lisp.h (buffer_overflow): New function.
19966 (insert_from_buffer_1, replace_range, replace_range_2):
19967 * insdel.c (make_gap_larger):
19968 * editfns.c (Finsert_char):
19969 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19971 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19973 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19975 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19977 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19978 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19980 * fileio.c: Don't assume EMACS_INT fits in off_t.
19981 (emacs_lseek): New static function.
19982 (Finsert_file_contents, Fwrite_region): Use it.
19983 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19985 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19987 * fns.c: Don't overflow int when computing a list length.
19988 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19989 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19990 truncation on 64-bit hosts. Check for QUIT every
19991 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19992 faster and is responsive enough.
19993 (Flength): Report an error instead of overflowing an integer.
19994 (Fsafe_length): Return a float if the value is not representable
19995 as a fixnum. This shouldn't happen except in contrived situations.
19996 (Fnthcdr, Fsort): Don't assume list length fits in int.
19997 (Fcopy_sequence): Don't assume vector length fits in int.
19999 * alloc.c: Check that resized vectors' lengths fit in fixnums.
20000 (header_size, word_size): New constants.
20001 (allocate_vectorlike): Don't check size overflow here.
20002 (allocate_vector): Check it here instead, since this is the only
20003 caller of allocate_vectorlike that could cause overflow.
20004 Check that the new vector's length is representable as a fixnum.
20006 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
20007 The previous code was bogus. For example, next_almost_prime (32)
20008 returned 39, which is undesirable as it is a multiple of 3; and
20009 next_almost_prime (24) returned 25, which is a multiple of 5 so
20010 why was the code bothering to check for multiples of 7?
20012 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
20014 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
20016 Variadic C functions now count arguments with ptrdiff_t.
20017 This partly undoes my 2011-03-30 change, which replaced int with size_t.
20018 Back then I didn't know that the Emacs coding style prefers signed int.
20019 Also, in the meantime I found a few more instances where arguments
20020 were being counted with int, which may truncate counts on 64-bit
20021 machines, or EMACS_INT, which may be unnecessarily wide.
20022 * lisp.h (struct Lisp_Subr.function.aMANY)
20023 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20024 Arg counts are now ptrdiff_t, not size_t.
20025 All variadic functions and their callers changed accordingly.
20026 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20027 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20028 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20029 * callint.c (Fcall_interactively): Check arg count for overflow,
20030 to avoid potential buffer overrun. Use signed char, not 'int',
20031 for 'varies' array, so that we needn't bother to check its size
20032 calculation for overflow.
20033 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20034 * eval.c (apply_lambda):
20035 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20036 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20037 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20039 * callint.c (Fcall_interactively): Don't use index var as event count.
20041 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20042 * mem-limits.h (SIZE): Remove; no longer used.
20044 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20046 Remove unnecessary casts.
20047 * xterm.c (x_term_init):
20048 * xfns.c (x_set_border_pixel):
20049 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20050 These aren't needed now that we assume ANSI C.
20052 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20053 It's more likely to cause problems (due to unsigned overflow)
20056 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20058 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20060 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20062 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20064 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20066 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20068 GLYPH_CODE_FACE returns EMACS_INT, not int.
20069 * dispextern.h (merge_faces):
20070 * xfaces.c (merge_faces):
20071 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20072 Don't assume EMACS_INT fits in int.
20074 * character.h (CHAR_VALID_P): Remove unused parameter.
20075 * fontset.c, lisp.h, xdisp.c: All uses changed.
20077 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20079 * fns.c (concat): Minor tuning based on overflow analysis.
20080 This doesn't fix any bugs. Use int to hold character, instead
20081 of constantly refetching from Emacs object. Use XFASTINT, not
20082 XINT, for value known to be a character. Don't bother comparing
20083 a single byte to 0400, as it's always less.
20085 * floatfns.c (Fexpt):
20086 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20088 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20091 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20093 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20094 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20095 incorrectly succeed when S was a string, because 4294967386 was
20096 truncated before it was used.
20098 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20099 Otherwise, an out-of-range integer could cause undefined behavior
20102 * composite.c: Use int, not EMACS_INT, for characters.
20103 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20104 EMACS_INT, for values that are known to be in character range.
20105 This doesn't fix any bugs but is the usual style inside Emacs and
20106 may generate better code on 32-bit machines.
20108 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20109 This is for reasons similar to the recent CHAR_STRING fix.
20110 * charset.c (Fencode_char): Check that character arg is actually
20111 a character. Pass an int to ENCODE_CHAR.
20112 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20113 wider than 'int', as a compile-time check to prevent future regressions
20116 * character.c (char_string): Remove unnecessary casts.
20118 Make sure a 64-bit char is never passed to CHAR_STRING.
20119 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20120 by silently ignoring the top 32 bits, allowing some values
20121 that were far too large to be valid characters.
20122 * character.h: Include <verify.h>.
20123 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20124 arguments are no wider than unsigned, as a compile-time check
20125 to prevent future regressions in this area.
20127 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20128 (Fsubst_char_in_region):
20130 * xdisp.c (decode_mode_spec_coding):
20131 Adjust to CHAR_STRING's new requirement.
20132 * editfns.c (Finsert_char, Fsubst_char_in_region):
20133 * fns.c (concat): Check that character args are actually
20134 characters. Without this test, these functions did the wrong
20135 thing with wildly out-of-range values on 64-bit hosts.
20137 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20138 These casts should not be needed on 32-bit hosts, either.
20139 * keyboard.c (read_char):
20140 * lread.c (Fload): Remove casts to unsigned.
20142 * lisp.h (UNSIGNED_CMP): New macro.
20143 This fixes comparison bugs on 64-bit hosts.
20144 (ASCII_CHAR_P): Use it.
20145 * casefiddle.c (casify_object):
20146 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20147 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20148 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20149 * dispextern.h (FACE_FROM_ID):
20150 * keyboard.c (read_char): Use UNSIGNED_CMP.
20152 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20153 not to EMACS_INT, to avoid GCC warning.
20155 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20157 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20158 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20159 isn't needed on 32-bit machines.
20161 * buffer.c (Fgenerate_new_buffer_name):
20162 Use EMACS_INT for count, not int.
20163 (advance_to_char_boundary): Return EMACS_INT, not int.
20165 * data.c (Qcompiled_function): Now static.
20167 * window.c (window_body_lines): Now static.
20169 * image.c (gif_load): Rename local to avoid shadowing.
20171 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20172 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20173 * alloc.c (make_save_value): Integer argument is now of type
20174 ptrdiff_t, not int.
20175 (mark_object): Use ptrdiff_t, not int.
20176 * lisp.h (pD): New macro.
20177 * print.c (print_object): Use it.
20179 * alloc.c: Use EMACS_INT, not int, to count objects.
20180 (total_conses, total_markers, total_symbols, total_vector_size)
20181 (total_free_conses, total_free_markers, total_free_symbols)
20182 (total_free_floats, total_floats, total_free_intervals)
20183 (total_intervals, total_strings, total_free_strings):
20184 Now EMACS_INT, not int. All uses changed.
20185 (Fgarbage_collect): Compute overall total using a double, so that
20186 integer overflow is less likely to be a problem. Check for overflow
20187 when converting back to an integer.
20188 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20189 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20190 These were 'int' variables that could overflow on 64-bit hosts;
20191 they were never used, so remove them instead of repairing them.
20192 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20193 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20194 Previously, this ceilinged at INT_MAX, but that doesn't work on
20196 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20198 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20199 (allocate_vectorlike): Check for ptrdiff_t overflow.
20200 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20201 when a (possibly-narrower) signed value would do just as well.
20202 We prefer using signed arithmetic, to avoid comparison confusion.
20204 * alloc.c: Catch some string size overflows that we were missing.
20205 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20206 for convenience in STRING_BYTES_MAX.
20207 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20208 The definition here is exact; the one in lisp.h was approximate.
20209 (allocate_string_data): Check for string overflow. This catches
20210 some instances we weren't catching before. Also, it catches
20211 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20212 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20213 and ptrdiff_t and EMACS_INT are both 64 bits.
20215 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20216 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20217 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20219 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20221 * alloc.c (Fmake_string): Check for out-of-range init.
20223 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20225 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20227 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20229 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20230 xg_get_default_scrollbar_width.
20232 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20233 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20234 (style_changed_cb): Call update_theme_scrollbar_width and call
20235 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20236 all frames (Bug#8505).
20237 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20238 Call gtk_window_set_resizable if HAVE_GTK3.
20239 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20240 and height if HAVE_GTK3 (Bug#8505).
20241 (scroll_bar_width_for_theme): New variable.
20242 (update_theme_scrollbar_width): New function.
20243 (xg_get_default_scrollbar_width): Move code to
20244 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20245 (xg_initialize): Call update_theme_scrollbar_width.
20247 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20249 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20251 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20253 * frame.c (make_frame): Call other_buffer_safely instead of
20256 * window.c (temp_output_buffer_show): Call display_buffer with
20257 second argument Vtemp_buffer_show_specifiers and reset latter
20258 immediately after the call.
20259 (Vtemp_buffer_show_specifiers): New variable.
20260 (auto_window_vscroll_p, next_screen_context_lines)
20261 (Vscroll_preserve_screen_position): Remove leading asterisks from
20264 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20266 Fix minor problems found by GCC 4.6.0 static checking.
20267 * buffer.c (Qclone_number): Remove for now, as it's unused.
20268 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20269 (record_buffer): Remove unused local.
20270 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20271 (set_frame_buffer_list): Remove; unused.
20272 * frame.h (other_visible_frames): Remove decl.
20273 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20274 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20275 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20277 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20278 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20279 Define only if HAVE_GPM.
20280 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20281 (update_hints_inhibit): Remove; never set. All uses removed.
20282 * widgetprv.h (emacsFrameClassRec): Remove decl.
20283 * window.c (delete_deletable_window): Now returns void, since it
20284 wasn't returning anything.
20285 (compare_window_configurations): Remove unused locals.
20286 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20287 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20288 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20289 the same widths as pointers. This follows up on the 2011-05-06 patch.
20290 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20291 * xterm.h: Likewise.
20292 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20294 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20296 * makefile.w32-in: Update dependencies.
20297 (LISP_H): Add lib/intprops.h.
20299 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20301 * image.c (gif_load): Add animation frame delay to the metadata.
20302 (syms_of_image): Use DEFSYM. New symbol `delay'.
20304 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20306 * window.c (delete_deletable_window): Re-add.
20307 (Fset_window_configuration): Rewrite to handle dead buffers and
20308 consequently deletable windows.
20309 (window_tree, Fwindow_tree): Remove. Supply functionality in
20311 (compare_window_configurations): Simplify code.
20313 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20315 * image.c (imagemagick_load_image): Fix type mismatch.
20316 (Fimagemagick_types): Likewise.
20318 * window.h (replace_buffer_in_windows): Declare.
20320 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20322 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20323 Qclone_number. Remove external declaration of Qdelete_window.
20324 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20326 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20327 Run Qbuffer_list_update_hook if allowed.
20328 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20329 buffer list implementation.
20330 (other_buffer_safely): New function.
20331 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20332 calls to replace_buffer_in_windows and
20333 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20335 (record_buffer): Inhibit quitting and rewrite using quittable
20336 functions. Run Qbuffer_list_update_hook if allowed.
20337 (Frecord_buffer, Funrecord_buffer): New functions.
20338 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20339 Move switch-to-buffer to window.el.
20340 (bury-buffer): Move to window.el.
20341 (Vbuffer_list_update_hook): New variable.
20343 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20346 * window.h (resize_frame_windows): Move up in code.
20347 (Fwindow_frame): Remove EXFUN.
20348 (replace_buffer_in_all_windows): Remove prototype.
20349 (replace_buffer_in_windows_safely): Add prototype.
20351 * window.c: Declare Qdelete_window static again. Move down
20352 declaration of select_count.
20353 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20354 (Fother_window): Move to window.el.
20355 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20356 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20357 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20359 (replace_buffer_in_windows): Implement by calling
20360 Qreplace_buffer_in_windows.
20361 (replace_buffer_in_all_windows): Remove with some functionality
20362 moved into replace_buffer_in_windows_safely.
20363 (replace_buffer_in_windows_safely): New function.
20364 (select_window_norecord, select_frame_norecord): Move in front
20365 of run_window_configuration_change_hook. Remove now obsolete
20367 (Fset_window_buffer): Rewrite doc-string.
20368 Call Qrecord_window_buffer.
20369 (keys_of_window): Move binding for other-window to window.el.
20371 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20373 * dispextern.h (struct image): Replace data member, whose int_val
20374 and ptr_val fields were not used by anything, with a single
20377 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20378 (gif_clear_image, gif_load, imagemagick_load_image)
20379 (gs_clear_image, gs_load): Callers changed.
20381 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20383 * buffer.h: Include <time.h>, for time_t.
20384 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20386 Fix minor problems found by static checking.
20388 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20390 Make identifiers static if they are not used in other modules.
20391 * data.c (Qcompiled_function, Qframe, Qvector):
20392 * image.c (QimageMagick, Qsvg):
20393 * minibuf.c (Qmetadata):
20394 * window.c (resize_window_check, resize_root_window): Now static.
20395 * window.h (resize_window_check, resize_root_window): Remove decls.
20397 * window.c (window_deletion_count, delete_deletable_window):
20399 (window_body_lines): Now static.
20400 (Fdelete_other_windows_internal): Mark vars as initialized.
20401 Make sure 'resize_failed' is initialized.
20402 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20403 (resize_window_apply): Remove unused local.
20404 * window.h (delete_deletable_window): Remove decl.
20406 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20407 (imagemagick_load_image): Fix pointer signedness problem by changing
20408 last arg from unsigned char * to char *. All uses changed.
20409 Also, fix a local for similar reasons.
20410 Remove unused locals. Remove locals to avoid shadowing.
20411 (fn_rsvg_handle_free): Remove; unused.
20412 (svg_load, svg_load_image): Fix pointer signedness problem.
20413 (imagemagick_load_image): Don't use garbage pointer image_wand.
20415 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20417 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20419 * image.c (gif_load): Fix omitted cast error introduced by
20422 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20424 * window.h (resize_proportionally, orig_total_lines)
20425 (orig_top_line): Remove from window structure.
20426 (set_window_height, set_window_width, change_window_heights)
20427 (Fdelete_window): Remove prototypes.
20428 (resize_frame_windows): Remove duplicate declaration.
20430 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20432 * window.h (resize_frame_windows, resize_window_check)
20433 (delete_deletable_window, resize_root_window)
20434 (resize_frame_windows): Declare prototypes.
20436 * window.c (resize_window_apply): Make definition be "static" to
20437 match the prototype.
20439 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20441 * window.c: Remove declarations of Qwindow_size_fixed,
20442 window_min_size_1, window_min_size_2, window_min_size,
20443 size_window, window_fixed_size_p, enlarge_window, delete_window.
20444 Remove static from declaration of Qdelete_window, it's
20445 temporarily needed by Fbury_buffer.
20446 (replace_window): Don't assign orig_top_line and
20448 (Fdelete_window, delete_window): Remove. Window deletion is
20449 handled by window.el.
20450 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20451 Replace Fdelete_window calls with calls to Qdelete_window.
20452 (Fdelete_other_windows): Remove. Deleting other windows is
20453 handled by window.el.
20454 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20455 handled in window.el.
20456 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20457 Window minimum sizes are handled in window.el.
20458 (shrink_windows, size_window, set_window_height)
20459 (set_window_width, change_window_heights, window_height)
20460 (window_width, CURBEG, CURSIZE, enlarge_window)
20461 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20462 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20463 handled in window.el.
20464 (make_dummy_parent): Rename to make_parent_window and give it a
20465 second argument horflag.
20466 (make_window): Don't set resize_proportionally any more.
20467 (Fsplit_window): Remove. Windows are split in window.el.
20468 (save_restore_action, save_restore_orig_size)
20469 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20470 Resize mini windows in window.el.
20471 (grow_mini_window, shrink_mini_window): Implement by calling
20472 Qresize_root_window_vertically, resize_window_check and
20473 resize_window_apply.
20474 (saved_window, Fset_window_configuration, save_window_save):
20475 Do not handle orig_top_line, orig_total_lines, and
20476 resize_proportionally.
20477 (window_min_height, window_min_width): Move to window.el.
20478 (keys_of_window): Move bindings for delete-other-windows,
20479 split-window, delete-window and enlarge-window to window.el.
20481 * buffer.c: Temporarily extern Qdelete_window.
20482 (Fbury_buffer): Temporarily call Qdelete_window instead of
20483 Fdelete_window (Fbury_buffer will move to window.el soon).
20485 * frame.c (set_menu_bar_lines_1): Remove code handling
20486 orig_top_line and orig_total_lines.
20488 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20489 set_window_height but set heights directly.
20490 (change_frame_size_1): Use resize_frame_windows.
20492 * xdisp.c (init_xdisp): Don't use set_window_height but set
20495 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20496 Use resize_frame_windows instead of change_window_heights and run
20497 run_window_configuration_change_hook.
20499 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20500 instead of change_window_heights and run
20501 run_window_configuration_change_hook.
20503 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20505 * window.c (replace_window): Rename second argument REPLACEMENT to
20506 NEW. New third argument SETFLAG. Rewrite.
20507 (delete_window, make_dummy_parent): Call replace_window with
20509 (window_list_1): Move down in code.
20510 (run_window_configuration_change_hook): Move set_buffer part
20511 before select_frame_norecord part in order to unwind correctly.
20512 Rename count1 to count.
20513 (recombine_windows, delete_deletable_window, resize_root_window)
20514 (Fdelete_other_windows_internal)
20515 (Frun_window_configuration_change_hook, make_parent_window)
20516 (resize_window_check, resize_window_apply, Fresize_window_apply)
20517 (resize_frame_windows, Fsplit_window_internal)
20518 (Fdelete_window_internal, Fresize_mini_window_internal):
20520 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20522 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20524 * window.h (window): Add some new members to window structure -
20525 normal_lines, normal_cols, new_total, new_normal, clone_number,
20526 splits, nest, prev_buffers, next_buffers.
20527 (WINDOW_TOTAL_SIZE): Move here from window.c.
20528 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20530 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20532 (make_dummy_parent): Set new members of windows structure.
20533 (make_window): Move down in code. Handle new members of window
20535 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20536 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20537 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20538 (Fset_window_prev_buffers, Fwindow_next_buffers)
20539 (Fset_window_next_buffers, Fset_window_clone_number):
20541 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20542 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20544 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20545 Argument WINDOW can be now internal window too.
20546 (Fwindow_use_time): Move up in code.
20547 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20548 Rewrite doc-string.
20549 (Fset_window_configuration, saved_window)
20550 (Fcurrent_window_configuration, save_window_save): Handle new
20551 members of window structure.
20552 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20553 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20554 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20555 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20556 Qget_mru_window, Qresize_root_window,
20557 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20558 Qauto_buffer_name; staticpro them.
20560 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20562 * window.c (Fwindow_total_size, Fwindow_left_column)
20563 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20564 (Fwindow_list_1): New functions.
20565 (window_box_text_cols): Replace with window_body_cols.
20566 (Fwindow_width, Fscroll_left, Fscroll_right):
20567 Use window_body_cols instead of window_box_text_cols.
20568 (delete_window, Fset_window_configuration):
20569 Call delete_all_subwindows with window as argument.
20570 (delete_all_subwindows): Take a window as argument and not a
20571 structure. Rewrite.
20572 (window_loop): Remove handling of GET_LRU_WINDOW and
20573 GET_LARGEST_WINDOW.
20574 (Fget_lru_window, Fget_largest_window): Move to window.el.
20576 * window.h: Extern window_body_cols instead of
20577 window_box_text_cols. delete_all_subwindows now takes a
20578 Lisp_Object as argument.
20580 * indent.c (compute_motion, Fcompute_motion):
20581 Use window_body_cols instead of window_box_text_cols.
20583 * frame.c (delete_frame): Call delete_all_subwindows with root
20584 window as argument.
20586 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20588 * fns.c (Fputhash): Document return value.
20590 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20592 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20594 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20596 Cons<->int and similar integer overflow fixes (Bug#8794).
20598 Check for overflow when converting integer to cons and back.
20599 * charset.c (Fdefine_charset_internal, Fdecode_char):
20600 Use cons_to_unsigned to catch overflow.
20601 (Fencode_char): Use INTEGER_TO_CONS.
20602 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20603 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20604 * data.c (long_to_cons, cons_to_long): Remove.
20605 (cons_to_unsigned, cons_to_signed): New functions.
20606 These signal an error for invalid or out-of-range values.
20607 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20608 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20609 * font.c (Ffont_variation_glyphs):
20610 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20611 * lisp.h: Include <intprops.h>.
20612 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20613 (cons_to_signed, cons_to_unsigned): New decls.
20614 (long_to_cons, cons_to_long): Remove decls.
20615 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20616 (Fprimitive_undo): Use CONS_TO_INTEGER.
20617 * xfns.c (Fx_window_property): Likewise.
20618 * xselect.c: Include <limits.h>.
20619 (x_own_selection, selection_data_to_lisp_data):
20620 Use INTEGER_TO_CONS.
20621 (x_handle_selection_request, x_handle_selection_clear)
20622 (x_get_foreign_selection, Fx_disown_selection_internal)
20623 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20624 (lisp_data_to_selection_data): Use cons_to_unsigned.
20625 (x_fill_property_data): Use cons_to_signed.
20626 Report values out of range.
20628 Check for buffer and string overflow more precisely.
20629 * buffer.h (BUF_BYTES_MAX): New macro.
20630 * lisp.h (STRING_BYTES_MAX): New macro.
20631 * alloc.c (Fmake_string):
20632 * character.c (string_escape_byte8):
20633 * coding.c (coding_alloc_by_realloc):
20634 * doprnt.c (doprnt):
20635 * editfns.c (Fformat):
20637 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20638 since they may not be the same number.
20639 * editfns.c (Finsert_char):
20640 * fileio.c (Finsert_file_contents):
20641 Likewise for BUF_BYTES_MAX.
20643 * image.c: Use ptrdiff_t, not int, for sizes.
20644 (slurp_file): Switch from int to ptrdiff_t.
20646 (slurp_file): Check that file size fits in both size_t (for
20647 malloc) and ptrdiff_t (for sanity and safety).
20649 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20650 if b->modtime has its maximal value.
20652 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20654 Don't assume time_t can fit into int.
20655 * buffer.h (struct buffer.modtime): Now time_t, not int.
20656 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20657 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20659 Minor fixes for signed vs unsigned integers.
20660 * character.h (MAYBE_UNIFY_CHAR):
20661 * charset.c (maybe_unify_char):
20662 * keyboard.c (read_char, reorder_modifiers):
20663 XINT -> XFASTINT, since the integer must be nonnegative.
20664 * ftfont.c (ftfont_spec_pattern):
20665 * keymap.c (access_keymap, silly_event_symbol_error):
20666 XUINT -> XFASTINT, since the integer must be nonnegative.
20667 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20668 since it makes no difference and we prefer signed.
20669 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20670 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20673 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20675 * window.h (Fwindow_frame): Declare.
20677 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20679 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20680 (SPARE_MEMORY): Always define.
20681 (LARGE_REQUEST): Remove.
20682 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20684 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20686 * lisp.h: Move EXFUNS for Fframe_root_window,
20687 Fframe_first_window and Fset_frame_selected_window to window.h.
20689 * window.h: Move EXFUNS for Fframe_root_window,
20690 Fframe_first_window and Fset_frame_selected_window here from
20693 * frame.c (Fwindow_frame, Fframe_first_window)
20694 (Fframe_root_window, Fframe_selected_window)
20695 (Fset_frame_selected_window): Move to window.c.
20696 (Factive_minibuffer_window): Move to minibuf.c.
20697 (Fother_visible_frames_p): New function.
20699 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20701 * window.c (decode_window, decode_any_window): Move up in code.
20702 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20703 (inhibit_frame_unsplittable): Remove unused variable.
20704 (Fwindow_buffer): Move up and rewrite doc-string.
20705 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20706 (Fwindow_prev): New functions.
20707 (Fwindow_frame): Move here from frame.c. Accept any window as
20709 (Fframe_root_window, Fframe_first_window)
20710 (Fframe_selected_window): Move here from frame.c. Accept frame
20711 or arbitrary window as argument. Update doc-strings.
20712 (Fminibuffer_window): Move up in code.
20713 (Fwindow_minibuffer_p): Move up in code and simplify.
20714 (Fset_frame_selected_window): Move here from frame.c.
20716 (Fselected_window, select_window, Fselect_window): Move up in
20717 code. Minor doc-string fixes.
20719 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20721 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20722 Do not assume that spare memory exists; that assumption is valid
20723 only if SYSTEM_MALLOC.
20724 (LARGE_REQUEST): New macro, so that the issue of large requests
20725 is separated from the issue of spare memory.
20727 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20729 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20732 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20734 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20737 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20739 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20741 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20743 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20744 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20746 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20748 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20750 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20752 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20753 (x_clipboard_manager_save): Add return value.
20754 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20755 New error handlers.
20756 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20757 Obey Vx_select_enable_clipboard_manager. Catch errors in
20758 x_clipboard_manager_save (Bug#8779).
20759 (Vx_select_enable_clipboard_manager): New variable.
20760 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20762 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20764 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20766 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20768 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20769 in the current matrix if keep_current_p is non-zero.
20771 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20773 * bidi.c (bidi_level_of_next_char): Fix last change.
20775 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20777 Support bidi reordering of text covered by display properties.
20779 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20780 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20781 (bidi_cache_search, bidi_cache_iterator_state)
20782 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20783 (bidi_level_of_next_char, bidi_move_to_visually_next):
20784 Support character positions inside a run of characters covered by a
20786 (bidi_paragraph_init, bidi_resolve_explicit_1)
20787 (bidi_level_of_next_char): Call bidi_fetch_char and
20788 bidi_fetch_char_advance instead of FETCH_CHAR and
20789 FETCH_CHAR_ADVANCE.
20790 (bidi_init_it): Initialize new members.
20791 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20793 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20794 instead of using explicit *_CHAR codes.
20795 (bidi_resolve_explicit, bidi_resolve_weak):
20796 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20797 bidirectional text is supported only in multibyte buffers.
20798 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20799 it to initialize the frame_window_p member of struct bidi_it.
20800 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20801 (bidi_resolve_explicit, bidi_resolve_weak)
20802 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20803 bidi_it->nchars is non-positive.
20804 (bidi_level_of_next_char): Don't try to lookup the cache for the
20805 next/previous character if nothing is cached there yet, or if we
20806 were just reseat()'ed to a new position.
20808 * xdisp.c (set_cursor_from_row): Set start and stop points
20809 according to the row's direction when priming the loop that looks
20810 for the glyph on which to display cursor.
20811 (single_display_spec_intangible_p): Function deleted.
20812 (display_prop_intangible_p): Reimplement to call
20813 handle_display_spec instead of single_display_spec_intangible_p.
20814 Accept 3 additional arguments needed by handle_display_spec.
20815 This fixes incorrect cursor motion across display property with complex
20816 values: lists, `(when COND...)' forms, etc.
20817 (single_display_spec_string_p): Support property values that are
20818 lists with the argument STRING its top-level element.
20819 (display_prop_string_p): Fix the condition for processing a
20820 property that is a list to be consistent with handle_display_spec.
20821 (handle_display_spec): New function, refactored from the
20822 last portion of handle_display_prop.
20823 (compute_display_string_pos): Accept additional argument
20824 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20825 value of a `display' property is a "replacing spec".
20826 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20827 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20828 the display property, but just return a value indicating whether
20829 the display property will replace the characters it covers.
20830 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20831 frame_window_p members of struct bidi_it.
20832 (compute_display_string_pos, compute_display_string_end):
20834 (push_it): Accept second argument POSITION, where pop_it should
20835 jump to continue iteration.
20836 (reseat_1): Initialize bidi_it.disp_pos.
20838 * keyboard.c (adjust_point_for_property): Adjust the call to
20839 display_prop_intangible_p to its new signature.
20841 * dispextern.h (struct bidi_it): New member frame_window_p.
20842 (bidi_init_it): Update prototypes.
20843 (display_prop_intangible_p): Update prototype.
20844 (compute_display_string_pos, compute_display_string_end):
20845 Declare prototypes.
20846 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20849 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20851 Malloc failure behavior now depends on size of allocation.
20852 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20853 * lisp.h: Change signatures accordingly.
20854 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20855 All callers changed. (Bug#8762)
20857 * gnutls.c: Use Emacs's memory allocators.
20858 Without this change, the gnutls library would invoke malloc etc.
20859 directly, which causes problems on non-SYNC_INPUT hosts, and which
20860 runs afoul of improving memory_full behavior. (Bug#8761)
20861 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20862 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20863 xfree instead of the default malloc, realloc, free.
20864 (Fgnutls_boot): No need to check for memory allocation failure,
20865 since xmalloc does that for us.
20867 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20868 * category.c (hash_get_category_set):
20869 * ccl.c (ccl_driver):
20870 * charset.c (Fdefine_charset_internal):
20871 * charset.h (struct charset.hash_index):
20872 * composite.c (get_composition_id, gstring_lookup_cache)
20873 (composition_gstring_put_cache):
20874 * composite.h (struct composition.hash_index):
20875 * dispextern.h (struct image.hash):
20876 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20877 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20878 (hashfn_equal, hashfn_user_defined, make_hash_table)
20879 (maybe_resize_hash_table, hash_lookup, hash_put)
20880 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20881 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20882 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20883 * image.c (make_image, search_image_cache, lookup_image)
20884 (xpm_put_color_table_h):
20885 * lisp.h (struct Lisp_Hash_Table):
20886 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20887 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20888 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20889 * alloc.c (allocate_vectorlike):
20890 Check for overflow in vector size calculations.
20891 * ccl.c (ccl_driver):
20892 Check for overflow when converting EMACS_INT to int.
20893 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20894 need to be updated by these changes.
20895 * fns.c (make_hash_table, maybe_resize_hash_table):
20896 Check for integer overflow with large hash tables.
20897 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20898 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20899 (SXHASH_REDUCE): New macro.
20900 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20901 Use it instead of discarding useful hash info with large hash values.
20902 (sxhash_float): New function.
20903 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20904 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20905 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20906 Rewrite to use FIXNUM_BITS, as this simplifies things.
20907 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20908 Adjust signatures to match updated version of code.
20909 (consing_since_gc): Now EMACS_INT, since a single hash table can
20910 use more than INT_MAX bytes.
20912 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20914 Make it possible to build with GCC-4.6+ -O2 -flto.
20916 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20918 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20920 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20921 Call minibuffer-inactive-mode.
20923 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20925 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20926 Update dependencies.
20928 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20930 * data.c (init_data): Remove code for UTS, this system is not
20933 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20935 Don't force ./temacs to start in terminal mode.
20937 * frame.c (make_initial_frame): Initialize faces in all cases, not
20938 only when CANNOT_DUMP is defined.
20939 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20941 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20943 * dispnew.c (add_window_display_history): Use const for the string
20944 pointer. Remove declaration, not needed.
20946 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20948 Use 'inline', not 'INLINE'.
20949 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20950 * alloc.c, fontset.c (INLINE): Remove.
20951 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20952 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20953 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20954 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20955 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20957 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20959 Make it possible to run ./temacs.
20961 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20962 syms_of_callproc does the same thing. Remove test for
20963 "initialized", do it in the caller.
20964 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20966 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20968 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20969 (read_minibuf): Use get_minibuffer.
20970 (syms_of_minibuf): Use DEFSYM.
20971 (Qmetadata): New var.
20972 * data.c (Qbuffer): Don't make it static.
20973 (syms_of_data): Use DEFSYM.
20975 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20977 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20978 (CCL_CODE_MIN): New macro.
20980 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20982 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20984 * eval.c (Qdebug): Now static.
20985 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20986 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20987 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20989 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20991 * image.c: Various fixes to ImageMagick code comments.
20992 (Fimagemagick_types): Doc fix.
20994 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20996 Minor fixes prompted by GCC 4.6.0 warnings.
20998 * xselect.c (converted_selections, conversion_fail_tag): Now static.
21000 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
21001 (x_clipboard_manager_save_all): Move extern decl to ...
21002 * xterm.h: ... here, so that it can be checked for consistency.
21004 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
21006 * xselect.c (x_clipboard_manager_save_frame)
21007 (x_clipboard_manager_save_all): New functions.
21008 (Fx_clipboard_manager_save): Lisp function deleted.
21010 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
21011 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
21013 * xterm.h: Update prototype.
21015 2011-05-28 William Xu <william.xwl@gmail.com>
21017 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
21018 exiting (Bug#8239).
21020 2011-05-28 Jim Meyering <meyering@redhat.com>
21022 Avoid a sign-extension bug in crypto_hash_function.
21023 * fns.c (to_uchar): Define.
21024 (crypto_hash_function): Use it to convert some newly-signed
21025 variables to unsigned, to avoid sign-extension bugs. For example,
21026 without this change, (md5 "truc") would evaluate to
21027 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21028 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21029 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21031 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21033 Integer overflow fixes.
21035 * dbusbind.c: Serial number integer overflow fixes.
21036 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21037 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21038 to hold a serial number that is too large for a fixnum.
21039 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21040 Check for serial numbers out of range. Decode any serial number
21041 that was so large that it became a float. (Bug#8722)
21043 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21044 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21045 Use XFASTINT rather than XUINT when numbers are nonnegative.
21046 (xd_append_arg, Fdbus_method_return_internal):
21047 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21048 arguments, check that Lisp number is nonnegative, rather than
21049 silently wrapping negative numbers around. (Bug#8722)
21050 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21053 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21055 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21057 ccl: Add integer overflow checks.
21058 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21059 (IN_INT_RANGE): New macros.
21060 (ccl_driver): Use them to check for integer overflow when
21061 decoding a CCL program. Many of the new checks are whether XINT (x)
21062 fits in int; it doesn't always, on 64-bit hosts. The new version
21063 doesn't catch all possible integer overflows, but it's an
21064 improvement. (Bug#8719)
21066 * alloc.c (make_event_array): Use XINT, not XUINT.
21067 There's no need for unsigned here.
21069 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21070 This follows up to the 2011-05-06 change that substituted uintptr_t
21071 for EMACS_INT. This case wasn't caught back then.
21073 Rework Fformat to avoid integer overflow issues.
21074 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21075 now (part of C89). Include <verify.h>.
21076 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21077 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21078 (Fformat): Avoid the prepass trying to compute sizes; it was only
21079 approximate and thus did not catch overflow reliably. Instead, walk
21080 through the format just once, formatting and computing sizes as we go,
21081 checking for integer overflow at every step, and allocating a larger
21082 buffer as needed. Keep track separately whether the format is
21083 multibyte. Keep only the most-recently calculated precision, rather
21084 than them all. Record whether each argument has been converted to
21085 string. Use EMACS_INT, not int, for byte and char and arg counts.
21086 Support field widths and precisions larger than INT_MAX. Avoid
21087 sprintf's undefined behavior with conversion specifications such as %#d
21088 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21089 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21090 formatting out-of-range floating point numbers with int
21091 formats. (Bug#8668)
21093 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21095 * data.c: Avoid integer truncation in expressions involving floats.
21096 * data.c: Include <intprops.h>.
21097 (arith_driver): When there's an integer overflow in an expression
21098 involving floating point, convert the integers to floating point
21099 so that the resulting value does not suffer from catastrophic
21100 integer truncation. For example, on a 64-bit host (* 4
21101 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21102 Do not rely on undefined behavior after integer overflow.
21104 merge count_size_as_multibyte, parse_str_to_multibyte
21105 * character.c, character.h (count_size_as_multibyte):
21106 Rename from parse_str_to_multibyte; all uses changed.
21107 Check for integer overflow.
21108 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21109 since it's now a duplicate of the other. This is more of
21110 a character than a buffer op, so better that it's in character.c.
21111 * fns.c, print.c: Adjust to above changes.
21113 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21115 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21117 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21119 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21120 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21121 (x_clipboard_manager_save): Now static.
21122 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21124 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21125 (crypto_hash_function): Now static.
21126 Fix pointer signedness problems. Avoid unnecessary initializations.
21128 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
21130 * termhooks.h (Vselection_alist): Make it terminal-local.
21132 * terminal.c (create_terminal): Initialize it.
21134 * xselect.c: Support for clipboard managers.
21135 (Vselection_alist): Move to termhooks.h as terminal-local var.
21136 (LOCAL_SELECTION): New macro.
21137 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21138 (symbol_to_x_atom): Remove gratuitous arg.
21139 (x_handle_selection_request, lisp_data_to_selection_data)
21140 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21141 (x_own_selection, x_get_local_selection, x_convert_selection):
21142 New arg, specifying work frame. Use terminal-local Vselection_alist.
21143 (some_frame_on_display): Delete unused function.
21144 (Fx_own_selection_internal, Fx_get_selection_internal)
21145 (Fx_disown_selection_internal, Fx_selection_owner_p)
21146 (Fx_selection_exists_p): New optional frame arg.
21147 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21148 (x_handle_selection_clear): Don't treat other terminals with the
21149 same keyboard specially. Use the terminal-local Vselection_alist.
21150 (x_clear_frame_selections): Use Frun_hook_with_args.
21152 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21154 * xterm.h: Add support for those atoms.
21156 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
21158 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21159 (converted_selections, conversion_fail_tag): New global variables.
21160 (x_selection_request_lisp_error): Free the above.
21161 (x_get_local_selection): Remove unnecessary code.
21162 (x_reply_selection_request): Args changed; handle arbitrary array
21163 of converted selections stored in converted_selections.
21164 Separate the XChangeProperty and SelectionNotify steps.
21165 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21166 (x_convert_selection): New function.
21167 (x_handle_selection_event): Simplify.
21168 (x_get_foreign_selection): Don't ignore incoming requests while
21169 waiting for an answer; this will fail when we implement
21170 SAVE_TARGETS, and seems unnecessary anyway.
21171 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21172 (Vx_sent_selection_functions): Doc fix.
21174 2011-05-26 Leo Liu <sdl.web@gmail.com>
21176 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21178 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21180 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21182 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21183 for fringe update if it has periodic bitmap.
21184 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21185 and fringe_bitmap_periodic_p.
21187 * fringe.c (get_fringe_bitmap_data): New function.
21188 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21189 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21190 row. Mark glyph row for fringe update if periodicity changed.
21192 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21193 for fringe update unless it has periodic bitmap.
21195 2011-05-25 Kenichi Handa <handa@m17n.org>
21197 * xdisp.c (get_next_display_element): Set correct it->face_id for
21198 a static composition.
21200 2011-05-24 Leo Liu <sdl.web@gmail.com>
21203 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21205 * fns.c (crypto_hash_function, Fsha1): New function.
21206 (Fmd5): Use crypto_hash_function.
21207 (syms_of_fns): Add Ssha1.
21209 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21211 * gnutls.c: Remove unused macros.
21212 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21213 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21214 Remove macros that are defined and never used.
21215 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21217 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21219 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21220 (Fx_get_selection_internal): Minor cleanup.
21221 (Fx_own_selection_internal): Rename arguments for consistency with
21224 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21226 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21228 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21230 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21232 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21234 * dispnew.c (scrolling_window): Don't exclude the case that the
21235 last enabled row in the desired matrix touches the bottom boundary.
21237 2011-05-21 Glenn Morris <rgm@gnu.org>
21239 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21240 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21241 and add some more files.
21243 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21245 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21246 report_file_error introduced by the change from 2011-05-07.
21248 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21250 * systime.h (Time): Define only if emacs is defined.
21251 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21252 where the include path doesn't have X11/X.h by default. See
21253 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21255 2011-05-20 Kenichi Handa <handa@m17n.org>
21257 * composite.c (find_automatic_composition): Fix previous change.
21259 2011-05-20 Glenn Morris <rgm@gnu.org>
21261 * lisp.mk: New file, split from Makefile.in.
21262 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21263 (shortlisp): Remove.
21264 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21266 2011-05-19 Glenn Morris <rgm@gnu.org>
21268 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21269 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21270 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21271 (lisp): Set the order to that of loadup.el.
21272 (shortlisp): Make it a copy of $lisp.
21273 (SOME_MACHINE_LISP): Remove.
21274 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21275 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21277 2011-05-18 Kenichi Handa <handa@m17n.org>
21279 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21280 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21281 (find_automatic_composition): Mostly rewrite for efficiency.
21283 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21285 * makefile.w32-in: Update dependencies.
21287 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21289 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21290 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21292 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21294 Fix some integer overflow issues, such as string length overflow.
21296 * insdel.c (count_size_as_multibyte): Check for string overflow.
21298 * character.c (lisp_string_width): Check for string overflow.
21299 Use EMACS_INT, not int, for string indexes and lengths; in
21300 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21301 the resulting string length overflows an EMACS_INT; instead,
21302 report a string overflow if no precision given. When checking for
21303 precision exhaustion, use a check that cannot possibly have
21304 integer overflow. (Bug#8675)
21305 * character.h (lisp_string_width): Adjust to new signature.
21307 * alloc.c (string_overflow): New function.
21308 (Fmake_string): Use it. This doesn't change behavior, but saves
21309 a few bytes and will simplify future changes.
21310 * character.c (string_escape_byte8): Likewise.
21311 * lisp.h (string_overflow): New decl.
21313 Fixups, following up to the user-interface timestamp change.
21314 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21315 for UI timestamps, instead of unsigned long.
21316 * msdos.c (mouse_get_pos): Likewise.
21317 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21318 * w32gui.h (Time): Define by including "systime.h" rather than by
21319 declaring it ourselves. (Bug#8664)
21321 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21322 * image.c (clear_image_cache): Likewise.
21324 * term.c (term_mouse_position): Don't assume time_t wraparound.
21326 Be more systematic about user-interface timestamps.
21327 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21328 and sometimes 'EMACS_UINT', to represent these timestamps.
21329 This change causes it to use 'Time' uniformly, as that's what X uses.
21330 This makes the code easier to follow, and makes it easier to catch
21331 integer overflow bugs such as Bug#8664.
21332 * frame.c (Fmouse_position, Fmouse_pixel_position):
21333 Use Time, not unsigned long, for user-interface timestamps.
21334 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21335 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21336 * keyboard.h (last_event_timestamp): Likewise.
21337 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21338 * menu.h (xmenu_show): Likewise.
21339 * term.c (term_mouse_position): Likewise.
21340 * termhooks.h (struct input_event.timestamp): Likewise.
21341 (struct terminal.mouse_position_hook): Likewise.
21342 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21343 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21344 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21345 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21346 what it was before.
21347 * menu.h, termhooks.h: Include "systime.h", for Time.
21349 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21350 Don't assume that the difference between two unsigned long values
21351 can fit into an integer. At this point, we know button_down_time
21352 <= event->timestamp, so the difference must be nonnegative, so
21353 there's no need to cast the result if double-click-time is
21354 nonnegative, as it should be; check that it's nonnegative, just in
21355 case. This bug is triggered when events are more than 2**31 ms
21356 apart (about 25 days). (Bug#8664)
21358 * xselect.c (last_event_timestamp): Remove duplicate decl.
21359 (x_own_selection): Remove needless cast to unsigned long.
21361 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21362 that always fit in int. Use a sentinel instead of a counter, to
21363 avoid a temp and to allay GCC's concerns about possible int overflow.
21364 * frame.h (struct frame): Use int for menu_bar_items_used
21365 instead of EMACS_INT, since it always fits in int.
21367 * menu.c (grow_menu_items): Check for int overflow.
21369 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21371 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21372 Before, the code was not consistent. These values cannot exceed
21373 2**31 - 1 so there's no need to make them unsigned.
21374 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21375 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21376 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21378 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21380 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21381 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21382 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21383 presumably because the widths might not match.
21385 * window.c (size_window): Avoid needless test at loop start.
21387 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21389 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21391 2011-05-12 Drew Adams <drew.adams@oracle.com>
21393 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21395 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21397 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21398 `width' to `bar_area_x' and `bar_area_width', respectively.
21399 (x_scroll_run): Take account of fringe background extension.
21401 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21402 Rename local vars `left' and `width' to `bar_area_x' and
21403 `bar_area_width', respectively.
21404 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21405 background extension.
21407 2011-05-10 Jim Meyering <meyering@redhat.com>
21409 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21411 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21413 * image.c (Finit_image_library): Return t for built-in image types,
21414 like pbm and xbm. (Bug#8640)
21416 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21418 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21420 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21422 * w32console.c (Fset_screen_color): Doc fix.
21423 (Fget_screen_color): New function.
21424 (syms_of_ntterm): Defsubr it.
21426 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21427 unlink the temporary file if Fcall_process didn't create it in the
21429 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21430 child process will be redirected to a file specified with `:file'.
21431 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21432 cue to call_process_cleanup not to close that handle.
21434 2011-05-07 Ben Key <bkey76@gmail.com>
21436 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21437 one of two shell specific rules, either bootstrap-temacs-CMD or
21438 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21439 to the previous implementation of the bootstrap-temacs rule.
21440 The bootstrap-temacs-CMD rule is similar to the previous
21441 implementation of the bootstrap-temacs rule except that it
21442 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21445 These changes, along with some changes to nt/configure.bat,
21446 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21447 earlier fix to add support for --cflags and --ldflags options
21448 that include quotes so that it works whether make uses cmd or
21451 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21453 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21454 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21456 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21457 a string. Handle both cases.
21458 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21459 (Fdbus_register_method): Use Qinvalid_function.
21461 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21463 * makefile.w32-in: Update dependencies.
21464 (LISP_H): Add inttypes.h and stdin.h.
21465 (PROCESS_H): Add unistd.h.
21467 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21469 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21470 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21472 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21474 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21476 * term.c (vfatal): Remove stray call to va_end.
21477 It's not needed and the C Standard doesn't allow it here anyway.
21479 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21480 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21482 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21485 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21487 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21489 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21491 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21493 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21495 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21496 * charset.c (Fdefine_charset_internal): Don't initialize
21497 charset.code_space[15]. The value was garbage, on hosts with
21498 32-bit int (Bug#8600).
21500 * lread.c (read_integer): Be more consistent with string-to-number.
21501 Use string_to_number to do the actual conversion; this avoids
21502 rounding errors and fixes some other screwups. Without this fix,
21503 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21504 (digit_to_number): Move earlier, for benefit of read_integer.
21505 Return -1 if the digit is out of range for the base, -2 if it is
21506 not a digit in any supported base. (Bug#8602)
21508 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21510 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21511 to match comment at start of function. This also removes a
21512 GCC warning about overflow in a 32+64-bit port.
21514 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21516 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21517 Reported by Stefan Monnier in
21518 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21519 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21520 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21522 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21523 (EMACS_UINTPTR): Likewise, with uintptr_t.
21525 * lisp.h: Prefer 64-bit EMACS_INT if available.
21526 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21527 on 32-bit hosts that have 64-bit int, so that they can access
21529 However, temporarily disable this change unless the temporary
21530 symbol WIDE_EMACS_INT is defined.
21532 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21534 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21535 This removes an assumption that EMACS_INT and long are the same
21536 width as pointers. The assumption is true for Emacs porting targets
21537 now, but we want to make other targets possible.
21538 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21539 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21540 In the rest of the code, change types of integers that hold casted
21541 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21542 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21543 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21544 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21545 No need to cast type when ORing.
21546 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21547 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21548 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21549 assume EMACS_INT is the same width as char *.
21550 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21551 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21552 Remove no-longer-needed casts.
21553 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21554 (xg_tool_bar_help_callback, xg_make_tool_item):
21555 Use EMACS_INTPTR to hold an integer
21556 that will be cast to void *; this can avoid a GCC warning
21557 if EMACS_INT is not the same width as void *.
21558 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21559 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21560 (current_message_1, set_message_1):
21561 Use a local to convert to proper width without a cast.
21562 * xmenu.c (dialog_selection_callback): Likewise.
21564 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21565 Also, don't assume VALBITS / RAND_BITS is less than 5,
21566 and don't rely on undefined behavior when shifting a 1 left into
21568 * lisp.h (get_random): Change signature to match.
21570 * lread.c (hash_string): Use size_t, not int, for hash computation.
21571 Normally we prefer signed values; but hashing is special, because
21572 it's better to use unsigned division on hash table sizes so that
21573 the remainder is nonnegative. Also, size_t is the natural width
21574 for hashing into memory. The previous code used 'int', which doesn't
21575 retain enough info to hash well into very large tables.
21576 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21578 * dbusbind.c: Don't possibly lose pointer info when converting.
21579 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21580 Use XPNTR rather than XHASH, so that the high-order bits of
21581 the pointer aren't lost when converting through void *.
21583 * eval.c (Fautoload): Don't double-shift a pointer.
21585 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21587 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21589 * gnutls.c (DEF_GNUTLS_FN):
21590 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21592 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21594 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21597 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21599 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21600 New version that can reserve upto 2GB of heap space.
21602 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21604 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21606 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21608 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21609 `gnutls_certificate_set_x509_key_file'.
21611 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21613 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21614 Update dependencies.
21616 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21618 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21619 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21620 Remove unused parameter `fildes'.
21621 * process.c (read_process_output, send_process): Don't pass it.
21623 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21625 Fix previous change: the library cache is defined in w32.c.
21626 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21627 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21629 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21631 Implement dynamic loading of GnuTLS on Windows.
21633 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21634 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21635 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21638 * gnutls.c (Qgnutls_dll): Define.
21639 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21640 (gnutls_*): Declare function pointers.
21641 (init_gnutls_functions): New function to initialize function pointers.
21642 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21643 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21644 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21645 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21646 (emacs_gnutls_write, emacs_gnutls_read)
21647 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21648 (Fgnutls_available_p): New function.
21649 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21650 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21651 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21653 * image.c: Include w32.h.
21654 (Vimage_type_cache): Delete.
21655 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21656 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21657 (w32_delayed_load): Move to w32.c.
21659 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21661 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21662 (w32_delayed_load): Move from image.c. When loading a library, record
21663 its filename in the :loaded-from property of the library id.
21664 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21665 Initialize and staticpro them.
21666 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21668 * process.c: Include lisp.h before w32.h, not after.
21669 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21670 instead of gnutls_record_check_pending.
21672 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21674 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21676 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21677 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21680 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21682 * xterm.c (x_set_frame_alpha): Do not set property on anything
21683 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21685 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21687 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21689 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21691 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21692 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21693 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21694 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21695 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21696 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21697 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21698 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21699 (Qgnutls_bootprop_callbacks_verify): Make static.
21701 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21703 * callproc.c: Indentation fixup.
21705 * sysdep.c (wait_for_termination_1): Make static.
21706 (wait_for_termination, interruptible_wait_for_termination):
21707 Move after wait_for_termination_1.
21709 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21711 * sysdep.c (interruptible_wait_for_termination): New function
21712 which is like wait_for_termination, but allows keyboard
21715 * callproc.c (Fcall_process): Add (:file "file") as an option for
21717 (Fcall_process_region): Ditto.
21719 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21721 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21722 rather than `XVECTOR (FOO)->size'.
21724 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21725 inttypes.h, as a gnulib replacement is used if it not available in
21728 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21730 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21731 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21732 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21734 * coding.c (coding_alloc_by_realloc): Error out if destination
21735 will grow beyond MOST_POSITIVE_FIXNUM.
21736 (decode_coding_emacs_mule): Abort if there isn't enough place in
21737 charbuf for the composition carryover bytes. Reserve an extra
21738 space for up to 2 characters produced in a loop.
21739 (decode_coding_iso_2022): Abort if there isn't enough place in
21740 charbuf for the composition carryover bytes.
21742 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21744 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21745 aborting when %lld or %lll format is passed.
21746 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21747 %llo or %llx format is passed. (Bug#8545)
21749 * window.c (window_scroll_line_based): Use a marker instead of
21750 simple variables to record original value of point. (Bug#7952)
21752 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21753 produced by %s or %c overflows available buffer space. (Bug#8545)
21755 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21757 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21758 (SIZE_MAX): Move defn after all includes, as they might #define it.
21760 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21762 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21764 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21766 * keyboard.c (Qdelayed_warnings_hook): Define.
21767 (command_loop_1): Run `delayed-warnings-hook'
21768 if Vdelayed_warnings_list is non-nil.
21769 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21770 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21772 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21774 * doprnt.c (doprnt): Don't return value smaller than the buffer
21775 size if the message was truncated. (Bug#8545).
21777 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21779 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21780 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21782 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21784 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21786 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21788 * makefile.w32-in: Update dependencies.
21790 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21792 Improve `doprnt' and its usage. (Bug#8545)
21793 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21794 `format_end'. Remove support for %l as a conversion specifier.
21795 Don't use xrealloc. Improve diagnostics when the %l size modifier
21796 is used. Update the commentary.
21798 * eval.c (verror): Simplify calculation of size_t.
21800 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21803 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21805 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21808 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21810 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21811 This makes this file independent of the recent pseudovector change.
21813 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21815 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21817 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21818 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21819 Remove unused local.
21820 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21822 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21823 GCC 4.6.0 optimizes based on type-based alias analysis.
21824 For example, if b is of type struct buffer * and v of type struct
21825 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21826 != &v->size, and therefore "v->size = 1; b->size = 2; return
21827 v->size;" must therefore return 1. This assumption is incorrect
21828 for Emacs, since it type-puns struct Lisp_Vector * with many other
21829 types. To fix this problem, this patch adds a new type struct
21830 vectorlike_header that documents the constraints on layout of vectors
21831 and pseudovectors, and helps optimizing compilers not get fooled
21832 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21833 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21834 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21836 (XSETPVECTYPE): Rewrite in terms of new macro.
21837 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21838 This is a bit clearer, and further avoids the possibility of
21839 undesirable aliasing.
21840 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21841 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21842 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21843 since Lisp_Subr is a special case (no "next" field).
21844 (ASIZE): Now uses header.size rather than size.
21845 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21846 to avoid the hassle of writing XVECTOR (foo)->header.size.
21847 (struct vectorlike_header): New type.
21848 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21849 object, to help avoid aliasing.
21850 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21851 (SUBRP): Likewise, since Lisp_Subr is a special case.
21852 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21853 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21854 (struct Lisp_Hash_Table): Combine first two members into a single
21855 struct vectorlike_header member. All uses of "size" and "next" members
21856 changed to be "header.size" and "header.next".
21857 * buffer.h (struct buffer): Likewise.
21858 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21859 * frame.h (struct frame): Likewise.
21860 * process.h (struct Lisp_Process): Likewise.
21861 * termhooks.h (struct terminal): Likewise.
21862 * window.c (struct save_window_data, struct saved_window): Likewise.
21863 * window.h (struct window): Likewise.
21864 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21865 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21866 * buffer.c (init_buffer_once): Likewise.
21867 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21869 * process.c (Fformat_network_address): Use local var for size,
21872 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21874 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21875 * data.c (atof): Remove decl; no longer used or needed.
21876 (digit_to_number): Move to lread.c.
21877 (Fstring_to_number): Use new string_to_number function, to be
21878 consistent with how the Lisp reader treats infinities and NaNs.
21879 Do not assume that floating-point numbers represent EMACS_INT
21880 without losing information; this is not true on most 64-bit hosts.
21881 Avoid double-rounding errors, by insisting on integers when
21882 parsing non-base-10 numbers, as the documentation specifies.
21883 * lisp.h (string_to_number): New decl, replacing ...
21884 (isfloat_string): Remove.
21885 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21886 (read1): Do not accept +. and -. as integers; this
21887 appears to have been a coding error. Similarly, do not accept
21888 strings like +-1e0 as floating point numbers. Do not report
21889 overflow for integer overflows unless the base is not 10 which
21890 means we have no simple and reliable way to continue.
21891 Break out the floating-point parsing into a new
21892 function string_to_number, so that Fstring_to_number parses
21893 floating point numbers consistently with the Lisp reader.
21894 (digit_to_number): Move here from data.c. Make it static inline.
21895 (E_CHAR, EXP_INT): Remove, replacing with ...
21896 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21897 (string_to_number): New function, replacing isfloat_string.
21898 This function checks for valid syntax and produces the resulting
21899 Lisp float number too. Rework it so that string-to-number
21900 no longer mishandles examples like "1.0e+". Use strtoumax,
21901 so that overflow for non-base-10 numbers is reported only when
21902 there's no portable and simple way to convert to floating point.
21904 * textprop.c (set_text_properties_1): Rewrite for clarity,
21905 and to avoid GCC warning about integer overflow.
21907 * intervals.h (struct interval): Use EMACS_INT for members
21908 where EMACS_UINT might cause problems. See
21909 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21910 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21911 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21913 (offset_intervals): Tell GCC not to worry about length overflow
21914 when negating a negative length.
21916 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21917 (overrun_check_free): Likewise.
21919 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21920 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21923 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21924 (gnutls_make_error): Rename local to avoid shadowing.
21925 (gnutls_emacs_global_deinit): ifdef out; not used.
21926 (Fgnutls_boot): Use const for pointer to readonly storage.
21927 Comment out unused local. Fix pointer signedness problems.
21929 * lread.c (openp): Don't stuff size_t into an 'int'.
21930 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21931 about possible signed overflow.
21933 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21934 (GDK_KEY_g): Don't define if already defined.
21935 (xg_prepare_tooltip): Avoid pointer signedness problem.
21936 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21938 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21939 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21941 * xfns.c (Fx_window_property): Simplify a bit,
21942 to make a bit faster and to avoid GCC 4.6.0 warning.
21943 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21945 * fns.c (internal_equal): Don't assume size_t fits in int.
21947 * alloc.c (compact_small_strings): Tighten assertion a little.
21949 Replace pEd with more-general pI, and fix some printf arg casts.
21950 * lisp.h (pI): New macro, generalizing old pEd macro to other
21951 conversion specifiers. For example, use "...%"pI"d..." rather
21952 than "...%"pEd"...".
21953 (pEd): Remove. All uses replaced with similar uses of pI.
21954 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21955 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21956 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21957 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21958 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21959 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21960 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21962 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21963 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21964 * print.c (safe_debug_print, print_object): Likewise.
21965 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21967 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21968 avoiding the 0 flag, which is not portable.
21969 * process.c (Fmake_network_process): Use pI to avoid cast.
21970 * region-cache.c (pp_cache): Likewise.
21971 * xdisp.c (decode_mode_spec): Likewise.
21972 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21973 behavior on 64-bit hosts with printf arg.
21974 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21975 (x_stop_queuing_selection_requests): Likewise.
21976 (x_get_window_property): Don't truncate byte count to an 'int'
21979 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21980 here, since it parses constructs like leading '-' and spaces,
21981 which are not wanted; and it overflows with large numbers.
21982 Instead, simply match F[0-9]+, which is what is wanted anyway.
21984 * alloc.c: Remove unportable assumptions about struct layout.
21985 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21986 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21987 (allocate_vectorlike, make_pure_vector): Use the new macros,
21988 plus offsetof, to remove unportable assumptions about struct layout.
21989 These assumptions hold on all porting targets that I know of, but
21990 they are not guaranteed, they're easy to remove, and removing them
21991 makes further changes easier.
21993 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21994 This doesn't fix a bug but makes the code clearer.
21995 (string_overrun_cookie): Now const. Use initializers that
21996 don't formally overflow signed char, to avoid warnings.
21997 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21998 can cause Emacs to crash when string overrun checking is enabled.
21999 (allocate_buffer): Don't assume sizeof (struct buffer) is a
22000 multiple of sizeof (EMACS_INT); it need not be, if
22001 alignof(EMACS_INT) < sizeof (EMACS_INT).
22002 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
22004 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
22006 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
22008 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
22010 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
22011 supposed to be handshaking. (Bug#8556)
22012 Reported by Paul Eggert <eggert@cs.ucla.edu>.
22014 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
22016 * lisp.h (Qdebug): List symbol.
22017 * eval.c (Qdebug): Restore global linkage.
22018 * keyboard.c (debug-on-event): New variable.
22019 (handle_user_signal): Break into debugger when debug-on-event
22020 matches the current signal symbol.
22022 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22024 * alloc.c (check_sblock, check_string_bytes)
22025 (check_string_free_list): Convert to standard C.
22027 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22029 * w32.c (emacs_gnutls_push): Fix typo.
22031 2011-04-25 Eli Zaretskii <eliz@gnu.org>
22033 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22034 "cast to pointer from integer of different size".
22036 Improve doprnt and its use in verror. (Bug#8545)
22037 * doprnt.c (doprnt): Document the set of format control sequences
22038 supported by the function. Use SAFE_ALLOCA instead of always
22041 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22042 is one byte too soon. Don't use xrealloc; instead xfree and
22045 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22047 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22050 * gnutls.c: Renamed global_initialized to
22051 gnutls_global_initialized. Added internals for the
22052 :verify-hostname-error, :verify-error, and :verify-flags
22053 parameters of `gnutls-boot' and documented those parameters in the
22054 docstring. Start callback support.
22055 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22056 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22057 on error. Return error code.
22058 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22059 (emacs_gnutls_read): Likewise.
22060 (Fgnutls_boot): Return handshake error code.
22061 (emacs_gnutls_handle_error): New function.
22062 (wsaerror_to_errno): Likewise.
22064 * w32.h (emacs_gnutls_pull): Add prototype.
22065 (emacs_gnutls_push): Likewise.
22067 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22068 (emacs_gnutls_push): Likewise.
22070 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22072 * process.c (wait_reading_process_output): Check if GnuTLS
22073 buffered some data internally if no FDs are set for TLS
22076 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22077 (LIBS): Link to USER_LIBS.
22078 ($(BLD)/gnutls.$(0)): New target.
22080 2011-04-24 Eli Zaretskii <eliz@gnu.org>
22082 * xdisp.c (handle_single_display_spec): Rename the
22083 display_replaced_before_p argument into display_replaced_p, to
22084 make it consistent with the commentary. Fix typos in the
22087 * textprop.c (syms_of_textprop): Remove dead code.
22088 (copy_text_properties): Delete obsolete commentary about an
22089 interface that was deleted long ago. Fix typos in the description
22092 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22093 to changes in oldXMenu/XMenu.h from 2011-04-16.
22094 <menu_help_message, prev_menu_help_message>: Constify.
22095 (IT_menu_make_room): menu->help_text is now `const char **';
22098 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22099 to changes in oldXMenu/XMenu.h from 2011-04-16.
22100 (struct XMenu): Declare `help_text' `const char **'.
22102 * xfaces.c <Qunspecified>: Make extern again.
22104 * syntax.c: Include sys/types.h before including regex.h, as
22107 * doc.c (get_doc_string): Improve the format passed to `error'.
22109 * doprnt.c (doprnt): Improve commentary.
22111 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22113 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22116 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22117 changes in globals.h immediately force recompilation.
22118 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22119 $(CURDIR)/s/ms-w32.h.
22120 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22122 * character.c (Fchar_direction): Function deleted.
22123 (syms_of_character): Don't defsubr it.
22124 <char-direction-table>: Deleted.
22126 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22128 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22129 * doprnt.c: Include limits.h.
22130 (SIZE_MAX): New macro.
22131 (doprnt): Return a size_t value. 2nd arg is now size_t.
22132 Many local variables are now size_t instead of int or unsigned.
22133 Improve overflow protection. Support `l' modifier for integer
22134 conversions. Support %l conversion. Don't assume an EMACS_INT
22135 argument for integer conversions and for %c.
22137 * lisp.h (doprnt): Restore prototype.
22139 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22140 $(SRC)/character.h.
22142 * Makefile.in (base_obj): Add back doprnt.o.
22144 * deps.mk (doprnt.o): Add back prerequisites.
22145 (callint.o): Depend on character.h.
22147 * eval.c (internal_lisp_condition_case): Include the handler
22148 representation in the error message.
22149 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22150 when breaking from the loop.
22152 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22154 * callint.c (Fcall_interactively): When displaying error message
22155 about invalid control letter, pass the character's codepoint, not
22156 a pointer to its multibyte form. Improve display of the character
22157 in octal and display also its hex code.
22159 * character.c (char_string): Use %x to display the (unsigned)
22160 codepoint of an invalid character, to avoid displaying a bogus
22163 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22164 `error', not SYMBOL_NAME itself.
22166 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22167 character arguments to `error'.
22169 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22170 to `error' in error message about FINAL_CHAR argument. Make sure
22171 FINAL_CHAR is a character, and use %c when it is passed as
22172 argument to `error'.
22174 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22176 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22178 * w32.c: Include <time.h>.
22179 (sys_localtime): New function.
22181 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22183 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22185 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22187 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22189 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22190 zombies (Bug#8467).
22192 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22194 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22195 gl_state.e_property when gl_state.object is Qt.
22197 * insdel.c (make_gap_larger): Remove limitation of buffer size
22200 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22202 * xdisp.c (lookup_glyphless_char_display)
22203 (produce_glyphless_glyph): Handle cons cell entry in
22204 glyphless-char-display.
22205 (Vglyphless_char_display): Document it.
22207 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22208 glyphless-char-display.
22210 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22212 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22214 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22216 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22217 definition for no-X builds.
22219 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22221 Static checks with GCC 4.6.0 and non-default toolkits.
22223 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22225 * process.c (keyboard_bit_set): Define only if SIGIO.
22226 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22227 (send_process): Repair possible setjmp clobbering.
22229 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22231 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22233 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22235 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22236 Define only if needed.
22238 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22239 by pacifying GCC about it. Maybe it's time to retire it?
22240 * xfaces.c (USG, __TIMEVAL__): Likewise.
22242 * dispextern.h (struct redisplay_interface): Rename param
22243 to avoid shadowing.
22244 * termhooks.h (struct terminal): Likewise.
22245 * xterm.c (xembed_send_message): Likewise.
22247 * insdel.c (make_gap_smaller): Define only if
22248 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22250 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22253 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22254 so that we aren't warned about unused symbols.
22256 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22258 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22260 * xfns.c (x_real_positions): Mark locals as initialized.
22262 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22264 * xterm.c: Fix problems found by static analysis with other toolkits.
22265 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22266 (x_dispatch_event): Declare static if USE_GTK, and
22267 define if USE_GTK || USE_X_TOOLKIT.
22268 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22269 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22270 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22271 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22273 * xmenu.c (menu_help_callback): Pointer type fixes.
22274 Use const pointers when pointing at readonly data. Avoid pointer
22275 signedness clashes.
22276 (FALSE): Remove unused macro.
22277 (update_frame_menubar): Remove unused decl.
22279 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22281 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22282 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22283 (single_menu_item): Rename local to avoid shadowing.
22285 * keyboard.c (make_lispy_event): Remove unused local var.
22287 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22288 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22290 * bitmaps: Change bitmaps from unsigned char back to the X11
22291 compatible char. Avoid the old compiler warnings about
22292 out-of-range initializers by using, for example, '\xab' rather
22295 * xgselect.c (xgselect_initialize): Check vs interface
22296 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22298 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22300 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22301 to read-only memory.
22303 * fns.c (vector): Remove; this old hack is no longer needed.
22305 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22307 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22309 * xrdb.c (x_load_resources): Omit unused local.
22311 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22312 (x_window): Rename locals to avoid shadowing.
22313 (USG): Use the kludged USG macro, to pacify gcc.
22315 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22316 (x_term_init): Remove local to avoid shadowing.
22318 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22320 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22321 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22323 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22325 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22327 Fix regex.c, syntax.c and friends for buffers > 2GB.
22328 * syntax.h (struct gl_state_s): Declare character position members
22331 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22333 * textprop.c (verify_interval_modification, interval_of):
22334 Declare arguments EMACS_INT.
22336 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22339 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22341 * indent.c (Fvertical_motion): Local variable it_start is now
22344 * regex.c (re_match, re_match_2, re_match_2_internal)
22345 (bcmp_translate, regcomp, regexec, print_double_string)
22346 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22347 (re_compile_pattern, re_exec): Declare arguments and local
22348 variables `size_t' and `ssize_t' and return values `regoff_t', as
22350 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22351 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22352 <compile_stack_type>: `size' and `avail' are now `size_t'.
22354 * regex.h <regoff_t>: Use ssize_t, not int.
22355 (re_search, re_search_2, re_match, re_match_2): Arguments that
22356 specify buffer/string position and length are now ssize_t and
22357 size_t. Return type is regoff_t.
22359 2011-04-16 Ben Key <bkey76@gmail.com>
22361 * nsfont.m: Fixed bugs in ns_get_family and
22362 ns_descriptor_to_entity that were caused by using free to
22363 deallocate memory blocks that were allocated by xmalloc (via
22364 xstrdup). This caused Emacs to crash when compiled with
22365 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22366 --enable-checking=xmallocoverrun). xfree is now used to
22367 deallocate these memory blocks.
22369 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22371 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22373 emacs_write: Accept and return EMACS_INT for sizes.
22374 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22376 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22377 Accept and return EMACS_INT.
22378 (emacs_gnutls_write): Return the number of bytes written on
22380 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22381 (emacs_read, emacs_write): Remove check for negative size, as the
22382 Emacs source code has been audited now.
22383 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22384 (emacs_read, emacs_write): Use it.
22385 * process.c (send_process): Adjust to the new signatures of
22386 emacs_write and emacs_gnutls_write. Do not attempt to store
22387 a byte offset into an 'int'; it might overflow.
22388 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22390 * sound.c: Don't assume sizes fit in 'int'.
22391 (struct sound_device.period_size, alsa_period_size):
22392 Return EMACS_INT, not int.
22393 (struct sound_device.write, vox_write, alsa_write):
22394 Accept EMACS_INT, not int.
22395 (wav_play, au_play): Use EMACS_INT to store sizes and to
22396 record read return values.
22398 2011-04-15 Ben Key <bkey76@gmail.com>
22400 * keyboard.c (Qundefined): Don't declare static since it is used
22402 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22403 static since they are used in nsfont.m.
22405 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22407 * process.c (Qprocessp): Don't declare static.
22408 * lisp.h (Qprocessp): Declare again.
22410 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22412 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22414 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22416 Improve C-level modularity by making more things 'static'.
22418 Don't publish debugger-only interfaces to other modules.
22419 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22420 (verify_bytepos, count_markers): Move decls to the only modules
22422 * region-cache.h (pp_cache): Likewise.
22423 * window.h (check_all_windows): Likewise.
22424 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22426 * sysdep.c (croak): Now static, if
22427 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22428 * syssignal.h (croak): Declare only if not static.
22430 * alloc.c (refill_memory_reserve): Now static if
22431 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22432 * lisp.h (refill_memory_reserve): Declare only if not static.
22434 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22435 Define only if USE_LUCID.
22437 * xrdb.c (x_customization_string, x_rm_string): Now static.
22439 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22440 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22442 * xdisp.c (draw_row_with_mouse_face): Now static.
22443 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22445 * window.h (check_all_windows): Mark externally visible.
22447 * window.c (window_deletion_count): Now static.
22449 * undo.c: Make symbols static if they're not exported.
22450 (last_undo_buffer, last_boundary_position, pending_boundary):
22453 * textprop.c (interval_insert_behind_hooks): Now static.
22454 (interval_insert_in_front_hooks): Likewise.
22456 * term.c: Make symbols static if they're not exported.
22457 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22458 (max_frame_lines, tty_set_terminal_modes):
22459 (tty_reset_terminal_modes, tty_turn_off_highlight):
22460 (get_tty_terminal): Now static.
22461 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22462 * termhooks.h (term_mouse_moveto): Do not declare if
22463 HAVE_WINDOW_SYSTEM.
22464 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22465 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22467 * sysdep.c: Make symbols static if they're not exported.
22468 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22470 (sigprocmask_set, full_mask): Remove; unused.
22471 (wait_debugging): Mark as visible.
22472 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22473 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22475 * syntax.c (syntax_temp): Define only if !__GNUC__.
22477 * sound.c (current_sound_device, current_sound): Now static.
22479 * search.c (searchbufs, searchbuf_head): Now static.
22481 * scroll.c (scroll_cost): Remove; unused.
22482 * dispextern.h (scroll_cost): Remove decl.
22484 * region-cache.h (pp_cache): Mark as externally visible.
22486 * process.c: Make symbols static if they're not exported.
22487 (process_tick, update_tick, create_process, chan_process):
22488 (Vprocess_alist, proc_buffered_char, datagram_access):
22489 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22490 (deactivate_process): Mark defn as static, as well as decl.
22491 * lisp.h (create_process): Remove decl.
22492 * process.h (chan_process, Vprocess_alist): Remove decls.
22494 * print.c: Make symbols static if they're not exported.
22495 (print_depth, new_backquote_output, being_printed, print_buffer):
22496 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22497 (print_interval, print_number_index, initial_stderr_stream):
22499 * lisp.h (Fprinc): Remove decl.
22500 (debug_output_compilation_hack): Mark as externally visible.
22502 * sysdep.c (croak): Move decl from here to syssignal.h.
22503 * syssignal.h (croak): Put it here, so the API can be checked when
22504 'croak' is called from dissociate_if_controlling_tty.
22506 * minibuf.c: Make symbols static if they're not exported.
22507 (minibuf_save_list, choose_minibuf_frame): Now static.
22508 * lisp.h (choose_minibuf_frame): Remove decl.
22510 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22512 * lread.c: Make symbols static if they're not exported.
22513 (read_objects, initial_obarray, oblookup_last_bucket_number):
22515 (make_symbol): Remove; unused.
22516 * lisp.h (initial_obarray, make_symbol): Remove decls.
22518 * keyboard.c: Make symbols static if they're not exported.
22519 (single_kboard, recent_keys_index, total_keys, recent_keys):
22520 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22521 (this_single_command_key_start, echoing, last_auto_save):
22522 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22523 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22524 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22525 (Vlispy_mouse_stem, double_click_count):
22527 (force_auto_save_soon): Define only if SIGDANGER.
22528 (ignore_mouse_drag_p): Now static if
22529 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22530 (print_help): Remove; unused.
22531 (stop_character, last_timer_event): Mark as externally visible.
22532 * keyboard.h (ignore_mouse_drag_p): Declare only if
22533 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22534 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22535 * lisp.h (echoing): Remove decl.
22536 (force_auto_save_soon): Declare only if SIGDANGER.
22537 * xdisp.c (redisplay_window): Simplify code, to make it more
22538 obvious that ignore_mouse_drag_p is not accessed if !defined
22539 USE_GTK && !defined HAVE_NS.
22541 * intervals.c: Make symbols static if they're not exported.
22542 (merge_properties_sticky, merge_interval_right, delete_interval):
22544 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22546 * insdel.c: Make symbols static if they're not exported.
22547 However, leave prepare_to_modify_buffer alone. It's never
22548 called from outside this function, but that appears to be a bug.
22549 (combine_after_change_list, combine_after_change_buffer):
22550 (adjust_after_replace, signal_before_change): Now static.
22551 (adjust_after_replace_noundo): Remove; unused.
22552 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22553 (signal_before_change): Remove decls.
22555 * indent.c (val_compute_motion, val_vmotion): Now static.
22557 * image.c: Make symbols static if they're not exported.
22558 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22560 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22561 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22563 * fringe.c (standard_bitmaps): Now static.
22564 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22566 * frame.c: Make symbols static if they're not exported.
22567 (x_report_frame_params, make_terminal_frame): Now static.
22568 (get_frame_param): Now static, unless HAVE_NS.
22569 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22570 (x_get_resource_string): Remove; not used.
22571 * frame.h (make_terminal_frame, x_report_frame_params):
22572 (x_get_resource_string); Remove decls.
22573 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22574 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22576 * font.c, fontset.c: Make symbols static if they're not exported.
22577 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22578 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22579 * font.c (font_close_object): Now static.
22580 * font.h (font_close_object): Remove.
22581 * fontset.c (FONTSET_OBJLIST): Remove.
22582 (free_realized_fontset) #if-0 the body, which does nothing.
22583 (face_suitable_for_char_p): #if-0, as it's never called.
22584 * fontset.h (face_suitable_for_char_p): Remove decl.
22585 * xfaces.c (face_at_string_position):
22586 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22587 since 0 is always ASCII.
22589 * fns.c (weak_hash_tables): Now static.
22591 * fileio.c: Make symbols static if they're not exported.
22592 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22593 (Vwrite_region_annotation_buffers): Now static.
22595 * eval.c: Make symbols static if they're not exported.
22596 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22597 * lisp.h (backtrace_list): Remove decl.
22599 * emacs.c: Make symbols static if they're not exported.
22600 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22601 (fatal_error_code, fatal_error_signal_hook, standard_args):
22603 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22604 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22605 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22606 * lisp.h (fatal_error_signal_hook): Remove decl.
22607 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22609 * editfns.c: Move a (normally-unused) function to its only use.
22610 * editfns.c, lisp.h (get_operating_system_release): Remove.
22611 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22612 worth the hassle of breaking this out.
22614 * xterm.c: Make symbols static if they're not exported.
22615 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22616 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22617 (x_destroy_window, x_delete_display):
22619 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22620 (x_mouse_leave): Remove; unused.
22621 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22622 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22623 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22625 (x_mouse_leave): Declare only if WINDOWSNT.
22626 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22627 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22630 * ftxfont.c: Make symbols static if they're not exported.
22631 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22633 * font.h (ftxfont_driver): Likewise.
22635 * xfns.c: Make symbols static if they're not exported.
22636 (x_last_font_name, x_display_info_for_name):
22637 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22638 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22639 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22640 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22641 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22642 (last_show_tip_args): Now static.
22643 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22644 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22645 (x_screen_planes): Remove; unused.
22646 * dispextern.h (x_screen_planes): Remove decl.
22648 * dispnew.c: Make symbols static if they're not exported.
22649 * dispextern.h (redraw_garbaged_frames, scrolling):
22650 (increment_row_positions): Remove.
22651 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22652 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22654 (redraw_garbaged_frames): Remove; unused.
22656 * xfaces.c: Make symbols static if they're not exported.
22657 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22659 * xterm.h (defined_color): Remove decls.
22660 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22661 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22662 (menu_face_changed_default, defined_color, free_realized_face):
22663 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22664 (ascii_face_of_lisp_face): Remove; unused.
22666 * xdisp.c: Make symbols static if they're not exported.
22667 * dispextern.h (scratch_glyph_row, window_box_edges):
22668 (glyph_to_pixel_coords, set_cursor_from_row):
22669 (get_next_display_element, set_iterator_to_next):
22670 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22671 (show_mouse_face): Remove decls
22672 * frame.h (message_buf_print): Likewise.
22673 * lisp.h (pop_message, set_message, check_point_in_composition):
22675 * xterm.h (set_vertical_scroll_bar): Likewise.
22676 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22677 (message_buf_print, scratch_glyph_row, displayed_buffer):
22678 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22679 (get_next_display_element, show_mouse_face, window_box_edges):
22680 (frame_to_window_pixel_xy, check_point_in_composition):
22681 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22682 (glyph_to_pixel_coords): Remove; unused.
22684 * dired.c (file_name_completion): Now static.
22686 * dbusbind.c (xd_in_read_queued_messages): Now static.
22688 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22689 * data.c (circular_list_error): Remove.
22691 * commands.h (last_point_position, last_point_position_buffer):
22692 (last_point_position_window): Remove decls.
22693 * keyboard.c: Make these variables static.
22695 * coding.h (coding, code_convert_region, encode_coding_gap):
22697 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22698 (iso_code_class, detect_coding, code_convert_region): Now static.
22699 (encode_coding_gap): Remove; unused.
22701 * chartab.c (chartab_chars, chartab_bits): Now static.
22703 * charset.h (charset_iso_8859_1): Remove decl.
22704 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22707 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22708 * ccl.c (Vccl_program_table): Now static.
22709 (check_ccl_update): Remove; unused.
22711 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22712 * category.h: ... from here.
22713 * category.c (check_category_table, set_category_set): Now static.
22715 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22716 * lisp.h: Remove these decls.
22718 * buffer.c (buffer_count): Remove unused var.
22720 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22721 so that it's not optimized away.
22722 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22723 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22724 exported only to the debugger.
22726 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22727 * atimer.h (run_all_atimers): Remove; not exported.
22729 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22730 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22731 was inaccessible from Lisp.
22732 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22733 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22735 alloc.c: Import and export fewer symbols, and remove unused items.
22736 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22738 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22739 it's not optimized away by whole-program optimization.
22740 (message_enable_multibyte, free_misc): Remove.
22741 (catchlist, handlerlist, mark_backtrace):
22742 Declare only if BYTE_MARK_STACK.
22743 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22744 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22745 (message_enable_multibyte): Remove decl.
22746 (free_misc, interval_free_list, float_block, float_block_index):
22747 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22748 (cons_free_list, last_marked_index):
22750 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22751 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22752 (mark_backtrace): Define only if BYTE_MARK_STACK.
22753 * xdisp.c (message_enable_multibyte): Now static.
22755 Declare Lisp_Object Q* variables to be 'static' if not exported.
22756 This makes it easier for human readers (and static analyzers)
22757 to see whether these variables are used from other modules.
22758 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22759 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22760 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22761 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22762 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22763 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22764 * xmenu.c, xselect.c:
22765 Declare Q* vars static if they are not used in other modules.
22766 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22767 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22768 Remove decls of unexported vars.
22769 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22771 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22773 Make Emacs functions such as Fatom 'static' by default.
22774 This makes it easier for human readers (and static analyzers)
22775 to see whether these functions can be called from other modules.
22776 DEFUN now defines a static function. To make the function external
22777 so that it can be used in other C modules, use the new macro DEFUE.
22778 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22779 (Finit_image_library):
22780 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22781 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22782 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22783 Remove decls, since these functions are now static.
22784 (Funintern, Fget_internal_run_time): New decls, since these functions
22785 were already external.
22787 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22788 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22789 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22790 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22791 * keyboard.c, keymap.c, lread.c:
22792 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22793 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22794 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22795 Mark functions with DEFUE instead of DEFUN,
22796 if they are used in other modules.
22797 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22798 decls for now-static functions.
22799 * buffer.h (Fdelete_overlay): Remove decl.
22800 * callproc.c (Fgetenv_internal): Mark as internal.
22801 * composite.c (Fremove_list_of_text_properties): Remove decl.
22802 (Fcomposition_get_gstring): New forward static decl.
22803 * composite.h (Fcomposite_get_gstring): Remove decl.
22804 * dired.c (Ffile_attributes): New forward static decl.
22805 * doc.c (Fdocumntation_property): New forward static decl.
22806 * eval.c (Ffetch_bytecode): New forward static decl.
22807 (Funintern): Remove extern decl; now in .h file where it belongs.
22808 * fileio.c (Fmake_symbolic_link): New forward static decl.
22809 * image.c (Finit_image_library): New forward static decl.
22810 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22811 * intervals.h (Fprevious_property_change):
22812 (Fremove_list_of_text_properties): Remove decls.
22813 * keyboard.c (Fthis_command_keys): Remove decl.
22814 (Fcommand_execute): New forward static decl.
22815 * keymap.c (Flookup_key): New forward static decl.
22816 (Fcopy_keymap): Now static.
22817 * keymap.h (Flookup_key): Remove decl.
22818 * process.c (Fget_process): New forward static decl.
22819 (Fprocess_datagram_address): Mark as internal.
22820 * syntax.c (Fsyntax_table_p): New forward static decl.
22821 (skip_chars): Remove duplicate decl.
22822 * textprop.c (Fprevious_property_change): New forward static decl.
22823 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22825 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22826 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22828 * editfns.c (Fformat): Remove unreachable code.
22830 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22832 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22835 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22837 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22838 when at ZV. (Bug#8487)
22840 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22842 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22844 * keyboard.c (parse_tool_bar_item): Likewise.
22845 * sound.c (sound_cleanup, alsa_close): Likewise.
22846 * termcap.c (tgetent): Likewise.
22847 * xfns.c (x_default_font_parameter): Likewise.
22848 * xsettings.c (read_and_apply_settings): Likewise.
22850 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22851 (overrun_check_free): Protoize.
22853 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22855 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22856 since callers should never pass a negative size.
22857 Change the signature to match that of plain 'read' and 'write'; see
22858 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22859 * lisp.h: Update prototypes of emacs_write and emacs_read.
22861 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22863 * xdisp.c (redisplay_window): Don't try to determine the character
22864 position of the scroll margin if the window start point w->startp
22865 is outside the buffer's accessible region. (Bug#8468)
22867 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22869 Fix write-region and its subroutines for buffers > 2GB.
22870 * fileio.c (a_write, e_write): Modify declaration of arguments and
22871 local variables to support buffers larger than 2GB.
22872 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22874 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22875 argument, local variables, and return value.
22877 * lisp.h: Update prototypes of emacs_write and emacs_read.
22879 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22881 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22883 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22885 Fix more problems found by GCC 4.6.0's static checks.
22887 * xdisp.c (vmessage): Use a better test for character truncation.
22889 * charset.c (load_charset_map): <, not <=, for optimization,
22890 and to avoid potential problems with integer overflow.
22891 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22892 * casetab.c (set_identity, shuffle): Likewise.
22893 * editfns.c (Fformat): Likewise.
22894 * syntax.c (skip_chars): Likewise.
22896 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22897 This also lets GCC 4.6.0 generate slightly better loop code.
22899 * callint.c (Fcall_interactively): <, not <=, for optimization.
22900 (Fcall_interactively): Count the number of arguments produced,
22901 not the number of arguments given. This is simpler and lets GCC
22902 4.6.0 generate slightly better code.
22904 * ftfont.c: Distingish more carefully between FcChar8 and char.
22905 The previous code passed unsigned char * to a functions like
22906 strlen and xstrcasecmp that expect char *, which does not
22907 conform to the C standard.
22908 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22909 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22910 char * when the C standard requires it.
22912 * keyboard.c (read_char): Remove unused var.
22914 * eval.c: Port to Windows vsnprintf (Bug#8435).
22915 Include <limits.h>.
22916 (SIZE_MAX): Define if the headers do not.
22917 (verror): Do not give up if vsnprintf returns a negative count.
22918 Instead, grow the buffer. This ports to Windows vsnprintf, which
22919 does not conform to C99. Problem reported by Eli Zaretskii.
22920 Also, simplify the allocation scheme, by avoiding the need for
22921 calling realloc, and removing the ALLOCATED variable.
22923 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22925 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22926 But keep the doprint source code for now, as we might revamp it
22927 and use it again (Bug#8435).
22928 * lisp.h (doprnt): Remove.
22929 * Makefile.in (base_obj): Remove doprnt.o.
22930 * deps.mk (doprnt.o): Remove.
22932 error: Print 32- and 64-bit integers portably (Bug#8435).
22933 Without this change, on typical 64-bit hosts error ("...%d...", N)
22934 was used to print both 32- and 64-bit integers N, which relied on
22935 undefined behavior.
22936 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22937 * lisp.h (error, verror): Mark as printf-like functions.
22938 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22939 Report overflow in size calculations when allocating printf buffer.
22940 Do not truncate output string at its first null byte.
22941 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22942 Truncate the output at a character boundary, since vsnprintf does not
22944 * charset.c (check_iso_charset_parameter): Convert internal
22945 character to string before calling 'error', since %c now has the
22947 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22948 overflow when computing char to be passed to 'error'. Do not
22949 pass Lisp_Object to 'error'; pass the integer instead.
22950 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22951 formatted with plain %d.
22953 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22955 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22957 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22959 * xterm.c (x_catch_errors): Remove duplicate declaration.
22961 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22963 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22965 2011-04-10 Jim Meyering <meyering@redhat.com>
22967 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22968 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22969 return ssize_t not "int", and use size_t as the buffer length.
22970 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22971 * gnutls.h: Update declarations.
22972 * process.c (read_process_output): Use ssize_t, to match.
22973 (send_process): Likewise.
22975 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22977 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22979 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22981 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22982 Use unsigned char, to match FcChar8 type definition.
22984 * xterm.c (handle_one_xevent):
22985 * xmenu.c (create_and_show_popup_menu):
22986 * xselect.c (x_decline_selection_request)
22987 (x_reply_selection_request): Avoid type-punned deref of X events.
22989 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22991 Fix some uses of `int' instead of EMACS_INT.
22992 * search.c (string_match_1, fast_string_match)
22993 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22994 (scan_buffer, find_next_newline_no_quit)
22995 (find_before_next_newline, search_command, Freplace_match)
22996 (Fmatch_data): Make some `int' variables be EMACS_INT.
22998 * xdisp.c (display_count_lines): 3rd argument and return value now
22999 EMACS_INT. All callers changed.
23000 (pint2hrstr): Last argument is now EMACS_INT.
23002 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
23003 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
23004 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
23005 (decode_coding_utf_16, decode_coding_emacs_mule)
23006 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
23007 (decode_coding_ccl, decode_coding_charset)
23008 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
23009 (decode_coding_iso_2022, decode_coding_emacs_mule)
23010 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
23011 <char_offset, last_offset>: Declare EMACS_INT.
23012 (encode_coding_utf_8, encode_coding_utf_16)
23013 (encode_coding_emacs_mule, encode_invocation_designation)
23014 (encode_designation_at_bol, encode_coding_iso_2022)
23015 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
23016 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
23018 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
23019 (encode_invocation_designation): Last argument P_NCHARS is now
23021 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
23022 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23024 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23027 * ccl.c (Fccl_execute_on_string): Declare some variables
23030 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23032 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23034 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23036 * process.c (Fformat_network_address): Doc fix.
23038 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23040 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23042 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
23044 * keyboard.c (read_char): Call Lisp function help-form-show,
23045 instead of using internal_with_output_to_temp_buffer.
23046 (Qhelp_form_show): New var.
23047 (syms_of_keyboard): Use DEFSYM macro.
23049 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23051 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23053 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
23055 * process.c (Flist_processes): Remove to Lisp.
23056 (list_processes_1): Delete.
23058 2011-04-06 Eli Zaretskii <eliz@gnu.org>
23060 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23062 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23064 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23066 Fix more problems found by GCC 4.6.0's static checks.
23068 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23070 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23072 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23074 * xdisp.c (vmessage): Mark as a printf-like function.
23076 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23078 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23080 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23081 printf-like functions.
23082 (tiff_load): Add casts to remove these marks before passing them
23083 to system-supplied API.
23085 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23087 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23088 This avoids several warnings with gcc -Wstrict-overflow.
23089 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23090 directly, rather than having caller test rule sign. This avoids
23091 some unnecessary tests.
23092 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23093 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23094 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23096 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23097 (xfont_open): Avoid unnecessary tests.
23099 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23101 * composite.h, composite.c (composition_gstring_put_cache):
23102 Use EMACS_INT, not int, for length.
23104 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23105 breaking out part of COMPOSITION_DECODE_RULE.
23106 (COMPOSITION_DECODE_RULE): Use it.
23107 * composite.c (get_composition_id): Remove unused local vars,
23108 by using the new macro.
23110 * textprop.c (set_text_properties_1): Change while to do-while,
23111 since the condition is always true at first.
23113 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23114 (interval_deletion_adjustment): Return unsigned value.
23117 * process.c (list_processes_1, create_pty, read_process_output):
23118 (exec_sentinel): Remove vars that were set but not used.
23119 (create_pty): Remove unnecessary "volatile"s.
23120 (Fnetwork_interface_info): Avoid possibility of int overflow.
23121 (read_process_output): Do adaptive read buffering even if carryover.
23122 (read_process_output): Simplify nbytes computation if buffered.
23124 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23126 * syntax.c (scan_words): Remove var that was set but not used.
23127 (update_syntax_table): Use unsigned instead of int.
23129 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23130 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23131 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23133 * print.c (print_error_message): Avoid int overflow.
23135 * font.c (font_list_entities): Redo for clarity,
23136 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23138 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23139 (font_score): Avoid potential overflow in diff calculation.
23141 * fns.c (substring_both): Remove var that is set but not used.
23142 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23144 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23146 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23147 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23148 can always succeed if overflow has undefined behavior.
23150 * search.c (boyer_moore, wordify): Remove vars set but not used.
23151 (wordify): Omit three unnecessary tests.
23153 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23154 All callers changed. This avoids the need for an unused var.
23156 * casefiddle.c (casify_region): Remove var that is set but not used.
23158 * dired.c (file_name_completion): Remove var that is set but not used.
23160 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23162 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23163 (Finsert_file_contents): Remove unnecessary code checking fd.
23165 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23166 Check for integer overflow on size calculations.
23168 * buffer.c (Fprevious_overlay_change): Remove var that is set
23171 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23172 Remove vars that are set but not used.
23173 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23174 (timer_check_2): Mark vars as initialized.
23176 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23178 * image.c (lookup_image): Remove var that is set but not used.
23179 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23181 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23182 that are set but not used.
23184 * xfns.c (make_invisible_cursor): Don't return garbage
23185 if XCreateBitmapFromData fails (Bug#8410).
23187 * xselect.c (x_get_local_selection, x_handle_property_notify):
23188 Remove vars that are set but not used.
23190 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23191 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23193 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23194 Remove var that is set but not used.
23195 (scroll_bar_windows_size): Now size_t, not int.
23196 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23197 Check for overflow.
23199 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23200 (map_tty_color) [!defined MSDOS]: Likewise.
23202 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23204 * coding.c: Remove vars that are set but not used.
23205 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23206 All callers changed.
23207 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23208 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23209 (decode_coding_charset): Remove vars that are set but not used.
23211 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23212 that is set but not used.
23214 * print.c (print_object): Remove var that is set but not used.
23216 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23217 The gnulib version avoids calling malloc in the usual case,
23218 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23219 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23220 * filelock.c (current_lock_owner): Likewise.
23221 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23222 * sysdep.c: Include allocator.h, careadlinkat.h.
23223 (emacs_no_realloc_allocator): New static constant.
23224 (emacs_readlink): New function.
23225 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23226 ../lib/careadlinkat.h.
23228 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23230 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23231 first non-nil return value).
23233 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23235 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23236 if not defined (Bug#8403).
23238 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23240 * xdisp.c (display_count_lines): Remove parameter `start',
23241 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23242 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23243 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23244 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23245 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23246 and thereabouts. All callers changed.
23247 (get_per_char_metric): Remove parameter `f', unused since
23248 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23250 2011-04-02 Jim Meyering <meyering@redhat.com>
23252 do not dereference NULL upon failed strdup
23253 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23254 (ns_get_family): Likewise.
23256 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23258 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23260 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23262 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23265 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23267 Add lexical binding.
23269 * window.c (Ftemp_output_buffer_show): New fun.
23270 (Fsave_window_excursion):
23271 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23273 * lread.c (lisp_file_lexically_bound_p): New function.
23274 (Fload): Bind Qlexical_binding.
23275 (readevalloop): Remove `evalfun' arg.
23276 Bind Qinternal_interpreter_environment.
23277 (Feval_buffer): Bind Qlexical_binding.
23278 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23280 (syms_of_lread): Declare `lexical-binding'.
23282 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23284 * keyboard.c (eval_dyn): New fun.
23285 (menu_item_eval_property): Use it.
23287 * image.c (parse_image_spec): Use Ffunctionp.
23289 * fns.c (concat, mapcar1): Accept byte-code-functions.
23291 * eval.c (Fsetq): Handle lexical vars.
23292 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23293 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23294 (FletX, Flet): Obey lexical binding.
23295 (Fcommandp): Handle closures.
23296 (Feval): New `lexical' arg.
23297 (eval_sub): New function extracted from Feval. Use it almost
23298 everywhere where Feval was used. Look up vars in lexical env.
23300 (Ffunctionp): Move from subr.el.
23301 (Ffuncall): Handle closures.
23302 (apply_lambda): Remove `eval_flags'.
23303 (funcall_lambda): Handle closures and new byte-code-functions.
23304 (Fspecial_variable_p): New function.
23305 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23306 but without exporting it to Lisp.
23308 * doc.c (Fdocumentation, store_function_docstring):
23309 * data.c (Finteractive_form): Handle closures.
23311 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23314 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23316 (exec_byte_code): New function extracted from Fbyte_code to handle new
23317 calling convention for byte-code-functions. Add new byte-codes.
23319 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23321 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23323 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23325 * xdisp.c (redisplay_internal): Fix prototype.
23327 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23329 * xdisp.c (SCROLL_LIMIT): New macro.
23330 (try_scrolling): Use it when setting scroll_limit.
23331 Limit scrolling to 100 screen lines.
23332 (redisplay_window): Even when falling back on "recentering",
23333 position point in the window according to scroll-conservatively,
23334 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23336 (try_scrolling): When point is above the window, allow searching
23337 as far as scroll_max, or one screenful, to compute vertical
23338 distance from PT to the scroll margin position. This prevents
23339 try_scrolling from unnecessarily failing when
23340 scroll-conservatively is set to a value slightly larger than the
23341 window height. Clean up the case of PT below the margin at bottom
23342 of window: scroll_max can no longer be INT_MAX. When aggressive
23343 scrolling is in use, don't let point enter the opposite scroll
23344 margin as result of the scroll.
23345 (syms_of_xdisp) <scroll-conservatively>: Document the
23346 threshold of 100 lines for never-recentering scrolling.
23348 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23350 * dispextern.h (move_it_by_lines):
23351 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23352 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23353 (message_log_check_duplicate): Remove parameters `prev_bol' and
23354 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23355 (redisplay_internal): Remove parameter `preserve_echo_area',
23356 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23358 * indent.c (Fvertical_motion):
23359 * window.c (window_scroll_pixel_based, Frecenter):
23360 Don't pass `need_y_p' to `move_it_by_lines'.
23362 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23364 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23365 steal a few bits to be more compact.
23366 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23367 Remove unneeded casts.
23369 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23371 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23373 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23374 binding" message (bug#7967).
23376 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23378 Fix more problems found by GCC 4.6.0's static checks.
23380 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23381 Remove unused local var.
23383 * editfns.c (Fmessage_box): Remove unused local var.
23385 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23386 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23387 Omit unused local vars.
23388 * window.c (shrink_windows): Omit unused local var.
23389 * menu.c (digest_single_submenu): Omit unused local var.
23390 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23391 Omit unused local var.
23393 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23394 Don't assume string length fits in int.
23395 (keyremap_step, read_key_sequence): Use size_t for sizes.
23396 (read_key_sequence): Don't check last_real_key_start redundantly.
23398 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23399 instead of alloca (Bug#8344).
23401 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23402 (Fbacktrace_frame): Don't assume nframes fits in int.
23404 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23406 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23409 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23411 * cm.c (calccost): Turn while-do into do-while, for clarity.
23413 * keyboard.c (syms_of_keyboard): Use the same style as later
23414 in this function when indexing through an array. This also
23415 works around GCC bug 48267.
23417 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23419 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23421 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23422 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23424 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23425 This avoids undefined behavior on integer overflow, and is a bit
23426 more convenient anyway since it is compared to a size_t variable.
23428 Variadic C functions now count arguments with size_t, not int.
23429 This avoids an unnecessary limitation on 64-bit machines, which
23430 caused (substring ...) to crash on large vectors (Bug#8344).
23431 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23432 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23433 All variadic functions and their callers changed accordingly.
23434 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23435 * data.c (arith_driver, float_arith_driver): Likewise.
23436 * editfns.c (general_insert_function): Likewise.
23437 * eval.c (struct backtrace.nargs, interactive_p)
23438 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23439 (funcall_lambda, mark_backtrace): Likewise.
23440 * fns.c (concat): Likewise.
23441 * frame.c (x_set_frame_parameters): Likewise.
23442 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23443 0 if not found, not -1. All callers changed.
23445 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23446 (stack_copy_size): Now size_t, not int.
23447 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23449 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23451 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23452 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23453 All callers changed.
23455 * lisp.h (multibyte_char_to_unibyte):
23456 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23457 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23458 * character.h (CHAR_TO_BYTE8):
23459 * cmds.c (internal_self_insert):
23460 * editfns.c (general_insert_function):
23461 * keymap.c (push_key_description):
23462 * search.c (Freplace_match):
23463 * xdisp.c (message_dolog, set_message_1): All callers changed.
23465 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23467 * keyboard.c (safe_run_hook_funcall): New function.
23468 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23469 don't set the hook to nil, but remove the offending function instead.
23470 (Qcommand_hook_internal): Remove, unused.
23471 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23472 Vcommand_hook_internal.
23474 * eval.c (enum run_hooks_condition): Remove.
23475 (funcall_nil, funcall_not): New functions.
23476 (run_hook_with_args): Call each function through a `funcall' argument.
23477 Remove `cond' argument, now redundant.
23478 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23479 (Frun_hook_with_args_until_failure): Adjust accordingly.
23480 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23482 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23484 * dispextern.h (string_buffer_position): Remove declaration.
23486 * print.c (strout): Remove parameter `multibyte', unused since
23487 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23489 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23490 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23491 All callers changed.
23493 * w32.c (_wsa_errlist): Use braces for struct initializers.
23495 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23496 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23497 All callers changed.
23498 (string_buffer_position): Likewise. Also, make static (it's never
23499 used outside xdisp.c).
23500 (cursor_row_p): Remove parameter `w', unused since
23501 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23502 (decode_mode_spec): Remove parameter `precision', introduced during
23503 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23504 All callers changed.
23506 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23508 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23510 2011-03-27 Anders Lindgren <andlind@gmail.com>
23512 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23513 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23514 (ns_update_auto_hide_menu_bar): New functions.
23515 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23516 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23517 ns_constrain_all_frames.
23518 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23519 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23521 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23523 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23525 2011-03-27 Glenn Morris <rgm@gnu.org>
23527 * syssignal.h: Replace RETSIGTYPE with void.
23528 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23529 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23530 Replace SIGTYPE with void everywhere.
23531 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23532 * s/template.h (SIGTYPE): Remove commented out definition.
23534 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23536 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23537 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23539 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23541 * w32.c (read_unc_volume): Use parameter `henum', instead of
23542 global variable `wget_enum_handle'.
23544 * keymap.c (describe_vector): Remove parameters `indices' and
23545 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23546 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23548 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23550 * keyboard.c (timer_check): Remove parameter `do_it_now',
23551 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23552 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23553 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23555 * keyboard.c (read_char):
23556 * w32menu.c (w32_menu_display_help):
23557 * xmenu.c (show_help_event, menu_help_callback):
23558 Adjust calls to `show_help_echo'.
23560 * gtkutil.c (xg_maybe_add_timer):
23561 * keyboard.c (readable_events):
23562 * process.c (wait_reading_process_output):
23563 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23565 * insdel.c (adjust_markers_gap_motion):
23566 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23567 (gap_left, gap_right): Don't call it.
23569 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23571 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23572 incurred during fontification.
23574 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23576 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23577 (DEFVAR_PER_BUFFER): Don't pass it.
23579 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23580 (scrolling_window): Don't pass it.
23582 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23584 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23586 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23588 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23589 of variables specific to SELinux and computation of `encoded_absname'.
23591 * image.c (XPutPixel): Remove unused variable `height'.
23593 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23595 * unexw32.c (get_section_info): Remove unused variable `section'.
23597 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23598 (system_process_attributes): Remove unused variable `sess'.
23599 (sys_read): Remove unused variable `err'.
23601 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23602 (w32_wnd_proc): Remove unused variable `isdead'.
23603 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23604 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23605 (x_create_tip_frame): Remove unused variable `tem'.
23607 * w32inevt.c (w32_console_read_socket):
23608 Remove unused variable `no_events'.
23610 * w32term.c (x_draw_composite_glyph_string_foreground):
23611 Remove unused variable `width'.
23613 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23615 * w32term.c (x_set_glyph_string_clipping):
23616 Don't pass uninitialized region to CombineRgn.
23618 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23620 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23621 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23622 (Fx_close_connection): Remove unused variable `i'.
23624 * w32font.c (w32font_draw): Return number of glyphs.
23625 (w32font_open_internal): Remove unused variable `i'.
23626 (w32font_driver): Add missing initializer.
23628 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23629 (fill_in_menu): Remove unused variable `items_added'.
23631 * w32term.c (last_mouse_press_frame): Remove static global variable.
23632 (w32_clip_to_row): Remove unused variable `f'.
23633 (x_delete_terminal): Remove unused variable `i'.
23635 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23636 (NOTHING): Remove unused static global variable.
23637 (uniscribe_check_otf): Remove unused variable `table'.
23638 (uniscribe_font_driver): Add missing initializers.
23640 2011-03-23 Julien Danjou <julien@danjou.info>
23642 * term.c (Fsuspend_tty, Fresume_tty):
23643 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23644 * window.c (temp_output_buffer_show):
23645 * insdel.c (signal_before_change):
23646 * frame.c (Fhandle_switch_frame):
23647 * fileio.c (Fdo_auto_save):
23648 * emacs.c (Fkill_emacs):
23649 * editfns.c (save_excursion_restore):
23650 * cmds.c (internal_self_insert):
23651 * callint.c (Fcall_interactively):
23652 * buffer.c (Fkill_all_local_variables):
23653 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23655 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23656 unconditionally since it does the check itself.
23658 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23660 Fix more problems found by GCC 4.5.2's static checks.
23662 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23663 the first time through the loop, since we know p0 < p1 then.
23664 This also avoids a gcc -Wstrict-overflow warning.
23666 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23667 leading to a memory leak, possible in functions like
23668 load_charset_map_from_file that can allocate an unbounded number
23669 of objects (Bug#8318).
23671 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23672 that could (at least in theory) be that large.
23674 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23675 This is less likely to overflow, and avoids undefined behavior if
23676 overflow does occur. All callers changed. Use strtoul to scan
23677 for the unsigned long integer.
23678 (pint2hrstr): Simplify and tune code slightly.
23679 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23681 * scroll.c (do_scrolling): Work around GCC bug 48228.
23682 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23684 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23685 This also avoids a warning with gcc -Wstrict-overflow.
23686 (validate_x_resource_name): Simplify count usage.
23687 This also avoids a warning with gcc -Wstrict-overflow.
23689 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23692 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23694 * process.c (Fmake_network_process): Use socklen_t, not int,
23695 where POSIX says socklen_t is required in portable programs.
23696 This fixes a porting bug on hosts like 64-bit HP-UX, where
23697 socklen_t is wider than int (Bug#8277).
23698 (Fmake_network_process, server_accept_connection):
23699 (wait_reading_process_output, read_process_output):
23702 * process.c: Rename or move locals to avoid shadowing.
23703 (list_processes_1, Fmake_network_process):
23704 (read_process_output_error_handler, exec_sentinel_error_handler):
23705 Rename or move locals.
23706 (Fmake_network_process): Define label "retry_connect" only if needed.
23707 (Fnetwork_interface_info): Fix pointer signedness.
23708 (process_send_signal): Add cast to avoid pointer signedness problem.
23709 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23710 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23712 Make tparam.h and terminfo.c consistent.
23713 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23714 Include tparam.h instead, since it declares them.
23715 * cm.h (PC): Remove extern decl; tparam.h now does this.
23716 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23717 * terminfo.c: Include tparam.h, to check interfaces.
23718 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23719 (tparam): Adjust signature to match interface in tparam.h;
23720 this removes some undefined behavior. Check that outstring and len
23721 are zero, which they always are with Emacs.
23722 * tparam.h (PC, BC, UP): New extern decls.
23724 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23725 (xftfont_open): Rename locals to avoid shadowing.
23727 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23728 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23729 (OTF_TAG_SYM): Omit macro if not needed.
23730 (ftfont_list): Remove unused local.
23731 (get_adstyle_property, ftfont_pattern_entity):
23732 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23733 Rename locals to avoid shadowing.
23735 * xfont.c (xfont_list_family): Mark var as initialized.
23737 * xml.c (make_dom): Now static.
23739 * composite.c (composition_compute_stop_pos): Rename local to
23741 (composition_reseat_it): Remove unused locals.
23742 (find_automatic_composition, composition_adjust_point): Likewise.
23743 (composition_update_it): Mark var as initialized.
23744 (find_automatic_composition): Mark vars as initialized,
23745 with a FIXME (Bug#8290).
23747 character.h: Rename locals to avoid shadowing.
23748 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23749 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23750 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23751 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23752 to avoid shadowing.
23754 * textprop.c (property_change_between_p): Remove; unused.
23756 * intervals.c (interval_start_pos): Now static.
23758 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23760 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23761 Rename locals to avoid shadowing.
23763 * sound.c (wav_play, au_play, Fplay_sound_internal):
23764 Fix pointer signedness.
23765 (alsa_choose_format): Remove unused local var.
23766 (wav_play): Initialize a variable to 0, to prevent undefined
23767 behavior (Bug#8278).
23769 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23771 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23773 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23774 clobbering (Bug#8298).
23775 * sysdep.c (sys_subshell): Likewise.
23776 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23778 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23779 This should get cleaned up, so that child_setup has the
23780 same signature on all platforms.
23782 * callproc.c (call_process_cleanup): Now static.
23783 (relocate_fd): Rename locals to avoid shadowing.
23785 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23787 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23788 not to be necessary, and produces flickering.
23790 2011-03-20 Glenn Morris <rgm@gnu.org>
23792 * config.in: Remove file.
23794 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23796 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23797 are now in src/globals.h.
23798 (syms_of_minibuf): Remove spurious & from previous change.
23800 2011-03-20 Leo Liu <sdl.web@gmail.com>
23802 * minibuf.c (completing-read-function): New variable.
23803 (completing-read-default): Rename from completing-read.
23804 (completing-read): Call completing-read-function.
23806 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23808 * xfaces.c (Fx_load_color_file):
23809 Read color file from absolute filename (bug#8250).
23811 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23813 * makefile.w32-in: Update dependencies.
23815 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23817 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23819 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23821 Fix more problems found by GCC 4.5.2's static checks.
23823 * process.c (make_serial_process_unwind, send_process_trap):
23824 (sigchld_handler): Now static.
23826 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23827 That way, the code declares only the vars that it needs.
23828 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23829 * s/cygwin.h (PTY_ITERATION): Likewise.
23830 * s/darwin.h (PTY_ITERATION): Likewise.
23831 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23833 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23834 * process.c (allocate_pty): Don't declare stb unless it's needed.
23836 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23837 (CONSTANTLIM): Remove; unused.
23838 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23839 Define only if needed.
23841 * unexelf.c (unexec): Name an expression,
23842 to avoid gcc -Wbad-function-cast warning.
23843 Use a different way to cause a compilation error if anyone uses
23844 n rather than nn, a way that does not involve shadowing.
23845 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23847 * deps.mk (unexalpha.o): Remove; unused.
23849 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23850 * unexec.h: New file.
23851 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23852 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23853 Depend on unexec.h.
23854 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23855 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23856 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23857 Change as necessary to match prototype in unexec.h.
23859 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23861 (back_comment, skip_chars): Mark vars as initialized.
23863 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23864 Rename locals to avoid shadowing.
23866 * lread.c (read1): Rewrite so as not to use empty "else".
23867 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23869 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23871 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23872 warning when compiling print.c.
23874 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23875 instead of using an uninitialized var.
23876 (font_sort_entities): Mark var as initialized.
23878 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23880 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23881 pointers to constants.
23882 (font_parse_fcname): Remove unused vars.
23883 (font_delete_unmatched): Now static.
23884 (font_get_spec): Remove; unused.
23885 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23886 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23887 Rename or move locals to avoid shadowing.
23889 * fns.c (require_nesting_list, require_unwind): Now static.
23890 (Ffillarray): Rename locals to avoid shadowing.
23892 * floatfns.c (domain_error2): Define only if needed.
23893 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23895 * alloc.c (mark_backtrace): Move decl from here ...
23896 * lisp.h: ... to here, so that it can be checked.
23898 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23899 (Fdefvar): Rewrite so as not to use empty "else".
23900 (lisp_indirect_variable): Name an expression,
23901 to avoid gcc -Wbad-function-cast warning.
23902 (Fdefvar): Rename locals to avoid shadowing.
23904 * callint.c (quotify_arg, quotify_args): Now static.
23905 (Fcall_interactively): Rename locals to avoid shadowing.
23906 Use const pointer when appropriate.
23908 * lisp.h (get_system_name, get_operating_system_release):
23909 Move decls here, to check interfaces.
23910 * process.c (get_operating_system_release): Move decl to lisp.h.
23911 * xrdb.c (get_system_name): Likewise.
23912 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23913 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23914 some of which prompt warnings from gcc -Wbad-function-cast.
23915 (Fformat_time_string, Fencode_time, Finsert_char):
23916 (Ftranslate_region_internal, Fformat):
23917 Rename or remove local vars to avoid shadowing.
23918 (Ftranslate_region_internal): Mark var as initialized.
23920 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23923 * lisp.h (eassert): Check that the argument compiles, even if
23924 ENABLE_CHECKING is not defined.
23926 * data.c (Findirect_variable): Name an expression, to avoid
23927 gcc -Wbad-function-cast warning.
23928 (default_value, arithcompare, arith_driver, arith_error): Now static.
23929 (store_symval_forwarding): Rename local to avoid shadowing.
23930 (Fmake_variable_buffer_local, Fmake_local_variable):
23931 Mark variables as initialized.
23932 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23934 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23935 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23936 Rename locals to avoid shadowing.
23937 (mark_stack): Move local variables into the #ifdef region where
23939 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23940 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23942 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23943 (GC_STRING_CHARS): Remove; not used.
23944 (Fmemory_limit): Cast sbrk's returned value to char *.
23946 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23947 avoids undefined behavior in theory.
23949 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23951 Use functions, not macros, for up- and down-casing (Bug#8254).
23952 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23953 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23954 to use the following functions instead of these macros.
23955 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23956 EMACS_INT, since callers assume the returned value fits in int.
23957 (upcase1): Likewise, for UPCASE_TABLE.
23958 (uppercasep, lowercasep, upcase): New static inline functions.
23959 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23960 the race-condition problem in the old DOWNCASE.
23962 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23963 Rename locals to avoid shadowing.
23964 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23965 (regex_compile, re_search_2, re_match_2_internal):
23966 Remove unused local vars.
23967 (FREE_VAR): Rewrite so as not to use empty "else",
23968 which gcc can warn about.
23969 (regex_compile, re_match_2_internal): Mark locals as initialized.
23970 (RETALLOC_IF): Define only if needed.
23971 (WORDCHAR_P): Likewise. This one is never needed, but is used
23972 only in a comment talking about a compiler bug, so put inside
23973 the #if 0 of that comment.
23974 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23975 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23978 * search.c (boyer_moore): Rename locals to avoid shadowing.
23979 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23980 (PREV_CHAR_BOUNDARY): Likewise.
23982 * search.c (simple_search): Remove unused var.
23984 * dired.c (compile_pattern): Move decl from here ...
23985 * lisp.h: ... to here, so that it can be checked.
23986 (struct re_registers): New forward decl.
23988 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23990 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23992 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23993 Rename locals to avoid shadowing.
23994 (Fvertical_motion): Mark locals as initialized.
23996 * casefiddle.c (casify_object, casify_region): Now static.
23997 (casify_region): Mark local as initialized.
23999 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
24001 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
24002 New macros, so that the caller can use some names other than
24003 gcpro1, gcpro2, etc.
24004 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
24006 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
24007 argument, for consistency with GCPRO2_VAR, etc: it is now the
24008 prefix of the variable, not the variable itself. All uses
24010 * dired.c (directory_files_internal, file_name_completion):
24011 Rename locals to avoid shadowing.
24013 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
24014 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
24015 dired.c's scmp function, had undefined behavior.
24016 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24017 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
24018 * buffer.h: ... to here, because these macros use current_buffer,
24019 and the new implementation with inline functions needs to have
24020 current_buffer in scope now, rather than later when the macros
24022 (downcase, upcase1): New static inline functions.
24023 (DOWNCASE, UPCASE1): Reimplement using these functions.
24024 This avoids undefined behavior in expressions like
24025 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24026 from race conditions in accessing the global variables
24027 case_temp1 and case_temp2.
24028 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24029 * lisp.h (case_temp1, case_temp2): Remove their decls.
24030 * character.h (ASCII_CHAR_P): Move from here ...
24031 * lisp.h: ... to here, so that the inline functions mentioned
24032 above can use them.
24034 * dired.c (directory_files_internal_unwind): Now static.
24036 * fileio.c (file_name_as_directory, directory_file_name):
24037 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24039 (file_name_as_directory): Use const pointers when appropriate.
24040 (Fexpand_file_name): Likewise. In particular, newdir might
24041 point at constant storage, so make it a const pointer.
24042 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24043 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24045 (Fset_file_times, Finsert_file_contents, auto_save_error):
24046 Rename locals to avoid shadowing.
24048 * minibuf.c (choose_minibuf_frame_1): Now static.
24049 (Ftry_completion, Fall_completions): Rename or remove locals
24050 to avoid shadowing.
24052 * marker.c (bytepos_to_charpos): Remove; unused.
24054 * lisp.h (verify_bytepos, count_markers): New decls,
24055 so that gcc does not warn that these functions aren't declared.
24057 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24058 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24059 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24060 (copy_text): Remove unused local var.
24062 * filelock.c (within_one_second): Now static.
24063 (lock_file_1): Rename local to avoid shadowing.
24065 * buffer.c (fix_overlays_before): Mark locals as initialized.
24066 (fix_start_end_in_overlays): Likewise. This function should be
24067 simplified by using pointers-to-pointers, but that's a different
24069 (switch_to_buffer_1): Now static.
24070 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24071 (report_overlay_modification): Rename locals to avoid shadowing.
24073 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24074 Fix pointer signedness issue.
24075 (sys_subshell): Mark local as volatile if checking for lint,
24076 to suppress a gcc -Wclobbered warning that does not seem to be right.
24077 (MAXPATHLEN): Define only if needed.
24079 * process.c (serial_open, serial_configure): Move decls from here ...
24080 * systty.h: ... to here, so that they can be checked.
24082 * fns.c (get_random, seed_random): Move extern decls from here ...
24083 * lisp.h: ... to here, so that they can be checked.
24085 * sysdep.c (reset_io): Now static.
24086 (wait_for_termination_signal): Remove; unused.
24088 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24089 (copy_keymap_item, append_key, push_text_char_description):
24091 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24092 (DENSE_TABLE_SIZE): Remove; unused.
24093 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24094 (describe_map_tree):
24095 Rename locals to avoid shadowing.
24097 * keyboard.c: Declare functions static if they are not used elsewhere.
24098 (echo_char, echo_dash, cmd_error, top_level_2):
24099 (poll_for_input, handle_async_input): Now static.
24100 (read_char, kbd_buffer_get_event, make_lispy_position):
24101 (make_lispy_event, make_lispy_movement, apply_modifiers):
24102 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24103 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24104 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24105 (read_key_sequence, read_char): Mark locals as initialized.
24106 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24108 * keyboard.h (make_ctrl_char): New decl.
24109 (mark_kboards): Move decl here ...
24110 * alloc.c (mark_kboards): ... from here.
24112 * lisp.h (force_auto_save_soon): New decl.
24114 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24115 (DEFINE_DUMMY_FUNCTION): New macro.
24116 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24118 (main): Add casts to avoid warnings
24119 if GCC considers string literals to be constants.
24121 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24123 * dbusbind.c: Pointer signedness fixes.
24124 (xd_signature, xd_append_arg, xd_initialize):
24125 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24126 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24127 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24128 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24130 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24131 if GCC considers string literals to be constants.
24132 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24134 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24136 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24137 (print_preprocess, print_object): New macro to fix last change.
24139 * print.c (print_preprocess): Don't forget font objects.
24141 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
24143 * emacs.c (USAGE3): Doc fixes.
24145 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24147 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24150 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
24152 * lisp.h (VWindow_system, Qfile_name_history):
24153 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24154 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24155 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24157 * w32select.c: Don't #include "keyboard.h".
24158 (run_protected): Add extern declaration for waiting_for_input.
24160 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24161 * w32console.c (detect_input_pending, read_input_pending)
24162 (encode_terminal_code):
24163 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24164 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24165 (w32_system_caret_y, Qfile_name_history):
24166 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24167 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24168 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24169 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24170 * w32proc.c (Qlocal, report_file_error):
24171 * w32term.c (Vwindow_system, updating_frame):
24172 * w32uniscribe.c (initialized, uniscribe_font_driver):
24173 Remove unneeded extern declarations.
24175 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
24177 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24179 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24181 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24182 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24183 These macros can no longer be used for assignment.
24185 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24186 Assign struct members directly, instead of using BUF_BEGV etc.
24187 (record_buffer_markers, fetch_buffer_markers): New functions for
24188 recording and fetching special buffer markers.
24189 (set_buffer_internal_1, set_buffer_temp): Use them.
24191 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24193 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24195 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24196 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24198 * xdisp.c (hscroll_window_tree):
24199 (reconsider_clip_changes): Use PT instead of BUF_PT.
24201 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24203 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24204 $(EMACS_ROOT)/lib/intprops.h.
24206 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24208 Fix more problems found by GCC 4.5.2's static checks.
24210 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24211 to unsigned char * to avoid compiler diagnostic.
24212 (xg_free_frame_widgets): Make it clear that a local variable is
24213 needed only if USE_GTK_TOOLTIP.
24214 (gdk_window_get_screen): Make it clear that this macro is needed
24215 only if USE_GTK_TOOLTIP.
24216 (int_gtk_range_get_value): New function, which avoids a diagnostic
24217 from gcc -Wbad-function-cast.
24218 (xg_set_toolkit_scroll_bar_thumb): Use it.
24219 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24220 diagnostic from gcc -Wbad-function-cast.
24221 (get_utf8_string, xg_get_file_with_chooser):
24222 Rename locals to avoid shadowing.
24223 (create_dialog): Move locals to avoid shadowing.
24225 * xgselect.c (xg_select): Remove unused var.
24227 * image.c (four_corners_best): Mark locals as initialized.
24228 (gif_load): Initialize transparent_p to zero (Bug#8238).
24229 Mark another local as initialized.
24230 (my_png_error, my_error_exit): Mark with NO_RETURN.
24232 * image.c (clear_image_cache): Now static.
24233 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24234 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24235 (x_edge_detection): Remove unnecessary cast that
24236 gcc -Wbad-function-cast diagnoses.
24237 (gif_load): Fix pointer signedness.
24238 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24239 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24241 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24243 Improve quality of tests for time stamp overflow.
24244 For example, without this patch (encode-time 0 0 0 1 1
24245 1152921504606846976) returns the obviously-bogus value (-948597
24246 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24247 reports time overflow. See
24248 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24249 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24250 * editfns.c: Include limits.h and intprops.h.
24251 (TIME_T_MIN, TIME_T_MAX): New macros.
24252 (time_overflow): Move earlier, to before first use.
24253 (hi_time, lo_time): New functions, for an accurate test for
24254 out-of-range times.
24255 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24256 (Fget_internal_run_time): Don't assume time_t fits in int.
24257 (make_time): Use list2 instead of Fcons twice.
24258 (Fdecode_time): More accurate test for out-of-range times.
24259 (check_tm_member): New function.
24260 (Fencode_time): Use it, to test for out-of-range times.
24261 (lisp_time_argument): Don't rely on undefined left-shift and
24262 right-shift behavior when checking for time stamp overflow.
24264 * editfns.c (time_overflow): New function, refactoring common code.
24265 (Fformat_time_string, Fdecode_time, Fencode_time):
24266 (Fcurrent_time_string): Use it.
24268 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24269 * dired.c (make_time): Move to ...
24270 * editfns.c (make_time): ... here.
24271 * systime.h: Note the move.
24273 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24275 * fringe.c (update_window_fringes): Remove unused variables.
24277 * unexmacosx.c (copy_data_segment): Also copy __got section.
24280 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24282 * termcap.c [MSDOS]: Include "msdos.h".
24283 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24284 Constify `char *' arguments and their references according to
24285 prototypes in tparam.h.
24287 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24289 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24290 Adapt all references accordingly.
24292 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24294 2011-03-11 Tom Tromey <tromey@redhat.com>
24296 * buffer.c (syms_of_buffer): Remove obsolete comment.
24298 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24300 * termhooks.h (encode_terminal_code): Declare prototype.
24302 * msdos.c (encode_terminal_code): Don't declare prototype.
24304 * term.c (encode_terminal_code): Now external again, used by
24305 w32console.c and msdos.c.
24307 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24308 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24310 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24312 Fix some minor problems found by GCC 4.5.2's static checks.
24314 * fringe.c (update_window_fringes): Mark locals as initialized
24316 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24318 * alloc.c (mark_fringe_data): Move decl from here ...
24319 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24320 to check its interface.
24321 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24323 * fontset.c (free_realized_fontset): Now static.
24324 (Fset_fontset_font): Rename local to avoid shadowing.
24325 (fontset_font): Mark local as initialized.
24326 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24328 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24330 * xselect.c (x_disown_buffer_selections): Remove; not used.
24331 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24332 (x_own_selection, Fx_disown_selection_internal): Rename locals
24333 to avoid shadowing.
24334 (x_handle_dnd_message): Remove local to avoid shadowing.
24336 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24337 so that the caller can use some name other than gcpro1.
24338 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24339 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24340 (Fx_backspace_delete_keys_p):
24341 Use them to avoid shadowing, and rename vars to avoid shadowing.
24342 (x_decode_color, x_set_name, x_window): Now static.
24343 (Fx_create_frame): Add braces to silence GCC warning.
24344 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24345 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24346 Remove unused locals.
24347 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24348 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24349 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24352 * xterm.h (x_mouse_leave): New decl.
24354 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24355 Remove unused functions.
24356 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24357 (x_calc_absolute_position): Now static.
24358 (XTread_socket): Don't define label "out" unless it's used.
24359 Don't declare local "event" unless it's used.
24360 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24361 unless they are used.
24362 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24363 (x_fatal_error_signal): Remove; not used.
24364 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24365 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24366 (x_error_catcher, x_connection_closed, x_error_handler):
24367 (x_error_quitter, xembed_send_message, x_iconify_frame):
24368 (my_log_handler): Rename locals to avoid shadowing.
24369 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24370 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24372 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24373 Rename or move locals to avoid shadowing.
24374 (tty_defined_color, merge_face_heights): Now static.
24375 (free_realized_faces_for_fontset): Remove; not used.
24376 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24377 does not deduce is never used uninitialized.
24378 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24379 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24381 * terminal.c (store_terminal_param): Now static.
24383 * xmenu.c (menu_highlight_callback): Now static.
24384 (set_frame_menubar): Remove unused local.
24385 (xmenu_show): Rename parameter to avoid shadowing.
24386 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24387 since they might point to immutable storage.
24388 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24389 since it's unused otherwise.
24391 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24392 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24393 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24394 avoids a gcc -Wuninitialized diagnostic.
24395 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24396 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24397 does not deduce are never used uninitialized.
24399 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24401 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24402 * window.c (window_loop, size_window):
24403 (run_window_configuration_change_hook, enlarge_window): Likewise.
24405 * window.c (display_buffer): Now static.
24406 (size_window): Mark variables that gcc -Wuninitialized
24407 does not deduce are never used uninitialized.
24408 * window.h (check_all_windows): New decl, to forestall
24409 gcc -Wmissing-prototypes diagnostic.
24410 * dispextern.h (bidi_dump_cached_states): Likewise.
24412 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24414 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24415 Include <limits.h>.
24416 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24417 and to avoid gcc -Wuninitialized warning.
24418 (load_charset_map): Mark variables that gcc -Wuninitialized
24419 does not deduce are never used uninitialized.
24420 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24422 * coding.c (coding_set_source, coding_set_destination):
24423 Use "else { /* comment */ }" rather than "else /* comment */;"
24424 for clarity, and to avoid gcc -Wempty-body warning.
24425 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24426 a block, when the outer 'i' will do.
24427 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24428 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24429 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24430 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24431 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24432 Rename locals to avoid shadowing.
24433 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24434 * coding.c (emacs_mule_char, encode_invocation_designation):
24435 Now static, since they're not used elsewhere.
24436 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24437 (decode_coding_object, encode_coding_object, detect_coding_system):
24438 (decode_coding_emacs_mule): Mark variables that gcc
24439 -Wuninitialized does not deduce are never used uninitialized.
24440 (detect_coding_iso_2022): Initialize a local variable that might
24441 be used uninitialized. Leave a FIXME because it's not clear that
24442 this initialization is needed. (Bug#8211)
24443 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24444 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24445 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24446 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24447 Remove unused macros.
24449 * category.c (hash_get_category_set): Remove unused local var.
24450 (copy_category_table): Now static, since it's not used elsewhere.
24451 * character.c (string_count_byte8): Likewise.
24453 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24454 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24456 * chartab.c (copy_sub_char_table): Now static, since it's not used
24458 (sub_char_table_ref_and_range, char_table_ref_and_range):
24459 Rename locals to avoid shadowing.
24460 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24462 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24463 (BIDI_BOB): Remove unused macro.
24465 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24466 deduce are never used uninitialized.
24467 * term.c (encode_terminal_code): Likewise.
24469 * term.c (encode_terminal_code): Now static. Remove unused local.
24471 * tparam.h: New file.
24472 * term.c, tparam.h: Include it.
24473 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24474 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24475 Move these decls to tparam.h, and make them agree with what
24476 is actually in tparam.c. The previous trick of using incompatible
24477 decls in different modules does not conform to the C standard.
24478 All callers of tparam changed to use tparam's actual API.
24479 * tparam.c (tparam1, tparam, tgoto):
24480 Use const pointers where appropriate.
24482 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24483 * cm.h (struct cm): Likewise.
24484 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24485 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24486 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24487 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24488 (turn_on_face, init_tty): Likewise.
24489 * termchar.h (struct tty_display_info): Likewise.
24491 * term.c (term_mouse_position): Rename local to avoid shadowing.
24493 * alloc.c (mark_ttys): Move decl from here ...
24494 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24496 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24498 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24500 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24502 * search.c (compile_pattern_1): Remove argument regp, unused since
24503 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24504 (compile_pattern): Don't pass it.
24506 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24508 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24509 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24511 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24513 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24515 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24516 gdk_window_get_screen, gdk_window_get_geometry,
24517 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24518 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24519 (xg_get_pixbuf_from_pixmap): New function.
24520 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24521 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24522 Call xg_get_pixbuf_from_pixmap instead of
24523 gdk_pixbuf_get_from_drawable.
24524 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24525 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24526 (xg_check_special_colors): Use GtkStyleContext and its functions
24528 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24529 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24530 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24531 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24532 Call gtk_widget_get_preferred_size.
24533 (xg_frame_resized): gdk_window_get_geometry only takes 5
24535 (xg_win_to_widget, xg_event_is_for_menubar):
24536 Call gdk_x11_window_lookup_for_display.
24537 (xg_set_widget_bg): New function.
24538 (delete_cb): New function.
24539 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24540 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24541 (xg_set_background_color): Call xg_set_widget_bg.
24542 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24543 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24544 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24545 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24547 (update_frame_tool_bar): Call gtk_widget_hide.
24548 (xg_initialize): Use GDK_KEY_g.
24550 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24552 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24554 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24555 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24556 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24558 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24560 * w32xfns.c (select_palette): Check success of RealizePalette against
24561 GDI_ERROR, not zero.
24563 See ChangeLog.11 for earlier changes.
24565 ;; Local Variables:
24569 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24571 This file is part of GNU Emacs.
24573 GNU Emacs is free software: you can redistribute it and/or modify
24574 it under the terms of the GNU General Public License as published by
24575 the Free Software Foundation, either version 3 of the License, or
24576 (at your option) any later version.
24578 GNU Emacs is distributed in the hope that it will be useful,
24579 but WITHOUT ANY WARRANTY; without even the implied warranty of
24580 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24581 GNU General Public License for more details.
24583 You should have received a copy of the GNU General Public License
24584 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.