1 2013-06-03 Eli Zaretskii <eliz@gnu.org>
3 * w32console.c (initialize_w32_display): Return the dimensions of
4 the console window via 2 additional arguments, not via the current
5 frame. This avoids crashes due to overrunning the bounds of
6 frame's decode_mode_spec_buffer, which is not resized following
7 the change of the frame dimensions from the initial 10x10.
9 * w32term.h (w32_initialize_display_info): Adjust prototype.
11 * term.c (init_tty): Take dimensions of the frame from the values
12 returned by initialize_w32_display.
14 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
15 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
16 (LIBES): Add $(GFILENOTIFY_LIBS).
18 * w32inevt.c (handle_file_notifications): Add dummy implementation
21 * w32term.c: Wrap code with HAVE_W32NOTIFY.
23 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
25 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
27 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
29 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
31 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
33 Fix minor problems found by static checking.
34 * data.c (pure_write_error):
35 Use xsignal2, not Fsignal, as Fsignal might return.
36 * eval.c (set_backtrace_debug_on_exit): Now static.
37 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
38 No longer inline. EXTERN_INLINE is needed only for functions
39 defined in .h files. Reindent function header as per GNU style.
40 (backtrace_p, backtrace_top, backtrace_next):
41 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
42 compiler or linker. Add extern decls to pacify gcc -Wall.
43 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
45 * frame.c (free_monitors): Define only on platforms that need it.
46 * nsterm.m (ns_term_init):
47 * process.c (catch_child_signal):
48 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
49 defined on all porting targets these days.
50 * process.c, process.h (catch_child_signal):
51 Make it extern only if NS_IMPL_GNUSTEP is defined.
53 2013-06-03 Eli Zaretskii <eliz@gnu.org>
55 * w32.c (gettimeofday): Make the signature identical to prototype
58 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
60 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
63 * keyboard.c (safe_run_hooks_error): Improve error message.
65 * data.c (pure_write_error): Add `object' argument.
66 * puresize.h (CHECK_IMPURE): Use it.
68 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
70 * Makefile.in (NOTIFY_OBJ): New variable.
71 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
73 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
74 Call syms_of_gfilenotify.
76 * gfilenotify.c: New file.
78 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
80 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
81 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
83 * lisp.h: Declare syms_of_gfilenotify.
85 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
87 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
89 Merge the specpdl and backtrace stacks. Make the structure of the
90 specpdl entries more obvious via a tagged union of structs.
91 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
92 (enum specbind_tag): New enum.
93 (struct specbinding): Make it a tagged union of structs.
94 Add a case for backtrace records.
95 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
96 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
97 (backtrace_debug_on_exit): New accessors.
98 (struct backtrace): Remove.
99 (struct catchtag): Remove backlist field.
100 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
102 (Flocal_variable_p): Speed up the common case where the binding is
104 * eval.c (backtrace_list): Remove.
105 (set_specpdl_symbol, set_specpdl_old_value): Remove.
106 (set_backtrace_args, set_backtrace_nargs)
107 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
108 (backtrace_next): New functions.
109 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
110 (unwind_to_catch, internal_lisp_condition_case)
111 (internal_condition_case, internal_condition_case_1)
112 (internal_condition_case_2, internal_condition_case_n): Don't bother
113 with backtrace_list any more.
114 (Fsignal): Adjust to new backtrace format.
115 (grow_specpdl): Move up.
116 (record_in_backtrace): New function.
117 (eval_sub, Ffuncall): Use it.
118 (apply_lambda): Adjust to new backtrace format.
119 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
121 (specbind): Adjust to new specpdl format. Simplify.
122 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
123 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
125 (mark_backtrace): Remove.
126 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
127 * xdisp.c (redisplay_internal): Use record_in_backtrace.
128 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
130 * profiler.c (record_backtrace): Use get_backtrace.
131 (handle_profiler_signal): Use backtrace_top_function.
132 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
135 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
137 * process.h (catch_child_signal): Declare.
139 * process.c (catch_child_signal): New function.
140 (init_process_emacs): Call it.
142 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
143 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
145 (x_set_cursor_type): Remove declaration.
146 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
147 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
148 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
149 (ns_get_color): Use F suffix on float.
150 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
151 (ns_get_rgb_color): Remove.
152 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
153 (note_mouse_movement): x and y are CGFloat.
154 (ns_draw_fringe_bitmap): Remove unused rowY.
155 Change #if to COCOA && >= 10_6.
156 (ns_draw_window_cursor): Remove unused overspill.
157 (ns_draw_underwave): width and x are EamcsCGFloat.
158 (ns_draw_box): thickness is CGFloat.
159 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
160 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
161 if not in main thread.
162 (ns_get_pending_menu_title, ns_check_menu_open)
163 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
164 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
165 (sendFromMainThread:): New method.
166 (changeFont:): size is CGFloat.
167 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
168 Disable warning about permanent text.
169 (characterIndexForPoint:): Adjust return type depending on GNUStep
171 (mouseDown:): delta is CGFloat.
172 (updateFrameSize): Remove unised variable f.
173 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
174 Cast float to EmacsCGFloat.
175 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
176 also to -1 when restoring.
177 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
178 inside NS_IMPL_COCOA.
179 (toggleFullScreen:): Put call to toggleFullScreen inside
180 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
181 (setPosition:portion:whole:): por is CGFloat.
182 (getMouseMotionPart:window:x:y:): Add F suffix to float.
183 (mouseDown:): Use CGFloat.
184 (mouseDragged:): Remove unised variable edge.
185 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
187 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
189 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
190 when NS_IMPL_GNUSTEP.
191 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
192 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
193 (EmacsToolbar): Add clearAll. Add tag argument to
194 addDisplayItemWithImage.
195 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
197 * nsselect.m (ns_get_local_selection): Remove unused variable type.
199 * nsmenu.m (ns_update_menubar): Make static.
200 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
201 (fillWithWidgetValue:): Add cast to SEL for setAction.
202 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
203 (update_frame_tool_bar): Update code for GNUStep.
204 (clearAll): New method.
205 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
206 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
207 identifierToItem setObject and activeIdentifiers addObject before
208 call to insertItemWithItemIdentifier.
209 (validateVisibleItems): Fix indentation.
210 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
211 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
212 UtilityWindow to aStyle, remove call to setStyleMask.
214 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
216 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
217 (ns_charset_covers, ns_get_covering_families, nsfont_open):
218 Use F suffix on floats.
219 (ns_char_width): Returns CGFloat.
220 (ns_ascii_average_width): w is CGFloat instead of float.
221 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
223 (ns_glyph_metrics): CGFloat instead of float.
225 * nsfns.m (x_set_foreground_color, x_set_background_color): Use
227 (ns_implicitly_set_icon_type, Fx_create_frame): Make static, remove
229 (Fns_read_file_name): Keep track if panel is for save. Use
230 ns_filename_from_panel/ns_directory_from_panel.
231 (Fns_list_services): delegate only used for COCOA.
232 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep. Just
233 return the input if GNUStep.
234 (x_screen_planes): Remove.
235 (Fxw_color_values): Use EmacsCGFloat
236 (Fns_display_monitor_attributes_list): Only get screen number for
238 (getDirectory, getFilename): Removed from EmacsOpenPanel and
240 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
241 ns_directory_from_panel.
243 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
245 * process.c (handle_child_signal): Also use WCONTINUED.
246 This is so that list-processes doesn't mistakenly list the process
247 as stopped, when the process has actually been continued and is
250 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
252 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
253 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
254 not already configured.
256 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
258 2013-05-29 Eli Zaretskii <eliz@gnu.org>
260 * Makefile.in (mostlyclean): Remove *.res files.
262 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
264 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
267 2013-05-27 Eli Zaretskii <eliz@gnu.org>
269 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
270 display vector, and we backtrack, handle the case that the
271 previous character position is also displayed from a display
272 vector or covered by a display string or image. (Bug#14476)
274 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
276 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
277 (struct MonitorInfo, free_monitors): Remove.
278 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
279 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
280 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
283 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
284 (struct MonitorInfo, free_monitors): Remove.
285 (ns_screen_name): Make static.
286 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
287 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
290 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
291 (struct MonitorInfo): New struct.
292 (free_monitors, make_monitor_attribute_list): Declare.
294 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
296 (free_monitors, make_monitor_attribute_list): New functions.
297 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
300 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
302 * callproc.c (call_process): Refine the doc string. (Bug#14045)
304 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
306 * keyboard.c: Apply keyboard decoding only to events that come directly
307 from the tty, not from unread-command-events (bug#14368).
308 (read_event_from_main_queue): New function, extracted from read_char).
309 (read_decoded_char): Remove.
310 (read_decoded_event_from_main_queue): New function to replace it.
312 (read_key_sequence): Use read_char rather than read_decoded_char.
314 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
316 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
318 * casetab.c (init_casetab_once): Fix last change (bug#14424).
320 2013-05-22 Kenichi Handa <handa@gnu.org>
322 The following changes are to fix the setting of
323 buffer-file-coding-system on, for instance, C-x RET c unix RET
324 _FILE_OF_DOS_EOL_TYPE_ RET.
326 * coding.h (struct coding_system): New member detected_utf8_chars.
328 * coding.c (detect_coding_utf_8): Count characters and check EOL
329 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
331 (setup_coding_system): Do not initialize coding->head_ascii.
332 (check_ascii): Do not set coding->eol_seen but update it. Do not
333 call adjust_coding_eol_type here.
334 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
335 If the eol-type of CODING is already specified, adjust the eol type
336 of the found coding-system.
337 (decode_coding_gap): Cancel previous change. Utilize the
338 character numbers counted by detect_coding_utf_8. Fix detection
341 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
343 * search.c (looking_at_1): Only set last_thing_searched if the match
344 changed the match-data (bug#14281).
346 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
348 * xdisp.c (reseat_at_previous_visible_line_start):
349 Already declared in dispextern.h, so remove it here.
350 (move_it_vertically_backward): Likewise.
352 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
354 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
355 (Fx_display_pixel_width, Fx_display_pixel_height)
356 (Fx_display_mm_width, Fx_display_mm_height):
357 Mention `display-monitor-attributes-list' in docstrings.
359 * nsfns.m (ns_get_screen): Remove function. All uses removed.
360 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
361 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
362 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
363 (Fx_display_backing_store, Fx_display_visual_class)
364 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
365 (Fx_display_grayscale_p, Fx_display_pixel_width)
366 (Fx_display_pixel_height, Fx_display_planes)
367 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
368 (Fx_display_screens): Don't confuse X11 screens with NS screens.
369 (Fx_display_mm_width, Fx_display_mm_height)
370 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
371 height for all physical monitors as in X11.
373 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
374 Return pixel width or height for all physical monitors as in X11.
376 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
378 Port --enable-gcc-warnings to clang.
379 * bytecode.c (exec_byte_code):
381 Redo diagnostic pragmas to pacify clang, too.
382 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
383 * editfns.c (Fencode_time):
384 * fileio.c (file_accessible_directory_p):
385 * font.c (font_unparse_xlfd):
386 Use '&"string"[index]' instead of '"string" + (index)'.
387 * undo.c (user_error): Remove; unused.
389 2013-05-16 Eli Zaretskii <eliz@gnu.org>
391 * insdel.c (insert_1_both): Document the arguments, instead of
392 referring to insert_1, which no longer exists.
394 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
395 some window, increment windows_or_buffers_changed, so that
396 *Messages* display in that window is updated. (Bug#14408)
398 * w32.c: Include epaths.h.
399 (init_environment): Use cmdproxy.exe without leading directories.
400 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
402 (gettimeofday): Adjust signature and return value to Posix
405 * unexw32.c (open_output_file): Delete the existing emacs.exe
406 before creating it, to break the hard link to the versioned
409 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
410 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
411 (FIRSTFILE_OBJ): New variables.
412 (W32_RES): Rename to EMACSRES. All users changed.
413 (base_obj): Use $(CM_OBJ).
414 (ALLOBJS): Use $(FIRSTFILE_OBJ).
415 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
416 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
417 $(W32_RES_LINK) before $(LIBES).
418 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
420 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
422 * makefile.w32-in (DOC): Use just "DOC".
424 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
426 * process.c: Export default filters and sentinels to Elisp.
427 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
429 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
430 (Fset_process_sentinel, Fformat_network_address):
431 Default to them instead of nil.
432 (server_accept_connection): Sentinels can't be nil any more.
433 (read_and_dispose_of_process_output): New function, extracted from
435 (read_process_output): Use it; filters can't be nil.
436 (Finternal_default_process_filter): New function, extracted from
438 (exec_sentinel_unwind): Remove function.
439 (exec_sentinel): Don't zilch sentinel while running.
440 (status_notify): Sentinels can't be nil.
441 (Finternal_default_process_sentinel): New function extracted from
443 (setup_process_coding_systems): Default filter is not nil any more.
444 (syms_of_process): Export new Elisp functions and initialize
446 * lisp.h (make_lisp_proc): New function.
448 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
450 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
452 2013-05-14 Eli Zaretskii <eliz@gnu.org>
454 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
455 unless we know that the window w is a leaf window.
456 Another attempt at solving bug#14062.
458 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
460 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
463 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
465 * image.c (gif_load): Check that subimages fit (Bug#14345).
467 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
469 * lread.c (skip_dyn_eof): New function.
470 (read1): Use it to skip the end of a file in response to #@00.
472 * doc.c (get_doc_string): Slightly relax the sanity checking.
474 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
476 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
477 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
478 (MonitorInfo): New struct.
479 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
480 (Fns_display_monitor_attributes_list): New functions.
481 (display-usable-bounds): Remove.
482 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
485 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
487 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
488 (GTK_CHECK_VERSION): New macro, if not already defined.
489 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
490 replaced by GTK_CHECK_VERSION.
492 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
494 * xterm.h (GTK_PREREQ): New macro.
495 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
496 to use this macro instead, for consistency and clarity.
498 2013-05-08 Eli Zaretskii <eliz@gnu.org>
500 * xdisp.c (row_for_charpos_p): New function, with code of
501 cursor_row_p, but accepts an additional argument CHARPOS instead
502 of using a hardcoded PT.
503 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
504 (row_containing_pos): Call row_for_charpos_p instead of partially
505 doing the same. Fixes cursor positioning under longlines-mode
506 when longlines-show-effect includes more than one newline, when
507 moving the cursor vertically up.
509 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
511 * makefile.w32-in (ACL_H): New macro.
512 ($(BLD)/fileio.$(O)): Update dependencies.
514 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
516 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
517 * Makefile.in (LIB_ACL): New macro.
518 (LIBACL_LIBS): Remove.
519 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
520 * fileio.c: Include <acl.h>.
521 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
522 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
524 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
527 * unexelf.c: Don't assume ElfW (Half) fits in int.
528 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
529 when dealing with ElfW (Half) values, since they can exceed 2**31
530 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
531 (entry_address): Omit unused NUM arg. All uses changed.
533 2013-05-07 Juri Linkov <juri@jurta.org>
535 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
536 to the string converted from number with `Fnumber_to_string'.
539 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
541 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
542 This fixes a problem introduced by my previous change.
544 2013-05-07 Glenn Morris <rgm@gnu.org>
546 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
548 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
550 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
552 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
554 Static checking by GCC 4.8.0.
555 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
556 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
557 (x_get_monitor_attributes_fallback)
558 (x_get_monitor_attributes_xinerama)
559 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
560 Define only if USE_GTK.
561 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
562 (x_get_monitor_attributes_fallback): Omit unused locals.
563 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
564 Use double, not float, to avoid mixed-mode floating point arithmetic.
566 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
567 Jan Djärv <jan.h.d@swipnet.se>
569 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
570 (XINERAMA_CFLAGS): New macros.
571 (ALL_CFLAGS, LIBES): Use them.
573 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
574 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
575 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
576 (syms_of_xfns): DEFSYM them.
577 (struct MonitorInfo): New struct.
578 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
579 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
580 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
581 (x_get_monitor_attributes_xinerama): New functions.
582 (Fx_display_monitor_attributes_list): New primitive.
583 (syms_of_xfns): Defsubr it.
585 * xterm.h (x_display_info): Add Xatom_net_workarea and
586 Xatom_net_current_desktop.
588 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
589 and dpyinfo->Xatom_net_current_desktop.
591 2013-05-06 Eli Zaretskii <eliz@gnu.org>
593 * xdisp.c (pos_visible_p): Use the special code for finding the
594 beginning of a display property or overlay for any "replacing"
595 display property, not just for display strings. This solves
596 incorrect reporting of position by posn-at-point. (Bug#14241)
598 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
600 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
601 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
602 Verify that ElfW (Half) fits in int.
603 (fatal): Use same signature as lisp.h.
604 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
605 configure and build with -DUNEXELF_DEBUG without worrying about
606 other modules that use DEBUG.
607 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
608 possibly-wide integers now uses it instead of plain fprintf.
609 (entry_address): New function, which avoids problems with 32-bit
610 overflow on 64-bit hosts.
611 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
612 (round_up): Don't assume the remainder fits in int.
613 (find_section): Use bool for boolean. Simplify debug code.
614 (unexec): Don't assume file sizes fit in int or size_t.
615 Omit unnecessary trailing newline in 'fatal' format.
616 Use strerror rather than outputting decimal error number.
617 Remove unused code when emacs is not defined;
618 this file relies on Emacs now.
619 Don't assume e_phnum and e_shnum are positive.
621 * regex.c: Fix problems when DEBUG is defined.
622 (extract_number, extract_number_and_incr): Define regardless of
623 whether DEBUG is defined; that's simpler and makes the code less
624 likely to go stale in the normal case when DEBUG is not defined.
625 Return int rather than taking an int * arg. All callers changed.
626 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
627 Remove, replacing with ...
628 (DEBUG_PRINT): New macro. All callers changed.
629 (DEBUG_COMPILES_ARGUMENTS): New macro.
630 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
631 (print_compiled_pattern, print_double_string) [DEBUG]:
632 Use prototype rather than old-style definition.
633 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
634 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
635 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
636 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
637 Don't assume ptrdiff_t, size_t, and long are the same width as int.
638 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
639 This matters only when DEBUG is defined.
641 2013-05-05 Eli Zaretskii <eliz@gnu.org>
643 * xdisp.c (set_iterator_to_next): Set the
644 ignore_overlay_strings_at_pos_p flag only if we are _really_
645 iterating over an overlay string, as indicated by the
646 current.overlay_string_index member. (Bug#14306)
648 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
650 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
651 to where it is used, to avoid autorelease issues (Bug#14050).
653 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
655 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
656 * fileio.c (syms_of_fileio): Implement this.
657 * filelock.c (create_lock_file): If symbolic links don't work, so
658 we use a regular file as a lock file, do not fsync the lock file;
661 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
663 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
664 (syms_of_minibuf): Adjust accodingly.
666 * callint.c (Fcall_interactively): Adjust calls accordingly.
668 2013-05-04 Eli Zaretskii <eliz@gnu.org>
670 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
671 w->contents is a buffer before computing everything else.
672 Use parentheses to disambiguate last part of the condition.
674 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
675 assertion violations. (Bug#14062)
677 2013-05-01 David Reitter <david.reitter@gmail.com>
679 * nsfns.m (ns_tooltip): Initialize.
681 2013-04-28 Eli Zaretskii <eliz@gnu.org>
683 * coding.c (decode_coding_gap): Don't remove the character before
684 a newline unless it's a CR character. (Bug#14287)
686 2013-04-28 Dan Nicolaescu <dann@gnu.org>
688 * dispextern.h (struct face): Move enum face_underline_type
689 earlier so that bitfields can be in the same word.
691 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
693 * nsfns.m (handlePanelKeys): New function.
694 (EmacsOpenPanel:performKeyEquivalent:)
695 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
696 arrows/function/control and copy/paste keys (Bug#14296).
698 2013-04-27 Juri Linkov <juri@jurta.org>
700 * callint.c (Fcall_interactively): Call `Qread_number' for
701 interactive code letter `n' instead of using duplicate code.
704 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
706 * systime.h (make_timeval): Declare as 'const'.
708 2013-04-27 Kenichi Handa <handa@gnu.org>
710 * font.c (font_open_entity): Always open a font of manageable
713 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
715 Port better to AIX (Bug#14258).
716 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
719 2013-04-24 Kenichi Handa <handa@gnu.org>
721 * coding.c (decode_coding_iso_2022): When an invalid escape
722 sequence is encountered, reset the invocation and designation
723 status to the safest one.
725 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
727 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
728 Without this fix, "make distclean" leaves stamp-h1 behind.
730 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
732 * w32fns.c (w32_fullscreen_rect): New function to compute the
733 window rectangle for the given fullscreen mode.
734 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
735 longer tunes the window size. This keeps the window's edges flush
736 with the screen and allows the taskbar to hide itself in fullboth.
738 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
739 window decorations and uses the entire screen.
741 * w32term.h (w32_fullscreen_rect) Add prototype.
742 (struct w32_output): Replace normal_width, normal_height,
743 normal_top, and normal_left members with a single normal_placement
745 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
747 (FRAME_NORMAL_PLACEMENT): New macro.
749 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
751 * minibuf.c (Ftest_completion): Silence compiler warning.
753 2013-04-15 Eli Zaretskii <eliz@gnu.org>
755 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
758 * frame.h (WINDOW_FRAME): Protect macro and its argument with
761 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
762 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
763 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
764 parentheses where appropriate.
766 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
768 * keyboard.c (timer_start_idle): Remove no-longer-used local.
770 2013-04-14 Eli Zaretskii <eliz@gnu.org>
772 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
773 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
774 Mention in the doc string that setting these variables takes
775 effect only after a call to set-window-buffer. (Bug#14200)
777 2013-04-13 Eli Zaretskii <eliz@gnu.org>
779 * indent.c (Fvertical_motion): Don't consider display strings on
780 overlay strings as display strings on the buffer position we
781 started from. This prevents vertical cursor motion from jumping
782 more than one line when there's an overlay string with a display
783 property at end of line.
784 Reported by Karl Chen <Karl.Chen@quarl.org> in
785 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
787 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
789 * window.c (select_window): `record_buffer' even if window is
790 already selected (bug#14191).
792 2013-04-11 Eli Zaretskii <eliz@gnu.org>
794 * window.c (Fwindow_end): Test more flags, including the buffer's
795 last_overlay_modified flag, to determine whether the window's
796 display is really up-to-date. Prevents the function from
797 returning a stale value. (Bug#14170)
798 (Fwindow_line_height): Fix the test for up-to-date-ness of the
801 2013-04-10 Eli Zaretskii <eliz@gnu.org>
803 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
804 garbaged only if it is not already the top frame on its TTY.
805 This prevents flickering due to constant redrawing of TTY frames when
806 there are GUI frames open in the same session. (Bug#13864)
808 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
810 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
811 of marking the idle timers directly.
813 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
815 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
818 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
820 * window.c (select_window): Don't record_buffer while the invariant is
821 temporarily broken (bug#14161).
823 * fns.c (Fdelq): Don't assume !NILP => CONSP.
825 2013-04-07 Eli Zaretskii <eliz@gnu.org>
827 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
829 2013-04-07 Romain Francoise <romain@orebokech.com>
831 Ignore additional platform-specific ACL errors (Bug#13702).
832 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
833 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
835 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
837 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
840 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
842 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
843 This bug was introduced by my 2013-02-25 change that simplified
844 data_start configuration. Without this change, on GNU/Linux
845 an Emacs configured with --enable-profiling fails immediately
846 due to a profiler signal.
847 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
848 with these flags. On platforms where special flags are needed
849 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
850 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
851 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
853 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
855 Get rid of some platform-specific functions examining window
856 system and its capabilities. This is a partial rework of the
858 * lisp.h (have_menus_p): Remove prototype. This function is
859 replaced with platform-independent window_system_available.
860 (check_window_system): Move to...
861 * frame.h (decode_window_system_frame, window_system_available):
862 ...here, add new prototypes.
863 * frame.c (window_system_available, decode_window_system_frame):
865 (check_window_system): Platform-independent now.
866 * xterm.h (x_in_use): Remove declaration.
868 * w32term.h (check_x_frame):
869 * nsterm.h (check_x_frame): Remove prototypes. This function
870 is replaced with platform-independent decode_window_system_frame.
871 * msdos.c (have_menus_p): Remove.
872 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
873 Remove platform-specific functions. Use check_window_system,
874 decode_window_system_frame and check_ns_display_info where
875 appropriate. Minor style and comment tweaks.
876 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
877 (check_x_frame): Likewise.
878 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
880 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
881 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
882 * xmenu.c, xselect.c: All related users changed.
884 2013-04-03 Kenichi Handa <handa@gnu.org>
886 The following changes is to optimize the code for reading UTF-8
889 * coding.c (check_ascii): Rename from detect_ascii. Return value
890 changed. Check EOL format. Do not call adjust_coding_eol_type
892 (check_utf_8): New function.
893 (adjust_coding_eol_type): Do nothing if already adjusted.
894 (detect_coding): Compare the return value of check_ascii with
895 coding->src_bytes. Call adjust_coding_eol_type if necessary.
896 (decode_coding_gap): Optimize for valid UTF-8.
898 2013-03-21 Kenichi Handa <handa@gnu.org>
900 * coding.c (syms_of_coding): Cancel previous change.
902 * insdel.c (insert_from_gap): Fix previous change.
904 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
906 Consistently use platform-specific function to detect window system.
907 * lisp.h (check_window_system): New prototype. This function is
908 going to replace check_x, check_w32 and check_ns.
909 (have_menus_p): Mention msdos.c in comment.
910 * fontset.c (check_window_system_func): Remove. Adjust all users.
911 * fontset.h (check_window_system_func): Remove prototype.
912 * nsterm.h (check_ns):
914 * w32term.h (check_w32): Likewise.
915 * menu.c (Fx_popup_menu): Use check_window_system.
916 * msdos.c (check_window_system): Define for MS-DOS.
917 * nsfns.m (check_window_system): Define for NS. Adjust all users.
918 * w32fns.c (check_window_system): Likewise for MS-Windows.
919 * xfns.c (check_window_system): Likewise for X.
920 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
921 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
923 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
925 Prefer < to > in range checks such as 0 <= i && i < N.
926 This makes it easier to visualize quantities on a number line.
927 This patch doesn't apply to all such range checks,
928 only to the range checks affected by the 2013-03-24 change.
929 This patch reverts most of the 2013-03-24 change.
930 * alloc.c (xpalloc, Fgarbage_collect):
931 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
932 * character.c (string_escape_byte8):
933 * charset.c (read_hex):
934 * data.c (cons_to_unsigned):
935 * dispnew.c (update_frame_1):
936 * doc.c (Fsubstitute_command_keys):
938 * editfns.c (hi_time, decode_time_components):
939 * fileio.c (file_offset):
940 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
941 * font.c (font_intern_prop):
942 * frame.c (x_set_alpha):
943 * gtkutil.c (get_utf8_string):
944 * indent.c (check_display_width):
945 * keymap.c (Fkey_description):
946 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
948 * minibuf.c (read_minibuf_noninteractive):
949 * process.c (wait_reading_process_output):
950 * search.c (Freplace_match):
951 * window.c (get_phys_cursor_glyph):
952 * xdisp.c (redisplay_internal):
953 * xsmfns.c (smc_save_yourself_CB):
954 Prefer < to > for range checks.
955 * dispnew.c (sit_for): Don't mishandle NaNs.
956 This fixes a bug introduced in the 2013-03-24 change.
957 * editfns.c (decode_time_components): Don't hoist comparison.
958 This fixes another bug introduced in the 2013-03-24 change.
960 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
962 * frame.h (struct frame): Drop scroll_bottom_vpos
963 member becaue all real users are dead long ago.
964 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
965 * xdisp.c (redisplay_internal): Adjust user.
967 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
969 * nsmenu.m (showAtX:Y:for:): setLevel to
970 NSPopUpMenuWindowLevel (Bug#13998).
972 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
974 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
975 (ns_check_pending_open_menu): Declare.
977 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
978 (x_activate_menubar): Update the menu with title that matches
979 ns_get_pending_menu_title, and call
980 ns_check_pending_openmenu (Bug#12698).
981 (menuWillOpen:): New method.
982 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
984 * nsterm.m (menu_will_open_state, menu_mouse_point)
985 (menu_pending_title): New varaibles.
986 (ns_get_pending_menu_title, ns_check_menu_open)
987 (ns_check_pending_open_menu): New functions.
989 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
991 * indent.c (current_column_bol_cache): Remove leftover which is not
992 used in Fmove_to_column any more.
993 (current_column, scan_for_column): Adjust users.
994 * keyboard.c (last_point_position_buffer, last_point_position_window):
995 Remove leftovers which are not used for recording undo any more.
996 (command_loop_1, syms_of_keyboard): Adjust users.
997 * xdisp.c (last_max_ascent): Remove leftover which is not used in
998 redisplay_window any more.
999 (move_it_to): Adjust user.
1001 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
1003 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1004 Update dependencies.
1006 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1008 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1009 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1012 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1014 * window.h (struct window): Replace hchild, vchild and buffer slots
1015 with the only contents slot. This is possible because each valid
1016 window may have either the child window (in vertical or horizontal
1017 combination) or buffer to display (for the leaf window). Using that,
1018 a lof of operations to traverse and/or change window hierarchies may
1019 be simplified. New member horizontal is used to distinguish between
1020 horizontal and vertical combinations of internal windows.
1021 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1022 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1023 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1024 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1025 Use contents slot, not buffer, where appropriate.
1026 (wset_combination): New function.
1027 (wset_buffer): Add eassert.
1028 (Fframe_first_window): Simplify the loop reaching first window.
1029 (Fwindow_buffer): Use WINDOW_LEAF_P.
1030 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1031 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1032 (unshow_buffer): Convert initial debugging check to eassert.
1033 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1034 (make_parent_window, window_resize_check, window_resize_apply)
1035 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1036 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1037 Adjust to match struct window changes.
1038 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1039 (mark_window_cursors_off, count_windows, get_leaf_windows)
1040 (foreach_window_1): Simplify the loop.
1041 * alloc.c (mark_object): Do not check for the leaf window because
1042 internal windows has no glyph matrices anyway.
1043 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1044 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1045 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1046 (build_frame_matrix_from_window_tree, mirror_make_current)
1047 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1048 (update_window_tree, set_window_update_flags): Simplify the loop.
1049 (sync_window_with_frame_matrix_rows): Enforce live window.
1050 Use contents slot, not buffer, where appropriate.
1051 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1052 and WINDOW_HORIZONTAL_COMBINATION_P.
1053 (make_frame_visible_1): Simplify the loop.
1054 Use contents slot, not buffer, where appropriate.
1055 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1056 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1057 (expose_window_tree): Likewise.
1058 Use contents slot, not buffer, where appropriate.
1059 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1060 to avoid deleted windows. Use contents slot instead of buffer.
1061 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1062 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1063 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1064 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1066 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1068 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1069 identify the reasons for assertion violations in bug#14062 and
1071 (Fx_show_tip): Fix compilation error under
1072 "--enable-check-lisp-object-type". (Bug#14073)
1074 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1075 Reported by <rzl24ozi@gmail.com>.
1077 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1079 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1081 (unwind_with_echo_area_buffer): ...to restore it here.
1082 This is needed to ensure that...
1083 (redisplay_window): ...both window markers are valid here,
1084 which is verified by eassert.
1085 * editfns.c (save_excursion_save): Do not assume that
1086 selected_window always displays the buffer.
1087 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1090 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1092 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1095 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1097 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1099 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1101 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1102 since MinGW's w32api headers do. This avoids compiler warnings.
1104 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1107 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1109 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1111 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1113 * gtkutil.c (style_changed_cb): Check if frame is live and an
1114 X frame (Bug#14038).
1116 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1118 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1119 Define only for _WIN32_WINNT less than 0x0500.
1120 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1122 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1123 see its own definitions of 'struct timeval' and 'struct timezone'.
1125 Fix incompatibilities between MinGW.org and MinGW64 headers.
1126 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1128 * w32.c (REPARSE_DATA_BUFFER): Guard with
1129 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1131 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1133 * xterm.c: Include X11/XKBlib.h
1134 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1136 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1138 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1140 * blockinput.h (input_blocked_p): Likewise.
1141 * bytecode.c (exec_byte_code): Likewise.
1142 * callproc.c (call_process_kill, call_process_cleanup)
1143 (Fcall_process): Likewise.
1144 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1145 (Fccl_execute_on_string): Likewise.
1146 * character.c (string_escape_byte8): Likewise.
1147 * charset.c (read_hex): Likewise.
1148 * cm.c (calccost): Likewise.
1149 * data.c (cons_to_unsigned): Likewise.
1150 * dired.c (directory_files_internal, file_name_completion):
1152 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1153 (sit_for): Likewise.
1154 * doc.c (Fsubstitute_command_keys): Likewise.
1155 * doprnt.c (doprnt): Likewise.
1156 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1157 * emacsgtkfixed.c: Likewise.
1158 * fileio.c (file_offset, Fwrite_region): Likewise.
1159 * floatfns.c (Fexpt, fmod_float): Likewise.
1160 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1162 * font.c (font_intern_prop): Likewise.
1163 * frame.c (x_set_alpha): Likewise.
1164 * gtkutil.c (get_utf8_string): Likewise.
1165 * indent.c (check_display_width): Likewise.
1166 * intervals.c (create_root_interval, rotate_right, rotate_left)
1167 (split_interval_right, split_interval_left)
1168 (adjust_intervals_for_insertion, delete_node)
1169 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1170 (merge_interval_right, merge_interval_left, copy_intervals)
1171 (set_intervals_multibyte_1): Likewise.
1172 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1173 * keymap.c (Fkey_description): Likewise.
1174 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1175 * lread.c (openp, read_integer, read1, string_to_number):
1177 * menu.c (ensure_menu_items): Likewise.
1178 * minibuf.c (read_minibuf_noninteractive): Likewise.
1179 * print.c (printchar, strout): Likewise.
1180 * process.c (create_process, Faccept_process_output)
1181 (wait_reading_process_output, read_process_output, send_process)
1182 (wait_reading_process_output): Likewise.
1183 * profiler.c (make_log, handle_profiler_signal): Likewise.
1184 * regex.c (re_exec): Likewise.
1185 * regex.h: Likewise.
1186 * search.c (looking_at_1, Freplace_match): Likewise.
1187 * sysdep.c (get_child_status, procfs_ttyname)
1188 (procfs_get_total_memory): Likewise.
1189 * systime.h (EMACS_TIME_VALID_P): Likewise.
1190 * term.c (dissociate_if_controlling_tty): Likewise.
1191 * window.c (get_phys_cursor_glyph): Likewise.
1192 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1193 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1195 * xfns.c (Fx_window_property): Likewise.
1196 * xmenu.c (set_frame_menubar): Likewise.
1197 * xselect.c (x_get_window_property, x_handle_dnd_message):
1199 * xsmfns.c (smc_save_yourself_CB): Likewise.
1200 * xterm.c (x_scroll_bar_set_handle): Likewise.
1202 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1204 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1205 to be optional or nil. Adjust comment and convert it to docstring.
1206 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1207 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1209 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1211 Static checking by GCC 4.8-20130319.
1212 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1213 * process.c (Fset_process_datagram_address)
1214 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1215 * xdisp.c (get_char_face_and_encoding):
1216 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1217 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1218 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1220 2013-03-24 Ken Brown <kbrown@cornell.edu>
1222 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1223 fix compilation on 64-bit Cygwin, where underscores are not
1224 automatically prepended.
1226 * w32term.c (w32_initialize): Silence compiler warning.
1228 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1230 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1231 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1232 variables, to save and restore frame dimensions.
1233 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1234 after returning from a 'fullscreen' configuration.
1235 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1236 to avoid races between the main thread and the input thread.
1238 * w32term.h (struct w32_output): New members normal_width,
1239 normal_height, normal_top, normal_left, and prev_fsmode.
1240 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1241 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1244 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1245 'fullscreen' parameter. Always record previous width and height
1246 of the frame, except when switching out of maximized modes, so
1247 that they could be restored correctly, instead of resetting to the
1248 default frame dimensions. Send SC_RESTORE command to the frame,
1249 unless we are going to send SC_MAXIMIZE, to restore the frame
1250 resize hints in the mouse pointer shown by the window manager.
1253 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1255 * lisp.h (get_frame_param): Adjust conditions for prototype
1258 2013-03-22 Ken Brown <kbrown@cornell.edu>
1260 * unexcw.c: Drop unneeded inclusion of w32common.h.
1261 (report_sheap_usage): Declare.
1262 (read_exe_header): Add magic numbers for x86_64.
1263 (fixup_executable): Fix printf format specifier for unsigned long
1266 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1268 * frame.h (struct frame): Put menu_bar_window under #ifdef
1269 because this member is not needed when X toolkit is in use.
1270 (fset_menu_bar_window):
1271 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1272 (free_glyphs, update_frame):
1273 * xdisp.c (expose_frame): Likewise.
1274 (display_menu_bar): Likewise. Remove redundant eassert.
1275 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1278 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1280 Use functions and constants to manipulate Lisp_Save_Value objects.
1281 This replaces code that used macros and strings and token-pasting.
1282 The change makes the C source a bit easier to follow,
1283 and shrinks the Emacs executable a bit.
1284 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1285 (make_save_value): Change 1st arg from string to enum. All callers
1288 (mark_object): Use if, not #if, for GC_MARK_STACK.
1289 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1290 (XSAVE_OBJECT): Now functions, not macros.
1291 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1292 the constant was never used.
1293 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1294 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1295 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1296 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1298 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1299 type3 with a single member save_type. All uses changed.
1300 (save_type, set_save_pointer, set_save_integer): New functions.
1301 * print.c (PRINTX): Remove.
1303 * alloc.c: Remove redundant static declarations.
1305 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1307 * window.h (struct window): Convert left_col, top_line, total_lines
1308 and total_cols from Lisp_Objects to integers. Adjust comments.
1309 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1311 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1312 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1313 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1314 Adjust users where appropriate.
1316 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1318 * frame.h (struct frame): Drop resx and resy because the same data is
1319 available from window system-specific output context. Adjust users.
1320 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1321 New functions to provide defaults when no window system available.
1322 (FRAME_RES_X, FRAME_RES_Y): New macros.
1323 (NUMVAL): Move from xdisp.c.
1324 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1325 (Ffont_face_attributes, Fopen_font):
1326 * image.c (gs_load):
1327 * w32font.c (fill_in_logfont):
1328 * xdisp.c (calc_pixel_width_or_height):
1329 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1330 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1332 2013-03-20 Kenichi Handa <handa@gnu.org>
1334 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1335 to 1 (temporary workaround until a bug related to ASCII
1336 optimization is fixed).
1338 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1340 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1341 Signal error if window is not internal. Adjust docstring.
1342 (delete_all_child_windows): Use combination_limit to save the buffer.
1343 (Fset_window_configuration): Adjust accordingly.
1344 * print.c (syms_of_print): Initialize debugging output not here...
1345 (init_print_once): ...but in a new function here.
1346 * lisp.h (init_print_once): Add prototype.
1347 * emacs.c (main): Add call to init_print_once. Adjust comments.
1349 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1351 * window.c (window_resize_check, window_resize_apply)
1352 (window_from_coordinates, recombine_windows, set_window_buffer)
1353 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1354 (Fsplit_window_internal, Fdelete_window_internal)
1355 (freeze_window_starts): Use bool for booleans.
1356 * window.h (window_frame_coordinates, resize_frame_windows)
1357 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1359 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1361 * dispnew.c (bitch_at_user): Use `user-error'.
1363 2013-03-17 Ken Brown <kbrown@cornell.edu>
1365 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1366 as return type of image_background. (Bug#13981)
1367 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1369 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1371 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1372 (ns_select): Don't return with result uninitialized.
1374 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1377 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1379 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1380 directories. If filename is nil, get directory name (Bug#13932).
1381 Use getFilename and getDirectory.
1382 (getFilename, getDirectory): New methods for EmacsSavePanel and
1384 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1386 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1388 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1390 2013-03-15 Kenichi Handa <handa@gnu.org>
1392 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1393 (adjust_after_replace): Make it back to static. Delete the third
1394 arg text_at_gap_tail. Cancel the code for handling it.
1396 * coding.h (struct coding_system): New member eol_seen.
1398 * coding.c (detect_ascii): New function.
1399 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1400 when the source bytes are actually scanned. On detecting for
1401 coding_category_utf_8_auto, call detect_ascii instead of scanning
1402 source bytes directly.
1403 (produce_chars): Call insert_from_gap with the new arg 0.
1404 (encode_coding): Likewise.
1405 (decode_coding_gap): Control ASCII optimization by the variable
1406 disable_ascii_optimization instead of #ifndef .. #endif.
1407 Deccode EOL format according to coding->eol_seen.
1408 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1411 * lisp.h (adjust_after_replace): Cancel externing it.
1412 (insert_from_gap): Adjust prototype.
1414 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1416 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1417 FULLSCREEN_MAXIMIZED. (Bug#13935)
1419 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1421 * region-cache.c (find_cache_boundary, move_cache_gap)
1422 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1423 Simplify debugging check and convert to eassert. Adjust comment.
1424 (pp_cache): Put under ENABLE_CHECKING.
1426 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1428 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1429 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1431 (w32fullscreen_hook): If the frame is visible, reset
1432 f->want_fullscreen flag after changing the frame size. If the
1433 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1436 2013-03-13 Daniel Colascione <dancol@dancol.org>
1438 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1439 too so that these builds can use Cygwin's file conversion
1440 functions. (We've been building and linking cygw32.o all along
1441 and just not using it.)
1443 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1445 File synchronization fixes (Bug#13944).
1446 * Makefile.in (LIB_FDATASYNC): New macro.
1448 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1449 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1450 Don't worry about HAVE_FSYNC, since a substitute fsync is
1451 available if the system lacks one.
1452 (Fwrite_regin): Retry fsync if interrupted.
1454 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1456 * w32term.c (w32_read_socket): If the Emacs frame is being
1457 activated, call w32fullscreen_hook, to make sure the new frame
1458 dimensions are in effect. (Bug#13937)
1460 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1462 * xdisp.c (init_iterator): Simplify because both character and byte
1463 positions are either specified or -1. Add eassert. Adjust comment.
1464 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1465 character and byte positions can be obtained from marker.
1467 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1469 Static checking by Sun C 5.12.
1470 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1471 * bytecode.c (exec_byte_code):
1472 * dispnew.c (init_display):
1474 * fileio.c (Fsubstitute_in_file_name):
1475 * keyboard.c (Fevent_convert_list):
1476 * keymap.c (Fsingle_key_description):
1477 * term.c (maybe_fatal, fatal):
1478 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1479 * xsmfns.c (Fhandle_save_session):
1480 Omit unreachable code.
1481 * keymap.c (map_keymap_char_table_item): Cast void * to
1482 a function pointer type; the C Standard requires this.
1484 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1485 Include <sys/param.h> unconditionally, as that works elsewhere and
1486 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1487 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1490 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1492 * insdel.c (adjust_after_replace): Use bool for boolean.
1494 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1496 * keyboard.c: Move keyboard decoding to read_key_sequence.
1497 (decode_keyboard_code): Remove.
1498 (tty_read_avail_input): Don't try to decode input.
1499 (read_decoded_char): New function.
1500 (read_key_sequence): Use it.
1502 2013-03-10 Daniel Colascione <dancol@dancol.org>
1504 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1505 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1506 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1509 * w32term.c (construct_drag_n_drop): Use the above macros to make
1510 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1512 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1513 properly display non-ASCII frame titles in cygw32 builds.
1515 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1516 call ShellExecute in cygw32 builds.
1518 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1519 common file dialog code.
1521 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1522 can just use du like other systems.
1524 * coding.c (from_unicode_buffer): Declare.
1525 * coding.c (from_unicode_buffer): Implement.
1527 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1529 * lread.c: Minor cleanup.
1530 (FROM_FILE_P): New macro.
1531 (skip_dyn_bytes, unreadchar, read1): Use it.
1532 (read_list): Consolidate duplicated code.
1534 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1536 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1538 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1539 (redisplay_internal, set_cursor_from_row, try_window)
1540 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1541 (display_line, notice_overwritten_cursor)
1542 (mouse_face_from_buffer_pos, note_mouse_highlight):
1543 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1544 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1545 (mouse_face_from_string_pos, fast_find_string_pos):
1546 Use MATRIX_ROW_VPOS.
1548 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1550 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1552 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1553 MATRIX_MODE_LINE_ROW.
1555 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1557 2013-03-10 handa <handa@gnu.org>
1559 * lisp.h (adjust_after_replace): Extern it.
1561 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1562 case of detection for coding_category_utf_8_auto.
1563 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1564 Skip decoding if all bytes are ASCII.
1566 * insdel.c (adjust_after_replace): Make it public. New arg
1568 (adjust_after_insert): Call adjust_after_replace with the new arg
1571 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1573 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1574 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1575 from Elisp via unread-command-events.
1577 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1578 functions to mean "no change".
1580 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1582 region-cache.c, scroll.c, search.c: Use bool for booleans.
1583 * lisp.h (compile_pattern):
1584 * scroll.c (do_scrolling, do_direct_scrolling):
1585 * search.c (struct regexp_cache, compile_pattern_1)
1586 (compile_pattern, string_match_1, search_command)
1587 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1588 (search_regs_saved, Fregexp_quote):
1589 Use bool for boolean.
1590 * region-cache.c (region_cache_forward, region_cache_backward):
1591 Fix comments to match code: these functions return int, not boolean.
1593 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1595 * search.c (find_newline): Accept start and end byte positions
1596 as arguments and allow -1 if not known.
1597 (find_newline_no_quit): Likewise for start position.
1598 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1599 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1600 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1601 * editfns.c (Fconstrain_to_field): Break long line.
1602 Adjust call to find_newline.
1603 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1604 Use DEC_BOTH to start next search from the previous buffer
1605 position, where appropriate.
1606 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1607 (get_visually_first_element, move_it_vertically_backward): Likewise.
1608 Obtain byte position from the display iterator, where appropriate.
1610 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1612 print.c, process.c: Use bool for booleans.
1613 * lisp.h (wait_reading_process_output):
1614 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1615 (strout, debug_output_compilation_hack, float_to_string, print)
1617 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1618 (decode_status, status_message, create_process, create_pty)
1619 (Fmake_network_process, Fnetwork_interface_info)
1620 (wait_reading_process_output, read_process_output)
1621 (write_queue_push, write_queue_pop, process_send_signal)
1622 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1623 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1624 Use bool for booleans.
1625 * process.c (Fnetwork_interface_list): Remove unused local.
1626 (connect_counter): Now EMACS_INT, not int.
1628 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1630 * bidi.c (bidi_fetch_char): Swap first and second arguments
1631 to match other functions accepting character and byte positions.
1633 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1634 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1635 when you need just to move to the previous buffer position.
1636 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1638 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1640 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1642 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1644 Avoid character to byte conversions in motion subroutines.
1645 * indent.h (compute_motion, vmotion): Add byte position argument.
1646 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1648 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1649 Use list5 for return value.
1650 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1651 Adjust comments, style and calls to compute_motion.
1652 (Fvertical_motion): Adjust call to vmotion.
1653 * window.c (Fdelete_other_windows_internal): Record window start
1654 byte position and adjust call to vmotion.
1655 (window_scroll_line_based): Likewise with call to compute_motion.
1657 (Frecenter): Adjust calls to vmotion.
1659 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1661 * lisp.h (list2i, list3i): New functions.
1662 (list4i): Move from window.c and make LISP_INLINE.
1663 * editfns.c (make_lisp_time):
1664 * fns.c (Flocale_info):
1665 * keyboard.c (parse_modifiers):
1666 * xterm.c (x_ewmh_activate_frame): Use list2i.
1667 * instel.c (signal_after_change):
1668 * nsfns.m (Fx_server_version, Fxw_color_values):
1669 * w32fns.c (Fxw_color_values, Fx_server_version):
1670 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1671 * fileio.c (Fvisited_file_modtime):
1672 * nsfns.m (Fns_display_usable_bounds):
1673 * w32.c (ltime): Use list4i.
1675 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1677 * search.c (find_newline_no_quit): Rename from find_next_newline.
1680 * lisp.h (find_newline_no_quit): Rename prototype.
1682 * xdisp.c (back_to_previous_line_start)
1683 (forward_to_next_line_start, get_visually_first_element)
1684 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1685 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1686 * bidi.c (bidi_find_paragraph_start): Callers of
1687 find_newline_no_quit changed.
1689 * msdos.c: Change encoding to cp850. (Bug#13879)
1690 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1692 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1694 Coding system support cleanup and minor refactoring.
1695 * coding.h (enum coding_result_code): Remove
1696 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1697 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1698 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1699 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1700 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1701 (decode_coding_region, encode_coding_region, decode_coding_string):
1702 Remove unused compatibility macros.
1703 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1704 (record_conversion_result): Adjust user.
1705 (syms_of_coding): Likewise.
1706 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1707 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1708 (decode_coding_object): Simplify since xrealloc never returns NULL.
1711 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1713 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1714 * sysdep.c (list_system_processes)
1715 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1716 Make it a stub in this case; otherwise the build might fail,
1717 and this code hasn't been tested on such hosts anyway.
1718 Problem reported by Nelson H. F. Beebe in
1719 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1720 and analyzed by Jérémie Courrèges-Anglas in
1721 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1723 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1725 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1726 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1727 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1728 * bidi.c (bidi_find_paragraph_start): Likewise.
1729 * indent.c (vmotion): Likewise.
1731 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1733 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1734 * filelock.c: Include <c-ctype.h>.
1735 (MAX_LFINFO): New top-level constant.
1736 (lock_info_type): Remove members pid, boot_time. Add members at,
1737 dot, colon. Change user member to be the entire buffer, not a
1738 pointer. This allows us to handle the case where a foreign
1739 pid or boot time exceeds the local range. All uses changed.
1740 (LINKS_MIGHT_NOT_WORK): New constant.
1741 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1742 (defined_WINDOWSNT): Remove.
1743 (MAKE_LOCK_NAME, file_in_lock_file_name):
1744 Always use .#FILE (not .#-FILE) for the file lock,
1745 even if it is a regular file.
1746 (rename_lock_file): New function.
1747 (create_lock_file): Use it.
1748 (create_lock_file, read_lock_data):
1749 Prefer a symbolic link for the lock file, falling back on a
1750 regular file if symlinks don't work. Do not try to create
1751 symlinks on MS-Windows, due to security hassles. Stick with
1752 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1753 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1754 host may be using a Windowsish file system, and cannot use
1755 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1756 doesn't work. Don't fail merely because of a symlink-contents
1757 length limit in the current file system; fall back on regular
1758 files. Increase the symlink contents length limit to 8 KiB, this
1759 should be big enough for any real use and doesn't crunch the
1761 (create_lock_file, lock_file_1, read_lock_data):
1762 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1763 (lock_file_1): Return error number, not bool. All callers changed.
1764 (ELOOP): New macro, if not already defined.
1765 (read_lock_data): Return size of lock file contents, not Lisp object.
1766 All callers changed. Handle a race condition if some other process
1767 replaces a regular-file lock with a symlink lock or vice versa,
1768 while we're trying to read the lock.
1769 (current_lock_owner): Parse contents more carefully, to help avoid
1770 confusing a regular-file lock with some other application's use
1771 of the file. Check for lock file contents being too long, or
1772 not parsing correctly.
1773 (current_lock_owner, lock_file):
1774 Allow foreign pid and boot times that exceed the local range.
1775 (current_lock_owner, lock_if_free, lock_file):
1776 Simplify allocation of lock file contents.
1777 * w32.c (sys_rename_replace): New function, containing most of
1778 the contents of the old sys_rename.
1779 (sys_rename): Use it.
1780 (fchmod): New dummy function.
1781 * w32.h (sys_rename_replace, fchmod): New decls.
1783 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1785 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1786 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1787 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1788 <dmantipov@yandex.ru>.
1790 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1792 * composite.c (get_composition_id, fill_gstring_header):
1793 Use make_uninit_vector where appropriate.
1794 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1795 * xselect.c (clean_local_selection_data): Likewise.
1797 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1799 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1800 * image.c (imagemagick_load_image): Calculate height and width
1801 after flattening the image, not before.
1803 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1805 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1806 * ftfont.c (ftfont_shape_by_flt): Likewise.
1807 * w32uniscribe.c (uniscribe_shape): Likewise.
1809 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1811 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1812 The old approach, which fell back on DIR/.#FILE.0 through
1813 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1814 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1815 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1816 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1817 because the locking mechanism was never reliable in that case).
1818 This patch fixes this and other bugs discovered by a code
1819 inspection that was prompted by
1820 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1821 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1822 to avoid interoperability problems between the MS-Windows and
1823 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1824 instances of Emacs now ignore each others' locks.
1825 * filelock.c (defined_WINDOWSNT): New constant.
1826 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1827 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1828 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1829 regular files on MS-Windows hosts.
1830 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1831 Use SAFE_ALLOCA to avoid problems with long file names.
1832 (MAX_LFINFO): Now a local constant, not a global macro.
1833 (IS_LOCK_FILE): Remove.
1834 (lock_file_1): Don't inspect errno if symlink call succeeds;
1835 that's not portable.
1836 (lock_file): Document that this function can return if lock
1838 (lock_file): Don't access freed storage.
1840 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1842 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1844 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1846 * textprop.c: Use bool for booleans.
1847 (validate_interval_range, Fadd_text_properties)
1848 (Fremove_text_properties): Prefer bool to int when either works.
1850 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1852 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1853 If the interval tree changes as a side effect of calling
1854 modify_region, re-do processing starting from the call to
1855 validate_interval_range. (Bug#13743)
1857 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1859 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1862 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1864 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1865 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1866 access to the lock file until it is written and closed.
1869 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1871 * callint.c (Qcall_interactively):
1872 * macros.c (Qexecute_kbd_macro):
1875 2013-02-26 Bastien Guerry <bzg@gnu.org>
1877 * window.c (Frecenter): Tiny docstring enhancement.
1879 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1881 Minor textprop integer cleanup.
1882 * intervals.h, textprop.c (add_text_properties_from_list):
1883 Return void, not int, since nobody uses the return value.
1884 * textprop.c (validate_plist, add_properties, remove_properties)
1885 (Fadd_text_properties):
1886 Don't assume list length fits in int.
1887 (interval_has_all_properties, interval_has_some_properties)
1888 (interval_has_some_properties_list, add_properties, remove_properties)
1889 (Fadd_text_properties, Fremove_text_properties)
1890 (Fremove_list_of_text_properties, text_property_stickiness):
1891 Use bool for booleans.
1892 (Fadd_text_properties, Fremove_text_properties):
1893 (Fremove_list_of_text_properties):
1894 Reindent do-while as per GNU style.
1896 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1898 Implement CLASH_DETECTION for MS-Windows.
1900 * filelock.c [WINDOWSNT]: Include w32.h.
1901 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1902 function of that name. Up-case the macro arguments.
1903 (IS_LOCK_FILE): New macro.
1904 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1905 (create_lock_file): New function, with body extracted from
1907 [WINDOWSNT]: Implement lock files by writing a regular file with
1908 the lock information as its contents.
1909 (read_lock_data): New function, on Posix platforms just calls
1911 [WINDOWSNT]: Read the lock info from the file.
1912 (current_lock_owner): Call read_lock_data instead of calling
1913 emacs_readlinkat directly.
1914 (lock_file) [WINDOWSNT]: Run the file name through
1917 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1918 just check if the process by that PID exists.
1920 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1921 also present, as doing so will fail to error out if the file
1924 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1926 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1927 (Fremove_list_of_text_properties): Skip all of the intervals in
1928 the region between START and END that already have resp. don't
1929 have the requested properties, not just the first one.
1930 Add assertions that the loop afterwards always modifies the
1931 properties. (Bug#13743)
1933 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1935 * callint.c (Fcall_interactively): Use the right lexical environment
1936 for `interactive' specs (bug#13811).
1937 * eval.c (Feval): Accept a lexical environment.
1939 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1941 Simplify data_start configuration (Bug#13783).
1942 This is a followon simplification to the fix for Bug#13650.
1943 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1944 (START_FILES): Remove. All uses removed.
1945 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1946 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1947 (buildobj.h): Use it.
1948 ($(ALLOBJS)): Depend on globals.h.
1949 (temacs$(EXEEXT)): Use $(ALLOBJS).
1950 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1951 * deps.mk (vm-limit.o):
1952 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1953 Do not depend on mem-limits.h.
1954 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1955 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1956 [__GNUC__ && !ORDINARY_LINK]: Remove.
1957 * mem-limits.h, pre-crt0.c: Remove.
1958 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1959 * unexcoff.c (etext): New decl.
1960 (make_hdr): Use DATA_START instead of start_of_data.
1961 * vm-limit.c: Move most of mem-limits.h's contents here.
1962 (data_start): New decl. It's OK if this is approximate,
1963 so simplify-away some unnecessary exactness.
1964 (POINTER): Remove; all uses removed.
1965 (data_space_start): Now char *, to avoid casts.
1966 (exceeds_lisp_ptr): New function, replacing the old
1967 EXCEEDS_LISP_PTR macro. All uses changed.
1968 (check_memory_limits): Simplify and remove casts.
1969 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1970 (memory_warnings): Use data_start instead of start_of_data.
1972 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1974 * xdisp.c (set_message): Only check for debug-on-message if STRING
1975 is a string. (Bug#13797)
1977 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1979 Fix regression introduced by July 10 filelock.c patch.
1980 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1981 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1982 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1983 and diagnosed by Andreas Schwab in
1984 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1986 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1988 Assume C89 or better.
1989 * ralloc.c (SIZE, POINTER, NIL):
1990 * vm-limit.c (POINTER):
1991 Remove, replacing all uses with C89 equivalents. These old
1992 symbols were present only for porting to pre-C89 platforms.
1994 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1996 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1997 This avoids warning messages reported as part of Bug#13546.
1999 2013-02-21 Ken Brown <kbrown@cornell.edu>
2001 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2003 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2005 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2007 * keyboard.c (Qcommand_execute): New var.
2008 (command_loop_1, read_char): Use it.
2009 (Fcommand_execute): Remove, replace by an Elisp implementation.
2010 (syms_of_keyboard): Adjust accordingly.
2012 2013-02-19 Daniel Colascione <dancol@dancol.org>
2014 * sheap.c (report_sheap_usage): Use message, not message1, so
2015 that we don't try to create a buffer while we're in the middle
2016 of dumping Emacs. Explain why.
2018 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2020 * search.c (find_newline): Return byte position in bytepos.
2022 (find_next_newline_no_quit, find_before_next_newline):
2023 Add bytepos argument.
2024 * lisp.h (find_newline, find_next_newline_no_quit)
2025 (find_before_next_newline): Adjust prototypes.
2026 * bidi.c (bidi_find_paragraph_start):
2027 * editfns.c (Fconstrain_to_field, Fline_end_position):
2028 * indent.c (compute_motion, vmotion):
2029 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2030 (get_visually_first_element, move_it_vertically_backward):
2031 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2033 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2035 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2036 resources were not orderly released.
2038 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2040 * xdisp.c (x_draw_vertical_border): For a window that is neither
2041 the leftmost nor the rightmost, redraw both the left and the right
2042 vertical borders. (Bug#13723)
2044 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2046 * xml.c (init_libxml2_functions):
2047 * sound.c (sound_warning):
2048 * sheap.c (report_sheap_usage):
2049 * process.c (wait_reading_process_output):
2050 * msdos.c (XMenuActivate):
2051 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2052 * keyboard.c (top_level_1):
2053 * editfns.c (Fmessage, Fmessage_box):
2054 * callint.c (Fcall_interactively):
2055 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2057 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2059 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2060 * frame.c (syms_of_frame): ... to here.
2062 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2064 * w32.c (sys_chown): Remove unused function.
2066 * w32term.c <input_signal_count>: Declare 'volatile'
2067 unconditionally. (Bug#9066)
2069 * w32.c (set_errno): Reset h_errno and don't set it to any other
2070 value. Set errno instead.
2071 (check_errno): Reset h_errno.
2072 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2073 (sys_gethostname, sys_getservbyname, sys_getpeername)
2074 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2075 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2077 (sys_gethostbyname): Set h_errno only errors detected.
2079 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2081 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2083 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2085 * keyboard.c (read_char): Fix calculation of auto-save time out
2086 when auto-save-timeout is less than 4. (Bug#13720)
2088 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2089 time. Improve diagnostics in DebPrint. (Bug#13546)
2091 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2092 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2093 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2094 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2095 make sure errno is set to an appropriate value. (Bug#13546)
2096 (socket_to_fd): Add assertion against indexing fd_info[] with a
2097 value that is out of bounds.
2098 (sys_accept): If fd is negative, do not set up the child_process
2099 structure for reading.
2101 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2103 * composite.c (fill_gstring_header): Remove useless prototype.
2105 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2106 * print.c (PRINTDECLARE, print_object):
2107 * search.c (compile_pattern, fast_looking_at, search_buffer):
2108 (simple_search, boyer_moore, Freplace_match):
2109 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2110 (get_overlay_arrow_glyph_row, display_mode_element):
2111 (decode_mode_spec_coding, message3):
2112 * xfaces.c (face_at_string_position): Use bool for booleans.
2115 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2117 Fix AIX port (Bug#13650).
2118 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2119 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2120 was #undeffed earlier, so it cannot be used as a macro here.
2121 Use the constant and not the macro.
2123 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2125 * w32proc.c (new_child): If no vacant slots are found in
2126 child_procs[], make another pass looking for slots whose process
2127 has exited or died. (Bug#13546)
2129 * w32.c (sys_pipe): When failing due to file descriptors above
2130 MAXDESC, set errno to EMFILE.
2131 (_sys_read_ahead): Update cp->status when failing to read serial
2132 communications input, so that the status doesn't stay at
2133 STATUS_READ_IN_PROGRESS. (Bug#13546)
2135 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2137 * gtkutil.c (tb_size_cb): New function.
2138 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2140 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2142 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2145 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2147 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2149 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2151 * font.c (font_range): Add pos_byte argument. Adjust comment
2152 and break long line.
2153 * font.h (font_range): Adjust prototype.
2154 * composite.c (autocmp_chars): Pass byte position to font_range.
2155 Break long line. Remove useless prototype and format comment.
2157 2013-02-13 Glenn Morris <rgm@gnu.org>
2159 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2161 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2163 Improve AIX port some more (Bug#13650).
2164 With this, it should be as good as it was in 23.3, though it's
2165 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2166 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2167 * unexaix.c (start_of_text): Remove.
2168 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2169 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2170 (orig_load_scnptr, orig_data_scnptr):
2171 Now off_t, not long, since they are file offsets.
2172 (make_hdr): Use _data, not start_of_data ().
2173 This is the key part of the fix.
2174 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2175 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2177 * pre-crt0.c (data_start): Initialize to 1.
2178 This ports to compilers that optimize the external declaration
2179 'int x = 0;' as if it were 'int x;' to shrink the executable.
2181 Improve AIX port (Bug#13650).
2182 This doesn't fix the bug, but it makes progress: Emacs builds now.
2183 * unexaix.c: Include inttypes.h, stdarg.h.
2184 (report_error, report_error_1): Mark as _Noreturn.
2185 (report_error): Don't report the wrong errno.
2186 (report_error_1): Now varargs. All callers changed.
2187 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2188 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2189 (write_ptr): Use %p to print address rather than %lx and a cast
2190 to unsigned long. Grow buffer a bit, to be safer.
2192 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2194 * bidi.c (bidi_resolve_neutral): After finding the next
2195 non-neutral character, accept NEUTRAL_ON type as well, because
2196 directional control characters, such as LRE and RLE, have their
2197 type converted to that by bidi_resolve_weak. This avoids aborts
2198 when LRE/RLE follows a run of neutrals.
2199 (bidi_move_to_visually_next): Assert that return value of
2200 bidi_peek_at_next_level is non-negative. Negative values will
2203 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2205 Minor getenv-related fixes.
2206 * callproc.c (Fcall_process_region) [!DOS_NT]:
2207 Avoid unnecessary duplicate call to getenv.
2208 * callproc.c (init_callproc):
2209 * dispnew.c (init_display):
2210 * sysdep.c (sys_subshell):
2211 Omit unnecessary cast of getenv or egetenv.
2213 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2215 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2216 Update dependencies.
2218 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2220 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2222 (display_line): Set w->region_showing to the value of
2223 it->region_beg_charpos, not to -1. This fixes redisplay
2224 optimization when cursor is moved up after M->. (Bug#13623)
2226 (try_scrolling): Scroll text up more if point is too close to ZV
2227 and inside the scroll margin. This makes sure point is moved
2228 outside the scroll margin in these cases.
2230 * window.h (struct window): region_showing can no longer be
2233 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2235 Tune by using memchr and memrchr.
2236 * doc.c (Fsnarf_documentation):
2237 * fileio.c (Fsubstitute_in_file_name):
2238 * search.c (find_newline, scan_newline):
2239 * xdisp.c (pos_visible_p, display_count_lines):
2240 Use memchr and memrchr rather than scanning byte-by-byte.
2241 * search.c (find_newline): Rename from scan_buffer.
2242 Omit first arg TARGET, as it's always '\n'. All callers changed.
2244 Clean up read_key_sequence a tiny bit more.
2245 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2246 (read_key_sequence): Remove unused locals.
2248 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2250 Clean up read_key_sequence a bit; reread active keymaps after first event.
2251 * keyboard.c (read_char, read_char_x_menu_prompt)
2252 (read_char_minibuf_menu_prompt):
2253 Replace nmaps+maps with a single `map' arg.
2254 (follow_key): Operate on a single map.
2255 (active_maps): New function.
2256 (test_undefined): Also return true for nil bindings.
2257 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2258 a single (composed) keymap. Remember `first_event' to choose the right
2259 set of active keymaps. Recompute the set of keymaps after receiving
2260 the first event. Remove GOBBLE_FIRST_EVENT.
2261 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2262 * keyboard.h (read_char): Update declaration.
2263 * lread.c (read_filtered_event): Adjust call to read_char.
2265 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2267 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2268 Don't use the limitation on backwards movement when lines are truncated
2269 in the window. (Bug#13675)
2271 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2273 * marker.c (set_marker_internal): If desired position is passed
2274 as a marker, avoid call to buf_charpos_to_bytepos.
2275 * window.c (Fset_window_point): Omit redundant type checking.
2276 (Fset_window_start): Likewise. Format comment.
2277 (window_scroll_pixel_based): Use set_marker_restricted_both
2278 with character and byte positions obtained from an iterator.
2279 (Fset_window_configuration): Use set_marker_restricted_both.
2280 * xdisp.c (message_dolog): Likewise.
2282 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2284 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2285 When text lines are longer than window's screen lines, don't move back
2286 too far. This speeds up some redisplay operations. (Bug#13675)
2288 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2290 * syntax.c (scan_sexps_forward): Fix byte position calculation
2291 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2293 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2295 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2296 that was not needed.
2298 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2300 Minor hashing refactoring.
2301 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2302 (sxhash_float): Return EMACS_UINT, for consistency with the other
2304 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2305 non-static inline function and therefore can't use static vars.
2306 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2307 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2308 with the other hash functions.
2310 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2312 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2313 XXXXXX part of the temporary file pattern is not downcased even
2314 when w32-downcase-file-names is non-nil. (Bug#13661)
2316 * xdisp.c (decode_mode_spec): Remove handling of %t.
2318 * msdos.c (careadlinkatcwd): Remove.
2320 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2322 * lread.c (skip_dyn_bytes): New function (bug#12598).
2323 (read1): Use it. Use getc instead of READCHAR to read bytes.
2324 (load_each_byte): Remove. Update users.
2326 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2328 * search.c (scan_buffer): Calculate end byte position just once.
2329 (scan_newline): Do not recalculate start_byte.
2330 (search_command): Use eassert.
2331 * syntax.c (struct lisp_parse_state): New member location_byte.
2332 (scan_sexps_forward): Record from_byte and avoid redundant
2333 character to byte position calculation ...
2334 (Fparse_partial_sexp): ... here. Break too long line.
2336 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2338 * lisp.h (make_uninit_vector): New function.
2339 * alloc.c (Fvector, Fmake_byte_code):
2340 * ccl.c (Fregister_ccl_program):
2341 * charset.c (Fdefine_charset_internal, define_charset_internal):
2342 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2343 * composite.c (syms_of_composite):
2344 * font.c (Fquery_font, Ffont_info, syms_of_font):
2345 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2346 * ftfont.c (ftfont_shape_by_flt):
2347 * indent.c (recompute_width_table):
2348 * nsselect.m (clean_local_selection_data):
2349 * syntax.c (init_syntax_once):
2350 * w32unsubscribe.c (uniscribe_shape):
2351 * window.c (Fcurrent_window_configuration):
2352 * xfaces.c (Fx_family_fonts):
2353 * xselect.c (selection_data_to_lisp_data): Use it.
2355 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2357 * coding.c (Fdefine_coding_system_internal): Use AREF where
2358 argument is known to be a vector.
2359 * fns.c (Flocale_info): Likewise for ASET.
2360 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2361 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2363 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2365 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2368 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2369 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2370 updateCollectionBehaviour.
2372 * nsterm.m (NEW_STYLE_FS): Remove.
2373 (ns_last_use_native_fullscreen): New variable.
2374 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2375 (x_set_window_size): Do not take title bar and tool bar into account
2376 if isFullscreen returns YES.
2377 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2378 (check_native_fs): New function.
2379 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2380 (ns_term_init): Remove NEW_STYLE_FS.
2381 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2382 and tool bar if isFullscreen returns NO.
2383 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2384 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2385 with HAVE_NATIVE_FS.
2386 (window:willUseFullScreenPresentationOptions:): New method.
2387 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2388 Hide toolbar if not enabled (Bug#13444).
2389 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2390 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2391 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2392 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2393 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2394 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2395 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2396 (syms_of_nsterm): Add ns-use-native-fullscreen.
2398 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2400 * fileio.c (Qchoose_write_coding_system): Now static.
2402 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2404 * xdisp.c (window_buffer_changed): region_showing can be negative,
2405 which still means region is being displayed.
2406 (redisplay_internal): Resurrect code that forced redisplay of the
2407 whole window when showing region and the mark has changed.
2408 Record the new mark position to allow redisplay optimizations.
2409 (display_line): If it->region_beg_charpos is non-zero, set the
2410 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2412 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2413 not bitfield of 1 bit.
2415 2013-02-03 Daniel Colascione <dancol@dancol.org>
2417 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2418 daemon mode works on cygw32 when Emacs is installed and not just
2421 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2423 Avoid file time stamp bug on MS-Windows (Bug#13149).
2424 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2425 as FAT32 doesn't update time stamps when truncating them.
2426 Also, check that a file time stamp is not a multiple of 100 ns;
2427 this should catch all instances of the problem on MS-Windows,
2428 as its native file system resolution is 100 ns or worse, and
2429 checking for a non-multiple of 100 ns should impose only a small
2430 overhead on systems with ns resolution.
2432 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2434 Avoid encoding file names on MS-Windows when they need to be run
2435 through dostounix_filename.
2436 * w32.c (normalize_filename): Accept an additional argument
2437 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2438 downcase it even if w32-downcase-file-names is non-nil.
2439 (dostounix_filename): Accept an additional argument MULTIBYTE and
2440 pass it to normalize_filename.
2441 (emacs_root_dir): Adjust.
2443 * msdos.h (dostounix_filename): Adjust prototype.
2445 * w32.h (dostounix_filename): Adjust prototype.
2447 * msdos.c (dostounix_filename): Accept an additional argument and
2449 (init_environment): Adjust callers of dostounix_filename.
2451 * fileio.c (Ffile_name_directory, file_name_as_directory)
2452 (directory_file_name, Fexpand_file_name)
2453 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2455 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2457 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2458 variables, as egetenv is case-insensitive for DOS_NT.
2460 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2461 with an encoded file name.
2463 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2464 Adjust calls to dostounix_filename.
2466 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2468 * unexw32.c (unexec): Adjust call to dostounix_filename.
2470 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2472 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2475 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2478 * callproc.c (Fcall_process): Make sure program name in PATH and
2479 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2480 is passed to exec/spawnve, which fails unless the file-name
2483 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2484 even if w32-quote-process-args is nil.
2486 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2488 Fix timestamp bug when write-region appends nothing (Bug#13149).
2489 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2490 the file's time stamp doesn't change if Emacs happens to write nothing
2491 to the file, and on a buggy file system this could cause Emacs to
2492 incorrectly infer that the file system doesn't have the bug.
2493 Avoid this problem by inhibiting the inference in this case.
2495 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2497 * window.h (struct window): Convert base_line_number, base_line_pos
2498 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2499 Convert region_showing member from Lisp_Object to bitfield.
2500 Remove sequence_number member. Adjust comments.
2501 * window.c (sequence_number): Remove.
2502 (make_window): Initialize column_number_displayed.
2503 * print.c (print_object): Follow the printed representation of
2504 frames and print window pointer to distinguish between windows.
2505 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2506 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2507 (wset_column_number_displayed, wset_region_showing): Remove.
2508 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2509 (try_scrolling, try_cursor_movement, redisplay_window)
2510 (try_window_reusing_current_matrix, try_window_id, display_line)
2511 (display_mode_lines, decode_mode_spec): Adjust users.
2512 * .gdbinit (pwinx): Do not print sequence_number.
2514 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2516 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2517 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2518 * dired.c: Include <fcntl.h>.
2519 (open_directory): New function, which uses open and fdopendir
2520 rather than opendir. DOS_NT platforms still use opendir, though.
2521 (directory_files_internal, file_name_completion): Use it.
2522 (file_attributes): New function, with most of the old Ffile_attributes.
2523 (directory_files_internal, Ffile_attributes): Use it.
2524 (file_attributes, file_name_completion_stat): First arg is now fd,
2525 not dir name. All uses changed. Use fstatat rather than lstat +
2527 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2528 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2529 (emacs_readlinkat): New function, with much of the old
2530 Ffile_symlink_p, but with an fd argument for speed.
2531 It uses readlinkat rather than careadlinkatcwd, so that it
2532 need not assume the working directory.
2533 (Ffile_symlink_p): Use it.
2534 * filelock.c (current_lock_owner): Use emacs_readlinkat
2535 rather than emacs_readlink.
2536 * lisp.h (emacs_readlinkat): New decl.
2537 (READLINK_BUFSIZE, emacs_readlink): Remove.
2538 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2539 (emacs_norealloc_allocator, emacs_readlink): Remove.
2540 This stuff is moved to fileio.c.
2541 * w32.c (fstatat, readlinkat): New functions.
2542 (careadlinkat): Don't check that fd == AT_FDCWD.
2543 (careadlinkatcwd): Remove; no longer needed.
2545 2013-01-31 Glenn Morris <rgm@gnu.org>
2547 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2548 (Fwrite_region): Update for new choose_write_coding_system args.
2549 Move the last piece of choose_write_coding_system here. (Bug#13522)
2550 (syms_of_fileio): Add choose-write-coding-system.
2552 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2554 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2555 (sys_close): Zero out the flags for the file descriptor before
2556 closing it. (Bug#13546)
2558 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2559 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2560 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2563 * w32.c (w32_get_long_filename, init_environment, readlink):
2564 Support file names encoded in DBCS codepages.
2565 (readlink): Use the current file-name-coding-system, not the ANSI
2566 codepage, to decode and handle targets of symlinks.
2568 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2570 * w32.c (opendir): Now accepts a 'const char *'.
2572 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2574 Remove obsolete redisplay code. See the discussion at
2575 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2576 * dispnew.c (preemption_period, preemption_next_check): Remove.
2577 (Vredisplay_preemption_period): Likewise.
2578 (update_frame, update_single_window, update_window, update_frame_1):
2579 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2580 used, following the 2012-06-22 change.
2582 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2584 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2586 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2588 * font.c (num_fonts): Remove the leftover from old
2589 debugging code. Adjust comment style here and there.
2590 * insdel.c (insert_1): Remove.
2591 * lisp.h (insert_1): Remove prototype.
2592 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2594 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2596 * w32.c (max_filename_mbslen): New function.
2597 (normalize_filename, readdir): Use it to detect locales where ANSI
2598 encoding of file names uses a double-byte character set (DBCS).
2599 If a DBCS encoding is used, advance by characters using
2600 CharNextExA, instead of incrementing a 'char *' pointer.
2601 Use _mbslwr instead of _strlwr. (Bug#13515)
2603 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2604 request of memory reservation to 1.7GB. (Bug#13065)
2606 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2608 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2609 at check_extra_latin label. (Bug#13505)
2611 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2613 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2614 Avoid redundant calls to strlen.
2616 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2618 Drop async_visible and async_iconified fields of struct frame.
2619 This is possible because async input is gone; for details, see
2620 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2621 * frame.h (struct frame): Remove async_visible and async_iconified
2622 members, convert garbaged to unsigned bitfield. Adjust comments.
2623 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2624 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2625 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2626 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2627 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2629 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2630 properly. Likewise for obscured.
2632 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2635 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2637 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2639 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2640 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2642 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2644 * xdisp.c (message2, message2_nolog): Remove functions.
2645 (message3, message3_nolog): Extract nbytes and multibyteness directly
2646 from the string. Change all callers.
2647 (message3_nolog): Don't set message_enable_multibyte since set_message
2648 will reset it anyway.
2649 (message1, message1_nolog): Use message3.
2650 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2651 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2652 (set_message): Drop all but the second arg, which has to be a string.
2653 (set_message_1): Simplify now that we know that a1 is NULL and the
2654 second arg is a string.
2655 * frame.h (struct frame): Remove `message_buf' field.
2656 Use glyphs_initialized_p instead.
2657 (FRAME_MESSAGE_BUF): Remove macro.
2658 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2659 * lisp.h (message2, message2_nolog): Remove declarations.
2660 (message3, message3_nolog): Update declarations.
2661 * keyboard.c (read_char_minibuf_menu_text)
2662 (read_char_minibuf_menu_width): Remove vars.
2663 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2664 to correctly handle multibyte strings.
2665 * frame.c (delete_frame): Don't free message_buf any more.
2666 * editfns.c (message_text, message_length): Remove vars.
2667 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2668 * fileio.c (auto_save_error): Use message3 instead of message2.
2669 * dispnew.c (adjust_frame_message_buffer): Remove function.
2671 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2673 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2674 real estate used for the tool bar and the menu bar.
2676 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2678 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2679 hidden buffer is prepared to modification (Bug#13164).
2681 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2683 * window.h (struct window): Change window_end_valid member from
2684 Lisp_Object to a bitfield. Adjust comments.
2685 (wset_window_end_valid): Remove.
2686 * window.c (adjust_window_count): Clear window_end_valid.
2687 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2688 (Fwindow_line_height, set_window_buffer, Frecenter)
2689 (Fsplit_window_internal, Fdelete_other_windows_internal)
2690 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2691 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2692 * xdisp.c (check_window_end, reconsider_clip_changes)
2693 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2694 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2695 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2697 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2699 * xdisp.c (mark_window_display_accurate): Simplify the loop
2700 assuming that the only one of vchild, hchild or buffer window
2701 slots is non-nil. Call mark_window_display_accurate_1 for
2702 the leaf windows only.
2703 (mark_window_display_accurate_1): Always assume leaf window.
2706 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2708 * emacs.c (Qkill_emacs_hook): Now static.
2710 * fileio.c (Finsert_file_contents): Simplify.
2711 Remove unnecessary assignments and tests.
2713 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2715 * w32.c (acl_set_file): Don't test for errors unless
2716 set_file_security returns FALSE. Avoids spurious errors when
2719 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2721 * fileio.c (Finsert_file_contents): Revert code introduced at
2722 2013-01-18 in favor of the simpler and generally better fix.
2723 Save stack space by removing 'buffer' and reusing 'read_buf'
2726 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2728 * lisp.h (eabs): Define unconditionally (Bug#13419).
2729 The old "#if !defined (eabs)" was an unnecessary revenant of back
2730 when this macro was called "abs". Document 'eabs' better.
2732 2013-01-19 Glenn Morris <rgm@gnu.org>
2734 * fns.c (Frandom): Doc fix.
2736 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2738 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2739 segfault when there are lots of overlays.
2741 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2742 when there are lots of overlays.
2743 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2744 for the details and a way to reproduce.
2746 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2748 * fileio.c: Use O_APPEND to append.
2749 This corresponds better to the natural interpretation of "append",
2750 and avoids the need to open the output file twice, or to invoke
2751 lseek when APPEND is neither nil nor a number.
2752 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2753 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2754 file possibly twice, and lseeking to its end; this avoids the
2755 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2756 at the same time: the combination is never needed and apparently
2757 it doesn't work with DOS_NT.
2759 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2760 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2762 Allow floating-point file offsets.
2763 Problem reported by Vitalie Spinu in
2764 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2765 * fileio.c (emacs_lseek): Remove.
2766 (file_offset): New function.
2767 (Finsert_file_contents, Fwrite_region): Use it.
2769 2013-01-19 Chong Yidong <cyd@gnu.org>
2771 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2772 aborting on Fsignal (Bug#13289).
2774 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2776 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2777 set_file_security as failure due to insufficient privileges.
2778 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2779 (fstat): Return owner and group like 'stat' and 'lstat' do.
2781 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2783 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2784 The bug was observed on Ubuntu operating inside a virtual machine,
2785 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2786 The workaround introduces a race condition on non-buggy hosts,
2787 but it's an unlikely race and anyway there's a nearly identical
2788 nearby race that can't be fixed.
2789 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2791 (Fwrite_region): Test for file system time stamp bug.
2792 (init_fileio): New function.
2793 * lisp.h (init_fileio): Declare it.
2794 * emacs.c (main): Call it.
2796 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2797 and make it more consistent with other stat-failure diagnostics.
2799 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2801 Fix crash when inserting data from non-regular files.
2802 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2803 for the error description produced by valgrind.
2804 * fileio.c (read_non_regular): Rename to read_contents.
2805 Free Lisp_Save_Value object used to pass parameters.
2806 (read_non_regular_quit): Rename to read_contents_quit.
2807 (Finsert_file_contents): Redesign internal file reading loop to adjust
2808 gap and end positions after each read and so help make_gap to work
2809 properly. Do not signal an I/O error too early and so do not leave
2810 not yet decoded characters in a buffer, which was the reason of
2811 redisplay crash. Use list2 to build return value. Adjust comments.
2813 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2815 Close a race when statting and reading files (Bug#13149).
2816 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2817 This avoids a race if the file is renamed between stat and open.
2818 This race is not the problem originally noted in Bug#13149;
2819 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2821 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2823 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2824 objects, related functions and macros.
2825 (make_save_value): Adjust prototype.
2826 (make_save_pointer): New prototype.
2827 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2828 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2829 * alloc.c (format_save_value): Rename to make_save_value.
2830 (make_save_pointer): New function.
2831 (record_xmalloc): Use make_save_pointer.
2832 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2833 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2834 Change users of make_save_value to make_save_pointer.
2835 Likewise for format_save_value and make_save_value.
2837 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2839 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2840 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2841 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2844 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2846 * alloc.c (free_save_value): Now static.
2848 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2850 * keymap.c (map_keymap_internal): Use format_save_value.
2851 (map_keymap_char_table_item): Adjust accordingly.
2852 * fileio.c (non_regular_fd, non_regular_inserted)
2853 (non_regular_nbytes): Remove.
2854 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2855 Use format_save_value to pass parameters to read_non_regular.
2856 (read_non_regular): Use XSAVE_ macros to extract parameters.
2858 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2860 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2862 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2864 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2865 extraction from any Lisp_Save_Value slot. Add type checking.
2866 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2867 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2868 * xselect.c: All users changed.
2870 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2872 Some convenient bits to deal with Lisp_Save_Values.
2873 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2874 (allocate_misc): Remove prototype.
2875 (format_save_value): New prototype.
2876 * alloc.c (allocate_misc): Revert back to static.
2877 (format_save_value): New function to build Lisp_Save_Value
2878 object with the specified internal structure.
2879 (make_save_value): Reimplement using format_save_value.
2880 * editfns.c (save_excursion_save): Use format_save_value.
2881 (save_excursion_restore): Use XSAVE_OBJECT.
2883 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2885 Avoid needless casts with XSAVE_POINTER.
2886 * alloc.c (mark_object) [GC_MARK_STACK]:
2887 * dired.c (directory_files_internal_unwind):
2888 * fileio.c (do_auto_save_unwind):
2889 * gtkutil.c (pop_down_dialog):
2890 * keymap.c (map_keymap_char_table_item):
2891 * lread.c (load_unwind):
2892 * nsmenu.m (pop_down_menu):
2893 * print.c (print_object) [GC_MARK_STACK]:
2894 * xfns.c (clean_up_file_dialog):
2895 * xmenu.c (cleanup_widget_value_tree):
2896 Omit casts between XSAVE_POINTER and a pointer type.
2898 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2900 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2901 * eval.c (eval_sub): Protect `form' from being GCed before its
2902 car and cdr becomes protected with the backtrace entry.
2904 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2906 Make Lisp_Save_Value more versatile storage for up to four objects.
2907 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2908 (struct Lisp_Save_Value): New layout. Adjust comments.
2909 (XSAVE_POINTER): New macro.
2910 (XSAVE_INTEGER): Likewise.
2911 (allocate_misc): Add prototype.
2912 (free_misc): Likewise.
2913 * alloc.c (allocate_misc): Now global.
2914 (free_misc): Likewise. Adjust comment.
2915 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2916 (free_save_value): Likewise.
2917 (mark_object): Likewise.
2918 * editfns.c (save_excursion_save): Pack everything within
2919 Lisp_Save_Value and so avoid xmalloc.
2920 (save_excursion_restore): Adjust to match new layout. Use free_misc
2921 because we do not allocate extra memory any more. Add eassert.
2922 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2923 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2924 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2925 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2926 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2928 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2930 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2931 (nsfont_draw): Remove disabling of LCD smoothing.
2932 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2933 Bug#11484 with LCD smoothing on.
2935 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2937 Fix SIGDANGER handlers, for AIX (Bug#13408).
2938 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2939 Move handlers here from emacs.c; they were out of place.
2941 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2943 * xterm.c (syms_of_xterm): Adjust documentation for
2944 scroll-bar-adjust-thumb-portion.
2946 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2948 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2949 determine whether scroll bar thumb size should be adjusted or
2950 not. Use variable for MOTIF.
2952 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2955 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2957 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2959 (doCommandBySelector:): Set processingCompose to NO.
2961 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2962 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2963 (nsfont_list_family): Add block/unblock_input calls.
2964 (nsfont_open): Move block_input earlier. Add unblock_input before early
2966 (nsfont_draw): Add block/unblock_input calls.
2968 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2970 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2971 for old_charpos and old_bytepos.
2973 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2975 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2976 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2977 Clear tzvalbuf_in_environ if this workaround is in effect.
2978 Problem and fix reported by Kazuhiro Ito.
2980 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2982 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2983 Fix ambiguous doc string cross-reference(s).
2985 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2986 doc string cross-reference(s).
2988 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2989 string cross-reference(s).
2991 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2993 Avoid unnecessary byte position calculation for the gap movement.
2994 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2995 anyway, all of them should use move_gap_both instead.
2996 * lisp.h (move_gap): Remove prototype.
2997 * insdel.c (move_gap): Remove.
2998 (move_gap_both): Add eassert.
2999 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3000 * xml.c (parse_region): Likewise.
3002 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3004 emacsclient -t should not suspend Emacs server (Bug#13387)
3005 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3007 * term.c (init_tty): Use them instead of rolling our own code.
3008 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3009 switches from 'signal' to 'pthread_sigmask', which is safer in
3010 multithreaded applications.
3011 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3012 which has already arranged for that.
3013 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3014 This is the main part of the bug fix.
3016 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3018 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3019 x_last_font_name (Bug#13403).
3021 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3023 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3024 the type of per-buffer values where appropriate.
3025 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3026 predicate, which is how it's really used now. Adjust comment.
3027 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3028 * buffer.c (buffer_slot_type_mismatch): Remove.
3029 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3030 predicate. Adjust comment.
3031 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3032 fill-column, left-margin, tab-width, buffer-saved-size,
3033 left-margin-width, right-margin-width, left-fringe-width,
3034 right-fringe-width, scroll-bar-width and buffer-display-count.
3035 Use Qstringp for default-directory, buffer-file-name,
3036 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3037 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3039 * data.c (store_symval_forwarding): Adjust to call the predicate.
3041 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3043 * w32.c (get_name_and_id, acl_set_file):
3044 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3046 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3048 * lisp.h (make_gap_1): New prototype.
3049 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3051 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3053 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3054 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3055 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3056 (make_gap_1): New function to adjust the gap of any buffer.
3057 * coding.c (coding_alloc_by_making_gap): Use it.
3058 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3059 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3061 2013-01-08 Juri Linkov <juri@jurta.org>
3063 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3064 of (supports :underline (:style wave)). (Bug#13000)
3066 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3068 * undo.c (Fprimitive_undo): Move to simple.el.
3069 (syms_of_undo): Remove declarations for Sprimitive_undo.
3071 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3073 * keyboard.c (echo_add_key): Rename from echo_add_char.
3075 2013-01-06 Chong Yidong <cyd@gnu.org>
3077 * keyboard.c (echo_add_char): New function, factored out from
3078 echo_char. Don't add a space if the previous echo string was
3080 (echo_char): Use it.
3081 (read_key_sequence): When echoing mock input, ensure that the
3082 trailing dash is properly added.
3084 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3086 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3087 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3088 digits for buffer positions, before misalignment starts.
3089 Display "0" for integer "object" field.
3090 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3091 Display the newline glyph more unambiguously.
3093 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3095 * nsterm.m (ns_draw_underwave):
3096 * w32term.c (w32_draw_underwave):
3097 * xterm.c (x_draw_underwave): Make underwave look more triangular
3098 and also degrade gracefully for small fonts. (Bug#13000)
3100 * nsterm.m (ns_draw_text_decoration):
3101 * w32term.c (x_draw_glyph_string):
3102 * xterm.c (x_draw_glyph_string): Don't use previous underline
3103 thickness and position if previous underline type is underwave.
3105 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3107 * fileio.c (Ffile_acl): Undocument return format.
3109 2013-01-02 Glenn Morris <rgm@gnu.org>
3111 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3113 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3116 * dired.c (file_name_completion):
3117 * doc.c (get_doc_string):
3118 * floatfns.c (round2):
3119 * font.c (font_score, font_delete_unmatched):
3120 * fringe.c (compute_fringe_widths):
3121 * lread.c (read_list):
3122 * minibuf.c (Ftry_completion):
3123 * term.c (tty_ins_del_lines):
3124 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3125 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3127 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3129 * w32.c (unsetenv): Set up the string passed to _putenv
3131 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3132 for the bug this caused.
3134 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3136 * coding.c (Qmac): Now static.
3138 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3140 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3141 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3142 handlebox_widget. Set toolbar_in_hbox to false/true, set
3143 toolbar_is_packed to true.
3144 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3145 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3146 Show all on TOOLBAR_TOP_WIDGET.
3147 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3148 by TOOLBAR_TOP_WIDGET.
3149 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3150 Check toolbar_is_packed.
3151 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3152 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3153 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3155 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3156 (xg_update_menubar): Update title only if
3157 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3158 (xg_update_submenu): Skip tearoff only if
3159 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3160 (xg_initialize): Initialize xg_detached_menus only if
3161 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3163 * xterm.h (struct x_output): Surround handlebox_widget with
3164 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3165 toolbar_in_hbox is bool.
3167 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3169 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3170 (LIBS_GNUSTEP): Define.
3171 (LIBES): Add $(LIBS_GNUSTEP).
3172 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3174 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3176 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3177 continuation glyph on a TTY with an indication of an empty line.
3180 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3182 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3183 file's SELinux context or ACLs successfully set, nil otherwise.
3185 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3187 * w32proc.c (reader_thread): Avoid passing NULL handles to
3188 SetEvent and WaitForSingleObject.
3190 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3192 Port EXTERNALLY_VISIBLE to Clang 3.2.
3193 * conf_post.h (__has_attribute): New macro.
3194 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3196 2012-12-27 Glenn Morris <rgm@gnu.org>
3198 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3199 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3201 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3203 * fileio.c (file_name_as_directory, directory_file_name):
3204 Accept an additional argument MULTIBYTE to indicate whether the input C
3205 came from a multibyte or a unibyte Lisp string; all callers
3206 adjusted. Don't assume the input string is always multibyte.
3208 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3209 don't ENCODE_FILE them, and return a unibyte string if the input
3211 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3212 don't assume the input strings will always be multibyte. If the
3213 input strings are multibyte, decode strings obtained from C
3216 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3218 * lisp.h (toplevel): Add two notices to the comment about
3219 defining a new Lisp data type.
3220 * print.c (print_object): If Lisp_Save_Value object's pointer
3221 is the address of a memory area containing Lisp_Objects, try
3223 * alloc.c (valid_lisp_object_p): Adjust comment.
3225 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3227 * keyboard.c (record_asynch_buffer_change): Initialize an event
3228 only if it's really needed.
3229 * frame.h (enum output_method): Remove output_mac member since
3230 it's a leftover from the deleted code.
3231 * frame.c (Fframep): Adjust user here ...
3232 * terminal.c (Fterminal_live_p): ... and here.
3233 * coding.c (Qmac): Now here because it's only used to denote
3234 end-of-line encoding type.
3235 (syms_of_coding): DEFSYM it.
3236 * frame.h (Qmac): Remove duplicated declaration.
3238 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3240 * window.c (select_window_1): Now static, since it's used only here.
3242 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3244 * window.c (window_body_cols): Subtract display margins from the
3245 window body width on TTYs as well. See
3246 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3247 for the original report.
3249 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3251 * xdisp.c (redisplay_window): Remove inner local variable
3252 because the outer shadowed one has the same meaning.
3253 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3255 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3256 (xg_create_tool_bar): Adjust users.
3258 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3260 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3261 * buffer.c (Fget_buffer_create): Use it to set compact field of
3262 struct buffer_text to avoid accessing an uninitialized value
3263 when compact_buffer is called for the first time.
3264 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3265 (Fset_buffer_modified_p): Use buffer_window_count to check
3266 whether the buffer is displayed in some window.
3267 * xdisp.c (message_dolog): Likewise.
3269 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3271 * w32.c (acl_set_file): If setting the file security descriptor
3272 fails, and the new DACL is identical to the existing one, silently
3273 return success. This fixes problems for users backing up their
3274 own files without having the necessary privileges for setting
3275 security descriptors.
3277 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3279 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3280 after WaitForSingleObject returns normally. This expedites reader
3281 thread shutdown when delete_child triggers it.
3282 (reap_subprocess): More accurate commentary for why we call
3283 delete_child only when cp->fd is negative.
3285 * w32.c (sys_close): Do not call delete_child on a subprocess
3286 whose handle is not yet closed. Instead, set its file descriptor
3287 to a negative value, so that reap_subprocess will call
3288 delete_child on that subprocess when its SIGCHLD arrives.
3289 This avoids closing handles used for communications between sys_select
3290 and reader_thread, which doesn't give sys_select a chance to
3291 notice that the process exited and invoke the SIGCHLD handler for
3294 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3296 * nsfns.m (Fns_do_applescript): Run event loop until script has
3297 been executed (Bug#12969).
3298 (ns_run_ascript): Chech as_script for nil, set to nil after
3301 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3303 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3305 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3307 * w32term.c (w32fullscreen_hook): New function.
3308 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3310 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3312 * fileio.c (Finsert_file_contents): Doc fix.
3314 * w32proc.c (new_child, delete_child, find_child_pid): For a
3315 subprocess, consider its slot being in use as long as its process
3316 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3317 slot when a new process is started immediately after killing
3318 another one, without waiting enough time for the first process to
3319 be reaped and resources allocated for it be orderly freed.
3321 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3323 2012-12-21 Chong Yidong <cyd@gnu.org>
3325 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3327 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3329 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3331 * w32.c (get_name_and_id): Always pass NULL as the first argument
3332 of lookup_account_sid. Avoids crashes with UNC file names that
3333 refer to DFS domains, not to specific machine names. (Bug#12621)
3334 Remove now unused argument FNAME; all callers changed.
3335 (get_file_owner_and_group): Remove now unused argument FNAME; all
3338 2012-12-21 Chong Yidong <cyd@gnu.org>
3340 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3341 error for invalid chars, don't check for a nil return value.
3343 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3345 Avoid calls to CHAR_TO_BYTE if byte position is known.
3346 * editfns.c (make_buffer_string_both): Use move_gap_both.
3347 (Fbuffer_string): Use make_buffer_string_both.
3348 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3350 (buf_bytepos_to_charpos): Likewise.
3351 (charpos_to_bytepos): Remove.
3352 * fileio.c (Finsert_file_contents): Use move_gap_both.
3353 * search.c (Freplace_match): Likewise.
3354 * process.c (process_send_region): Likewise. Use convenient
3355 names for byte positions.
3356 * lisp.h (charpos_to_bytepos): Remove prototype.
3357 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3358 * insdel.c (move_gap): Likewise.
3360 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3362 * xdisp.c (redisplay_internal): Remove now-unused local.
3364 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3366 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3367 (redisplay_internal): Don't bother selecting the frame to get the
3368 proper value of frame-local variables (bug#13225).
3370 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3372 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3373 Rename 4th argument since it may be buffer or string. Adjust comment.
3374 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3376 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3378 * coding.c (Fdetect_coding_region): Do not check start and end with
3379 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3380 (code_convert_region): Likewise.
3382 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3384 * w32.c (acl_get_file, acl_set_file): Run the file name through
3385 map_w32_filename, and resolve any symlinks in the file name, like
3387 (acl_set_file): Call revert_to_self, if any privileges were
3390 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3392 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3393 ($(BLD)/w32.$(O)): Update dependencies.
3395 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3397 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3398 propagate redisplay's scrolling (if any) to the right window.
3399 (redisplay_internal): Use ensure_selected_frame.
3400 (display_mode_lines): Complete last fix.
3401 * window.c (select_window_1): New func, extracted from select_window.
3402 (select_window): Use it.
3403 * window.h (select_window_1): Declare.
3405 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3407 Emulate Posix ACL APIs on MS-Windows.
3408 * w32.c: Include sddl.h and sys/acl.h.
3409 (SDDL_REVISION_1): Define if not already defined.
3410 (g_b_init_get_security_descriptor_dacl)
3411 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3412 (g_b_init_is_valid_security_descriptor)
3413 (g_b_init_set_file_security): New static flags.
3414 (globals_of_w32): Initialize them to zero.
3415 (SetFileSecurity_Name): New string constant.
3416 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3417 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3418 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3419 (IsValidSecurityDescriptor_Proc): New typedefs.
3420 (get_file_security, get_security_descriptor_owner)
3421 (get_security_descriptor_group): Set errno to ENOTSUP.
3422 (set_file_security, get_security_descriptor_dacl)
3423 (is_valid_security_descriptor, convert_sd_to_sddl)
3424 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3425 (acl_free, acl_get_file, acl_set_file): New functions.
3427 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3429 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3431 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3432 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3433 for some of that bug's symptoms can now cause Emacs to abort.
3434 Remove the workaround.
3435 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3436 The bug that caused SIGCHLD to get lost has been fixed, and the
3437 workaround for it can now cause Emacs to abort.
3439 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3441 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3442 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3443 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3445 2012-12-16 Romain Francoise <romain@orebokech.com>
3447 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3448 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3449 and copy ACL entries of file in addition to SELinux context if set.
3450 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3452 * Makefile.in (LIBACL_LIBS): New macro.
3455 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3457 * fileio.c (internal_delete_file): Use bool for boolean.
3459 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3461 Fix bug #13079 on MS-Windows with temp files not being deleted.
3462 * w32.h (_child_process): New members input_file and
3464 (register_child): First argument is now pid_t.
3465 (record_infile, record_pending_deletion): New prototypes.
3467 * w32proc.c (new_child): Initialize input_file and
3468 pending_deletion members of the child.
3469 (delete_child): Delete the child's temporary input file, if any,
3470 that is pending deletion.
3471 (register_child): First argument is now pid_t.
3472 (record_infile, record_pending_deletion): New functions.
3473 (reap_subprocess): Fix a typo in DebPrint string.
3474 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3476 * fileio.c (internal_delete_file): Return an int again: non-zero
3477 if delete-file succeeds, zero otherwise.
3479 * lisp.h (internal_delete_file): Adjust prototype.
3481 * callproc.c (Fcall_process): Don't overwrite infile with result
3483 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3484 asynchronous subprocess, record the name of the input file name,
3486 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3487 delete the file, record it as pending deletion when the subprocess
3490 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3492 * editfns.c [HAVE_PWD_H]: Include grp.h.
3494 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3496 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3498 Fix permissions bugs with setgid directories etc. (Bug#13125)
3499 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3500 to mark it as a placeholder. The old value was often wrong.
3501 The only user of this attribute has been changed to use
3502 file-ownership-preserved-p instead, with its new group arg.
3503 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3505 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3507 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3508 Keep selected_window and selected_frame in sync.
3510 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3512 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3513 try to get accurate owner and group information from NT file
3514 security APIs. This is to make most callers of 'stat' and
3515 'lstat', which don't need that information, much faster.
3517 * dired.c (Ffile_attributes) [WINDOWSNT]:
3518 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3519 owner and group information from 'lstat'.
3521 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3523 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3524 as that confuses set-auto-coding, so insist on the head-read
3525 returning the full 1024 bytes. Let lseek compute the tail offset;
3526 less work for us. Do not ignore I/O errors when reading the tail.
3528 * xdisp.c: Minor style fixes.
3529 (init_iterator): Hoist assignment out of if-expression.
3530 (markpos_of_region): Callers now test for sign, not for -1.
3532 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3534 Minor redisplay optimization when the region length is zero.
3535 * xdisp.c (markpos_of_region): New function.
3536 (init_iterator): Do not highlight the region of zero length.
3537 (redisplay_window): Check whether the region is of non-zero length.
3538 (try_cursor_movement): Allow if the region length is zero.
3539 (try_window_reusing_current_matrix, try_window_id): Likewise.
3541 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3543 * search.c (search_buffer): Check the inverse translations of each
3544 character in pattern when the buffer being searched is unibyte.
3547 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3549 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3550 files, fixing a regression from 24.2.
3551 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3553 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3555 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3556 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3557 Remove unnecessary S_ISLNK test, as (contra the comments) this
3558 function can't copy symlinks. Improve quality of error message
3559 when attempting to copy files that are neither regular files nor
3562 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3564 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3565 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3566 * window.c (Frecenter):
3567 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3568 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3570 2012-12-12 Daniel Colascione <dancol@dancol.org>
3572 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3573 the dumped Emacs is not a sparse file, greatly improving Cygwin
3574 "make bootstrap" performance.
3576 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3578 * inotify.c (inotify_callback): Generate an Emacs event for every
3579 incoming inotify event.
3581 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3583 * xdisp.c (handle_face_prop): Fix logic of computing
3584 it->start_of_box_run_p.
3585 (append_space_for_newline): If the glyph row is R2L, reset the
3586 iterator's end_of_box_run_p flag before prepending the space glyph.
3587 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3588 iterator's start_of_box_run_p flag before prepending the stretch.
3589 (append_glyph, produce_image_glyph, append_composite_glyph)
3590 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3591 left_box_line_p and right_box_line_p flags of the glyph for R2L
3592 glyph rows. (Bug#13011)
3594 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3596 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3597 if changed buffer is not shown in a window.
3598 * insdel.c (prepare_to_modify_buffer): Likewise.
3599 * window.c (replace_buffer_in_windows_safely): Do nothing
3600 if buffer is not shown in a window.
3601 (Fforce_window_update): Likewise if string or buffer argument
3604 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3606 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3607 encoded_file_name, which is what it is.
3609 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3611 Consistently use marker_position and marker_byte_position.
3612 * fringe.c (Ffringe_bitmaps_at_pos):
3613 * indent.c (Fvertical_motion):
3614 * insdel.c (prepare_to_modify_buffer):
3615 * keyboard.c (make_lispy_position):
3616 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3617 (window_scroll_pixel_based, displayed_window_lines)
3618 (Fset_window_configuration):
3619 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3620 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3621 Replace direct access to marker fields with calls
3622 to marker_position and/or marker_byte_position.
3624 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3626 * makefile.w32-in (SIG2STR_H): New macro.
3627 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3628 ($(BLD)/w32notify.$(O)): Update dependencies.
3630 2012-12-10 Daniel Colascione <dancol@dancol.org>
3632 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3633 Windows file notification functionality unless WINDOWSNT.
3635 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3638 * w32fns.c (cache_system_info): Initialize the global hinst
3639 variable here so various initialization calls DTRT.
3641 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3642 (hinst): Remove unneeded extern declaration.
3643 (_start): Remove initialization of above variables; remove
3644 initialization of hinst, as cache_system_info now does that.
3646 * emacs.c (main): Call cache_system_info early in startup; we
3647 previously weren't calling it in Cygwin builds.
3649 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3650 Teach the autoconf build system how to compile a Windows resource file
3651 and link it to Emacs.
3653 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3655 Per-buffer window counters.
3656 * buffer.h (struct buffer): New member window_count.
3657 (buffer_window_count): New function.
3658 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3659 Initialize window_count.
3660 (Fkill_buffer): Verify window_count for the buffer being killed.
3661 (modify_overlay): Do not force redisplay if buffer is not shown
3663 (init_buffer_once): Initialize window_count for buffer_defaults
3664 and buffer_local_symbols.
3665 * window.h (buffer_shared): Remove declaration.
3666 (wset_buffer): Convert from inline ...
3667 * window.c (wset_buffer): ... to an ordinary function.
3668 (adjust_window_count): New function.
3669 (make_parent_window): Use it.
3670 * xdisp.c (buffer_shared): Remove.
3671 (redisplay_internal, redisplay_window): Adjust users.
3672 (buffer_shared_and_changed): Use per-buffer window counter.
3674 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3676 Support for filesystem notifications on MS-Windows.
3677 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3678 and this is a TTY frame, signal the caller that keyboard input is
3681 * w32xfns.c (drain_message_queue): Now returns an int: an
3682 indication whether any WM_EMACS_FILENOTIFY messages were found in
3685 * w32inevt.c (handle_file_notifications): New function.
3686 (w32_console_read_socket): Call it to process file notifications.
3688 * w32console.c (initialize_w32_display): Record the main thread ID
3691 * deps.mk (inotify.o): New dependency list.
3693 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3695 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3696 (WM_EMACS_END): Bump value by 1.
3697 (notification_buffer_in_use, file_notifications)
3698 (notifications_size, notifications_desc): Declare.
3699 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3702 * w32term.c (lispy_file_action, queue_notifications): New functions.
3703 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3704 <Qrenamed_to>: New symbols.
3705 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3707 * w32notify.c: New file, implements file event notifications for
3710 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3711 by posting it to the w32_read_socket queue.
3713 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3715 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3716 (GLOBAL_SOURCES): Add w32notify.c
3717 ($(BLD)/w32notify.$(O)): New set of dependencies.
3719 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3721 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3722 Handle FILE_NOTIFY_EVENT.
3723 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3724 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3725 w32notify-handle-event by default.
3727 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3730 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3732 Support for filesystem notifications on GNU/Linux via inotify.
3733 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3735 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3737 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3738 (syms_of_keyboard): DEFSYM it.
3739 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3740 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3741 Qfile_inotify events.
3742 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3743 special-event-map to inotify-handle-event.
3745 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3747 * Makefile.in (base_obj): Add inotify.o.
3749 * inotify.c: New file.
3751 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3753 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3755 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3757 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3758 DWORD_PTR, for compatibility with 64-bit builds.
3760 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3761 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3762 (system_process_attributes): Use SIZE_T rather than DWORD, for
3763 compatibility with 64-bit builds.
3765 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3767 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3769 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3771 * indent.c (Fvertical_motion): If a display string will be
3772 displayed on the left or the right margin, don't consider it as a
3773 factor in cursor positioning. (Bug#13108)
3775 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3777 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3779 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3781 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3784 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3786 * w32.c (unsetenv): Return 0 if the input string is too long.
3788 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3790 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3791 * alloc.c (xputenv): New function.
3792 * dbusbind.c (Fdbus_init_bus):
3794 * xterm.c (x_term_init):
3795 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3796 * editfns.c (initial_tz): Move static var decl up.
3797 (tzvalbuf_in_environ): New static var.
3798 (init_editfns): Initialize these two static vars.
3799 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3800 Save old TZ value on stack, if it's small.
3801 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3802 instead, use xputenv+unsetenv to set and restore TZ.
3803 (environbuf): Remove static var. All uses removed.
3804 (Fset_time_zone_rule): Do not save TZ and environ;
3805 no longer needed here.
3806 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3807 Move to inside set_time_zone_rule; they don't need file scope any more.
3808 (set_time_zone_rule): Maintain the TZ=value string separately.
3809 (syms_of_editfns): Don't initialize initial_tz;
3810 init_editfns now does it.
3811 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3812 * lisp.h (xputenv): New decl.
3814 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3816 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3818 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3820 * w32.c (unsetenv, sys_putenv): New functions.
3822 2012-12-08 Chong Yidong <cyd@gnu.org>
3824 * editfns.c (Finsert_char): Make the error message more
3825 informative (Bug#12992).
3827 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3829 Simplify get_lim_data.
3830 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3831 Remove USG and vlimit methods; no longer used these days.
3832 Add #error catchall just in case.
3834 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3835 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3836 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3837 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3838 (deleted_pid_list, Fdelete_process, create_process)
3839 (record_child_status_change, handle_child_signal, deliver_child_signal)
3840 (init_process_emacs, syms_of_process):
3841 Assume SIGCHLD is defined.
3842 (parse_signal): Remove. All uses removed.
3843 (abbr_to_signal): New static function.
3844 (Fsignal_process): Use it to convert signal names to ints.
3845 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3846 kill (getpgrp (), ...).
3847 (emacs_sigaction_init): Assume SIGCHLD is defined.
3848 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3849 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3850 * syssignal.h (EMACS_KILLPG): Remove.
3851 All uses replaced by 'kill' with a negative pid.
3852 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3853 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3855 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3857 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3858 This will cause a production Emacs to dump core instead of
3861 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3863 * frame.c (make_frame): Do not set window's buffer to t.
3864 * window.c (Fsplit_window_internal): Likewise. Previously it was
3865 used to indicate that the window is being set up. Now we use
3866 set_window_buffer for all new windows, so the condition in ...
3867 (Fset_window_buffer): ... is always true and can be removed.
3869 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3871 Convenient macro to check whether the buffer is hidden.
3872 * buffer.h (BUFFER_HIDDEN_P): New macro.
3873 * frame.c (make_frame): Use it. Adjust comment.
3874 * buffer.c (candidate_buffer): New function.
3875 (Fother_buffer, other_buffer_safely): Use it.
3877 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3879 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3880 if the child process is still running. Instead, exit the wait
3881 loop and return zero. (Bug#13086)
3883 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3885 * frame.h (x_char_width, x_char_height): Remove prototypes.
3886 * w32term.h (x_char_width, x_char_height): Likewise.
3887 * xfns.c (x_char_width, x_char_height): Remove.
3888 * w32fns.c (x_char_width, x_char_height): Likewise.
3889 * nsfns.c (x_char_width, x_char_height): Likewise.
3890 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3892 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3893 * keyboard.c (command_loop_1): Remove prototype.
3894 (command_loop_2, top_level_1): Add static to match prototype.
3896 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3898 Fix a recently-introduced delete-process race condition.
3899 * callproc.c, process.h (record_kill_process):
3900 New function, containing part of the old call_process_kill.
3901 (call_process_kill): Use it.
3902 This does not change call_process_kill's behavior.
3903 * process.c (Fdelete_process): Use record_kill_process to fix a
3904 race condition that could cause Emacs to lose track of a child.
3906 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3908 Avoid code duplication between prev_frame and next_frame.
3909 * frame.c (candidate_frame): New function. Add comment.
3910 (prev_frame, next_frame): Use it. Adjust comment.
3912 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3914 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3915 fails, signal an error instead of continuing with an empty
3917 Encode expanded temp file pattern before passing it to mkstemp or
3920 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3921 Encode the file name before passing it to dostounix_filename, in
3922 case it will downcase it (under w32-downcase-file-names).
3925 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3927 Minor call-process cleanups.
3928 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3929 at the same time as other platforms, to simplify analysis.
3930 No need for fd0_volatile since we have synch_process_fd.
3931 Avoid needless emacs_close; arg is always negative.
3933 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3935 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3938 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3940 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3941 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3942 and mouse_face_hidden members to a bitfields.
3943 * frame.h (struct frame): Remove set-but-not-used space_width member.
3944 (FRAME_SPACE_WIDTH): Remove.
3945 * nsterm.m, w32term.c, xterm.c: Adjust users.
3946 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3947 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3948 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3949 members to a bitfields.
3951 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3953 Don't let call-process be a zombie factory (Bug#12980).
3954 Fixing this bug required some cleanup of the signal-handling code.
3955 As a side effect, this change also fixes a longstanding rare race
3956 condition whereby Emacs could mistakenly kill unrelated processes,
3957 and it fixes a bug where a second C-g does not kill a recalcitrant
3958 synchronous process in GNU/Linux and similar platforms.
3959 The patch should also fix the last vestiges of Bug#9488,
3960 a bug which has mostly been fixed on the trunk by other changes.
3961 * callproc.c, process.h (synch_process_alive, synch_process_death)
3962 (synch_process_termsig, sync_process_retcode):
3963 Remove. All uses removed, to simplify analysis and so that
3964 less consing is done inside critical sections.
3965 * callproc.c (call_process_exited): Remove. All uses replaced
3966 with !synch_process_pid.
3967 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3968 These take the role of what used to be in unwind-protect arg.
3970 (block_child_signal, unblock_child_signal):
3971 New functions, to avoid races that could kill innocent-victim processes.
3972 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3973 (call_process_kill): Record killed processes as deleted, so that
3974 zombies do not clutter up the system. Do this inside a critical
3975 section, to avoid a race that would allow the clutter.
3976 (call_process_cleanup): Fix code so that the second C-g works again
3977 on common platforms such as GNU/Linux.
3978 (Fcall_process): Create the child process in a critical section,
3979 to fix a race condition. If creating an asynchronous process,
3980 record it as deleted so that zombies do not clutter up the system.
3981 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3982 light of these changes. Omit unnecessary call to emacs_close
3983 before failure, as the unwind-protect code does that.
3984 * callproc.c (call_process_cleanup):
3985 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3986 * process.c (record_deleted_pid): New function, containing
3987 code refactored out of Fdelete_process.
3988 (Fdelete_process): Use it.
3989 (process_status_retrieved): Remove. All callers changed to use
3990 child_status_change.
3991 (record_child_status_change): Remove, folding its contents into ...
3992 (handle_child_signal): ... this signal handler. Now, this
3993 function is purely a handler for SIGCHLD, and is not called after
3994 a synchronous waitpid returns; the synchronous code is moved to
3995 wait_for_termination. There is no need to worry about reaping
3996 more than one child now.
3997 * sysdep.c (get_child_status, child_status_changed): New functions.
3998 (wait_for_termination): Now takes int * status and bool
3999 interruptible arguments, too. Do not record child status change;
4000 that's now the caller's responsibility. All callers changed.
4001 Reimplement in terms of get_child_status.
4002 (wait_for_termination_1, interruptible_wait_for_termination):
4003 Remove. All callers changed to use wait_for_termination.
4004 * syswait.h: Include <stdbool.h>, for bool.
4005 (record_child_status_change, interruptible_wait_for_termination):
4007 (record_deleted_pid, child_status_changed): New decls.
4008 (wait_for_termination): Adjust to API changes noted above.
4010 * bytecode.c, lisp.h (Qbytecode): Remove.
4011 No longer needed after 2012-11-20 interactive-p changes.
4013 2012-12-03 Eli Zaretskii <eliz@gnu.org>
4015 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4016 the scroll margin, move point outside the margin. (Bug#13055)
4018 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4020 * gtkutil.c (my_log_handler): New function.
4021 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4023 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4025 * lisp.h (modify_region): Rename to...
4026 (modify_region_1): ...new prototype.
4027 * textprop.c (modify_region): Now static. Adjust users.
4028 * insdel.c (modify_region): Rename to...
4029 (modify_region_1): ...new function to work with current buffer.
4030 Adjust comment and users. Use true and false for booleans.
4032 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4034 * alloc.c (free_save_value): New function.
4035 (safe_alloca_unwind): Use it.
4036 * lisp.h (free_save_value): New prototype.
4037 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4039 (save_excursion_restore): Adjust to match saved data structure.
4040 Use free_save_value to offload some work from GC. Drop obsolete
4043 2012-12-03 Chong Yidong <cyd@gnu.org>
4045 * fileio.c (Vauto_save_list_file_name): Doc fix.
4047 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4049 * w32fns.c: Remove prototype of atof.
4050 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4052 (file_dialog_callback): Make it UINT_PTR.
4054 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4057 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4058 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4061 2012-12-03 Glenn Morris <rgm@gnu.org>
4063 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4065 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4067 Fix xpalloc confusion after memory is exhausted.
4068 * alloc.c (xpalloc): Comment fix.
4069 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4070 and signals an error, do not clear charset_table_size, as
4071 charset_table is still valid.
4072 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4074 Use execve to avoid need to munge environ (Bug#13054).
4075 * callproc.c (Fcall_process):
4076 * process.c (create_process):
4077 Don't save and restore environ; no longer needed.
4078 * callproc.c (child_setup):
4079 Use execve, not execvp, to preserve environ.
4081 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4083 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4085 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4087 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4088 display for sliced images (Bug#10500).
4090 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4092 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4094 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4095 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4097 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4099 * xdisp.c (window_outdated): Remove eassert since it hits
4100 some suspicious corner cases (see Bug#13007 and Bug#13012).
4101 (mode_line_update_needed): New function.
4102 (redisplay_internal, redisplay_window): Use it.
4103 (ensure_selected_frame): New function.
4104 (redisplay_internal, unwind_redisplay): Use it.
4105 (redisplay_internal): Move comment about buffer_shared...
4106 (buffer_shared_and_changed): ...near to its real use.
4108 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4110 * callproc.c (Fcall_process): Don't misreport vfork failure.
4112 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4114 * callproc.c (Fcall_process): Fix vfork portability problems.
4115 Do not assume that fd[0], count, filefd, and save_environ survive
4116 vfork. Fix bug whereby wrong errno value could be reported for
4117 pipe failure. Some minor cleanups, too, as follows. Move buf and
4118 bufsize to the context where they're needed. Change new_argv to
4119 be of type char **, as this is more convenient and avoids casts.
4120 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4121 Now local constants, not macros.
4123 2012-11-18 Kenichi Handa <handa@gnu.org>
4125 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4126 for the variable "f".
4128 2012-11-13 Kenichi Handa <handa@gnu.org>
4130 * font.c (font_unparse_xlfd): Exclude special characters from the
4131 generating XLFD name.
4133 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4135 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4136 * dired.c (stat_uname, stat_gname):
4137 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4139 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4140 * dired.c (directory_files_internal, file_name_completion):
4141 Assume EAGAIN and EINTR are defined.
4143 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4144 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4145 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4146 * lread.c (readbyte_from_file): Assume EINTR is defined.
4147 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4148 Assume EIO and EAGAIN are defined.
4149 * unexcoff.c (write_segment): Assume EFAULT is defined.
4151 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4153 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4156 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4157 highlighting on the frame was cleared. Prevents assertion
4158 violations when repeatedly clicking on the "Top" link of the
4159 "bread-crumbs" in Info buffers.
4161 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4163 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4165 2012-11-24 Ken Brown <kbrown@cornell.edu>
4167 * keyboard.c (HAVE_MOUSE):
4168 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4169 were always defined.
4171 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4173 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4174 between bpos_covered and bpos_max. This fixes cursor display when
4175 several display strings follow each other.
4177 * .gdbinit (pgx): If the glyph's object is a string, display the
4178 pointer to string data, rather than the value of the string object
4179 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4181 * indent.c (Fvertical_motion): If the starting position is covered
4182 by a display string, return to one position before that, to avoid
4183 overshooting it inside move_it_to. (Bug#12930)
4185 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4187 * frame.h (struct frame): Remove display_preempted member
4188 since all users are dead long ago.
4189 * nsterm.h (struct x_output): Use the only dummy member.
4190 * w32menu.c (pending_menu_activation): Remove since not
4192 (set_frame_menubar): Adjust user.
4193 * w32term.h (struct x_output): Drop outdated #if 0 code.
4194 (struct w32_output): Use bitfields for explicit_parent,
4195 asked_for_visible and menubar_active members.
4196 Drop unused pending_menu_activation member.
4197 * xterm.h (struct x_output): Drop outdated #if 0 code.
4198 Use bitfields for explicit_parent, asked_for_visible,
4199 has_been_visible and net_wm_state_hidden_seen members.
4201 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4203 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4204 of a literal "/". (Bug#12955)
4205 (gl-stamp): Invoke fc.exe directly, not through cmd.
4207 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4209 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4210 * dired.c: Assume HAVE_DIRENT_H.
4211 (NAMLEN): Remove, replacing with ...
4212 (dirent_namelen): New function. All uses changed. Use the GNU macro
4213 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4214 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4215 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4216 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4218 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4219 * ndir.h: Rename to ../nt/inc/dirent.h.
4220 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4221 Do not include <dirent.h>; no longer needed.
4222 * w32.c: Include <dirent.h> rather than "ndir.h".
4224 2012-11-23 Chong Yidong <cyd@gnu.org>
4226 * xftfont.c (xftfont_open): Remove duplicate assignment.
4228 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4230 * alloc.c (Fgarbage_collect): Unblock input after clearing
4231 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4232 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4233 * msdos.c (IT_frame_up_to_date): Use it here...
4234 * w32term.c (w32_frame_up_to_date): ...here...
4235 * xterm.c (XTframe_up_to_date): ...and here...
4236 * nsterm.m (ns_frame_up_to_date): ...but not here.
4237 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4239 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4240 Do not check whether GC is in progress.
4242 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4244 * xdisp.c (window_buffer_changed): New function.
4245 (update_menu_bar, update_tool_bar): Use it to
4246 simplify large 'if' statements.
4247 (redisplay_internal): Generalize commonly used
4248 'tail' and 'frame' local variables.
4250 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4252 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4253 with Windows system header.
4255 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4257 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4258 * alloc.c: Assume unistd.h exists.
4259 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4260 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4261 (getwd) [USG]: Remove; no longer needed.
4262 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4263 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4264 * w32.h (getcwd): Remove decl.
4266 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4268 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4269 Make it set selected_window as well.
4270 (update_tool_bar): Use it.
4272 2012-11-21 Ken Brown <kbrown@cornell.edu>
4274 * emacs.c (main): Set the G_SLICE environment variable for all
4275 Cygwin builds, not just GTK builds. See
4276 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4278 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4280 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4281 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4282 Define for the MSVC compiler.
4284 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4286 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4287 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4288 dostounix_filename. Prevents crashes down the road, because
4289 dostounix_filename assumes it gets a unibyte string.
4290 Reported by Michel de Ruiter <michel@sentient.nl>, see
4291 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4293 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4295 Conflate Qnil and Qunbound for `symbol-function'.
4296 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4297 * lread.c (init_obarray): Set `function' fields to Qnil.
4298 * eval.c (Fcommandp): Ignore Qunbound.
4299 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4300 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4301 Test NILP rather than Qunbound.
4302 (Ffmakunbound): Set to Qnil.
4303 (Fsymbol_function): Never signal an error.
4304 (Finteractive_form): Ignore Qunbound.
4306 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4308 * eval.c (interactive_p): Remove no-longer-used decl.
4310 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4312 * xdisp.c (buffer_shared): Adjust comment.
4313 (buffer_shared_and_changed): New function.
4314 (prepare_menu_bars, redisplay_internal): Use it to
4315 decide whether all windows or frames should be updated.
4316 (window_outdated): New function.
4317 (text_outside_line_unchanged_p, redisplay_window): Use it.
4318 (redisplay_internal): Likewise. Fix indentation.
4320 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4322 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4323 (syms_of_eval): Remove corresponding defsubr.
4324 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4326 2012-11-19 Daniel Colascione <dancol@dancol.org>
4328 * w32fns.c (Fx_file_dialog):
4329 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4330 cygwin_convert_file_name*.
4332 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4333 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4335 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4337 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4339 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4341 * w32select.c: Include w32common.h before w32term.h, so that
4342 windows.h gets included before w32term.h uses some of its
4343 features, see below.
4345 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4347 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4349 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4351 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4353 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4354 (ns_select): Return at once if events are held (Bug#12834).
4356 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4358 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4359 Needed following 2012-10-20 change. (Bug#12902)
4361 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4363 * w32proc.c (waitpid): Remove unused label get_result.
4365 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4367 * makefile.w32-in (SYSWAIT_H): New macro.
4368 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4369 ($(BLD)/sysdep.$(O)): Update dependencies.
4371 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4373 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4374 * callproc.c (relocate_fd): Assume F_DUPFD.
4375 * emacs.c, term.c (O_RDWR): Remove.
4376 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4377 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4378 * nsterm.m: Assume <fcntl.h> exists.
4379 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4380 (create_pty, Fmake_network_process, server_accept_connection)
4381 (wait_reading_process_output, init_process_emacs):
4383 (wait_reading_process_output): Put in a special case for WINDOWSNT
4384 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4385 It's not clear this is needed, but it's a more-conservative change.
4386 (create_process): Assume FD_CLOEXEC.
4387 (create_process, create_pty): Assume O_NOCTTY.
4388 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4389 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4390 Omit if not DOS_NT, since F_GETFL is not defined there.
4391 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4392 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4394 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4395 lack it, since gnulib guarantees this.
4396 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4398 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4400 * w32.c (faccessat): Pretend that directories have the execute bit
4401 set. Emacs expects that, e.g., in files.el:cd-absolute.
4403 * w32proc.c (create_child): Don't clip the PID of the child
4404 process to fit into an Emacs integer, as this is no longer a
4406 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4407 reaping only the process specified by PID argument, if that is
4408 positive. Use PID instead of dead_child to know which process to
4409 reap. Wait for the child to die only if WNOHANG is not in
4411 (sys_select): Don't set dead_child.
4413 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4414 as it is no longer needed.
4416 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4418 (record_child_status_change): Remove the setting of
4419 record_at_most_one_child for the !WNOHANG case.
4421 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4423 Fix problems in ns port found by static checking.
4424 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4425 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4426 not to process group.
4427 (ns_select): Use emacs_write, not write, as that's more robust
4428 in the presence of signals.
4429 (fd_handler:): Check for read errors.
4431 2012-11-16 Glenn Morris <rgm@gnu.org>
4433 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4435 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4437 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4439 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4441 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4442 use the same value of thread handle.
4443 (start_timer_thread): If the timer thread exited (due to error),
4444 clean up by closing the two handles it used. Duplicate the caller
4445 thread's handle here, so it gets duplicated only once, when
4446 launching the timer thread. Set priority of the timer thread, not
4448 (getitimer): Don't duplicate the caller thread's handle here.
4451 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4453 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4456 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4458 Remove no-longer-used pty_max_bytes variable.
4459 * process.c (pty_max_bytes): Remove; unused.
4460 (send_process): Do not set it.
4462 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4464 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4465 Update dependencies.
4467 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4469 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4470 This follows up on the 2012-09-29 patch that removed indirection
4471 for the 'function' field. Reported by Sergey Vinokurov in
4472 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4474 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4476 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4477 different name, as the MS runtime does not have such a function,
4478 and probably never will.) All callers changed. Ignore DIRFD
4479 value if PATH is an absolute file name, to match Posix spec
4480 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4483 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4485 * xdisp.c (echo_area_display, redisplay_internal):
4486 Omit redundant check whether frame_garbaged is set.
4488 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4490 Use faccessat, not access, when checking file permissions (Bug#12632).
4491 This fixes a bug that has been present in Emacs since its creation.
4492 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4493 which must set some sort of record. (Torek's bug report was against
4494 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4495 same common flaw.) See Torek's Usenet posting
4496 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4497 Posted: Fri Apr 8 14:18:56 1983.
4498 * Makefile.in (LIB_EACCESS): New macro.
4500 * callproc.c (init_callproc):
4501 * charset.c (init_charset):
4502 * fileio.c (check_existing, check_executable, check_writable)
4504 * lread.c (openp, load_path_check):
4505 * process.c (allocate_pty):
4507 Use effective UID when checking permissions, not real UID.
4508 * callproc.c (init_callproc):
4509 * charset.c (init_charset):
4510 * lread.c (load_path_check, init_lread):
4511 Test whether directories are accessible, not merely whether they exist.
4512 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4513 * fileio.c (check_existing, check_executable, check_writable)
4515 Use symbolic names instead of integers for the flags, as they're
4517 (check_writable): New arg AMODE. All uses changed.
4518 Set errno on failure.
4519 (Ffile_readable_p): Use faccessat, not stat + open + close.
4520 (Ffile_writable_p): No need to call check_existing + check_writable.
4521 Just call check_writable and then look at errno. This saves a syscall.
4522 dir should never be nil; replace an unnecessary runtime check
4523 with an eassert. When checking the parent directory of a nonexistent
4524 file, check that the directory is searchable as well as writable, as
4525 we can't create files in unsearchable directories.
4526 (file_directory_p): New function, which uses 'stat' on most platforms
4527 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4528 (Ffile_directory_p, Fset_file_times): Use it.
4529 (file_accessible_directory_p): New function, which uses a single
4530 syscall for efficiency.
4531 (Ffile_accessible_directory_p): Use it.
4532 * xrdb.c (file_p): Use file_directory_p.
4533 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4534 * lread.c (openp): When opening a file, use fstat rather than
4535 stat, as that avoids a permissions race. When not opening a file,
4536 use file_directory_p rather than stat.
4537 (dir_warning): First arg is now a usage string, not a format.
4538 Use errno. All uses changed.
4539 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4540 that merely introduced a race.
4541 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4542 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4543 and similarly for the other O_* flags.
4544 * w32.c (sys_faccessat): Rename from sys_access and switch to
4545 faccessat's API. All uses changed.
4546 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4547 (magic_db): Rename from magic_file_p.
4548 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4549 char *, so that we don't have to test for file existence
4550 separately from opening the file for reading. This removes a race
4551 fixes a permission-checking problem, and simplifies the code.
4553 (file_p): Remove; no longer needed.
4555 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4557 Omit glyphs initialization at startup.
4558 * dispnew.c (glyphs_initialized_initially_p): Remove.
4559 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4560 (Fredraw_frame): Move actual code from here...
4561 (redraw_frame): ...to here. Add eassert. Adjust comment.
4562 (Fredraw_display): Use redraw_frame.
4563 * xdisp.c (clear_garbaged_frames): Likewise.
4565 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4567 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4568 passed to pint2str and pint2hrstr to be at most the size of the
4569 frame's decode_mode_spec_buffer. This avoids crashes with very
4570 large values of FIELD_WIDTH argument to decode_mode_spec.
4573 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4575 Fix a race with verify-visited-file-modtime (Bug#12863).
4576 Since at least 1991 Emacs has ignored an mtime difference of no
4577 more than one second, but my guess is that this was to work around
4578 file system bugs that were fixed long ago. Since the race is
4579 causing problems now, let's remove that code.
4580 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4581 whose time stamp is off by no more than a second. Insist that the
4582 file time stamps match exactly.
4584 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4586 * frame.h (struct frame): Convert external_tool_bar member to
4587 1-bit unsigned bitfield.
4588 * termhooks.h (struct terminal): Remove mouse_moved member since
4589 all users are long dead. Adjust comment on mouse_position_hook.
4591 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4593 Simplify by using FOR_EACH_FRAME here and there.
4594 * frame.c (next_frame, prev_frame, other_visible_frames)
4595 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4596 * w32term.c (x_window_to_scroll_bar): Likewise.
4597 * window.c (window_list): Likewise.
4598 * xdisp.c (x_consider_frame_title): Likewise.
4599 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4600 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4601 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4602 * xmenu.c (menubar_id_to_frame): Likewise.
4603 * xselect.c (frame_for_x_selection): Likewise.
4604 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4605 (x_window_to_menu_bar): Likewise.
4606 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4608 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4610 * data.c (Qdefalias_fset_function): Now static.
4612 Another tweak to vectorlike_header change.
4613 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4614 Remove, and replace all uses with ...
4615 (next_in_free_list, set_next_in_free_list):
4616 New functions, which respect C's aliasing rules better.
4618 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4620 * window.c (list4i): Rename from 'quad'. All uses changed.
4621 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4623 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4625 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4626 warning about mixing declarations and code in ISO C90.
4628 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4630 * window.c (Fsplit_window_internal): Set combination limit of
4631 new parent window to t iff Vwindow_combination_limit is t;
4632 fixing a regression introduced with the change from 2012-09-22.
4633 (Fset_window_combination_limit): Fix doc-string.
4635 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4637 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4638 amount when the scroll margins are too large. When scrolling
4639 backwards in the buffer, give up if cannot reach point or the
4640 scroll margin within a reasonable number of screen lines.
4641 Fixes point position in window under scroll-up/down-aggressively when
4642 point is positioned many lines beyond the window top/bottom.
4645 * ralloc.c (relinquish): If real_morecore fails to return memory
4646 to the system, don't crash; instead, leave the last heap
4647 unchanged and return. (Bug#12774)
4649 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4651 * lisp.h (AUTOLOADP): New macro.
4652 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4653 * data.c (Ffset): Remove special ad-advice-info handling.
4654 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4656 (Finteractive_form): Simplify.
4657 (Fquo): Don't insist on having at least 2 arguments.
4658 (Qdefalias_fset_function): New var.
4660 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4662 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4664 * nsfont.m (Qcondensed, Qexpanded): New variables.
4665 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4666 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4668 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4670 Fix recently introduced crash on MS-Windows (Bug#12839).
4671 * w32term.h (struct scroll_bar): Use convenient header.
4672 (SCROLL_BAR_VEC_SIZE): Remove.
4673 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4675 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4677 Tweak last vectorlike_header change.
4678 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4679 vectorlike object on the free list. This is introduced to avoid
4680 some (but not all) pointer casting and aliasing problems, see
4681 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4682 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4684 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4686 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4688 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4689 been removed, so remove them here also.
4691 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4693 * doc.c (Fdocumentation): Handle new property
4694 dynamic-docstring-function to replace the old ad-advice-info.
4696 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4698 * fns.c (Qeql, hashtest_eq): Now static.
4700 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4702 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4703 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4704 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4705 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4707 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4709 Use same hash function for hashfn_profiler as for hash_string etc.
4710 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4711 * lisp.h (sxhash_combine): New inline function, with the contents
4712 of the old SXHASH_COMBINE.
4713 * profiler.c (hashfn_profiler): Use it, instead of having a
4714 special hash function containing a comparison that always yields 1.
4716 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4718 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4719 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4720 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4723 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4725 * image.c (xpm_make_color_table_h): Fix compiler error because
4726 make_hash_table changed.
4728 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4730 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4732 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4734 Use ad-hoc comparison function for the profiler's hash-tables.
4735 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4736 (make_log): Use them.
4737 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4738 call Fequal any more.
4739 (Ffunction_equal): New function.
4740 (cmpfn_profiler, hashfn_profiler): New functions.
4741 (syms_of_profiler): Initialize them.
4742 * lisp.h (struct hash_table_test): New struct.
4743 (struct Lisp_Hash_Table): Use it.
4744 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4745 * fns.c (make_hash_table): Take a struct to describe the test.
4746 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4747 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4748 (hash_lookup, hash_remove_from_table): Move assertion checking of
4749 hashfn result here. Check hash-equality before calling cmpfn.
4750 (Fmake_hash_table): Adjust call to make_hash_table.
4751 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4752 (syms_of_fns): Initialize them.
4753 * emacs.c (main): Move syms_of_fns earlier.
4754 * xterm.c (syms_of_xterm):
4755 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4756 * print.c (print_object): Adjust to new hash-table struct.
4757 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4759 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4761 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4762 value of w32-scroll-lock-modifier is neither nil nor one of the
4763 known key modifiers. (Bug#12806)
4765 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4767 Shrink struct vectorlike_header to the only size field.
4768 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4770 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4771 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4772 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4773 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4774 information from the vector header. Adjust comment.
4775 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4776 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4778 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4779 (struct vectorlike_header): Remove next member. Adjust comment.
4780 (struct Lisp_Subr): Add convenient header. Adjust comment.
4781 (allocate_pseudovector): Adjust prototype.
4782 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4783 (sweep_string, lisp_malloc): Remove useless prototypes.
4784 (enum mem_type): Adjust comment.
4785 (NEXT_IN_FREE_LIST): New macro.
4786 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4787 (Fmake_bool_vector): Likewise.
4788 (struct large_vector): New type to represent allocation unit for
4789 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4790 (large_vectors): Change type to struct large_vector.
4791 (allocate_vector_from_block): Simplify.
4792 (PSEUDOVECTOR_NBYTES): Replace with...
4793 (vector_nbytes): ...new function. Adjust users.
4794 (sweep_vectors): Adjust processing of large vectors.
4795 (allocate_vectorlike): Likewise.
4796 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4797 Add easserts. Adjust XSETPVECTYPESIZE usage.
4798 (allocate_buffer): Use BUFFER_PVEC_INIT.
4799 (live_vector_p): Adjust to match large vector.
4800 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4801 * buffer.h (struct buffer): Add next member.
4802 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4804 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4805 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4806 (copy_hash_table): Adjust to match vector header change.
4807 * lread.c (defsubr): Use XSETPVECTYPE.
4808 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4809 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4810 (xvecsize): New command.
4812 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4814 * keyboard.c (event_to_kboard): Do not dereference
4815 frame_or_window field of SELECTION_REQUEST_EVENT
4816 and SELECTION_CLEAR_EVENT events (Bug#12814).
4817 * xterm.h (struct selection_input_event): Adjust comment.
4819 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4821 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4822 such as Scroll Lock, if the respective keys are treated as
4823 function keys, not as modifiers. This avoids destroying non-ASCII
4824 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4826 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4828 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4830 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4832 Restore some duplicate definitions (Bug#12814).
4833 This undoes part of the 2012-11-03 changes. Some people build
4834 with plain -g rather than with -g3, and they need the duplicate
4835 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4836 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4837 Define as macros, as well as as enums or as constants.
4839 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4841 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4842 to keypad keys (Bug#12816).
4844 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4846 Minor adjustments of recently-changed frame functions.
4847 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4848 known to be a frame (we're in the FRAMEP branch).
4849 * lisp.h (Qframep): Remove decl. frame.h declares this.
4850 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4851 since they're meant for Lisp fixnum values.
4853 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4855 * window.c (Fwindow_combination_limit): Revert to the only
4856 required argument and adjust docstring as suggested in
4857 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4858 by Martin Rudalics <rudalics@gmx.at>.
4860 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4862 Widely used frame validity and checking functions.
4863 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4864 * frame.c (decode_live_frame, decode_any_frame): New functions.
4865 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4866 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4867 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4868 (Fframe_pointer_visible_p): Use decode_any_frame.
4869 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4870 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4871 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4872 (Fframe_focus): Likewise. Allow zero number of arguments.
4874 (frame_buffer_list, frame_buffer_predicate): Remove.
4875 * lisp.h (frame_buffer_predicate): Remove prototype.
4876 * buffer.c (Fother_buffer): Use decode_any_frame.
4877 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4878 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4879 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4880 (Fclose_font, Ffont_info): Use decode_live_frame.
4881 * fontset.c (check_fontset_name): Likewise.
4882 * terminal.c (Fframe_terminal): Likewise.
4883 * w32fns.c (check_x_frame): Likewise.
4884 * window.c (Fminibuffer_window, Fwindow_at)
4885 (Fcurrent_window_configuration): Likewise.
4886 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4887 Likewise. Allow zero number of arguments. Adjust docstring.
4888 * dispnew.c (Fredraw_frame): Likewise.
4889 * xfaces.c (frame_or_selected_frame): Remove.
4890 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4891 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4892 (Fframe_face_alist): Use decode_live_frame.
4893 * xfns.c (check_x_frame): Likewise.
4895 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4897 * window.c (quad): New function.
4898 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4899 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4900 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4901 (Fwindow_line_height): Use it.
4902 (Fwindow_fringes): Use list3.
4903 (Fwindow_scroll_bars): Use list4.
4904 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4905 (Fwindow_combination_limit): Allow zero number of arguments.
4907 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4909 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4911 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4912 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4913 file descriptor 2 for standard error. (Bug#12805)
4915 2012-11-05 Chong Yidong <cyd@gnu.org>
4917 * process.c (wait_reading_process_output): Revert previous change.
4919 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4921 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4922 This removes code that has been obsolete since around 1990.
4923 * callproc.c (Fcall_process):
4925 * process.c (create_process):
4926 * term.c (dissociate_if_controlling_tty):
4927 Assume setsid exists.
4928 * callproc.c (child_setup): Assume setpgid exists and behaves as
4929 per POSIX.1-1988 or later.
4930 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4931 * emacs.c (shut_down_emacs):
4932 * sysdep.c (sys_suspend, init_foreground_group):
4933 Assume getpgrp behaves as per POSIX.1-1998 or later.
4934 * msdos.c (setpgrp): Remove.
4935 (tcgetpgrp, setpgid, setsid): New functions.
4936 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4937 * term.c (no_controlling_tty): Remove; unused.
4938 * w32proc.c (setpgrp): Remove.
4939 (setsid, tcgetpgrp): New functions.
4941 Simplify by assuming __fpending.
4942 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4943 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4944 Do not assume that __fpending's result fits in int.
4946 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4948 Remove EMACS_OUTQSIZE+sleep hack.
4949 * dispnew.c (update_frame_1): Remove hack for terminals slower
4950 than 2400 bps, which throttled Emacs by having it sleep.
4951 This code hasn't worked since at least 2007, when the multi-tty stuff
4952 was added, and anyway those old terminals are long dead.
4953 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4954 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4956 Fix data-loss with --version (Bug#9574).
4957 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4958 as we can't assume that emacs_strerror is initialized, and strerror
4959 is good enough here.
4960 (main): Invoke atexit earlier, to catch earlier instances of
4961 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4963 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4965 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4966 (keyDown): Remap keypad keys to X11 virtual key codes.
4968 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4970 Fix data-loss with --batch (Bug#9574).
4971 * emacs.c: Include <close-stream.h>.
4972 (close_output_streams): New function.
4973 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4974 and handles errors appropriately.
4975 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4978 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4979 The symptom is a diagnostic "GLib-WARNING **: In call to
4980 g_spawn_sync(), exit status of a child process was requested but
4981 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4982 waitpid(), so exit status can't be returned." The diagnostic
4983 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4984 The real bug is a race condition between Emacs and glib: Emacs
4985 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4986 so that glib can't find it. Work around the bug by invoking
4987 waitpid only on subprocesses that Emacs itself creates.
4988 * process.c (create_process, record_child_status_change):
4989 Don't use special value -1 in pid field, as the caller now must
4990 know the pid rather than having the callee infer it.
4991 The inference was sometimes incorrect anyway, due to another race.
4992 (create_process): Set new 'alive' member if child is created.
4993 (process_status_retrieved): New function.
4994 (record_child_status_change): Use it.
4995 Accept negative 1st argument, which means to wait for the
4996 processes that Emacs already knows about. Move special-case code
4997 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4998 processes that have already been waited for, by testing and
4999 clearing new 'alive' member.
5000 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5001 now does this internally.
5002 (handle_child_signal): Let record_child_status_change do all
5003 the work, since we do not want to reap all exited child processes,
5004 only the child processes that Emacs itself created.
5005 * process.h (Lisp_Process): New boolean member 'alive'.
5007 Omit duplicate definitions no longer needed with gcc -g3.
5008 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5009 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5010 Define only as macros. There's no longer any need to also define
5011 these symbols as enums or as constants, since we now assume
5012 gcc -g3 when debugging.
5014 2012-11-03 Eli Zaretskii <eliz@gnu.org>
5016 * lisp.mk: Adjust comments to the fact that term/internal is now
5017 loaded from loadup.el.
5019 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5020 (msdos_fatal_signal): New function.
5021 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5024 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5025 for GCC versions before 4.
5026 (emacs_raise): Define to call msdos_fatal_signal.
5028 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5029 iterator when starting in the middle of a display or overlay
5032 2012-11-03 Chong Yidong <cyd@gnu.org>
5034 * process.c (wait_reading_process_output): Clean up the last
5037 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5039 * process.c (wait_reading_process_output): Avoid a race condition
5040 with SIGIO delivery (Bug#11536).
5042 2012-11-03 Chong Yidong <cyd@gnu.org>
5044 * buffer.c (cursor_type): Untabify docstring.
5046 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5048 * frame.h (struct frame): Drop can_have_scroll_bars member
5049 which is meaningless for a long time. Adjust comments.
5050 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5051 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5053 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5055 * window.c (decode_next_window_args): Update window arg after
5056 calling decode_live_window and so fix crash reported at
5057 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5058 by Juanma Barranquero <lekktu@gmail.com>.
5059 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5060 * font.c (Ffont_at): Likewise.
5062 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5064 * widget.c (resize_cb): New function.
5065 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5066 (EmacsFrameResize): Check if all is up to date before changing frame
5069 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5071 Implement backtrace output for fatal errors on MS-Windows.
5072 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5073 (BACKTRACE_LIMIT_MAX): New macro.
5074 (w32_backtrace): New function.
5075 (emacs_abort): Use w32_backtrace when the user chooses not to
5076 attach a debugger. Update the text of the abort dialog.
5078 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5080 Window-related stuff cleanup here and there.
5081 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5082 Use decode_any_window.
5083 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5084 * xdisp.c (Fformat_mode_line): Likewise.
5085 * font.c (Ffont_at): Use decode_live_window.
5086 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5087 * window.c (decode_next_window_args): Likewise.
5088 (decode_any_window): Remove static.
5089 * window.h (decode_any_window): Add prototype.
5090 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5091 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5094 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5096 Remove pad from struct input_event.
5097 * termhooks.h (struct input_event): Remove padding field.
5099 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5100 member is never cons for a long time. Adjust comment.
5101 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5102 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5103 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5104 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5106 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5108 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5110 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5112 Fix crash when using Emacs as commit editor for git (Bug#12697).
5113 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5114 and it is configured in conf_post.h.
5115 (Fcall_process): Don't invoke both setsid and setpgid; the former
5116 is enough, if it exists.
5117 * callproc.c (Fcall_process, child_setup):
5118 * process.c (create_process): Use setpgid.
5119 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5121 * dispnew.c (init_display): Initialize the foreground group
5122 if we are running a tty display.
5123 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5124 * lisp.h (init_foreground_group): New decl.
5125 * sysdep.c (inherited_pgroup): New static var.
5126 (init_foreground_group, tcsetpgrp_without_stopping)
5127 (narrow_foreground_group, widen_foreground_group): New functions.
5128 (init_sys_modes): Narrow foreground group.
5129 (reset_sys_modes): Widen foreground group.
5131 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5133 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5135 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5137 * minibuf.c (read_minibuf): Restore current buffer since
5138 choose_minibuf_frame calling Fset_frame_selected_window may
5139 change it (Bug#12766).
5141 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5143 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5145 2012-10-30 Kenichi Handa <handa@gnu.org>
5147 * font.c (Ffont_at): If WINDOW is specified and it is not
5148 displaying the current buffer, signal an error.
5150 2012-10-29 Daniel Colascione <dancol@dancol.org>
5152 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5153 In preparation for fixing bug#12739, move these functions from
5156 * coding.h, coding.c: ... to here, and compile them only when
5157 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5158 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5160 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5162 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5163 (timer_loop, getitimer, setitimer): Use it instead of
5164 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5166 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5169 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5171 * nsterm.m (NO_APPDEFINED_DATA): New define.
5172 (last_appdefined_event_data): New variable
5173 (last_appdefined_event): Remove.
5174 (ns_select): Initialize t from last_appdefined_event_data instead
5175 of [last_appdefined_event data1].
5176 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5177 remove last_appdefined_event (Bug#12698).
5179 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5181 * frame.c (x_set_font): Catch internal error.
5183 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5185 Avoid overflow in w32 implementation of interval timers.
5186 When possible, for ITIMER_PROF count only times the main thread
5188 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5189 'volatile ULONGLONG' types. All the other data which was
5190 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5191 (GetThreadTimes_Proc): New typedef.
5192 (w32_get_timer_time): New function, returns a suitable time value
5194 (timer_loop): Enter critical section when accessing ULONGLONG
5195 values of the itimer_data struct, as these accesses are no longer
5196 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5197 Remove unused variable.
5198 (init_timers): Initialize s_pfn_Get_Thread_Times.
5199 (start_timer_thread): Don't assign itimer->caller_thread here.
5200 (getitimer): Assign itimer->caller_thread here.
5201 (setitimer): Always call getitimer to get the value of ticks_now.
5202 (sys_spawnve): Avoid compiler warning about format mismatch.
5204 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5206 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5207 mouse movement events if the menu bar is active. This avoids
5208 producing a busy "hour-glass" cursor by Windows if the mouse
5209 pointer is positioned over a tooltip shown for some menu item.
5211 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5213 Don't assume process IDs fit in int.
5214 * emacs.c (shut_down_emacs) [!DOS_NT]:
5215 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5216 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5217 Use pid_t, not int, to store process IDs, as 'int'
5218 is not wide enough on a few platforms (e.g., AIX and IRIX).
5220 2012-10-23 Kenichi Handa <handa@gnu.org>
5222 The following change is to make face-font-rescale-alist work
5223 correctly for non-ASCII fonts.
5225 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5226 (font_open_for_lface): Handle Vface_font_rescale_alist.
5228 2012-10-23 Chong Yidong <cyd@gnu.org>
5230 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5232 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5234 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5236 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5238 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5241 2012-10-21 Glenn Morris <rgm@gnu.org>
5243 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5245 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5247 Port to OpenBSD 5.1.
5248 * frame.c (Fmouse_position, Fmouse_pixel_position):
5249 * xdisp.c (produce_stretch_glyph):
5250 Declare local vars only when they're needed.
5251 This is clearer and avoids a warning on OpenBSD about unused vars.
5252 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5253 This is safer, and avoids OpenBSD warnings about unused vars.
5254 * keyboard.c (record_menu_key): Remove unnecessary decl.
5255 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5256 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5257 as our definition clashes with OpenBSD's.
5258 * xfaces.c (load_face_colors, check_lface_attrs)
5259 (get_lface_attributes_no_remap, get_lface_attributes)
5260 (lface_fully_specified_p, x_supports_face_attributes_p)
5261 (tty_supports_face_attributes_p, face_fontset, realize_face)
5262 (realize_x_face, realize_tty_face):
5263 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5264 merely Lisp_Object *. This is more informative and avoids
5265 a warning on OpenBSD about accessing beyond an object's size.
5267 2012-10-20 Chong Yidong <cyd@gnu.org>
5269 * lread.c (Fload): Doc fix (Bug#12592).
5271 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5273 * font.c (Ffont_at): Fix previous change.
5275 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5277 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5278 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5281 * alloc.c (NSTATICS): Decrease to 0x800.
5283 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5285 * fns.c (Fnreverse): Include the problem element when signaling an
5288 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5290 * nsterm.m (ns_select): Check writefds before call to
5291 FD_ISSET (Bug#12668).
5293 2012-10-18 Daniel Colascione <dancol@dancol.org>
5295 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5296 (staticpro): If we run out of staticpro slots, die with an
5297 informative error instead of just calling emacs_abort.
5299 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5301 Fix two flaws reported by Dmitry Antipov.
5302 * window.c (Ftemp_output_buffer_show): Remove.
5303 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5304 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5306 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5308 * makefile.w32-in ($(BLD)/w32.$(O)):
5309 ($(BLD)/vm-limit.$(O)):
5311 ($(BLD)/unexw32.$(O)):
5312 ($(BLD)/fileio.$(O)):
5313 ($(BLD)/dispnew.$(O)): Update dependencies.
5315 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5318 * w32proc.c: Include ctype.h.
5320 * w32.h (init_environment, check_windows_init_file)
5321 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5322 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5323 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5324 (sys_link): Add prototypes.
5326 * w32.c: Include w32select.h.
5327 (sys_access, e_malloc, sys_select): Add prototypes.
5328 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5330 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5332 * unexw32.c: Include lisp.h and w32.h.
5334 * term.c [WINDOWSNT]: Include w32term.h.
5336 * process.c [WINDOWSNT]: Add prototype of sys_select.
5338 * fileio.c [WINDOWSNT]: Include w32.h.
5340 * dispnew.c [WINDOWSNT]: Include w32.h.
5342 * cygw32.c (Fcygwin_convert_path_to_windows)
5343 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5344 Lisp_Object values. (Bug#12661)
5346 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5347 to Lisp_Object. (Bug#12661)
5349 2012-10-17 Kenichi Handa <handa@gnu.org>
5351 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5354 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5356 * buffer.c (Fkill_buffer): When unchaining the marker,
5357 reset its buffer pointer to NULL (Bug#12652).
5359 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5361 Do not verify indirection counters of killed buffers (Bug#12579).
5362 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5363 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5365 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5367 * alloc.c (Fmake_byte_code): Fix typo in comment.
5368 * print.c (print_interval): Define as static to match prototype.
5369 * indent.c (disptab_matches_widthtab, recompute_width_table):
5372 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5374 * editfns.c (get_system_name): Remove.
5375 * lisp.h (get_system_name): Remove prototype.
5376 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5377 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5379 2012-10-15 Daniel Colascione <dancol@dancol.org>
5381 * dbusbind.c: Add comment explaining reason for previous change.
5383 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5385 * window.c (Fwindow_end): Rewrite check whether cached position
5386 can be used (Bug#12600).
5387 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5388 Set windows_or_buffers_changed.
5390 2012-10-15 Daniel Colascione <dancol@dancol.org>
5392 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5393 enabled by undefining the symbol "interface", which the platform
5394 headers define to something incompatible.
5396 2012-10-14 Daniel Colascione <dancol@dancol.org>
5398 * image.c (init_tiff_functions, init_imagemagick_functions)
5399 (init_svg_functions): Fix cygw32 build break by using these
5400 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5402 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5404 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5406 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5408 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5410 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5412 * coding.c (detect_coding): Set coding->id before calling
5415 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5417 * fileio.c: Formatting fixes.
5419 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5421 Fix some stat-related races.
5422 * fileio.c (Fwrite_region): Avoid race condition if a file is
5423 removed or renamed by some other process immediately after Emacs
5424 writes it but before Emacs stats it. Do not assume that stat (or
5426 * image.c (slurp_file): Resolve the file name with fopen + fstat
5427 rather than stat + fopen.
5428 (pbm_read_file) [0]: Remove unused code with stat race.
5429 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5430 Remove ineffective code with stat race.
5432 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5434 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5436 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5438 * nsterm.m (hold_event_q): New static variable.
5439 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5441 (hold_event): New function.
5442 (ns_read_socket): If hold_event_q have events, store them and
5444 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5445 is zero (Bug#12384).
5447 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5449 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5451 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5453 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5455 * fileio.c (check_existing): New function.
5456 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5457 instead of calling 'stat', when what's needed is to check whether
5458 a file exists. This avoids expensive system calls on MS-Windows.
5461 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5463 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5464 determine whether a file exists and is not a directory.
5466 * lisp.h (check_existing): Add prototype.
5468 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5470 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5472 2012-10-12 Glenn Morris <rgm@gnu.org>
5474 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5476 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5478 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5480 * eval.c (Fautoload): Remember previous autoload status in load-history.
5482 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5484 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5485 * lread.c (load_each_byte, new_backquote_flag, readchar)
5486 (read_filtered_event, lisp_file_lexically_bound_p)
5487 (safe_to_load_version, Fload, complete_filename_p, openp)
5488 (build_load_history, readevalloop, read_escape, read1)
5489 (string_to_number, read_vector, read_list):
5490 * macros.c (Fstart_kbd_macro):
5491 * marker.c (CONSIDER):
5492 * menu.c (parse_single_submenu, digest_single_submenu)
5493 (find_and_return_menu_selection, Fx_popup_menu):
5494 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5496 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5498 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5499 (xmenu_show, xdialog_show):
5500 Use bool for booleans.
5501 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5502 as it's not a predicate. All uses changed. Omit unnecessary
5505 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5507 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5508 (save_excursion_restore): Do not restore mark if it was not saved.
5510 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5512 * marker.c (cached_modiff): EMACS_INT, not int.
5514 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5515 instead of having a wrong decl.
5516 * nsmenu.m (waiting_for_input): Remove wrong decl.
5518 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5520 keyboard.c, keymap.c: Use bool for booleans.
5521 * dispnew.c (sit_for): Distinguish between 3-way display_option
5522 and boolean do_display.
5523 * keyboard.c (single_kboard, this_command_key_count_reset)
5524 (waiting_for_input, echoing, immediate_quit, input_pending)
5525 (interrupt_input, interrupts_deferred, pop_kboard)
5526 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5527 (command_loop_1, adjust_point_for_property)
5528 (safe_run_hooks_error, input_polling_used, read_char):
5529 (help_char_p, readable_events, kbd_buffer_events_waiting)
5530 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5531 (lucid_event_type_list_p, get_input_pending):
5532 (gobble_input, menu_separator_name_p, menu_bar_item)
5533 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5534 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5535 (keyremap_step, test_undefined, read_key_sequence)
5536 (detect_input_pending, detect_input_pending_ignore_squeezables)
5537 (detect_input_pending_run_timers, requeued_events_pending_p)
5538 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5539 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5540 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5541 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5542 (accessible_keymaps_1, Fkey_description, push_key_description):
5543 (shadow_lookup, struct where_is_internal_data)
5544 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5545 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5546 (describe_map, describe_vector):
5547 * menu.c (single_menu_item):
5548 * nsmenu.m (ns_update_menubar):
5549 * process.c (wait_reading_process_output):
5550 * search.c (scan_buffer, scan_newline):
5551 Use bool for boolean.
5552 * keyboard.c (timers_run, swallow_events)
5553 (detect_input_pending_run_timers):
5554 * process.c (wait_reading_process_output):
5555 Use unsigned for counter where wraparound-on-overflow is desired,
5556 since unsigned is guaranteed to have that behavior and signed is not.
5557 (read_char): Use ptrdiff_t for string length.
5558 (get_input_pending): Remove first argument, since it was always
5559 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5560 and behave as if it had that value. Return new value of
5561 input_pending. All callers changed.
5562 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5563 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5565 * keymap.c (push_key_description): Omit last arg, which was always 1.
5566 All callers changed.
5568 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5570 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5572 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5573 ($(BLD)/term.$(O)): Update dependencies.
5575 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5577 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5578 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5579 initializer for PVEC_NORMAL_VECTOR.
5581 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5583 Clean out old termopts cruft.
5584 * termopts.h (flow_control, meta_key): Remove unused decls.
5585 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5586 Don't include termopts.h.
5588 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5590 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5592 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5594 * commands.h (immediate_quit): Remove duplicate decl.
5596 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5598 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5600 (nsfont_open): Remove setting of Vfonts_in_cache.
5601 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5603 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5605 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5606 match what GetLastError returns. Explain why the function is
5609 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5610 'is_tooltip_frame', to avoid confusion with its global namesake.
5612 2012-10-08 Daniel Colascione <dancol@dancol.org>
5614 * xdisp.c (start_hourglass): Call w32_note_current_window when
5615 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5616 build that caused Emacs to display the hourglass cursor forever.
5618 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5619 which is broken under remote desktop, calculate the number of
5620 colors available for a display based on the display's number of
5621 planes and number of bits per pixel per plane. (bug#10397).
5623 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5625 * nsfont.m (Vfonts_in_cache): New variable.
5626 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5627 are used. Add cached fonts to Vfonts_in_cache.
5628 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5630 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5632 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5634 (FONT_H): Define after FRAME_H.
5635 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5636 Update dependencies.
5638 * w32term.c: Remove leftover declaration of keyboard_codepage.
5640 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5642 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5643 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5644 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5645 (GLOBAL_SOURCES): Add cygw32.c.
5646 ($(BLD)/unexw32.$(O)):
5648 ($(BLD)/w32console.$(O)):
5649 ($(BLD)/w32fns.$(O)):
5650 ($(BLD)/w32heap.$(O)):
5651 ($(BLD)/w32menu.$(O)):
5652 ($(BLD)/w32proc.$(O)): Add w32common.h.
5654 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5656 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5658 2012-10-08 Daniel Colascione <dancol@dancol.org>
5660 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5661 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5662 accidental message numbering hole. Change other messages to
5665 * w32select.h (HAVE_W32SELECT): Remove.
5667 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5668 w32common.h instead of w32heap.h.
5670 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5671 (get_allocation_unit, get_processor_type, get_w32_major_version)
5672 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5673 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5674 (OS_NT, os_subtype, cache_system_info): Move declarations to
5677 * w32heap.c: Include w32common.h.
5678 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5679 (w32_minor_version, w32_build_number, w32_subtype):
5680 Remove duplicate definitions.
5682 * w32fns.c: Include w32common.h; include w32heap.h only in
5685 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5686 Use `report_file_error' instead of `error' in order to better
5687 inform users of what went wrong. Increase NTGUI_UNICODE file
5688 dialog box file name length to 32k, the maximum allowed by the NT
5691 * w32common.h: New file.
5692 (ROUND_UP, ROUND_DOWN, get_page_size)
5693 (get_allocation_unit, get_processor_type, get_w32_major_version)
5694 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5695 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5696 (OS_NT, os_subtype, cache_system_info): Move here.
5698 * unexw32.c, unexcw.c: Include w32common.h.
5700 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5701 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5702 to call syms_of_w32select.
5704 * cygw32.h: Remove obsolete EXFUN declarations.
5706 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5708 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5709 of w32inevt.o from SOME_MACHINE_OBJECTS.
5711 2012-10-08 Daniel Colascione <dancol@dancol.org>
5713 * image.c: Permanent fix for JPEG compilation issue --- limit
5714 jpeglib `boolean' redefinition to Cygwin builds.
5716 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5718 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5720 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5723 2012-10-08 Daniel Colascione <dancol@dancol.org>
5725 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5726 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5727 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5728 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5729 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5730 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5731 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5732 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5733 now a supported configuration.
5735 * Makefile.in: consolidate image variables into LIBIMAGE; add
5736 W32_OBJ and W32_LIBS. Compile new files.
5739 (_DebPrint) declare tracing facility for W32 debugging. We need
5740 to unify tracing later.
5742 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5743 unconditional use of W32 Unicode functions. Cygwin runs only on
5744 100% Unicode operating systems.
5746 * cygw32.c: New file. Define Cygwin-specific facilities.
5747 (Fcygwin_convert_path_to_windows)
5748 (Fcygwin_convert_path_from_windows): New user functions for
5749 accessing Cygwin path-munging routines.
5751 * cygw32.h: New file.
5752 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5753 UTF-16LE strings temporarily inside non-Lisp-visible string
5756 (w32_strerror): Just what it says on the tin.
5758 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5759 also run for Cygwin; both systems have the same problem with using
5760 GUI facilities in a forked child. Also call syms_of_cygw32,
5761 syms_of_w32select in correct places.
5763 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5764 needs fork-then-exec for daemon launching.
5766 * font.h: Include frame.h.
5768 * image.c: Use the image library cache machinery only when we're
5769 compiling for native WINDOWSNT; Cygwin can use shared libraries
5770 like any other Unixlike system.
5772 * keyboard.c: Clarify a comment regarding the input loop.
5774 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5775 functions directly instead of trying to detect at runtime that our
5776 host operating system supports them. We make this change for two
5777 reasons: Cygwin lacks support for the multibyte character
5778 conversion functions used by the legacy menu code, and Cygwin
5779 never needs to rely on non-Unicode APIs.
5781 * unexw32.c (hinst): Declare extern.
5783 * w32.c: Change header order;
5784 (w32_strerror): Move to w32fns.c because we need it for
5785 non-WINDOWSNT builds.
5787 * w32.h: Add #error macro to make sure we don't include w32.h for
5788 Cygwin builds. Remove w32select declarations.
5790 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5791 w32fns.c. w32console.c is WINDOWSNT-only.
5793 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5794 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5796 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5797 (w32_major_version, w32_minor_version, w32_build_number)
5798 (os_subtype, sound_type): Define here
5799 (w32_defined_color): Make color parameter const for consistency
5800 with other _defined_color functions.
5801 (w32_createwindow): Unconditionally call w32_init_class instead of
5802 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5803 through the code is complex and unnecessary because class
5804 registration is practically free.
5805 (w32_name_of_message): New EMACSDEBUG-only function.
5806 (Fset_message_beep): Move here
5807 (Fx_open_connection): Require that the display name for Windows be
5808 "w32" for consistency, emacsclient disambiguation, and maybe, one
5809 day, multi-window-system support.
5810 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5811 Cygwin files for W32 GUI facilities, since these clearly don't
5812 expect Cygwin names.
5813 (_DebPrint): Define.
5814 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5815 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5816 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5817 (w32_last_error): Remove.
5819 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5821 * w32heap.c (syspage_mask): Declare here.
5822 (cache_system_info): Remove.
5824 * w32inevt.c (faked_key): Define globally, not statically.
5825 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5826 (w32_console_toggle_lock_key): Move to w32fns.c.
5828 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5830 * w32proc.c (_DebPrint): Move to w32fns.c.
5831 * w32select.c: Include string.h, stdio.h for Cygwin.
5832 * w32select.h: New File.
5834 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5836 (w32_message_fd): New variable. Under Cygwin, holds the file
5837 descriptor the system used to tell us about pending thread
5840 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5841 that prevented compilation under non-WINDOWSNT systems.
5843 (w32_initialize): Open /dev/windows and assign it to
5844 w32_message_fd. Provide w32 feature.
5846 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5847 (WM_EMACS_INPUT_READY): add.
5848 (prepend_msg, w32_message_fd): Declare globally.
5851 (keyboard_handle): Use only when WINDOWSNT.
5852 (notify_msg_ready): New function. Posts a message to the main
5853 thread's message queue under CYGWIN, which wakes up the main
5854 thread from select(2) by making the /dev/windows file descriptor
5855 ready. Under WINDOWSNT, it sets an event the same way the old
5858 (post, prepend_msg): Actually call notify_msg_ready instead of
5859 setting the input event directly.
5861 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5863 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5864 but it still has blocs in it, don't return it to the system,
5865 instead of aborting. (Bug#12402)
5867 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5869 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5871 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5872 MAC_OS_X_VERSION_10_6.
5873 (syms_of_nsterm): Remove comment about Panther and above for
5875 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5876 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5877 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5879 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5880 MAC_OS_X_VERSION_10_4.
5882 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5883 MAC_OS_X_VERSION_10_2.
5885 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5887 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5888 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5890 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5891 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5892 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5893 Remove ns_in_resize check.
5894 (ns_clear_frame_area): Remove resize handle code.
5896 * nsfns.m (ns_in_resize): Remove.
5897 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5898 Remove ns_in_resize check.
5900 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5902 Improve sys_siglist detection.
5903 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5904 defined as a macro, as is done in Solaris.
5905 (sys_siglist_entries): New macro.
5906 (save_strsignal): Use it.
5907 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5908 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5910 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5912 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5913 fullscreen/Fullscreen.
5915 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5916 tobar_height is new.
5918 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5919 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5920 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5921 (windowDidResize:): Check for correct window if old style fullscreen.
5922 Capitalize word in comment. Remove incorrect comment.
5923 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5924 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5925 error in drawing background.
5926 (toggleFullScreen:): Remove comment. Rearrange calls.
5927 Set toolbar values to zero, save old height in tobar_height.
5928 Restore tool bar height when leaving fullscreen.
5929 (canBecomeMainWindow): New function.
5931 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5933 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5935 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5937 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5939 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5940 that time stamps of directories could also be changed.
5941 Don't request the too broad GENERIC_WRITE, only the more restrictive
5942 FILE_WRITE_ATTRIBUTES access rights.
5944 * fileio.c (Fset_file_times): Special-case ignoring errors for
5945 directories only on MSDOS, not on MS-Windows.
5947 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5949 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5951 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5953 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5954 see whether CreateFile failed.
5956 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5958 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5959 to avoid similar races.
5960 * keyboard.c (pending_signals): Now bool, not int.
5962 Port timers to OpenBSD, plus check for timer failures.
5963 OpenBSD problem reported by Han Boetes.
5964 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5966 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5967 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5968 like OpenBSD, which has timer_settime but does not declare it.
5969 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5970 whether to use itimerspec-related primitives. All uses of
5971 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5973 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5975 * profiler.c (handle_profiler_signal): Fix a malloc race
5976 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5978 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5980 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5982 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5984 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5985 consistent with the change in return value of 'safe_strsignal'.
5987 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5989 Prefer plain 'static' to 'static inline' (Bug#12541).
5990 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5991 (bidi_set_sor_type, bidi_push_embedding_level)
5992 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5993 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5994 (bidi_cache_search, bidi_cache_ensure_space)
5995 (bidi_cache_iterator_state, bidi_cache_find)
5996 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5997 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5998 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5999 Now 'static', not 'static inline'.
6001 Count overruns when profiling; change units to ns.
6002 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6003 Give extra weight to samples after overruns, to attempt to count
6004 the time more accurately.
6005 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6006 the underlying primitives nominally do ns.
6007 (Fprofiler_cpu_start): Document the change. Mention that
6008 the sampling intervals are only approximate.
6010 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6012 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6014 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6015 case for the special 0 coding-system.
6017 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6018 (Fmake_overlay): Remove redundant tests.
6019 (fix_start_end_in_overlays): Remove redundant recentering.
6021 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
6023 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6024 Update dependencies.
6026 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6028 Fix a malloc race condition involving strsignal.
6029 A signal can arrive in the middle of a malloc, and Emacs's signal
6030 handler can invoke strsignal, which can invoke malloc, which is
6031 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6032 Fix it by altering the signal handler so that it does not invoke
6034 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6035 * process.c (status_message): Use const pointer, in case strsignal
6036 is #defined to safe_strsignal.
6037 * sysdep.c (sys_siglist, init_signals): Always define and
6038 initialize a substitute sys_siglist if the system does not define
6039 one, even if HAVE_STRSIGNAL.
6040 (safe_strsignal): Rename from strsignal. Always define,
6041 using sys_siglist. Return a const pointer.
6042 * syssignal.h (safe_strsignal): New decl.
6043 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6045 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6047 * w32proc.c (timer_loop): Fix code that waits for timer
6048 expiration, to avoid high CPU usage.
6050 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6052 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6053 (sweep_weak_table): Remove redundant prototypes.
6055 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6057 * emacs.c: Move the inclusion of TERM_HEADER after including
6058 windows.h on WINDOWSNT. This avoids compilation problems with
6061 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6063 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6064 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6065 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6066 as the previous version used 'void *'.
6068 * ralloc.c (ROUNDUP): Fix last change.
6069 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6072 * w32proc.c <disable_itimers>: New static flag.
6073 (init_timers): Initialize it to zero, after creating the critical
6074 sections used by the timer threads.
6075 (term_timers): Set to 1 before deleting the critical sections.
6076 (getitimer, setitimer): If disable_itimers is non-zero, return an
6077 error indication without doing anything. Reported by Fabrice
6078 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6079 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6081 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6084 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6085 term_ntproc after all the other bookkeeping, to get timers working
6086 as long as possible.
6088 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6090 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6091 Suggested by Juri Linkov in
6092 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6094 Prefer plain 'static' to 'static inline' (Bug#12541).
6095 With static functions, modern compilers inline pretty well by
6096 themselves; advice from programmers often hurts as much as it helps.
6097 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6098 this change shrinks the text size of the Emacs executable by 1.1%
6099 without affecting CPU significantly in my benchmark.
6100 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6101 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6102 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6103 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6104 (bset_auto_fill_function, bset_auto_save_file_format)
6105 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6106 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6107 (bset_cache_long_line_scans, bset_case_fold_search)
6108 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6109 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6110 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6111 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6112 (bset_header_line_format, bset_indicate_buffer_boundaries)
6113 (bset_indicate_empty_lines, bset_invisibility_spec)
6114 (bset_left_fringe_width, bset_major_mode, bset_mark)
6115 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6116 (bset_name, bset_overwrite_mode, bset_pt_marker)
6117 (bset_right_fringe_width, bset_save_length)
6118 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6119 (bset_scroll_up_aggressively, bset_selective_display)
6120 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6121 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6122 (set_buffer_overlays_after):
6123 * category.c (bset_category_table):
6124 * charset.c (read_hex):
6125 * coding.c (produce_composition, produce_charset)
6126 (handle_composition_annotation, handle_charset_annotation)
6128 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6129 (assign_row, set_frame_matrix_frame, make_current)
6131 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6132 * fns.c (maybe_resize_hash_table):
6133 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6134 * gmalloc.c (register_heapinfo):
6135 * image.c (lookup_image_type):
6136 * intervals.c (set_interval_object, set_interval_left)
6137 (set_interval_right, copy_interval_parent, rotate_right)
6138 (rotate_left, balance_possible_root_interval):
6139 * keyboard.c (kset_echo_string, kset_kbd_queue)
6140 (kset_keyboard_translate_table, kset_last_prefix_arg)
6141 (kset_last_repeatable_command, kset_local_function_key_map)
6142 (kset_overriding_terminal_local_map, kset_real_last_command)
6143 (kset_system_key_syms, clear_event, set_prop):
6144 * lread.c (digit_to_number):
6145 * marker.c (attach_marker, live_buffer, set_marker_internal):
6146 * nsterm.m (ns_compute_glyph_string_overhangs):
6147 * process.c (pset_buffer, pset_command)
6148 (pset_decode_coding_system, pset_decoding_buf)
6149 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6150 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6151 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6152 * syntax.c (bset_syntax_table, dec_bytepos):
6153 * terminal.c (tset_param_alist):
6154 * textprop.c (interval_has_some_properties)
6155 (interval_has_some_properties_list):
6156 * window.c (wset_combination_limit, wset_dedicated)
6157 (wset_display_table, wset_hchild, wset_left_fringe_width)
6158 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6159 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6160 (wset_right_fringe_width, wset_right_margin_cols)
6161 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6162 (wset_vertical_scroll_bar_type, wset_window_parameters):
6163 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6164 (wset_column_number_displayed, wset_region_showing)
6165 (window_box_edges, run_window_scroll_functions)
6166 (append_glyph_string_lists, prepend_glyph_string_lists)
6167 (append_glyph_string, set_glyph_string_background_width)
6168 (append_glyph, append_composite_glyph)
6169 (take_vertical_position_into_account):
6170 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6171 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6172 (lface_hash, lface_same_font_attributes_p, lookup_face):
6173 * xml.c (libxml2_loaded_p):
6174 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6175 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6176 Now 'static', not 'static inline'.
6179 (bidi_copy_it): Do the whole copy with a single memcpy.
6180 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6182 Revert the FOLLOW-SYMLINKS change for file-attributes.
6183 Doing it right would require several changes to Tramp, and there's
6184 not enough time to get that tested before the freeze today.
6185 * dired.c (directory_files_internal, Ffile_attributes):
6188 * frame.c (x_report_frame_params): Port better to wider ints.
6189 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6190 or that pointers can be printed in 15 decimal digits.
6191 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6193 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6195 Support x64 build on MS-Windows.
6196 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6197 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6198 compatibility with x64.
6199 (x_get_focus_frame): Add prototype.
6201 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6202 defining an XRectangle structure.
6204 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6205 arithmetics for compatibility with x64.
6207 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6208 compatibility with x64.
6210 * w32heap.h: Adjust prototypes and declarations.
6212 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6213 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6214 DWORD, long, and unsigned long, for compatibility with x64.
6215 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6216 (sbrk): Argument is now of type ptrdiff_t.
6218 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6220 (w32_msg_pump): Use WPARAM type for 'result'.
6222 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6224 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6225 compatibility with x64.
6227 * vm-limit.c (lim_data): Now size_t.
6228 (check_memory_limits): Adjust prototypes of real_morecore and
6229 __morecore to receive argument of type ptrdiff_t. Use size_t for
6230 five_percent and data_size.
6232 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6233 variables, for compatibility with x64.
6234 (rva_to_section, offset_to_section, relocate_offset)
6235 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6236 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6237 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6238 for compatibility with x64.
6240 * sysdep.c (STDERR_FILENO): Define if not already defined.
6242 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6243 (__morecore): Argument type is now ptrdiff_t.
6244 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6245 (relinquish): Use ptrdiff_t type for 'excess'.
6246 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6248 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6249 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6250 instead of a literal number.
6252 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6253 (min): Define only if not already defined.
6255 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6256 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6259 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6260 'bitmaps' is a pointer.
6262 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6264 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6266 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6268 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6269 * dired.c (directory_files_internal, Ffile_attributes):
6270 New arg follow_symlinks. All uses changed.
6272 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6274 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6276 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6278 Support atimers and CPU profiler via profile.c on MS-Windows.
6279 * w32proc.c (sig_mask, crit_sig): New static variables.
6280 (sys_signal): Support SIGALRM and SIGPROF.
6281 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6282 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6283 sigfillset, and sigprocmask are no longer no-ops.
6284 (sigismember): New function.
6285 (struct itimer_data): New definition.
6286 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6287 (crit_prof): New static variables.
6288 (MAX_SINGLE_SLEEP): New definition.
6289 (timer_loop, stop_timer_thread, term_timers, init_timers)
6290 (start_timer_thread, getitimer, setitimer): New functions.
6291 (alarm): No longer a no-op, calls setitimer.
6293 * w32.c (term_ntproc): Call term_timers.
6294 (init_ntproc): Make sure all signals are unblocked at startup, to
6295 erase any traces of dumping. Call init_timers.
6297 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6298 Windows-specific code to display the hourglass mouse pointer is no
6300 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6301 to hourglass timer expiration.
6302 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6303 Remove, no longer used.
6304 (w32_note_current_window, show_hourglass, hide_hourglass):
6305 New functions, in support of hourglass cursor display similar to other
6307 (syms_of_w32fns): Don't initialize hourglass_timer.
6309 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6311 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6313 * w32.h (init_timers, term_timers): Add prototypes.
6315 2012-09-30 Kenichi Handa <handa@gnu.org>
6317 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6318 to the buffer relocation which may be caused by ccl_driver.
6320 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6322 * xfns.c (Fx_file_dialog): Update comment.
6324 * w32fns.c (Fx_file_dialog): Update comment.
6326 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6327 Initialize panel name field if OSX >= 10.6.
6329 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6331 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6333 * nsterm.m (NEW_STYLE_FS): New define.
6334 (ns_fullscreen_hook, windowWillEnterFullScreen)
6335 (windowDidEnterFullScreen, windowWillExitFullScreen)
6336 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6337 (setFSValue): New functions.
6338 (EmacsFSWindow): New implementation.
6339 (canBecomeKeyWindow): New function for EmacsFSWindow.
6340 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6341 (dealloc): Release nonfs_window if in fullscreen.
6342 (updateFrameSize:): Call windowDidMove to update top/left.
6343 (windowWillResize:toSize:): Check if frame is still maximized.
6344 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6345 next_maximized, maximized_width, maximized_height and nonfs_window.
6346 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6348 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6349 fullscreen. Set maximized_width/height. Act on next_maximized.
6351 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6352 (EmacsView): Add variables for fullscreen.
6353 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6354 (EmacsFSWindow): New interface for fullscreen.
6356 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6358 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6360 2012-09-30 Chong Yidong <cyd@gnu.org>
6362 * fns.c (Frandom): Doc fix.
6364 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6366 * window.c (Vwindow_combination_limit): New default value.
6367 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6369 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6371 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6372 Suggested by Eli Zaretskii in
6373 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6375 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6377 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6378 HAVE_TIMER_SETTIME is defined.
6380 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6382 Profiler improvements: more-accurate timers, overflow checks.
6383 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6384 signal.h, setjmp.h. Include systime.h instead.
6385 (saturated_add): New function.
6386 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6387 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6388 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6390 (enum profiler_cpu_running): New enum.
6391 (profiler_cpu_running): Now of that enum type, not bool.
6392 All uses changed to store the new value.
6393 (handle_profiler_signal): Rename from sigprof_handler_1,
6394 for consistency with other handlers. Do not check whether
6395 cpu_log is a hash-table if garbage collecting, since it
6396 doesn't matter in that case.
6397 (deliver_profiler_signal): Rename from sigprof_handler,
6398 for consistency with other handlers.
6399 (setup_cpu_timer): New function, with much of what used to be in
6400 Fprofiler_cpu_start. Check for out-of-range argument.
6401 Prefer timer_settime if available, and prefer
6402 thread cputime clocks, then process cputime clocks, then
6403 monotonic clocks, to the old realtime clock. Use make_timeval
6404 to round more-correctly when falling back to setitimer.
6405 (Fprofiler_cpu_start): Use it.
6406 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6407 Don't assume that passing NULL as the 2nd argument of setitimer
6408 is the same as passing a pointer to all-zero storage.
6409 Ignore SIGPROF afterwards.
6410 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6411 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6412 non-fatal signal handlers. Ignore SIGPROF on startup.
6413 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6414 in profiler.c, since sysdep.c now uses it.
6416 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6417 Suggested by Eli Zaretskii in
6418 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6420 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6422 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6424 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6426 * lisp.h (struct backtrace): Remove indirection for `function' field.
6427 * xdisp.c (redisplay_internal):
6428 * profiler.c (record_backtrace, sigprof_handler_1):
6429 * alloc.c (Fgarbage_collect):
6430 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6431 (Fbacktrace_frame): Adjust accordingly.
6433 2012-09-28 Glenn Morris <rgm@gnu.org>
6435 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6436 (Frun_hook_with_args_until_failure): Doc fixes.
6438 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6440 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6441 Qautomatic_redisplay and change the symbol name. All users changed.
6443 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6445 * profiler.c (sigprof_handler): Fix race condition.
6447 2012-09-28 Glenn Morris <rgm@gnu.org>
6449 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6451 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6453 Check more robustly for timer_settime.
6454 * Makefile.in (LIB_TIMER_TIME): New macro.
6456 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6457 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6460 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6462 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6464 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6466 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6468 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6470 * character.h (MAYBE_UNIFY_CHAR): Remove.
6471 * charset.c, charset.h (maybe_unify_char): Now static.
6472 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6473 Since this stuff is now private to charset.c, there's no need for
6474 a public macro and no need to inline by hand.
6476 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6477 Stefan Monnier <monnier@iro.umontreal.ca>
6478 Juanma Barranquero <lekktu@gmail.com>
6480 * profiler.c: New file.
6481 * Makefile.in (base_obj): Add profiler.o.
6482 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6483 ($(BLD)/profiler.$(O)): New target.
6484 * emacs.c (main): Call syms_of_profiler.
6485 * alloc.c (Qautomatic_gc): New constant.
6486 (MALLOC_PROBE): New macro.
6487 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6488 (total_bytes_of_live_objects): New function.
6489 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6490 Call malloc_probe for the memory profiler.
6491 (syms_of_alloc): Define Qautomatic_gc.
6492 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6494 (struct backtrace): Move definition...
6495 * lisp.h (struct backtrace): ..here.
6496 (Qautomatic_gc, profiler_memory_running): Declare vars.
6497 (malloc_probe, syms_of_profiler): Declare functions.
6498 * xdisp.c (Qautomatic_redisplay): New constant.
6499 (redisplay_internal): Record itself in backtrace_list.
6500 (syms_of_xdisp): Define Qautomatic_redisplay.
6502 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6503 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6505 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6507 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6509 Prefer POSIX timers if available.
6510 They avoid a race if the timer is too close to the current time.
6511 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6512 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6513 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6515 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6517 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6518 CHAR_STRING_ADVANCE.
6519 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6520 STRING_CHAR_ADVANCE.
6522 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6524 Move Vlibrary_cache to emacs.c and reset before dumping.
6526 * lisp.h (reset_image_types): Declare.
6527 [WINDOWSNT] (Vlibrary_cache): Declare.
6529 * image.c (reset_image_types): New function.
6531 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6532 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6533 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6535 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6536 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6538 * w32.h (Vlibrary_cache): Do not declare.
6540 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6542 * w32proc.c (sys_signal): Handle all signals defined by the
6543 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6544 handlers for signals supported by Windows. Don't override
6545 term_ntproc as the handler for SIGABRT.
6546 (sigaction): Rewrite to call sys_signal instead of duplicating its
6548 (sys_kill): Improve commentary.
6550 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6551 consistency with a signature of a signal handler. All callers
6553 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6554 install term_ntproc as a signal handler for SIGABRT, as that
6555 should be done by the dumped Emacs.
6557 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6559 * w32select.c (term_w32select): Protect against repeated
6560 invocation by setting clipboard_owner to NULL after calling
6563 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6564 and term_ntproc to their modified signatures.
6566 * character.c (char_string, string_char): Remove calls to
6567 MAYBE_UNIFY_CHAR. See the discussion starting at
6568 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6571 2012-09-25 Chong Yidong <cyd@gnu.org>
6573 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6575 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6577 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6578 when encountering an unknown bytecode.
6580 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6582 image.c, indent.c: Use bool for booleans.
6583 * dispextern.h (struct image_type): Members valid_p, load, init
6584 now return bool, not int. All uses changed.
6585 * image.c: Omit unnecessary static decls.
6586 (x_create_bitmap_mask, x_build_heuristic_mask):
6587 Return void, not int, since callers don't care about the return value.
6588 (x_create_bitmap_mask, define_image_type, valid_image_p)
6589 (struct image_keyword, parse_image_spec, image_spec_value)
6590 (check_image_size, image_background)
6591 (image_background_transparent, x_clear_image_1)
6592 (postprocess_image, lookup_image, x_check_image_size)
6593 (x_create_x_image_and_pixmap, xbm_image_p)
6594 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6595 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6596 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6597 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6598 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6599 (png_image_p, init_png_functions, png_load_body, png_load)
6600 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6601 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6602 (init_gif_functions, gif_load, imagemagick_image_p)
6603 (imagemagick_load_image, imagemagick_load, svg_image_p)
6604 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6606 * nsimage.m (ns_load_image):
6607 * nsterm.m (ns_defined_color):
6608 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6609 * xfns.c (x_defined_color):
6610 * xterm.c (x_alloc_lighter_color_for_widget)
6611 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6612 (x_alloc_lighter_color):
6613 * indent.c (disptab_matches_widthtab, current_column)
6614 (scan_for_column, string_display_width, indented_beyond_p)
6615 (compute_motion, vmotion, Fvertical_motion):
6616 Use bool for booleans.
6618 2012-09-24 Chong Yidong <cyd@gnu.org>
6620 * chartab.c (Fset_char_table_default): Obsolete function removed.
6622 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6624 Move pid_t related decls out of lisp.h.
6625 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6626 (interruptible_wait_for_termination):
6627 Move these decls from lisp.h to syswait.h, since they use pid_t.
6628 Needed on FreeBSD; see Herbert J. Skuhra in
6629 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6630 * callproc.c: Include syswait.h.
6632 gnutls.c, gtkutil.c: Use bool for boolean.
6633 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6634 (emacs_gnutls_handle_error):
6635 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6636 (xg_hide_tooltip, xg_create_frame_widgets)
6637 (create_dialog, xg_uses_old_file_dialog)
6638 (xg_get_file_with_chooser, xg_get_file_with_selection)
6639 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6640 (xg_item_label_same_p, xg_update_menubar)
6641 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6642 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6643 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6644 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6645 (update_frame_tool_bar, free_frame_tool_bar):
6646 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6647 * nsmenu.m (ns_update_menubar):
6648 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6649 * xfns.c (Fx_show_tip) [USE_GTK]:
6650 Use bool for boolean.
6651 * gtkutil.c (xg_update_frame_menubar):
6652 * xmenu.c (update_frame_menubar):
6653 Return void, not int, since caller ignores return value.
6654 * gtkutil.c (xg_change_toolbar_position):
6657 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6659 * makefile.w32-in (BLOCKINPUT_H): Remove.
6660 (SYSSIGNAL_H): New macro.
6661 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6662 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6663 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6664 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6665 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6666 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6667 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6668 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6669 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6670 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6671 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6672 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6673 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6674 ($(BLD)/w32xfns.$(O)): Update dependencies.
6676 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6678 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6679 fatal_error_backtrace.
6681 * w32proc.c (sys_kill): Undo last change: don't do anything when
6682 invoked to deliver SIGABRT to our own process. This is now
6683 handled by emacs_raise.
6685 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6687 * w32term.c (w32_read_socket): Remove leftover reference to
6688 interrupt_input_pending.
6690 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6692 Do not use SA_NODEFER.
6693 Problem reported by Dani Moncayo in
6694 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6696 * sysdep.c (emacs_abort): Do not reset signal handler.
6697 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6698 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6699 wanted even on POSIXish hosts, and it doesn't work on Windows.
6701 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6703 * xterm.c (x_term_init): Call fixup_locale before and after calling
6704 gtk_init (Bug#12392).
6706 2012-09-23 Chong Yidong <cyd@gnu.org>
6708 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6709 Vdynamic_library_alist.
6711 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6712 (Fgnutls_available_p): Caller changed.
6714 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6715 (Flibxml_parse_xml_region): Likewise.
6717 * dispextern.h (struct image_type): Remove arg from init function.
6719 * image.c (Finit_image_library, lookup_image_type)
6720 (define_image_type): Remove now-unneeded second arg.
6721 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6722 (init_tiff_functions, init_gif_functions, init_svg_functions):
6723 Arglist and w32_delayed_load calling convention changed.
6724 (gs_type): Remove init_gs_functions; there is no such function.
6725 (valid_image_p, make_image): Fix caller to lookup_image_type.
6727 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6729 Simplify and avoid signal-handling races (Bug#12471).
6731 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6732 Avoid recursive loop if there's a fatal error in the function itself.
6733 * atimer.c (pending_atimers):
6734 * blockinput.h: Don't include "atimer.h"; no longer needed.
6735 (interrupt_input_pending): Remove. All uses removed.
6736 pending_signals now counts both atimers and ordinary interrupts.
6737 This is less racy than having three separate pending-signal flags.
6738 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6740 Rename from their upper-case counterparts BLOCK_INPUT,
6741 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6742 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6743 This makes it easier to access volatile variables more accurately.
6744 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6745 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6746 that's more reliable if the code is buggy and sets
6747 interrupt_input_blocked to a negative value. All uses changed.
6748 * atimer.c (deliver_alarm_signal):
6749 Remove. No need to deliver this to the parent; any thread can
6750 handle this signal now. All uses replaced by underlying handler.
6751 * atimer.c (turn_on_atimers):
6752 * dispnew.c (handle_window_change_signal):
6753 * emacs.c (handle_danger_signal):
6754 * keyboard.c (kbd_buffer_get_event):
6755 Don't reestablish signal handler; not needed with sigaction.
6756 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6758 Rework to avoid unnecessary accesses to volatile variables.
6759 (UNBLOCK_INPUT_TO): Now a function.
6760 (totally_unblock_input, unblock_input): New decls.
6761 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6762 (init_data): Remove. Necessary stuff now done in init_signal.
6763 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6764 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6765 (fatal_error_code): Remove; no longer needed.
6766 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6767 it doesn't always backtrace. All uses changed. No need to reset
6768 signal to default, since sigaction and/or die does that for us now.
6769 Use emacs_raise (FOO), not kill (getpid (), FOO).
6770 (main): Check more-accurately whether we're dumping.
6771 Move fatal-error setup to sysdep.c
6772 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6773 * gtkutil.c (xg_get_file_name, xg_get_font):
6774 Remove no-longer-needed signal-mask manipulation.
6775 * keyboard.c, process.c (POLL_FOR_INPUT):
6776 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6777 * keyboard.c (read_avail_input): Remove.
6778 All uses replaced by gobble_input.
6779 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6780 (kbd_buffer_store_event_hold, gobble_input):
6781 (record_asynch_buffer_change) [USABLE_SIGIO]:
6782 (store_user_signal_events):
6783 No need to mess with signal mask.
6784 (gobble_input): If blocking input and there are terminals, simply
6785 set pending_signals to 1 and return. All hooks changed to not
6786 worry about whether input is blocked.
6787 (process_pending_signals): Clear pending_signals before processing
6788 them, in case a signal comes in while we're processing.
6789 By convention callers now test pending_signals before calling us.
6790 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6791 New functions, to support changes to blockinput.h.
6792 (handle_input_available_signal): Now extern.
6793 (reinvoke_input_signal): Remove. All uses replaced by
6795 (quit_count): Now volatile, since a signal handler uses it.
6796 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6797 All callers changed. Block SIGINT only if not already blocked.
6798 Clear sigmask reliably, even if Fsignal returns, which it can.
6799 Omit unnecessary accesses to volatile var.
6800 (quit_throw_to_read_char): No need to restore sigmask.
6801 * keyboard.c (gobble_input, handle_user_signal):
6802 * process.c (wait_reading_process_output):
6803 Call signal-handling code rather than killing ourselves.
6804 * lisp.h: Include <float.h>, for...
6805 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6806 (pending_signals): Now volatile.
6807 (syms_of_data): Now const if IEEE floating point.
6808 (handle_input_available_signal) [USABLE_SIGIO]:
6809 (terminate_due_to_signal, record_child_status_change): New decls.
6810 * process.c (create_process): Avoid disaster if memory is exhausted
6811 while we're processing a vfork, by tightening the critical section
6813 (send_process_frame, process_sent_to, handle_pipe_signal)
6814 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6816 (send_process): No need for setjmp/longjmp any more, since the
6817 SIGPIPE stuff is now gone. Instead, report an error if errno
6819 (record_child_status_change): Now extern. PID and W are now args.
6820 Return void, not bool. All callers changed.
6821 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6822 Remove. All uses removed. This bug should be fixed now in a
6824 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6825 and record the child status change directly. This avoids the
6826 need to futz with the signal mask.
6827 (process_fatal_action): Move here from emacs.c.
6828 (emacs_sigaction_flags): New function, containing
6829 much of what used to be in emacs_sigaction_init.
6830 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6831 caught by emacs, to make races less likely.
6832 (deliver_process_signal): Rename from handle_on_main_thread.
6834 (BACKTRACE_LIMIT_MAX): Now at top level.
6835 (thread_backtrace_buffer, threadback_backtrace_pointers):
6837 (deliver_thread_signal, deliver_fatal_thread_signal):
6838 New functions, for more-accurate delivery of thread-specific signals.
6839 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6840 (deliver_arith_signal): Handle in this thread, not
6841 in the main thread, since it's triggered by this thread.
6842 (maybe_fatal_sig): New function.
6843 (init_signals): New arg DUMPING so that we can be more accurate
6844 about whether we're dumping. Caller changed.
6845 Treat thread-specific signals differently from process-general signals.
6846 Block all signals while handling fatal error; that's safer.
6847 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6849 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6850 Ignore SIGPIPE unless batch.
6851 (emacs_backtrace): Output backtrace for the appropriate thread,
6852 which is not necessarily the main thread.
6853 * syssignal.h: Include <stdbool.h>.
6854 (emacs_raise): New macro.
6855 * xterm.c (x_connection_signal): Remove; no longer needed
6856 now that we use sigaction.
6857 (x_connection_closed): No need to mess with sigmask now.
6858 (x_initialize): No need to reset SIGPIPE handler here, since
6859 init_signals does this for us now.
6861 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6863 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6864 background rect may be larger (Bug#12245).
6866 2012-09-23 Chong Yidong <cyd@gnu.org>
6868 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6870 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6872 * .gdbinit: Just stop at fatal_error_backtrace.
6873 See Stefan Monnier's request in
6874 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6875 Remove no-longer-used query of system type.
6877 2012-09-22 Chong Yidong <cyd@gnu.org>
6879 * search.c (Freplace_match): Doc fix (Bug#12325).
6881 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6883 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6884 (Fline_end_position): Doc fix.
6886 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6888 2012-09-22 Chong Yidong <cyd@gnu.org>
6890 * dispextern.h (struct image_type): Add new slot, storing a type
6891 initialization function.
6893 * image.c (define_image_type): Call the image initializer function
6894 if it is defined. Arguments and return value changed.
6895 (valid_image_p, make_image): Callers changed.
6896 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6897 (gif_type, imagemagick_type, svg_type, gs_type):
6898 Add initialization functions.
6899 (Finit_image_library): Call lookup_image_type.
6900 (CHECK_LIB_AVAILABLE): Macro deleted.
6901 (lookup_image_type): Call define_image_type here, rather than via
6902 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6903 (syms_of_image): Move define_image_type calls for xbm_type and
6904 pbm_type to lookup_image_type.
6906 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6908 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6909 'idle_timers' from here ...
6910 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6911 lists, to avoid infloops when the timer does something stupid,
6912 like reinvoke itself with the same or smaller time-out.
6915 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6917 * window.c (Fsplit_window_internal): Handle only Qt value of
6918 Vwindow_combination_limit separately.
6919 (Qtemp_buffer_resize): New symbol.
6920 (Vwindow_combination_limit): New default value.
6923 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6925 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6926 the new overlay string. (Bug#10159)
6928 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6930 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6931 or that fprintf is async-signal-safe. POSIX doesn't require
6934 2012-09-22 Chong Yidong <cyd@gnu.org>
6936 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6939 2012-09-22 Kenichi Handa <handa@gnu.org>
6941 * composite.c (composition_reseat_it): Handle the case that a
6942 grapheme cluster is not covered by a single font (Bug#12352).
6944 2012-09-21 Chong Yidong <cyd@gnu.org>
6946 * image.c (define_image_type): Avoid adding duplicate types to
6947 image_types (Bug#12463). Suggested by Jörg Walter.
6949 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6951 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6952 (print_load_command_name): Add case LC_DATA_IN_CODE.
6953 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6955 2012-09-21 Glenn Morris <rgm@gnu.org>
6957 * eval.c (Frun_hook_with_args_until_success)
6958 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6960 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6962 * fileio.c (Ffile_selinux_context): Only call freecon when
6963 lgetfilecon succeeded.
6964 (Fset_file_selinux_context): Likewise. (Bug#12444)
6966 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6968 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6969 reordering, locate the cursor by calling set_cursor_from_row; if
6970 that fails, clear the desired glyph matrix before returning a
6971 failure indication to the caller. Fixes leaving garbled display
6972 when fast scrolling with a down-key. (Bug#12403)
6973 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6974 scrolling through multibyte text.
6976 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6978 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6979 calling mark_vectorlike since that's the one that marks the window.
6980 (mark_discard_killed_buffers): Mark the final cdr.
6981 * window.h (struct window): Move prev/next_buffers to the
6982 non-standard fields.
6983 * window.c (make_window): Initialize prev/next_buffers manually.
6985 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6987 Omit unused arg EXPECTED from socket hooks.
6988 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6989 * nsterm.m (ns_term_init):
6990 * termhooks.h (struct terminal.read_socket_hook):
6991 * w32inevt.c (w32_console_read_socket):
6992 * w32term.c (w32_read_socket):
6993 * xterm.c (XTread_socket):
6994 Omit unused arg EXPECTED. All callers changed.
6995 (store_user_signal_events): Return void, not int, since callers no
6996 longer care about the return value. All uses changed.
6998 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
7000 * w32gui.h (XParseGeometry): Do not declare.
7002 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7004 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7005 Ignore 'expected'. See Eli Zaretskii in
7006 <http://bugs.gnu.org/12471#8> (last line).
7008 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7009 (XParseGeometry): Now static. Substitute extremal values for
7010 values that are out of range.
7012 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7014 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7016 * nsfns.m (XParseGeometry): Remove.
7017 (Fx_create_frame): Call x_set_offset to correctly interpret
7018 top_pos in geometry.
7020 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7021 (Fx_parse_geometry): If there is a space in string, call
7022 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7024 2012-09-17 Eli Zaretskii <eliz@gnu.org>
7026 * search.c (scan_buffer): Use character positions in calls to
7027 region_cache_forward and region_cache_backward, not byte
7028 positions. (Bug#12196)
7030 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7031 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7033 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7034 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7035 emacs_blocked_malloc, now deleted.
7037 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7039 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7040 The workaround was for improving performance on Solaris 2.4, but
7041 is getting in the way now. Emacs will still work if someone is
7042 still running Solaris 2.4 in a museum somewhere; Sun dropped
7043 support for Solaris 2.4 in 2003.
7044 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7045 * process.c (create_process) [HAVE_WORKING_VFORK]:
7046 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7047 since Emacs no longer uses vfork on that platform.
7049 2012-09-17 Glenn Morris <rgm@gnu.org>
7051 * emacs.c: Use COPYRIGHT.
7053 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7055 Remove configure's --without-sync-input option (Bug#12450).
7056 When auditing signal-handling in preparation for cleaning it up,
7057 I found that SYNC_INPUT has race conditions and would be a real
7058 pain to fix. Since it's an undocumented and deprecated
7059 configure-time option, now seems like a good time to remove it.
7060 Also see <http://bugs.gnu.org/11080#16>.
7061 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7062 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7063 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7064 (malloc_hysteresis):
7065 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7066 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7067 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7068 (dont_register_blocks, bytes_used_when_reconsidered)
7069 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7070 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7071 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7072 Remove. All uses removed.
7073 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7074 implementation, one that depends on whether the new macro
7075 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7077 * atimer.c (run_timers, handle_alarm_signal):
7078 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7079 (handle_async_input, process_pending_signals)
7080 (handle_input_available_signal, init_keyboard):
7081 * nsterm.m (ns_read_socket):
7082 * process.c (wait_reading_process_output):
7083 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7084 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7086 * xterm.c (XTread_socket):
7088 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7089 * eval.c (handling_signal): Remove. All uses removed.
7090 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7091 All uses replaced with the SYNC_INPUT version.
7092 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7094 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7097 * font.c (Ffont_shape_gstring): Remove unused local.
7099 2012-09-16 Glenn Morris <rgm@gnu.org>
7101 * Makefile.in (clean): No longer run nextstep's clean.
7103 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7105 (ns-app): Move here from ns.mk, and simplify.
7106 (clean): Simplify nextstep entry.
7107 * ns.mk: Remove file.
7109 2012-09-17 Kenichi Handa <handa@gnu.org>
7111 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7112 not covert the last few charactes.
7114 2012-09-16 Kenichi Handa <handa@gnu.org>
7116 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7117 here, but just check the validity of glyphs in the glyph-string.
7119 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7121 * window.c (Fwindow_parameter, Fset_window_parameter):
7122 Accept any window as argument (Bug#12452).
7124 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7126 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7127 to ns_term_init to avoid memory leak.
7129 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7130 explicit retain/release.
7131 (ns_term_init): Only allow one display. Initialize outerpool and
7134 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7136 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7137 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7138 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7139 the Microsoft problem in a different way, by altering ../nt/config.nt.
7141 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7156 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7157 by lisp.h. This completes removal of setjmp.h inclusion
7158 erroneously announced in the previous commit. (Bug#12446)
7160 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7163 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7164 not defined as a macro. The latter happens on MS-Windows.
7167 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7169 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7170 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7171 Some instances of '#include <setjmp.h>' removed, if the
7172 only reason for the instance was because "lisp.h" was included.
7173 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7174 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7175 and _longjmp with the new symbols. Emacs already uses _setjmp if
7176 available, so this change affects only POSIXish hosts that have
7177 sigsetjmp but not _setjmp, such as some versions of Solaris and
7178 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7179 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7180 (png_load_body) [HAVE_PNG]:
7181 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7182 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7183 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7184 since PNG requires jmp_buf. This is the only exception to the
7185 general rule that we now use sys_setjmp and sys_longjmp.
7186 This exception is OK since this code does not change the signal
7187 mask or longjmp out of a signal handler.
7189 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7191 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7192 Include "syssignal.h", for 'main_thread'.
7194 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7196 Avoid out-of-range marker position (Bug#12426).
7197 * insdel.c (replace_range, replace_range_2):
7198 Adjust markers before overlays, as suggested by comments.
7199 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7200 Remove redundant check before calling offset_intervals.
7202 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7204 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7205 current buffer (Bug#12387).
7207 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7209 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7211 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7213 Use a more backwards-compatible timer format (Bug#12430).
7214 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7215 vector element, not from the 4th, since PSECS is now at the end.
7216 (Fcurrent_idle_time): Doc fix.
7218 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7220 Function to mark objects and remove killed buffers at once.
7221 * alloc.c (discard_killed_buffers): Rename to ...
7222 (mark_discard_killed buffers) ... new name. Add marking
7223 of remaining objects. Fix comment. Adjust users.
7224 (mark_object): Do not touch frame buffer lists here.
7225 * frame.c (delete_frame): Reset frame buffer lists here.
7227 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7229 Better workaround for GNOME bug when --enable-gcc-warnings.
7230 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7231 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7232 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7234 Simplify SIGIO usage (Bug#12408).
7235 The code that dealt with SIGIO was crufty and confusing, e.g., it
7236 played tricks like "#undef SIGIO" but these tricks were not used
7237 consistently. Simplify mostly by not #undeffing standard symbols,
7238 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7239 or not as we please) rather than "defined SIGIO" (standard symbol
7240 that we probably shouldn't #undef).
7241 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7242 Modules that need it can include it.
7243 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7244 * dispextern.h (ignore_sigio): New decl.
7245 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7246 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7247 * emacs.c (shut_down_emacs):
7248 * keyboard.c (kbd_buffer_store_event_hold):
7249 Use ignore_sigio rather than invoking 'signal' directly.
7250 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7252 (FIONREAD, SIGIO): Do not #undef.
7253 (tty_read_avail_input): Use #error rather than a syntax error.
7254 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7255 for I_PIPE, used by SETUP_SLAVE_PTY.
7256 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7257 * sysdep.c (croak): Remove; no longer needed. This bit of
7258 temporary code, with Fred N. Fish's comment that it's temporary,
7259 has been in Emacs since at least 1992!
7260 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7261 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7262 * syssignal.h (croak): Remove decl.
7263 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7264 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7265 now that we're termios-only.
7266 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7267 * term.c (dissociate_if_controlling_tty): Use #error rather than
7270 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7271 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7272 to work around GNOME bug 683906.
7273 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7274 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7275 This works around GCC bug 54561.
7277 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7279 More fixes for 'volatile' and setjmp/longjmp.
7280 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7281 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7282 (png_load_body) [HAVE_PNG]:
7283 (jpeg_load_body) [HAVE_JPEG]:
7284 New function, with most of the old parent function's body.
7285 (png_load) [HAVE_PNG]:
7286 (jpeg_load) [HAVE_JPEG]:
7287 Invoke the new function, to avoid longjmp munging our locals.
7288 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7289 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7290 longjmp is passed 2, as the C standard doesn't guarantee this.
7291 Instead, store the failure code into mgr->failure_code.
7293 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7295 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7296 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7297 (syms_of_keyboard): Remove support for unread-command-char.
7299 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7301 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7302 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7303 violation. (Bug#12426)
7305 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7307 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7309 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7311 * eval.c: Add `inhibit-debugger'.
7312 (Qinhibit_debugger): New symbol.
7313 (call_debugger): Bind it instead of Qdebug_on_error.
7314 (maybe_call_debugger): Test Vinhibit_debugger.
7315 (syms_of_eval): Define inhibit-debugger.
7316 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7317 (syms_of_xdisp): Remove inhibit-debug-on-message.
7319 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7321 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7322 If a nonvolatile local variable is written before a _longjmp to
7323 the frame containing the variable, and is read after the _longjmp,
7324 the value read is indeterminate. Some local variables of type
7325 'struct handler' and 'struct catchtag' are used in this way, so
7326 mark each of their slots as volatile if the slot can be set before
7327 _longjmp and read afterwards.
7328 * lisp.h (struct handler): var and chosen_clause are now volatile.
7329 (struct catchtag): val, next, and pdlcount are now volatile.
7331 * bidi.c (bidi_push_it, bidi_pop_it):
7332 * fns.c (copy_hash_table):
7333 * image.c (define_image_type):
7334 * keyboard.c (kbd_buffer_store_event_hold):
7335 * process.c (Fprocess_send_eof):
7336 * xfaces.c (x_create_gc) [HAVE_NS]:
7337 * xgselect.c (xg_select):
7338 Prefer assignment to memcpy when either will do.
7340 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7341 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7342 time an item is removed. No need to mark this function 'inline';
7343 the compiler knows better than we do.
7345 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7347 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7348 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7349 to change_frame_size (Bug#12388).
7350 (windowDidResize:): Pass YES to updateFrameSize.
7352 * nsterm.h: Add delay parameter to updateFrameSize.
7354 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7356 Discard killed buffers from deleted window and frame objects.
7357 This reduces an amount of references to killed buffers and
7358 helps GC to reclaim them faster.
7359 * alloc.c (discard_killed_buffers): New function.
7360 (mark_object): Use it for deleted windows and frames.
7361 (mark_object): If symbol's value is set up for a killed buffer
7362 or deleted frame, restore its global binding.
7363 * data.c (swap_in_global_binding): Add GC notice.
7364 (swap_in_symval_forwarding): Use convenient set_blv_where.
7365 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7366 * window.h: ... to here.
7368 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7370 Convenient macro to check whether the buffer is live.
7371 * buffer.h (BUFFER_LIVE_P): New macro.
7372 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7373 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7375 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7377 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7378 composition cases (Bug#12364).
7380 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7381 overhang of succeeding glyphs overlapping box cursor.
7383 * w32term.c (x_draw_glyph_string): Likewise.
7385 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7387 Simplify, document, and port floating-point (Bug#12381).
7388 The porting part of this patch fixes bugs on non-IEEE platforms
7389 with frexp, ldexp, logb.
7390 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7392 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7393 support, by removing commented-out code and briefly listing the
7394 C89 functions excluded. The commented-out stuff was confusing
7395 maintenance, e.g., we thought we needed cbrt but it was commented out.
7396 (logb): Remove decl; no longer needed.
7397 (isfinite): New macro, if not already supplied.
7398 (isnan): Don't replace any existing macro.
7399 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7400 are present on all C89 platforms.
7401 (Ffrexp): Do not special-case zero, as frexp does the right thing
7403 (Flogb): Do not use logb, as it doesn't have the desired meaning
7404 on hosts that use non-base-2 floating point. Instead, stick with
7405 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7406 frexp, to avoid getting an unspecified result.
7408 * xdisp.c (Qinhibit_debug_on_message): Now static.
7410 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7412 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7413 NSBezierPath (Bug#12131).
7415 2012-09-10 Chong Yidong <cyd@gnu.org>
7417 * fns.c (Fdelq, Fdelete): Doc fix.
7419 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7421 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7422 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7424 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7426 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7427 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7430 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7432 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7433 left fringe if the window has a left margin. This avoids leaving
7434 traces of the cursor because its leftmost pixel is not drawn over.
7436 * dispnew.c (update_window_line): When the left margin area of a
7437 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7438 that screen line. (Bug#12277)
7440 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7442 Assume C89 or later for math functions (Bug#12381).
7443 This simplifies the code, and makes it a bit smaller and faster,
7444 and (most important) makes it easier to clean up signal handling
7445 since we can stop worring about floating-point exceptions in
7446 library code. That was a problem before C89, but the problem
7447 went away many years ago on all practical Emacs targets.
7448 * data.c, image.c, lread.c, print.c:
7449 Don't include <math.h>; no longer needed.
7450 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7451 might be autoconfigured, as that never happens.
7453 * doprnt.c (DBL_MAX_10_EXP):
7454 * print.c (DBL_DIG):
7455 Remove. C89 or later always defines these.
7456 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7457 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7458 (arith_error, domain_error, domain_error2):
7459 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7460 no longer needed -- we simply return what C returns. All uses removed.
7461 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7463 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7464 Remove. All uses expanded, as these macros are no longer used
7465 more than once and are now more trouble than they're worth.
7466 (Ftan): Use tan, not sin / cos.
7467 (Flogb): Assume C89 frexp.
7468 (fmod_float): Assume C89 fmod.
7469 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7470 (init_floatfns): Remove. All uses removed.
7472 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7474 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7475 compositeToPoint for OSX < 10.6 (Bug#12390).
7477 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7479 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7480 This produces more-accurate results.
7482 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7484 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7485 changes (Bug#12088).
7487 2012-09-08 Chong Yidong <cyd@gnu.org>
7489 * syntax.c (Fstring_to_syntax): Doc fix.
7491 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7493 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7494 in the internal border.
7495 (x_set_window_size): Remove static variables and their usage.
7496 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7497 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7498 Remove fringe/internal border adjustment (Bug#11052).
7499 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7500 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7501 (ns_fix_rect_ibw): Remove.
7502 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7503 (ns_dumpglyphs_box_or_relief): Ditto.
7504 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7506 (ns_dumpglyphs_image): Ditto.
7507 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7509 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7510 their usage. Add fringe_extended_p and its use as in other terms.
7511 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7512 scroll bar was removed.
7513 (updateFrameSize): New function.
7514 (windowDidResize): Move code to updateFrameSize and call it.
7516 * nsterm.h (EmacsView): Add updateFrameSize.
7518 2012-09-07 Chong Yidong <cyd@gnu.org>
7520 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7522 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7524 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7526 More signal-handler cleanup (Bug#12327).
7527 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7528 Problem introduced when merging patches. Noted by Eli Zaretskii in
7529 <http://bugs.gnu.org/12327#67>.
7530 * floatfns.c: Comment fix.
7531 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7532 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7533 and anyway the declaration is harmless even if SIGDANGER is not defined.
7534 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7535 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7536 source files not surprisingly expected syssignal.h to define, or
7537 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7538 Include <sys/ioctl.h>, for FIONREAD.
7539 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7540 This eliminates a problem whereby other files mysteriously had
7541 to include "syssignal.h" before including "systty.h" if they
7542 wanted to use "#ifdef SIGIO".
7544 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7546 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7548 * w32.c (sigemptyset): Empty the set.
7549 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7551 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7553 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7555 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7556 (mark_object): Likewise for frame objects.
7558 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7560 * syssignal.h (handle_on_main_thread): Always declare,
7561 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7562 This ports to platforms without HAVE_PTHREAD.
7564 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7566 Signal-handler cleanup (Bug#12327).
7567 Emacs's signal handlers were written in the old 4.2BSD style with
7568 sigblock and sigmask and so forth, and this led to some
7569 inefficiencies and confusion. Rewrite these to use
7570 pthread_sigmask etc. without copying signal sets around. Also,
7571 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7572 'signal', and instead use functions that do not attempt to take
7573 over the system name space. This patch causes Emacs's text
7574 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7575 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7576 Do not include <signal.h> or "syssignal.h", as these
7577 modules do not use signals.
7578 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7579 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7580 Do not include <signal.h>, as "syssignal.h" does that for us now.
7581 * atimer.c (sigmask_atimers): New function.
7582 (block_atimers, unblock_atimers): New functions,
7583 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7585 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7586 no longer needed here.
7587 * emacs.c (main): Inspect existing signal handler with sigaction,
7588 so that there's no need to block and unblock SIGHUP.
7589 * sysdep.c (struct save_signal): New member 'action', replacing
7590 old member 'handler'.
7591 (save_signal_handlers, restore_signal_handlers):
7592 Use sigaction instead of 'signal' to save and restore.
7593 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7594 New function. All users of 'signal' modified to use set_sighandler
7595 if they're writeonly, and to use sys_signal if they're read+write.
7596 (emacs_sigaction_init, forwarded_signal): New functions.
7597 (sys_signal): Remove. All uses replaced by calls to sigaction
7598 and emacs_sigaction_init, or by direct calls to 'signal'.
7599 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7600 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7601 all uses replaced by pthread_sigmask etc. calls.
7602 * syssignal.h: Include <signal.h>.
7603 (emacs_sigaction_init, forwarded_signal): New decls.
7604 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7605 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7606 (sigmask, sys_sigmask): Remove; no longer needed.
7607 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7608 (sigblock, sigunblock, sigfree):
7609 (sigsetmask) [!defined sigsetmask]:
7610 Remove. All uses replaced by pthread_sigmask.
7611 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7612 no longer need to be replaced, and its typical old uses
7613 are now done via emacs_sigaction_init and sigaction.
7614 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7615 (sys_sigdel): Remove; unused.
7616 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7618 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7620 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7621 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7623 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7625 Explicitly mark buffer_defaults and buffer_local_symbols.
7626 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7627 mark_local_symbols here.
7628 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7629 since special buffers aren't marked here any more.
7630 (allocate_buffer): Chain new buffer with all_buffers here...
7631 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7633 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7634 (syms_of_buffer): Remove staticpro of the above.
7635 (init_buffer_once): Set names for buffer_defaults and
7636 buffer_local_symbols.
7638 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7640 Use bool for booleans in font-related modules.
7641 * font.c (font_intern_prop, font_style_to_value)
7642 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7643 (generate_otf_features, font_check_otf_features, font_check_otf)
7644 (font_match_p, font_list_entities, font_at):
7645 * fontset.c (fontset_id_valid_p, reorder_font_vector
7646 (fontset_find_font, Fset_fontset_font)
7647 (face_suitable_for_char_p) [0]:
7648 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7649 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7650 (m17n_flt_initialized, ftfont_shape_by_flt):
7651 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7652 * nsfont.m (nsfont_draw):
7653 * w32font.c (w32font_draw):
7654 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7655 Use bool for booleans.
7656 * font.h: Adjust to above API changes.
7657 (struct font, struct font_driver, struct font_driver_list):
7658 Use bool for booleans.
7659 (struct font): Remove useless member encoding_type.
7661 * fontset.c, xftfont.c: Omit unnecessary static decls.
7663 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7665 * alloc.c (mark_object): Revert window marking code
7666 since it's unsafe for the Fset_window_configuration.
7668 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7670 Fix race conditions with signal handlers and errno (Bug#12327).
7671 Be more systematic about preserving errno whenever a signal
7672 handler returns, even if it's not in the main thread. Do this by
7673 renaming signal handlers to distinguish between signal delivery
7674 and signal handling. All uses changed.
7675 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7676 * data.c (deliver_arith_signal): Rename from arith_error.
7677 * dispnew.c (deliver_window_change_signal): Rename from
7678 window_change_signal.
7679 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7680 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7681 * keyboard.c (deliver_input_available_signal): Rename from
7682 input_available_signal.
7683 (deliver_user_signal): Rename from handle_user_signal.
7684 (deliver_interrupt_signal): Rename from interrupt_signal.
7685 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7686 (deliver_child_signal): Rename from sigchld_handler.
7687 * atimer.c (handle_alarm_signal):
7688 * data.c (handle_arith_signal):
7689 * dispnew.c (handle_window_change_signal):
7690 * emacs.c (handle_fatal_signal, handle_danger_signal):
7691 * keyboard.c (handle_input_available_signal):
7692 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7693 * process.c (handle_pipe_signal, handle_child_signal):
7694 New functions, with the actual signal-handling code taken from the
7695 original respective signal handlers, sans the sporadic attempts to
7696 preserve errno, since that's now done by handle_on_main_thread.
7697 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7698 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7699 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7701 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7702 Move initialization of main_thread to sysdep.c's init_signals.
7703 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7704 our usage, and simplifies the mainline code.
7705 (record_child_status_change): New static function, as a helper
7706 for handle_child_signal, and with most of the old child handler's
7708 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7709 (handle_child_signal): Use the above.
7710 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7711 Moved here from emacs.c.
7712 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7713 code moved here from emacs.c's main function.
7714 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7715 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7716 This lets callers save and restore errno properly.
7718 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7720 Remove redundant or unused things here and there.
7721 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7722 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7723 * editfns.c (Fcompare_buffer_substrings): Likewise.
7724 * frame.h (struct terminal, struct font_driver_list):
7725 Remove redundant declarations.
7726 * window.h (Qleft, Qright): Likewise.
7728 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7730 Do not mark objects from deleted buffers, windows and frames.
7731 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7732 (mark_object): Likewise for windows and frames.
7734 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7736 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7737 buffer_defaults and buffer_local_symbols as valid objects.
7738 Return special value to denote them.
7740 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7742 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7743 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7744 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7745 (file_name_absolute_p, Fsubstitute_in_file_name):
7746 (check_executable, check_writable, Ffile_accessible_directory_p)
7747 (Fset_file_selinux_context, Fdefault_file_modes)
7748 (Finsert_file_contents, choose_write_coding_system)
7749 (Fwrite_region, build_annotations, a_write, e_write)
7751 * filelock.c (boot_time_initialized, get_boot_time)
7752 (get_boot_time_1, lock_file_1, within_one_second):
7753 * floatfns.c (in_float):
7754 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7755 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7756 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7757 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7758 * window.c (compare_window_configurations):
7759 Use bool for booleans.
7760 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7761 (Fdefault_file_modes): Now mode_t, not int, for modes.
7762 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7763 (internal_delete_file): Now returns void, not a (boolean) int,
7764 since nobody was looking at the return value.
7765 * lisp.h, window.h: Adjust to above API changes.
7767 * xdisp.c (set_message): Simplify and reindent last change.
7769 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7771 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7773 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7775 * eval.c (call_debugger): Make the function non-static so that we
7776 can call it from set_message.
7778 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7779 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7781 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7783 Give more-useful info on a fatal error (Bug#12328).
7784 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7785 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7786 of doing the work ourselves.
7787 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7788 do most of the work.
7789 (fatal_error_backtrace): New function, taken from the guts
7790 of the old fatal_error_signal, but with a new option to output
7792 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7793 info about the signal than just its number.
7794 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7795 * sysdep.c: Include <execinfo.h>
7796 (emacs_backtrace): New function, taken partly from the previous
7797 code of the 'die' function.
7798 (emacs_abort): Call fatal_error_backtrace rather than abort.
7800 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7802 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7803 eager (load-time) macro-expansion.
7804 * lisp.mk (lisp): Add macroexp.
7806 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7808 Simplify redefinition of 'abort' (Bug#12316).
7809 Do not try to redefine the 'abort' function. Instead, redo
7810 the code so that it calls 'emacs_abort' rather than 'abort'.
7811 This removes the need for the NO_ABORT configure-time macro
7812 and makes it easier to change the abort code to do a backtrace.
7813 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7814 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7815 Remove; sysdep.c's emacs_abort now takes its place.
7816 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7817 'abort' changed to use 'emacs_abort'.
7818 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7819 (abort) [!defined abort]: Rename to ...
7820 (emacs_abort): ... new name.
7821 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7822 the place of the old 'abort' in emacs.c.
7823 * w32.c, w32fns.c (abort): Do not #undef.
7824 * w32.c (emacs_abort): Rename from w32_abort.
7826 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7828 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7829 offsets[j].dv, since the y axis of the screen coordinates points
7830 down, while the y axis of the font definition coordinates points
7831 up. This fixes display of Arabic diacritics such as KASRA and
7832 KASRATAN. (Bug#11860)
7834 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7836 Be more systematic about _setjmp vs setjmp.
7837 * alloc.c (test_setjmp, mark_stack):
7838 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7839 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7840 (png_load, my_error_exit, jpeg_load):
7841 * process.c (send_process_trap, send_process):
7842 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7843 The underscored versions are up to 30x faster on some hosts.
7844 Formerly, the code used setjmp+longjmp sometimes and
7845 _setjmp+_longjmp at other times, with no particular reason to
7846 prefer setjmp+longjmp.
7848 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7850 Fix minor problem found by static checking.
7851 * buffer.c (Fdelete_all_overlays): Return nil.
7853 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7855 * buffer.c (Fdelete_all_overlays): New function.
7857 2012-09-03 Chong Yidong <cyd@gnu.org>
7859 * gtkutil.c: Add extern decl for Qxft.
7861 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7863 * emacs.c, eval.c: Use bool for boolean.
7864 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7865 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7866 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7867 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7868 (main, decode_env_path, Fdaemon_initialized):
7869 * eval.c (call_debugger, Finteractive_p, interactive_p):
7870 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7871 (maybe_call_debugger, Fbacktrace):
7872 * process.c (read_process_output, exec_sentinel):
7873 Use bool for booleans.
7874 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7875 All callers changed.
7876 * eval.c (interactive_p): Omit always-true boolean argument
7877 EXCLUDE_SUBRS_P. All callers changed.
7878 * dispextern.h, lisp.h: Reflect above API changes.
7879 * firstfile.c (dummy): Use the address of 'main', whose signature
7880 won't change, instead of the address of 'initialize', whose
7881 signature just changed from int to bool.
7882 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7883 * msdos.c (fatal_error_in_progress): ... from here.
7884 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7886 (redisplay_internal, unwind_redisplay): Simply clear
7887 REDISPLAYING_P when unwinding, instead of saving its previous,
7888 always-false value and then restoring it.
7890 Clean up some extern decls.
7891 Mostly, this hoists extern decls out of .c files and into .h files.
7892 That way, we're more likely to catch errors if the interfaces change.
7893 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7894 declare xg_mark_data.
7895 * dispextern.h (x_frame_parm_handlers):
7897 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7898 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7899 (Qultra_bold, Qoblique, Qitalic):
7900 Move extern decl here from .c file.
7901 * alloc.c (xg_mark_data) [USE_GTK]:
7903 * eval.c (Qlexical_binding):
7904 * fns.c (time) [!HAVE_UNISTD_H]:
7905 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7906 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7907 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7908 * lread.c (Qinternal_interpreter_environment):
7909 * minibuf.c (Qbuffer):
7910 * process.c (QCfamily, QCfilter):
7911 * widget.c (free_frame_faces):
7912 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7913 * xfont.c (x_clear_errors):
7914 * xterm.c (x_frame_parm_handlers):
7915 Remove now-redundant extern decls.
7916 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7917 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7919 * xfaces.c: Remove unnecessary static decls.
7920 * xterm.c (updating_frame): Remove decl of nonexistent object.
7922 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7923 when building globals.h, as the objects that are not built on
7924 this host are not needed to compile C files on this host.
7926 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7928 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7930 * frame.h: Add missing prototype for x_wm_set_size_hint.
7932 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7934 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7935 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7936 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7937 (Fsubstitute_command_keys):
7938 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7939 (save_excursion_save, save_excursion_restore)
7940 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7941 (format_time_string, general_insert_function)
7942 (make_buffer_string, make_buffer_string_both)
7943 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7944 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7945 (copy_text, insert_1, insert_1_both, insert_from_string)
7946 (insert_from_string_before_markers, insert_from_string_1)
7947 (insert_from_buffer, insert_from_buffer_1, replace_range)
7948 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7949 (del_range_2, modify_region):
7950 * intervals.c (intervals_equal, balance_possible_root_interval)
7951 (adjust_intervals_for_insertion, merge_properties_sticky)
7952 (graft_intervals_into_buffer, lookup_char_property)
7953 (adjust_for_invis_intang, set_point_both)
7954 (get_property_and_range, compare_string_intervals)
7955 (set_intervals_multibyte_1, set_intervals_multibyte):
7956 * keyboard.c (decode_timer):
7957 Use bool for boolean.
7958 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7959 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7961 2012-09-02 Chong Yidong <cyd@gnu.org>
7963 * keymap.c (push_key_description): Print M-TAB as C-M-i
7966 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7968 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7969 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7970 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7971 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7972 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7973 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7974 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7976 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7978 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7979 more than one grapheme cluster passed to the shaper: compute the
7980 offset adjustment values separately for each cluster. (Bug#11860)
7982 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7983 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7984 about implicit conversions from integer to pointer.
7986 2012-09-01 Daniel Colascione <dancol@dancol.org>
7988 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7989 system used too early.
7991 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7993 Better seed support for (random).
7994 * emacs.c (main): Call init_random.
7995 * fns.c (Frandom): Set the seed from a string argument, if given.
7996 Remove long-obsolete Gentzel cruft.
7997 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7998 (init_random): New function.
8000 2012-09-01 Daniel Colascione <dancol@dancol.org>
8002 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8003 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8004 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8005 x_wm_set_size_hint, x_query_colors, x_real_positions,
8006 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8007 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8008 all of which have been moved to common code.
8010 * xfaces.c: Include TERM_HEADER instead of listing all possible
8011 window-system headers.
8013 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8016 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8017 directly accessing frame internals.
8019 * w32font.h: Include font.h. Define syms_of_w32font and
8022 * process.c: Include TERM_HEADER instead of listing all possible
8023 window-system headers.
8025 * nsterm.h: Remove declarations now in frame.h.
8026 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8028 * menu.c: Include TERM_HEADER instead of listing all possible
8029 window-system headers.
8031 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8034 * keyboard.c: Include TERM_HEADER instead of listing all possible
8035 window-system headers.
8037 * image.c: Include TERM_HEADER instead of listing all possible
8038 window-system headers. Declare Vlibrary_cache when compiling for
8041 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8042 window system declarations.
8044 * frame.h: Move common functions here: set_frame_menubar,
8045 x_set_window_size, x_sync, x_get_focus_frame,
8046 x_set_mouse_position, x_set_mouse_pixel_position,
8047 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8048 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8049 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8050 x_activate_menubar, x_real_positions, x_bitmap_icon,
8051 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8054 * frame.c: Include TERM_HEADER instead of listing all possible
8055 window-system headers.
8057 * font.c: Include TERM_HEADER instead of listing all possible
8058 window-system headers.
8060 * emacs.c: Include TERM_HEADER.
8062 * dispnew.c: Include TERM_HEADER instead of listing all possible
8063 window-system headers.
8065 * ccl.h: Include character.h.
8067 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8068 the current window system; include in list of objects to link into
8071 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8073 Remove mark_ttys function and fix tty_display_info initialization.
8074 * lisp.h (mark_ttys): Remove prototype.
8075 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8076 to mark_ttys because all possible values of 'top_frame' slot are
8077 the frames which are reachable from Vframe_list.
8078 * term.c (mark_ttys): Remove.
8079 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8081 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8083 Change struct frame bitfields from unsigned char to unsigned.
8084 * frame.h (struct frame): Change type of 'display_preempted',
8085 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8086 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8087 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8088 bitfields from unsigned char to unsigned.
8090 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8092 Remove unused member of struct x_output and struct w32_output.
8093 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8094 * w32term.h (struct w32_output): Likewise.
8096 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8098 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8099 does not become zero (Bug#12234).
8101 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8103 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8104 for GCC 4.7.1 x86-64.
8106 2012-08-30 Glenn Morris <rgm@gnu.org>
8108 * lread.c (init_lread): For out-of-tree builds, only add the
8109 source directory's site-lisp dir to the load-path if it exists,
8110 consistent with in-tree builds. (Bug#12302)
8112 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8114 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8115 button_values to NULL. Call setStykeMask so dialogs get a close button.
8116 (windowShouldClose:): Set window_closed.
8117 (dealloc): New member, free button_values.
8118 (process_dialog:): Make member function. Remove window argument,
8119 replace window with self. Count buttons and allocate and store values
8121 (addButton:value:row:): value is int with the name tag. Call setTag
8122 with tag. Remove return self, declare return value as void.
8123 (addString:row:): Remove return self, declare return value as void.
8124 (addSplit): Remove return self, declare return value as void.
8125 (clicked:): Remove return self, declare return value as void.
8126 Set dialog_return to button_values[seltag]. Code formatting change.
8127 (initFromContents:isQuestion:): Adjust call to process_dialog.
8128 Code formatting change.
8129 (timeout_handler:): Set timer_fired to YES.
8130 (runDialogAt:): Set timer_fired to NO.
8131 Handle click on close button as quit.
8133 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8134 Add window_closed and button_values. Add void as return value for
8135 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8136 Add process_dialog as new member.
8138 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8140 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8141 is not one of the heaps we manage. (Bug#12242)
8143 2012-08-28 Glenn Morris <rgm@gnu.org>
8145 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8147 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8149 * window.c (Fset_window_configuration): Remove handling of
8150 auto-buffer-name window parameter. Install revision of reverted
8153 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8155 Do not allow to set major mode for a dead buffer.
8156 * buffer.c (Fset_buffer_major_mode): Signal an error
8157 if the buffer is dead.
8158 (Fother_buffer, other_buffer_safely): Remove redundant
8161 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8163 Always use set_buffer_if_live to restore original buffer at unwind.
8164 * buffer.h (record_unwind_current_buffer): New function.
8165 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8166 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8167 * undo.c, window.c: Adjust users.
8168 * buffer.c (set_buffer_if_live): Fix comment.
8170 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8172 Fix usage of set_buffer_internal.
8173 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8174 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8175 * coding.c (decode_coding): Omit redundant test.
8176 * fileio.c (decide_coding_unwind): Likewise.
8177 * fns.c (secure_hash): Likewise.
8178 * insdel.c (modify_region): Likewise.
8179 * keyboard.c (command_loop_1): Likewise.
8180 * print.c (PRINTFINISH): Likewise.
8181 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8183 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8185 * dispnew.c: Use bool for boolean.
8186 (frame_garbaged, display_completed, delayed_size_change)
8187 (fonts_changed_p, add_window_display_history)
8188 (add_frame_display_history, verify_row_hash)
8189 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8190 (row_equal_p, realloc_glyph_pool)
8191 (allocate_matrices_for_frame_redisplay)
8192 (showing_window_margins_p)
8193 (adjust_frame_glyphs_for_frame_redisplay)
8194 (build_frame_matrix_from_leaf_window, make_current)
8195 (mirrored_line_dance, mirror_line_dance, update_frame)
8196 (update_window_tree, update_single_window)
8197 (check_current_matrix_flags, update_window, update_text_area)
8198 (update_window_line, set_window_update_flags, scrolling_window)
8199 (update_frame_1, scrolling, buffer_posn_from_coords)
8200 (do_pending_window_change, change_frame_size)
8201 (change_frame_size_1, sit_for):
8202 Use bool for boolean.
8203 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8204 and remove last int (actually boolean) argument, which was always 0.
8205 All callers changed.
8206 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8207 * dispextern.h (struct composition_it): Use bool for boolean.
8208 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8209 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8210 * dired.c (file_name_completion):
8211 Use bool for boolean. (This was missed in an earlier change.)
8213 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8215 * window.c (Fset_window_configuration): Revert first part of
8218 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8220 * nsterm.h (NSPanel): New class variable dialog_return.
8222 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8223 Initialize dialog_return.
8224 (windowShouldClose:): Use stop instead of stopModalWithCode.
8225 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8226 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8228 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8231 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8233 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8234 * composite.c (find_composition, composition_gstring_p)
8235 (composition_reseat_it, find_automatic_composition):
8236 * data.c (let_shadows_buffer_binding_p)
8237 (let_shadows_global_binding_p, set_internal, make_blv)
8238 (Fmake_variable_buffer_local, Fmake_local_variable)
8239 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8240 (cons_to_signed, arith_driver):
8241 * dbusbind.c (xd_in_read_queued_messages):
8242 * dired.c (directory_files_internal, file_name_completion):
8243 Use bool for booleans.
8244 * dired.c (file_name_completion):
8245 * process.h (fd_callback):
8246 Omit int (actually boolean) argument. It wasn't being used.
8248 * composite.h, lisp.h: Reflect above API changes.
8250 * cmds.c, coding.c: Use bool for booleans.
8251 * cmds.c (move_point, Fself_insert_command):
8252 * coding.h (struct composition status, struct coding_system):
8253 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8254 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8255 (emacs_mule_char, decode_coding_emacs_mule)
8256 (encode_coding_emacs_mule, detect_coding_iso_2022)
8257 (decode_coding_iso_2022, encode_invocation_designation)
8258 (encode_designation_at_bol, encode_coding_iso_2022)
8259 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8260 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8261 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8262 (encode_coding_raw_text, detect_coding_charset)
8263 (decode_coding_charset, encode_coding_charset, detect_eol)
8264 (detect_coding, get_translation_table, produce_chars)
8265 (consume_chars, reused_workbuf_in_use)
8266 (make_conversion_work_buffer, code_conversion_save)
8267 (decode_coding_object, encode_coding_object)
8268 (detect_coding_system, char_encodable_p)
8269 (Funencodable_char_position, code_convert_region)
8270 (code_convert_string, code_convert_string_norecord)
8271 (Fset_coding_system_priority):
8272 * fileio.c (Finsert_file_contents):
8273 Use bool for booleans.
8274 * coding.h, lisp.h: Reflect above API changes.
8275 * coding.c: Remove unnecessary static function decls.
8276 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8277 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8278 not a boolean 'int', since callers never look at the return value.
8279 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8280 * coding.h (decoding_buffer_size, encoding_buffer_size)
8281 (emacs_mule_string_char): Remove unused extern decls.
8282 (struct iso_2022_spec, struct coding_system):
8283 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8284 (struct emacs_mule_spec): Remove unused field 'full_support'.
8285 All initializations removed.
8286 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8288 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8290 Fix spare memory change (Bug#12286).
8291 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8292 (valid_lisp_object_p): Likewise.
8294 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8296 * window.c (Fset_window_configuration): Record any window's old
8297 buffer if it's replaced (see Bug#8789). If the new current
8298 buffer doesn't appear in the selected window, go to its old
8301 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8303 Special MEM_TYPE_SPARE to denote reserved memory.
8304 * alloc.c (enum mem_type): New memory type.
8305 (refill_memory_reserve): Use new type for spare memory.
8306 This prevents live_cons_p and live_string_p from incorrect
8307 detection of uninitialized objects from spare memory as live.
8309 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8312 * Makefile.in (.PHONY): versioclean -> versionclean.
8314 Remove unused external symbols.
8315 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8316 * window.c (Qwindow_valid_p, decode_valid_window):
8317 Now static, not extern.
8318 * data.c (Qinterval): Remove; unused.
8319 (syms_of_data): Do not define 'interval'.
8320 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8321 * window.h (decode_valid_window):
8324 * character.c, charset.c, chartab.c: Use bool for booleans.
8325 * character.c (lisp_string_width, string_count_byte8)
8326 (string_escape_byte8):
8327 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8328 (load_charset_map_from_file, map_charset_chars)
8329 (Fdefine_charset_internal, define_charset_internal)
8330 (Fdeclare_equiv_charset, find_charsets_in_text)
8331 (Ffind_charset_region, char_charset, Fiso_charset):
8332 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8333 (sub_char_table_set, sub_char_table_set_range)
8334 (char_table_set_range, optimize_sub_char_table)
8335 (map_sub_char_table):
8336 Use bool for boolean.
8337 * character.c (str_to_unibyte): Omit last boolean argument; it was
8338 always 0. All callers changed.
8339 * character.h, charset.h: Adjust to match previous changes.
8340 * character.h (char_printable_p): Remove decl of nonexistent function.
8341 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8342 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8343 are all boolean, so make them single-bit bitfields.
8345 * lisp.h (ASET): Remove attempt to detect side effects.
8346 It was meant to be temporary and it often doesn't work,
8347 because when IDX has side effects the behavior of IDX==IDX
8348 is undefined. See Stefan Monnier in
8349 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8351 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8353 * lisp.h (functionp): New function (extracted from Ffunctionp).
8354 (FUNCTIONP): Use it.
8355 * eval.c (Ffunctionp): Use it.
8357 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8359 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8360 as that's faster and simpler than static storage. Don't bother
8361 with the g_main_context_query overhead if g_main_context_pending
8362 says no events are pending.
8363 (gfds, gfds_size): Remove these static vars.
8364 (xgselect_initialize): Remove; no longer needed.
8365 All uses and decls removed.
8367 * emacs.c (fatal_error_signal_hook): Remove.
8368 All uses removed. This leftover from old code was always 0.
8370 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8371 * casefiddle.c (casify_object, casify_region):
8372 * casetab.c (set_case_table):
8373 * category.c, category.h (word_boundary_p):
8374 * category.h (CHAR_HAS_CATEGORY):
8375 Use bool for booleans, instead of int.
8377 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8379 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8381 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8383 On assertion failure, print backtrace if available.
8384 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8385 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8386 * Makefile.in (LIB_EXECINFO): New macro.
8389 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8390 * bytecode.c (exec_byte_code):
8391 * callint.c (check_mark, Fcall_interactively):
8392 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8393 (getenv_internal, sync_process_alive, call_process_exited):
8394 * lisp.h (USE_SAFE_ALLOCA):
8395 Use bool for booleans, instead of int.
8396 * lisp.h, process.h: Adjust prototypes to match above changes.
8397 * callint.c (Fcall_interactively): Don't assume the mark's
8398 offset fits in 'int'.
8400 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8402 * buffer.c, buffer.h: Use bool for boolean.
8403 * buffer.c (reset_buffer_local_variables)
8404 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8405 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8406 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8407 (overlay_touches_p, overlay_strings, Foverlay_put)
8408 (report_overlay_modification, call_overlay_mod_hooks):
8409 (mmap_enlarge, mmap_set_vars):
8410 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8411 Use bool for booleans, instead of int.
8412 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8413 since the 1-or-0 return value is always ignored anyway.
8414 (mmap_initialized_p):
8415 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8416 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8418 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8420 * bidi.c: Use bool for boolean.
8421 This is a bit more readable, and makes the text segment of bidi.o
8422 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8423 Presumably it's faster too.
8424 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8426 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8427 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8428 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8429 (bidi_explicit_dir_char, bidi_level_of_next_char)
8430 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8431 Use bool for booleans, instead of int.
8432 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8433 (bidi_unshelve_cache): Adjust decls to match code.
8435 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8437 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8440 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8442 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8443 * atimer.h: Include <stdbool.h>.
8445 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8447 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8448 compile time tests instead of run time tests on systems that do
8450 (FRAME_MAC_P): Remove leftover from deleted code.
8451 * frame.c (syms_of_frame): Remove leftover from deleted code.
8453 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8455 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8457 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8459 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8460 Otherwise, the compiler complains about (A?B:C) where B is void
8461 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8462 (fontset_add): Return void, for FONTSET_ADD.
8464 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8466 * alloc.c: Use bool for booleans.
8467 (gc_in_progress, abort_on_gc)
8468 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8469 (dont_register_blocks) [GC_MALLOC_CHECK]:
8470 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8471 (check_string_bytes, make_specified_string, memory_full)
8472 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8473 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8474 (mark_stack, valid_pointer_p, make_pure_string)
8475 (Fgarbage_collect, survives_gc_p, gc_sweep):
8476 Use bool for booleans, instead of int.
8477 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8478 Remove unused local.
8479 * alloc.c (PURE_POINTER_P):
8480 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8481 * editfns.c (Fformat):
8482 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8484 * fns.c (sweep_weak_table):
8485 * lisp.h (suppress_checking, push_message, survives_gc_p)
8486 (make_pure_string, gc_in_progress, abort_on_gc):
8487 * lread.c (readchar, read1):
8488 * print.c (Fprin1_to_string):
8489 * xdisp.c (push_message):
8490 Use bool for booleans affected directly or indirectly by
8493 Make recently-introduced setters macros.
8494 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8495 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8496 (set_fontset_default, set_fontset_fallback): Rename from their
8497 upper-case counterparts, and make them functions rather than macros.
8498 This is more consistent with the other recently-introduced setters.
8499 These don't need to be inline, since they're local.
8501 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8503 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8504 the loop (Bug#12247).
8506 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8508 * lisp.h (vcopy): Use memcpy rather than our own loop.
8509 This fixes a performance regression introduced by the recent
8510 addition of vcopy. This means 'vcopy' will need to be modified
8511 for a copying collector, but that's OK. Also, tighten the
8512 checking in the assertion.
8514 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8516 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8517 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8518 non-base glyph for the width of the base character, according to
8519 what x_draw_composite_glyph_string_foreground expects.
8520 Generate WADJUST value according to composition_gstring_width's
8521 expectations, to produce correct width of the composed character.
8522 Reverse the sign of the DU offset produced by ScriptPlace.
8524 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8526 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8528 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8530 Avoid direct writes to contents member of struct Lisp_Vector.
8531 * lisp.h (vcopy): New function to copy data into vector.
8532 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8533 * fns.c (Ffillarray): Use ASET.
8534 * keyboard.c (timer_check_2): Use AREF and ASET.
8535 (append_tool_bar_item, Frecent_keys): Use vcopy.
8536 * lread.c (read_vector): Use ASET.
8537 * msdos.c (Frecent_doskeys): Use vcopy.
8538 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8539 (Finternal_merge_in_global_face): Use ASET and vcopy.
8540 * xfont.c (xfont_list_pattern): Likewise.
8542 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8544 * window.c (Fwindow_point): For the selected window always return
8545 the position of its buffer's point.
8546 (Fset_window_point): For the selected window always go in its
8547 buffer to the specified position.
8549 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8551 Setter macros for fontsets.
8552 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8553 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8554 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8557 2012-08-20 Glenn Morris <rgm@gnu.org>
8559 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8560 Don't assume that `ln -f' works.
8562 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8564 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8565 and later about non-assignments with no effect. See discussion at
8566 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8569 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8571 Inline setter functions for Lisp_Objects slots of struct specbinding.
8572 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8575 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8577 * window.c (select_window): Always make selected window's buffer
8580 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8582 Use AREF and ASET for docstrings of category tables.
8583 * category.h (CATEGORY_DOCSTRING): Use AREF.
8584 (SET_CATEGORY_DOCSTRING): Use ASET.
8585 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8587 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8589 Inline setter functions for hash table members.
8590 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8591 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8592 (set_hash_key_and_value, set_hash_index, set_hash_next)
8593 (set_hash_hash): New functions.
8594 * charset.c, fns.c: Adjust users.
8596 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8598 Inline getter and setter functions for per-buffer values.
8599 * buffer.h (per_buffer_default, set_per_buffer_default)
8600 (per_buffer_value, set_per_buffer_value): New functions.
8601 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8602 * buffer.c, data.c: Adjust users.
8604 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8606 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8608 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8610 Rely on <config.h> + <unistd.h> to declare 'environ',
8611 as gnulib does this if the system doesn't.
8612 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8613 Remove declaration. MS-Windows declares it on stdlib.h which is
8614 included by conf_post.h.
8615 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8616 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8617 * vm-limit.c: Include <unistd.h>, for 'environ'.
8619 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8620 (start_of_data): Remove decl; mem-limits.h provides it.
8622 * xdisp.c (handle_invisible_prop): Make it a bit faster
8623 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8625 2012-08-19 Chong Yidong <cyd@gnu.org>
8627 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8630 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8632 * .gdbinit: Use call instead of set when calling a function in the
8635 * data.c (set_internal): Don't use set_blv_found.
8636 (Fkill_local_variable): Likewise.
8638 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8640 * nsfont.m (ns_ascii_average_width): Ensure the string
8641 ascii_printable is initialized with a null-terminated character
8642 array. Otherwise, it can contain undesired extra characters.
8644 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8646 port new setting code to Sun C 5.8 2005/10/13
8647 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8648 Return void, not Lisp_Object. Otherwise, the compiler
8649 complains about (A?B:C) where B is void and C is Lisp_Object
8650 when compiling CHAR_TABLE_SET, due to the recent change to
8651 the API of sub_char_table_set_contents.
8653 2012-08-18 Chong Yidong <cyd@gnu.org>
8655 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8656 for the string case (Bug#3874).
8658 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8660 * buffer.h (BSET): Remove (Bug#12215).
8661 Replace all uses with calls to new setter functions.
8662 (bset_bidi_paragraph_direction, bset_case_canon_table)
8663 (bset_case_eqv_table, bset_directory, bset_display_count)
8664 (bset_display_time, bset_downcase_table)
8665 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8666 (bset_last_selected_window, bset_local_var_alist)
8667 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8668 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8670 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8671 (bset_auto_fill_function, bset_auto_save_file_format)
8672 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8673 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8674 (bset_cache_long_line_scans, bset_case_fold_search)
8675 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8676 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8677 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8678 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8679 (bset_header_line_format, bset_indicate_buffer_boundaries)
8680 (bset_indicate_empty_lines, bset_invisibility_spec)
8681 (bset_left_fringe_width, bset_major_mode, bset_mark)
8682 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8683 (bset_name, bset_overwrite_mode, bset_pt_marker)
8684 (bset_right_fringe_width, bset_save_length)
8685 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8686 (bset_scroll_up_aggressively, bset_selective_display)
8687 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8688 (bset_word_wrap, bset_zv_marker):
8689 * category.c (bset_category_table):
8690 * syntax.c (bset_syntax_table):
8691 New setter functions.
8693 * process.h (PSET): Remove (Bug#12215).
8694 Replace all uses with calls to new setter functions.
8695 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8696 (PROCESS_INLINE): New macro.
8697 (pset_childp): New setter function.
8698 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8699 * process.c (PROCESS_INLINE):
8700 Define to EXTERN_INLINE, so that the corresponding functions
8701 are compiled into code.
8702 (pset_buffer, pset_command, pset_decode_coding_system)
8703 (pset_decoding_buf, pset_encode_coding_system)
8704 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8705 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8706 (pset_type, pset_write_queue): New setter functions.
8708 * window.h (WSET): Remove (Bug#12215).
8709 Replace all uses with calls to new setter functions.
8710 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8711 (WINDOW_INLINE): New macro.
8712 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8713 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8714 (wset_total_lines, wset_vertical_scroll_bar)
8715 (wset_window_end_pos, wset_window_end_valid)
8716 (wset_window_end_vpos): New setter functions.
8717 * window.c (WINDOW_INLINE):
8718 Define to EXTERN_INLINE, so that the corresponding functions
8719 are compiled into code.
8720 (wset_combination_limit, wset_dedicated, wset_display_table)
8721 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8722 (wset_new_normal, wset_new_total, wset_next_buffers)
8723 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8724 (wset_prev_buffers, wset_right_fringe_width)
8725 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8726 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8727 (wset_window_parameters):
8728 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8729 (wset_column_number_displayed, wset_region_showing):
8730 New setter functions.
8732 * termhooks.h (TSET): Remove (Bug#12215).
8733 Replace all uses with calls to new setter functions.
8734 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8735 (TERMHOOKS_INLINE): New macro.
8736 (tset_charset_list, tset_selection_alist): New setter functions.
8737 * terminal.c (TERMHOOKS_INLINE):
8738 Define to EXTERN_INLINE, so that the corresponding functions
8739 are compiled into code.
8740 (tset_param_alist): New setter function.
8742 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8744 * keyboard.h (KSET): Remove (Bug#12215).
8745 Replace all uses with calls to new setter functions.
8746 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8747 (KEYBOARD_INLINE): New macro.
8748 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8749 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8750 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8751 New setter functions.
8752 * keyboard.c (KEYBOARD_INLINE):
8753 Define to EXTERN_INLINE, so that the corresponding functions
8754 are compiled into code.
8755 (kset_echo_string, kset_kbd_queue)
8756 (kset_keyboard_translate_table, kset_last_prefix_arg)
8757 (kset_last_repeatable_command, kset_local_function_key_map)
8758 (kset_overriding_terminal_local_map, kset_real_last_command)
8759 (kset_system_key_syms): New setter functions.
8761 * frame.h (FSET): Remove (Bug#12215).
8762 Replace all uses with calls to new setter functions.
8763 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8764 (FRAME_INLINE): New macro.
8765 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8766 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8767 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8768 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8769 (fset_param_alist, fset_root_window, fset_scroll_bars)
8770 (fset_selected_window, fset_title, fset_tool_bar_items)
8771 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8772 * frame.c (FRAME_INLINE):
8773 Define to EXTERN_INLINE, so that the corresponding functions
8774 are compiled into code.
8775 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8777 A few more naming-convention fixes for getters and setters.
8778 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8779 and rename from buffer_overlays_set_before.
8780 (set_buffer_overlays_after): Move here from buffer.h, and rename
8781 from buffer_overlays_set_after.
8782 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8784 (set_buffer_intervals): Rename from buffer_set_intervals.
8785 * intervals.c (set_interval_object): Move here from intervals.h,
8786 and rename from interval_set_object.
8787 (set_interval_left): Move here from intervals.h, and rename from
8789 (set_interval_right): Move here from intervals.h, and rename from
8791 (copy_interval_parent): Move here from intervals.h, and rename from
8792 interval_copy_parent.
8793 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8794 (set_interval_plist): Rename from interval_set_plist.
8795 Return void, not Lisp_Object, since no caller uses the result.
8796 * lisp.h (string_intervals): Rename from string_get_intervals.
8797 (set_string_intervals): Rename from string_set_intervals.
8799 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8800 (set_char_table_contents): Rename from char_table_set_contents.
8801 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8802 All uses changed. See the end of
8803 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8805 * lisp.h (CSET): Remove (Bug#12215).
8806 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8807 (set_char_table_purpose): New functions,
8808 replacing CSET. All uses changed. For example, replace
8809 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8810 "set_char_table_parent (char_table, parent);".
8811 The old version was confusing because it used the same name
8812 'parent' for two different things.
8814 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8816 Functions to get and set Lisp_Object fields of buffer-local variables.
8817 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8818 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8819 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8820 * data.c, eval.c, frame.c: Adjust users.
8822 2012-08-17 Chong Yidong <cyd@gnu.org>
8824 * xfaces.c (merge_face_vectors): If the target font specfies a
8825 font spec, make the font's attributes take precedence over
8826 directly-specified attributes.
8827 (merge_face_ref): Recognize :font.
8829 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8831 Do not use memcpy for copying intervals.
8832 * intervals.c (reproduce_interval): New function.
8833 (reproduce_tree, reproduce_tree_obj): Use it.
8834 (reproduce_tree_obj): Remove prototype.
8836 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8838 * lisp.h (duration_to_sec_usec): Remove unused decl.
8840 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8842 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8843 to an allocated instance of NSString, not to the class itself.
8845 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8847 * makefile.w32-in (C_CTYPE_H): New macro.
8848 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8849 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8850 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8852 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8854 Use ASCII tests for character types.
8855 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8857 Don't include <ctype.h>; was not needed.
8858 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8859 * sysdep.c, xfaces.c:
8860 Include <c-ctype.h> instead of <ctype.h>.
8861 * nsterm.m: Include <c-ctype.h>.
8862 * charset.c (read_hex):
8863 * doc.c (Fsnarf_documentation):
8864 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8865 (DRIVE_LETTER) [DOS_NT]:
8866 (Ffile_name_directory, Fexpand_file_name)
8867 (Fsubstitute_in_file_name):
8868 * font.c (font_parse_xlfd, font_parse_fcname):
8869 * frame.c (x_set_font_backend):
8870 * gtkutil.c (xg_get_font):
8871 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8872 * nsimage.m (hexchar):
8873 * nsterm.m (ns_xlfd_to_fontname):
8874 * sysdep.c (system_process_attributes):
8875 * xfaces.c (hash_string_case_insensitive):
8876 Use C-locale tests instead of locale-specific tests for character
8877 types, since we want the ASCII interpretation here, not the
8878 interpretation suitable for whatever happens to be the current locale.
8880 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8882 Consistently check windows for validity/liveness
8883 (Bug#11984, Bug#12025, Bug#12026).
8884 * lisp.h (CHECK_VALID_WINDOW): New macro.
8885 * window.c (decode_window): Rename to decode_live_window.
8886 (decode_valid_window, Fwindow_valid_p): New functions.
8887 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8888 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8889 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8890 (Fwindow_prev_sibling, Fwindow_combination_limit)
8891 (Fset_window_combination_limit, Fwindow_use_time)
8892 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8893 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8894 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8895 (Fwindow_hscroll, Fset_window_hscroll)
8896 (Fwindow_redisplay_end_trigger)
8897 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8898 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8899 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8900 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8901 (Fwindow_end, Fset_window_point, Fset_window_start)
8902 (Fpos_visible_in_window_p, Fwindow_line_height)
8903 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8904 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8905 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8906 (Fset_window_parameter, Fwindow_display_table)
8907 (Fset_window_display_table, Fdelete_other_windows_internal)
8908 (Fset_window_buffer, Fset_window_new_total)
8909 (Fset_window_new_normal, Fdelete_window_internal)
8910 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8911 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8912 (Fwindow_scroll_bars): Check whether argument window is a valid or
8913 live window. Update doc-strings.
8914 (syms_of_window): New symbol Qwindow_valid_p.
8915 * keyboard.c (Fposn_at_x_y): Check whether argument
8916 frame_or_window denotes a valid window.
8918 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8920 Fix previous char table change.
8921 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8922 * chartab.c (optimize_sub_char_table): Likewise.
8924 2012-08-16 Chong Yidong <cyd@gnu.org>
8926 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8928 * xfont.c (xfont_open):
8929 * xftfont.c (xftfont_open): Set the font's max_width field.
8931 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8932 min_width to space_width and average_width to the average over
8933 printable ASCII characters.
8934 (ns_char_width): Code cleanup.
8935 (ns_ascii_average_width): New utility function.
8937 * font.h (struct font): Update comments.
8939 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8941 Simple interface to set Lisp_Object fields of character tables.
8942 * lisp.h (CSET): New macro.
8943 (char_table_set_extras, char_table_set_contents)
8944 (sub_char_table_set_contents): New function.
8945 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8946 * syntax.c: Adjust users.
8948 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8950 * eval.c (eval_sub): Bind lexical-binding.
8951 * lread.c (Qlexical_binding): Make non-static.
8953 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8955 * nsmenu.m (popupSession): Remove.
8956 (pop_down_menu): Remove endModalSession.
8957 (timeout_handler:): New method.
8958 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8959 Call runModalForWindow. Check timer_fired when it returns.
8960 If not set, cancel timer and break out of loop.
8961 Otherwise loop again, with a new timeout.
8963 * nsterm.m: Include fcntl.h if present.
8964 (fd_entry, t_readfds, inNsSelect): Remove.
8965 (select_writefds, select_valid, select_timeout, selfds)
8966 (select_mutex, apploopnr): Add.
8967 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8968 Otherwise call kbd_buffer_store_event.
8969 (ns_send_appdefined): Remove release of fd_entry.
8970 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8971 Increment and decrement apploopnr.
8972 (ns_select): If no file descriptors, just do a NSTimer.
8973 Otherwise copy read/write masks and start select thread (fd_handler).
8974 Start main loop and wait for application defined event.
8975 Inform select thread to stop selecting after main loop is exited.
8976 (ns_term_init): Create selfds pipe and set non-blocking.
8977 Initialize select_mutex. Start the select thread (fd_handler).
8978 (fd_handler:): Loop forever, wait for info from the main thread
8979 to either start or stop selecting. When select returns, send
8980 and appdefined event.
8981 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8982 If not call kbd_buffer_store_event.
8984 * nsterm.h (EmacsApp): fd_handler takes id argument.
8985 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8987 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8989 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8991 * region-cache.c (move_cache_gap): Update gap_len using the actual
8992 growth of the boundaries array. Do not change cache_len.
8995 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8997 Generalize and cleanup font subsystem checks.
8998 * font.h (FONT_DEBUG, font_assert): Remove.
8999 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9000 Change font_assert to eassert. Use eassert where appropriate.
9002 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9004 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9006 2012-08-15 Chong Yidong <cyd@gnu.org>
9008 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9009 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9010 extract the font descriptor instead of just the font name.
9011 In that case, return a font spec instead of a string.
9012 (x_last_font_name): Move to this file from xfns.c.
9014 * xfns.c (Fx_select_font): The return value can also be a font
9015 spec. Move x_last_font_name management to gtkutil.c.
9017 * xfaces.c: Make font weight and style symbols non-static.
9019 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9021 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9024 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9026 * alloc.c (Fgarbage_collect): Use plural form consistently.
9028 2012-08-14 Eli Zaretskii <eliz@gnu.org>
9030 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9031 iteration through the command loop. Fixes a problem whereby mouse
9032 movements are ignored until the first mouse click.
9034 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9036 Use bool, not int, for Lisp booleans.
9037 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9038 makes Emacs a bit smaller and presumably a bit faster.
9039 * lisp.h: Include <stdbool.h>.
9040 (struct Lisp_Boolfwd, defvar_bool):
9041 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9042 * regex.c [!emacs]: Include <stdbool.h>.
9043 (false, true): Remove; <stdbool.h> does this for us now.
9045 2012-08-14 Chong Yidong <cyd@gnu.org>
9047 * character.c (Fcharacterp): Doc fix (Bug#12076).
9049 * data.c (Findirect_variable): Doc fix (Bug#11040).
9051 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9053 * editfns.c (Fformat): Doc fix (Bug#12059).
9054 (Fsave_current_buffer): Doc fix (Bug#11542).
9056 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9058 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9061 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9063 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9064 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9065 * minibuf.c (choose_minibuf_frame, read_minibuf):
9066 * w32fns.c (x_create_tip_frame):
9067 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9068 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9070 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9072 * intervals.c (offset_intervals): Remove obsolete comment.
9074 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9076 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9078 2012-08-14 Gergely Risko <gergely@risko.hu>
9080 * coding.c (decode_coding): Record buffer modification before
9081 disabling undo_list (Bug#11773).
9083 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9085 Revert and cleanup some recent overlay changes.
9086 * buffer.h (enum overlay_type): Remove.
9087 (buffer_get_overlays, buffer_set_overlays): Likewise.
9088 (buffer_set_overlays_before, buffer_set_overlays_after):
9089 New function. Adjust users.
9090 (unchain_both): Add eassert.
9092 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9094 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9096 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9098 * gtkutil.c (xg_mark_data): Don't assume C99.
9100 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9102 * gtkutil.c (xg_frame_tb_info): New struct.
9103 (TB_INFO_KEY): New define.
9104 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9105 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9106 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9108 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9109 is up to date. Otherwise store new data.
9110 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9112 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9114 Use KSET for write access to Lisp_Object members of struct kboard.
9115 * keyboard.h (KSET): New macro.
9116 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9117 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9118 * xterm.c: Adjust users.
9120 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9122 Use BSET for write access to Lisp_Object members of struct buffer.
9123 * buffer.h (BSET): New macro.
9124 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9125 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9126 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9127 * window.c, xdisp.c, xfns.c: Adjust users.
9129 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9131 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9133 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9135 * nsterm.m (not_in_argv): New function.
9136 (application:openFile, application:openTempFile:):
9137 (application:openFileWithoutUI:, application:openFiles:): Open file
9138 if not_in_argv returns non-zero (bug#12171).
9140 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9141 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9142 Define for Gtk+ versions less than 3.2.
9143 (xg_get_font_name): Use those functions/macros here.
9144 Reported by Frans Oilinki <moilinki@gmail.com>.
9146 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9148 * unexmacosx.c (copy_data_segment): Copy initialized data in
9149 statically linked libraries from input file rather than memory.
9151 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9152 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9153 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9155 2012-08-10 Glenn Morris <rgm@gnu.org>
9157 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9158 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9160 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9162 Fix last change to allow compilation with low optimization levels.
9163 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9164 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9166 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9168 Use common inline syntax in intervals.h.
9169 * intervals.h (INTERVALS_INLINE): New macro.
9170 Change all users from LISP_INLINE.
9172 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9174 Define Qnone once for all platforms.
9175 * frame.c (Qnone): Define here.
9176 (syms_of_frame): DEFSYM it.
9177 * lisp.h (Qnone): New declaration.
9178 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9179 * xfns.c: Remove duplication. Adjust users.
9181 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9183 Remove unused macros from intervals.h.
9184 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9185 * intervals.c: Adjust comment.
9187 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9189 * w32fns.c <w32_unicode_gui>: New static variable.
9190 (globals_of_w32fns): Initialize it according to os_subtype.
9191 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9194 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9195 Eli Zaretskii <eliz@gnu.org>
9197 Fix bug #10299 with Unicode characters sent by customized
9198 keyboards created by MSKLC.
9199 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9200 (w32_init_class): Use it to initialize the Emacs class with either
9201 ANSI or Unicode API calls.
9202 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9204 (w32_wnd_proc): If the character code sent by WM_CHAR or
9205 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9206 original message. Call DefWindowProcW on NT and later.
9208 2012-08-10 Glenn Morris <rgm@gnu.org>
9210 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9212 * lisp.h (DIRECTORY_SEP): Let configure set it.
9214 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9216 Use TSET for write access to Lisp_Object slots of struct terminal.
9217 * termhooks.h (TSET): New macro.
9218 * coding.c, terminal.c, xselect.c: Adjust users.
9220 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9222 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9223 the failing expression, include them in the error message.
9224 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9225 * lisp.h (internal_condition_case_n): Update declaration.
9227 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9229 Inline functions to examine and change buffer overlays.
9230 * buffer.c (unchain_both): New function.
9231 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9232 (buffer_has_overlays): New function.
9233 (enum overlay_type): New enum.
9234 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9235 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9237 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9239 Inline functions to examine and change buffer intervals.
9240 * alloc.c (mark_interval_tree): Remove.
9241 (MARK_INTERVAL_TREE): Simplify.
9242 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9243 * intervals.c (buffer_balance_intervals): New function.
9244 (graft_intervals_into_buffer): Adjust indentation.
9245 (set_intervals_multibyte): Simplify.
9246 * buffer.h (BUF_INTERVALS): Remove.
9247 (buffer_get_intervals, buffer_set_intervals): New function.
9248 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9249 * intervals.c, textprop.c: Adjust users.
9251 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9253 Inline functions to examine and change string intervals.
9254 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9255 (string_get_intervals, string_set_intervals): New function.
9256 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9257 * lread.c, print.c, textprop.c: Adjust users.
9259 2012-08-08 Glenn Morris <rgm@gnu.org>
9261 * lisp.mk (lisp): Remove language/persian.elc.
9263 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9266 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9267 (NULL_INTERVAL_P): Likewise. Adjust users.
9268 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9269 Adjust comment. Move under #if 0.
9270 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9271 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9273 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9275 Check total length of intervals with eassert.
9276 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9277 * intervals.c: Change all users to eassert.
9279 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9281 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9282 Rename fields to match removal of FGET and WGET and disuse of
9283 INTERNAL_FIELD in Lisp_Cons.
9285 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9287 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9288 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9289 name since all xname users are fixed long time ago. Do not
9291 (set_symbol_name, set_symbol_function, set_symbol_plist):
9292 (set_symbol_next, set_overlay_plist): New function.
9293 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9294 (struct Lisp_Overlay): Likewise.
9295 (CVAR, MVAR, SVAR): Remove.
9296 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9297 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9298 * xterm.c: Adjust users.
9299 * .gdbinit: Change to use name field of struct Lisp_Symbol
9302 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9304 Basic functions to set Lisp_Object and pointer slots of intervals.
9305 * intervals.h (interval_set_parent, interval_set_object):
9306 (interval_set_left, interval_set_right, interval_set_plist):
9307 (interval_copy_parent): New function.
9308 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9309 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9311 (INTERVAL_SIZE): Remove. Adjust users.
9312 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9314 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9316 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9317 * process.h (PGET): Remove.
9318 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9319 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9321 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9323 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9324 * window.h (WGET): Remove.
9325 (struct window): Do not use INTERNAL_FIELD.
9326 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9327 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9328 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9329 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9330 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9333 2012-08-07 Chong Yidong <cyd@gnu.org>
9335 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9336 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9337 (Fdelete_window_internal): Signal an error if the window is not on
9338 a live frame (Bug#12025).
9340 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9342 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9343 * frame.h (FGET): Remove.
9344 (struct frame): Do not use INTERNAL_FIELD.
9345 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9346 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9347 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9348 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9350 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9352 * w32.c: Silence compiler warnings.
9353 (map_w32_filename): Remove unused variable `is_fat'.
9354 (chase_symlinks): Add parentheses around expression.
9356 2012-08-06 Glenn Morris <rgm@gnu.org>
9358 * sysdep.c: Respect BROKEN_GETWD.
9360 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9361 Let configure handle it.
9362 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9364 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9366 Use GCALIGNMENT where appropriate.
9367 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9368 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9369 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9371 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9373 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9374 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9376 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9378 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9379 that should be sufficient for everyone.
9381 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9383 * keyboard.c (timer_check_2): Add break so timer_check returns next
9386 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9388 Fix Windows build errors introduced after converting to WGET and WSET.
9389 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9390 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9392 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9394 * nsterm.m (ns_frame_rehighlight): Use FSET.
9396 * nsmenu.m (ns_update_menubar): Use FSET.
9398 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9400 Separate read and write access to Lisp_Object slots of Lisp_Process.
9401 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9402 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9404 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9406 Separate read and write access to Lisp_Object slots of struct window.
9407 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9408 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9409 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9410 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9411 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9412 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9415 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9417 Fix Windows build errors introduced after converting to FGET and FSET.
9418 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9419 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9420 (w32_judge_scroll_bars): Change to use FSET.
9421 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9423 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9425 Fix replacement typo.
9426 * window.c (replace_window): Set root_window instead of
9427 selected_window. This fixes a total window subsystem
9428 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9430 2012-08-06 Glenn Morris <rgm@gnu.org>
9432 * lisp.mk (lisp): Add language/persian.elc.
9434 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9436 Separate read and write access to Lisp_Object slots of struct frame.
9437 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9438 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9439 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9440 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9441 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9443 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9445 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9447 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9449 Generalize common compile-time constants.
9450 * lisp.h (header_size, bool_header_size, word_size): Now here.
9451 (struct Lisp_Vector): Add comment.
9452 (struct Lisp_Bool_Vector): Move up to define handy constants.
9453 (VECSIZE, PSEUDOVECSIZE): Simplify.
9454 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9455 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9456 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9457 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9458 * xfont.c, xmenu.c: Use word_size where appropriate.
9460 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9462 * search.c (Freplace_match): Treat \? in the replacement text
9463 literally (Bug#8161).
9465 2012-08-05 Chong Yidong <cyd@gnu.org>
9467 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9468 * frame.c (Vdelete_frame_functions):
9469 * emacs.c (Vkill_emacs_hook): Doc fix.
9471 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9473 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9474 --with-x-toolkit=no builds.
9475 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9477 2012-08-04 Chong Yidong <cyd@gnu.org>
9479 * syntax.c (Fmodify_syntax_entry): Doc fix.
9481 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9483 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9484 * w32.c (init_environment): Change the default values of many
9485 environment variables in dflt_envvars[] to NULL, to avoid pushing
9486 them into environment when they were not already defined.
9487 Remove the code that deletes site-lisp subdirectories from the default
9488 value of EMACSLOADPATH, as it is no longer needed.
9489 (check_windows_init_file): Now external, not static.
9490 Use Vload_path as is, without adding anything, as this function is now
9491 called when Vload_path is already set up.
9493 * w32.h (check_windows_init_file): Add prototype.
9495 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9496 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9497 compatibility with Posix platforms.
9498 (main): Move the call to check_windows_init_file to here from
9500 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9501 any, in the DEFALT argument into the root of the Emacs build or
9502 installation tree, as appropriate.
9504 * callproc.c (init_callproc_1): Call decode_env_path instead of
9505 doing its equivalent by hand.
9506 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9507 the code that sets Vexec_path run on MS-Windows.
9509 * lread.c (init_lread): Add comments to #ifdef's.
9511 * msdos.c (dos_set_window_size, IT_update_begin)
9512 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9513 instead of direct references.
9515 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9517 Export DEFAULT_REHASH_* to GDB.
9518 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9519 Now constants, not macros.
9521 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9523 Remove unnecessary casts involving pointers.
9524 These casts are no longer needed now that we assume C89 or later,
9525 since they involve casting to or from void *.
9526 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9527 (make_pure_float, make_pure_vector):
9528 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9529 * macros.c (Fstart_kbd_macro):
9530 * menu.c (find_and_return_menu_selection):
9531 * minibuf.c (read_minibuf_noninteractive):
9532 * sysdep.c (closedir):
9533 * xdisp.c (x_produce_glyphs):
9534 * xfaces.c (compare_fonts_by_sort_order):
9535 * xfns.c (x_real_positions, select_visual):
9536 * xselect.c (x_stop_queuing_selection_requests)
9537 (x_get_window_property, x_get_window_property_as_lisp_data):
9538 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9539 Remove unnecessary pointer casts.
9540 * alloc.c (record_xmalloc): New function.
9541 * lisp.h (record_xmalloc): New decl.
9542 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9543 more like a function. This is because the pointer cast is not
9544 needed. All uses changed.
9545 * print.c (print_string, print_error_message): Avoid length recalc.
9547 Improve fix for macroexp crash with debugging (Bug#12118).
9548 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9549 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9550 not supposed to be invoked from the garbage collector.
9551 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9552 (gc_aset): New function, which is like ASET but can be
9553 used in the garbage collector.
9554 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9555 (set_hash_index): Use it instead of ASET.
9557 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9559 Support symlinks on latest versions of MS-Windows.
9560 * w32.c: Include winioctl.h and aclapi.h.
9561 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9562 (revert_to_self): Forward declarations of static functions.
9563 <static BOOL g_b_init_get_security_info>:
9564 <g_b_init_create_symbolic_link>: New static flags.
9565 (globals_of_w32): Initialize them to zero.
9566 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9567 (map_w32_filename): Improve commentary. Simplify switch.
9568 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9569 headers (most versions of MinGW w32api don't).
9570 (get_security_info, create_symbolic_link)
9571 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9573 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9574 in the argument file name.
9575 (sys_access): Call unc_volume_file_attributes only if
9576 GetFileAttributes fails with network-related error codes.
9577 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9578 have the required privileges.
9579 (get_file_security_desc_by_name): Rename from
9580 get_file_security_desc.
9581 (stat_worker): New function, with most of the guts of 'stat', and
9582 with addition of handling of symlinks and support for 'lstat'.
9583 If possible, get file's attributes and security information by
9584 handle, not by name. Produce S_IFLNK bit for symlinks, when
9585 called from 'lstat'.
9586 (stat, lstat): New functions, call 'stat_worker'.
9587 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9588 symlinks when the underlying filesystem supports them.
9590 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9592 Fix macroexp crash on Windows with debugging (Bug#12118).
9593 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9594 checking subscripts; problem introduced with the recent
9595 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9596 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9597 since it's used in non-static inline functions now.
9599 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9600 Don't assume buffer size fits in 'int'. Remove unused local.
9602 Use C99-style 'extern inline' if available.
9603 * buffer.h (BUFFER_INLINE):
9604 * category.h (CATEGORY_INLINE):
9605 * character.h (CHARACTER_INLINE):
9606 * charset.h (CHARSET_INLINE):
9607 * composite.h (COMPOSITE_INLINE):
9608 * dispextern.h (DISPEXTERN_INLINE):
9609 * lisp.h (LISP_INLINE):
9610 * systime.h (SYSTIME_INLINE):
9611 New macro, replacing 'static inline' in this header.
9612 * buffer.h, category.h, character.h, charset.h, composite.h:
9613 * dispextern.h, lisp.h, systime.h:
9614 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9615 * alloc.c (LISP_INLINE):
9616 * buffer.c (BUFFER_INLINE):
9617 * category.c (CATEGORY_INLINE):
9618 * character.c (CHARACTER_INLINE):
9619 * charset.c (CHARSET_INLINE):
9620 * composite.c (COMPOSITE_INLINE):
9621 * dispnew.c (DISPEXTERN_INLINE):
9622 * sysdep.c (SYSTIME_INLINE):
9623 Define to EXTERN_INLINE, so that the corresponding functions
9624 are compiled into code.
9625 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9626 (INLINE_HEADER_END): New macros.
9627 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9628 since it's used in non-static inline functions now.
9629 (VALMASK) [!USE_LSB_TAG]: Likewise.
9631 2012-08-02 Glenn Morris <rgm@gnu.org>
9633 * s/: Remove empty directory.
9635 * s/ms-w32.h: Move to ../nt/inc.
9636 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9637 Update for new ms-w32.h location.
9639 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9642 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9644 2012-08-02 Glenn Morris <rgm@gnu.org>
9646 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9647 hard-coding the path separator.
9649 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9651 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9652 This how ASET and AREF are supposed to work, and makes
9653 it easier to think about future improvements. See
9654 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9655 * charset.h (set_charset_attr): New function.
9656 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9657 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9658 (aref_addr): New function. All uses of &AREF(...) changed.
9659 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9660 (set_hash_index): New functions. All lvalue-style uses of
9661 HASH_KEY etc. changed.
9662 * keyboard.c (set_prop): New function. All lvalue-style uses
9665 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9667 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9668 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9669 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9670 * nsfns.m (ns_set_name_as_filename): Likewise.
9671 * nsmenu.m (ns_update_menubar): Likewise.
9672 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9674 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9676 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9677 Adapt to latest changes in field names of the corresponding Lisp
9680 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9682 2012-08-01 Glenn Morris <rgm@gnu.org>
9684 * s/msdos.h: Remove file.
9685 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9686 * Makefile.in (S_FILE): Remove.
9687 (config_h): Remove S_FILE.
9689 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9691 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9692 Remove; moved to nt/config.nt.
9694 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9696 Use INTERNAL_FIELD for conses and overlays.
9697 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9698 Remove obsolete comment.
9700 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9701 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9703 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9705 Use INTERNAL_FIELD for symbols.
9706 * lisp.h (SVAR): New macro. Adjust users.
9707 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9708 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9710 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9712 Use INTERNAL_FIELD for processes.
9713 * process.h (PVAR): New macro. Adjust style.
9714 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9715 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9717 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9719 Use INTERNAL_FIELD for windows.
9720 * window.h (WVAR): New macro.
9721 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9722 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9723 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9724 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9725 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9726 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9728 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9730 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9732 2012-08-01 Glenn Morris <rgm@gnu.org>
9734 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9735 Move to configure.ac.
9737 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9739 * makefile.w32-in (CONFIG_H): Update dependencies.
9740 (CONF_POST_H): New macro.
9742 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9744 2012-07-31 Glenn Morris <rgm@gnu.org>
9746 * Makefile.in (S_FILE): No longer set by configure.
9748 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9750 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9752 * process.h (NULL_DEVICE):
9753 * emacs.c (SEPCHAR):
9754 * editfns.c (USER_FULL_NAME): Let configure set them.
9756 * s/README, s/template.h: Remove files.
9758 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9760 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9761 Move to configure.ac.
9763 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9765 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9766 resulting renaming of 'struct frame' members.
9768 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9770 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9771 after introduction of FVAR.
9773 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9775 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9777 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9778 instead of compositeToPoint.
9779 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9781 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9783 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9785 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9786 * lisp.h (INTERNAL_FIELD): New macro.
9787 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9788 (BVAR): Change to use INTERNAL_FIELD.
9789 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9790 (KVAR): Change to use INTERNAL_FIELD.
9791 * frame.h (FVAR): New macro.
9792 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9793 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9794 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9795 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9796 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9798 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9800 Miscellaneous fixes for non-default X toolkits.
9801 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9802 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9803 Move under #ifdef USE_LUCID.
9804 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9805 definition and usage to avoid warnings.
9807 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9809 * nsterm.m (openFiles): Fix previous checkin.
9811 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9813 * indent.c (compute_motion): Remove unused local.
9815 2012-07-31 Glenn Morris <rgm@gnu.org>
9817 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9819 * conf_post.h [USG5_4]:
9820 Move remaining contents of s/usg5-4-common.h here.
9821 * s/usg5-4-common.h: Remove file.
9823 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9824 * s/irix6-5.h: Remove file.
9826 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9827 * s/darwin.h: Remove file.
9829 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9830 * s/hpux10-20.h: Remove file, which is now empty.
9832 2012-07-30 Glenn Morris <rgm@gnu.org>
9834 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9835 * Makefile.in (config_h): Add conf_post.h.
9836 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9838 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9840 * nsterm.m (ns_do_open_file): New variable.
9841 (ns_term_init): Set ns_do_open_file to YES after run returns.
9842 (openFile, openTempFile, openFileWithoutUI, openFiles):
9843 Open files only if ns_do_open_file.
9845 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9847 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9848 This no-op macro hasn't been needed for many years.
9849 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9851 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9852 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9853 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9854 gdb_make_enums_visible.
9855 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9856 (DIRECTORY_SEP): Now a constant, not a macro.
9858 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9860 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9861 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9863 * w32term.c <w32_keyboard_codepage>: Renamed from
9864 keyboard_codepage and now external. All users changed.
9866 * w32term.h: Add declaration of w32_keyboard_codepage.
9868 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9869 the codepage to translate keys to Unicode. If this argument is
9870 -1, use the value returned by GetConsoleCP. All callers changed.
9872 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9874 Update .PHONY listings in makefiles.
9875 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9876 bootstrap-clean, distclean, maintainer-clean, versioclean,
9879 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9880 This is a bit clearer. Fix some commentary typos.
9882 2012-07-30 Glenn Morris <rgm@gnu.org>
9884 * s/netbsd.h: Let configure include signal.h if needed.
9885 Remove file, which is now empty.
9887 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9888 Let configure set them.
9889 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9890 No more need to undefine.
9892 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9894 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9895 non-single-byte char when adding meta modifier. (Bug#12090)
9897 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9899 Convert safe_call to use variable number of arguments.
9900 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9901 (safe_call2): Fix comment.
9902 * lisp.h (safe_call): Adjust prototype.
9903 * coding.c (encode_coding_object): Change to use safe_call2.
9904 * xfaces.c (merge_face_heights): Change to use safe_call1.
9906 2012-07-30 Glenn Morris <rgm@gnu.org>
9908 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9909 does that unconditionally. Remove file, which is now empty.
9911 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9914 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9916 Export to GDB most of lisp.h's remaining object-like macros.
9917 * lisp.h (min, max): Move earlier, because they're used earlier now.
9918 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9919 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9920 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9921 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9922 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9923 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9924 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9925 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9926 Now constants, for GDB. They need not be macros.
9927 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9928 Now constants, for GDB, as well as macros, for static initializers.
9929 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9930 Move to after the definition of struct Lisp_Char_Table,
9931 since the former now needs that type defined.
9932 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9933 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9934 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9935 New enums, for gdb_make_enums_visible.
9936 (GLYPH_MODE_LINE_FACE): Remove; unused.
9937 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9938 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9939 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9940 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9941 enum maxargs, enum MAX_ALLOCA.
9942 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9943 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9944 no longer needed, now that they are done in lisp.h.
9946 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9948 Cleanup string bytes checking.
9949 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9950 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9951 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9952 (check_sblock, compact_small_strings): Simplify.
9954 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9956 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9957 These macros are confusing and no longer need to be defined, as
9958 the enum values now suffice. All uses replaced with definiens.
9959 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9961 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9963 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9964 ($(BLD)/w32console.$(O)): Update dependencies.
9966 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9968 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9969 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9971 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9973 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9975 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9976 setting sitelisp (Bug#12010).
9978 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9980 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9982 * w32heap.c (cache_system_info):
9983 * w32.c (sys_rename):
9984 * w32proc.c (find_child_console, sys_kill): All users changed.
9986 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9988 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9990 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9992 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9994 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9996 Cleanup statistics calculation in Fgarbage_collect.
9997 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9998 Fix zombies percentage calculation. Simplify elapsed time calculation.
10000 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10002 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10003 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10004 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10005 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10006 (replace_range, replace_range_2, del_range_2): Change to eassert.
10007 * marker.c (byte_char_debug_check): Adjust style.
10009 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10011 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10012 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10013 long-ago-commented-out code that talks about "WIN32".
10014 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10017 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10019 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10020 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10021 Simplify by using alignof.
10022 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10023 * lisp.h: Include <stdalign.h>.
10024 (GCALIGNMENT): New macro and constant.
10025 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10026 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10027 (stdalign): New macro, if not already defined.
10029 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10031 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10032 * w32inevt.c: Include w32inevt.h.
10033 (w32_read_console_input): New inline function, calls either
10034 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10035 w32_console_unicode_input.
10036 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10037 (w32_kbd_patch_key, key_event): Use the codepage returned by
10038 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10039 (key_event): use uChar.UnicodeChar only if
10040 w32_console_unicode_input is non-zero.
10042 * w32console.c: Include w32heap.h.
10043 <w32_console_unicode_input>: New global variable.
10044 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10045 family of Windows, zero otherwise.
10047 * w32inevt.h: Declare w32_console_unicode_input.
10049 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10050 --without-x. (Bug#11742)
10052 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10054 Adjust GDB to reflect pvec_type changes (Bug#12036).
10055 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10056 2012-07-04 changes to pseudovector representation.
10057 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10059 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10061 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10063 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10065 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10067 * alloc.c (listn): Fix the order the arguments are consed onto the
10070 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10071 enumeration constants, as PURE and HEAP are too general, and clash
10072 with other headers and sources, such as gmalloc.c and the
10073 MS-Windows system headers. All users changed.
10075 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10077 Revert last save_excursion_save and save_excursion_restore changes.
10078 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10079 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10081 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10083 Fix recently-introduced typos in Windows port.
10084 Reported by Martin Rudalics <rudalics@gmx.at>.
10085 * w32.c (init_environment): Replace comma with semicolon.
10086 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10088 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10090 Improve GDB symbol export (Bug#12036).
10091 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10092 arms of an 'if', not using conditional expressions; otherwise GDB
10093 complains about the types in the unevaluated arm when the argument
10094 is an integer literal.
10095 (xgetint): Simplify expression.
10096 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10097 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10098 Zaretskii in <http://bugs.gnu.org/12036#13>.
10099 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10100 needed now that we have gdb_make_enums_visible.
10101 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10102 (enum enum_USE_LSB_TAG):
10103 New enum types, packaging up enums that need to be exported to GDB.
10105 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10107 Utility function to make a list from specified amount of objects.
10108 * lisp.h (enum constype): New datatype.
10109 (listn): New prototype.
10110 * alloc.c (listn): New function.
10111 (Fmemory_use_count, syms_of_alloc): Use it.
10112 * buffer.c (syms_of_buffer): Likewise.
10113 * callint.c (syms_of_callint): Likewise.
10114 * charset.c (define_charset_internal): Likewise.
10115 * coding.c (syms_of_coding): Likewise.
10116 * keymap.c (syms_of_keymap): Likewise.
10117 * search.c (syms_of_search): Likewise.
10118 * syntax.c (syms_of_syntax): Likewise.
10119 * w32.c (init_environment): Likewise.
10120 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10121 * xdisp.c (syms_of_xdisp): Likewise.
10122 * xfns.c (syms_of_xfns): Likewise.
10124 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10126 Fast save_excursion_save and save_excursion_restore.
10127 * lisp.h (struct Lisp_Excursion): New data type.
10128 (PVEC_EXCURSION): New pseudovector type.
10129 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10130 to deal with it. Adjust comments.
10131 (init_marker, attach_marker): New prototype.
10132 (unchain_marker): Adjust prototype.
10133 * marker.c (attach_marker): Change to global.
10134 (init_marker): New function.
10135 * alloc.c (Fmake_marker, build_marker): Use it.
10136 (build_marker): More easserts.
10137 (mark_object): Handle struct Lisp_Excursion.
10138 * editfns.c (save_excursion_save, save_excursion_restore):
10139 Reimplement to use struct Lisp_Excursion. Add comments.
10141 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10143 Fix export of symbols to GDB (Bug#12036).
10144 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10145 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10146 emacs.c, as this is a more-suitable home. Had this been done earlier
10147 the fix for 12036 would have avoided some of the problems noted in
10148 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10149 would have been more obvious.
10150 * emacs.c: Do not include <verify.h>; no longer needed.
10151 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10152 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10153 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10154 Remove; now done in lisp.h.
10155 * lisp.h (PUBLISH_TO_GDB): New macro.
10156 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10157 (DATA_SEG_BITS): Use it.
10158 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10159 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10160 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10161 not be usable in #if. This simplifies things.
10163 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10165 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10167 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10169 Simplify export of symbols to GDB (Bug#12036).
10170 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10171 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10172 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10173 Adjust to changes in lisp.h and emacs.c, by using
10174 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10175 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10176 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10177 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10178 instead of gdb_valbits.
10179 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10180 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10181 instead of gdb_array_mark_flag.
10182 (xboolvector): Get size from $->size, not $->header.size.
10183 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10184 (xreload, hook-run, hookpost-run): Remove.
10185 * emacs.c: Include <verify.h>.
10186 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10187 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10189 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10190 (gdb_USE_LSB_TAG): New enum constants.
10191 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10192 Also define these as enum constants, so they're visible to GDB.
10193 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10194 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10195 as constants, so they're visible to GDB.
10196 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10197 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10198 Now enum constants, not macros, so they're visible to GDB.
10199 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10200 more convenient now. All uses changed.
10201 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10202 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10204 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10206 Explicitly free restriction data that are not needed anymore.
10207 * editfns.c (save_restriction_restore): Free restriction data.
10209 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10211 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10212 add argument, tune behavior, and adjust all callers.
10214 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10216 Use typedef for EMACS_INT, EMACS_UINT.
10217 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10218 than macros. This simplifies debugging in the usual case, since
10219 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10220 and it allows expressions involving EMACS_INT casts.
10221 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10223 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10225 * nsterm.m (ns_read_socket): Return early if there is a modal
10226 window (Bug#12043).
10228 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10230 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10231 that FOCUS-FRAME can be omitted.
10233 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10235 Adjust buffer text indirection counters at the end of Fkill_buffer.
10236 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10237 buffer is definitely dead. This should really fix an issue reported
10238 by Christoph Scholtes again. (Bug#12007).
10239 (init_buffer_once): Initialize indirection counters of
10240 buffer_defaults and buffer_local_symbols (for sanity and safety).
10242 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10244 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10245 and continuation glyphs on tooltip frames, leave them at zero.
10246 Avoids continued lines in tooltips. (Bug#11832)
10248 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10250 Simplify copy_overlay.
10251 * buffer.c (copy_overlay): Simplify. Use build_marker.
10252 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10254 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10256 * print.c (print_object): Don't crash when a frame's name is nil
10257 or invalid. (Bug#12025)
10259 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10260 it signals an error when a tooltip frame is being created.
10262 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10264 Cleanup miscellaneous objects allocation and initialization.
10265 * alloc.c (allocate_misc): Change to static. Add argument to
10266 specify the subtype. Adjust comment and users.
10267 (build_overlay): New function.
10268 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10269 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10270 (allocate_misc): Remove prototype.
10271 (build_overlay): Add prototype.
10273 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10275 Swap buffer text indirection counters in Fbuffer_swap_text.
10276 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10277 This avoids crash reported by Christoph Scholtes at
10278 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10280 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10282 * nsmenu.m (Popdown_data): New struct.
10283 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10285 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10286 (initWithContentRect): Make imgView and contentView non-static
10287 and autorelease them. Also autorelease img and matrix (Bug#12005).
10288 (dealloc): Remove (Bug#12005).
10290 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10292 Adjust consing_since_gc when objects are explicitly freed.
10293 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10294 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10295 (free_cons, free_misc): Subtract object size from consing_since_gc.
10297 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10299 Simplify and cleanup markers positioning code.
10300 * marker.c (attach_marker): More useful eassert.
10301 (live_buffer, set_marker_internal): New function.
10302 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10303 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10305 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10307 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10308 as it's limited by the amount of memory, not by INT_MAX.
10310 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10312 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10313 in special-event-map. See the discussion at
10314 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10317 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10318 info.dwItemData. Fixes crashes on 64-bit Windows.
10319 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10321 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10323 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10324 (conversationIdentifier): Return value is NSInteger.
10325 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10327 2012-07-21 Chong Yidong <cyd@gnu.org>
10329 * window.c (decode_any_window): Signal an error if the window is
10330 on a dead frame (Bug#11984).
10332 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10334 Add indirection counting to speed up Fkill_buffer.
10335 * buffer.h (struct buffer): New member.
10336 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10337 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10338 base buffer indirection counter.
10339 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10340 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10341 through buffer list if indirection counter is 0.
10343 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10345 Extend the value returned by Fgarbage_collect with heap statistics.
10346 * alloc.c (Qheap): New symbol.
10347 (syms_of_alloc): DEFSYM it.
10348 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10349 (Fmemory_free): Remove.
10350 (syms_of_alloc): Don't defsubr it.
10351 * buffer.c (Fcompact_buffer): Remove.
10352 (syms_of_buffer): Don't defsubr it.
10354 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10356 Make maybe_gc inline.
10357 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10358 * lisp.h (consing_since_gc, gc_relative_threshold)
10359 (memory_full_cons_threshold): Revert declaration.
10360 (maybe_gc): Remove prototype, define as inline.
10361 * alloc.c: Remove old commented-out code.
10362 (consing_since_gc, gc_relative_threshold)
10363 (memory_full_cons_threshold): Revert to global.
10364 (maybe_gc): Remove.
10366 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10368 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10369 * lisp.h (build_unibyte_string): New function.
10370 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10371 * sysdep.c, w32fns.c, xfns.c: Use it.
10372 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10373 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10374 Adjust users accordingly.
10375 * font.h (font_open_by_name): Adjust prototype.
10377 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10379 Cleanup calls to Fgarbage_collect.
10380 * lisp.h (maybe_gc): New prototype.
10381 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10382 Remove declarations.
10383 * alloc.c (maybe_gc): New function.
10384 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10386 * bytecode.c (MAYBE_GC): Use maybe_gc.
10387 * eval.c (eval_sub, Ffuncall): Likewise.
10388 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10389 to avoid dependency from auto-save feature.
10391 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10393 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10394 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10395 'for_each_per_buffer_object_at'.
10396 All uses changed. It's better to use upper-case for macros that
10397 cannot be implemented as functions, to give the reader a clue
10398 that they're special.
10400 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10402 * alloc.c (Fgarbage_collect): Tweak docstring.
10404 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10406 Tweak the value returned from Fgarbage_collect again.
10407 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10408 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10409 Adjust documentation.
10410 (total_vector_bytes): Rename to total_vector_slots, adjust
10412 (total_free_vector_bytes): Rename to total_free_vector_slots,
10414 (Qstring_bytes, Qvector_slots): New symbols.
10415 (syms_of_alloc): DEFSYM them.
10417 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10419 Buffer compaction primitive which may be used from Lisp.
10420 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10421 (syms_of_buffer): Register Fcompact_buffer.
10422 * alloc.c (Fgarbage_collect): Use compact_buffer.
10423 * buffer.h (compact_buffer): New prototype.
10424 (struct buffer_text): New member.
10426 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10428 New macro to iterate over all buffers, miscellaneous cleanups.
10429 * lisp.h (all_buffers): Remove declaration.
10430 * buffer.h (all_buffers): Add declaration, with comment.
10431 (for_each_buffer): New macro.
10432 * alloc.c (Fgarbage_collect, mark_object): Use it.
10433 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10434 (init_buffer): Likewise.
10435 * data.c (Fset_default): Likewise.
10436 * coding.c (code_conversion_restore): Remove redundant check
10438 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10440 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10442 Fix bug that created negative-length intervals.
10443 * intervals.c (merge_interval_right, merge_interval_left):
10444 Do not zero out this interval if it is absorbed by its children,
10445 as this interval's total length doesn't change in that case. See
10446 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10448 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10450 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10451 when invoking (make-bool-vector N t) and N is a positive
10452 multiple of 8 -- the last 8 bits were mistakenly cleared.
10454 Remove some struct layout assumptions in bool vectors.
10455 * alloc.c (bool_header_size): New constant.
10456 (header_size, word_size): Move earlier, as they're now used earlier.
10457 Use 'word_size' in a few more places, where it's appropriate.
10458 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10459 padding before the data member of a bool vector.
10460 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10461 than doing the check by hand with an abort ().
10463 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10465 * eval.c (Fdefvar): Don't check constants since we only set the var if
10466 it's not yet defined anyway (bug#11904).
10468 * lisp.h (last_undo_boundary): Declare new var.
10469 * keyboard.c (command_loop_1): Set it.
10470 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10471 were auto-added by the command loop (bug#11774).
10473 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10475 * w32font.c (Qsymbol): Remove local definition.
10476 (syms_of_w32font): Don't DEFSYM it.
10478 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10480 Fix sweep_vectors to handle large bool vectors correctly.
10481 * alloc.c (sweep_vectors): Account total_vector_bytes for
10482 bool vectors larger than VBLOCK_BYTES_MAX.
10484 2012-07-18 Chong Yidong <cyd@gnu.org>
10486 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10487 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10489 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10491 Return more descriptive data from Fgarbage_collect.
10492 Suggested by Stefan Monnier in
10493 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10494 * alloc.c (bounded_number): New function.
10495 (total_buffers, total_vectors): New variable.
10496 (total_string_size): Rename to total_string_bytes, adjust users.
10497 (total_vector_size): Rename to total_vector_bytes, adjust users.
10498 (sweep_vectors): Account total_vectors and total_vector_bytes.
10499 (Fgarbage_collect): New return value. Adjust documentation.
10500 (gc_sweep): Account total_buffers.
10501 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10502 (VECTOR_SIZE): Remove.
10503 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10504 (Qinterval, Qmisc): New symbols.
10505 (syms_of_data): Initialize them.
10506 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10507 (Qcons, Qbuffer): New declarations.
10509 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10511 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10512 Round up, not down. Improve doc.
10514 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10516 Restore old code in allocate_string_data to avoid Faset breakage.
10517 Reported by Julien Danjou <julien@danjou.info> in
10518 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10519 * alloc.c (allocate_string_data): Restore old code with minor
10520 adjustments, fix comment to explain this subtle issue.
10522 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10524 Remove FILE_SYSTEM_CASE.
10525 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10527 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10528 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10529 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10530 call-process-region passes it through expand-file-name.
10532 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10534 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10536 Fix crash when creating indirect buffer (Bug#11917)
10537 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10538 Don't handle unbound variables specially if non-zero.
10539 (Fbuffer_local_variables): Pass zero.
10540 (clone_per_buffer_values): Pass non-zero.
10542 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10544 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10545 to make the loop interruptible.
10547 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10549 * gnutls.c (emacs_gnutls_handshake): Only retry if
10550 GNUTLS_E_INTERRUPTED.
10552 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10554 Cleanup and convert miscellaneous checks to eassert.
10555 * alloc.c (mark_interval): Fix comment, partially rephrase
10556 old comment from intervals.h (see below).
10557 * intervals.c (find_interval, adjust_intervals_for_insertion)
10558 (delete_interval, adjust_intervals_for_deletion)
10559 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10560 Convert to eassert.
10561 (adjust_intervals_for_insertion, make_new_interval):
10562 Remove obsolete and unused code.
10563 * intervals.h (struct interval): Remove obsolete comment.
10564 * textprotp.c (erase_properties): Remove unused code.
10565 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10566 (Fremove_list_of_text_properties): Convert to eassert.
10568 2012-07-17 Chong Yidong <cyd@gnu.org>
10570 * editfns.c (Finsert_char): Doc fix.
10572 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10574 Fix previous change to make Fmemory_free always accurate.
10575 * alloc.c (make_interval): Update total_free_intervals.
10576 (make_float): Likewise for total_free_floats.
10577 (free_cons, Fcons): Likewise for total_free_conses.
10578 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10579 Likewise for total_free_vector_bytes.
10580 (Fmake_symbol): Likewise for total_free_symbols.
10581 (bytes_free): Remove.
10583 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10585 Simple free memory accounting feature.
10586 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10587 (sweep_vectors): Accumulate size of free vectors.
10588 (Fgarbage_collect): Setup bytes_free.
10589 (Fmemory_free): New function.
10590 (syms_of_alloc): Register it.
10592 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10594 Cleanup overlays checking.
10595 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10596 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10597 eassert and OVERLAYP.
10598 (sort_overlays): Change to use OVERLAYP.
10600 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10602 * editfns.c (Finsert_char): Make it interactive, and make the
10603 second arg optional. Copy interactive spec and docstring from
10606 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10608 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10609 Unlike the other wrapped functions, fabs has an unspecified
10612 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10614 * nsterm.m (keyDown): Interpret flags without left/right bits
10615 as the left key (Bug#11670).
10617 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10619 Remove empty and useless init functions.
10620 * lisp.h (init_character_once, init_fns, init_image)
10621 (init_filelock, init_sound): Remove prototype.
10622 * character.c (init_character_once): Remove.
10623 * filelock.c (init_filelock): Likewise.
10624 * fns.c (init_fns): Likewise.
10625 * image.c (init_image): Likewise.
10626 * sound.c (init_sound): Likewise.
10627 * emacs.c (main): Adjust accordingly.
10629 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10631 * gtkutil.h: Tiny cleanups.
10632 (use_old_gtk_file_dialog): Remove useless declaration.
10633 (xg_uses_old_file_dialog): Add suggested const attribute.
10635 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10637 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10638 (bidi_paragraph_init): Use it to limit search forward for a strong
10639 directional character in abnormally large paragraphs full of
10640 neutral or weak characters. (Bug#11943)
10642 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10644 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10645 the toolbar (Bug#9451).
10646 (xg_make_tool_item): Give the widget event box a transparent
10649 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10651 Cleanup basic allocation variables and functions.
10652 * alloc.c (ignore_warnings, init_intervals, init_float)
10653 (init_cons, init_symbol, init_marker): Remove.
10654 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10655 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10656 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10657 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10658 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10659 (staticidx, init_alloc_once, init_strings, free_ablock):
10660 Remove redundant initialization.
10661 * fns.c (init_weak_hash_tables): Remove.
10662 * lisp.h (init_weak_hash_tables): Remove prototype.
10664 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10666 Use zero_vector where appropriate.
10667 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10669 * lisp.h (zero_vector): New declaration.
10670 * font.c (null_vector): Remove.
10671 (syms_of_font): Remove initialization and staticpro.
10672 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10673 * keymap.c (Faccessible_keymaps): Likewise.
10675 2012-07-15 Leo Liu <sdl.web@gmail.com>
10677 * fringe.c: Fix typo in comments.
10679 2012-07-14 Leo Liu <sdl.web@gmail.com>
10681 * fringe.c: Add a new bitmap exclamation-mark.
10683 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10685 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10687 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10688 (HAVE_MENUS): Don't define, defined by editing config.in with
10690 (GMALLOC_INHIBIT_VALLOC): Don't define.
10691 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10693 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10695 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10697 2012-07-14 Glenn Morris <rgm@gnu.org>
10699 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10700 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10701 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10703 2012-07-13 Glenn Morris <rgm@gnu.org>
10705 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10707 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10708 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10710 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10712 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10713 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10714 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10715 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10717 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10718 as boolean expression.
10719 (x_set_window_size): Remove unused variable toolbar.
10720 (ns_get_color_default, ns_mod_to_lisp): Remove.
10721 (ns_mouse_position): Remove unused variables xchar and ychar.
10722 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10723 (ns_set_vertical_scroll_bar): Remove unused variable count.
10724 (ns_delete_terminal): Remove unused variable i.
10725 (ns_term_init): Remove unused variables r, g and b.
10726 (mouseDown): Remove unused variable window.
10727 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10728 (initFrameFromEmacs): Remove unused variable vbextra.
10729 (mouseEntered): Remove unused variables p and dpyinfo.
10730 (mouseExited): Remove unused variables p and r.
10731 (ns_define_frame_cursor, ns_clear_frame_area)
10732 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10733 (menuDown): Assign [sender tag] to variable and cast the variable.
10735 * nsterm.h (menuDown): Add id as type to argument sender.
10736 (ns_display_info_for_name): Add Lisp_Object argument.
10737 (ns_term_init): Add Lisp_Object argument.
10738 (ns_map_event_to_object): Add void argument.
10739 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10740 prototype with arguments and only declare if __OBJC__.
10741 (nxatoms_of_nsselect): Add void argument.
10742 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10743 (ns_alloc_autorelease_pool): Add void argument.
10744 (ns_release_autorelease_pool): Add void* argument.
10745 (ns_get_defaults_value): Add const char* argument.
10747 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10748 (initFromContents): Use SSDATA where appropriate.
10749 (ns_update_menubar): Add braces to ambigous if-else.
10750 (initWithTitle): Put () around assignment in if statement.
10751 (ns_menu_show): Remove unused variables window and keymap.
10752 (update_frame_tool_bar): Remove unused variable selected_p.
10753 (initWithContentRect): Remove unused variable this_cmd_name.
10755 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10757 (setXBMColor): Remove unused variable len.
10758 (setPixmapData): Put () around assignment in loop statement.
10760 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10761 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10763 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10764 around assignment in loop statement.
10765 (nsfont_open): Remove unused variable i.
10766 (nsfont_open): Remove unused variable len.
10767 (nsfont_draw): Remove unused variable cs.
10769 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10770 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10771 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10772 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10773 (Fns_font_name, Fns_perform_service)
10774 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10775 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10776 (ns_set_name): Remove unused variable view.
10777 (x_set_menu_bar_lines): Remove unused variable olines.
10778 (x_set_tool_bar_lines): Remove unused variable root_window.
10779 (Fns_list_colors): Put () around assignment in while statement.
10780 (Fns_perform_service): Remove unused variable len.
10781 (Fns_display_usable_bounds): Remove unused variable top.
10782 (syms_of_nsfns): Remove unused variable i.
10784 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10785 memcpy (Bug#11907).
10787 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10789 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10790 and free it with DestroyExceptionInfo (Bug#11558).
10792 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10794 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10795 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10796 Set here, not in nt/config.nt.
10798 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10800 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10801 cursor overflow into the last glyph on display line when the right
10802 fringe is off. (Bug#11832)
10804 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10806 * xdisp.c (produce_special_glyphs): Now static.
10807 * dispextern.h (produce_special_glyphs): Remove decl.
10809 2012-07-13 Glenn Morris <rgm@gnu.org>
10811 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10812 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10814 * s/usg5-4-common.h (USG, USG5):
10815 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10816 * s/sol2-6.h (SOLARIS2):
10817 * s/irix6-5.h (IRIX6_5):
10818 * s/hpux10-20.h (USG, USG5, HPUX):
10819 * s/gnu-linux.h (USG, GNU_LINUX):
10820 * s/freebsd.h (BSD_SYSTEM):
10821 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10822 * s/cygwin.h (CYGWIN):
10823 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10824 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10826 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10828 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10830 2012-07-13 Glenn Morris <rgm@gnu.org>
10832 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10834 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10836 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10837 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10839 2012-07-12 Glenn Morris <rgm@gnu.org>
10841 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10843 * process.c (init_process_emacs): Rename from init_process.
10844 The old name is also the name of a Mach system call.
10845 * lisp.h, emacs.c: Update for this name change.
10846 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10849 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10851 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10852 memmove call that removes glyphs covered by the left truncation
10853 glyph. Improve commentary.
10854 (display_line): Fix display of continuation glyphs on GUI frames
10855 when the right fringe is turned off and variable-size fonts are
10856 used in the window. Move the code that appends a stretch glyph to
10857 produce_special_glyphs, so that it could be used for truncation
10858 and continuation glyphs alike.
10859 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10860 glyph of a suitably computed width, to align the special glyphs at
10861 the window margin. Code moved from display_line. (Bug#11832)
10863 2012-07-12 Glenn Morris <rgm@gnu.org>
10865 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10867 * s/gnu-linux.h, s/hpux10-20.h:
10868 Do not unconditionally define HAVE_XRMSETDATABASE.
10870 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10872 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10874 Fix typos that broke OS X build.
10875 Reported by Randal L. Schwartz in
10876 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10877 * nsterm.m (ns_timeout): Add missing local decl.
10878 (ns_get_color): snprintf -> sprintf, to fix typo.
10880 2012-07-12 Glenn Morris <rgm@gnu.org>
10882 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10883 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10884 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10885 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10887 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10888 Move PTY_OPEN to configure.
10890 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10891 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10892 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10894 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10896 Use empty_unibyte_string where applicable.
10897 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10898 * lread.c (read1): Likewise.
10899 * xsettings.c (syms_of_xsettings): Likewise.
10901 2012-07-12 Glenn Morris <rgm@gnu.org>
10903 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10904 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10905 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10906 * s/hpux10-20.h (RUN_TIME_REMAP):
10907 * s/bsd-common.h (TABDLY): Move to configure.
10909 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10911 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10913 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10914 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10916 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10918 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10919 * s/template.h: Move NARROWPROTO to configure.
10921 2012-07-11 Glenn Morris <rgm@gnu.org>
10923 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10924 unused since 2011-01-17 change to systty.h.
10926 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10927 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10928 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10930 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10932 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10934 2012-07-11 Glenn Morris <rgm@gnu.org>
10936 * s/darwin.h, s/gnu-linux.h, s/template.h:
10937 Move INTERRUPT_INPUT to configure.
10939 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10941 Minor adjustments to interning code.
10942 * lisp.h (intern, intern_c_string): Redefine as static inline
10943 wrappers for intern_1 and intern_c_string_1, respectively.
10944 (intern_1, intern_c_string_1): Rename prototypes.
10945 * lread.c (intern_1, intern_c_string_1, oblookup):
10946 Simplify Vobarray checking.
10947 * font.c (font_intern_prop): Likewise. Adjust comment.
10948 * w32font.c (intern_font_name): Likewise.
10950 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10952 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10954 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10955 of Fcar/Fcdr if possible.
10956 * font.c (check_otf_features): Likewise.
10957 * fontset.c (Fnew_fontset): Likewise.
10958 * gnutls.c (Fgnutls_boot): Likewise.
10959 * minibuf.c (read_minibuf): Likewise.
10960 * msdos.c (IT_set_frame_parameters): Likewise.
10961 * xmenu.c (Fx_popup_dialog): Likewise.
10962 * w32menu.c (Fx_popup_dialog): Likewise.
10964 2012-07-11 Glenn Morris <rgm@gnu.org>
10966 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10967 since nothing has defined it on these platforms.
10969 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10970 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10972 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10973 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10974 Move CLASH_DETECTION to configure.
10976 * s/gnu.h: Remove file, which is now empty.
10978 * s/gnu.h, s/gnu-linux.h:
10979 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10981 2012-07-11 John Wiegley <johnw@newartisans.com>
10983 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10984 function attribute, so we only use it if it exists in the
10987 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10989 Avoid call to strlen in fast_c_string_match_ignore_case.
10990 * search.c (fast_c_string_match_ignore_case): Change to use
10991 length argument. Adjust users accordingly.
10992 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10994 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10996 Assume mkdir, rmdir.
10997 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10998 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11001 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11004 * s/hpux10-20.h (HAVE_PERROR): Remove.
11005 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11006 Remove dummy definition, as this problem was obsolete long ago.
11009 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11011 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11013 Avoid calls to strlen in font processing functions.
11014 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11015 (font_open_by_name): Change to use length argument.
11016 Adjust users accordingly.
11017 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11019 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11020 Change to return ptrdiff_t.
11021 (xfont_list_pattern, xfont_match): Use length returned by
11022 xfont_decode_coding_xlfd.
11023 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11025 2012-07-11 Glenn Morris <rgm@gnu.org>
11027 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11028 Move DONT_REOPEN_PTY to configure.
11030 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11031 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11033 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11035 Remove "#define unix" that is no longer needed (Bug#11905).
11036 * s/aix4-2.h (unix): Remove; no longer needed.
11038 EMACS_TIME simplification (Bug#11875).
11039 This replaces macros (which typically do not work in GDB)
11040 with functions, typedefs and enums, making the code easier to debug.
11041 The functional style also makes code easier to read and maintain.
11042 * systime.h: Include <sys/time.h> on all hosts, not just if
11043 WINDOWSNT, since 'struct timeval' is needed in general.
11044 (EMACS_TIME): Now a typedef, not a macro.
11045 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11047 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11048 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11049 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11050 (EMACS_TIME_LE): Now functions, not macros.
11051 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11052 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11053 which are not functions. All uses rewritten to use:
11054 (make_emacs_time): New function.
11055 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11056 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11057 not functions. All uses rewritten to use the following, respectively:
11058 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11059 (add_emacs_time, sub_emacs_time): New functions.
11060 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11061 * fileio.c (Fcopy_file):
11062 * xterm.c (XTflash): Get the current time closer to when it's used.
11063 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11065 * bytecode.c (targets): Suppress -Woverride-init warnings.
11067 Simplify by avoiding confusing use of strncpy etc.
11068 * doc.c (Fsnarf_documentation):
11069 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11070 * frame.c (Fmake_terminal_frame):
11071 * gtkutil.c (get_utf8_string):
11073 * nsmenu.m (ns_update_menubar):
11074 * regex.c (regerror):
11075 Prefer memcpy to strncpy and strncat when either will do.
11076 * fileio.c (Fsubstitute_in_file_name):
11077 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11078 (menu_separator_name_p):
11079 * nsmenu.m (ns_update_menubar):
11080 Prefer memcmp to strncmp when either will do.
11081 * nsterm.m: Include <ftoastr.h>.
11083 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11084 Prefer snprintf to strncpy.
11085 * nsterm.m (ns_term_init):
11086 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11087 * nsterm.m (ns_term_init):
11088 Avoid the need for strncpy, by using build_string or
11089 make_unibyte_string directly. Use dtoastr, not snprintf.
11090 * process.c (Fmake_network_process): Diagnose service names that
11091 are too long, rather than silently truncating them or creating
11092 non-null-terminated names.
11093 (Fnetwork_interface_info): Likewise, for interface names.
11094 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11095 Prefer sprintf to strncat.
11096 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11097 Prefer vsnprintf to vsprintf + strncpy.
11099 2012-07-10 Glenn Morris <rgm@gnu.org>
11101 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11102 Clarify fallback case.
11104 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11106 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11107 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11108 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11109 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11110 where argument type is known to be a Lisp_Cons.
11112 2012-07-10 Tom Tromey <tromey@redhat.com>
11114 * bytecode.c (BYTE_CODE_THREADED): New macro.
11115 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11116 (enum byte_code_op): New type.
11117 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11118 (exec_byte_code): Use them. Use token threading when applicable.
11120 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11122 Optimize pure C strings initialization.
11123 * lisp.h (make_pure_string): Fix prototype.
11124 (build_pure_c_string): New function, defined as static inline. This
11125 provides a better opportunity to optimize away calls to strlen when
11126 the function is called with compile-time constant argument.
11127 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11128 argument, adjust users accordingly. Use build_pure_c_string where
11130 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11131 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11132 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11134 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11136 Avoid calls to strlen in miscellaneous functions.
11137 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11138 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11139 * lread.c (openp): Likewise.
11141 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11143 Avoid calls to strlen in path processing functions.
11144 * fileio.c (file_name_as_directory): Add comment. Change to add
11145 srclen argument and return the length of result. Adjust users
11147 (directory_file_name): Fix comment. Change to add srclen argument,
11148 swap 1st and 2nd arguments to obey the common convention.
11149 Adjust users accordingly.
11150 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11152 2012-07-10 Glenn Morris <rgm@gnu.org>
11154 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11155 Move PENDING_OUTPUT_COUNT definition to configure.
11157 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11158 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11159 * s/gnu.h (DATA_START): Move definitions to configure.
11161 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11162 We include usg5-4-common.h, which defines them both.
11164 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11165 O_RDONLY already includes it).
11167 Stop ns builds setting the EMACSLOADPATH environment variable.
11168 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11169 Now it does not set EMACSLOADPATH, just returns the load-path string.
11170 * nsterm.h: Update accordingly.
11171 * lread.c [HAVE_NS]: Include nsterm.h.
11172 (init_lread) [HAVE_NS]: Use ns_load_path.
11173 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11175 2012-07-09 Glenn Morris <rgm@gnu.org>
11177 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11178 since the included bsd-common.h does so.
11180 Stop ns builds setting the EMACSPATH environment variable.
11181 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11182 (ns_init_paths): Do not set EMACSPATH.
11183 * nsterm.h (ns_exec_path): Add it.
11184 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11187 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11189 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11191 * process.c (wait_reading_process_output): 'waitchannels' was unset
11192 when read_kbd || !NILP (wait_for_cell); fix this.
11194 Add GCC-style 'const' attribute to functions that can use it.
11195 * character.h (char_resolve_modifier_mask):
11196 * keyboard.h (make_ctrl_char):
11197 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11198 (init_character_once, next_almost_prime, init_fns, init_image)
11199 (flush_pending_output, init_sound):
11200 * mem-limits.h (start_of_data):
11201 * menu.h (finish_menu_items):
11202 Add ATTRIBUTE_CONST.
11203 * emacs.c (DEFINE_DUMMY_FUNCTION):
11204 Declare the dummy function with ATTRIBUTE_CONST.
11205 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11206 Add decls with ATTRIBUTE_CONST.
11208 Minor improvements to make_formatted_string.
11209 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11210 where int is good enough, as vsprintf returns an int.
11211 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11213 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11215 Use make_formatted_string to avoid double length calculation.
11216 * lisp.h (make_formatted_string): New prototype.
11217 * alloc.c (make_formatted_string): New function.
11218 * buffer.c (Fgenerate_new_buffer_name): Use it.
11219 * dbusbind.c (syms_of_dbusbind): Likewise.
11220 * editfns.c (Fcurrent_time_zone): Likewise.
11221 * filelock.c (get_boot_time): Likewise.
11222 * frame.c (make_terminal_frame, set_term_frame_name)
11223 (x_report_frame_params): Likewise.
11224 * image.c (gs_load): Likewise.
11225 * minibuf.c (get_minibuffer): Likewise.
11226 * msdos.c (dos_set_window_size): Likewise.
11227 * process.c (make_process): Likewise.
11228 * xdisp.c (ensure_echo_area_buffers): Likewise.
11229 * xsettings.c (apply_xft_settings): Likewise.
11231 2012-07-09 Glenn Morris <rgm@gnu.org>
11233 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11234 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11235 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11236 * nsterm.h (ns_etc_directory): Add it.
11237 * callproc.c [HAVE_NS]: Include nsterm.h.
11238 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11240 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11242 Move marker debugging code under MARKER_DEBUG.
11243 * marker.c (MARKER_DEBUG): Move marker debugging code under
11244 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11245 for bootstrap with --enable-checking (~3x slowdown reported
11246 by Juanma Barranquero <lekktu@gmail.com>).
11247 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11249 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11251 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11252 See <http://bugs.gnu.org/11825#29>.
11254 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11256 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11257 has no font, use the frame's font. (Bug#11813)
11258 (display_line): Add commentary about displaying truncation glyphs
11260 (produce_special_glyphs): Move here from term.c.
11262 * term.c (produce_special_glyphs): Move to xdisp.c.
11264 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11267 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11269 * xdisp.c (display_line): Avoid warning about implicit declaration
11272 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11274 * lisp.h: Remove empty conditional.
11276 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11278 * lread.c (load_path_check): Now static.
11280 Fix some minor --with-ns problems found by static checking.
11281 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11282 (x_set_font) [!HAVE_X_WINDOWS]:
11283 * image.c (xpm_load_image) [HAVE_NS]:
11284 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11285 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11286 Remove unused local.
11287 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11288 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11289 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11290 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11291 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11292 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11293 Fix pointer signedness problem.
11294 * xfaces.c (FRAME_X_FONT_TABLE):
11295 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11297 2012-07-07 Glenn Morris <rgm@gnu.org>
11299 * lread.c (load_path_check): New function, split from init_lread.
11300 (init_lread): Reorganize. Motivation:
11301 If EMACSLOADPATH is set, check/warn about that rather than the
11302 defaults, which we are not going to use. Hence we can remove
11303 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11304 Don't warn if site-lisp directories are missing.
11305 If not installed, start from a blank load-path, since
11306 PATH_LOADSEARCH refers to the eventual installation directories.
11308 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11310 Support truncation and continuation glyphs on GUI frames, when
11311 fringes are disabled. (Bug#11832)
11312 * xdisp.c (init_iterator): Get dimensions of truncation and
11313 continuation glyphs even if on GUI frames.
11314 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11315 or both, are absent.
11316 (start_display, move_it_in_display_line_to): Handle the case of a
11317 GUI frame without a fringe to display continuation or truncation
11319 (insert_left_trunc_glyphs): Support GUI frames: make sure
11320 truncation glyphs overwrite enough glyphs from the current line to
11321 have sufficient space in pixels.
11322 (display_line): Support truncation and continuation glyphs on GUI
11323 frames. If some spare pixels are left on the line after inserting
11324 the truncation glyphs, fill that space with a stretch glyph of a
11325 suitably computed width.
11327 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11328 produce_glyphs, to support GUI sessions.
11330 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11332 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11334 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11336 Do not require float-time's arg to fit in time_t (Bug#11825).
11337 This works better on hosts where time_t is unsigned, and where
11338 float-time is applied to the (negative) difference between two times.
11339 * editfns.c (decode_time_components): Last arg is now double *,
11340 not int *, and means to store all the result as a double, without
11341 worrying about whether the seconds part fits in time_t.
11342 All callers changed.
11343 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11344 All callers changed.
11345 (Ffloat_time): Do not fail merely because the specified time falls
11346 outside of time_t range.
11348 2012-07-07 Glenn Morris <rgm@gnu.org>
11350 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11351 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11352 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11354 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11356 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11357 Update dependencies.
11359 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11361 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11363 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11364 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11365 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11366 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11367 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11368 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11370 * xfont.c (compare_font_names): Redo to omit the need for casts.
11372 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11374 * xfns.c (Fx_change_window_property): Doc fix.
11375 * w32fns.c (Fx_change_window_property): Doc fix.
11377 * w32fns.c (Fx_window_property): Accept the same arguments as the
11378 X Windows version. Doc fix.
11379 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11381 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11382 Eli Zaretskii <eliz@gnu.org>
11384 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11385 Windows-specific code from nt/config.nt moved here.
11386 Obsolete settings removed.
11388 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11390 * process.c: Avoid unnecessary calls to gettime.
11391 (wait_reading_process_output): Don't get the time of day
11392 when gobbling data immediately and not waiting, as there's no need
11393 for it in that case. This removes a FIXME.
11395 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11397 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11398 is defined (Bug#11768).
11400 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11402 Fix marker debugging code.
11403 * marker.c (byte_char_debug_check): Do not perform the check
11404 if buffer is not multibyte.
11405 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11406 Call byte_char_debug_check with correct arguments.
11408 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11410 Compile marker debugging code only if ENABLE_CHECKING is defined.
11411 * marker.c (byte_char_debug_check, count_markers):
11412 Use only if ENABLE_CHECKING is defined.
11413 (byte_debug_flag): Remove.
11414 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11415 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11417 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11419 Avoid code repetition in marker-related functions.
11420 * marker.c (attach_marker): New function.
11421 (Fset_marker, set_marker_restricted, set_marker_both)
11422 (set_marker_restricted_both): Use it.
11423 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11424 Consistently rename charno to charpos.
11425 (marker_position): Add eassert.
11426 (marker_byte_position): Convert to eassert.
11428 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11430 Simplify list operations in unchain_overlay and unchain_marker.
11431 * buffer.c (unchain_overlay): Simplify. Add comment.
11432 * marker.c (unchain_marker): Simplify. Fix comments.
11434 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11436 Introduce fast path for the widely used marker operation.
11437 * alloc.c (build_marker): New function.
11438 * lisp.h (build_marker): New prototype.
11439 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11440 * composite.c (autocmp_chars): Likewise.
11441 * editfns.c (buildmark): Remove.
11442 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11443 (save_restriction_save): Use build_marker.
11444 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11445 * window.c (save_window_save): Likewise.
11447 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11449 Do not use Fdelete_overlay in delete_all_overlays
11450 to avoid redundant calls to unchain_overlay.
11451 * buffer.c (drop_overlay): New function.
11452 (delete_all_overlays, Fdelete_overlay): Use it.
11453 * minibuf.c (get_minibuffer): Fix comment.
11455 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11457 Port to OpenBSD 5.1 amd64.
11458 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11459 This is needed for OpenBSD, and should be harmless on all BSD systems.
11460 Also, include <sys/sysctl.h>, as it should be available on all
11461 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11462 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11463 use p_pid member, not kp_proc.pid.
11465 2012-07-06 Glenn Morris <rgm@gnu.org>
11467 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11469 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11471 More xmalloc and related cleanup.
11472 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11473 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11474 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11475 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11476 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11477 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11478 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11479 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11480 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11482 Omit needless casts involving void * pointers and allocation.
11483 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11484 as the former is more robust if P's type is changed.
11485 Prefer xzalloc to xmalloc + memset 0.
11486 Simplify malloc-or-realloc to realloc.
11487 Don't worry about xmalloc returning a null pointer.
11488 Prefer xstrdup to xmalloc + strcpy.
11489 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11491 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11492 alloca of a constant.
11494 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11496 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11497 hscroll is larger than the line width. Fixes long and futile
11498 looping inside extend_face_to_end_of_line (on a TTY) producing
11499 glyphs that are not needed and thrown away.
11501 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11503 * marker.c (set_marker_restricted_both): Simplify by using
11506 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11508 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11510 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11512 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11513 not defined (Bug#11768).
11514 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11515 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11516 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11517 followed by gtk_box_set_homogeneous (Bug#11768).
11518 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11519 (update_theme_scrollbar_width, xg_create_scroll_bar):
11520 Use gtk_scrollbar_new (Bug#11768).
11521 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11522 (is_box_type): New function (Bug#11768).
11523 (xg_tool_item_stale_p): Call is_box_type.
11524 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11525 with default display (Bug#11768).
11527 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11529 * xdisp.c (window_hscroll_limited): New function.
11530 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11531 coordinates when window's hscroll is set to insanely large
11532 values. (Bug#11857)
11534 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11536 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11537 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11539 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11542 * lisp.h (xzalloc): New prototype. Omit needless casts.
11543 * alloc.c (xzalloc): New function. Omit needless casts.
11544 * charset.c: Omit needless casts. Convert all calls to
11545 xmalloc with following memset to xzalloc.
11546 * dispnew.c: Likewise.
11547 * fringe.c: Likewise.
11548 * image.c: Likewise.
11549 * sound.c: Likewise.
11550 * term.c: Likewise.
11551 * w32fns.c: Likewise.
11552 * w32font.c: Likewise.
11553 * w32term.c: Likewise.
11554 * xfaces.c: Likewise.
11555 * xfns.c: Likewise.
11556 * xterm.c: Likewise.
11557 * atimer.c: Omit needless casts.
11558 * buffer.c: Likewise.
11559 * callproc.c: Likewise.
11561 * coding.c: Likewise.
11562 * composite.c: Likewise.
11564 * doprnt.c: Likewise.
11565 * editfns.c: Likewise.
11566 * emacs.c: Likewise.
11567 * eval.c: Likewise.
11568 * filelock.c: Likewise.
11570 * gtkutil.c: Likewise.
11571 * keyboard.c: Likewise.
11572 * lisp.h: Likewise.
11573 * lread.c: Likewise.
11574 * minibuf.c: Likewise.
11575 * msdos.c: Likewise.
11576 * print.c: Likewise.
11577 * process.c: Likewise.
11578 * region-cache.c: Likewise.
11579 * search.c: Likewise.
11580 * sysdep.c: Likewise.
11581 * termcap.c: Likewise.
11582 * terminal.c: Likewise.
11583 * tparam.c: Likewise.
11584 * w16select.c: Likewise.
11586 * w32reg.c: Likewise.
11587 * w32select.c: Likewise.
11588 * w32uniscribe.c: Likewise.
11589 * widget.c: Likewise.
11590 * xdisp.c: Likewise.
11591 * xmenu.c: Likewise.
11592 * xrdb.c: Likewise.
11593 * xselect.c: Likewise.
11595 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11597 * fileio.c (time_error_value): Check the right error number.
11598 Problem reported by Troels Nielsen in
11599 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11601 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11603 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11604 This should be fixed in a better way; see Eli Zaretskii in
11605 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11606 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11608 * fileio.c (time_error_value): Rename from special_mtime.
11609 The old name's problems were noted by Eli Zaretskii in
11610 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11612 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11613 This variable's comment says Emacs needs at least one GDB-visible
11614 symbol of type enum pvec_type, to work around GDB problems.
11615 The symbol's value doesn't matter.
11617 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11618 that causes compilation to fail on pre-C99 compilers.
11620 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11622 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11623 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11625 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11627 * buffer.c (init_buffer_once): Fix initialization of
11628 headers for buffer_defaults and buffer_local_symbols.
11629 Reported by Juanma Barranquero <lekktu@gmail.com>.
11631 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11633 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11634 * lisp.h (enum pvec_type): Use fewer bits.
11635 (PSEUDOVECTOR_SIZE_BITS): New constant.
11636 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11637 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11638 change in pvec_type.
11639 (PSEUDOVECTOR_TYPEP): New macro.
11640 (TYPED_PSEUDOVECTORP): Use it.
11641 * fns.c (internal_equal): Adapt code to extract pvectype.
11642 * emacs.c (gdb_pvec_type): Update type.
11643 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11644 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11645 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11646 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11647 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11648 abusing vector->header.next.nbytes.
11649 (live_vector_p): Use PVEC_TYPE.
11650 (mark_object): Adapt code to extract pvectype. Use switch.
11652 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11654 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11655 Tighten new eassert a bit.
11657 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11659 Fix compilation with --enable-gcc-warnings and -O1
11660 optimization level.
11661 * doprnt.c (doprnt): Change type of tem to int, initialize
11662 to avoid compiler warning. Add eassert.
11663 * search.c (simple_search): Initialize match_byte to avoid
11664 compiler warning. Add eassert.
11666 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11668 Avoid weird behavior with large horizontal scrolls.
11669 Without this change, for example, large hscroll values would
11670 mess up Emacs's display on Fedora 15 x86, presumably due to
11671 overflows in int calculations in the display code.
11672 Also, if buffers had long lines, Emacs would freeze.
11673 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11674 (set_window_hscroll): New function, containing the old guts of
11675 Fset_window_hscroll. Return the clipped value.
11676 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11677 This avoids the need to check against PTRDIFF_MAX.
11679 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11681 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11683 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11685 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11687 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11688 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11689 since GCC 4.4.6 issues a bogus warning for them.
11691 Fix bugs in file timestamp newness comparisons.
11692 * fileio.c (Ffile_newer_than_file_p):
11693 * lread.c (Fload): Use full timestamp resolution of files,
11694 not just the 1-second resolution, so that files that are only
11695 slightly newer still count as newer.
11696 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11697 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11699 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11701 * fileio.c: Improve handling of file time marker. (Bug#11852)
11702 (special_mtime): New function.
11703 (Finsert_file_contents, Fverify_visited_file_modtime):
11704 Use it to set special mtime values consistently.
11706 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11708 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11709 marker for non-existing file. (Bug#11852)
11711 2012-07-03 Glenn Morris <rgm@gnu.org>
11713 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11714 and did not make it into globals.h).
11716 2012-07-03 Tom Tromey <tromey@redhat.com>
11718 * window.c (Fset_window_margins, Fset_window_fringes)
11719 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11720 * textprop.c (Fprevious_property_change): No longer static.
11721 * syntax.c (Fsyntax_table_p): No longer static.
11722 * process.c (Fget_process, Fprocess_datagram_address): No longer
11724 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11725 * keyboard.c (Fcommand_execute): No longer static.
11727 * insdel.c (Fcombine_after_change_execute): No longer static.
11728 * image.c (Finit_image_library): No longer static.
11729 * fileio.c (Fmake_symbolic_link): No longer static.
11730 * eval.c (Ffetch_bytecode): No longer static.
11731 * editfns.c (Fuser_full_name): No longer static.
11732 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11734 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11736 * dired.c (Ffile_attributes): No longer static.
11737 * composite.c (Fcomposition_get_gstring): No longer static.
11738 * callproc.c (Fgetenv_internal): No longer static.
11740 * ccl.h: Remove EXFUNs.
11741 * buffer.h: Remove EXFUNs.
11742 * dispextern.h: Remove EXFUNs.
11743 * intervals.h: Remove EXFUNs.
11744 * fontset.h: Remove EXFUN.
11745 * font.h: Remove EXFUNs.
11746 * dosfns.c (system_process_attributes): Remove EXFUN.
11747 * keymap.h: Remove EXFUNs.
11748 * lisp.h: Remove EXFUNs.
11749 * w32term.h: Remove EXFUNs.
11750 * window.h: Remove EXFUNs.
11751 * xsettings.h: Remove EXFUN.
11752 * xterm.h: Remove EXFUN.
11754 2012-07-03 Glenn Morris <rgm@gnu.org>
11756 * lisp.h (Frandom): Make it visible to C.
11757 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11758 buffer for invisible buffers. (Bug#1229)
11760 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11762 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11763 values which aren't power of 2.
11764 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11765 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11768 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11770 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11772 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11774 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11776 * alloc.c (allocate_vector_block): Remove redundant
11777 calls to mallopt if DOUG_LEA_MALLOC is defined.
11778 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11779 avoid calls to mallopt if zero_vector is returned.
11781 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11783 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11784 is enabled, avoid dereferencing NULL current_sblock if
11787 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11789 Cleanup basic buffer management.
11790 * buffer.h (struct buffer): Change layout to use generic vector
11791 marking code. Fix some comments. Change type of 'clip_changed'
11792 to bitfield. Remove unused #ifndef old.
11793 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11794 (GET_OVERLAYS_AT): Fix indentation.
11795 (for_each_per_buffer_object_at): New macro.
11796 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11797 (Fbuffer_local_variables): Use it.
11798 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11799 * alloc.c (allocate_buffer): Adjust to match new layout of
11800 struct buffer. Fix comment.
11801 (mark_overlay): New function.
11802 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11803 Lisp area of struct buffer.
11804 (mark_object): Use it. Adjust marking of misc objects
11805 and related comments.
11807 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11809 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11810 wrapper that is not needed because the wrapped code is a no-op (zero
11811 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11812 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11814 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11816 * alloc.c (mark_buffer): Simplify. Remove prototype.
11817 (mark_object): Add comment. Reorganize marking of vector-like
11818 objects. Use CHECK_LIVE for all vector-like objects except buffers
11819 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11820 Avoid redundant calls to mark_vectorlike for bool vectors.
11822 2012-06-30 Glenn Morris <rgm@gnu.org>
11824 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11826 * epaths.in (PATH_SITELOADSEARCH): New.
11827 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11828 This is rather than relying on --enable-locallisppath elements
11829 having "site-lisp" in their names. (Bug#10208#25, 11658)
11831 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11833 * w32proc.c (sys_select): Accept and ignore one more argument.
11835 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11837 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11838 (pselect) [!MS_DOS]: Redirect to sys_select.
11840 * sysdep.c: Don't include dos.h and dosfns.h.
11842 * process.c (sys_select):
11843 * msdos.c (sys_select): Accept one more argument and ignore it.
11845 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11846 adapt data types and code to that.
11849 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11850 which clashes with the gnulib function of the same name.
11852 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11854 * font.c (font_style_to_value, font_style_symbolic)
11855 (font_prop_validate_style): Add type checks for values in
11858 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11860 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11863 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11865 * xdisp.c (try_window_id): Undo last change.
11867 * w32.c (getwd): Adjust commentary about startup_dir.
11868 (init_environment): Always call sys_access, even in non-MSVC
11869 builds. Don't chdir to the directory of the Emacs executable.
11870 This undoes code from 1997 which was justified by the need to
11871 "avoid conflicts when removing and renaming directories". But its
11872 downside was that every relative file name was being interpreted
11873 relative to the directory of the Emacs executable, which can never
11874 be TRT. In particular, it broke sys_access when called with
11875 relative file names.
11876 (sys_access): Map GetLastError to errno.
11878 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11880 * window.h (struct window): Change type of 'fringes_outside_margins'
11881 to bitfield. Fix comment. Adjust users accordingly.
11882 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11884 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11887 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11889 * gnutls.c (emacs_gnutls_handshake):
11890 Add QUIT to make the loop interruptible.
11892 2012-06-29 Glenn Morris <rgm@gnu.org>
11894 * charset.c (init_charset): Make lack of etc/charsets fatal.
11896 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11898 * editfns.c (region_limit): Fix type mismatch.
11900 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11902 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11903 undefined. Convert from xassert to eassert.
11904 * nsmenu.m: Convert from xassert to eassert.
11905 * nsterm.m: Likewise.
11907 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11909 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11911 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11913 Avoid integer overflow on scroll-left and scroll-right.
11914 * window.c (HSCROLL_MAX): New macro.
11915 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11916 overflow when requested scroll falls outside ptrdiff_t range.
11918 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11920 * window.h (struct window): Change type of 'hscroll',
11921 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11922 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11923 Adjust users accordingly.
11924 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11925 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11926 from EMACS_INT to ptrdiff_t.
11927 (make_window): Omit redundant initialization.
11929 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11931 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11933 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11935 * window.h (struct window): Change type of 'use_time' and
11936 'sequence_number' from Lisp_Object to int.
11937 * frame.c (make_frame): Adjust users accordingly.
11938 * print.c (print_object): Likewise.
11939 * window.c (select_window, Fwindow_use_time, make_parent_window)
11940 (make_window): Likewise.
11942 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11944 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11945 enabled with --enable-checking=[all,glyphs] configure option.
11946 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11947 adjust comments accordingly.
11948 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11949 undefined, adjust comments accordingly.
11950 * image.c: Likewise.
11951 * scroll.c: Likewise.
11952 * w32fns.c: Likewise.
11953 * w32term.c: Likewise.
11954 * xdisp.c: Likewise.
11955 * xfaces.c: Likewise.
11956 * xfns.c: Likewise.
11957 * xterm.c: Likewise.
11959 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11961 Generalize run-time debugging checks.
11962 * dispextern.h (XASSERTS): Remove.
11963 * fontset.c (xassert): Remove.
11964 Convert from xassert to eassert.
11965 * alloc.c: Convert from xassert to eassert.
11966 * bidi.c: Likewise.
11967 * dispnew.c: Likewise.
11969 * fringe.c: Likewise.
11970 * ftfont.c: Likewise.
11971 * gtkutil.c: Likewise.
11972 * image.c: Likewise.
11973 * keyboard.c: Likewise.
11974 * menu.c: Likewise.
11975 * process.c: Likewise.
11976 * scroll.c: Likewise.
11977 * sound.c: Likewise.
11978 * term.c: Likewise.
11979 * w32console.c: Likewise.
11980 * w32fns.c: Likewise.
11981 * w32term.c: Likewise.
11982 * window.c: Likewise.
11983 * xdisp.c: Likewise.
11984 * xfaces.c: Likewise.
11985 * xfns.c: Likewise.
11986 * xselect.c: Likewise.
11987 * xterm.c: Likewise.
11989 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11991 * fns.c (maybe_resize_hash_table): Output message when growing the
11994 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11996 * alloc.c (allocate_string_data): Remove dead code.
11997 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11998 avoid GCC warning about unused macro.
12000 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12002 * alloc.c (allocate_string): Omit intervals initialization.
12003 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12004 as in make_pure_string and make_pure_c_string.
12006 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12008 * alloc.c (allocate_string): Fix last change.
12010 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12012 * alloc.c (allocate_string): Remove two redundant calls
12013 to memset, add explicit initialization where appropriate.
12015 2012-06-27 Glenn Morris <rgm@gnu.org>
12017 * lisp.mk (lisp): Remove paths.elc.
12019 2012-06-27 Chong Yidong <cyd@gnu.org>
12021 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12023 2012-06-26 John Wiegley <johnw@newartisans.com>
12025 * unexmacosx.c (copy_data_segment): Add two section names used
12026 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12028 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12029 when building with Clang.
12031 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12033 * eval.c (Fapply): Allow calling it with a single argument.
12035 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12037 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12038 _stricmp and _strnicmp.
12039 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12041 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12043 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12045 (allocate_process): Likewise for new process.
12046 (allocate_terminal): Change to use offsetof.
12047 (allocate_frame): Likewise.
12048 * frame.c (make_frame): Omit redundant initialization.
12049 * window.c (make_parent_window): Use memset.
12050 (make_window): Omit redundant initialization.
12051 * process.c (make_process): Omit redundant initialization.
12052 * terminal.c (create_terminal): Likewise.
12054 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12056 * term.c (delete_tty): Remove redundant call to memset.
12058 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12060 * alloc.c: Remove build_string.
12061 * lisp.h: Define build_string as static inline. This provides
12062 a better opportunity to optimize away calls to strlen when the
12063 function is called with compile-time constant argument.
12064 * image.c (imagemagick_error): Convert to build_string.
12065 * w32proc.c (sys_spawnve): Likewise.
12066 * xterm.c (x_term_init): Likewise.
12068 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12070 Use sprintf return value instead of invoking strlen on result.
12071 In the old days this wasn't portable, since some sprintf
12072 implementations returned char *. But they died out years ago and
12073 Emacs already assumes sprintf returns int.
12074 Similarly for float_to_string.
12075 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12076 * ccl.c (ccl_driver):
12077 * character.c (string_escape_byte8):
12078 * data.c (Fnumber_to_string):
12079 * doprnt.c (doprnt):
12080 * print.c (print_object):
12081 * xdisp.c (message_dolog):
12082 * xfns.c (syms_of_xfns):
12083 Use sprintf or float_to_string result to avoid need to call strlen.
12084 * data.c (Fnumber_to_string):
12085 Use make_unibyte_string, since the string must be ASCII.
12086 * lisp.h, print.c (float_to_string): Now returns int length.
12087 * term.c (produce_glyphless_glyph):
12088 Use sprintf result rather than recomputing it.
12090 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12091 * Makefile.in (ALL_CFLAGS):
12092 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12093 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12095 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12097 * dispextern.h (xstrcasecmp): Define to library function
12098 strcasecmp if available.
12099 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12101 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12103 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12104 Avoid comma operator.
12105 * menu.c (push_submenu_start, push_submenu_end)
12106 (push_left_right_boundary, push_menu_pane): Likewise.
12107 * msdos.c (dos_rawgetc): Likewise.
12109 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12111 * xfns.c (xic_create_fontsetname): Remove redundant calls
12114 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12116 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12117 sprintf already null-terminates its output.
12119 * xfns.c (x_window): Remove redundant cast.
12121 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12123 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12124 `const char *' to `char *' to avoid compiler warning.
12126 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12128 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12129 instead of truncating it to 63 (admittedly a generous limit).
12131 * process.c: Fix spelling and caps in comments.
12133 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12135 * emacs.c (setpgrp): Remove definition, unused.
12136 * sysdep.c (setpgrp): Remove definition, not used in this file.
12138 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12140 * makefile.w32-in: Update dependencies.
12142 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12144 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12145 (SYSTIME_H): Add nt/inc/sys/time.h.
12147 * systime.h [WINDOWSNT]: Include sys/time.h.
12149 * s/ms-w32.h (struct timespec): Definition moved from
12150 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12152 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12154 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12155 * buffer.h (buffer_slot_type_mismatch):
12156 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12157 * eval.c (unwind_to_catch):
12158 * image.c (my_png_error, my_error_exit):
12159 * keyboard.c (quit_throw_to_read_char, user_error)
12160 (Fexit_recursive_edit, Fabort_recursive_edit):
12161 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12162 (wrong_type_argument, buffer_overflow, __executable_start)
12163 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12164 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12165 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12167 (child_setup) [!DOS_NT]:
12168 * lread.c (end_of_file_error, invalid_syntax):
12169 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12170 * puresize.h (pure_write_error):
12171 * search.c (matcher_overflow):
12172 * sound.c (sound_perror, alsa_sound_perror):
12173 * sysdep.c, syssignal.h (croak):
12174 * term.c (maybe_fatal, vfatal):
12175 * textprop.c (text_read_only):
12176 * undo.c (user_error):
12177 * unexmacosx.c (unexec_error):
12178 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12179 Use _Noreturn rather than NO_RETURN.
12180 No need for separate decl merely because of _Noreturn.
12181 * sound.c (sound_warning, parse_sound):
12182 Remove unnecessary forward decls.
12184 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12186 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12187 * lisp.h (WAIT_READING_MAX): New macro.
12188 * dispnew.c (Fsleep_for, sit_for):
12189 * keyboard.c (kbd_buffer_get_event):
12190 * process.c (Faccept_process_output):
12191 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12192 This improves on the previous patch, which introduced a bug
12193 when time_t is unsigned and as wide as intmax_t.
12194 See <http://bugs.gnu.org/9000#51>.
12196 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12198 * dispnew.c (sit_for, Fsleep_for):
12199 * keyboard.c (kbd_buffer_get_event):
12200 * process.c (Faccept_process_output): Avoid compiler warnings when
12201 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12203 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12205 * makefile.w32-in: Update dependencies.
12207 * w32.c (ltime): Add return type and declare static.
12208 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12210 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12212 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12213 Privately reported by Herbert J. Skuhra.
12214 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12216 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12217 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12219 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12221 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12222 last argument of make_unibyte_string.
12224 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12225 language ID in the event parameters.
12227 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12228 event.code, not the obscure "character set ID".
12230 2012-06-23 Chong Yidong <cyd@gnu.org>
12232 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12234 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12236 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12237 * w32.c (fdutimens): New function.
12239 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12241 * s/ms-w32.h (pselect): Redirect to sys_select.
12243 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12245 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12246 in the logic of incrementing and decrementing the value of
12247 use_relocatable_buffers.
12249 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12251 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12252 Privately reported by Herbert J. Skuhra.
12253 [__FreeBSD__]: Remove "*/" typo after "#include".
12254 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12255 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12256 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12257 Don't assume EMACS_TIME and struct timeval are the same type.
12259 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12261 Support higher-resolution time stamps (Bug#9000).
12262 The time stamps are only nanosecond-resolution at the C level,
12263 since that's the best that any real-world system supports now.
12264 But they are picosecond-resolution at the Lisp level, as that's
12265 easy, and leaves room for future OS improvements.
12267 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12270 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12271 Don't get current time unless it's needed.
12273 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12274 now provides it if it's absent.
12275 (start_atimer): Port to higher-res time stamps.
12276 Check for time stamp overflow. Don't get current time more
12277 often than is needed.
12279 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12280 Include systime.h, not time.h.
12281 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12283 * dired.c: Include stat-time.h.
12284 (Ffile-attributes): File times now have higher resolution.
12286 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12287 (struct image): Timestamp now has higher resolution.
12289 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12290 has at least microseconds now. All uses removed.
12291 (update_frame, update_single_window, update_window, update_frame_1)
12292 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12293 (duration_to_sec_usec): Remove; no longer needed.
12295 * editfns.c (time_overflow): Now extern.
12296 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12297 (float-time, Fformat_time_string, Fcurrent_time_string)
12298 (Fcurrent_time_zone): Accept and generate higher-resolution
12300 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12301 (decode_time_components, lisp_seconds_argument): New functions.
12302 (make_time): Now static.
12303 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12304 Report an error if the time is invalid, rather than having the caller
12307 * fileio.c: Include <stat-time.h>
12308 (Fcopy_file): Copy higher-resolution time stamps.
12309 Prefer to set the time stamp via a file descriptor if that works.
12310 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12311 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12312 (Fvisited_file_modtime, Fset_visited_file_modtime):
12313 Support higher-resolution time stamps.
12315 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12317 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12319 * image.c (prepare_image_for_display, clear_image_cache)
12320 (lookup_image): Port to higer-resolution time stamps.
12322 * keyboard.c (start_polling, bind_polling_period):
12323 Check for time stamp overflow.
12324 (read_char, kbd_buffer_get_event, timer_start_idle)
12325 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12326 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12327 Port to higher-resolution time stamps. Do not assume time_t is signed.
12328 (decode_timer): New function. Timers are now vectors of length 9,
12329 not 8, to accommodate the picosecond component.
12330 (timer_check_2): Use it.
12332 * nsterm.m (select_timeout, timeval_subtract): Remove.
12333 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12334 as they're a bit more accurate and handle overflow better.
12335 (ns_select): Change prototype to be compatible with pselect.
12336 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12337 * nsterm.h (ns_select): Adjust prototype.
12339 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12340 us-resolution time stamps.
12341 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12343 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12345 * lisp.h (time_overflow): New decl.
12346 (wait_reading_process_output): First arg is now intmax_t, not int,
12347 to accommodate larger waits.
12349 * process.h (struct Lisp_Process.read_output_delay):
12350 Now counts nanoseconds, not microseconds.
12351 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12353 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12354 (wait_reading_process_output):
12355 Port to ns-resolution time stamps.
12356 (Faccept_process_output, wait_reading_process_output):
12357 Check for time stamp overflow. Do not assume time_t is signed.
12358 (select_wrapper): Remove; we now use pselect.
12359 (Fprocess_attributes): Now generates ns-resolution time stamps.
12361 * sysdep.c: Include utimens.h. Don't include utime.h
12362 or worry about struct utimbuf; gnulib does that for us now.
12363 (gettimeofday): Remove; gnulib provides a substitute.
12364 (make_timeval): New function.
12365 (set_file_times): Now sets ns-resolution time stamps.
12366 New arg FD; all uses changed.
12367 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12368 (system_process_attributes):
12369 Now returns ns-resolution time stamp. All uses changed.
12370 Check for time stamp overflow.
12372 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12373 provides a substitute now.
12375 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12376 since it guarantees struct timespec.
12377 (EMACS_TIME): Now struct timespec, so that we can support
12378 ns-resolution time stamps.
12379 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12380 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12381 (EMACS_USECS): Remove.
12382 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12383 so multiply the arg by 1000 before storing it.
12384 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12386 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12387 Port to ns-resolution time stamps.
12388 (EMACS_TIME_NEG_P): Remove; replaced by....
12389 (EMACS_TIME_SIGN): New macro.
12390 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12391 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12392 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12393 (make_timeval, make_lisp_time, decode_time_components): New decls.
12394 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12395 that it mishandled time_t overflow. You can't compare by subtracting!
12396 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12397 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12399 * term.c: Include <sys/time.h>.
12400 (timeval_to_Time): New function, for proper overflow wraparound.
12401 (term_mouse_position, term_mouse_click): Use it.
12403 * undo.c (record_first_change): Support higher-resolution time stamps
12404 in the undo buffer.
12405 (Fprimitive_undo): Use them when restoring time stamps.
12407 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12408 (w32_get_internal_run_time):
12409 Port to higher-resolution Emacs time stamps.
12410 (ltime): Now accepts single 64-bit integer, as that's more convenient
12413 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12415 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12416 for compatibility with pselect. Support ns-resolution time stamps.
12418 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12420 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12421 Check for time stamp overflow, and support ns-resolution time stamps.
12423 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12424 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12425 (timeval_subtract): Remove; no longer needed.
12426 (XTflash, XTring_bell, x_wait_for_event):
12427 Port to ns-resolution time stamps. Don't assume time_t is signed.
12429 2012-06-22 Chong Yidong <cyd@gnu.org>
12431 * xdisp.c (x_consider_frame_title): Revert last change.
12433 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12435 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12436 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12437 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12438 staticidx goes up to 1597 out of 1600 = 0x640.)
12440 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12442 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12443 Otherwise, the umask might be mistakenly 0 while handling input signals.
12445 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12447 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12449 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12451 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12452 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12453 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12454 access to `contents' member of Lisp_Vector objects with AREF and ASET
12457 2012-06-19 Chong Yidong <cyd@gnu.org>
12459 * frame.c (delete_frame): When selecting a frame on a different
12460 text terminal, do not alter the terminal's top-frame.
12462 * xdisp.c (format_mode_line_unwind_data): Record the target
12463 frame's selected window and its terminal's top-frame.
12464 (unwind_format_mode_line): Restore them.
12465 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12467 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12468 since tty frames can be explicitly named.
12469 (prepare_menu_bars): Likewise.
12471 * term.c (Ftty_top_frame): New function.
12473 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12475 Port byte-code-meter to modern targets.
12476 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12477 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12478 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12479 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12480 (METER_1, METER_2): Simplify.
12482 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12484 * data.c (Fdefalias): Return `symbol' (bug#11686).
12486 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12488 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12489 gets killed during executing of this function (Bug#11665).
12490 Try to always return Qt when the buffer has been actually killed.
12491 (Vkill_buffer_query_functions): In doc-string say that functions
12492 run by this hook should not change the current buffer.
12494 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12496 Fix recently-introduced process.c problems found by static checking.
12497 * process.c (write_queue_push, write_queue_pop, send_process):
12498 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12499 (write_queue_pop): Fix pointer signedness problem.
12500 (send_process): Remove unused local.
12502 2012-06-17 Chong Yidong <cyd@gnu.org>
12504 * xdisp.c (redisplay_internal): No need to redisplay terminal
12505 frames that are not on top.
12507 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12509 * process.c (make_process): Initialize write_queue.
12510 (write_queue_push, write_queue_pop): New functions.
12511 (send_process): Use them to maintain correct ordering of process
12512 writes (Bug#10815).
12514 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12516 * lisp.h (eassert): Assume C89 or later.
12517 This removes the need for CHECK.
12518 (CHECK): Remove. Its comments about always evaluating its
12519 argument were confusing, as 'eassert' typically does not evaluate
12522 * coding.c (produce_chars): Use ptrdiff_t, not int.
12524 * xterm.c (x_draw_underwave): Check for integer overflow.
12525 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12527 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12529 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12530 referenced (Bug#11583).
12532 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12534 Implement wave-style variant of underlining.
12535 * dispextern.h (face_underline_type): New enum.
12536 (face): Add field for underline type.
12537 * nsterm.m (ns_draw_underwave): New function.
12538 (ns_draw_text_decoration): Use it.
12539 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12541 (x_draw_glyph_string): Use them.
12542 * xfaces.c (Qline, Qwave): New Lisp objects.
12543 (check_lface_attrs, merge_face_ref)
12544 (Finternal_set_lisp_face_attribute, realize_x_face):
12545 Handle wave-style underline face attributes.
12546 * xterm.c (x_draw_underwave): New function.
12547 (x_draw_glyph_string): Use it.
12549 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12551 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12552 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12553 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12554 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12555 ($(BLD)/w32select.$(O)): Update dependencies.
12557 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12559 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12560 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12561 * character.c (_fetch_multibyte_char_p): Remove.
12562 * alloc.c: Include "character.h" before "buffer.h".
12563 * bidi.c: Likewise.
12564 * buffer.c: Likewise.
12565 * bytecode.c: Likewise.
12566 * callint.c: Likewise.
12567 * callproc.c: Likewise.
12568 * casefiddle.c: Likewise.
12569 * casetab.c: Likewise.
12570 * category.c: Likewise.
12571 * cmds.c: Likewise.
12572 * coding.c: Likewise.
12573 * composite.c: Likewise.
12574 * dired.c: Likewise.
12575 * dispnew.c: Likewise.
12577 * dosfns.c: Likewise.
12578 * editfns.c: Likewise.
12579 * emacs.c: Likewise.
12580 * fileio.c: Likewise.
12581 * filelock.c: Likewise.
12582 * font.c: Likewise.
12583 * fontset.c: Likewise.
12584 * fringe.c: Likewise.
12585 * indent.c: Likewise.
12586 * insdel.c: Likewise.
12587 * intervals.c: Likewise.
12588 * keyboard.c: Likewise.
12589 * keymap.c: Likewise.
12590 * lread.c: Likewise.
12591 * macros.c: Likewise.
12592 * marker.c: Likewise.
12593 * minibuf.c: Likewise.
12594 * nsfns.m: Likewise.
12595 * nsmenu.m: Likewise.
12596 * print.c: Likewise.
12597 * process.c: Likewise.
12598 * regex.c: Likewise.
12599 * region-cache.c: Likewise.
12600 * search.c: Likewise.
12601 * syntax.c: Likewise.
12602 * term.c: Likewise.
12603 * textprop.c: Likewise.
12604 * undo.c: Likewise.
12605 * unexsol.c: Likewise.
12606 * w16select.c: Likewise.
12607 * w32fns.c: Likewise.
12608 * w32menu.c: Likewise.
12609 * window.c: Likewise.
12610 * xdisp.c: Likewise.
12611 * xfns.c: Likewise.
12612 * xmenu.c: Likewise.
12614 * xselect.c: Likewise.
12616 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12618 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12619 If all the glyphs of the glyph row came from strings, and we have no
12620 cursor positioning clues, put the cursor on the first glyph of the
12622 (handle_face_prop): Use chunk-relative overlay string index when
12623 indexing into it->string_overlays array. (Bug#11653)
12624 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12625 the rightmost. (Bug#11720)
12627 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12629 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12630 (CATEGORY_MEMBER): Enforce 1/0 value.
12631 * category.c (_temp_category_set): Remove.
12633 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12635 * window.c (Fdelete_other_windows_internal)
12636 (Fdelete_window_internal): Don't access frame's mouse highlight
12637 info of the initial frame. (Bug#11677)
12639 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12641 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12642 Assume USE_2_TAGS_FOR_INTS.
12643 (xreload): Adjust $tagmask width to match recent lisp.h change.
12645 Simplify lisp.h in minor ways that should not affect code.
12646 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12647 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12648 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12649 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12650 (INTTYPEBITS): New macro, for clarity.
12651 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12652 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12653 Simplify now that USE_LSB_TAG is always defined.
12654 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12655 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12657 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12659 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12661 2012-06-13 Glenn Morris <rgm@gnu.org>
12663 * s/bsd-common.h (BSD4_3):
12664 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12666 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12668 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12670 (XLI, XIL): Define.
12671 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12673 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12674 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12675 * alloc.c (widen_to_Lisp_Object): Remove.
12676 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12677 * frame.c (delete_frame): Remove outdated comment.
12678 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12679 USE_LISP_UNION_TYPE.
12680 (Fw32_unregister_hot_key): Likewise.
12681 (Fw32_toggle_lock_key): Likewise.
12682 * w32menu.c (add_menu_item): Likewise.
12683 (w32_menu_display_help): Use XIL instead of checking
12684 USE_LISP_UNION_TYPE.
12685 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12686 (init_heap): Likewise.
12687 * w32term.c (w32_read_socket): Update comment.
12689 2012-06-13 Glenn Morris <rgm@gnu.org>
12691 * s/usg5-4-common.h, src/s/unixware.h:
12692 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12694 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12696 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12698 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12699 * alloc.c (make_number) [!defined make_number]:
12700 Remove, as lisp.h always defines this now.
12701 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12702 (roundup_size): Verify that it is a power of 2.
12703 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12704 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12705 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12706 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12707 USE_LSB_TAG now is always defined to be either 0 or 1.
12709 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12710 code works fine either way, and efficiency is not a concern here,
12711 as the union type is for debugging, not for production.
12712 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12713 Use an inline function on all platforms when using the union type,
12714 since this is simpler and 'static inline' can be used portably
12716 (LISP_INITIALLY_ZERO): New macro.
12717 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12718 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12720 2012-06-12 Glenn Morris <rgm@gnu.org>
12722 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12724 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12726 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12727 Move BROKEN_SIGIO to configure.
12729 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12730 Move NO_TERMIO to configure.
12732 2012-06-12 Chong Yidong <cyd@gnu.org>
12734 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12735 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12736 MagickExportImagePixels is undefined.
12738 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12740 * image.c (imagemagick_load_image): Remove unused label.
12742 2012-06-11 Glenn Morris <rgm@gnu.org>
12744 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12745 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12746 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12747 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12749 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12751 * alloc.c (make_byte_code): New function.
12752 (Fmake_byte_code): Use it. Don't purify here.
12753 * lread.c (read1): Use it as well to avoid extra allocation.
12755 2012-06-11 Chong Yidong <cyd@gnu.org>
12757 * image.c (imagemagick_load_image): Implement transparency.
12759 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12761 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12762 account for preceding backslashes. (Bug#11663)
12764 2012-06-09 Chong Yidong <cyd@gnu.org>
12766 * term.c: Support italics in capable terminals (Bug#9652).
12767 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12768 (turn_on_face): Output using TS_enter_italic_mode if available.
12769 Don't handle unused blinking and alt-charset cases.
12770 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12771 and tty_alt_charset_p cases.
12772 (tty_capable_p, init_tty): Support italics.
12774 * termchar.h (struct tty_display_info): Add field for italics.
12775 Remove unused blink field.
12777 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12780 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12781 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12782 tty_alt_charset_p. Add tty_italic_p.
12784 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12786 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12787 dbus_type_is_basic if available.
12788 (xd_extract_signed, xd_extract_unsigned): Rename from
12789 extract_signed and extract_unsigned, respectively. Adapt callers.
12791 2012-06-09 Chong Yidong <cyd@gnu.org>
12793 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12795 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12798 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12800 * xdisp.c (vmessage): Treat frame message as multibyte.
12801 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12802 would generate the diagnostic "Making \302\247 buffer-local while
12805 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12807 * dispnew.c (showing_window_margins_p): Undo last change, which
12808 was done due to an inadvertent commit.
12809 (adjust_frame_glyphs_for_frame_redisplay): Do call
12810 showing_window_margins_p.
12812 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12814 * eval.c (Fmake_var_non_special): New primitive.
12815 (syms_of_eval): Defsubr it.
12816 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12818 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12820 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12821 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12823 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12825 * alloc.c (allocate_vectorlike): Fix last change.
12827 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12829 Block-based vector allocation of small vectors.
12830 * lisp.h (struct vectorlike_header): New field `nbytes',
12831 adjust comment accordingly.
12832 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12833 to denote vector blocks. Adjust users (live_vector_p,
12834 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12835 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12836 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12837 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12838 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12839 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12840 (roundup_size): New constant.
12841 (struct vector_block): New data type.
12842 (vector_blocks, vector_free_lists, zero_vector): New variables.
12843 (all_vectors): Rename to `large_vectors'.
12844 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12845 (sweep_vectors): New functions.
12846 (allocate_vectorlike): Return `zero_vector' as the only vector of
12847 0 items. Allocate new vector from block if vector size is less than
12848 or equal to VBLOCK_BYTES_MAX.
12849 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12850 (init_alloc_once): Add call to init_vectors.
12852 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12854 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12856 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12858 * doprnt.c (doprnt): Truncate multibyte char correctly.
12859 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12860 would mishandle a string argument "Xc" if X was a multibyte
12861 character of length 2: it would truncate after X's first byte
12862 rather than including all of X.
12864 2012-06-06 Chong Yidong <cyd@gnu.org>
12866 * buffer.c (word_wrap): Doc fix.
12868 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12870 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12872 2012-06-03 Glenn Morris <rgm@gnu.org>
12874 * xdisp.c (tool-bar-style): Doc fix.
12876 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12878 * Makefile.in (PAXCTL): Define.
12879 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12880 binary via PaX flags if the paxctl utility is available.
12881 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12882 Restore PaX flags to their default. (Bug#11398)
12884 2012-06-03 Chong Yidong <cyd@gnu.org>
12886 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12887 buffer (Bug#11226).
12889 2012-06-03 Chong Yidong <cyd@gnu.org>
12891 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12892 (note_mode_line_or_margin_highlight): If there is no help echo,
12893 use mode-line-default-help-echo. Handle the case where the mouse
12894 position is past the end of the mode line string.
12896 * buffer.c (buffer_local_value_1): New function, split from
12897 Fbuffer_local_value; can return Qunbound.
12898 (Fbuffer_local_value): Use it.
12899 (Vmode_line_format): Docstring tweaks.
12901 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12903 * sysdep.c (system_process_attributes): Improve comment.
12905 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12907 * keyboard.c: Export real-this-command to Elisp.
12908 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12909 and DEFVAR it. Update all users.
12911 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12913 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12915 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12916 Convert pctcpu and pctmem to Lisp float properly.
12917 Let the compiler fold better, as 100.0/0x8000 is exact.
12919 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12921 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12924 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12926 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12928 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12930 For a 'struct window', replace some Lisp_Object fields to
12931 bitfields where appropriate, remove unused fields.
12932 * window.h (struct window): Remove unused 'last_mark_x' and
12933 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12934 change its type from Lisp_Object to bitfield.
12935 Change type of 'force_start', 'optional_new_start',
12936 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12937 fields from Lisp_Object to bitfield. Adjust users accordingly.
12939 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12941 Pacify gcc -Wdouble-precision when using Xaw.
12942 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12943 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12944 Use 'float' consistently, rather than 'float' in most places
12945 and 'double' in a couple of places.
12947 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12949 * xdisp.c (handle_stop): Detect whether we have overlay strings
12950 loaded by testing it->current.overlay_string_index to be
12951 non-negative, instead of checking whether n_overlay_strings is
12952 positive. (Bug#11587)
12954 2012-05-31 Chong Yidong <cyd@gnu.org>
12956 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12958 * doc.c (Fsubstitute_command_keys): Doc fix.
12960 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12962 * search.c (search_buffer): Remove calls to
12963 r_alloc_inhibit_buffer_relocation, as it is now called by
12964 maybe_unify_char, which was the cause of relocation of buffer text
12967 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12969 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12970 for the duration of call to load_charset, to avoid problems with
12971 callers of maybe_unify_char that access buffer text through C
12974 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12975 decrement the inhibition flag, instead of just setting or
12978 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12980 Remove obsolete '#define static' cruft.
12981 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12982 This #undef was "temporary" in 2000; it is no longer needed
12983 now that '#define static' has gone away.
12984 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12985 (gray_bitmap_bits): Remove; no longer needed.
12986 All uses replaced with definiens.
12987 * xterm.c: Include "bitmaps/gray.xbm".
12989 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12991 Clean up __executable_start, monstartup when --enable-profiling.
12992 The following changes affect the code only when profiling.
12993 * dispnew.c (__executable_start): Rename from safe_bcopy.
12994 Define only on platforms that need it.
12995 * emacs.c: Include <sys/gmon.h> when profiling.
12996 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12997 (__executable_start): Remove decl, since lisp.h does it now.
12998 (safe_bcopy): Remove decl; no longer has that name.
12999 (main): Coalesce #if into single bit of code, for simplicity.
13000 Cast pointers to uintptr_t, since standard libraries want integers
13002 * lisp.h (__executable_start): New decl.
13004 2012-05-31 Glenn Morris <rgm@gnu.org>
13006 * image.c (Fimagemagick_types): Doc fix.
13008 2012-05-30 Jim Meyering <meyering@redhat.com>
13010 * callproc.c (Fcall_process_region): Include directory component
13011 in mkstemp error message (Bug#11586).
13013 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13015 * alloc.c, lisp.h (make_pure_vector): Now static.
13017 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13019 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13020 Move to byte-run.el.
13021 (Fautoload): Do the hash-doc more carefully.
13022 * data.c (Fdefalias): Purify definition, except for keymaps.
13023 (Qdefun): Move from eval.c.
13024 * lisp.h (Qdefun): Remove.
13025 * lread.c (read1): Tiny simplification.
13027 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
13029 Do not create empty overlays with the evaporate property (Bug#9642).
13030 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13031 Bug#9642, but explicitly check that the buffer the overlay would
13032 be moved to is live and rearrange lines to make sure that errors
13033 will not put the overlay in an inconsistent state.
13034 (Fdelete_overlay): Cosmetics.
13036 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13038 * w32term.c (my_bring_window_to_top): New function.
13039 (x_raise_frame): Use handle returned by DeferWindowPos, which
13040 could be different from the original one.
13041 Call my_bring_window_to_top instead of my_set_foreground_window.
13044 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13045 by calling BringWindowToTop.
13047 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13048 (WM_EMACS_END): Increase by one.
13050 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13052 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13053 This avoids undefined behavior that might cause the eassert
13054 to not catch an out-of-range value.
13056 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13058 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13059 Update dependencies.
13061 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13063 * bidi.c (bidi_mirror_char): Fix last change.
13065 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13067 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13068 when referring to sectname field in printf format.
13070 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13072 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13073 Only r_alloc_inhibit_buffer_relocation needed to be added;
13074 the others were already declared.
13076 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13077 before checking whether it's out of range. Put the check inside
13079 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13081 2012-05-27 Ken Brown <kbrown@cornell.edu>
13083 * callproc.c (Fcall_process): Restore a line that was accidentally
13084 commented out in the 2011-02-13 change (bug#11547).
13086 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13088 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13089 defined on ralloc.c.
13091 * buffer.c [REL_ALLOC]: Remove prototypes of
13092 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13093 they are now on lisp.h.
13095 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13097 * search.c (search_buffer): Use it to inhibit relocation of buffer
13098 text while re_search_2 is doing its job, because re_search_2 is
13099 passed C pointers to buffer text. (Bug#11519)
13101 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13102 Update value to 24.
13104 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13105 state after an additional call to move_it_in_display_line_to, keep
13106 the values of it->max_ascent and it->max_descent found for the
13108 (pos_visible_p): Revert the comparison against bottom_y to what it
13109 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13112 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13114 Fix coding-related core dumps with gcc -ftrapv.
13115 The code was computing A - B, where A and B are pointers, and B is
13116 random garbage. This can lead to core dumps on platforms that
13117 have special pointer registers, and it also leads to core dumps on
13118 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13119 A - B only when B is initialized properly.
13120 * coding.c (coding_set_source, coding_set_destination): Return void.
13121 (coding_change_source, coding_change_destinations): New functions,
13122 with the old behaviors of coding_set_source and coding_set_destination.
13123 All callers that need an offset changed to use these new functions.
13125 2012-05-26 Glenn Morris <rgm@gnu.org>
13127 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13129 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13131 Extend mouse support on W32 text-mode console.
13132 * xdisp.c (draw_row_with_mouse_face):
13133 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13135 * w32console.c: Include window.h.
13136 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13138 (initialize_w32_display): Initialize mouse-highlight data.
13140 * w32inevt.c: Include termchar.h and window.h.
13141 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13142 moves, call note_mouse_highlight. If help_echo changed, call
13143 gen_help_event to produce help-echo message in the echo area.
13144 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13147 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13149 * lread.c (read1): Simplify slightly to avoid an overflow warning
13150 with GCC 4.7.0 on x86-64.
13152 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13154 * bidi.c (bidi_mirror_char): Revert last change: an int is
13155 definitely wide enough here.
13157 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13159 Fix integer width and related bugs (Bug#9874).
13160 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13161 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13162 (string_bytes, check_sblock, allocate_string_data):
13163 (compact_small_strings, Fmake_bool_vector, make_string)
13164 (make_unibyte_string, make_multibyte_string)
13165 (make_string_from_bytes, make_specified_string)
13166 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13167 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13170 (allocate_pseudovector):
13171 Use int, not EMACS_INT, where int is wide enough.
13172 (inhibit_garbage_collection, Fgarbage_collect):
13173 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13174 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13175 int might not be wide enough.
13176 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13177 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13178 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13179 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13180 (bidi_level_of_next_char, bidi_move_to_visually_next):
13181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13182 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13183 (Fkill_buffer, Fset_buffer_major_mode)
13184 (advance_to_char_boundary, Fbuffer_swap_text)
13185 (Fset_buffer_multibyte, overlays_at, overlays_in)
13186 (overlay_touches_p, struct sortvec, record_overlay_string)
13187 (overlay_strings, recenter_overlay_lists)
13188 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13189 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13190 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13191 (Foverlay_recenter, last_overlay_modification_hooks_used)
13192 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13193 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13194 (validate_region): Omit unnecessary test for b <= e,
13195 since that's guaranteed by the previous test.
13196 (adjust_overlays_for_delete): Avoid pos + length overflow.
13197 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13198 (report_overlay_modification):
13199 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13200 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13201 Omit pointer cast, which isn't needed anyway, and doesn't work
13202 after the EMACS_INT -> ptrdiff_t change.
13203 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13204 * buffer.h: Adjust decls to match defn changes elsewhere.
13205 (struct buffer_text, struct buffer):
13206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13207 Use EMACS_INT, not int, where int might not be wide enough.
13208 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13209 not int, to avoid needless 32-bit limit on 64-bit hosts.
13210 (exec_byte_code): Use tighter memory-full test, one that checks
13211 for alloca overflow. Don't compute the address of the object just
13212 before an array, as that's not portable. Use EMACS_INT, not
13213 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13214 * callint.c (Fcall_interactively):
13215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13216 * callproc.c (call_process_kill, Fcall_process):
13217 Don't assume pid_t fits into an Emacs fixnum.
13218 (call_process_cleanup, Fcall_process, child_setup):
13219 Don't assume pid_t fits into int.
13220 (call_process_cleanup, Fcall_process, delete_temp_file)
13221 (Fcall_process_region):
13222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13223 (Fcall_process): Simplify handling of volatile integers.
13224 Use int, not EMACS_INT, where int will do.
13225 * casefiddle.c (casify_object, casify_region, operate_on_word)
13226 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13228 (casify_object): Avoid integer overflow when overallocating buffer.
13229 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13230 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13231 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13232 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13233 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13234 integers are now checked earlier. All uses replaced with XINT.
13236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13237 For CCL_MapSingle, check that content and value are in int range.
13238 (ccl_driver, Fregister_code_conversion_map):
13239 Check that Vcode_version_map_vector is a vector.
13240 (resolve_symbol_ccl_program): Check that vector header is in range.
13241 Always copy the vector, so that we can check its contents reliably
13242 now rather than having to recheck each instruction as it's being
13243 executed. Check that vector words fit in 'int'.
13244 (ccl_get_compiled_code, Fregister_ccl_program)
13245 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13246 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13247 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13248 contents are in range.
13249 (Fccl_execute_on_string): Check that status is in range.
13250 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13251 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13252 Accept and return EMACS_INT, not int, because callers can pass values
13253 out of 'int' range.
13254 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13255 (multibyte_chars_in_text, parse_str_as_multibyte)
13256 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13257 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13258 (string_escape_byte8, Fget_byte):
13259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13260 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13261 avoid mishandling large integers.
13262 * character.h: Adjust decls to match defn changes elsewhere.
13263 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13264 (Ffind_charset_region):
13265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13266 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13267 (load_charset_map_from_vector, Fdefine_charset_internal):
13268 Don't assume fixnum fits in int.
13269 (load_charset_map_from_vector, Fmap_charset_chars):
13270 Remove now-unnecessary CHECK_NATNUMs.
13271 (Fdefine_charset_internal): Check ranges here, more carefully.
13272 Don't rely on undefined behavior with signed left shift overflow.
13273 Don't assume unsigned int fits into fixnum, or that fixnum fits
13274 into unsigned int. Don't require max_code to be a valid fixnum;
13275 that's not true for gb10830 4-byte on a 32-bit host. Allow
13276 invalid_code to be a cons, for the same reason. Require code_offset
13277 to be a character. Avoid int overflow if max_char is close
13279 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13280 this is intended anyway and avoids some undefined behavior.
13281 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13282 INDEX_TO_CODE_POINT, as that's what it expects.
13283 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13284 * charset.h (DECODE_CHAR): Return int, not unsigned;
13285 this is what was intended anyway, and it avoids undefined behavior.
13286 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13287 integer-overflow issues.
13288 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13289 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13290 where the argument is EMACS_INT, and this behavior is not intended.
13291 * chartab.c (Fmake_char_table, Fset_char_table_range)
13292 (uniprop_get_decoder, uniprop_get_encoder):
13293 Don't assume fixnum fits in int.
13294 * cmds.c (move_point): New function, that does the gist of
13295 Fforward_char and Fbackward_char, but does so while checking
13296 for integer overflow more accurately.
13297 (Fforward_char, Fbackward_char): Use it.
13298 (Fforward_line, Fend_of_line, internal_self_insert)
13299 (internal_self_insert):
13300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13301 Fix a FIXME, by checking for integer overflow when calculating
13302 target_clm and actual_clm.
13303 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13304 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13305 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13306 (coding_alloc_by_making_gap, alloc_destination)
13307 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13308 (encode_coding_utf_16, detect_coding_emacs_mule)
13309 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13310 (detect_coding_iso_2022, decode_coding_iso_2022)
13311 (encode_invocation_designation, encode_designation_at_bol)
13312 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13313 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13314 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13315 (encode_coding_ccl, encode_coding_raw_text)
13316 (detect_coding_charset, decode_coding_charset)
13317 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13318 (produce_composition, produce_charset, produce_annotation)
13319 (decode_coding, handle_composition_annotation)
13320 (handle_charset_annotation, consume_chars, decode_coding_gap)
13321 (decode_coding_object, encode_coding_object, detect_coding_system)
13322 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13323 (code_convert_region, code_convert_string)
13324 (Fdefine_coding_system_internal)
13325 (coding_set_source, coding_set_destination):
13326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13327 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13328 (Fdefine_coding_system_internal):
13329 Don't assume fixnums fit in int.
13330 (decode_coding_gap, decode_coding_object, encode_coding_object)
13331 (Fread_coding_system, Fdetect_coding_region)
13332 (Funencodable_char_position, Fcheck_coding_systems_region)
13333 (get_translation, handle_composition_annotation, consume_chars):
13334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13335 (consume_chars): Rewrite to not calculate an address outside buffer.
13336 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13337 Don't access memory outside of the args array.
13338 (Fdefine_coding_system_internal): Check for charset-id overflow.
13339 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13340 result of ENCODE_CHAR.
13341 * coding.h: Adjust decls to match defn changes elsewhere.
13342 (struct coding_system):
13343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13344 * composite.c (get_composition_id, find_composition)
13345 (run_composition_function, update_compositions)
13346 (compose_text, composition_gstring_put_cache)
13347 (composition_gstring_p, composition_gstring_width)
13348 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13349 (composition_compute_stop_pos, composition_reseat_it)
13350 (composition_update_it, struct position_record)
13351 (find_automatic_composition, composition_adjust_point)
13352 (Fcomposition_get_gstring, Ffind_composition_internal):
13353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13354 (update_compositions):
13355 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13356 * composite.h: Adjust decls to match defn changes elsewhere.
13357 (struct composition):
13358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13359 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13360 Do not attempt to compute the address of the object just before a
13361 buffer; this is not portable.
13363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13364 (Faset): Use int, not EMACS_INT, where int is wide enough.
13365 (Fstring_to_number): Don't assume fixnums fit in int.
13366 (Frem): Don't assume arg is nonnegative.
13367 * dbusbind.c (xd_append_arg): Check for integers out of range.
13368 (Fdbus_call_method): Don't overflow the timeout int.
13369 (extract_signed, extract_unsigned): New functions.
13370 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13371 (xd_get_connection_references): Return ptrdiff_t, not int.
13373 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13374 (xd_read_message_1):
13375 Use int, not unsigned, where the dbus API uses int.
13376 (Fdbus_message_internal): Don't overflow mtype.
13377 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13378 * dired.c (directory_files_internal, file_name_completion, scmp)
13379 (file_name_completion_stat):
13380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13381 (file_name_completion): Don't overflow matchcount.
13382 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13383 * dispextern.h: Adjust decls to match defn changes elsewhere.
13384 (struct text_pos, struct glyph, struct bidi_saved_info)
13385 (struct bidi_string_data, struct bidi_it, struct composition_it)
13387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13388 (struct display_pos, struct composition_it, struct it):
13389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13390 * dispnew.c (increment_matrix_positions)
13391 (increment_row_positions, mode_line_string)
13392 (marginal_area_string):
13393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13394 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13396 (duration_to_sec_usec): New function, to check for overflow better.
13397 (Fsleep_for, sit_for): Use it.
13398 * doc.c (get_doc_string, store_function_docstring):
13399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13400 (get_doc_string, Fsnarf_documentation):
13401 Use int, not EMACS_INT, where int is wide enough.
13403 Use SAFE_ALLOCA, not alloca.
13404 Check for overflow when converting EMACS_INT to off_t.
13405 * doprnt.c (doprnt):
13406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13407 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13408 Don't assume uid_t fits into fixnum.
13409 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13410 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13411 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13412 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13413 (general_insert_function)
13414 (Finsert_char, make_buffer_string, make_buffer_string_both)
13415 (update_buffer_properties, Fbuffer_substring)
13416 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13417 (Fsubst_char_in_region, check_translation)
13418 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13419 (transpose_markers, Ftranspose_regions):
13420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13421 (clip_to_bounds): Move to lisp.h as an inline function).
13422 (Fconstrain_to_field): Don't assume integers are nonnegative.
13423 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13424 (Fsubst_char_in_region, Fsave_restriction):
13425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13426 (Femacs_pid): Don't assume pid_t fits into fixnum.
13427 (lo_time): Use int, not EMACS_INT, when int suffices.
13428 (lisp_time_argument): Check for usec out of range.
13429 (Fencode_time): Don't assume fixnum fits in int.
13430 (Fuser_login_name, Fuser_full_name): Signal an error
13431 if a uid argument is out of range, rather than relying on
13432 undefined behavior.
13433 (Fformat_time_string): Remove now-unnecessary check.
13434 lisp_time_argument checks for out-of-range usec now.
13435 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13436 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13437 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13438 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13439 (init_cmdargs, Fdump_emacs):
13440 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13441 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13442 the bottom (typically) 32 bits of the fixnum.
13443 * eval.c (specpdl_size, call_debugger):
13444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13445 (when_entered_debugger, Fbacktrace_debug):
13446 Don't assume fixnum can fit in int.
13447 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13448 the object just before a buffer; this is not portable.
13449 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13450 (grow_specpdl, unbind_to):
13451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13452 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13453 (grow_specpdl): Simplify allocation by using xpalloc.
13454 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13455 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13456 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13458 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13459 (a_write, e_write):
13460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13461 (Fcopy_file, non_regular_nbytes, read_non_regular)
13462 (Finsert_file_contents):
13463 Use int, not EMACS_INT, where int is wide enough.
13464 (READ_BUF_SIZE): Verify that it fits in int.
13465 (Finsert_file_contents): Check that counts are in proper range,
13466 rather than assuming fixnums fit into ptrdiff_t etc.
13467 Don't assume fixnums fit into int.
13468 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13469 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13470 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13471 (string_char_to_byte, string_byte_to_char)
13472 (string_make_multibyte, string_to_multibyte)
13473 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13474 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13475 (substring_both, Fdelete, internal_equal, Ffillarray)
13476 (Fclear_string, mapcar1)
13477 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13478 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13479 (larger_vector, make_hash_table, maybe_resize_hash_table)
13480 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13481 (Fmaphash, secure_hash):
13482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13483 (concat): Check for string index and length overflow.
13484 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13487 (larger_vector): New API (vec, incr_min, size_max) replaces old
13488 one (vec, new_size, init). This catches size overflow.
13489 INIT was removed because it was always Qnil.
13490 All callers changed.
13491 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13492 the upper bound on a hash table index size.
13493 (make_hash_table, maybe_resize_hash_table): Use it.
13494 (secure_hash): Computer start_byte and end_byte only after
13495 they're known to be in ptrdiff_t range.
13496 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13497 (Ffont_get_glyphs, Ffont_at):
13498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13499 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13500 (Flist_fonts, Fopen_font):
13501 Don't assume fixnum can fit in int.
13502 (check_gstring): Don't assume index can fit in int.
13503 (font_match_p): Check that fixnum is a character, not a nonnegative
13504 fixnum, since the later code needs to stuff it into an int.
13505 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13506 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13507 conversion overflow issues.
13508 (Fopen_font): Check for integer out of range.
13509 (Ffont_get_glyphs): Don't assume index can fit in int.
13510 * font.h: Adjust decls to match defn changes elsewhere.
13511 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13513 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13514 printmax_t, where ptrdiff_t is wide enough.
13515 (Finternal_char_font):
13516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13517 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13518 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13519 (Fset_frame_position, x_set_frame_parameters)
13520 (x_set_line_spacing, x_set_border_width)
13521 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13522 Check that fixnums are in proper range for system types.
13523 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13525 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13526 Use SAFE_ALLOCA_LISP, not alloca.
13527 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13528 intptr_t is wide enough.
13529 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13530 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13531 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13532 Check for fixnum out of range.
13533 * ftfont.c (ftfont_list): Don't assume index fits in int.
13534 Check that fixnums are in proper range for system types.
13535 (ftfont_shape_by_flt):
13536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13537 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13539 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13540 Check that fixnums are in proper range for system types.
13541 * gnutls.h: Adjust decls to match defn changes elsewhere.
13542 * gtkutil.c (xg_dialog_run):
13543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13544 (update_frame_tool_bar):
13545 Check that fixnums are in proper range for system types.
13546 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13547 (lookup_image): Check that fixnums are in range for system types.
13548 * indent.c (last_known_column, last_known_column_point):
13549 (current_column_bol_cache):
13550 (skip_invisible, current_column, check_display_width):
13551 (check_display_width, scan_for_column, current_column_1)
13552 (Findent_to, Fcurrent_indentation, position_indentation)
13553 (indented_beyond_p, Fmove_to_column, compute_motion):
13554 (Fcompute_motion, Fvertical_motion):
13555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13556 (last_known_column_modified): Use EMACS_INT, not int.
13557 (check_display_width):
13559 Check that fixnums and floats are in proper range for system types.
13560 (compute_motion): Don't assume index or fixnum fits in int.
13561 (compute_motion, Fcompute_motion):
13562 Use int, not EMACS_INT, when it is wide enough.
13563 (vmotion): Omit local var start_hpos that is always 0; that way
13564 we don't need to worry about overflow in expressions involving it.
13565 * indent.h: Adjust decls to match defn changes elsewhere.
13567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13568 Use int, not EMACS_INT, where int is wide enough.
13569 Remove unused members ovstring_chars_done and tab_offset;
13571 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13572 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13573 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13574 (make_gap, copy_text, insert, insert_and_inherit)
13575 (insert_before_markers, insert_before_markers_and_inherit)
13576 (insert_1, count_combining_before, count_combining_after)
13577 (insert_1_both, insert_from_string)
13578 (insert_from_string_before_markers, insert_from_string_1)
13579 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13580 (adjust_after_replace, adjust_after_insert, replace_range)
13581 (replace_range_2, del_range, del_range_1, del_range_byte)
13582 (del_range_both, del_range_2, modify_region)
13583 (prepare_to_modify_buffer, signal_before_change)
13584 (signal_after_change, Fcombine_after_change_execute):
13585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13586 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13587 (balance_an_interval, split_interval_right, split_interval_left)
13588 (find_interval, next_interval, update_interval)
13589 (adjust_intervals_for_insertion, delete_node, delete_interval)
13590 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13591 (static_offset_intervals, offset_intervals)
13592 (merge_interval_right, merge_interval_left, make_new_interval)
13593 (graft_intervals_into_buffer, temp_set_point_both)
13594 (temp_set_point, set_point, adjust_for_invis_intang)
13595 (set_point_both, move_if_not_intangible, get_property_and_range)
13596 (get_local_map, copy_intervals, copy_intervals_to_string)
13597 (compare_string_intervals, set_intervals_multibyte_1):
13598 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13599 * intervals.h: Adjust decls to match defn changes elsewhere.
13601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13602 * keyboard.c (this_command_key_count, this_single_command_key_start)
13603 (before_command_key_count, before_command_echo_length, echo_now)
13604 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13605 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13606 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13607 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13609 (last_non_minibuf_size, last_point_position, echo_truncate)
13610 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13611 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13612 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13613 (stuff_buffered_input):
13614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13615 (last_auto_save, command_loop_1, read_char):
13616 Use EMACS_INT, not int, to avoid integer overflow.
13617 (record_char): Avoid overflow in total_keys computation.
13618 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13619 * keyboard.h: Adjust decls to match defn changes elsewhere.
13620 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13621 (Fkey_description, Fdescribe_vector, Flookup_key):
13622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13623 (click_position): New function, to check that positions are in range.
13624 (Fcurrent_active_maps):
13625 (describe_command):
13626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13627 (Faccessible_keymaps, Fkey_description):
13628 (preferred_sequence_p):
13629 Don't assume fixnum can fit into int.
13630 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13631 Check for integer overflow in size calculations.
13632 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13633 avoid mishandling large integers.
13634 * lisp.h: Adjust decls to match defn changes elsewhere.
13635 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13636 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13637 (struct Lisp_Marker):
13638 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13639 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13640 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13641 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13642 All callers changed.
13643 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13644 Assume the arg has valid form, since it always does.
13645 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13646 unsigned integer system type.
13647 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13648 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13650 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13651 (duration_to_sec_usec): New decl.
13652 * lread.c (read_from_string_index, read_from_string_index_byte)
13653 (read_from_string_limit, readchar, unreadchar, openp)
13654 (read_internal_start, read1, oblookup):
13655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13656 (Fload, readevalloop, Feval_buffer, Feval_region):
13657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13658 (openp): Check for out-of-range argument to 'access'.
13659 (read1): Use int, not EMACS_INT, where int is wide enough.
13660 Don't assume fixnum fits into int.
13661 Fix off-by-one error that can read outside a buffer.
13662 (read_filtered_event): Use duration_to_sec_usec
13663 to do proper overflow checking on durations.
13664 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13665 in size calculation.
13666 (Fexecute_kbd_macro):
13667 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13668 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13669 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13670 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13671 (set_marker_both, set_marker_restricted_both, marker_position)
13672 (marker_byte_position, Fbuffer_has_markers_at):
13673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13674 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13675 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13676 It now merely ensures that the menu is large enough, without
13677 necessarily growing it, as this avoids some integer overflow issues.
13678 All callers changed.
13679 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13681 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13682 Use SAFE_ALLOCA_LISP, not alloca.
13683 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13684 to EMACS_INT. Check that fixnums are in proper range for system types.
13685 * minibuf.c (minibuf_prompt_width, string_to_object)
13686 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13687 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13689 (get_minibuffer, read_minibuf_unwind):
13690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13691 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13692 this simplifies overflow checking. All callers changed.
13693 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13694 (Ftest_completion):
13695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13696 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13697 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13698 Check that fixnums are in proper range for system types.
13699 (Fx_create_frame, Fx_show_tip):
13700 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13701 * nsfont.m (ns_findfonts, nsfont_list_family):
13702 Don't assume fixnum fits in long.
13703 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13705 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13707 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13709 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13710 (PRINTDECLARE, PRINTPREPARE):
13711 (strout, print_string):
13712 (print, print_preprocess, print_check_string_charset_prop)
13714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13716 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13718 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13719 (printchar, strout): Use xpalloc to catch size calculation overflow.
13720 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13721 (print_error_message): Use SAFE_ALLOCA, not alloca.
13722 (print_object): Use int, not EMACS_INT, where int is wide enough.
13723 (print_depth, new_backquote_output, print_number_index):
13724 Use ptrdiff_t, not int, where int might not be wide enough.
13725 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13726 (Fset_process_window_size, Fformat_network_address)
13727 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13729 Check that fixnums are in proper range for system types.
13730 (Fsignal_process): Simplify by avoiding a goto.
13731 Check for process-ids out of pid_t range rather than relying on
13732 undefined behavior.
13733 (process_tick, update_tick): Use EMACS_INT, not int.
13734 (Fformat_network_address, read_process_output, send_process)
13735 (Fprocess_send_region, status_notify):
13736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13737 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13738 (wait_reading_process_output, read_process_output, exec_sentinel):
13739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13740 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13741 (Faccept_process_output): Use duration_to_sec_usec to do proper
13742 overflow checking on durations.
13743 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13744 Don't assume pid_t fits in int.
13745 * process.h (struct Lisp_Process): Members tick and update_tick
13746 are now of type EMACS_INT, not int.
13747 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13748 configured --with-wide-int.
13749 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13750 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13751 * search.c (looking_at_1, string_match_1):
13752 (fast_string_match, fast_c_string_match_ignore_case)
13753 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13754 (scan_newline, find_before_next_newline, search_command)
13755 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13756 (set_search_regs, wordify):
13759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13760 (string_match_1, search_buffer, set_search_regs):
13762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13763 (wordify): Check for overflow in size calculation.
13764 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13765 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13766 Check that fixnums are in proper range for system types.
13767 * sound.c (struct sound_device)
13768 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13769 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13770 (Fplay_sound_internal):
13771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13772 * syntax.c (struct lisp_parse_state, find_start_modiff)
13773 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13774 (Fparse_partial_sexp):
13775 Don't assume fixnums can fit in int.
13776 (struct lisp_parse_state, find_start_pos, find_start_value)
13777 (find_start_value_byte, find_start_begv)
13778 (update_syntax_table, char_quoted, dec_bytepos)
13779 (find_defun_start, prev_char_comend_first, back_comment):
13780 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13781 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13783 (Finternal_describe_syntax_value): Check that match_lisp is a
13784 character, not an integer, since the code stuffs it into int.
13785 (scan_words, scan_sexps_forward):
13786 Check that fixnums are in proper range for system types.
13788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13789 (scan_sexps_forward):
13790 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13791 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13792 * syntax.h: Adjust decls to match defn changes elsewhere.
13793 (struct gl_state_s):
13794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13795 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13796 MOST_POSITIVE_FIXNUM.
13797 * sysdep.c (wait_for_termination_1, wait_for_termination)
13798 (interruptible_wait_for_termination, mkdir):
13799 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13800 (emacs_read, emacs_write):
13801 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13802 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13803 and double all fit in int.
13804 * term.c (set_tty_color_mode):
13805 Check that fixnums are in proper range for system types.
13806 * termhooks.h (struct input_event):
13807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13808 * textprop.c (validate_interval_range, interval_of)
13809 (Fadd_text_properties, set_text_properties_1)
13810 (Fremove_text_properties, Fremove_list_of_text_properties)
13811 (Ftext_property_any, Ftext_property_not_all)
13812 (copy_text_properties, text_property_list, extend_property_ranges)
13813 (verify_interval_modification):
13814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13815 (Fnext_single_char_property_change)
13816 (Fprevious_single_char_property_change):
13817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13818 (copy_text_properties):
13819 Check for integer overflow in index calculation.
13820 * undo.c (last_boundary_position, record_point, record_insert)
13821 (record_delete, record_marker_adjustment, record_change)
13822 (record_property_change):
13823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13824 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13826 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13827 (Fx_hide_tip, Fx_file_dialog):
13828 * w32menu.c (set_frame_menubar):
13829 Use ptrdiff_t, not int, for consistency with rest of code.
13830 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13831 (select_window, Fdelete_other_windows_internal)
13832 (window_scroll_pixel_based, window_scroll_line_based)
13833 (Frecenter, Fset_window_configuration):
13834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13835 (Fset_window_hscroll, run_window_configuration_change_hook)
13836 (set_window_buffer, temp_output_buffer_show, scroll_command)
13837 (Fscroll_other_window, Frecenter):
13838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13839 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13840 Don't assume fixnum fits in int.
13841 (Fset_window_scroll_bars):
13842 Check that fixnums are in proper range for system types.
13843 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13844 (string_pos, c_string_pos, number_of_chars, init_iterator)
13845 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13846 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13847 (compute_display_string_end, handle_face_prop)
13848 (face_before_or_after_it_pos, handle_invisible_prop)
13849 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13850 (display_prop_intangible_p, string_buffer_position_lim)
13851 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13852 (get_overlay_strings_1, get_overlay_strings)
13853 (iterate_out_of_display_property, forward_to_next_line_start)
13854 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13855 (get_next_display_element, set_iterator_to_next)
13856 (get_visually_first_element, compute_stop_pos_backwards)
13857 (handle_stop_backwards, next_element_from_buffer)
13858 (move_it_in_display_line_to, move_it_in_display_line)
13859 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13860 (add_to_log, message_dolog, message_log_check_duplicate)
13861 (message2, message2_nolog, message3, message3_nolog
13862 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13863 (current_message_1, truncate_echo_area, truncate_message_1)
13864 (set_message, set_message_1, store_mode_line_noprop)
13865 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13866 (text_outside_line_unchanged_p, check_point_in_composition)
13867 (reconsider_clip_changes)
13868 (redisplay_internal, set_cursor_from_row, try_scrolling)
13869 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13870 (redisplay_window, find_last_unchanged_at_beg_row)
13871 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13872 (trailing_whitespace_p, find_row_edges, display_line)
13873 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13874 (display_mode_element, store_mode_line_string)
13875 (pint2str, pint2hrstr, decode_mode_spec)
13876 (display_count_lines, display_string, draw_glyphs)
13877 (x_produce_glyphs, x_insert_glyphs)
13878 (rows_from_pos_range, mouse_face_from_buffer_pos)
13879 (fast_find_string_pos, mouse_face_from_string_pos)
13880 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13882 (safe_call, init_from_display_pos, handle_fontified_prop)
13883 (handle_single_display_spec, load_overlay_strings)
13884 (with_echo_area_buffer, setup_echo_area_for_printing)
13885 (display_echo_area, echo_area_display)
13886 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13887 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13888 (redisplay_window, dump_glyph_row, display_mode_line)
13889 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13890 (handle_display_spec, display_prop_string_p):
13891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13892 (handle_single_display_spec, build_desired_tool_bar_string)
13893 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13894 (get_specified_cursor_type):
13895 Check that fixnums are in proper range for system types.
13896 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13897 (Flookup_image_map):
13898 Don't assume fixnums fit in int.
13899 (compare_overlay_entries):
13900 Avoid mishandling comparisons due to subtraction overflow.
13901 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13902 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13903 (handle_tool_bar_click):
13904 Use int, not unsigned, since we prefer signed and the signedness
13905 doesn't matter here.
13906 (get_next_display_element, next_element_from_display_vector):
13907 Use int, not EMACS_INT, when int is wide enough.
13908 (start_hourglass): Use duration_to_sec_usec to do proper
13909 overflow checking on durations.
13910 * xfaces.c (Fbitmap_spec_p):
13911 Check that fixnums are in proper range for system types.
13912 (compare_fonts_by_sort_order):
13913 Avoid mishandling comparisons due to subtraction overflow.
13914 (Fx_family_fonts, realize_basic_faces):
13915 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13917 Don't assume fixnum fits in int.
13918 Use SAFE_ALLOCA_LISP, not alloca.
13919 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13920 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13921 (face_at_buffer_position, face_for_overlay_string)
13922 (face_at_string_position):
13923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13924 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13925 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13927 Check that fixnums are in proper range for system types.
13928 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13929 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13931 (Fx_change_window_property): Don't assume fixnums fit in int.
13932 * xfont.c (xfont_chars_supported):
13933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13934 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13935 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13937 * xml.c (parse_region):
13938 * xrdb.c (magic_file_p):
13939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13940 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13941 (x_get_local_selection, x_reply_selection_request)
13942 (x_handle_selection_request, wait_for_property_change):
13943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13944 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13945 short is wide enough.
13946 (x_send_client_event): Don't assume fixnum fits in int.
13947 * xterm.c (x_x_to_emacs_modifiers):
13948 Don't assume EMACS_INT overflows nicely into int.
13949 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13950 may come from Lisp.
13951 (handle_one_xevent): NATNUMP can eval its arg twice.
13952 (x_connection_closed):
13953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13954 * xterm.h: Adjust decls to match defn changes elsewhere.
13955 (struct scroll_bar): Use struct vectorlike_header
13956 rather than rolling our own approximation.
13957 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13959 2012-05-25 Glenn Morris <rgm@gnu.org>
13961 * lisp.mk (lisp): Update for more files being compiled now.
13963 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13965 * lread.c: Remove `read_pure' which makes no difference.
13966 (read_pure): Remove var.
13967 (unreadpure): Remove function.
13968 (readevalloop): Don't call read_list with -1 flag.
13969 (read1, read_vector): Don't test read_pure any more.
13970 (read_list): Simplify.
13972 * fileio.c, character.h: Minor style tweaks.
13974 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13976 * window.h (clip_changed): Remove useless declaration.
13978 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13980 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13981 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13983 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13986 This directory predates autoconf and is no longer needed nowadays.
13987 Move its few remaining bits of functionality to where they're needed.
13988 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13989 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13990 * m/template.h: Remove.
13991 * Makefile.in (M_FILE): Remove. All uses removed.
13992 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13993 * lisp.h (USE_LSB_TAG):
13994 * mem-limits.h (EXCEEDS_LISP_PTR):
13995 Use VAL_MAX, not VALBITS, in #if.
13996 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13997 (EMACS_UINT): Define unconditionally now.
13998 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13999 (BITS_PER_EMACS_INT): New constants, replacing
14000 what used to be in config.h, but not useful in #if.
14001 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14002 define them any more.
14003 (VAL_MAX): New macro.
14005 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14006 BITS_PER_EMACS_INT, in #if.
14007 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14008 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14009 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14010 * s/ms-w32.h (DATA_START):
14011 Move here from removed file m/intel386.h.
14012 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14013 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14015 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14017 Assume C89 or later.
14018 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14019 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14021 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14022 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14023 * textprop.c, tparam.c (NULL): Remove.
14024 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14025 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14026 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14027 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14028 * xterm.c (input_signal_count): Assume volatile works.
14030 2012-05-21 Ken Brown <kbrown@cornell.edu>
14032 * xgselect.c (xg_select): Fix first argument in call to 'select'
14035 2012-05-20 Ken Brown <kbrown@cornell.edu>
14037 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14038 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14040 2012-05-19 Ken Brown <kbrown@cornell.edu>
14042 * xfns.c (x_in_use): Remove `static' qualifier.
14043 * xterm.h (x_in_use): Declare.
14044 * xgselect.c: Include xterm.h.
14045 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14046 and `display_arg' (bug#9754).
14048 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14050 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14052 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14053 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14055 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14057 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14059 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14060 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14062 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14063 reference to image_cache->refcount.
14064 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14066 2012-05-17 Juri Linkov <juri@jurta.org>
14068 * search.c (Fword_search_regexp, Fword_search_backward)
14069 (Fword_search_forward, Fword_search_backward_lax)
14070 (Fword_search_forward_lax): Move functions to isearch.el
14071 (bug#10145, bug#11381).
14073 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14075 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14077 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14079 * lread.c (init_obarray): Declare Qt and Qnil as special.
14081 2012-05-14 Glenn Morris <rgm@gnu.org>
14083 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14084 Put "libexec" before "bin", for the sake of init_callproc_1.
14086 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14088 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14090 * unexaix.c: Port to more-recent AIX compilers.
14091 (report_error, report_error_1, make_hdr, copy_sym)
14092 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14093 Make arguments const char *, not char *, to avoid violations of C
14094 standard and to fix some AIX warnings reported by Gilles Pion.
14096 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14098 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14099 already have overlays loaded.
14100 (handle_single_display_spec): Before returning without displaying
14101 fringe bitmap, synchronize the bidi iterator with the main display
14102 iterator, by calling iterate_out_of_display_property.
14103 (iterate_out_of_display_property): Detect buffer iteration by
14104 testing that it->string is a Lisp string.
14105 (get_next_display_element): When the current object is exhausted,
14106 and there's something on it->stack, call set_iterator_to_next to
14107 proceed with what's on the stack, instead of returning zero.
14108 (set_iterator_to_next): If called at the end of a Lisp string,
14109 proceed to consider_string_end without incrementing string
14110 position. Don't increment display vector index past the end of
14111 the display vector. (Bug#11417)
14112 (pos_visible_p): Don't report a position visible when move_it_to
14113 stopped at the last line of window, which happens to be scanned
14114 backwards by the bidi iteration. (Bug#11464)
14116 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14118 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14119 and right-margin display specs even if the spec is invalid or we
14120 are on a TTY, and thus unable to display on the fringes.
14121 That's because the text with the property will not be displayed anyway,
14122 so we need to signal to the caller that this is a "replacing"
14123 display spec. This fixes display when the spec is invalid or we
14126 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14128 * unexaix.c (make_hdr): Fix typo in prototype.
14129 This bug broke the build on AIX. Problem reported by Gilles Pion.
14131 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14133 * keyboard.c (kbd_buffer_get_event): Read special events also in
14134 batch mode. (Bug#11415)
14136 2012-05-12 Glenn Morris <rgm@gnu.org>
14138 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14140 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14142 * lisp.mk (lisp): Add newcomment.elc.
14144 2012-05-12 Glenn Morris <rgm@gnu.org>
14146 * Makefile.in (MKDIR_P): New, set by configure.
14147 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14149 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14151 Remove unused function hourglass_started.
14152 * dispextern.h (hourglass_started):
14153 * w32fns.c (hourglass_started):
14154 * xdisp.c (hourglass_started): Remove.
14156 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14158 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14159 Update dependencies.
14161 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14163 * xgselect.c (xg_select): Put maxfds+1 into a var.
14164 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14166 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14168 2012-05-10 Dave Abrahams <dave@boostpro.com>
14170 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14171 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14173 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14175 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14176 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14177 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14178 Initialize xd_registered_buses.
14180 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14182 Untag more efficiently if USE_LSB_TAG.
14183 This is based on a proposal by YAMAMOTO Mitsuharu in
14184 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14185 For an admittedly artificial (nth 8000 longlist) benchmark on
14186 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14187 Emacs's overall text size by 1%.
14188 * lisp.h (XUNTAG): New macro.
14189 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14190 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14191 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14192 * eval.c (Fautoload):
14193 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14194 * frame.h (XFRAME): Use XUNTAG.
14196 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14197 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14198 Remove unportable assumptions about print widths of types like
14200 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14201 intptr_t when converting between pointer and integer, to avoid GCC
14202 warnings about wrong width.
14204 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14206 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14207 stack for each reader_thread, instead of defaulting to 8MB
14208 determined by the linker. This avoids failures in creating
14209 subprocesses on Windows 7, see the discussion in this thread:
14210 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14212 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14214 Fix up display of the *Minibuf-0* buffer in the mini window.
14215 * keyboard.c (read_char): Don't clear the echo area if there's no
14217 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14218 contents of *Minibuf-0*) if there's no message displayed in its stead.
14220 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14222 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14225 2012-05-06 Chong Yidong <cyd@gnu.org>
14227 * lisp.mk (lisp): Update.
14229 2012-05-05 Jim Meyering <meyering@redhat.com>
14231 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14233 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14235 * data.c (PUT_ERROR): New macro.
14236 (syms_of_data): Use it. Add new error type `user-error'.
14237 * undo.c (user_error): New function.
14238 (Fprimitive_undo): Use it.
14239 * print.c (print_error_message): Adjust print style for `user-error'.
14240 * keyboard.c (user_error): New function.
14241 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14243 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14245 Do not limit current-time-string to years 1000..9999.
14246 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14247 (Fcurrent_time_string): Support any year that is supported by the
14248 underlying localtime representation. Don't use asctime, as it
14249 has undefined behavior for years outside the range -999..9999.
14251 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14253 Fix race conditions involving setenv, gmtime, localtime, asctime.
14254 Without this fix, interrupts could mess up code that uses these
14255 nonreentrant functions, since setting TZ invalidates existing
14256 tm_zone or tzname values, and since most of these functions return
14257 pointers to static storage.
14258 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14259 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14260 Grow the critical sections to include not just invoking
14261 localtime/gmtime, but also accessing these functions' results
14262 including their tm_zone values if any, and any related TZ setting.
14263 (format_time_string): Last arg is now struct tm *, not struct tm **,
14264 so that the struct tm is saved in the critical section.
14265 All callers changed. Simplify allocation of initial buffer, partly
14266 motivated by the fact that memory allocation needs to be outside
14267 the critical section.
14269 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14271 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14272 with RESET_INTERVAL.
14274 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14275 Remove duplicated buffer name initialization.
14277 2012-05-02 Jim Meyering <jim@meyering.net>
14279 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14281 * xfns.c (x_window): Use xstrdup (Bug#11375).
14283 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14285 * xdisp.c (pos_visible_p): If already at a newline from the
14286 display string before the 'while' loop, don't walk back the glyphs
14287 from it3.glyph_row. Solves assertion violation when the display
14288 string begins with a newline (egg.el). (Bug#11367)
14290 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14292 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14295 2012-05-01 Glenn Morris <rgm@gnu.org>
14297 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14298 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14299 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14300 All were removed before 23.1.
14302 * dispnew.c: Remove HAVE_LIBNCURSES test;
14303 it is always true on relevant platforms.
14305 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14306 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14308 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14310 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14312 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14313 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14316 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14318 Do not avoid creating empty evaporating overlays (Bug#9642).
14319 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14320 That is, do not delete an evaporating overlay if it becomes
14321 empty after its bounds are adjusted to fit within its buffer.
14322 This fix caused other problems, and I'm reverting it until we get
14323 to the bottom of them.
14325 2012-04-27 Chong Yidong <cyd@gnu.org>
14327 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14329 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14331 * xdisp.c (pos_visible_p): If the window start position is beyond
14332 ZV, start the display from buffer beginning. Prevents assertion
14333 violation in init_iterator when the minibuffer window is scrolled
14334 via the scroll bar.
14336 * window.c (window_scroll_pixel_based): Likewise.
14338 2012-04-27 Chong Yidong <cyd@gnu.org>
14340 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14342 2012-04-27 Glenn Morris <rgm@gnu.org>
14344 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14345 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14347 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14349 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14350 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14352 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14354 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14355 display element, check also the underlying string or buffer
14356 character. (Bug#11341)
14358 * w32menu.c: Include w32heap.h.
14359 (add_menu_item): If the call to AppendMenuW (via
14360 unicode_append_menu) fails, disable Unicode menus only if we are
14361 running on Windows 9X/Me.
14363 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14365 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14366 (xgetint): Add missing shift for LSB tags.
14368 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14370 * keyboard.c (read_char): Don't wipe echo area for select window
14371 events: These might get delayed via `mouse-autoselect-window'
14374 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14376 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14377 manipulation of :loaded-from data.
14379 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14381 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14382 now a cons (bug#11311).
14384 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14386 Do not create empty overlays with the evaporate property (Bug#9642).
14387 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14388 if it becomes empty after its bounds are adjusted to fit within
14389 its buffer. Without this fix, in a nonempty buffer (let ((o
14390 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14391 yields an empty overlay that has the evaporate property, which is
14392 not supposed to happen.
14394 Fix minor GTK3 problems found by static checking.
14395 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14396 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14397 (struct _EmacsFixedClass, emacs_fixed_get_type):
14398 Move decls here from emacsgtkfixed.h, since they needn't be public.
14399 (emacs_fixed_get_type): Now static.
14400 (emacs_fixed_class_init): Omit unused local.
14401 (emacs_fixed_child_type): Remove; unused.
14402 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14403 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14404 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14405 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14406 (EMACS_FIXED_GET_CLASS): Remove; unused.
14407 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14409 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14410 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14412 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14414 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14415 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14416 (__malloc_size_t, __malloc_ptrdiff_t):
14417 Remove. All uses removed, replaced by the definiens if needed,
14418 since we can assume C89 or better now.
14419 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14420 (protect_malloc_state, align, get_contiguous_space)
14421 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14422 (malloc_atfork_handler_child, malloc_enable_thread)
14423 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14424 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14425 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14426 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14427 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14428 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14429 Define using prototypes, not old style.
14430 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14431 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14432 (align): Don't assume that signed integer overflow wraps around.
14433 Omit unused local var.
14434 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14435 (_free_internal_nolock, memalign, mallochook, reallochook):
14436 Omit no-longer-needed casts.
14437 (valloc): Use getpagesize, not __getpagesize.
14438 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14439 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14441 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14443 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14445 Move functions from C to Lisp. Make non-blocking method calls
14446 the default. Implement further D-Bus standard interfaces.
14448 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14449 (QCdbus_request_name_allow_replacement)
14450 (QCdbus_request_name_replace_existing)
14451 (QCdbus_request_name_do_not_queue)
14452 (QCdbus_request_name_reply_primary_owner)
14453 (QCdbus_request_name_reply_in_queue)
14454 (QCdbus_request_name_reply_exists)
14455 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14456 (QCdbus_registered_serial, QCdbus_registered_method)
14457 (QCdbus_registered_signal): New Lisp objects.
14458 (XD_DEBUG_MESSAGE): Use sizeof.
14459 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14460 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14461 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14462 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14463 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14464 (xd_signature, xd_append_arg): Allow float for integer types.
14465 (xd_get_connection_references): New function.
14466 (xd_get_connection_address): Rename from xd_initialize.
14467 Return cached address.
14468 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14469 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14471 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14472 Return number of refcounts.
14473 (Fdbus_get_unique_name): Make stronger parameter check.
14474 (Fdbus_message_internal): New defun.
14475 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14476 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14477 (Fdbus_send_signal, Fdbus_register_service)
14478 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14479 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14480 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14481 (Vdbus_compiled_version, Vdbus_runtime_version)
14482 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14483 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14484 (Vdbus_message_type_signal): New defvars.
14485 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14488 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14490 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14491 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14492 Do not assume ptrdiff_t is the same width as 'int'.
14494 * alloc.c: Handle unusual debugging option combinations.
14495 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14496 since the two debugging options are incompatible.
14497 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14499 (mem_init, mem_insert, mem_insert_fixup):
14500 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14501 (NEED_MEM_INSERT): Remove; no longer needed.
14503 2012-04-22 Leo Liu <sdl.web@gmail.com>
14505 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14507 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14509 * sysdep.c [__FreeBSD__]: Minor cleanups.
14510 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14511 Use Emacs indenting style more consistently. Avoid some casts.
14512 Use 'double' consistently rather than mixing 'float' and 'double'.
14514 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14516 * sysdep.c (list_system_processes, system_process_attributes):
14517 Add implementation for FreeBSD (Bug#5243).
14519 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14521 * lisp.mk (lisp): Update.
14523 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14525 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14526 It is never used otherwise.
14528 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14530 * print.c (print_preprocess): Only check print_depth if print-circle
14532 (print_object): Check for cycles even when print-circle is nil and
14533 print-gensym is t, but only check print_depth if print-circle is nil.
14535 2012-04-20 Chong Yidong <cyd@gnu.org>
14537 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14538 set the status to "failed" and ensure that sentinel is run.
14540 2012-04-20 Glenn Morris <rgm@gnu.org>
14542 * process.c (Fset_process_inherit_coding_system_flag)
14543 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14544 (Fmake_network_process, Fmake_serial_process): Doc fix.
14546 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14548 * xdisp.c (string_buffer_position_lim): Limit starting position to
14550 (set_cursor_from_row): If called for a mode-line or header-line
14551 row, return zero immediately.
14552 (try_cursor_movement): If inside continuation line, don't back up
14553 farther than the first row after the header line, if any.
14554 Don't consider the header-line row as "partially visible", even if
14555 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14557 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14559 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14562 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14563 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14565 configure: new option --enable-gcc-warnings (Bug#11207)
14566 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14567 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14568 (ALL_CFLAGS): Use new macros rather than old.
14569 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14570 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14571 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14572 -Wunused-result, -Wunused-variable. This should go away once
14573 the Emacs and Gnulib regex code is merged.
14574 (xmalloc, xrealloc): Now static.
14576 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14578 * dired.c (Fsystem_groups): Remove unused local.
14580 2012-04-17 Glenn Morris <rgm@gnu.org>
14582 * dired.c (Fsystem_users): Doc fix.
14584 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14586 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14587 (syms_of_dired): Add them.
14589 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14591 Fix minor alloc.c problems found by static checking.
14592 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14593 New extern decls, to avoid calling undeclared functions.
14594 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14595 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14596 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14597 (NEED_MEM_INSERT): New macro.
14598 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14599 Remove one incorrect comment and fix another.
14601 Fix minor ralloc.c problems found by static checking.
14602 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14603 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14604 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14605 (r_alloc_sbrk): Now static.
14607 Improve ralloc.c interface checking.
14608 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14609 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14610 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14611 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14612 [REL_ALLOC]: ... to here, to check interface.
14613 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14614 Remove decls. This fixes an "It stinks!".
14616 * alloc.c (which_symbols): Fix alignment issue / type clash.
14618 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14620 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14621 (struct Lisp_Misc_Any): Likewise.
14622 (struct Lisp_Free): Likewise.
14623 * alloc.c (union aligned_Lisp_Symbol): Define.
14624 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14625 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14626 (union aligned_Lisp_Misc): Define.
14627 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14628 aligned_Lisp_Misc instead of union Lisp_Misc.
14629 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14631 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14633 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14634 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14635 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14636 * s/netbsd.h, s/sol2-6.h:
14637 Remove definition of GC_MARK_STACK, since the default now works.
14638 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14639 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14640 no longer the default.
14641 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14643 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14645 * lread.c (lisp_file_lexically_bound_p):
14646 Fix hang at ";-*-\n" (bug#11238).
14648 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14650 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14651 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14653 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14655 * nsterm.m (constrainFrameRect): Always constrain when there is only
14656 one screen (Bug#10962).
14658 2012-04-13 Ken Brown <kbrown@cornell.edu>
14660 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14662 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14664 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14666 2012-04-11 Daniel Colascione <dancol@dancol.org>
14668 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14669 against is gone. It's better to use vfork now so that when Cygwin
14670 gains a new, working vfork, we use it automatically (bug#10398).
14672 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14674 * window.c (save_window_save): Obey window-point-insertion-type.
14676 2012-04-11 Glenn Morris <rgm@gnu.org>
14678 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14680 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14682 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14684 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14686 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14687 (force_quit_count): New var.
14688 (handle_interrupt): Use it.
14690 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14692 * w32.c (w32_delayed_load): Record the full path of the library
14693 being loaded (bug#10424).
14695 2012-04-09 Glenn Morris <rgm@gnu.org>
14697 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14698 not just in the obarray, before snarfing them. (Bug#11036)
14700 * Makefile.in ($(leimdir)/leim-list.el):
14701 Pass EMACS rather than BUILT_EMACS.
14703 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14705 * process.c (make_process):
14706 * process.h: Add integer `gnutls_handshakes_tried' member to
14709 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14710 Add convenience `GNUTLS_LOG2i' macro.
14712 * gnutls.c (gnutls_log_function2i): Convenience log function.
14713 (emacs_gnutls_read): Use new log functions,
14714 `gnutls_handshakes_tried' process member, and
14715 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14716 attempts per process (connection).
14718 2012-04-09 Chong Yidong <cyd@gnu.org>
14720 * eval.c (Fuser_variable_p, user_variable_p_eh)
14721 (lisp_indirect_variable): Functions deleted.
14722 (Fdefvar): Caller changed.
14724 * callint.c (Finteractive, Fcall_interactively):
14725 * minibuf.c (Fread_variable): Callers changed.
14727 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14729 * xdisp.c (set_cursor_from_row): If the display string appears in
14730 the buffer at position that is closer to point than the position
14731 after the display string, display the cursor on the first glyph of
14732 the display string. Fixes cursor display when a 'display' text
14733 property immediately follows invisible text. (Bug#11094)
14735 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14737 composite.c: use 'double' consistently
14738 * composite.c (get_composition_id): Use 'double' consistently
14739 instead of converting 'float' to 'double' and vice versa; this is
14740 easier to understand and avoids a GCC warning.
14742 2012-04-09 Glenn Morris <rgm@gnu.org>
14744 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14745 preparation for dumping it with emacs. (Bug#4789)
14746 (leimdir): New variable.
14747 ($(leimdir)/leim-list.el): New rule.
14748 (emacs$(EXEEXT)): Depend on leim-list.el.
14750 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14751 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14752 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14754 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14756 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14759 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14761 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14762 Remove unused local variable.
14764 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14766 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14767 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14768 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14769 objects, as mark_maybe_pointer will catch them otherwise.
14770 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14771 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14773 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14775 Fix typo that broke non-Windows builds.
14776 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14778 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14780 Support building on MS-Windows with libxml2.
14782 * makefile.w32-in (OBJ2): Add xml.$(O).
14783 (GLOBAL_SOURCES): Add xml.c.
14784 ($(BLD)/xml.$(O)): New dependency list.
14786 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14787 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14788 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14789 [!WINDOWSNT]: New macros.
14790 (init_libxml2_functions, libxml2_loaded_p): New functions.
14791 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14792 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14793 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14794 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14796 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14797 Call init_libxml2_functions before calling libxml2 functions.
14798 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14800 * emacs.c: Don't include libxml/parser.h.
14801 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14802 xmlCleanupParser directly.
14804 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14806 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14808 * indent.c (Fvertical_motion): If there is a display string at
14809 point, use it.vpos to compute how many lines to backtrack after
14810 move_it_to point. (Bug#11133)
14812 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14814 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14815 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14816 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14817 macros related to unification of CJK characters. For the details,
14818 see the discussion following the message here:
14819 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14821 2012-04-04 Chong Yidong <cyd@gnu.org>
14823 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14825 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14827 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14828 instead of alloca. (Bug#11138)
14830 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14832 * w32menu.c (is_simple_dialog): Properly check lisp types.
14835 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14837 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14838 position we get to after a call to move_it_to fails the
14839 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14840 only if we wind up in a string from display property. (Bug#11063)
14842 * window.c (Fdelete_other_windows_internal): Invalidate the row
14843 and column information about mouse highlight, so that redisplay
14844 restores it after reallocating the glyph matrices. (Bug#7464)
14846 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14847 string comes from a `display' text property, use the buffer
14848 position of that property as if we actually saw that position in
14850 (move_it_by_lines): Remove the assertion that
14851 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14852 violated when there's a before-string at the beginning of a line.
14855 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14857 * xdisp.c (append_space_for_newline): If the default face was
14858 remapped, use the remapped face for the appended newline.
14859 (extend_face_to_end_of_line): Use the remapped default face for
14860 extending the face to the end of the line.
14861 (display_line): Call extend_face_to_end_of_line when the default
14862 face was remapped. (Bug#11068)
14864 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14866 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14868 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14870 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14872 2012-03-27 Glenn Morris <rgm@gnu.org>
14874 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14877 2012-03-26 Kenichi Handa <handa@m17n.org>
14879 * dispextern.h (struct glyph): Fix previous change. Change the
14880 bit length of glyphless.ch to 25 (Bug#11082).
14882 2012-03-26 Chong Yidong <cyd@gnu.org>
14884 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14885 (command_loop_1): Use it; inhibit selection update for
14886 handle-select-window too (Bug#8996).
14888 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14890 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14892 2012-03-25 Kenichi Handa <handa@m17n.org>
14894 * dispextern.h (struct glyph): Change the bit length of
14895 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14897 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14899 * s/ms-w32.h (tzname): Include time.h before redirecting to
14900 _tzname. Fixes the MSVC build. (Bug#9960)
14902 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14904 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14907 * xterm.c (XTread_socket): Only modify handling_signal if
14908 !SYNC_INPUT. (Bug#11080)
14910 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14912 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14913 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14914 when fetching a multibyte character consumes more bytes than
14915 CHAR_BYTES returns, due to unification of CJK characters in
14916 string_char. (Bug#11073)
14918 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14920 * process.c (wait_reading_process_output): Handle pty disconnect
14921 by refraining from sending oneself a SIGCHLD (bug#10933).
14923 2012-03-22 Chong Yidong <cyd@gnu.org>
14925 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14927 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14928 Mark string as coming from a prefix property.
14929 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14930 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14932 2012-03-21 Chong Yidong <cyd@gnu.org>
14934 * xfaces.c (Vface_remapping_alist): Doc fix.
14936 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14938 * w32proc.c (Fw32_set_console_codepage)
14939 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14942 2012-03-20 Chong Yidong <cyd@gnu.org>
14944 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14945 to reflect default non-nil value of redisplay-dont-pause.
14947 2012-03-19 Kenichi Handa <handa@m17n.org>
14949 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14950 it fit in a valid range (Bug#11003).
14952 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14954 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14955 that is not from display property, accept the row as a "cursor
14956 row" if one of the string's character has a non-nil `cursor'
14957 property. Fixes cursor positioning when there are newlines in
14958 overlay strings, e.g. in icomplete.el. (Bug#11035)
14960 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14962 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14964 2012-03-12 Chong Yidong <cyd@gnu.org>
14966 * eval.c (inhibit_lisp_code): Rename from
14967 inhibit_window_configuration_change_hook; move from window.c.
14969 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14970 * window.c (run_window_configuration_change_hook)
14971 (syms_of_window): Callers changed.
14973 2012-03-11 Chong Yidong <cyd@gnu.org>
14975 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14977 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14979 2012-03-10 Chong Yidong <cyd@gnu.org>
14981 * frame.c (other_visible_frames): Don't assume the selected frame
14982 is visible (Bug#10955).
14984 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14986 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14988 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14990 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14991 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14994 2012-03-03 Glenn Morris <rgm@gnu.org>
14996 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14998 2012-03-02 Eli Zaretskii <eliz@gnu.org>
15000 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15001 position past the first glyph_row that ends at ZV. (Bug#10902)
15002 (redisplay_window, next_element_from_string): Fix typos in
15004 (redisplay_window): Pass to move_it_vertically the margin in
15005 pixels, not in screen lines.
15007 2012-03-02 Glenn Morris <rgm@gnu.org>
15009 * buffer.c (buffer-list-update-hook): Doc fix.
15011 2012-02-29 Eli Zaretskii <eliz@gnu.org>
15013 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15014 push_it before setting up the iterator for the first overlay
15015 string, even if we have an empty string loaded.
15016 (next_overlay_string): If there's an empty string on the iterator
15017 stack, pop the stack. (Bug#10903)
15019 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15021 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15022 Suggested by Stefan Monnier in
15023 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15024 * alloc.c (widen_to_Lisp_Object): New static function.
15025 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15026 and widening them to Lisp_Objects. This would work even if
15027 USE_LSB_TAG is defined and wide integers are used, which might
15028 happen in a future version of Emacs.
15030 2012-02-25 Chong Yidong <cyd@gnu.org>
15032 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15035 * xselect.c (Fx_selection_exists_p): Doc fix.
15036 (x_clipboard_manager_save_all): Print an informative message
15037 before saving to clipboard manager.
15039 2012-02-24 Chong Yidong <cyd@gnu.org>
15041 * keyboard.c (process_special_events): Handle all X selection
15042 requests in kbd_buffer, not just the next one (Bug#8869).
15044 2012-02-23 Chong Yidong <cyd@gnu.org>
15046 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15047 call when setting menu-bar-lines and tool-bar-lines parameters.
15048 (unwind_create_frame_1): New helper function.
15050 * window.c (inhibit_window_configuration_change_hook): New var.
15051 (run_window_configuration_change_hook): Obey it.
15052 (syms_of_window): Initialize it.
15054 2012-02-22 Chong Yidong <cyd@gnu.org>
15056 * xterm.c (x_draw_image_relief): Add missing type check for
15057 Vtool_bar_button_margin (Bug#10743).
15059 2012-02-21 Chong Yidong <cyd@gnu.org>
15061 * fileio.c (Vfile_name_handler_alist): Doc fix.
15063 * buffer.c (Fget_file_buffer): Protect against invalid file
15064 handler return value.
15066 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15068 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15069 when computing $valmask.
15071 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15072 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15073 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15074 It's useless in that case, and it can cause problems on hosts
15075 that allocate halves of EMACS_INT values separately.
15076 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15077 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15078 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15079 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15080 it avoids undefined behavior on hosts where shifting right by more
15081 than the word width has undefined behavior.
15083 2012-02-19 Chong Yidong <cyd@gnu.org>
15085 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15086 (Funhandled_file_name_directory, Ffile_name_as_directory)
15087 (Fdirectory_file_name, Fexpand_file_name)
15088 (Fsubstitute_in_file_name): Protect against invalid file handler
15089 return values (Bug#10845).
15091 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15093 * .gdbinit (pitx): Fix incorrect references to fields of the
15096 2012-02-17 Chong Yidong <cyd@gnu.org>
15098 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15100 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15102 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15103 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15105 2012-02-15 Chong Yidong <cyd@gnu.org>
15107 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15108 marked as special. Also, starting docstrings with * is obsolete.
15110 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15112 * gnutls.c (emacs_gnutls_write): Fix last change.
15114 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15116 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15119 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15121 * keymap.c (Fsingle_key_description): Handle char ranges.
15123 2012-02-12 Chong Yidong <cyd@gnu.org>
15125 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15126 as that creates a dangerous corner case.
15128 * window.c (Fdelete_window_internal): Invalidate the mouse
15129 highlight (Bug#9904).
15131 2012-02-12 Glenn Morris <rgm@gnu.org>
15133 * xselect.c (Fx_own_selection_internal)
15134 (Fx_get_selection_internal, Fx_disown_selection_internal)
15135 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15136 * nsselect.m (Fx_own_selection_internal)
15137 (Fx_disown_selection_internal, Fx_selection_exists_p)
15138 (Fx_selection_owner_p, Fx_get_selection_internal):
15139 Sync docs and argument specs with the xselect.c versions.
15141 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15143 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15145 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15147 * w32select.c (Fx_selection_exists_p): Sync doc string and
15148 argument list with xselect.c. (Bug#10783)
15150 * w16select.c (Fx_selection_exists_p): Sync doc string and
15151 argument list with xselect.c. (Bug#10783)
15153 2012-02-10 Glenn Morris <rgm@gnu.org>
15155 * fns.c (Fsecure_hash): Doc fix.
15157 2012-02-09 Kenichi Handa <handa@m17n.org>
15159 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15161 2012-02-07 Chong Yidong <cyd@gnu.org>
15163 * buffer.c (Fbuffer_local_variables)
15164 (buffer_lisp_local_variables): Handle unbound vars correctly;
15165 don't let Qunbound leak into Lisp.
15167 2012-02-07 Glenn Morris <rgm@gnu.org>
15169 * image.c (Fimagemagick_types): Doc fix.
15171 * image.c (imagemagick-render-type): Change it from a lisp object
15172 to an integer. Move the doc here from the lisp manual.
15173 Treat all values not equal to 0 the same.
15175 2012-02-06 Chong Yidong <cyd@gnu.org>
15177 * doc.c (store_function_docstring): Avoid applying docstring of
15178 alias to base function (Bug#2603).
15180 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15182 * .gdbinit (pp1, pv1): Remove redundant defines.
15185 2012-02-04 Chong Yidong <cyd@gnu.org>
15187 * nsterm.m: Declare a global (Bug#10694).
15189 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15191 * w32.c (get_emacs_configuration_options):
15192 Include --enable-checking, if specified, in the return value.
15194 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15196 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15197 after rounding frame sizes. (Bug#9723)
15199 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15201 * keyboard.c (adjust_point_for_property): Don't position point
15202 before BEGV. (Bug#10696)
15204 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15206 Handle overflow when computing char display width (Bug#9496).
15207 * character.c (char_width): Return EMACS_INT, not int.
15208 (char_width, c_string_width): Check for overflow when
15209 computing the width; this is possible now that individual
15210 characters can have unbounded width. Problem introduced
15211 by merge from Emacs 23 on 2012-01-19.
15213 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15215 * dbusbind.c (Fdbus_register_method): Mention the return value
15216 :ignore in the docstring.
15218 2012-02-02 Glenn Morris <rgm@gnu.org>
15220 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15222 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15223 Unconditionally set to t. (Bug#10673)
15224 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15225 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15226 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15228 2012-02-02 Kenichi Handa <handa@m17n.org>
15230 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15231 0, do not call append_composite_glyph.
15233 2012-02-02 Kenichi Handa <handa@m17n.org>
15235 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15237 (x_produce_glyphs): If the component of a composition is a null
15238 string, set it->pixel_width to 1 to avoid zero-width glyph.
15240 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15242 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15243 first 2 arguments are identical. This makes inserting large
15244 output from a subprocess an order of magnitude faster on
15245 MS-Windows, where all sbrk'ed memory is always contiguous.
15247 2012-01-31 Glenn Morris <rgm@gnu.org>
15249 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15250 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15251 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15253 2012-01-29 Glenn Morris <rgm@gnu.org>
15255 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15257 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15259 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15261 2012-01-28 Chong Yidong <cyd@gnu.org>
15263 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15265 2012-01-26 Chong Yidong <cyd@gnu.org>
15267 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15269 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15270 repeat counts (Bug#10507).
15272 2012-01-26 Glenn Morris <rgm@gnu.org>
15274 * lread.c (syms_of_lread): Doc fix.
15276 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15278 * coding.c (encode_designation_at_bol): Change return value to
15281 2012-01-25 Chong Yidong <cyd@gnu.org>
15283 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15285 2012-01-21 Chong Yidong <cyd@gnu.org>
15287 * floatfns.c (Fcopysign): Make the second argument non-optional,
15288 since nil is not allowed anyway.
15290 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15292 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15293 (send_process): Likewise.
15295 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15297 * window.c (save_window_save, Fcurrent_window_configuration)
15298 (Vwindow_persistent_parameters): Do not use Qstate.
15299 Rewrite doc-strings.
15301 2012-01-19 Kenichi Handa <handa@m17n.org>
15303 * character.c (char_width): New function.
15304 (Fchar_width, c_string_width, lisp_string_width):
15305 Use char_width (Bug#9496).
15307 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15309 * window.c (Vwindow_persistent_parameters): New variable.
15310 (Fset_window_configuration, save_window_save): Handle persistent
15313 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15315 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15316 thrashing the stack of the thread. (Bug#9087)
15318 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15320 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15322 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15324 * xdisp.c (rows_from_pos_range): Handle the case where the
15325 highlight ends on a newline. (Bug#10464)
15326 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15327 he end column for display of highlight that ends on a newline
15330 2012-01-11 Glenn Morris <rgm@gnu.org>
15332 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15333 from load-path also when installation-directory is nil. (Bug#10208)
15335 2012-01-10 Glenn Morris <rgm@gnu.org>
15337 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15339 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15340 Update template values to be closer to their typical values these days.
15342 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15344 * xdisp.c (rows_from_pos_range): Accept additional argument
15345 DISP_STRING, and accept any glyph in a row whose object is that
15346 string as eligible for mouse highlight. Fixes mouse highlight of
15347 display strings from overlays. (Bug#10464)
15349 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15351 emacs: fix an auto-save permissions race condition (Bug#10400)
15352 * fileio.c (auto_saving_dir_umask): New static var.
15353 (Fmake_directory_internal): Use it.
15354 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15355 creating the directory. The old code temporarily assigns
15356 too-generous permissions to the directory.
15357 (do_auto_save_eh): Clear it.
15358 (Fdo_auto_save): Catch all errors, not just file errors, so
15359 that the var is always cleared.
15361 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15363 * search.c (scan_buffer): Pass character positions to
15364 know_region_cache, not byte positions. (Bug#6540)
15366 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15368 * w32.c (sys_rename): Report EXDEV when rename of a directory
15369 fails because the target is on another logical disk. (Bug#10284)
15371 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15373 * xterm.c (x_embed_request_focus): New function.
15375 * xterm.h: Add prototype.
15377 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15379 2012-01-05 Glenn Morris <rgm@gnu.org>
15381 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15383 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15385 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15386 Load gnutls_transport_set_lowat only if GnuTLS version is below
15388 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15389 GnuTLS versions below 2.11.1.
15391 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15393 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15394 to the doc string advising against its use for altering the way
15395 windows are scrolled.
15397 2011-12-28 Kenichi Handa <handa@m17n.org>
15399 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15400 coding-system ASCII compatible only when it does not produce BOM
15401 on encoding (Bug#10383).
15403 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15405 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15407 (create_and_show_popup_menu): Always use menu_position_func for
15410 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15412 * callint.c (Fcall_interactively): Don't truncate prompt string.
15414 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15416 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15417 property that ends at ZV, so that the bidi iteration could be
15418 resumed from there (after widening). (Bug#10360)
15420 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15422 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15424 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15426 * nsterm.m (x_free_frame_resources):
15427 Release f->output_data.ns->miniimage.
15428 (ns_index_color): Fix indentation. Do not retain
15429 color_table->colors[i].
15431 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15434 * nsfns.m (x_set_background_color): Assign return value from
15435 ns_index_color to face-background instead of NSColor*.
15436 (ns_implicitly_set_icon_type): Fix indentation.
15437 Change assignment in for loop to comparison.
15439 * emacs.c (ns_pool): New variable.
15440 (main): Assign ns_pool.
15441 (Fkill_emacs): Call ns_release_autorelease_pool.
15443 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15444 autorelease fdesc, release fdAttrs and tdict.
15445 (ns_get_covering_families): Release charset.
15446 (ns_findfonts): Release NSFontDescriptor created with new.
15447 (ns_uni_to_glyphs): Fix indentation.
15448 (setString): Release attrStr before assigning new value.
15450 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15452 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15454 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15455 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15457 2011-12-18 David Reitter <reitter@cmu.edu>
15459 * nsterm.m (ns_term_init): Subscribe for notifications
15460 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15461 to method trackingNotification in EmacsMenu.
15463 * nsmenu.m (trackingMenu): New variable.
15464 (trackingNotification): New method (from Aquamacs).
15465 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15466 from Aquamacs (Bug#7030).
15468 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15470 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15471 (symbol_to_nsstring): Fix indentation.
15472 (ns_symbol_to_pb): New function.
15473 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15474 (Fns_rotate_cut_buffers_internal): Remove.
15475 (Fns_store_selection_internal): Rename from
15476 Fns_store_cut_buffer_internal.
15477 (ns_get_foreign_selection, Fx_own_selection_internal)
15478 (Fx_disown_selection_internal, Fx_selection_exists_p)
15479 (Fns_get_selection_internal, Fns_store_selection_internal):
15480 Use ns_symbol_to_pb and check if return value is nil.
15481 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15482 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15483 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15484 renamed to Sns_store_selection_internal.
15485 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15486 and remove this function.
15487 (ns_handle_selection_clear): Remove, never used.
15488 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15491 2011-12-17 Ken Brown <kbrown@cornell.edu>
15493 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15494 GID is unknown (Bug#10257).
15496 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15498 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15499 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15500 which caused a build failure on GNU/Linux IA-64. This problem was
15501 introduced by my 2011-10-07 patch.
15503 2011-12-15 Juri Linkov <juri@jurta.org>
15505 * image.c (imagemagick_error): New function. (Bug#10112)
15506 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15507 Use `imagemagick_error' where ImageMagick functions return
15509 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15512 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15514 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15515 fill background (Bug#8992).
15517 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15519 * window.c (Vwindow_combination_resize)
15520 (Vwindow_combination_limit): Use t instead of non-nil in
15522 (Vrecenter_redisplay): Add first sentence of doc-string on
15524 (Frecenter): Fix doc-string typo.
15526 2011-12-11 Kenichi Handa <handa@m17n.org>
15528 * coding.c (Funencodable_char_position): Pay attention to the
15529 buffer text relocation (Bug#9389).
15531 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15533 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15534 gtk_init (Bug#10100).
15536 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15538 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15539 IT->string is nil. (Bug#10263)
15541 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15543 * nsterm.h (x_free_frame_resources): Declare.
15545 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15546 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15548 * nsterm.h (ns_get_defaults_value): Declare.
15550 * nsterm.m (ns_default): Call ns_get_defaults_value.
15552 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15554 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15557 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15559 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15560 that where the value of an _OBJC_* symbol points to is in the .bss
15561 section (Bug#10240).
15563 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15565 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15566 after the loop to call ccl_driver at least once (Bug#8619).
15568 2011-12-08 Kenichi Handa <handa@m17n.org>
15570 * ftfont.c (get_adstyle_property): Fix previous change
15573 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15575 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15576 dirs from the default value of EMACSLOADPATH (bug#10208).
15578 2011-12-07 Glenn Morris <rgm@gnu.org>
15580 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15581 installation and source directories as well. (Bug#10208)
15583 2011-12-06 Chong Yidong <cyd@gnu.org>
15585 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15587 2011-12-06 Glenn Morris <rgm@gnu.org>
15589 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15590 as an error, not just -1. (Bug#10217)
15592 2011-12-05 Chong Yidong <cyd@gnu.org>
15594 * keyboard.c (process_special_events): New function.
15595 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15597 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15599 * coding.c (encode_designation_at_bol): Don't use uninitialized
15600 local variable (Bug#9318).
15602 2011-12-05 Kenichi Handa <handa@m17n.org>
15604 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15605 return Qnil (Bug#8046, Bug#10193).
15607 2011-12-05 Kenichi Handa <handa@m17n.org>
15609 * coding.c (encode_designation_at_bol): New args charbuf_end and
15610 dst. Return the number of produced bytes. Callers changed.
15611 (coding_set_source): Return how many bytes coding->source was
15613 (coding_set_destination): Return how many bytes
15614 coding->destination was relocated.
15615 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15616 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15618 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15620 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15621 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15624 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15626 The following changes are to fix Bug#9318.
15628 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15629 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15630 (encode_coding_iso_2022, encode_coding_sjis)
15631 (encode_coding_big5, encode_coding_charset): Use the above macros.
15633 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15635 * lisp.h (process_quit_flag): Fix external declaration.
15637 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15639 Don't macro-inline non-performance-critical code.
15640 * eval.c (process_quit_flag): New function.
15641 * lisp.h (QUIT): Use it.
15643 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15645 * nsfns.m (get_geometry_from_preferences): New function.
15646 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15648 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15650 * emacs.c (Qkill_emacs): Define.
15651 (syms_of_emacs): Initialize it.
15652 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15653 Qquit_flag to `kill-emacs' instead.
15654 (quit_throw_to_read_char): Add parameter `from_signal'.
15655 All callers changed. Call Fkill_emacs if requested and safe.
15656 * lisp.h (QUIT): Call Fkill_emacs if requested.
15658 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15660 * widget.c (update_wm_hints): Return if wmshell is null.
15661 (widget_update_wm_size_hints): New function.
15663 * widget.h (widget_update_wm_size_hints): Declare.
15665 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15666 widget_update_wm_size_hints (Bug#10104).
15668 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15670 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15671 before a newline, prepare the bidi iterator for consuming the
15672 newline, and keep the current paragraph direction. (Bug#10183)
15673 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15675 2011-12-02 Juri Linkov <juri@jurta.org>
15677 * search.c (Fword_search_regexp): New Lisp function created from
15678 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15679 (Fword_search_backward, Fword_search_forward)
15680 (Fword_search_backward_lax, Fword_search_forward_lax):
15681 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15682 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15684 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15686 * fileio.c (Finsert_file_contents): Move after-change-function call
15687 to before the "handled:" label, since all "goto handled" appear in
15688 cases where the *-change-functions have already been properly called
15691 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15693 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15694 waiting for input. (Bug#10169)
15696 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15698 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15699 verifies glyph row's hash code--we have just reallocated the
15700 glyphs, so their contents can be complete garbage. (Bug#10164)
15702 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15704 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15706 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15708 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15709 attributes are tested _before_ calling verify_row_hash, to protect
15710 against GCC re-ordering of the tests. (Bug#10164)
15712 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15714 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15716 * xterm.c (handle_one_xevent): Only set async_visible and friends
15717 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15718 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15719 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15721 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15723 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15724 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15725 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15726 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15727 All uses changed to use GCPRO1 etc.
15728 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15729 Revert to old implementation (i.e., before 2011-03-11).
15731 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15733 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15734 of scroll runs so as to avoid assigning disabled bogus rows and
15735 unnecessary graphics copy operations.
15737 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15739 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15740 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15741 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15742 (malloc, free, realloc, calloc): Redirect to e_* only when
15745 * lisp.h (GCTYPEBITS): Move before first use.
15746 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15747 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15748 this macro definition.
15750 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15753 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15755 * gtkutil.c (xg_create_frame_widgets):
15756 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15757 present with Gtk+ 2.0.
15759 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15761 * fileio.c (Finsert_file_contents): Undo previous change; see
15762 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15764 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15766 Rename locals to avoid shadowing.
15767 * fileio.c (Finsert_file_contents):
15768 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15769 * process.c (wait_reading_process_output):
15770 Rename inner 'proc' to 'p' to avoid shadowing.
15771 Indent for consistency with usual Emacs style.
15773 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15775 * xdisp.c (redisplay_window): If cursor row is not fully visible
15776 after recentering, and scroll-conservatively is set to a large
15777 number, scroll window by a few more lines to make the cursor fully
15778 visible and out of scroll-margin. (Bug#10105)
15779 (start_display): Don't move to the next line if the display should
15780 start at a newline that is part of a display vector or an overlay
15781 string. (Bug#10119)
15783 2011-11-24 Juri Linkov <juri@jurta.org>
15785 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15786 after the `MagickPingImage' call. (Bug#10112)
15788 2011-11-23 Chong Yidong <cyd@gnu.org>
15790 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15792 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15794 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15795 making another buffer current. (Bug#10114)
15797 2011-11-23 Glenn Morris <rgm@gnu.org>
15799 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15801 2011-11-23 Chong Yidong <cyd@gnu.org>
15803 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15804 using it (Bug#5984).
15806 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15808 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15809 and header-lines, as they don't have one computed for them.
15812 * .gdbinit (prow): Make displayed values more self-explaining.
15813 Add row's hash code.
15815 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15817 * process.c (wait_reading_process_output): Fix asynchrounous
15818 GnuTLS socket handling on some versions of the GnuTLS library.
15819 (wait_reading_process_output): Add comment and URL.
15821 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15823 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15825 2011-11-21 Chong Yidong <cyd@gnu.org>
15827 * window.c (Fnext_window, Fprevious_window): Doc fix.
15829 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15831 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15833 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15835 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15837 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15839 * window.c (Fset_window_combination_limit): Rename argument
15841 (Vwindow_combination_limit): Remove "status" from doc-string.
15843 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15845 * m/ibms390.h: Remove.
15846 * m/ibms390x.h: Don't include "ibms390.h".
15848 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15850 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15851 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15853 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15855 * casetab.c (Fset_case_table):
15856 * charset.c (Fcharset_after): Fix typos.
15858 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15860 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15861 Otherwise, valgrind does not work on some platforms.
15862 Problem reported by Andreas Schwab in
15863 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15864 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15865 is set, removing the need for VIRT_ADDRESS_VARIES.
15866 (PURE_P): Use a more-efficient implementation that needs just one
15867 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15868 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15869 to 4 (xorl, subq, cmpq, setbe).
15870 * alloc.c (pure): Always extern now, since that's the
15871 VIRT_ADDR_VARIES behavior.
15872 (PURE_POINTER_P): Use a single comparison, not two, for
15873 consistency with the new puresize.h.
15874 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15875 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15876 Remove VIRT_ADDR_VARIES no longer needed.
15878 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15880 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15881 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15882 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15883 behave as if the cursor position were at the window margin.
15885 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15886 and the cursor position is out of bounds, behave as if the cursor
15887 position were at the window margin. (Bug#10075)
15889 2011-11-18 Chong Yidong <cyd@gnu.org>
15891 * window.c (Fwindow_combination_limit): Make first argument
15892 non-optional, since it is meaningless for live windows like the
15895 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15897 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15899 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15901 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15902 (graft_intervals_into_buffer): Simplify.
15904 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15906 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15907 hash values of the two rows.
15908 (copy_row_except_pointers): Preserve the used[] arrays and the
15909 hash values of the two rows. (Bug#10035)
15910 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15912 * xdisp.c (row_hash): New function, body extracted from
15913 compute_line_metrics.
15914 (compute_line_metrics): Call row_hash, instead of computing the
15917 * dispnew.c (verify_row_hash): Call row_hash for computing the
15918 hash code of a row, instead of duplicating code from xdisp.c.
15920 * dispextern.h (row_hash): Add prototype.
15922 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15924 * frame.c (delete_frame): Don't delete the terminal when the last
15925 X frame is closed if emacs is built with GTK toolkit.
15927 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15929 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15931 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15933 * window.c (Vwindow_splits): Rename to
15934 Vwindow_combination_resize. Suggested by Juri Linkov.
15935 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15938 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15940 * nsfns.m (Fns_font_name):
15941 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15943 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15945 * window.h (window): Rename slot "nest" to "combination_limit".
15946 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15947 (Fset_window_nest): Rename to Fset_window_combination_limit.
15948 (Vwindow_nest): Rename to Vwindow_combination_limit.
15949 (recombine_windows, make_parent_window, make_window)
15950 (Fsplit_window_internal, saved_window)
15951 (Fset_window_configuration, save_window_save): Rename all
15952 occurrences of window_nest to window_combination_limit.
15954 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15956 * image.c (imagemagick_load_image): Fix typo.
15958 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15960 * xdisp.c (display_line): Move the call to
15961 highlight_trailing_whitespace before the call to
15962 compute_line_metrics, since the latter needs to see the final
15963 faces of all the glyphs to compute ROW's hash value.
15964 Fixes assertion violations in row_equal_p. (Bug#10035)
15966 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15968 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15969 just return (bug#10044).
15971 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15973 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15974 with user-defined heap size. Bump the default size of the temacs
15975 heap to 27MB, to avoid memory warning when running temacs.
15976 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15978 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15979 current_matrix and desired_matrix. (Bug#9990)
15980 (verify_row_hash) [XASSERTS]: New function.
15981 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15982 that the hash value of glyph rows is correct.
15984 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15986 * window.h (window): Remove splits slot.
15987 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15988 (Fdelete_other_windows_internal, make_parent_window)
15989 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15990 (Fset_window_configuration, save_window_save): Don't deal with
15991 split status of windows.
15992 (saved_window): Remove splits slot.
15993 (Vwindow_splits): Rewrite doc-string.
15995 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15997 * xfns.c (unwind_create_frame):
15998 * nsfns.m (unwind_create_frame):
15999 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16000 Vframe_list (Bug#9999).
16002 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16004 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16006 2011-11-11 Kenichi Handa <handa@m17n.org>
16008 * callproc.c (Fcall_process): Set the member dst_multibyte of
16011 2011-11-11 Johan Bockgård <bojohan@gnu.org>
16013 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16014 avoid a crash (bug#9496).
16016 2011-11-09 Chong Yidong <cyd@gnu.org>
16018 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16019 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16021 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16023 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16025 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16027 Avoid some portability problems by eschewing 'extern inline' functions.
16028 The trivial performance wins aren't worth the portability hassles; see
16029 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16031 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16032 (window_box_width, window_box_left, window_box_left_offset)
16033 (window_box_right, window_box_right_offset): Undo previous change,
16034 by removing the "extern"s.
16035 * intervals.c (adjust_intervals_for_insertion)
16036 (adjust_intervals_for_deletion): Undo previous change,
16037 making these static again.
16038 (offset_intervals, temp_set_point_both, temp_set_point)
16039 (copy_intervals_to_string): No longer inline.
16040 * xdisp.c (window_text_bottom_y, window_box_width)
16041 (window_box_height, window_box_left_offset)
16042 (window_box_right_offset, window_box_left, window_box_right)
16043 (window_box): No longer inline.
16045 2011-11-08 Chong Yidong <cyd@gnu.org>
16047 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16048 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16049 Signal an error if not a live window.
16050 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16051 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16053 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16055 * lisp.h (syms_of_abbrev): Remove declaration.
16056 Reported by CHENG Gao <chenggao@royau.me>.
16058 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16060 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16061 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16062 of temacs in GUI mode.
16064 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16066 * window.h: Declare delete_all_child_windows instead of
16067 delete_all_subwindows.
16068 * window.c (Fwindow_nest, Fset_window_nest)
16069 (Fset_window_new_total, Fset_window_new_normal)
16070 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16071 (delete_all_subwindows): Rename to delete_all_child_windows.
16072 (Fdelete_other_windows_internal, Fset_window_configuration):
16073 Call delete_all_child_windows instead of delete_all_subwindows.
16074 * frame.c (delete_frame): Call delete_all_child_windows instead
16075 of delete_all_subwindows.
16077 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16079 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16080 This is also needed for porting to any host where GC_MARK_STACK is
16081 not GC_MAKE_GCPROS_NOOPS.
16082 (which_symbols): Use it.
16084 2011-11-07 Kenichi Handa <handa@m17n.org>
16086 * coding.c (coding_set_destination): Check coding->src_pos only
16087 when coding->src_object is a buffer (bug#9910).
16089 * process.c (send_process): Set the member src_multibyte of coding
16090 to 0 (bug#9911) when sending a unibyte text.
16092 * callproc.c (Fcall_process): Set the member src_multibyte of
16093 process_coding to 0 (bug#9912).
16095 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16097 * xmenu.c (cleanup_widget_value_tree): New function.
16098 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16099 calling free_menubar_widget_value_tree directly (Bug#9830).
16101 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16103 Fix some portability problems with 'inline'.
16104 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16105 (window_box_width, window_box_left, window_box_left_offset)
16106 (window_box_right, window_box_right_offset): Declare extern.
16107 Otherwise, these inline functions do not conform to C99 and
16108 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16109 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16110 * intervals.c (adjust_intervals_for_insertion)
16111 (adjust_intervals_for_deletion): Now extern, because otherwise the
16112 extern inline functions 'offset_intervals' couldn't refer to it.
16113 (static_offset_intervals): Remove.
16114 (offset_intervals): Rewrite using the old contents of
16115 static_offset_intervals. The old version didn't conform to C99
16116 because an extern inline function contained a reference to an
16117 identifier with static linkage.
16119 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16121 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16124 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16126 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16127 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16128 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16129 return Qleft_to_right.
16131 2011-11-06 Chong Yidong <cyd@gnu.org>
16133 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16134 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16135 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16136 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16137 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16138 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16139 (Fwindow_vscroll): Doc fix.
16140 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16141 argument, since it makes no sense to pass a live window and for
16142 consistency with window-child.
16144 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16146 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16149 2011-11-05 Jason Rumney <jasonr@gnu.org>
16151 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16152 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16154 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16155 bitwise arithmetic preventing use of unicode-sip and non-truetype
16158 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16160 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16163 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16164 initialization code to keep similarity to xfns.c after changes
16167 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16169 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16170 (unwind_create_frame): New function (Bug#9943).
16171 (Fx_create_frame): Restructure code to be more similar to the one in
16172 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16173 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16174 Move terminal->reference_count++ just before making the frame official
16177 * nsterm.m (x_free_frame_resources): New function.
16178 (x_destroy_window): Move code to x_free_frame_resources.
16180 * xfns.c (unwind_create_frame): Fix comment.
16181 (Fx_create_frame, x_create_tip_frame):
16182 Move terminal->reference_count++ just before making the frame
16183 official. Move initialization of image_cache_refcount and
16184 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16186 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16188 Support MSVC build with newer versions of Visual Studio.
16189 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16190 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16193 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16194 which are not supported by MSVC.
16195 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16196 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16198 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16199 types in bitfields.
16200 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16202 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16204 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16206 Support MSVC build with newer versions of Visual Studio.
16207 * w32.c: Don't include w32api.h for MSVC.
16208 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16210 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16211 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16212 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16213 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16215 (alloca) [_MSC_VER]: Define to _alloca.
16217 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16219 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16221 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16223 * xdisp.c (note_mouse_highlight): If either of
16224 previous/next-single-property-change returns nil, treat that as
16225 the beginning or the end of the buffer. (Bug#9955)
16227 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16229 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16230 label is not null (Bug#9951).
16231 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16234 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16236 * window.c (Fwindow_body_size): Mention in the doc string that the
16237 return value is in frame's canonical units. (Bug#9949)
16239 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16241 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16243 * w32fns.c (unwind_create_frame): If needed, free the glyph
16244 matrices of the partially constructed frame. (Bug#9943)
16245 * xfns.c (unwind_create_frame): Likewise.
16247 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16249 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16250 Don't stop backward scan on the continuation glyph, even though
16251 its CHARPOS is positive.
16252 (mouse_face_from_buffer_pos, note_mouse_highlight):
16253 Rename cover_string to disp_string.
16255 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16257 * window.c (temp_output_buffer_show): Don't use
16258 Vtemp_buffer_show_specifiers.
16259 (Vtemp_buffer_show_specifiers): Remove unused variable.
16261 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16263 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16264 past the beginning of the current glyph matrix.
16266 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16268 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16269 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16270 HAVE_GTK3 (Bug#9869).
16272 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16273 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16275 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16277 * xterm.c: Declare x_handle_net_wm_state to return int.
16278 (handle_one_xevent): Check if we are iconified but don't have
16279 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16280 (get_current_wm_state): Return non-zero if not hidden,
16281 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16282 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16283 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16284 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16286 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16288 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16289 so that this new function doesn't get optimized away by a
16290 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16292 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16294 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16296 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16298 Fix the `xbytecode' command.
16299 * .gdbinit (xprintbytestr): New command.
16300 (xwhichsymbols): Rename from `which'; all callers changed.
16301 (xbytecode): Print the byte-code string as well.
16303 2011-10-29 Kim Storm <storm@cua.dk>
16305 * alloc.c (which_symbols): New function.
16307 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16309 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16312 2011-10-29 Glenn Morris <rgm@gnu.org>
16314 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16315 Not clear what it was for, and it causes various bugs. (Bug#9839)
16317 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16319 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16320 possible random value that matches one of those tested as
16321 condition to clear the mouse face.
16323 2011-10-28 Chong Yidong <cyd@gnu.org>
16325 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16327 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16329 * window.c (make_window): Initialize phys_cursor_on_p.
16331 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16333 * lisp.h (struct Lisp_Symbol): Update comments.
16335 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16337 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16339 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16341 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16342 <oslsachem@gmail.com> for helping to debug this.
16344 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16345 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16346 (g_b_init_get_glyph_outline_w): New static variables.
16347 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16348 (GetGlyphOutlineW_Proc): New typedefs.
16349 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16350 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16352 (w32font_open_internal, compute_metrics):
16353 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16354 instead of calling the "wide" APIs directly.
16356 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16358 * w32.h (syms_of_w32font): Add prototype.
16360 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16362 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16363 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16364 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16365 (Fmove_to_window_line): Doc fix.
16367 2011-10-27 Chong Yidong <cyd@gnu.org>
16369 * process.c (make_process): Set gnutls_state to NULL.
16371 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16372 non-NULL, regardless of GNUTLS_INITSTAGE.
16373 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16374 an error. Set process slots as soon as we allocate them.
16376 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16378 2011-10-27 Chong Yidong <cyd@gnu.org>
16380 * gnutls.c (emacs_gnutls_deinit): New function.
16381 Deallocate credentials structures as well as calling gnutls_deinit.
16382 (Fgnutls_deinit, Fgnutls_boot): Use it.
16384 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16385 (deactivate_process): Call emacs_gnutls_deinit.
16387 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16389 * image.c (x_create_x_image_and_pixmap):
16390 * w32.c (sys_rename, w32_delayed_load):
16391 * w32font.c (fill_in_logfont):
16392 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16394 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16396 * w32fns.c (w32_default_color_map): New function,
16397 extracted from Fw32_default_color_map.
16398 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16400 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16402 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16404 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16406 * keyboard.c (test_undefined): New function (bug#9751).
16407 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16409 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16411 * sysdep.c (init_sys_modes): Fix the check for the controlling
16412 terminal (Bug#6649).
16414 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16416 * dispextern.h (struct bidi_it): New member next_en_type.
16418 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16419 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16420 current character, check also for next_en_type being WEAK_EN.
16421 (bidi_resolve_weak): Don't enter the expensive loop if the current
16422 position is before next_en_pos. Record the bidi type of the first
16423 non-ET, non-BN character we find, in addition to its position.
16424 (bidi_level_of_next_char): Invalidate next_en_type when
16425 next_en_pos is over-stepped.
16427 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16429 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16430 * editfns.c: Rewrite current-time-zone so that it invokes
16431 the equivalent of (format-time-string "%Z") to get the time zone name.
16432 This fixes a bug when the time zone name contains characters that
16433 need converting from the system time locale to Emacs internal format.
16434 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16435 that patch fixed format-time-string to do the conversion, but
16436 I forgot to fix current-time-zone.
16437 (format_time_string): New function, containing most of
16438 what Fformat_time_string used to contain.
16439 (Fformat_time_string): Rewrite in terms of format_time_string.
16440 This doesn't change this function's behavior.
16441 (current-time-zone): Rewrite to use format_time_string.
16442 This fixes the bug reported by Michael Schierl in
16443 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16444 Jason Rumney's 2007-06-07 change worked around this bug, but
16446 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16448 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16450 * xdisp.c (start_display): If the character at POS is displayed
16451 via a display vector, reset IT->current.dpvec_index to zero.
16452 (try_window_reusing_current_matrix): If a line ends in a display
16453 vector or the next line starts in a display vector, continue
16454 redrawing the window even though the character position of
16455 start_row was reached.
16458 2011-10-18 Chong Yidong <cyd@gnu.org>
16460 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16461 with nobreak-char-display too.
16463 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16465 Fix part 3 of bug#9771.
16466 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16467 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16468 non-neutral characters if the current character is a paragraph
16469 separator (a.k.a. Newline). This avoids running the same
16470 expensive loop twice, once when we consume the preceding newline
16471 and the other time when the line actually needs to be displayed.
16472 Avoid the loop when we see neutrals on the base embedding level
16473 following a character whose directionality is the same as the
16474 paragraph's. This avoids running the expensive loop when a line
16475 ends in a long sequence of neutrals, like control characters.
16476 Add assertion against STRONG_AL type. Slightly rearrange code
16477 that determines the type of a neutral given the first non-neutral
16479 (bidi_level_of_next_char): Set next_en_pos to zero when
16480 invalidating its info.
16482 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16484 * xdisp.c (push_display_prop): Determine whether to record string
16485 or buffer position by IT->string, not by IT->method. Allow
16486 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16487 (move_it_vertically_backward): Don't look for character position
16488 immediately after the newline when in a continuation line.
16491 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16493 * window.c (coordinates_in_window): Rewrite and delabelize
16494 vertical border check. (Bug#5357) (Bug#9618)
16496 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16498 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16499 errors in XSetWindowBorder (bug#9310).
16501 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16503 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16504 avoid crash when xmalloc overrun checking is enabled.
16506 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16508 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16509 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16510 cursor motion with <left> and <right> arrow keys.
16512 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16513 some callers set that themselves.
16515 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16517 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16518 display string and the previous row comes from the same string and
16519 is empty. (Bug#9739) (Bug#9738)
16521 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16523 * doc.c (get_doc_string): Encode file name (bug#9735).
16525 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16527 * bidi.c (bidi_level_of_next_char):
16528 * xdisp.c (get_visually_first_element): Remove old incorrect
16529 comments regarding the Unicode Line Separator character.
16531 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16533 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16535 * alloc.c (Fgc_status): Do not access beyond zombies array
16536 boundary if nzombies > MAX_ZOMBIES.
16537 * alloc.c (dump_zombies): Add missing format specifier.
16539 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16541 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16542 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16544 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16545 Some packages use them to denote characters with modifiers.
16547 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16549 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16550 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16551 matching a pp-number. Rename parameter var to var1.
16553 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16555 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16557 2011-10-08 Glenn Morris <rgm@gnu.org>
16559 * callint.c (Fcall_interactively): Give a more explicit error for the
16560 'c' case with a non-character input. (Bug#8479)
16562 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16564 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16566 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16567 lines that are hscrolled on the left.
16569 * dispnew.c (buffer_posn_from_coords): Account for a possible
16570 presence of header-line. (Bug#4426)
16572 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16574 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16575 Don't advertise functionality which we discourage or doesn't work.
16577 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16579 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16580 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16581 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16582 this makes Emacs dump core during garbage collection on rare
16583 occasions. sizeof is obviously inferior to offsetof here, so
16584 stick with offsetof.
16585 (GC_POINTER_ALIGNMENT): New macro.
16586 (mark_memory): Omit 3rd (offset) arg; caller changed.
16587 Don't assume EMACS_INT alignment is the same as pointer alignment.
16589 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16591 * keyboard.c (read_key_sequence_remapped): New var.
16592 (read_key_sequence): Compute remapping in the right buffer.
16593 (command_loop_1): Use read_key_sequence's remapping directly.
16595 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16597 * dired.c (file_name_completion): Don't expand file name.
16598 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16599 before checking file name handler.
16601 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16602 they've been requested explicitly (bug#9591).
16604 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16606 * keymap.c (Fsingle_key_description): Use make_specified_string
16607 instead of build_string to build string from push_key_description.
16610 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16612 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16613 This fixes a Y2038 bug on 64-bit hosts.
16614 * buffer.c (reset_buffer):
16615 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16616 (Fclear_buffer_auto_save_failure):
16617 Use 0, not -1, to represent an unset failure time, since time_t
16618 might not be signed.
16620 Remove dependency on glibc malloc internals.
16621 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16622 Move back here from lisp.h, but with their new implementations.
16623 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16624 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16625 * charset.c (charset_table_init): New static var.
16626 (syms_of_charset): Use it instead of xmalloc. This removes a
16627 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16628 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16629 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16630 Move back to alloc.c.
16631 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16632 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16634 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16636 * nsterm.m (windowDidResize): Call x_set_window_size only when
16637 ns_in_resize is true. Otherwise set pixelwidth/height and
16638 call change_frame_size (Bug#9628).
16640 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16642 Port --enable-checking=all to Fedora 14 x86-64.
16643 * charset.c (syms_of_charset): Also account for glibc malloc's
16644 internal overhead when calculating the initial malloc maximum.
16646 Port --enable-checking=all to Fedora 14 x86.
16647 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16649 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16650 (overrun_check_realloc, overrun_check_free):
16651 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16652 That way, xmalloc returns a properly-aligned pointer even if
16653 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16654 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16655 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16656 into account when calculating the initial malloc maximum.
16657 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16658 Move here from alloc.c, so that charset.c can use it too.
16659 Properly align; the old code wasn't right for common 32-bit hosts
16660 when configured with --enable-checking=all.
16661 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16662 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16664 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16666 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16669 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16671 * xdisp.c (compute_display_string_end): If there's no display
16672 string at CHARPOS, return -1.
16674 * bidi.c (bidi_fetch_char): When compute_display_string_end
16675 returns a negative value, treat the character as a normal
16676 character not covered by a display string. (Bug#9624)
16678 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16680 * lread.c (Fread_from_string): Fix typo in docstring.
16682 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16684 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16685 newline, reseat the iterator instead of bidi-iterating there one
16686 character at a time. (Bug#9610)
16687 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16688 TO_CHARPOS if the bidi iterator is at base embedding level.
16690 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16692 * lread.c (readevalloop): Use correct code for NBSP.
16693 (read1): Likewise. (Bug#9608)
16695 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16697 * dbusbind.c (Fdbus_register_signal): When service is not
16698 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16700 2011-09-25 Glenn Morris <rgm@gnu.org>
16702 * buffer.c (truncate-lines): Doc fix.
16704 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16706 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16707 (Fset_window_next_buffers): Doc fix.
16709 2011-09-24 Glenn Morris <rgm@gnu.org>
16711 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16713 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16715 Fix minor problems found by static checking.
16716 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16717 * indent.c (Fvertical_motion): Fix == vs = typo.
16719 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16721 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16722 Default value is now t. Doc fix.
16724 * indent.c (Fvertical_motion): Compute and apply the overshoot
16725 logic when moving up, not only when moving down. Fix the
16726 confusing name and values of the it_overshoot_expected variable;
16727 logic changes accordingly. (Bug#9254) (Bug#9549)
16729 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16730 CHARPOS is covered by a display string which includes newlines.
16731 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16732 is covered by a display string with embedded newlines.
16734 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16736 * dbusbind.c (Fdbus_register_signal): Add match rule to
16737 Vdbus_registered_objects_table. (Bug#9581)
16738 (Fdbus_register_method, Vdbus_registered_objects_table):
16741 2011-09-24 Jim Meyering <meyering@redhat.com>
16743 do not ignore write error for any output size
16744 The previous change was incomplete.
16745 While it makes emacs --batch detect the vast majority of stdout
16746 write failures, errors were still ignored whenever the output size is
16747 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16748 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16749 && echo FAIL: ignored write error
16750 FAIL: ignored write error
16751 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16752 && echo FAIL: ignored write error
16753 FAIL: ignored write error
16754 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16756 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16758 * emacs.c (Fkill_emacs): In noninteractive mode exit
16759 non-successfully if a write error occurred on stdout. (Bug#9574)
16761 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16763 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16766 * dispextern.h (struct it): Update the comment documenting what
16769 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16771 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16772 a display string, extend search for cursor position to end of row.
16773 (find_row_edges): If the row ends in a newline from a display
16774 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16775 Handle the case of a display string with multiple newlines.
16776 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16777 non-empty line. Fixes confusing cursor motion with arrow keys at
16778 the beginning of a line that starts with whitespace.
16780 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16782 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16785 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16787 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16788 boolean (Bug#9154).
16790 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16792 * xdisp.c (display_line): Record maximum and minimum buffer
16793 positions even if no glyphs were produced (e.g., by a zero-width
16794 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16795 buffer positions that will be removed from the glyph row because
16797 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16798 column is beyond frame width: don't subtract 1 "pixel" when
16799 computing width of the stretch.
16800 (reseat_at_next_visible_line_start): Undo the change made on
16801 2011-09-17 that saved paragraph information and restored it after
16802 the call to `reseat'. (Bug#9545)
16804 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16806 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16807 and turn window cursor on if cleared (Bug#9415).
16809 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16811 * search.c (boyer_moore): Take unibyte characters from pattern
16812 literally. (Bug#9458)
16814 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16816 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16818 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16820 Fix minor problem found by static checking.
16821 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16822 initialized, to pacify gcc -Wuninitialized.
16824 * fileio.c: Report proper errno when syscall falls.
16825 (Finsert_file_contents): Save and restore errno,
16826 so that report_file_error outputs the correct diagnostic.
16827 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16829 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16831 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16833 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16835 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16836 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16838 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16840 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16841 about the current paragraph and restore it after the call to reseat.
16843 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16844 (bidi_find_paragraph_start): Search back for paragraph beginning
16845 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16846 (bidi_move_to_visually_next): Only trigger paragraph-related
16847 computations when the last character is a newline or at EOB, not
16848 just any NEUTRAL_B. (Bug#9470)
16850 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16851 truncated lines if point is covered by a display string. (Bug#9524)
16853 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16855 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16856 (cons_to_x_long): New function.
16857 (lisp_data_to_selection_data): Use it. Correct the test for
16858 short-versus-long data; it was negated. Break out of vector
16859 loop, for efficiency, when a long datum is discovered.
16861 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16863 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16865 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16867 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16868 GCC PR/17406) by declaring this function with external scope.
16870 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16872 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16873 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16875 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16877 * editfns.c (Fformat): Correctly handle text properties on "%%".
16879 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16881 * xterm.c (x_draw_composite_glyph_string_foreground):
16882 * w32term.c (x_draw_composite_glyph_string_foreground):
16883 * term.c (encode_terminal_code):
16884 * composite.c (composition_update_it, get_composition_id):
16885 * xdisp.c (get_next_display_element)
16886 (fill_composite_glyph_string): Add comments about special meaning
16887 of TAB characters in a composition.
16889 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16891 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16892 This occurs when processing a multibyte format.
16893 Problem reported by Wolfgang Jenker.
16895 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16897 * xdisp.c (try_cursor_movement): Only check for exact match if
16898 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16900 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16902 Remove unused external symbols.
16903 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16904 * xdisp.c (calc_pixel_width_or_height): Now static.
16905 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16906 * indent.c (check_display_width):
16907 * w32term.c: Fix comment to match code.
16908 * xterm.c, xterm.h (x_catching_errors): Remove.
16910 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16912 * xselect.c: Use signed conversions more consistently (Bug#9498).
16913 (selection_data_to_lisp_data): Assume incoming selection data are
16914 signed integers, not unsigned. This is to be consistent with
16915 outgoing selection data, which was modified to use signed integers
16916 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16917 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16918 expects long, not unsigned long.
16920 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16922 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16923 computation of loop end. Reported by Johan Bockgård
16926 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16928 * frame.c (Fother_visible_frames_p): Function deleted.
16930 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16932 * indent.c (compute_motion): Process display vector front to back
16933 rather than the other way around. (Bug#2496)
16935 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16937 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16939 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16941 * minibuf.c (Fread_from_minibuffer): Doc fix.
16943 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16945 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16946 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16948 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16950 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16951 value for non-existent files.
16953 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16955 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16956 set its "size" to -1. This will set the modtime_size field of
16957 the corresponding buffer to -1, which is what
16958 verify-visited-file-modtime expects for files that do not exist.
16961 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16963 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16965 * lisp.h: ... from here. push_key_description is no longer
16966 defined in keyboard.c, so its declaration should not be in
16967 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16968 logically belongs with push_key_description.
16970 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16972 * buffer.h: Include <sys/types.h> instead of <time.h>.
16973 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16974 Problem reported by Herbert J. Skuhra.
16976 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16978 * xml.c (parse_region): Make the parsing work for
16979 non-comment-starting XML files again (bug#9144).
16981 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16983 * image.c (gif_load): Fix calculation of bottom and right corner.
16986 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16988 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16989 redisplay in small windows.
16991 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16993 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16995 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16997 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16998 Operate on live windows only.
17000 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
17002 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17004 2011-09-07 Eli Zaretskii <eliz@gnu.org>
17006 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17007 only under bidi iteration.
17009 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17011 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17013 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17015 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17016 Without this fix, the command to link temacs failed due to an
17017 undefined symbol __builtin_isnan. This is because
17018 /usr/include/iso/math_c99.h #defines isnan(x) to
17019 __builtin_isnan(x), but the bundled gcc, which identifies itself
17020 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17022 * floatfns.c (isnan): #undef, and then #define to a clone of
17024 (Fisnan): Always define, since it's always available now.
17025 (syms_of_floatfns): Always define isnan at the Lisp level.
17027 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17029 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17031 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17033 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17034 The previous code assumed that file offsets (off_t values) fit in
17035 EMACS_INT variables, which is not true on typical 32-bit hosts.
17036 The code messed up by falsely reporting buffer overflow in cases
17037 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17038 when "big" contains more than 2**29 bytes, even though this
17039 inserts just one byte and does not overflow the buffer.
17040 (Finsert_file_contents): Store file offsets as off_t
17041 values, not as EMACS_INT values. Check for overflow when
17042 converting between EMACS_INT and off_t. When checking for
17043 buffer overflow or for overlap, take the offsets into account.
17044 Don't use EMACS_INT for small values where int suffices.
17045 When checking for overlap, fix a typo: ZV was used where
17046 ZV_BYTE was intended.
17047 (Fwrite_region): Don't assume off_t fits into 'long'.
17048 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17050 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17052 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17054 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17056 sprintf-related integer and memory overflow issues (Bug#9412).
17058 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17059 (esprintf, exprintf, evxprintf): New functions.
17060 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17061 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17062 (modify_event_symbol): Do not assume that the length of
17063 name_alist_or_stem is safe to alloca and fits in int.
17064 (Fexecute_extended_command): Likewise for function name and binding.
17065 (Frecursion_depth): Wrap around reliably on integer overflow.
17066 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17067 since some callers pass EMACS_INT values.
17068 (Fsingle_key_description): Don't crash if symbol name contains more
17069 than MAX_ALLOCA bytes.
17070 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17071 (get_minibuffer): Arg is now EMACS_INT, not int.
17072 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17073 (esprintf, exprintf, evxprintf): New decls.
17074 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17076 * dbusbind.c (signature_cat): New function.
17077 (xd_signature, Fdbus_register_signal):
17078 Do not overrun buffer; instead, report string overflow.
17080 * dispnew.c (add_window_display_history): Don't overrun buffer.
17081 Truncate instead; this is OK since it's just a log.
17083 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17084 even if the time zone offset is outlandishly large.
17085 Don't mishandle offset == INT_MIN.
17087 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17088 when creating daemon; the previous buffer-overflow check was incorrect.
17090 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17091 which has the guts of the old verror function.
17093 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17094 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17096 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17097 (font_unparse_xlfd): Don't blindly alloca long strings.
17098 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17099 fits in int, when using sprintf. Use single snprintf to count
17100 length of string rather than counting it via multiple sprintfs;
17101 that's simpler and more reliable.
17102 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17103 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17104 sprintf, in case result does not fit in int.
17106 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17107 (fontset_from_font): Print it.
17109 * frame.c (tty_frame_count): Now printmax_t, not int.
17110 (make_terminal_frame, set_term_frame_name): Print it.
17111 (x_report_frame_params): In X, window IDs are unsigned long,
17112 not signed long, so print them as unsigned.
17113 (validate_x_resource_name): Check for implausibly long names,
17114 and don't assume name length fits in 'int'.
17115 (x_get_resource_string): Don't blindly alloca invocation name;
17116 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17119 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17120 (xg_check_special_colors, xg_set_geometry):
17121 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17123 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17124 Use esprintf, not sprintf, in case result does not fit in int.
17126 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17127 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17128 it as a large positive number.
17129 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17130 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17132 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17133 in case result does not fit in int.
17135 * print.c (float_to_string): Detect width overflow more reliably.
17136 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17137 buffer overrun. Don't assume list length fits in 'int'. Treat
17138 print length of 0 as 0, not as infinity; to be consistent with other
17139 uses of print length in this function. Don't overflow print length
17140 index. Don't assume hash table size fits in 'long', or that
17141 vectorlike size fits in 'unsigned long'.
17143 * process.c (make_process): Use printmax_t, not int, to format
17144 process-name gensyms.
17146 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17148 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17149 to avoid potential buffer overrun.
17151 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17152 if X resource line is longer than 512 bytes.
17154 * xfns.c (x_window): Make sprintf buffer a bit bigger
17155 to avoid potential buffer overrun.
17157 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17159 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17161 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17163 Integer overflow fixes for scrolling, etc.
17164 Without these, Emacs silently mishandles large integers sometimes.
17165 For example, "C-u 4294967297 M-x recenter" was treated as if
17166 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17168 * xdisp.c (try_window_id): Check Emacs fixnum range before
17169 converting to 'int'.
17171 * window.c (window_scroll_line_based, Frecenter):
17172 Check that an Emacs fixnum is in range before assigning it to 'int'.
17173 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17174 values converted from Emacs fixnums.
17175 (Frecenter): Don't wrap around a line count if it is out of 'int'
17176 range; instead, treat it as an extreme value.
17177 (Fset_window_configuration, compare_window_configurations):
17178 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17180 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17181 that can exceed INT_MAX. Check that EMACS_INT value is in range
17182 before assigning it to the (possibly-narrower) index.
17183 (match_limit): Don't assume that a fixnum can fit in 'int'.
17185 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17188 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17189 (Fvertical_motion): Don't wrap around LINES values that don't fit
17190 in 'int'. Instead, treat them as extreme values. This is good
17191 enough for windows, which can't have more than INT_MAX lines anyway.
17193 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17195 * Require libxml/parser.h to avoid compilation warning.
17197 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17199 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17200 since this reportedly can destroy thread storage.
17202 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17204 * syntax.c (find_defun_start): Update all cache variables if
17205 exiting early (Bug#9401).
17207 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17209 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17211 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17212 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17213 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17215 * term.c (tty_append_glyph): New function.
17216 (produce_stretch_glyph): Static function and its prototype deleted.
17218 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17221 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17223 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17224 when checking :margin (Bug#9390).
17225 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17226 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17227 so that the name doesn't mislead. All uses changed.
17229 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17231 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17234 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17236 * xdisp.c (move_it_to): Don't bail out early when reaching
17237 position beyond to_charpos, if we are scanning backwards.
17238 (move_it_vertically_backward): When DY == 0, make sure we get to
17239 the first character in the line after the newline.
17241 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17243 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17244 (ccl_driver): Do not generate an out-of-range pointer.
17245 (Fccl_execute_on_string): Remove unnecessary check for
17246 integer overflow, noted by Stefan Monnier in
17247 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17248 Remove a FIXME that didn't need fixing.
17249 Simplify the newly-introduced buffer reallocation code.
17251 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17253 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17255 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17257 Integer and memory overflow issues (Bug#9196).
17259 * doc.c (get_doc_string): Rework so that
17260 get_doc_string_buffer_size is the actual buffer size, rather than
17261 being 1 less than the actual buffer size; this makes xpalloc more
17264 * image.c (x_allocate_bitmap_record, cache_image):
17265 * xselect.c (Fx_register_dnd_atom):
17266 Simplify previous changes by using xpalloc.
17268 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17269 since either will do and ptrdiff_t is convenient with xpalloc.
17271 * charset.c (charset_table_size)
17272 (struct charset_sort_data.priority): Now ptrdiff_t.
17273 (charset_compare): Don't overflow if priorities differ greatly.
17274 (Fsort_charsets): Don't assume list length fits in int.
17275 Check for size-calculation overflow when allocating sort data.
17276 (syms_of_charset): Allocate an initial charset table that is
17277 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17279 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17281 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17282 The actual value is always <= INT_MAX, and leaving it unsigned made
17283 overflow checking harder.
17285 * dispextern.h (struct glyph_matrix.rows_allocated)
17286 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17287 with xpalloc. The values are still always <= INT_MAX.
17289 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17291 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17292 (SAFE_NALLOCA): New macro.
17294 * region-cache.c (struct boundary.pos, find_cache_boundary)
17295 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17296 (set_cache_region, invalidate_region_cache)
17297 (revalidate_region_cache, know_region_cache, region_cache_forward)
17298 (region_cache_backward, pp_cache):
17299 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17300 so that ptrdiff_t * can be passed to xpalloc.
17301 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17302 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17303 (pp_cache): Don't assume cache_len fits in int.
17304 * region-cache.h: Adjust extern decls to match.
17306 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17307 EMACS_INT, since either will do, for xpalloc.
17309 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17310 (xnmalloc, xnrealloc, xpalloc): New functions.
17312 * bidi.c (bidi_shelve_header_size): New constant.
17313 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17314 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17316 * bidi.c (bidi_cache_shrink):
17317 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17319 Don't update size of array until after memory allocation succeeds,
17320 because xmalloc/xrealloc may not return.
17321 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17322 now that we have proper integer overflow checking.
17323 (record_overlay_string, overlay_strings): Catch overflows when
17324 calculating size of overlay_str_buf.
17326 * callproc.c (Fcall_process): Check for size overflow when
17327 calculating size of args2.
17328 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17329 Normally we prefer signed values, but sticking with ptrdiff_t would
17330 require adding more-complicated checks.
17332 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17333 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17334 Redo buffer-overflow calculations to avoid integer overflow.
17335 Add a FIXME comment where memory seems to be over-allocated.
17337 * character.c (Fstring): Check for size-calculation overflow.
17339 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17340 unnecessary integer overflow. Check for size overflow.
17341 (encode_coding_object): Don't update size until xmalloc succeeds.
17343 * composite.c (get_composition_id): Check for overflow in glyph
17344 length calculations.
17346 Integer and memory overflow fixes for display code.
17347 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17348 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17349 (scrolling_window): Check for overflow in size calculations.
17350 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17351 Don't assume glyph table len fits in int.
17352 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17353 (row_table_size): Now ptrdiff_t, not int.
17354 (scrolling_window): Avoid overflow in size calculations.
17355 Don't update size until allocation succeeds.
17356 * fns.c (concat): Check for overflow in size calculations.
17357 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17358 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17359 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17361 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17362 (get_doc_string): Check for size calculation overflow.
17363 Don't update size until allocation succeeds.
17364 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17365 EMACS_INT, where ptrdiff_t will do.
17366 (Fsubstitute_command_keys): Check for string overflow.
17368 * editfns.c (set_time_zone_rule): Don't assume environment length
17370 (message_length): Now ptrdiff_t, not int.
17371 (Fmessage_box): Don't update size until allocation succeeds.
17372 Don't assume message length fits in int.
17373 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17375 * emacs.c (main): Do not reallocate argv, since there is a null at
17376 the end that can be overwritten, and this way there's no need to
17377 worry about size-calculation overflow.
17378 (sort_args): Check for size-calculation overflow.
17380 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17382 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17384 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17385 (x_set_scroll_bar_width, x_figure_window_size):
17386 Check for integer overflow.
17387 (x_set_alpha): Do not assume XINT fits in int.
17389 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17390 This is for the members text_lines, text_cols, total_lines, total_cols,
17391 where the system imposes an 'int' limit.
17393 * fringe.c (Fdefine_fringe_bitmap):
17394 Don't update size until alloc works.
17396 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17397 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17399 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17400 Check for size-calculation overflow.
17401 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17402 do, as we prefer signed integers.
17403 (id_to_widget.max_size, id_to_widget.used)
17404 (xg_store_widget_in_map, xg_remove_widget_from_map)
17405 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17406 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17407 Use and return ptrdiff_t, not int.
17408 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17409 * gtkutil.h: Change prototypes to match the above.
17411 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17412 are duplicate now that they've been promoted to lisp.h.
17413 (x_allocate_bitmap_record, x_alloc_image_color)
17414 (make_image_cache, cache_image, xpm_load):
17415 Don't update size until alloc is done.
17416 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17418 Check for size calculation overflow.
17419 (ct_colors_allocated_max): New constant.
17420 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17423 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17424 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17425 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17426 Use ptrdiff_t, not int, to count maps.
17427 (read_char_minibuf_menu_prompt): Check for overflow in size
17428 calculations. Don't update size until allocation succeeds.
17429 Redo calculations to avoid overflow.
17430 * keyboard.h: Change prototypes to match the above.
17432 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17434 (current_minor_maps): Check for size calculation overflow.
17435 * keymap.h: Change prototypes to match the above.
17437 * lread.c (read1, init_obarray): Don't update size until alloc done.
17439 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17440 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17442 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17443 Now ptrdiff_t, not int.
17444 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17445 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17447 * process.c (Fnetwork_interface_list): Check for overflow
17448 in size calculation.
17450 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17452 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17453 overflow. Don't bother calling xmalloc when xrealloc will do.
17455 * search.c (Freplace_match): Check for size calculation overflow.
17456 (Fset_match_data): Don't assume list lengths fit in 'int'.
17458 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17459 for command line length. Do not attempt to address one before the
17460 beginning of an array, as that's not portable.
17462 * term.c (max_frame_lines): Remove; unused.
17463 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17465 (encode_terminal_code, calculate_costs): Check for size
17466 calculation overflow.
17467 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17468 table lengths and related sizes. Don't update size until alloc
17469 done. Redo calculations to avoid overflow.
17470 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17472 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17473 subtracting pointers.
17474 (gobble_line): Check for overflow more carefully. Don't update size
17477 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17478 Don't update size until alloc done.
17479 Redo size calculations to avoid overflow.
17480 Check for size calculation overflow.
17481 (main) [DEBUG]: Fix typo in invoking tparam1.
17483 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17484 Use ptrdiff_t, not int, for sizes.
17485 (store_mode_line_noprop_char): Don't update size until alloc done.
17487 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17488 Use ptrdiff_t, not int, for sizes.
17489 (Finternal_make_lisp_face, cache_face):
17490 Check for size calculation overflow.
17491 (cache_face): Treat size calculation overflows as if they were
17492 memory exhaustion (the usual treatment), rather than aborting.
17494 * xfns.c (x_encode_text, x_set_name_internal)
17495 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17496 sizes, since they can exceed INT_MAX in size. Check for size
17497 calculation overflow.
17499 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17500 (xg_select): Check for size calculation overflow.
17501 Don't update size until alloc done.
17503 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17504 as sprintf is limited to int lengths.
17506 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17507 (X_LONG_MIN): New macros.
17508 Use them to make the following changes clearer.
17509 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17510 This change doesn't affect the value now, but it may help remind
17511 future maintainers not to raise the value too much later.
17512 (SELECTION_QUANTUM): Remove, replacing with ...
17513 (selection_quantum): ... new function, which avoids overflow.
17515 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17516 assumption that selection length fits in 'int'.
17517 (x_reply_selection_request, x_handle_selection_request)
17518 (x_get_window_property, receive_incremental_selection)
17519 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17520 (lisp_data_to_selection_data, clean_local_selection_data):
17521 Use ptrdiff_t, not int, to record length of selection.
17522 (x_reply_selection_request, x_get_window_property)
17523 (receive_incremental_selection, x_property_data_to_lisp):
17524 Redo calculations to avoid overflow.
17525 (x_reply_selection_request): When sending hint, ceiling it at
17526 X_LONG_MAX rather than relying on wraparound overflow to send
17528 (x_get_window_property, receive_incremental_selection)
17529 (lisp_data_to_selection_data, x_property_data_to_lisp):
17530 Check for size-calculation overflow.
17531 (x_get_window_property, receive_incremental_selection)
17532 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17533 Don't store size until memory allocation succeeds.
17534 (x_get_window_property): Plug memory leak on memory exhaustion.
17535 Don't double-block input; malloc is safe here. Don't assume 2**34
17536 - 4 fits in unsigned long. Add an xassert to check
17537 XGetWindowProperty overflow. Be more careful about overflow
17538 calculations, and distinguish size from memory overflow better.
17539 (receive_incremental_selection): When tracing, don't assume
17540 unsigned int is less than INT_MAX.
17541 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17542 harmful) conversions of unsigned short to int.
17543 (lisp_data_to_selection_data): Don't assume that integers
17544 in the range -65535 through -1 fit in an X unsigned short.
17545 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17546 result parameters unless successful. Rely on cons_to_unsigned
17547 to report problems with elements; the old code wasn't right anyway.
17548 (x_check_property_data): Check for int overflow; we cannot use
17549 a wider type due to X limits.
17550 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17552 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17554 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17555 (x_term_init): Check for size calculation overflow.
17556 (x_color_cells): Don't store size until memory allocation succeeds.
17557 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17558 Don't assume alloca size is less than MAX_ALLOCA.
17559 (x_term_init): Don't assume length fits in int (sprintf is limited
17562 Use ptrdiff_t for composition IDs.
17563 * character.c (lisp_string_width):
17564 * composite.c (composition_table_size, n_compositions)
17565 (get_composition_id, composition_gstring_from_id):
17566 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17567 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17568 * window.c (Frecenter):
17569 Use ptrdiff_t, not int, for composition IDs.
17570 * composite.c (get_composition_id): Check for integer overflow.
17571 * composite.h: Adjust prototypes to match the above changes.
17573 Use ptrdiff_t for hash table indexes.
17574 * category.c (hash_get_category_set):
17575 * ccl.c (ccl_driver):
17576 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17577 * coding.c (coding_system_charset_list, detect_coding_system):
17578 * coding.h (struct coding_system.id):
17579 * composite.c (get_composition_id, gstring_lookup_cache):
17580 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17581 * image.c (xpm_get_color_table_h):
17582 * lisp.h (hash_lookup, hash_put):
17583 * minibuf.c (Ftest_completion):
17584 Use ptrdiff_t for hash table indexes, not int (which is too
17585 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17586 32-bit --with-wide-int hosts).
17588 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17589 Add a FIXME comment about memory leaks.
17590 (syms_of_charset): Don't assume xmalloc returns.
17592 Don't assume that stated character widths fit in int.
17593 * character.c (Fchar_width, c_string_width, lisp_string_width):
17594 * character.h (CHAR_WIDTH):
17595 * indent.c (MULTIBYTE_BYTES_WIDTH):
17596 Use sanitize_char_width to avoid undefined and/or bad behavior
17597 with outlandish widths.
17598 * character.h (sanitize_tab_width): Rename from sanitize_width,
17599 now that we have two such functions. All uses changed.
17600 (sanitize_char_width): New inline function.
17602 Don't assume that tab-width fits in int.
17603 * character.h (sanitize_width): New inline function.
17604 (SANE_TAB_WIDTH): New macro.
17605 (ASCII_CHAR_WIDTH): Use it.
17606 * indent.c (sane_tab_width): Remove. All uses replaced by
17607 SANE_TAB_WIDTH (current_buffer).
17608 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17610 * fileio.c: Integer overflow issues with file modes.
17611 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17613 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17614 Remove unreachable code.
17615 (read_hex, load_charset_map_from_file): Check for integer overflow.
17617 * xterm.c: Don't go over XClientMessageEvent limit.
17618 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17619 (x_send_scroll_bar_event): Likewise. Check that the size does not
17620 exceed limits imposed by XClientMessageEvent, as well as the usual
17621 ptrdiff_t and size_t limits.
17623 * keyboard.c: Overflow, signedness and related fixes.
17624 (make_lispy_movement): Use same integer type in forward decl
17625 that is used in the definition.
17626 (read_key_sequence, keyremap_step):
17627 Change bufsize argument back to int, undoing my 2011-03-30 change.
17628 We prefer signed types, and int is wide enough here.
17629 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17630 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17631 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17632 length, not size_t. Use ptrdiff_t for index, not int.
17633 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17634 possibility of integer overflow.
17636 Overflow, signedness and related fixes for images.
17638 * dispextern.h (struct it.stack[0].u.image.image_id)
17639 (struct_it.image_id, struct image.id, struct image_cache.size)
17640 (struct image_cache.used, struct image_cache.ref_count):
17641 * gtkutil.c (update_frame_tool_bar):
17642 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17643 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17644 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17645 * nsmenu.m (update_frame_tool_bar):
17646 * xdisp.c (calc_pixel_width_or_height):
17647 * xfns.c (image_cache_refcount):
17648 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17649 on typical 64-bit hosts.
17651 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17652 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17653 Omit unnecessary casts to int.
17654 (parse_image_spec): Check that integers fall into 'int' range
17655 when the callers expect that.
17656 (image_ascent): Redo ascent calculation to avoid int overflow.
17657 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17658 (lookup_image): Remove unnecessary tests.
17659 (xbm_image_p): Locals are now of int, not EMACS_INT,
17660 since parse_image_check makes sure they fit into int.
17661 (png_load, gif_load, svg_load_image):
17662 Prefer int to unsigned where either will do.
17663 (tiff_handler): New function, combining the cores of the
17664 old tiff_error_handler and tiff_warning_handler.
17665 This function is rewritten to use vsnprintf and thereby avoid
17666 stack buffer overflows. It uses only the features of vsnprintf
17667 that are common to both POSIX and native Microsoft.
17668 (tiff_error_handler, tiff_warning_handler): Use it.
17669 (tiff_load, gif_load, imagemagick_load_image):
17670 Don't assume :index value fits in 'int'.
17671 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17672 (imagemagick_load_image): Check that crop parameters fit into
17673 the integer types that MagickCropImage accepts. Don't assume
17674 Vimagemagick_render_type has a nonnegative value. Don't assume
17675 size_t fits in 'long'.
17676 (gs_load): Use printmax_t to print the widest integers possible.
17677 Check for integer overflow when computing image height and width.
17679 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17681 * xdisp.c (redisplay_window): Don't force window start if point
17682 will be invisible in the resulting window. (Bug#9324)
17684 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17686 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17687 the display spec is of the form `(space ...)'.
17688 (handle_display_spec): Return the value returned by
17689 handle_single_display_spec, not just 1 or zero.
17690 (handle_single_display_spec): If the display spec is of the form
17691 `(space ...)', and specifies display in the text area, return 2
17693 (try_cursor_movement): Check for the need to scroll more
17694 accurately, and prefer exact match for point under bidi.
17695 Don't advance `row' beyond the last row of the window.
17697 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17698 into disp_prop; all users changed.
17700 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17701 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17702 for the text covered by the display property.
17704 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17706 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17707 Change return value to nil.
17708 (Frecord_buffer): Delete unused function.
17710 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17712 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17713 buffers, return left-to-right.
17714 (set_cursor_from_row): Consider candidate row a win if its glyph
17715 represents a newline and point is on that newline. Fixes cursor
17716 positioning on the newline at EOL of R2L text within L2R
17717 paragraph, and vice versa.
17718 (try_cursor_movement): Check continued rows, in addition to
17719 continuation rows. Fixes unwarranted scroll when point enters a
17720 continued line of R2L text within an L2R paragraph, or vice versa.
17721 (cursor_row_p): Consider the case of point being equal to
17722 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17723 from the end of a short line to the beginning of a continued line
17724 of R2L text within L2R paragraph.
17725 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17726 composed characters.
17728 * bidi.c (bidi_check_type): Use xassert.
17729 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17732 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17734 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17737 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17739 * nsfont.m (ns_otf_to_script): Fix typo.
17741 2011-08-22 Kenichi Handa <handa@m17n.org>
17743 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17744 extra slot even if the purpose is char-code-property-table.
17746 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17748 * xdisp.c (redisplay_window): When computing centering_position,
17749 account for the height of the header line. (Bug#8874)
17751 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17752 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17753 candidate is selected by the mouse, and that candidate has a
17754 composed character under the mouse.
17756 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17757 coordinates reported by pos-visible-in-window-p for a composed
17758 character in column zero.
17760 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17762 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17764 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17766 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17767 consider it a hit if to_charpos is anywhere in the range of the
17768 composed buffer positions.
17770 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17772 * image.c (gif_load): Don't assume that each subimage has the same
17773 dimensions as the base image. Handle disposal method that is
17774 "undefined" by the gif spec (Bug#9335).
17776 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17778 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17779 (Fcondition_case): Document `debug' symbol in error handler.
17781 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17783 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17784 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17785 from an Org mode buffer to a Speedbar frame.
17787 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17788 a composition, take its buffer position from IT->cmp_it.charpos.
17789 Fixes cursor positioning at the beginning of a line that begins
17790 with a composed character.
17792 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17794 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17795 character bidirectional type, use STRONG_L instead. Fixes crashes
17796 in a buffer produced by `describe-categories'.
17798 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17799 members before the level stack, so they would be saved and
17800 restored when copying iterator state. Fixes incorrect reordering
17801 around TABs covered by display properties.
17803 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17805 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17807 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17809 * eval.c (internal_condition_case, internal_condition_case_1)
17810 (internal_condition_case_2, internal_condition_case_n):
17811 Remove unnecessary aborts (Bug#9081).
17813 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17815 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17816 has no `load' handler, try opening the file locally. (Bug#9311)
17818 2011-08-16 Ken Brown <kbrown@cornell.edu>
17820 * gmalloc.c: Expand comment.
17822 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17824 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17825 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17827 2011-08-16 Ken Brown <kbrown@cornell.edu>
17829 Fix memory allocation problems in Cygwin build (Bug#9273).
17831 * unexcw.c ( __malloc_initialized): Declare external variable.
17832 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17834 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17836 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17838 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17839 in the static heap.
17840 [CYGWIN] (special_realloc): New function.
17841 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17842 requests to realloc storage in the static heap.
17844 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17846 * bidi.c (bidi_initialize): Remove unused local.
17848 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17851 * biditype.h: Remove file.
17852 * makefile.w32-in ($(BLD)/bidi.$(O)):
17853 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17855 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17857 * chartab.c: Improve commentary for the uniprop_table API.
17859 * bidi.c (bidi_paragraph_init): Support zero value of
17860 bidi_ignore_explicit_marks_for_paragraph_level.
17861 (bidi_initialize): Use uniprop_table instead of including
17862 biditype.h and bidimirror.h.
17864 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17865 coordinates of the iterator when restoring from ppos_it.
17868 2011-08-14 Kenichi Handa <handa@m17n.org>
17870 * process.c (create_process): Call setup_process_coding_systems
17871 after the pid of the process is set to -1 (Bug#8162).
17873 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17875 * xdisp.c (move_it_in_display_line_to): Don't invoke
17876 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17877 ppos_it. Fixes vertical cursor motion when line beginning is
17878 covered by an image. (Bug#9296)
17880 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17882 * nsterm.h (ns_run_ascript): Declare.
17883 (NSAPP_DATA2_RUNASSCRIPT): Define.
17885 * nsfns.m (as_script, as_result, as_status): New static variables.
17886 (ns_run_ascript): New function.
17887 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17888 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17889 the event loop. Get status from as_status (Bug#7276).
17891 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17892 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17893 the event loop (Bug#7276).
17895 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17897 * gnutls.c (QCgnutls_bootprop_priority)
17898 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17899 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17900 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17901 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17902 (QCgnutls_bootprop_verify_hostname_error)
17903 (QCgnutls_bootprop_callbacks_verify): Rename from
17904 Qgnutls_bootprop_..., all uses changed.
17906 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17909 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17911 * xfaces.c (Qframe_set_background_mode): Now static.
17912 * dispextern.h (Qframe_set_background_mode): Remove decl.
17914 * process.c (Fnetwork_interface_info): Declare local only if needed.
17916 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17918 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17919 (Fnetwork_interface_list): Allocate in increments of bytes instead
17920 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17921 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17923 (struct ifflag_def): notrailers is smart on OSX.
17924 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17925 Get hardware address with getifaddrs if available.
17927 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17929 * xdisp.c (iterate_out_of_display_property): xassert that
17930 IT->position is set to within IT->object's boundaries. Break from
17931 the loop as soon as EOB is reached; avoids infloops in redisplay
17932 when IT->position is set up wrongly due to some bug.
17933 Set IT->current to match the bidi iterator unconditionally.
17934 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17935 entry. Force push_it to save on the stack the current
17936 buffer/string position, to be restored by pop_it. Fix flags in
17937 the iterator structure wrt the object coming from a display
17938 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17939 properties. (Bug#9284)
17941 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17943 * fontset.c (fontset_get_font_group): Add proper type checks.
17946 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17948 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17949 and LC_VERSION_MIN_MACOSX.
17950 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17951 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17953 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17955 * xdisp.c (forward_to_next_line_start): Allow to use the
17956 no-display-properties-and-no-overlays under bidi display.
17957 Set disp_pos in the bidi iterator to avoid searches for display
17958 properties and overlays.
17960 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17962 * editfns.c (Fset_time_zone_rule): Document relationship with the
17965 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17966 the font entity extracted from the cache (Bug#8109).
17968 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17970 * composite.c (autocmp_chars): Don't reset point. That is done by
17971 restore_point_unwind (Bug#5984).
17973 2011-08-07 Juri Linkov <juri@jurta.org>
17975 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17976 to show the arg `TIME' instead of `TIMEVAL'.
17978 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17980 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17981 display property strides EOL and includes a newline, as in
17982 longlines-mode. (Bug#9254)
17983 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17984 word-wrap under bidirectional display. (Bug#9224)
17986 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17987 is non-zero, even if the data buffer is NULL. Fixes a crash in
17988 vertical-motion with longlines-mode. (Bug#9254)
17990 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17992 * bidi.c <bidi_cache_total_alloc>: Now static.
17993 (bidi_initialize): Initialize bidi_cache_total_alloc.
17995 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17998 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17999 amount allocated this far in `bidi_cache_total_alloc'.
18000 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18001 non-zero, only free the data buffer without restoring the cache
18002 contents. All callers changed.
18004 * dispextern.h (bidi_unshelve_cache): Update prototype.
18006 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18007 (move_it_in_display_line, move_it_to)
18008 (move_it_vertically_backward, move_it_by_lines): Replace the call
18009 to xfree to an equivalent call to bidi_unshelve_cache.
18010 (move_it_in_display_line_to): Fix logic of returning
18011 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18013 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18015 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18016 came from a string character with a `cursor' property. (Bug#9229)
18018 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18020 * Makefile.in (LIB_PTHREAD): New variable.
18021 (LIBES): Add LIB_PTHREAD (Bug#9216).
18023 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18024 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18026 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18028 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18030 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18032 * xterm.c (x_find_topmost_parent): New function.
18033 (x_set_frame_alpha): Find topmost parent window with
18034 x_find_topmost_parent and set the property there also (bug#9181).
18035 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18037 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18039 * callproc.c (Fcall_process): Avoid vfork clobbering
18040 the local vars buffer, coding_systems, current_dir.
18042 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18044 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18046 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18048 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18049 so that it is not optimized away.
18051 * xdisp.c (compute_display_string_pos): Remove unused local.
18053 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18055 Fix slow cursor motion and scrolling in large buffers with
18056 selective display, like Org Mode buffers. (Bug#9218)
18058 * dispextern.h (struct bidi_it): New member disp_prop_p.
18060 * xdisp.c: Remove one-slot cache of display string positions.
18061 (compute_display_string_pos): Accept an additional argument
18062 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18063 for a display string or property. If found, set DISP_PROP_P
18066 * bidi.c (bidi_fetch_char): Accept an additional argument
18067 DISP_PROP_P, and pass it to compute_display_string_pos.
18068 Only handle text covered by a display string if DISP_PROP_P is returned
18069 non-zero. All callers of bidi_fetch_char changed.
18071 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18073 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18075 2010-12-03 Don March <don@ohspite.net>
18077 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18078 last character M-[char] is translated to ESC [char] (bug#7541).
18080 2011-08-02 Kenichi Handa <handa@m17n.org>
18082 * lisp.h (uniprop_table): Extern it.
18084 * chartab.c (uniprop_table): Make it non-static.
18086 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18088 * xdisp.c (forward_to_next_line_start): Accept additional argument
18089 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18091 (reseat_at_next_visible_line_start): Use the bidi iterator state
18092 returned by forward_to_next_line_start to restore the state of
18093 it->bidi_it after backing up to previous newline. (Bug#9212)
18095 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18097 * regex.c (re_comp): Protoize.
18098 (re_exec): Fix return type.
18099 (regexec): Fix type of `ret'. (Bug#9203)
18101 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18103 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18104 This is needed if max-image-size is a floating-point number.
18106 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18108 * print.c (print_object): Print empty symbol as ##.
18110 * lread.c (read1): Read ## as empty symbol.
18112 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18114 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18115 setting frame foreground color (Bug#9175).
18116 (x_set_background_color): Likewise.
18118 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18119 contents (Bug#9176).
18120 (EmacsTooltip -init): Remove bezels and add shadows to
18123 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18124 or scroll bar (Bug#8470).
18126 * nsfont.m (nsfont_open): Remove assignment to voffset and
18127 unnecessary vars hshink, expand, hd, full_height, min_height.
18128 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18130 * nsterm.h (nsfont_info): Remove voffset field.
18132 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18134 Implement strike-through and overline on NextStep (Bug#8863).
18136 * nsfont.m (nsfont_open): Use underline position provided by font,
18137 instead of hard-coded value of 2.
18138 (nsfont_draw): Call ns_draw_text_decoration instead.
18140 * nsterm.h: Add declaration for ns_draw_text_decoration.
18142 * nsterm.m (ns_draw_text_decoration): New function for drawing
18143 underline, overline, and strike-through.
18144 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18145 ns_draw_text_decoration. Change treatment of cursor drawing to
18146 accommodate underlining, etc.
18148 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18150 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18153 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18155 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18156 Without this fix, if a signal arrives just after memory fills up,
18157 'malloc' might be invoked reentrantly.
18159 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18160 In other words, assume that every image size is allowed, on non-X
18161 hosts. This assumption is probably wrong, but it lets Emacs compile.
18163 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18165 * regex.c (re_iswctype): Convert return values to boolean.
18167 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18169 * xdisp.c (compute_display_string_pos): Don't use cached display
18170 string position if the buffer had its restriction changed.
18173 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18175 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18177 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18179 Integer signedness and overflow and related fixes. (Bug#9079)
18181 * bidi.c: Integer size and overflow fixes.
18182 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18183 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18184 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18185 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18186 (bidi_find_other_level_edge):
18187 Use ptrdiff_t instead of EMACS_INT where either will do.
18188 This works better on 32-bit hosts configured --with-wide-int.
18189 (bidi_cache_ensure_space): Check for size-calculation overflow.
18190 Use % rather than repeated addition, for better worst-case speed.
18191 Don't set bidi_cache_size until after xrealloc returns, because it
18193 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18194 (bidi_cache_ensure_space): Also check that the bidi cache size
18195 does not exceed that of the largest Lisp string or buffer. See Eli
18196 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18198 * alloc.c (__malloc_size_t): Remove.
18199 All uses replaced by size_t. See Andreas Schwab's note
18200 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18202 * image.c: Improve checking for integer overflow.
18203 (check_image_size): Assume that f is nonnull, since
18204 it is always nonnull in practice. This is one less thing to
18205 worry about when checking for integer overflow later.
18206 (x_check_image_size): New function, which checks for integer
18207 overflow issues inside X.
18208 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18209 This removes the need for a memory_full check.
18210 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18211 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18212 (xbm_read_bitmap_data): Change locals back to 'int', since
18213 their values must fit in 'int'.
18214 (xpm_load_image, png_load, tiff_load):
18215 Invoke x_create_x_image_and_pixmap earlier,
18216 to avoid much needless work if the image is too large.
18217 (tiff_load): Treat overly large images as if
18218 x_create_x_image_and_pixmap failed, not as malloc failures.
18219 (gs_load): Use x_check_image_size.
18221 * gtkutil.c: Omit integer casts.
18222 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18223 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18225 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18227 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18228 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18229 would wrongly return t on a 64-bit host.
18231 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18232 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18233 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18234 and therefore cause GCC to emit a bogus diagnostic in some cases.
18236 * image.c: Integer signedness and overflow and related fixes.
18237 This is not an exhaustive set of fixes, but it's time to
18238 record what I've got.
18239 (lookup_pixel_color, check_image_size): Remove redundant decls.
18240 (check_image_size): Don't assume that arbitrary EMACS_INT values
18241 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18242 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18243 (tiff_load, imagemagick_load_image):
18244 Check for overflow in size calculations.
18245 (x_create_x_image_and_pixmap): Remove unnecessary test for
18246 xmalloc returning NULL; that can't happen.
18247 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18248 (xpm_color_bucket): Use better integer hashing function.
18249 (xpm_cache_color): Don't possibly over-allocate memory.
18250 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18251 (gif_memory_source):
18252 Use ptrdiff_t, not int or size_t, to record sizes.
18253 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18254 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18255 either works, as we prefer signed integers.
18256 (tiff_read_from_memory, tiff_write_from_memory):
18257 Return tsize_t, not size_t, since that's what the TIFF API wants.
18258 (tiff_read_from_memory): Don't fail simply because the read would
18259 go past EOF; instead, return a short read.
18260 (tiff_load): Omit no-longer-needed casts.
18261 (Fimagemagick_types): Don't assume size fits into 'int'.
18263 Improve hashing quality when configured --with-wide-int.
18264 * fns.c (hash_string): New function, taken from sxhash_string.
18265 Do not discard information about ASCII character case; this
18266 discarding is no longer needed.
18267 (sxhash-string): Use it. Change sig to match it. Caller changed.
18268 * lisp.h: Declare it.
18269 * lread.c (hash_string): Remove, since we now use fns.c's version.
18270 The fns.c version returns a wider integer if --with-wide-int is
18271 specified, so this should help the quality of the hashing a bit.
18273 * emacs.c: Integer overflow minor fix.
18274 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18275 Define only if GNU_LINUX.
18276 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18278 * dispnew.c: Integer signedness and overflow fixes.
18279 Remove unnecessary forward decls, that were a maintenance hassle.
18280 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18282 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18283 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18284 (prepare_desired_row, line_draw_cost):
18285 Use int, not unsigned, where either works.
18286 (save_current_matrix, restore_current_matrix):
18287 Use ptrdiff_t, not size_t, where either works.
18288 (init_display): Check for overflow more accurately, and without
18289 relying on undefined behavior.
18291 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18292 Remove, replacing with the new symbols in lisp.h. All uses changed.
18293 * fileio.c (make_temp_name):
18294 * filelock.c (lock_file_1, lock_file):
18295 * xdisp.c (message_dolog):
18296 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18297 Use pMd etc. instead.
18298 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18299 replacing the pWIDE etc. symbols removed from editfns.c.
18301 * keyboard.h (num_input_events): Now uintmax_t.
18302 This is (very slightly) less likely to mess up due to wraparound.
18305 * buffer.c: Integer signedness fixes.
18306 (alloc_buffer_text, enlarge_buffer_text):
18307 Use ptrdiff_t rather than size_t when either will do, as we prefer
18310 * alloc.c: Integer signedness and overflow fixes.
18311 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18312 (__malloc_size_t): Default to size_t, not to int.
18313 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18314 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18315 Prefer ptrdiff_t to size_t when either would do, as we prefer
18317 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18318 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18319 Now const. Initialize with values that are in range even if char
18321 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18322 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18323 These functions do the right thing with sizes > 2**32.
18324 (check_depth): Now ptrdiff_t, not int.
18325 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18326 Adjust to new way of storing sizes. Check for size overflow bugs
18328 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18329 slightly wrong anyway, as it missed one instance of
18330 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18331 (refill_memory_reserve): Omit needless cast to size_t.
18332 (mark_object_loop_halt): Mark as externally visible.
18334 * xselect.c: Integer signedness and overflow fixes.
18335 (Fx_register_dnd_atom, x_handle_dnd_message):
18336 Use ptrdiff_t, not size_t, since we prefer signed.
18337 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18338 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18339 x_dnd_atoms_size and x_dnd_atoms_length.
18341 * doprnt.c: Prefer signed to unsigned when either works.
18343 * doprnt.c (doprnt):
18345 * xdisp.c (vmessage):
18346 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18347 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18348 prefer signed arithmetic to avoid comparison confusion.
18349 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18350 but is a bit tricky.
18352 Assume freestanding C89 headers, string.h, stdlib.h.
18353 * data.c, doprnt.c, floatfns.c, print.c:
18354 Include float.h unconditionally.
18355 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18356 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18357 * regex.c: Likewise for stddef.h, string.h.
18358 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18359 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18360 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18361 (STDC_HEADERS): Remove obsolete defines.
18362 * sysdep.c: Include limits.h unconditionally.
18364 Assume support for memcmp, memcpy, memmove, memset.
18365 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18366 * regex.c (memcmp, memcpy):
18367 Remove; we assume C89 now.
18369 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18370 (__malloc_safe_bcopy): Remove; no longer needed.
18372 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18373 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18374 well either way, and we prefer signed to unsigned.
18376 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18378 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18379 closes the connection while we're reading (bug#9182).
18381 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18383 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18384 are specified (Bug#9168).
18386 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18388 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18389 Found by GCC static checking and --with-wide-int on a 32-bit host.
18391 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18393 * xdisp.c (compute_display_string_pos): Fix logic of caching
18394 previous display string position. Initialize cached_prev_pos to
18395 -1. Fixes slow-down at the beginning of a buffer.
18397 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18399 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18400 for attrs[LFACE_FONTSET_INDEX].
18402 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18404 * xml.c (parse_region): Remove unused local
18405 that was recently introduced.
18407 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18409 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18410 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18412 * xdisp.c (move_it_in_display_line_to): Record the best matching
18413 position for TO_CHARPOS while scanning the line, and restore it on
18414 exit if none of the characters scanned was an exact match.
18415 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18416 when exact match is impossible due to invisible text, and the
18417 lines are truncated.
18419 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18421 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18424 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18426 Fix a significant slow-down of cursor motion with C-n, C-p,
18427 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18428 auto-repeat under bidi redisplay in fontified buffers.
18429 * xdisp.c (compute_stop_pos_backwards): New function.
18430 (next_element_from_buffer): Call compute_stop_pos_backwards to
18431 find a suitable prev_stop when we find ourselves before
18433 (reseat): Don't look for prev_stop, as that could mean a very long
18435 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18436 <cached_disp_overlay_modiff>: Cache for last found display string
18438 (compute_display_string_pos): Return the cached position if asked
18439 about the same buffer in the same area of character positions, and
18440 the buffer wasn't changed since the time the display string
18441 position was cached.
18443 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18445 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18446 is an integer, which is important for empty lines. (Bug#9149)
18448 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18450 * frame.c (Fmodify_frame_parameters): In tty case, update the
18451 default face if necessary (Bug#4238).
18453 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18455 * editfns.c (Fstring_to_char): No need to explain what a character
18456 is in the docstring (Bug#6576).
18458 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18460 * xml.c (parse_region): Make sure we always return a tree.
18462 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18464 * xml.c (parse_region): If a document contains only comments,
18467 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18469 * xml.c (make_dom): Return comments, too.
18471 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18474 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18475 and the surrounding thread.
18476 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18477 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18478 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18480 * s/openbsd.h (BROKEN_SIGIO): Define.
18481 * unexelf.c (unexec) [__OpenBSD__]:
18482 Don't update the .mdebug section of the Alpha COFF symbol table.
18484 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18486 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18489 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18491 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18492 This fixes some race conditions on the permissions of any newly
18495 * alloc.c (valid_pointer_p): Use pipe, not open.
18496 This fixes some permissions issues when debugging.
18498 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18499 If fchown fails to set both uid and gid, try to set just gid,
18500 as that is sometimes allowed. Adjust the file's mode to eliminate
18501 setuid or setgid bits that are inappropriate if fchown fails.
18503 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18505 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18506 to compare Lisp_Objects.
18507 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18508 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18509 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18511 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18513 * lread.c (read_integer): Unread even EOF character.
18514 (read1): Likewise. Properly record start position of symbol.
18516 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18517 symbol character follows.
18519 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18521 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18522 This works around a problem with the previous change to Fcopy_file.
18523 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18524 and without this change, GCC might complain about discarding
18525 fchown's return value.
18527 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18529 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18531 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18533 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18535 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18537 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18538 it's used from the C level.
18540 * process.c: Use the same condition for POLL_FOR_INPUT in both
18541 keyboard.c and process.c (bug#1858).
18543 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18545 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18546 (Fgnutls_boot): Use it.
18548 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18550 * doc.c (Fsubstitute_command_keys): Revert last change.
18552 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18554 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18555 quotes the next character, and doesn't affect other longer
18556 sequences (bug#8935).
18558 * lread.c (syms_of_lread): Clarify that is isn't only
18559 `eval-buffer' and `eval-defun' that's affected by
18560 `lexical-binding' (bug#8460).
18562 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18564 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18565 bidi redisplay when a line includes both an image and is truncated.
18567 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18569 Fix minor problems found by static checking.
18570 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18571 (elsz): Now a signed constant, not a size_t var. We prefer signed
18572 types to unsigned, to avoid integer comparison confusion. Without
18573 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18574 "cannot optimize loop, the loop counter may overflow", a symptom
18576 * indent.c (Fvertical_motion): Mark locals as initialized.
18577 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18579 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18581 * search.c (Fre_search_backward): Mention `case-fold-search' in
18582 all the re_search_* functions (bug#8138).
18584 * keyboard.c (Fopen_dribble_file): Document when the file is
18587 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18589 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18592 Support bidi reordering of display and overlay strings.
18593 * xdisp.c (compute_display_string_pos)
18594 (compute_display_string_end): Accept additional argument STRING.
18595 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18596 (reseat_to_string): Initialize bidi_it->string.s and
18597 bidi_it->string.schars.
18598 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18599 NULL (avoids a crash in bidi_paragraph_init).
18600 Initialize itb.string.lstring.
18601 (init_iterator): Call bidi_init_it only of a valid
18602 buffer position was specified. Initialize paragraph_embedding to
18604 (reseat_to_string): Initialize the bidi iterator.
18605 (display_string): If we need to ignore text properties of
18606 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18607 original value of -1 will not work with bidi.)
18608 (compute_display_string_pos): First arg is now struct
18609 `text_pos *'; all callers changed. Support display properties on
18611 (compute_display_string_end): Support display properties on Lisp
18613 (init_iterator, reseat_1, reseat_to_string): Initialize the
18614 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18615 when iterating on a string not from display properties).
18616 (compute_display_string_pos, compute_display_string_end):
18617 Fix calculation of the object to scan. Fixes an error when using
18619 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18620 base_level_stop; instead, set base_level_stop to BEGV.
18621 Fixes crashes in vertical-motion.
18622 (next_element_from_buffer): Improve commentary for when
18623 the iterator is before prev_stop.
18624 (init_iterator): Initialize bidi_p from the default value of
18625 bidi-display-reordering, not from buffer-local value. Use the
18626 buffer-local value only if initializing for buffer iteration.
18627 (handle_invisible_prop): Support invisible properties on strings
18628 that are being bidi-reordered.
18629 (set_iterator_to_next): Support bidi reordering of C strings and
18631 (next_element_from_string): Support bidi reordering of Lisp
18633 (handle_stop_backwards): Support Lisp strings as well.
18634 (display_string): Support display of R2L glyph rows.
18635 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18636 (init_iterator): Don't initialize it->bidi_p for strings
18638 (reseat_to_string): Initialize it->bidi_p for strings here.
18639 (next_element_from_string, next_element_from_c_string)
18640 (next_element_from_buffer): Add xassert's for correspondence
18641 between IT's object being iterated and it->bidi_it.string
18643 (face_before_or_after_it_pos): Support bidi iteration.
18644 (next_element_from_c_string): Handle the case of the first string
18645 character that is not the first one in the visual order.
18646 (get_visually_first_element): New function, refactored from common
18647 parts of next_element_from_buffer, next_element_from_string, and
18648 next_element_from_c_string.
18649 (tool_bar_lines_needed, redisplay_tool_bar)
18650 (display_menu_bar): Force left-to-right direction. Add a FIXME
18651 comment for making that be controlled by a user option.
18652 (push_it, pop_it): Save and restore the state of the
18653 bidi iterator. Save and restore the bidi_p flag.
18654 (pop_it): Iterate out of display property for string iteration as
18656 (iterate_out_of_display_property): Support iteration over strings.
18657 (handle_single_display_spec): Set up it->bidi_it for iteration
18658 over a display string, and call bidi_init_it.
18659 (handle_single_display_spec, next_overlay_string)
18660 (get_overlay_strings_1, push_display_prop): Set up the bidi
18661 iterator for displaying display or overlay strings.
18662 (forward_to_next_line_start): Don't use the shortcut if
18664 (back_to_previous_visible_line_start): If handle_display_prop
18665 pushed the iterator stack, restore the internal state of the bidi
18666 iterator by calling bidi_pop_it same number of times.
18667 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18668 and we are bidi-iterating, don't decrement the iterator position;
18669 instead, set the first_elt flag in the bidi iterator, to produce
18671 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18672 (push_display_prop): xassert that we are iterating a buffer.
18673 (push_it, pop_it): Save and restore paragraph_embedding member.
18674 (handle_single_display_spec, next_overlay_string)
18675 (get_overlay_strings_1, reseat_1, reseat_to_string)
18676 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18677 correctly. Don't assume unibyte strings are not bidi-reordered.
18678 (compute_display_string_pos)
18679 (compute_display_string_end): Fix handling the case of C string.
18680 (push_it, pop_it): Save and restore from_disp_prop_p.
18681 (handle_single_display_spec, push_display_prop): Set the
18682 from_disp_prop_p flag.
18683 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18684 (pop_it): Call iterate_out_of_display_property only if we are
18685 popping after iteration over a string that came from a display
18686 property. Fix a typo in popping stretch info. Add an assertion
18687 for verifying that the iterator position is in sync with the bidi
18689 (handle_single_display_spec, get_overlay_strings_1)
18690 (push_display_prop): Fix initialization of paragraph direction for
18691 string when that of the parent object is not yet determined.
18692 (reseat_1): Call bidi_init_it to resync the bidi
18693 iterator with IT's position. (Bug#7616)
18694 (find_row_edges): If ROW->start.pos gives position
18695 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18696 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18697 Reset the from_disp_prop_p flag.
18698 (SAVE_IT, RESTORE_IT): New macros.
18699 (pos_visible_p, face_before_or_after_it_pos)
18700 (back_to_previous_visible_line_start)
18701 (move_it_in_display_line_to, move_it_in_display_line)
18702 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18703 (try_scrolling, redisplay_window, display_line): Use them when
18704 saving a temporary copy of the iterator and restoring it back.
18705 (back_to_previous_visible_line_start, reseat_1)
18706 (init_iterator): Empty the bidi cache "stack".
18707 (move_it_in_display_line_to): If iterator ended up at
18708 EOL, but we never saw any buffer positions smaller than
18709 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18710 motion in bidi-reordered lines.
18711 (move_it_in_display_line_to): Record prev_method and prev_pos
18712 immediately before the call to set_iterator_to_next. Fixes cursor
18713 motion in bidi-reordered lines with stretch glyphs and strings
18714 displayed in margins. (Bug#8133) (Bug#8867)
18715 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18717 (pos_visible_p): Support positions in bidi-reordered lines.
18718 Save and restore bidi cache.
18720 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18721 (bidi_paragraph_info): Delete unused struct.
18722 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18723 (bidi_cache_start): New variable.
18724 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18726 (bidi_cache_fetch_state, bidi_cache_search)
18727 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18728 (bidi_cache_find, bidi_peek_at_next_level)
18729 (bidi_level_of_next_char, bidi_find_other_level_edge)
18730 (bidi_move_to_visually_next): Compare cache index with
18731 bidi_cache_start rather than with zero.
18732 (bidi_fetch_char): Accept new argument STRING; all callers
18733 changed. Support iteration over a string. Support strings with
18734 display properties. Support unibyte strings. Fix the type of
18735 `len' according to what STRING_CHAR_AND_LENGTH expects.
18736 (bidi_paragraph_init, bidi_resolve_explicit_1)
18737 (bidi_resolve_explicit, bidi_resolve_weak)
18738 (bidi_level_of_next_char, bidi_move_to_visually_next):
18739 Support iteration over a string.
18740 (bidi_set_sor_type, bidi_resolve_explicit_1)
18741 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18742 can now be zero (for strings); special values 0 and -1 were
18743 changed to -1 and -2, respectively.
18744 (bidi_char_at_pos): New function.
18745 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18746 Call it instead of FETCH_MULTIBYTE_CHAR.
18747 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18748 initialized to valid values.
18749 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18751 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18752 the test for valid cached positions. Fix the logic for looking up
18753 the sentinel state in the cache. GCPRO the Lisp string we are
18755 (bidi_push_it, bidi_pop_it): New functions.
18756 (bidi_initialize): Initialize the bidi cache start stack pointer.
18757 (bidi_cache_ensure_space): New function, refactored from part of
18758 bidi_cache_iterator_state. Don't assume the required size is just
18759 one BIDI_CACHE_CHUNK away.
18760 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18761 (bidi_count_bytes, bidi_char_at_pos): New functions.
18762 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18763 always valid if bidi_cache_idx is valid.
18764 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18765 is valid if it's going to be used.
18766 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18767 (bidi_cache_fetch_state, bidi_cache_search)
18768 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18769 (bidi_cache_iterator_state, bidi_cache_find)
18770 (bidi_find_other_level_edge, bidi_cache_start_stack):
18771 All variables related to cache indices are now EMACS_INT.
18773 * dispextern.h (struct bidi_string_data): New structure.
18774 (struct bidi_it): New member `string'. Make flag members be 1-bit
18775 fields, and put them last in the struct.
18776 (compute_display_string_pos, compute_display_string_end):
18778 (bidi_push_it, bidi_pop_it): Add prototypes.
18779 (struct iterator_stack_entry): New members bidi_p,
18780 paragraph_embedding, and from_disp_prop_p.
18781 (struct it): Member bidi_p is now a bit field 1 bit wide.
18782 (bidi_shelve_cache, bidi_unshelve_cache):
18783 Declare prototypes.
18785 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18786 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18787 and vector-like objects.
18789 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18790 cache around display iteration.
18792 * window.c (Fwindow_end, window_scroll_pixel_based)
18793 (displayed_window_lines, Frecenter): Save and restore the bidi
18794 cache around display iteration.
18796 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18798 * editfns.c (Fdelete_region): Clarify the use of the named
18799 parameters (bug#6788).
18801 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18803 * indent.c (Fvertical_motion): Set and restore w->pointm when
18804 saving and restoring the window's buffer (Bug#9006).
18806 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18808 * editfns.c (Fstring_to_char): Clarify just what is returned
18809 (bug#6576). Text by Eli Zaretskii.
18811 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18813 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18815 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18817 * buffer.c (mmap_find): Fix a typo.
18819 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18821 Fix execution of x selection hooks.
18822 * xselect.c (Qx_lost_selection_functions)
18823 (Qx_sent_selection_functions): New vars.
18824 (syms_of_xselect): DEFSYM them.
18825 (x_handle_selection_request): Pass Qx_sent_selection_functions
18826 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18827 (x_handle_selection_clear,x_clear_frame_selections):
18828 Pass Qx_lost_selection_functions rather than
18829 Vx_lost_selection_functions to Frun_hook_with_args.
18831 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18833 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18834 The old code sometimes used this field without initializing it.
18836 * alloc.c (gc_sweep): Don't read past end of array.
18837 In theory, the old code could also have corrupted Emacs internals,
18838 though it'd be very unlikely.
18840 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18842 * character.c (Fcharacterp): Don't advertise optional ignored
18843 argument. (Bug#4026)
18845 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18847 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18850 * window.c (Fset_window_start): Doc fix (bug#4199).
18851 (Fset_window_hscroll): Ditto.
18853 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18855 Fix minor new problems caught by GCC 4.6.1.
18856 * term.c (init_tty): Remove unused local.
18857 * xsettings.c (store_monospaced_changed): Define this function only
18858 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18859 not used otherwise.
18861 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18863 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18865 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18867 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18868 are the mini-buffer and the echo area (bug#3320).
18870 * term.c (init_tty): Remove support for supdup, c10 and perq
18871 terminals, which are no longer supported (bug#1482).
18873 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18875 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18877 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18879 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18880 for non-popups (Bug#3642).
18882 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18884 * alloc.c (reset_malloc_hooks): Protoize.
18885 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18886 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18887 * cm.c (losecursor): Likewise.
18888 * data.c (fmod): Likewise.
18889 * dispnew.c (swap_glyphs_in_rows): Likewise.
18890 * emacs.c (memory_warning_signal): Likewise.
18891 * floatfns.c (float_error): Likewise.
18892 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18893 (otf_open, font_otf_capability, generate_otf_features)
18894 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18896 * image.c (pbm_read_file): Likewise.
18897 * indent.c (string_display_width): Likewise.
18898 * intervals.c (check_for_interval, search_for_interval)
18899 (inc_interval_count, count_intervals, root_interval)
18900 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18901 * lread.c (defalias): Likewise.
18902 * ralloc.c (r_alloc_check): Likewise.
18903 * regex.c (set_image_of_range_1, set_image_of_range)
18904 (regex_grow_registers): Likewise.
18905 * sysdep.c (strerror): Likewise.
18906 * termcap.c (valid_filename_p, tprint, main): Likewise.
18907 * tparam.c (main): Likewise.
18908 * unexhp9k800.c (run_time_remap, save_data_space)
18909 (update_file_ptrs, read_header, write_header, calculate_checksum)
18910 (copy_file, copy_rest, display_header): Likewise.
18911 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18913 * xdisp.c (check_it): Likewise.
18914 * xfaces.c (register_color, unregister_color, unregister_colors):
18916 * xfns.c (print_fontset_result): Likewise.
18917 * xrdb.c (member, fatal, main): Likewise.
18919 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18921 Fix minor problems found by static checking (Bug#9031).
18922 * chartab.c (char_table_set_range, map_sub_char_table):
18923 Remove unused locals.
18924 (uniprop_table): Now static.
18925 * composite.c (_work_char): Remove unused static var.
18927 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18929 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18931 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18933 * gtkutil.c (qttip_cb): Remove code without function.
18935 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18937 * w32.c (pthread_sigmask): New stub.
18939 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18941 Use pthread_sigmask, not sigprocmask (Bug#9010).
18942 sigprocmask is portable only for single-threaded applications, and
18943 Emacs can be multi-threaded when it uses GTK.
18944 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18946 * callproc.c (Fcall_process):
18947 * process.c (create_process):
18948 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18949 Use pthread_sigmask, not sigprocmask.
18951 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18953 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18954 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18957 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18959 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18960 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18961 (xg_hide_tooltip): Fix comment.
18963 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18964 in registerServicesMenuSendTypes.
18965 (validRequestorForSendType): Don't check ns_return_types.
18967 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18970 2011-07-08 Jason Rumney <jasonr@gnu.org>
18972 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18973 SH_SHOW for hidden windows (Bug#5482).
18975 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18976 frame struct members of non-existent frames (Bug#6284).
18978 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18980 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18981 variable firstTime not needed on OSX >= 10.6.
18982 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18983 >= 10.5. Use setKnobProportion, setDoubleValue.
18985 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18986 (MAC_OS_X_VERSION_10_5): Define if not defined.
18987 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18988 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18989 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18991 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18992 cString and lossyCString on OSX >= 10.4.
18994 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18995 sizeToFit on OSX >= 10.2.
18997 * nsimage.m (allocInitFromFile): Don't use deprecated method
18998 bestRepresentationForDevice on OSX >= 10.6.
19000 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19003 * emacs.c: Declare unexec_init_emacs_zone.
19005 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19007 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19009 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19010 on svcsMenu (Bug#8842).
19012 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19014 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19016 * nsterm.m (QUTF8_STRING): Declare.
19017 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19018 (validRequestorForSendType): Return type is (id).
19019 Change indexOfObjectIdenticalTo to indexOfObject.
19020 Check if we have local selection before returning self (Bug#8842).
19021 (writeSelectionToPasteboard): Put local selection into paste board
19022 if we have a local selection (Bug#8842).
19023 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19025 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19026 (ns_get_local_selection): Declare.
19028 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19030 * keymap.c (describe_map_tree): Don't insert a double newline at
19031 the end of the buffer (bug#1169) and return whether we inserted
19034 * callint.c (Fcall_interactively): Change "reading args" to
19035 "providing args" to try to clarify what it does (bug#1010).
19037 2011-07-07 Kenichi Handa <handa@m17n.org>
19039 * composite.c (composition_compute_stop_pos): Ignore a static
19040 composition starting before CHARPOS (Bug#8915).
19042 * xdisp.c (handle_composition_prop): Likewise.
19044 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19046 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19049 2011-07-07 Kenichi Handa <handa@m17n.org>
19051 * character.h (unicode_category_t): New enum type.
19053 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19054 (Qchar_code_property_table): New variable.
19055 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19056 (UNIPROP_COMPRESSED_FORM_P): New macros.
19057 (char_table_ascii): Uncompress the compressed values.
19058 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19059 Uncompress the compressed values.
19060 (sub_char_table_ref_and_range): Likewise.
19061 (char_table_ref_and_range): Uncompress the compressed values.
19062 (sub_char_table_set): New arg is_uniprop. Callers changed.
19063 Uncompress the compressed values.
19064 (sub_char_table_set_range): Args changed. Callers changed.
19065 (char_table_set_range): Adjuted for the above change.
19066 (map_sub_char_table): Delete args default_val and parent. Add arg
19067 top. Give decoded values to a Lisp function.
19068 (map_char_table): Adjust for the above change. Give decoded
19069 values to a Lisp function. Gcpro more variables.
19070 (uniprop_table_uncompress)
19071 (uniprop_decode_value_run_length): New functions.
19072 (uniprop_decoder, uniprop_decoder_count): New variables.
19073 (uniprop_get_decoder, uniprop_encode_value_character)
19074 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19076 (uniprop_encoder, uniprop_encoder_count): New variables.
19077 (uniprop_get_encoder, uniprop_table)
19078 (Funicode_property_table_internal, Fget_unicode_property_internal)
19079 (Fput_unicode_property_internal): New functions.
19080 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19081 Sunicode_property_table_internal, Sget_unicode_property_internal,
19082 and Sput_unicode_property_internal. Defvar_lisp
19083 char-code-property-alist.
19085 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19086 Vunicode_category_table.
19088 * font.c (font_range): Adjust for the change of
19089 Vunicode_category_table.
19091 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19093 * m/iris4d.h: Remove file, move contents ...
19094 * s/irix6-5.h: ... here.
19096 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19098 Remove unportable assumption about struct layout (Bug#8884).
19099 * alloc.c (mark_buffer):
19100 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19101 (clone_per_buffer_values): Don't assume that
19102 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19103 This isn't true in general, and it's particularly not true
19104 if Emacs is configured with --with-wide-int.
19105 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19106 New macros, used in the buffer.c change.
19108 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19110 * xsettings.c: Use both GConf and GSettings if both are available.
19111 (store_config_changed_event): Add comment.
19112 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19113 (store_tool_bar_style_changed): New functions.
19114 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19115 (struct xsettings): Move font inside HAVE_XFT.
19116 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19117 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19118 Move inside HAVE_XFT.
19119 (something_changed_gsettingsCB): Rename from something_changedCB.
19120 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19122 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19123 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19124 (something_changed_gconfCB): Rename from something_changedCB.
19125 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19126 (parse_settings): Move check for font inside HAVE_XFT.
19127 (read_settings, apply_xft_settings): Add comment.
19128 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19129 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19130 call store_font_name_changed.
19131 (xft_settings_event): Add comment.
19132 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19133 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19134 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19135 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19136 (xsettings_initialize): Call init_gsettings last.
19137 (xsettings_get_system_font, xsettings_get_system_normal_font):
19140 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19142 Random fixes. E.g., (random) never returned negative values.
19143 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19144 subseconds part to the entropy, as that's a bit more random.
19145 Prefer signed to unsigned, since the signedness doesn't matter and
19146 in general we prefer signed. When given a limit, use a
19147 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19148 latter isn't right if USE_2_TAGS_FOR_INTS.
19149 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19150 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19152 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19154 * textprop.c (text_property_stickiness):
19155 Obey Vtext_property_default_nonsticky.
19156 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19157 * w32fns.c (syms_of_w32fns):
19158 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19160 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19162 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19163 This is more efficient than Ffile_directory_p and avoids a minor race.
19165 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19167 * buffer.c (Foverlay_put): Say what the return value is
19170 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19171 is a directory before asking whether to use the file name
19173 (barf_or_query_if_file_exists): Make the "File is a directory"
19174 error be more correct.
19176 * fns.c (Frequire): Remove the mention of the .gz files, since
19177 that's installation-specific, but keep the mention of
19178 `get-load-suffixes'.
19180 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19182 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19183 Report string overflow if the output is too long.
19185 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19187 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19188 (syms_of_gnutls): Remove duplicate DEFSYM for
19189 Qgnutls_bootprop_verify_hostname_error, an error for
19190 Qgnutls_bootprop_verify_error (which is no longer used).
19192 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19193 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19194 Also (re)move comments that are misplaced or no longer relevant.
19196 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19198 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19200 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19202 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19203 and background color parameters if they have been changed.
19205 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19207 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19209 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19211 * xsettings.c (SYSTEM_FONT): Define only when used.
19212 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19214 * keymap.c (access_keymap_1): Now static.
19216 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19218 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19219 leave any prefix arg for the up event (Bug#1586).
19221 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19223 * lread.c (syms_of_lread): Mention single symbols defined by
19224 `defvar' or `defconst' (bug#7154).
19226 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19227 (Frequire): Mention get-load-suffixes.
19229 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19231 * window.h (window): Remove clone_number slot.
19232 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19234 (make_parent_window, make_window, saved_window)
19235 (Fset_window_configuration, save_window_save): Don't deal with
19237 * buffer.c (Qclone_number): Remove declaration.
19238 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19240 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19242 Add multiple inheritance to keymaps.
19243 * keymap.c (Fmake_composed_keymap): New function.
19244 (Fset_keymap_parent): Simplify.
19245 (fix_submap_inheritance): Remove.
19246 (access_keymap_1): New function extracted from access_keymap to handle
19247 embedded parents and handle lists of maps.
19248 (access_keymap): Use it.
19249 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19250 (Fcopy_keymap): Handle embedded parents.
19251 (Fcommand_remapping, define_as_prefix): Simplify.
19252 (Fkey_binding): Simplify.
19253 (syms_of_keymap): Move minibuffer-local-completion-map,
19254 minibuffer-local-filename-completion-map,
19255 minibuffer-local-must-match-map, and
19256 minibuffer-local-filename-must-match-map to Elisp.
19257 (syms_of_keymap): Defsubr make-composed-keymap.
19258 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19259 (parse_menu_item): Trivial simplification.
19261 2011-07-01 Glenn Morris <rgm@gnu.org>
19263 * Makefile.in (SETTINGS_LIBS): Fix typo.
19265 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19267 * coding.c (Fencode_coding_string): Record the last coding system
19268 used, as the function doc string says (bug#8738).
19270 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19272 * xsettings.c (store_monospaced_changed): Take new font as arg and
19273 check for change against current_mono_font.
19274 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19275 (emacs_settings_constructor, emacs_settings_get_property)
19276 (emacs_settings_set_property, emacs_settings_class_init)
19277 (emacs_settings_init, gsettings_obj): Remove.
19278 (something_changedCB): New function for HAVE_GSETTINGS.
19279 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19280 with value as argument.
19281 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19282 g_settings_new (Bug#8967). Do not create gsettings_obj.
19283 Remove calls to g_settings_bind. Connect something_changedCB to
19286 * xgselect.c: Add defined (HAVE_GSETTINGS).
19287 (xgselect_initialize): Ditto.
19289 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19290 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19293 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19295 * eval.c (struct backtrace): Simplify and port the data structure.
19296 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19297 signed bit field, as this assumption is not portable and it makes
19298 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19299 "char debug_on_exit : 1" as this is not portable either; instead,
19300 use the portable "unsigned int debug_on_exit : 1". Remove unused
19301 member evalargs. Remove obsolete comments about cc bombing out.
19303 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19305 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19306 Let HAVE_GSETTINGS override HAVE_GCONF.
19307 (store_monospaced_changed): New function.
19308 (EMACS_SETTINGS): A new type derived from GObject to handle
19309 GSettings notifications.
19310 (emacs_settings_constructor, emacs_settings_get_property)
19311 (emacs_settings_set_property, emacs_settings_class_init):
19313 (gsettings_client, gsettings_obj): New variables.
19314 (GSETTINGS_SCHEMA): New define.
19315 (something_changedCB): Call store_monospaced_changed.
19316 (init_gsettings): New function.
19317 (xsettings_initialize): Call init_gsettings.
19318 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19321 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19324 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19326 * window.c (resize_root_window, grow_mini_window)
19327 (shrink_mini_window): Rename Qresize_root_window to
19328 Qwindow_resize_root_window and Qresize_root_window_vertically to
19329 Qwindow_resize_root_window_vertically.
19331 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19333 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19335 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19337 * makefile.w32-in: Redesign dependencies so they reflect more
19338 clearly which files are directly included by each source file,
19339 and not through other includes.
19341 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19343 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19344 (sort_overlays, overlay_strings): When an overlay's clone number
19345 matches the window's clone number process the overlay even if
19346 the overlay's window property doesn't match the current window.
19348 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19349 (Fwindow_hchild): Rename to Fwindow_left_child.
19350 (Fwindow_next): Rename to Fwindow_next_sibling.
19351 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19352 (resize_window_check): Rename to window_resize_check.
19353 (resize_window_apply): Rename to window_resize_apply.
19354 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19355 (Fdelete_other_windows_internal, resize_frame_windows)
19356 (Fsplit_window_internal, Fdelete_window_internal)
19357 (grow_mini_window, shrink_mini_window)
19358 (Fresize_mini_window_internal): Fix callers accordingly.
19360 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19362 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19363 (emacs_fixed_set_min_size): Remove.
19364 (emacs_fixed_new): Take frame as argument.
19366 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19367 (_EmacsFixedPrivate): Remove minwidth/height.
19368 Add struct frame *f.
19369 (emacs_fixed_init): Initialize priv->f.
19370 (get_parent_class, emacs_fixed_set_min_size): Remove.
19371 (emacs_fixed_new): Set priv->f to argument.
19372 (emacs_fixed_get_preferred_width)
19373 (emacs_fixed_get_preferred_height): Use min_width/height from
19374 frames size_hint to set minimum and natural (Bug#8919).
19375 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19376 and use min_width/height from frames size_hint to set
19377 min_width/height (Bug#8919).
19379 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19380 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19383 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19385 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19386 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19389 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19391 * process.c (wait_reading_process_output): Bypass select if
19392 waiting for a cell while ignoring keyboard input, and input is
19393 pending. Suggested by Jan Djärv (Bug#8869).
19395 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19397 Use gnulib's dup2 module instead of rolling our own.
19398 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19400 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19402 * dispnew.c (scrolling_window): Before scrolling, turn off a
19403 mouse-highlight in the window being scrolled.
19405 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19407 Move DEFSYM to lisp.h and use everywhere.
19409 * character.h (DEFSYM): Move declaration...
19410 * lisp.h (DEFSYM): ...here.
19416 * w32select.c: Don't include character.h.
19418 * alloc.c (syms_of_alloc):
19419 * buffer.c (syms_of_buffer):
19420 * bytecode.c (syms_of_bytecode):
19421 * callint.c (syms_of_callint):
19422 * casefiddle.c (syms_of_casefiddle):
19423 * casetab.c (init_casetab_once):
19424 * category.c (init_category_once, syms_of_category):
19425 * ccl.c (syms_of_ccl):
19426 * cmds.c (syms_of_cmds):
19427 * composite.c (syms_of_composite):
19428 * dbusbind.c (syms_of_dbusbind):
19429 * dired.c (syms_of_dired):
19430 * dispnew.c (syms_of_display):
19431 * doc.c (syms_of_doc):
19432 * editfns.c (syms_of_editfns):
19433 * emacs.c (syms_of_emacs):
19434 * eval.c (syms_of_eval):
19435 * fileio.c (syms_of_fileio):
19436 * fns.c (syms_of_fns):
19437 * frame.c (syms_of_frame):
19438 * fringe.c (syms_of_fringe):
19439 * insdel.c (syms_of_insdel):
19440 * keymap.c (syms_of_keymap):
19441 * lread.c (init_obarray, syms_of_lread):
19442 * macros.c (syms_of_macros):
19443 * msdos.c (syms_of_msdos):
19444 * print.c (syms_of_print):
19445 * process.c (syms_of_process):
19446 * search.c (syms_of_search):
19447 * sound.c (syms_of_sound):
19448 * syntax.c (init_syntax_once, syms_of_syntax):
19449 * terminal.c (syms_of_terminal):
19450 * textprop.c (syms_of_textprop):
19451 * undo.c (syms_of_undo):
19452 * w32.c (globals_of_w32):
19453 * window.c (syms_of_window):
19454 * xdisp.c (syms_of_xdisp):
19455 * xfaces.c (syms_of_xfaces):
19456 * xfns.c (syms_of_xfns):
19457 * xmenu.c (syms_of_xmenu):
19458 * xsettings.c (syms_of_xsettings):
19459 * xterm.c (syms_of_xterm): Use DEFSYM.
19461 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19463 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19465 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19467 Integer and buffer overflow fixes (Bug#8873).
19469 * print.c (printchar, strout): Check for string overflow.
19470 (PRINTPREPARE, printchar, strout):
19471 Don't set size unless allocation succeeds.
19473 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19474 for sizes. Check for string overflow more accurately.
19475 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19477 * macros.c: Integer and buffer overflow fixes.
19478 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19479 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19480 Use ptrdiff_t, not int, for sizes.
19481 Don't increment bufsize until after realloc succeeds.
19482 Check for size-calculation overflow.
19483 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19485 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19487 * lread.c: Integer overflow fixes.
19488 (read_integer): Radix is now EMACS_INT, not int,
19489 to improve quality of diagnostics for out-of-range radices.
19490 Calculate buffer size correctly for out-of-range radices.
19491 (read1): Check for integer overflow in radices, and in
19492 read-circle numbers.
19493 (read_escape): Avoid int overflow.
19494 (Fload, openp, read_buffer_size, read1)
19495 (substitute_object_recurse, read_vector, read_list, map_obarray):
19496 Use ptrdiff_t, not int, for sizes.
19497 (read1): Use EMACS_INT, not int, for sizes.
19498 Check for size overflow.
19500 * image.c (cache_image): Check for size arithmetic overflow.
19502 * lread.c: Integer overflow issues.
19503 (saved_doc_string_size, saved_doc_string_length)
19504 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19505 Now ptrdiff_t, not int.
19506 (read1): Don't assume doc string length fits in int. Check for
19507 out-of-range doc string lengths.
19508 (read_list): Don't assume file position fits in int.
19509 (read_escape): Check for hex character overflow.
19511 2011-06-22 Leo Liu <sdl.web@gmail.com>
19513 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19514 Move to minibuffer.el.
19516 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19518 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19519 The following patches are for when GLYPH_DEBUG && !XASSERT.
19520 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19521 * dispnew.c (flush_stdout):
19522 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19523 Mark as externally visible.
19524 * dispnew.c (check_window_matrix_pointers): Now static.
19525 * dispnew.c (window_to_frame_vpos):
19526 * xfns.c (unwind_create_frame):
19527 * xterm.c (x_check_font): Remove unused local.
19528 * scroll.c (CHECK_BOUNDS):
19529 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19530 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19531 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19532 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19533 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19535 (debug_method_add): Use va_list and vsprintf rather than relying
19536 on undefined behavior with wrong number of arguments.
19537 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19538 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19539 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19540 since we're not interested in debugging glyphs with old libraries.
19541 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19542 GCC 4.6.0's static checking.
19544 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19546 Integer overflow and signedness fixes (Bug#8873).
19547 A few related buffer overrun fixes, too.
19549 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19551 * dispextern.h (struct face.stipple):
19552 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19553 (x_bitmap_mask, x_allocate_bitmap_record)
19554 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19555 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19556 (x_create_bitmap_from_xpm_data):
19557 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19558 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19560 * xfaces.c (load_pixmap):
19561 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19562 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19563 (.bitmaps_last, struct x_output.icon_bitmap):
19564 Use ptrdiff_t, not int, for bitmap indexes.
19565 (x_allocate_bitmap_record): Check for size overflow.
19566 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19568 Use ptrdiff_t, not int, for overlay counts.
19569 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19570 * editfns.c (overlays_around, get_pos_property):
19571 * textprop.c (get_char_property_and_overlay):
19572 * xdisp.c (next_overlay_change, note_mouse_highlight):
19573 * xfaces.c (face_at_buffer_position):
19574 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19575 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19576 (Fnext_overlay_change, Fprevious_overlay_change)
19577 (mouse_face_overlay_overlaps, Foverlays_in):
19578 Use ptrdiff_t, not int, for sizes.
19579 (overlays_at, overlays_in): Check for size-calculation overflow.
19581 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19583 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19584 (x_session_initialize): Do not assume string length fits in int.
19586 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19587 This is unlikely, but can occur if DPI is outlandish.
19589 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19590 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19592 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19593 * xrdb.c (magic_file_p, search_magic_path):
19594 Omit last arg SUFFIX; it was always 0. All callers changed.
19595 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19597 * xfont.c (xfont_match): Avoid need for strlen.
19599 * xfns.c: Don't assume strlen fits in int.
19600 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19602 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19603 not unsigned long, as we prefer signed integers. All callers changed.
19604 Detect integer overflow in repeat count.
19605 (message_dolog): Don't assume print length fits in 39 bytes.
19606 (display_mode_element): Don't assume strlen fits in int.
19608 * termcap.c: Don't assume sizes fit in int and never overflow.
19609 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19610 (gobble_line): Check for size-calculation overflow.
19612 * minibuf.c (Fread_buffer):
19613 * lread.c (intern, intern_c_string):
19614 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19615 Don't assume string length fits in int.
19617 * keyboard.c (parse_tool_bar_item):
19618 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19620 * font.c: Don't assume string length fits in int.
19621 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19622 Use ptrdiff_t, not int.
19623 (font_intern_prop): Don't assume string length fits in int.
19624 Don't assume integer property fits in fixnum.
19625 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19627 * filelock.c: Fix some buffer overrun and integer overflow issues.
19628 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19629 Reformulate so as not to need the command string.
19630 Invoke gzip -cd rather than gunzip, as it's more portable.
19631 (lock_info_type, lock_file_1, lock_file):
19632 Don't assume pid_t and time_t fit in unsigned long.
19633 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19634 (current_lock_owner): Prefer signed type for sizes.
19635 Use memcpy, not strncpy, where memcpy is what is really wanted.
19636 Don't assume (via atoi) that time_t and pid_t fit in int.
19637 Check for time_t and/or pid_t out of range, e.g., via a network share.
19638 Don't alloca where an auto var works fine.
19640 * fileio.c: Fix some integer overflow issues.
19641 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19642 Don't assume string length fits in int.
19643 (directory_file_name): Don't assume string length fits in long.
19644 (make_temp_name): Don't assume pid fits in int, or that its print
19645 length is less than 20.
19647 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19649 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19651 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19653 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19654 We prefer signed integers, even for size calculations.
19656 * emacs.c: Don't assume string length fits in 'int'.
19657 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19658 (main): Don't invoke strlen when not needed.
19660 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19661 (XD_DEBUG_MESSAGE): Don't waste a byte.
19663 * callproc.c (getenv_internal_1, getenv_internal)
19664 (Fgetenv_internal):
19665 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19667 * lread.c (invalid_syntax): Omit length argument.
19668 All uses changed. This doesn't fix a bug, but it simplifies the
19669 code away from its former Hollerith-constant appearance, and it's
19670 one less 'int' to worry about when looking at integer-overflow issues.
19671 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19673 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19674 This didn't break anything, but it didn't help either.
19675 It's confusing to put a bogus integer in a place where the actual
19676 value does not matter.
19677 (LIST_END_P): Remove unused macro and its bogus comment.
19678 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19680 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19681 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19683 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19684 We prefer signed types, and the value cannot exceed the EMACS_INT
19685 range anyway (because otherwise the length would not be representable).
19686 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19687 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19688 This avoids a GCC warning when WIDE_EMACS_INT.
19690 * indent.c (sane_tab_width): New function.
19691 (current_column, scan_for_column, Findent_to, position_indentation)
19692 (compute_motion): Use it. This is just for clarity.
19693 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19695 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19697 * lisp.h (lint_assume): New macro.
19698 * composite.c (composition_gstring_put_cache):
19699 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19701 * editfns.c, insdel.c:
19702 Omit unnecessary forward decls, to simplify future changes.
19704 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19706 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19708 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19709 Use much-faster test for byte-length change.
19710 Don't assume string byte-length fits in 'int'.
19711 Check that character arg fits in 'int'.
19712 (mapcar1): Declare byte as byte, for clarity.
19714 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19716 * fns.c (concat): Catch string overflow earlier.
19717 Do not rely on integer wraparound.
19719 * dispextern.h (struct it.overlay_strings_charpos)
19720 (struct it.selective): Now EMACS_INT, not int.
19721 * xdisp.c (forward_to_next_line_start)
19722 (back_to_previous_visible_line_start)
19723 (reseat_at_next_visible_line_start, next_element_from_buffer):
19724 Don't arbitrarily truncate the value of 'selective' to int.
19726 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19728 * composite.c: Don't truncate sizes to 'int'.
19729 (composition_gstring_p, composition_reseat_it)
19730 (composition_adjust_point): Use EMACS_INT, not int.
19731 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19732 not EMACS_UINT, for indexes.
19734 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19736 * buffer.c: Include <verify.h>.
19737 (struct sortvec.priority, struct sortstr.priority):
19738 Now EMACS_INT, not int.
19739 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19740 (struct sortstr.size, record_overlay_string)
19741 (struct sortstrlist.size, struct sortlist.used):
19742 Don't truncate size to int.
19743 (record_overlay_string): Check for size-calculation overflow.
19744 (init_buffer_once): Check at compile-time, not run-time.
19746 2011-06-22 Jim Meyering <meyering@redhat.com>
19748 Don't leak an XBM-image-sized buffer
19749 * image.c (xbm_load): Free the image buffer after using it.
19751 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19754 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19755 that Sun C diagnosed.
19756 * fns.c (secure_hash): Fix pointer signedness issue.
19757 * intervals.c (static_offset_intervals): New function.
19758 (offset_intervals): Use it.
19760 2011-06-21 Leo Liu <sdl.web@gmail.com>
19763 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19766 * fns.c (secure_hash): Rename from crypto_hash_function and change
19767 the first arg to accept symbols.
19768 (Fsecure_hash): New primitive.
19769 (syms_of_fns): New symbols.
19771 2011-06-20 Deniz Dogan <deniz@dogan.se>
19773 * process.c (Fset_process_buffer): Clarify return value in
19776 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19778 * dispnew.c (add_window_display_history): Use BVAR.
19780 * xdisp.c (debug_method_add): Use BVAR.
19781 (check_window_end, dump_glyph_matrix, dump_glyph)
19782 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19784 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19787 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19788 check till after the cache is created in init_frame_faces.
19790 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19792 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19794 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19796 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19797 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19798 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19800 Improve buffer-overflow checking (Bug#8873).
19801 * fileio.c (Finsert_file_contents):
19802 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19803 Remove the old (too-loose) buffer overflow checks.
19804 They weren't needed, since make_gap checks for buffer overflow.
19805 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19806 The old code merely checked for Emacs fixnum overflow, and relied
19807 on undefined (wraparound) behavior. The new code avoids undefined
19808 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19810 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19811 Tune. Don't use wider integers than needed. Don't use alloca.
19812 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19814 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19816 * insdel.c, lisp.h (buffer_overflow): New function.
19817 (insert_from_buffer_1, replace_range, replace_range_2):
19818 * insdel.c (make_gap_larger):
19819 * editfns.c (Finsert_char):
19820 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19822 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19824 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19826 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19828 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19829 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19831 * fileio.c: Don't assume EMACS_INT fits in off_t.
19832 (emacs_lseek): New static function.
19833 (Finsert_file_contents, Fwrite_region): Use it.
19834 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19836 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19838 * fns.c: Don't overflow int when computing a list length.
19839 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19840 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19841 truncation on 64-bit hosts. Check for QUIT every
19842 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19843 faster and is responsive enough.
19844 (Flength): Report an error instead of overflowing an integer.
19845 (Fsafe_length): Return a float if the value is not representable
19846 as a fixnum. This shouldn't happen except in contrived situations.
19847 (Fnthcdr, Fsort): Don't assume list length fits in int.
19848 (Fcopy_sequence): Don't assume vector length fits in int.
19850 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19851 (header_size, word_size): New constants.
19852 (allocate_vectorlike): Don't check size overflow here.
19853 (allocate_vector): Check it here instead, since this is the only
19854 caller of allocate_vectorlike that could cause overflow.
19855 Check that the new vector's length is representable as a fixnum.
19857 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19858 The previous code was bogus. For example, next_almost_prime (32)
19859 returned 39, which is undesirable as it is a multiple of 3; and
19860 next_almost_prime (24) returned 25, which is a multiple of 5 so
19861 why was the code bothering to check for multiples of 7?
19863 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19865 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19867 Variadic C functions now count arguments with ptrdiff_t.
19868 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19869 Back then I didn't know that the Emacs coding style prefers signed int.
19870 Also, in the meantime I found a few more instances where arguments
19871 were being counted with int, which may truncate counts on 64-bit
19872 machines, or EMACS_INT, which may be unnecessarily wide.
19873 * lisp.h (struct Lisp_Subr.function.aMANY)
19874 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19875 Arg counts are now ptrdiff_t, not size_t.
19876 All variadic functions and their callers changed accordingly.
19877 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19878 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19879 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19880 * callint.c (Fcall_interactively): Check arg count for overflow,
19881 to avoid potential buffer overrun. Use signed char, not 'int',
19882 for 'varies' array, so that we needn't bother to check its size
19883 calculation for overflow.
19884 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19885 * eval.c (apply_lambda):
19886 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19887 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19888 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19890 * callint.c (Fcall_interactively): Don't use index var as event count.
19892 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19893 * mem-limits.h (SIZE): Remove; no longer used.
19895 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19897 Remove unnecessary casts.
19898 * xterm.c (x_term_init):
19899 * xfns.c (x_set_border_pixel):
19900 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19901 These aren't needed now that we assume ANSI C.
19903 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19904 It's more likely to cause problems (due to unsigned overflow)
19907 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19909 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19911 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19913 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19915 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19917 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19919 GLYPH_CODE_FACE returns EMACS_INT, not int.
19920 * dispextern.h (merge_faces):
19921 * xfaces.c (merge_faces):
19922 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19923 Don't assume EMACS_INT fits in int.
19925 * character.h (CHAR_VALID_P): Remove unused parameter.
19926 * fontset.c, lisp.h, xdisp.c: All uses changed.
19928 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19930 * fns.c (concat): Minor tuning based on overflow analysis.
19931 This doesn't fix any bugs. Use int to hold character, instead
19932 of constantly refetching from Emacs object. Use XFASTINT, not
19933 XINT, for value known to be a character. Don't bother comparing
19934 a single byte to 0400, as it's always less.
19936 * floatfns.c (Fexpt):
19937 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19939 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19942 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19944 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19945 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19946 incorrectly succeed when S was a string, because 4294967386 was
19947 truncated before it was used.
19949 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19950 Otherwise, an out-of-range integer could cause undefined behavior
19953 * composite.c: Use int, not EMACS_INT, for characters.
19954 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19955 EMACS_INT, for values that are known to be in character range.
19956 This doesn't fix any bugs but is the usual style inside Emacs and
19957 may generate better code on 32-bit machines.
19959 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19960 This is for reasons similar to the recent CHAR_STRING fix.
19961 * charset.c (Fencode_char): Check that character arg is actually
19962 a character. Pass an int to ENCODE_CHAR.
19963 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19964 wider than 'int', as a compile-time check to prevent future regressions
19967 * character.c (char_string): Remove unnecessary casts.
19969 Make sure a 64-bit char is never passed to CHAR_STRING.
19970 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19971 by silently ignoring the top 32 bits, allowing some values
19972 that were far too large to be valid characters.
19973 * character.h: Include <verify.h>.
19974 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19975 arguments are no wider than unsigned, as a compile-time check
19976 to prevent future regressions in this area.
19978 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19979 (Fsubst_char_in_region):
19981 * xdisp.c (decode_mode_spec_coding):
19982 Adjust to CHAR_STRING's new requirement.
19983 * editfns.c (Finsert_char, Fsubst_char_in_region):
19984 * fns.c (concat): Check that character args are actually
19985 characters. Without this test, these functions did the wrong
19986 thing with wildly out-of-range values on 64-bit hosts.
19988 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19989 These casts should not be needed on 32-bit hosts, either.
19990 * keyboard.c (read_char):
19991 * lread.c (Fload): Remove casts to unsigned.
19993 * lisp.h (UNSIGNED_CMP): New macro.
19994 This fixes comparison bugs on 64-bit hosts.
19995 (ASCII_CHAR_P): Use it.
19996 * casefiddle.c (casify_object):
19997 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19998 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19999 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20000 * dispextern.h (FACE_FROM_ID):
20001 * keyboard.c (read_char): Use UNSIGNED_CMP.
20003 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20004 not to EMACS_INT, to avoid GCC warning.
20006 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20008 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20009 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20010 isn't needed on 32-bit machines.
20012 * buffer.c (Fgenerate_new_buffer_name):
20013 Use EMACS_INT for count, not int.
20014 (advance_to_char_boundary): Return EMACS_INT, not int.
20016 * data.c (Qcompiled_function): Now static.
20018 * window.c (window_body_lines): Now static.
20020 * image.c (gif_load): Rename local to avoid shadowing.
20022 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20023 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20024 * alloc.c (make_save_value): Integer argument is now of type
20025 ptrdiff_t, not int.
20026 (mark_object): Use ptrdiff_t, not int.
20027 * lisp.h (pD): New macro.
20028 * print.c (print_object): Use it.
20030 * alloc.c: Use EMACS_INT, not int, to count objects.
20031 (total_conses, total_markers, total_symbols, total_vector_size)
20032 (total_free_conses, total_free_markers, total_free_symbols)
20033 (total_free_floats, total_floats, total_free_intervals)
20034 (total_intervals, total_strings, total_free_strings):
20035 Now EMACS_INT, not int. All uses changed.
20036 (Fgarbage_collect): Compute overall total using a double, so that
20037 integer overflow is less likely to be a problem. Check for overflow
20038 when converting back to an integer.
20039 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20040 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20041 These were 'int' variables that could overflow on 64-bit hosts;
20042 they were never used, so remove them instead of repairing them.
20043 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20044 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20045 Previously, this ceilinged at INT_MAX, but that doesn't work on
20047 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20049 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20050 (allocate_vectorlike): Check for ptrdiff_t overflow.
20051 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20052 when a (possibly-narrower) signed value would do just as well.
20053 We prefer using signed arithmetic, to avoid comparison confusion.
20055 * alloc.c: Catch some string size overflows that we were missing.
20056 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20057 for convenience in STRING_BYTES_MAX.
20058 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20059 The definition here is exact; the one in lisp.h was approximate.
20060 (allocate_string_data): Check for string overflow. This catches
20061 some instances we weren't catching before. Also, it catches
20062 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20063 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20064 and ptrdiff_t and EMACS_INT are both 64 bits.
20066 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20067 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20068 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20070 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20072 * alloc.c (Fmake_string): Check for out-of-range init.
20074 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20076 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20078 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20080 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20081 xg_get_default_scrollbar_width.
20083 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20084 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20085 (style_changed_cb): Call update_theme_scrollbar_width and call
20086 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20087 all frames (Bug#8505).
20088 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20089 Call gtk_window_set_resizable if HAVE_GTK3.
20090 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20091 and height if HAVE_GTK3 (Bug#8505).
20092 (scroll_bar_width_for_theme): New variable.
20093 (update_theme_scrollbar_width): New function.
20094 (xg_get_default_scrollbar_width): Move code to
20095 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20096 (xg_initialize): Call update_theme_scrollbar_width.
20098 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20100 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20102 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20104 * frame.c (make_frame): Call other_buffer_safely instead of
20107 * window.c (temp_output_buffer_show): Call display_buffer with
20108 second argument Vtemp_buffer_show_specifiers and reset latter
20109 immediately after the call.
20110 (Vtemp_buffer_show_specifiers): New variable.
20111 (auto_window_vscroll_p, next_screen_context_lines)
20112 (Vscroll_preserve_screen_position): Remove leading asterisks from
20115 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20117 Fix minor problems found by GCC 4.6.0 static checking.
20118 * buffer.c (Qclone_number): Remove for now, as it's unused.
20119 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20120 (record_buffer): Remove unused local.
20121 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20122 (set_frame_buffer_list): Remove; unused.
20123 * frame.h (other_visible_frames): Remove decl.
20124 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20125 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20126 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20128 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20129 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20130 Define only if HAVE_GPM.
20131 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20132 (update_hints_inhibit): Remove; never set. All uses removed.
20133 * widgetprv.h (emacsFrameClassRec): Remove decl.
20134 * window.c (delete_deletable_window): Now returns void, since it
20135 wasn't returning anything.
20136 (compare_window_configurations): Remove unused locals.
20137 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20138 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20139 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20140 the same widths as pointers. This follows up on the 2011-05-06 patch.
20141 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20142 * xterm.h: Likewise.
20143 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20145 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20147 * makefile.w32-in: Update dependencies.
20148 (LISP_H): Add lib/intprops.h.
20150 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20152 * image.c (gif_load): Add animation frame delay to the metadata.
20153 (syms_of_image): Use DEFSYM. New symbol `delay'.
20155 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20157 * window.c (delete_deletable_window): Re-add.
20158 (Fset_window_configuration): Rewrite to handle dead buffers and
20159 consequently deletable windows.
20160 (window_tree, Fwindow_tree): Remove. Supply functionality in
20162 (compare_window_configurations): Simplify code.
20164 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20166 * image.c (imagemagick_load_image): Fix type mismatch.
20167 (Fimagemagick_types): Likewise.
20169 * window.h (replace_buffer_in_windows): Declare.
20171 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20173 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20174 Qclone_number. Remove external declaration of Qdelete_window.
20175 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20177 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20178 Run Qbuffer_list_update_hook if allowed.
20179 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20180 buffer list implementation.
20181 (other_buffer_safely): New function.
20182 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20183 calls to replace_buffer_in_windows and
20184 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20186 (record_buffer): Inhibit quitting and rewrite using quittable
20187 functions. Run Qbuffer_list_update_hook if allowed.
20188 (Frecord_buffer, Funrecord_buffer): New functions.
20189 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20190 Move switch-to-buffer to window.el.
20191 (bury-buffer): Move to window.el.
20192 (Vbuffer_list_update_hook): New variable.
20194 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20197 * window.h (resize_frame_windows): Move up in code.
20198 (Fwindow_frame): Remove EXFUN.
20199 (replace_buffer_in_all_windows): Remove prototype.
20200 (replace_buffer_in_windows_safely): Add prototype.
20202 * window.c: Declare Qdelete_window static again. Move down
20203 declaration of select_count.
20204 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20205 (Fother_window): Move to window.el.
20206 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20207 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20208 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20210 (replace_buffer_in_windows): Implement by calling
20211 Qreplace_buffer_in_windows.
20212 (replace_buffer_in_all_windows): Remove with some functionality
20213 moved into replace_buffer_in_windows_safely.
20214 (replace_buffer_in_windows_safely): New function.
20215 (select_window_norecord, select_frame_norecord): Move in front
20216 of run_window_configuration_change_hook. Remove now obsolete
20218 (Fset_window_buffer): Rewrite doc-string.
20219 Call Qrecord_window_buffer.
20220 (keys_of_window): Move binding for other-window to window.el.
20222 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20224 * dispextern.h (struct image): Replace data member, whose int_val
20225 and ptr_val fields were not used by anything, with a single
20228 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20229 (gif_clear_image, gif_load, imagemagick_load_image)
20230 (gs_clear_image, gs_load): Callers changed.
20232 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20234 * buffer.h: Include <time.h>, for time_t.
20235 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20237 Fix minor problems found by static checking.
20239 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20241 Make identifiers static if they are not used in other modules.
20242 * data.c (Qcompiled_function, Qframe, Qvector):
20243 * image.c (QimageMagick, Qsvg):
20244 * minibuf.c (Qmetadata):
20245 * window.c (resize_window_check, resize_root_window): Now static.
20246 * window.h (resize_window_check, resize_root_window): Remove decls.
20248 * window.c (window_deletion_count, delete_deletable_window):
20250 (window_body_lines): Now static.
20251 (Fdelete_other_windows_internal): Mark vars as initialized.
20252 Make sure 'resize_failed' is initialized.
20253 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20254 (resize_window_apply): Remove unused local.
20255 * window.h (delete_deletable_window): Remove decl.
20257 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20258 (imagemagick_load_image): Fix pointer signedness problem by changing
20259 last arg from unsigned char * to char *. All uses changed.
20260 Also, fix a local for similar reasons.
20261 Remove unused locals. Remove locals to avoid shadowing.
20262 (fn_rsvg_handle_free): Remove; unused.
20263 (svg_load, svg_load_image): Fix pointer signedness problem.
20264 (imagemagick_load_image): Don't use garbage pointer image_wand.
20266 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20268 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20270 * image.c (gif_load): Fix omitted cast error introduced by
20273 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20275 * window.h (resize_proportionally, orig_total_lines)
20276 (orig_top_line): Remove from window structure.
20277 (set_window_height, set_window_width, change_window_heights)
20278 (Fdelete_window): Remove prototypes.
20279 (resize_frame_windows): Remove duplicate declaration.
20281 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20283 * window.h (resize_frame_windows, resize_window_check)
20284 (delete_deletable_window, resize_root_window)
20285 (resize_frame_windows): Declare prototypes.
20287 * window.c (resize_window_apply): Make definition be "static" to
20288 match the prototype.
20290 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20292 * window.c: Remove declarations of Qwindow_size_fixed,
20293 window_min_size_1, window_min_size_2, window_min_size,
20294 size_window, window_fixed_size_p, enlarge_window, delete_window.
20295 Remove static from declaration of Qdelete_window, it's
20296 temporarily needed by Fbury_buffer.
20297 (replace_window): Don't assign orig_top_line and
20299 (Fdelete_window, delete_window): Remove. Window deletion is
20300 handled by window.el.
20301 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20302 Replace Fdelete_window calls with calls to Qdelete_window.
20303 (Fdelete_other_windows): Remove. Deleting other windows is
20304 handled by window.el.
20305 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20306 handled in window.el.
20307 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20308 Window minimum sizes are handled in window.el.
20309 (shrink_windows, size_window, set_window_height)
20310 (set_window_width, change_window_heights, window_height)
20311 (window_width, CURBEG, CURSIZE, enlarge_window)
20312 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20313 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20314 handled in window.el.
20315 (make_dummy_parent): Rename to make_parent_window and give it a
20316 second argument horflag.
20317 (make_window): Don't set resize_proportionally any more.
20318 (Fsplit_window): Remove. Windows are split in window.el.
20319 (save_restore_action, save_restore_orig_size)
20320 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20321 Resize mini windows in window.el.
20322 (grow_mini_window, shrink_mini_window): Implement by calling
20323 Qresize_root_window_vertically, resize_window_check and
20324 resize_window_apply.
20325 (saved_window, Fset_window_configuration, save_window_save):
20326 Do not handle orig_top_line, orig_total_lines, and
20327 resize_proportionally.
20328 (window_min_height, window_min_width): Move to window.el.
20329 (keys_of_window): Move bindings for delete-other-windows,
20330 split-window, delete-window and enlarge-window to window.el.
20332 * buffer.c: Temporarily extern Qdelete_window.
20333 (Fbury_buffer): Temporarily call Qdelete_window instead of
20334 Fdelete_window (Fbury_buffer will move to window.el soon).
20336 * frame.c (set_menu_bar_lines_1): Remove code handling
20337 orig_top_line and orig_total_lines.
20339 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20340 set_window_height but set heights directly.
20341 (change_frame_size_1): Use resize_frame_windows.
20343 * xdisp.c (init_xdisp): Don't use set_window_height but set
20346 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20347 Use resize_frame_windows instead of change_window_heights and run
20348 run_window_configuration_change_hook.
20350 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20351 instead of change_window_heights and run
20352 run_window_configuration_change_hook.
20354 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20356 * window.c (replace_window): Rename second argument REPLACEMENT to
20357 NEW. New third argument SETFLAG. Rewrite.
20358 (delete_window, make_dummy_parent): Call replace_window with
20360 (window_list_1): Move down in code.
20361 (run_window_configuration_change_hook): Move set_buffer part
20362 before select_frame_norecord part in order to unwind correctly.
20363 Rename count1 to count.
20364 (recombine_windows, delete_deletable_window, resize_root_window)
20365 (Fdelete_other_windows_internal)
20366 (Frun_window_configuration_change_hook, make_parent_window)
20367 (resize_window_check, resize_window_apply, Fresize_window_apply)
20368 (resize_frame_windows, Fsplit_window_internal)
20369 (Fdelete_window_internal, Fresize_mini_window_internal):
20371 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20373 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20375 * window.h (window): Add some new members to window structure -
20376 normal_lines, normal_cols, new_total, new_normal, clone_number,
20377 splits, nest, prev_buffers, next_buffers.
20378 (WINDOW_TOTAL_SIZE): Move here from window.c.
20379 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20381 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20383 (make_dummy_parent): Set new members of windows structure.
20384 (make_window): Move down in code. Handle new members of window
20386 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20387 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20388 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20389 (Fset_window_prev_buffers, Fwindow_next_buffers)
20390 (Fset_window_next_buffers, Fset_window_clone_number):
20392 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20393 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20395 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20396 Argument WINDOW can be now internal window too.
20397 (Fwindow_use_time): Move up in code.
20398 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20399 Rewrite doc-string.
20400 (Fset_window_configuration, saved_window)
20401 (Fcurrent_window_configuration, save_window_save): Handle new
20402 members of window structure.
20403 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20404 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20405 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20406 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20407 Qget_mru_window, Qresize_root_window,
20408 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20409 Qauto_buffer_name; staticpro them.
20411 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20413 * window.c (Fwindow_total_size, Fwindow_left_column)
20414 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20415 (Fwindow_list_1): New functions.
20416 (window_box_text_cols): Replace with window_body_cols.
20417 (Fwindow_width, Fscroll_left, Fscroll_right):
20418 Use window_body_cols instead of window_box_text_cols.
20419 (delete_window, Fset_window_configuration):
20420 Call delete_all_subwindows with window as argument.
20421 (delete_all_subwindows): Take a window as argument and not a
20422 structure. Rewrite.
20423 (window_loop): Remove handling of GET_LRU_WINDOW and
20424 GET_LARGEST_WINDOW.
20425 (Fget_lru_window, Fget_largest_window): Move to window.el.
20427 * window.h: Extern window_body_cols instead of
20428 window_box_text_cols. delete_all_subwindows now takes a
20429 Lisp_Object as argument.
20431 * indent.c (compute_motion, Fcompute_motion):
20432 Use window_body_cols instead of window_box_text_cols.
20434 * frame.c (delete_frame): Call delete_all_subwindows with root
20435 window as argument.
20437 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20439 * fns.c (Fputhash): Document return value.
20441 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20443 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20445 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20447 Cons<->int and similar integer overflow fixes (Bug#8794).
20449 Check for overflow when converting integer to cons and back.
20450 * charset.c (Fdefine_charset_internal, Fdecode_char):
20451 Use cons_to_unsigned to catch overflow.
20452 (Fencode_char): Use INTEGER_TO_CONS.
20453 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20454 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20455 * data.c (long_to_cons, cons_to_long): Remove.
20456 (cons_to_unsigned, cons_to_signed): New functions.
20457 These signal an error for invalid or out-of-range values.
20458 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20459 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20460 * font.c (Ffont_variation_glyphs):
20461 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20462 * lisp.h: Include <intprops.h>.
20463 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20464 (cons_to_signed, cons_to_unsigned): New decls.
20465 (long_to_cons, cons_to_long): Remove decls.
20466 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20467 (Fprimitive_undo): Use CONS_TO_INTEGER.
20468 * xfns.c (Fx_window_property): Likewise.
20469 * xselect.c: Include <limits.h>.
20470 (x_own_selection, selection_data_to_lisp_data):
20471 Use INTEGER_TO_CONS.
20472 (x_handle_selection_request, x_handle_selection_clear)
20473 (x_get_foreign_selection, Fx_disown_selection_internal)
20474 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20475 (lisp_data_to_selection_data): Use cons_to_unsigned.
20476 (x_fill_property_data): Use cons_to_signed.
20477 Report values out of range.
20479 Check for buffer and string overflow more precisely.
20480 * buffer.h (BUF_BYTES_MAX): New macro.
20481 * lisp.h (STRING_BYTES_MAX): New macro.
20482 * alloc.c (Fmake_string):
20483 * character.c (string_escape_byte8):
20484 * coding.c (coding_alloc_by_realloc):
20485 * doprnt.c (doprnt):
20486 * editfns.c (Fformat):
20488 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20489 since they may not be the same number.
20490 * editfns.c (Finsert_char):
20491 * fileio.c (Finsert_file_contents):
20492 Likewise for BUF_BYTES_MAX.
20494 * image.c: Use ptrdiff_t, not int, for sizes.
20495 (slurp_file): Switch from int to ptrdiff_t.
20497 (slurp_file): Check that file size fits in both size_t (for
20498 malloc) and ptrdiff_t (for sanity and safety).
20500 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20501 if b->modtime has its maximal value.
20503 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20505 Don't assume time_t can fit into int.
20506 * buffer.h (struct buffer.modtime): Now time_t, not int.
20507 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20508 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20510 Minor fixes for signed vs unsigned integers.
20511 * character.h (MAYBE_UNIFY_CHAR):
20512 * charset.c (maybe_unify_char):
20513 * keyboard.c (read_char, reorder_modifiers):
20514 XINT -> XFASTINT, since the integer must be nonnegative.
20515 * ftfont.c (ftfont_spec_pattern):
20516 * keymap.c (access_keymap, silly_event_symbol_error):
20517 XUINT -> XFASTINT, since the integer must be nonnegative.
20518 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20519 since it makes no difference and we prefer signed.
20520 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20521 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20524 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20526 * window.h (Fwindow_frame): Declare.
20528 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20530 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20531 (SPARE_MEMORY): Always define.
20532 (LARGE_REQUEST): Remove.
20533 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20535 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20537 * lisp.h: Move EXFUNS for Fframe_root_window,
20538 Fframe_first_window and Fset_frame_selected_window to window.h.
20540 * window.h: Move EXFUNS for Fframe_root_window,
20541 Fframe_first_window and Fset_frame_selected_window here from
20544 * frame.c (Fwindow_frame, Fframe_first_window)
20545 (Fframe_root_window, Fframe_selected_window)
20546 (Fset_frame_selected_window): Move to window.c.
20547 (Factive_minibuffer_window): Move to minibuf.c.
20548 (Fother_visible_frames_p): New function.
20550 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20552 * window.c (decode_window, decode_any_window): Move up in code.
20553 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20554 (inhibit_frame_unsplittable): Remove unused variable.
20555 (Fwindow_buffer): Move up and rewrite doc-string.
20556 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20557 (Fwindow_prev): New functions.
20558 (Fwindow_frame): Move here from frame.c. Accept any window as
20560 (Fframe_root_window, Fframe_first_window)
20561 (Fframe_selected_window): Move here from frame.c. Accept frame
20562 or arbitrary window as argument. Update doc-strings.
20563 (Fminibuffer_window): Move up in code.
20564 (Fwindow_minibuffer_p): Move up in code and simplify.
20565 (Fset_frame_selected_window): Move here from frame.c.
20567 (Fselected_window, select_window, Fselect_window): Move up in
20568 code. Minor doc-string fixes.
20570 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20572 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20573 Do not assume that spare memory exists; that assumption is valid
20574 only if SYSTEM_MALLOC.
20575 (LARGE_REQUEST): New macro, so that the issue of large requests
20576 is separated from the issue of spare memory.
20578 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20580 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20583 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20585 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20588 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20590 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20592 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20594 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20595 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20597 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20599 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20601 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20603 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20604 (x_clipboard_manager_save): Add return value.
20605 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20606 New error handlers.
20607 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20608 Obey Vx_select_enable_clipboard_manager. Catch errors in
20609 x_clipboard_manager_save (Bug#8779).
20610 (Vx_select_enable_clipboard_manager): New variable.
20611 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20613 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20615 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20617 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20619 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20620 in the current matrix if keep_current_p is non-zero.
20622 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20624 * bidi.c (bidi_level_of_next_char): Fix last change.
20626 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20628 Support bidi reordering of text covered by display properties.
20630 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20631 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20632 (bidi_cache_search, bidi_cache_iterator_state)
20633 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20634 (bidi_level_of_next_char, bidi_move_to_visually_next):
20635 Support character positions inside a run of characters covered by a
20637 (bidi_paragraph_init, bidi_resolve_explicit_1)
20638 (bidi_level_of_next_char): Call bidi_fetch_char and
20639 bidi_fetch_char_advance instead of FETCH_CHAR and
20640 FETCH_CHAR_ADVANCE.
20641 (bidi_init_it): Initialize new members.
20642 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20644 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20645 instead of using explicit *_CHAR codes.
20646 (bidi_resolve_explicit, bidi_resolve_weak):
20647 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20648 bidirectional text is supported only in multibyte buffers.
20649 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20650 it to initialize the frame_window_p member of struct bidi_it.
20651 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20652 (bidi_resolve_explicit, bidi_resolve_weak)
20653 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20654 bidi_it->nchars is non-positive.
20655 (bidi_level_of_next_char): Don't try to lookup the cache for the
20656 next/previous character if nothing is cached there yet, or if we
20657 were just reseat()'ed to a new position.
20659 * xdisp.c (set_cursor_from_row): Set start and stop points
20660 according to the row's direction when priming the loop that looks
20661 for the glyph on which to display cursor.
20662 (single_display_spec_intangible_p): Function deleted.
20663 (display_prop_intangible_p): Reimplement to call
20664 handle_display_spec instead of single_display_spec_intangible_p.
20665 Accept 3 additional arguments needed by handle_display_spec.
20666 This fixes incorrect cursor motion across display property with complex
20667 values: lists, `(when COND...)' forms, etc.
20668 (single_display_spec_string_p): Support property values that are
20669 lists with the argument STRING its top-level element.
20670 (display_prop_string_p): Fix the condition for processing a
20671 property that is a list to be consistent with handle_display_spec.
20672 (handle_display_spec): New function, refactored from the
20673 last portion of handle_display_prop.
20674 (compute_display_string_pos): Accept additional argument
20675 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20676 value of a `display' property is a "replacing spec".
20677 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20678 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20679 the display property, but just return a value indicating whether
20680 the display property will replace the characters it covers.
20681 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20682 frame_window_p members of struct bidi_it.
20683 (compute_display_string_pos, compute_display_string_end):
20685 (push_it): Accept second argument POSITION, where pop_it should
20686 jump to continue iteration.
20687 (reseat_1): Initialize bidi_it.disp_pos.
20689 * keyboard.c (adjust_point_for_property): Adjust the call to
20690 display_prop_intangible_p to its new signature.
20692 * dispextern.h (struct bidi_it): New member frame_window_p.
20693 (bidi_init_it): Update prototypes.
20694 (display_prop_intangible_p): Update prototype.
20695 (compute_display_string_pos, compute_display_string_end):
20696 Declare prototypes.
20697 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20700 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20702 Malloc failure behavior now depends on size of allocation.
20703 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20704 * lisp.h: Change signatures accordingly.
20705 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20706 All callers changed. (Bug#8762)
20708 * gnutls.c: Use Emacs's memory allocators.
20709 Without this change, the gnutls library would invoke malloc etc.
20710 directly, which causes problems on non-SYNC_INPUT hosts, and which
20711 runs afoul of improving memory_full behavior. (Bug#8761)
20712 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20713 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20714 xfree instead of the default malloc, realloc, free.
20715 (Fgnutls_boot): No need to check for memory allocation failure,
20716 since xmalloc does that for us.
20718 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20719 * category.c (hash_get_category_set):
20720 * ccl.c (ccl_driver):
20721 * charset.c (Fdefine_charset_internal):
20722 * charset.h (struct charset.hash_index):
20723 * composite.c (get_composition_id, gstring_lookup_cache)
20724 (composition_gstring_put_cache):
20725 * composite.h (struct composition.hash_index):
20726 * dispextern.h (struct image.hash):
20727 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20728 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20729 (hashfn_equal, hashfn_user_defined, make_hash_table)
20730 (maybe_resize_hash_table, hash_lookup, hash_put)
20731 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20732 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20733 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20734 * image.c (make_image, search_image_cache, lookup_image)
20735 (xpm_put_color_table_h):
20736 * lisp.h (struct Lisp_Hash_Table):
20737 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20738 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20739 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20740 * alloc.c (allocate_vectorlike):
20741 Check for overflow in vector size calculations.
20742 * ccl.c (ccl_driver):
20743 Check for overflow when converting EMACS_INT to int.
20744 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20745 need to be updated by these changes.
20746 * fns.c (make_hash_table, maybe_resize_hash_table):
20747 Check for integer overflow with large hash tables.
20748 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20749 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20750 (SXHASH_REDUCE): New macro.
20751 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20752 Use it instead of discarding useful hash info with large hash values.
20753 (sxhash_float): New function.
20754 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20755 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20756 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20757 Rewrite to use FIXNUM_BITS, as this simplifies things.
20758 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20759 Adjust signatures to match updated version of code.
20760 (consing_since_gc): Now EMACS_INT, since a single hash table can
20761 use more than INT_MAX bytes.
20763 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20765 Make it possible to build with GCC-4.6+ -O2 -flto.
20767 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20769 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20771 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20772 Call minibuffer-inactive-mode.
20774 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20776 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20777 Update dependencies.
20779 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20781 * data.c (init_data): Remove code for UTS, this system is not
20784 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20786 Don't force ./temacs to start in terminal mode.
20788 * frame.c (make_initial_frame): Initialize faces in all cases, not
20789 only when CANNOT_DUMP is defined.
20790 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20792 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20794 * dispnew.c (add_window_display_history): Use const for the string
20795 pointer. Remove declaration, not needed.
20797 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20799 Use 'inline', not 'INLINE'.
20800 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20801 * alloc.c, fontset.c (INLINE): Remove.
20802 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20803 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20804 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20805 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20806 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20808 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20810 Make it possible to run ./temacs.
20812 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20813 syms_of_callproc does the same thing. Remove test for
20814 "initialized", do it in the caller.
20815 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20817 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20819 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20820 (read_minibuf): Use get_minibuffer.
20821 (syms_of_minibuf): Use DEFSYM.
20822 (Qmetadata): New var.
20823 * data.c (Qbuffer): Don't make it static.
20824 (syms_of_data): Use DEFSYM.
20826 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20828 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20829 (CCL_CODE_MIN): New macro.
20831 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20833 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20835 * eval.c (Qdebug): Now static.
20836 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20837 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20838 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20840 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20842 * image.c: Various fixes to ImageMagick code comments.
20843 (Fimagemagick_types): Doc fix.
20845 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20847 Minor fixes prompted by GCC 4.6.0 warnings.
20849 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20851 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20852 (x_clipboard_manager_save_all): Move extern decl to ...
20853 * xterm.h: ... here, so that it can be checked for consistency.
20855 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20857 * xselect.c (x_clipboard_manager_save_frame)
20858 (x_clipboard_manager_save_all): New functions.
20859 (Fx_clipboard_manager_save): Lisp function deleted.
20861 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20862 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20864 * xterm.h: Update prototype.
20866 2011-05-28 William Xu <william.xwl@gmail.com>
20868 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20869 exiting (Bug#8239).
20871 2011-05-28 Jim Meyering <meyering@redhat.com>
20873 Avoid a sign-extension bug in crypto_hash_function.
20874 * fns.c (to_uchar): Define.
20875 (crypto_hash_function): Use it to convert some newly-signed
20876 variables to unsigned, to avoid sign-extension bugs. For example,
20877 without this change, (md5 "truc") would evaluate to
20878 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20879 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20880 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20882 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20884 Integer overflow fixes.
20886 * dbusbind.c: Serial number integer overflow fixes.
20887 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20888 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20889 to hold a serial number that is too large for a fixnum.
20890 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20891 Check for serial numbers out of range. Decode any serial number
20892 that was so large that it became a float. (Bug#8722)
20894 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20895 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20896 Use XFASTINT rather than XUINT when numbers are nonnegative.
20897 (xd_append_arg, Fdbus_method_return_internal):
20898 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20899 arguments, check that Lisp number is nonnegative, rather than
20900 silently wrapping negative numbers around. (Bug#8722)
20901 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20904 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20906 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20908 ccl: Add integer overflow checks.
20909 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20910 (IN_INT_RANGE): New macros.
20911 (ccl_driver): Use them to check for integer overflow when
20912 decoding a CCL program. Many of the new checks are whether XINT (x)
20913 fits in int; it doesn't always, on 64-bit hosts. The new version
20914 doesn't catch all possible integer overflows, but it's an
20915 improvement. (Bug#8719)
20917 * alloc.c (make_event_array): Use XINT, not XUINT.
20918 There's no need for unsigned here.
20920 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20921 This follows up to the 2011-05-06 change that substituted uintptr_t
20922 for EMACS_INT. This case wasn't caught back then.
20924 Rework Fformat to avoid integer overflow issues.
20925 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20926 now (part of C89). Include <verify.h>.
20927 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20928 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20929 (Fformat): Avoid the prepass trying to compute sizes; it was only
20930 approximate and thus did not catch overflow reliably. Instead, walk
20931 through the format just once, formatting and computing sizes as we go,
20932 checking for integer overflow at every step, and allocating a larger
20933 buffer as needed. Keep track separately whether the format is
20934 multibyte. Keep only the most-recently calculated precision, rather
20935 than them all. Record whether each argument has been converted to
20936 string. Use EMACS_INT, not int, for byte and char and arg counts.
20937 Support field widths and precisions larger than INT_MAX. Avoid
20938 sprintf's undefined behavior with conversion specifications such as %#d
20939 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20940 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20941 formatting out-of-range floating point numbers with int
20942 formats. (Bug#8668)
20944 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20946 * data.c: Avoid integer truncation in expressions involving floats.
20947 * data.c: Include <intprops.h>.
20948 (arith_driver): When there's an integer overflow in an expression
20949 involving floating point, convert the integers to floating point
20950 so that the resulting value does not suffer from catastrophic
20951 integer truncation. For example, on a 64-bit host (* 4
20952 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20953 Do not rely on undefined behavior after integer overflow.
20955 merge count_size_as_multibyte, parse_str_to_multibyte
20956 * character.c, character.h (count_size_as_multibyte):
20957 Rename from parse_str_to_multibyte; all uses changed.
20958 Check for integer overflow.
20959 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20960 since it's now a duplicate of the other. This is more of
20961 a character than a buffer op, so better that it's in character.c.
20962 * fns.c, print.c: Adjust to above changes.
20964 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20966 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20968 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20970 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20971 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20972 (x_clipboard_manager_save): Now static.
20973 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20975 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20976 (crypto_hash_function): Now static.
20977 Fix pointer signedness problems. Avoid unnecessary initializations.
20979 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20981 * termhooks.h (Vselection_alist): Make it terminal-local.
20983 * terminal.c (create_terminal): Initialize it.
20985 * xselect.c: Support for clipboard managers.
20986 (Vselection_alist): Move to termhooks.h as terminal-local var.
20987 (LOCAL_SELECTION): New macro.
20988 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20989 (symbol_to_x_atom): Remove gratuitous arg.
20990 (x_handle_selection_request, lisp_data_to_selection_data)
20991 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20992 (x_own_selection, x_get_local_selection, x_convert_selection):
20993 New arg, specifying work frame. Use terminal-local Vselection_alist.
20994 (some_frame_on_display): Delete unused function.
20995 (Fx_own_selection_internal, Fx_get_selection_internal)
20996 (Fx_disown_selection_internal, Fx_selection_owner_p)
20997 (Fx_selection_exists_p): New optional frame arg.
20998 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20999 (x_handle_selection_clear): Don't treat other terminals with the
21000 same keyboard specially. Use the terminal-local Vselection_alist.
21001 (x_clear_frame_selections): Use Frun_hook_with_args.
21003 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21005 * xterm.h: Add support for those atoms.
21007 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
21009 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21010 (converted_selections, conversion_fail_tag): New global variables.
21011 (x_selection_request_lisp_error): Free the above.
21012 (x_get_local_selection): Remove unnecessary code.
21013 (x_reply_selection_request): Args changed; handle arbitrary array
21014 of converted selections stored in converted_selections.
21015 Separate the XChangeProperty and SelectionNotify steps.
21016 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21017 (x_convert_selection): New function.
21018 (x_handle_selection_event): Simplify.
21019 (x_get_foreign_selection): Don't ignore incoming requests while
21020 waiting for an answer; this will fail when we implement
21021 SAVE_TARGETS, and seems unnecessary anyway.
21022 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21023 (Vx_sent_selection_functions): Doc fix.
21025 2011-05-26 Leo Liu <sdl.web@gmail.com>
21027 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21029 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21031 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21033 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21034 for fringe update if it has periodic bitmap.
21035 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21036 and fringe_bitmap_periodic_p.
21038 * fringe.c (get_fringe_bitmap_data): New function.
21039 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21040 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21041 row. Mark glyph row for fringe update if periodicity changed.
21043 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21044 for fringe update unless it has periodic bitmap.
21046 2011-05-25 Kenichi Handa <handa@m17n.org>
21048 * xdisp.c (get_next_display_element): Set correct it->face_id for
21049 a static composition.
21051 2011-05-24 Leo Liu <sdl.web@gmail.com>
21054 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21056 * fns.c (crypto_hash_function, Fsha1): New function.
21057 (Fmd5): Use crypto_hash_function.
21058 (syms_of_fns): Add Ssha1.
21060 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21062 * gnutls.c: Remove unused macros.
21063 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21064 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21065 Remove macros that are defined and never used.
21066 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21068 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21070 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21071 (Fx_get_selection_internal): Minor cleanup.
21072 (Fx_own_selection_internal): Rename arguments for consistency with
21075 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21077 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21079 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21081 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21083 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21085 * dispnew.c (scrolling_window): Don't exclude the case that the
21086 last enabled row in the desired matrix touches the bottom boundary.
21088 2011-05-21 Glenn Morris <rgm@gnu.org>
21090 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21091 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21092 and add some more files.
21094 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21096 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21097 report_file_error introduced by the change from 2011-05-07.
21099 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21101 * systime.h (Time): Define only if emacs is defined.
21102 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21103 where the include path doesn't have X11/X.h by default. See
21104 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21106 2011-05-20 Kenichi Handa <handa@m17n.org>
21108 * composite.c (find_automatic_composition): Fix previous change.
21110 2011-05-20 Glenn Morris <rgm@gnu.org>
21112 * lisp.mk: New file, split from Makefile.in.
21113 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21114 (shortlisp): Remove.
21115 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21117 2011-05-19 Glenn Morris <rgm@gnu.org>
21119 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21120 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21121 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21122 (lisp): Set the order to that of loadup.el.
21123 (shortlisp): Make it a copy of $lisp.
21124 (SOME_MACHINE_LISP): Remove.
21125 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21126 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21128 2011-05-18 Kenichi Handa <handa@m17n.org>
21130 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21131 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21132 (find_automatic_composition): Mostly rewrite for efficiency.
21134 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21136 * makefile.w32-in: Update dependencies.
21138 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21140 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21141 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21143 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21145 Fix some integer overflow issues, such as string length overflow.
21147 * insdel.c (count_size_as_multibyte): Check for string overflow.
21149 * character.c (lisp_string_width): Check for string overflow.
21150 Use EMACS_INT, not int, for string indexes and lengths; in
21151 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21152 the resulting string length overflows an EMACS_INT; instead,
21153 report a string overflow if no precision given. When checking for
21154 precision exhaustion, use a check that cannot possibly have
21155 integer overflow. (Bug#8675)
21156 * character.h (lisp_string_width): Adjust to new signature.
21158 * alloc.c (string_overflow): New function.
21159 (Fmake_string): Use it. This doesn't change behavior, but saves
21160 a few bytes and will simplify future changes.
21161 * character.c (string_escape_byte8): Likewise.
21162 * lisp.h (string_overflow): New decl.
21164 Fixups, following up to the user-interface timestamp change.
21165 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21166 for UI timestamps, instead of unsigned long.
21167 * msdos.c (mouse_get_pos): Likewise.
21168 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21169 * w32gui.h (Time): Define by including "systime.h" rather than by
21170 declaring it ourselves. (Bug#8664)
21172 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21173 * image.c (clear_image_cache): Likewise.
21175 * term.c (term_mouse_position): Don't assume time_t wraparound.
21177 Be more systematic about user-interface timestamps.
21178 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21179 and sometimes 'EMACS_UINT', to represent these timestamps.
21180 This change causes it to use 'Time' uniformly, as that's what X uses.
21181 This makes the code easier to follow, and makes it easier to catch
21182 integer overflow bugs such as Bug#8664.
21183 * frame.c (Fmouse_position, Fmouse_pixel_position):
21184 Use Time, not unsigned long, for user-interface timestamps.
21185 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21186 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21187 * keyboard.h (last_event_timestamp): Likewise.
21188 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21189 * menu.h (xmenu_show): Likewise.
21190 * term.c (term_mouse_position): Likewise.
21191 * termhooks.h (struct input_event.timestamp): Likewise.
21192 (struct terminal.mouse_position_hook): Likewise.
21193 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21194 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21195 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21196 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21197 what it was before.
21198 * menu.h, termhooks.h: Include "systime.h", for Time.
21200 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21201 Don't assume that the difference between two unsigned long values
21202 can fit into an integer. At this point, we know button_down_time
21203 <= event->timestamp, so the difference must be nonnegative, so
21204 there's no need to cast the result if double-click-time is
21205 nonnegative, as it should be; check that it's nonnegative, just in
21206 case. This bug is triggered when events are more than 2**31 ms
21207 apart (about 25 days). (Bug#8664)
21209 * xselect.c (last_event_timestamp): Remove duplicate decl.
21210 (x_own_selection): Remove needless cast to unsigned long.
21212 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21213 that always fit in int. Use a sentinel instead of a counter, to
21214 avoid a temp and to allay GCC's concerns about possible int overflow.
21215 * frame.h (struct frame): Use int for menu_bar_items_used
21216 instead of EMACS_INT, since it always fits in int.
21218 * menu.c (grow_menu_items): Check for int overflow.
21220 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21222 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21223 Before, the code was not consistent. These values cannot exceed
21224 2**31 - 1 so there's no need to make them unsigned.
21225 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21226 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21227 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21229 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21231 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21232 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21233 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21234 presumably because the widths might not match.
21236 * window.c (size_window): Avoid needless test at loop start.
21238 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21240 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21242 2011-05-12 Drew Adams <drew.adams@oracle.com>
21244 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21246 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21248 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21249 `width' to `bar_area_x' and `bar_area_width', respectively.
21250 (x_scroll_run): Take account of fringe background extension.
21252 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21253 Rename local vars `left' and `width' to `bar_area_x' and
21254 `bar_area_width', respectively.
21255 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21256 background extension.
21258 2011-05-10 Jim Meyering <meyering@redhat.com>
21260 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21262 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21264 * image.c (Finit_image_library): Return t for built-in image types,
21265 like pbm and xbm. (Bug#8640)
21267 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21269 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21271 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21273 * w32console.c (Fset_screen_color): Doc fix.
21274 (Fget_screen_color): New function.
21275 (syms_of_ntterm): Defsubr it.
21277 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21278 unlink the temporary file if Fcall_process didn't create it in the
21280 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21281 child process will be redirected to a file specified with `:file'.
21282 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21283 cue to call_process_cleanup not to close that handle.
21285 2011-05-07 Ben Key <bkey76@gmail.com>
21287 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21288 one of two shell specific rules, either bootstrap-temacs-CMD or
21289 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21290 to the previous implementation of the bootstrap-temacs rule.
21291 The bootstrap-temacs-CMD rule is similar to the previous
21292 implementation of the bootstrap-temacs rule except that it
21293 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21296 These changes, along with some changes to nt/configure.bat,
21297 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21298 earlier fix to add support for --cflags and --ldflags options
21299 that include quotes so that it works whether make uses cmd or
21302 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21304 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21305 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21307 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21308 a string. Handle both cases.
21309 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21310 (Fdbus_register_method): Use Qinvalid_function.
21312 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21314 * makefile.w32-in: Update dependencies.
21315 (LISP_H): Add inttypes.h and stdin.h.
21316 (PROCESS_H): Add unistd.h.
21318 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21320 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21321 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21323 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21325 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21327 * term.c (vfatal): Remove stray call to va_end.
21328 It's not needed and the C Standard doesn't allow it here anyway.
21330 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21331 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21333 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21336 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21338 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21340 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21342 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21344 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21346 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21347 * charset.c (Fdefine_charset_internal): Don't initialize
21348 charset.code_space[15]. The value was garbage, on hosts with
21349 32-bit int (Bug#8600).
21351 * lread.c (read_integer): Be more consistent with string-to-number.
21352 Use string_to_number to do the actual conversion; this avoids
21353 rounding errors and fixes some other screwups. Without this fix,
21354 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21355 (digit_to_number): Move earlier, for benefit of read_integer.
21356 Return -1 if the digit is out of range for the base, -2 if it is
21357 not a digit in any supported base. (Bug#8602)
21359 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21361 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21362 to match comment at start of function. This also removes a
21363 GCC warning about overflow in a 32+64-bit port.
21365 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21367 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21368 Reported by Stefan Monnier in
21369 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21370 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21371 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21373 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21374 (EMACS_UINTPTR): Likewise, with uintptr_t.
21376 * lisp.h: Prefer 64-bit EMACS_INT if available.
21377 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21378 on 32-bit hosts that have 64-bit int, so that they can access
21380 However, temporarily disable this change unless the temporary
21381 symbol WIDE_EMACS_INT is defined.
21383 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21385 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21386 This removes an assumption that EMACS_INT and long are the same
21387 width as pointers. The assumption is true for Emacs porting targets
21388 now, but we want to make other targets possible.
21389 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21390 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21391 In the rest of the code, change types of integers that hold casted
21392 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21393 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21394 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21395 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21396 No need to cast type when ORing.
21397 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21398 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21399 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21400 assume EMACS_INT is the same width as char *.
21401 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21402 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21403 Remove no-longer-needed casts.
21404 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21405 (xg_tool_bar_help_callback, xg_make_tool_item):
21406 Use EMACS_INTPTR to hold an integer
21407 that will be cast to void *; this can avoid a GCC warning
21408 if EMACS_INT is not the same width as void *.
21409 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21410 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21411 (current_message_1, set_message_1):
21412 Use a local to convert to proper width without a cast.
21413 * xmenu.c (dialog_selection_callback): Likewise.
21415 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21416 Also, don't assume VALBITS / RAND_BITS is less than 5,
21417 and don't rely on undefined behavior when shifting a 1 left into
21419 * lisp.h (get_random): Change signature to match.
21421 * lread.c (hash_string): Use size_t, not int, for hash computation.
21422 Normally we prefer signed values; but hashing is special, because
21423 it's better to use unsigned division on hash table sizes so that
21424 the remainder is nonnegative. Also, size_t is the natural width
21425 for hashing into memory. The previous code used 'int', which doesn't
21426 retain enough info to hash well into very large tables.
21427 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21429 * dbusbind.c: Don't possibly lose pointer info when converting.
21430 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21431 Use XPNTR rather than XHASH, so that the high-order bits of
21432 the pointer aren't lost when converting through void *.
21434 * eval.c (Fautoload): Don't double-shift a pointer.
21436 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21438 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21440 * gnutls.c (DEF_GNUTLS_FN):
21441 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21443 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21445 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21448 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21450 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21451 New version that can reserve upto 2GB of heap space.
21453 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21455 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21457 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21459 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21460 `gnutls_certificate_set_x509_key_file'.
21462 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21464 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21465 Update dependencies.
21467 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21469 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21470 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21471 Remove unused parameter `fildes'.
21472 * process.c (read_process_output, send_process): Don't pass it.
21474 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21476 Fix previous change: the library cache is defined in w32.c.
21477 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21478 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21480 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21482 Implement dynamic loading of GnuTLS on Windows.
21484 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21485 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21486 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21489 * gnutls.c (Qgnutls_dll): Define.
21490 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21491 (gnutls_*): Declare function pointers.
21492 (init_gnutls_functions): New function to initialize function pointers.
21493 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21494 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21495 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21496 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21497 (emacs_gnutls_write, emacs_gnutls_read)
21498 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21499 (Fgnutls_available_p): New function.
21500 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21501 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21502 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21504 * image.c: Include w32.h.
21505 (Vimage_type_cache): Delete.
21506 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21507 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21508 (w32_delayed_load): Move to w32.c.
21510 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21512 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21513 (w32_delayed_load): Move from image.c. When loading a library, record
21514 its filename in the :loaded-from property of the library id.
21515 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21516 Initialize and staticpro them.
21517 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21519 * process.c: Include lisp.h before w32.h, not after.
21520 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21521 instead of gnutls_record_check_pending.
21523 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21525 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21527 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21528 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21531 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21533 * xterm.c (x_set_frame_alpha): Do not set property on anything
21534 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21536 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21538 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21540 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21542 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21543 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21544 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21545 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21546 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21547 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21548 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21549 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21550 (Qgnutls_bootprop_callbacks_verify): Make static.
21552 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21554 * callproc.c: Indentation fixup.
21556 * sysdep.c (wait_for_termination_1): Make static.
21557 (wait_for_termination, interruptible_wait_for_termination):
21558 Move after wait_for_termination_1.
21560 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21562 * sysdep.c (interruptible_wait_for_termination): New function
21563 which is like wait_for_termination, but allows keyboard
21566 * callproc.c (Fcall_process): Add (:file "file") as an option for
21568 (Fcall_process_region): Ditto.
21570 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21572 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21573 rather than `XVECTOR (FOO)->size'.
21575 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21576 inttypes.h, as a gnulib replacement is used if it not available in
21579 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21581 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21582 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21583 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21585 * coding.c (coding_alloc_by_realloc): Error out if destination
21586 will grow beyond MOST_POSITIVE_FIXNUM.
21587 (decode_coding_emacs_mule): Abort if there isn't enough place in
21588 charbuf for the composition carryover bytes. Reserve an extra
21589 space for up to 2 characters produced in a loop.
21590 (decode_coding_iso_2022): Abort if there isn't enough place in
21591 charbuf for the composition carryover bytes.
21593 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21595 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21596 aborting when %lld or %lll format is passed.
21597 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21598 %llo or %llx format is passed. (Bug#8545)
21600 * window.c (window_scroll_line_based): Use a marker instead of
21601 simple variables to record original value of point. (Bug#7952)
21603 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21604 produced by %s or %c overflows available buffer space. (Bug#8545)
21606 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21608 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21609 (SIZE_MAX): Move defn after all includes, as they might #define it.
21611 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21613 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21615 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21617 * keyboard.c (Qdelayed_warnings_hook): Define.
21618 (command_loop_1): Run `delayed-warnings-hook'
21619 if Vdelayed_warnings_list is non-nil.
21620 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21621 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21623 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21625 * doprnt.c (doprnt): Don't return value smaller than the buffer
21626 size if the message was truncated. (Bug#8545).
21628 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21630 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21631 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21633 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21635 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21637 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21639 * makefile.w32-in: Update dependencies.
21641 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21643 Improve `doprnt' and its usage. (Bug#8545)
21644 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21645 `format_end'. Remove support for %l as a conversion specifier.
21646 Don't use xrealloc. Improve diagnostics when the %l size modifier
21647 is used. Update the commentary.
21649 * eval.c (verror): Simplify calculation of size_t.
21651 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21654 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21656 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21659 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21661 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21662 This makes this file independent of the recent pseudovector change.
21664 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21666 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21668 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21669 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21670 Remove unused local.
21671 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21673 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21674 GCC 4.6.0 optimizes based on type-based alias analysis.
21675 For example, if b is of type struct buffer * and v of type struct
21676 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21677 != &v->size, and therefore "v->size = 1; b->size = 2; return
21678 v->size;" must therefore return 1. This assumption is incorrect
21679 for Emacs, since it type-puns struct Lisp_Vector * with many other
21680 types. To fix this problem, this patch adds a new type struct
21681 vectorlike_header that documents the constraints on layout of vectors
21682 and pseudovectors, and helps optimizing compilers not get fooled
21683 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21684 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21685 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21687 (XSETPVECTYPE): Rewrite in terms of new macro.
21688 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21689 This is a bit clearer, and further avoids the possibility of
21690 undesirable aliasing.
21691 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21692 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21693 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21694 since Lisp_Subr is a special case (no "next" field).
21695 (ASIZE): Now uses header.size rather than size.
21696 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21697 to avoid the hassle of writing XVECTOR (foo)->header.size.
21698 (struct vectorlike_header): New type.
21699 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21700 object, to help avoid aliasing.
21701 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21702 (SUBRP): Likewise, since Lisp_Subr is a special case.
21703 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21704 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21705 (struct Lisp_Hash_Table): Combine first two members into a single
21706 struct vectorlike_header member. All uses of "size" and "next" members
21707 changed to be "header.size" and "header.next".
21708 * buffer.h (struct buffer): Likewise.
21709 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21710 * frame.h (struct frame): Likewise.
21711 * process.h (struct Lisp_Process): Likewise.
21712 * termhooks.h (struct terminal): Likewise.
21713 * window.c (struct save_window_data, struct saved_window): Likewise.
21714 * window.h (struct window): Likewise.
21715 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21716 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21717 * buffer.c (init_buffer_once): Likewise.
21718 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21720 * process.c (Fformat_network_address): Use local var for size,
21723 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21725 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21726 * data.c (atof): Remove decl; no longer used or needed.
21727 (digit_to_number): Move to lread.c.
21728 (Fstring_to_number): Use new string_to_number function, to be
21729 consistent with how the Lisp reader treats infinities and NaNs.
21730 Do not assume that floating-point numbers represent EMACS_INT
21731 without losing information; this is not true on most 64-bit hosts.
21732 Avoid double-rounding errors, by insisting on integers when
21733 parsing non-base-10 numbers, as the documentation specifies.
21734 * lisp.h (string_to_number): New decl, replacing ...
21735 (isfloat_string): Remove.
21736 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21737 (read1): Do not accept +. and -. as integers; this
21738 appears to have been a coding error. Similarly, do not accept
21739 strings like +-1e0 as floating point numbers. Do not report
21740 overflow for integer overflows unless the base is not 10 which
21741 means we have no simple and reliable way to continue.
21742 Break out the floating-point parsing into a new
21743 function string_to_number, so that Fstring_to_number parses
21744 floating point numbers consistently with the Lisp reader.
21745 (digit_to_number): Move here from data.c. Make it static inline.
21746 (E_CHAR, EXP_INT): Remove, replacing with ...
21747 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21748 (string_to_number): New function, replacing isfloat_string.
21749 This function checks for valid syntax and produces the resulting
21750 Lisp float number too. Rework it so that string-to-number
21751 no longer mishandles examples like "1.0e+". Use strtoumax,
21752 so that overflow for non-base-10 numbers is reported only when
21753 there's no portable and simple way to convert to floating point.
21755 * textprop.c (set_text_properties_1): Rewrite for clarity,
21756 and to avoid GCC warning about integer overflow.
21758 * intervals.h (struct interval): Use EMACS_INT for members
21759 where EMACS_UINT might cause problems. See
21760 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21761 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21762 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21764 (offset_intervals): Tell GCC not to worry about length overflow
21765 when negating a negative length.
21767 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21768 (overrun_check_free): Likewise.
21770 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21771 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21774 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21775 (gnutls_make_error): Rename local to avoid shadowing.
21776 (gnutls_emacs_global_deinit): ifdef out; not used.
21777 (Fgnutls_boot): Use const for pointer to readonly storage.
21778 Comment out unused local. Fix pointer signedness problems.
21780 * lread.c (openp): Don't stuff size_t into an 'int'.
21781 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21782 about possible signed overflow.
21784 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21785 (GDK_KEY_g): Don't define if already defined.
21786 (xg_prepare_tooltip): Avoid pointer signedness problem.
21787 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21789 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21790 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21792 * xfns.c (Fx_window_property): Simplify a bit,
21793 to make a bit faster and to avoid GCC 4.6.0 warning.
21794 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21796 * fns.c (internal_equal): Don't assume size_t fits in int.
21798 * alloc.c (compact_small_strings): Tighten assertion a little.
21800 Replace pEd with more-general pI, and fix some printf arg casts.
21801 * lisp.h (pI): New macro, generalizing old pEd macro to other
21802 conversion specifiers. For example, use "...%"pI"d..." rather
21803 than "...%"pEd"...".
21804 (pEd): Remove. All uses replaced with similar uses of pI.
21805 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21806 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21807 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21808 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21809 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21810 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21811 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21813 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21814 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21815 * print.c (safe_debug_print, print_object): Likewise.
21816 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21818 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21819 avoiding the 0 flag, which is not portable.
21820 * process.c (Fmake_network_process): Use pI to avoid cast.
21821 * region-cache.c (pp_cache): Likewise.
21822 * xdisp.c (decode_mode_spec): Likewise.
21823 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21824 behavior on 64-bit hosts with printf arg.
21825 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21826 (x_stop_queuing_selection_requests): Likewise.
21827 (x_get_window_property): Don't truncate byte count to an 'int'
21830 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21831 here, since it parses constructs like leading '-' and spaces,
21832 which are not wanted; and it overflows with large numbers.
21833 Instead, simply match F[0-9]+, which is what is wanted anyway.
21835 * alloc.c: Remove unportable assumptions about struct layout.
21836 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21837 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21838 (allocate_vectorlike, make_pure_vector): Use the new macros,
21839 plus offsetof, to remove unportable assumptions about struct layout.
21840 These assumptions hold on all porting targets that I know of, but
21841 they are not guaranteed, they're easy to remove, and removing them
21842 makes further changes easier.
21844 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21845 This doesn't fix a bug but makes the code clearer.
21846 (string_overrun_cookie): Now const. Use initializers that
21847 don't formally overflow signed char, to avoid warnings.
21848 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21849 can cause Emacs to crash when string overrun checking is enabled.
21850 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21851 multiple of sizeof (EMACS_INT); it need not be, if
21852 alignof(EMACS_INT) < sizeof (EMACS_INT).
21853 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21855 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21857 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21859 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21861 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21862 supposed to be handshaking. (Bug#8556)
21863 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21865 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21867 * lisp.h (Qdebug): List symbol.
21868 * eval.c (Qdebug): Restore global linkage.
21869 * keyboard.c (debug-on-event): New variable.
21870 (handle_user_signal): Break into debugger when debug-on-event
21871 matches the current signal symbol.
21873 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21875 * alloc.c (check_sblock, check_string_bytes)
21876 (check_string_free_list): Convert to standard C.
21878 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21880 * w32.c (emacs_gnutls_push): Fix typo.
21882 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21884 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21885 "cast to pointer from integer of different size".
21887 Improve doprnt and its use in verror. (Bug#8545)
21888 * doprnt.c (doprnt): Document the set of format control sequences
21889 supported by the function. Use SAFE_ALLOCA instead of always
21892 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21893 is one byte too soon. Don't use xrealloc; instead xfree and
21896 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21898 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21901 * gnutls.c: Renamed global_initialized to
21902 gnutls_global_initialized. Added internals for the
21903 :verify-hostname-error, :verify-error, and :verify-flags
21904 parameters of `gnutls-boot' and documented those parameters in the
21905 docstring. Start callback support.
21906 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21907 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21908 on error. Return error code.
21909 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21910 (emacs_gnutls_read): Likewise.
21911 (Fgnutls_boot): Return handshake error code.
21912 (emacs_gnutls_handle_error): New function.
21913 (wsaerror_to_errno): Likewise.
21915 * w32.h (emacs_gnutls_pull): Add prototype.
21916 (emacs_gnutls_push): Likewise.
21918 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21919 (emacs_gnutls_push): Likewise.
21921 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21923 * process.c (wait_reading_process_output): Check if GnuTLS
21924 buffered some data internally if no FDs are set for TLS
21927 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21928 (LIBS): Link to USER_LIBS.
21929 ($(BLD)/gnutls.$(0)): New target.
21931 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21933 * xdisp.c (handle_single_display_spec): Rename the
21934 display_replaced_before_p argument into display_replaced_p, to
21935 make it consistent with the commentary. Fix typos in the
21938 * textprop.c (syms_of_textprop): Remove dead code.
21939 (copy_text_properties): Delete obsolete commentary about an
21940 interface that was deleted long ago. Fix typos in the description
21943 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21944 to changes in oldXMenu/XMenu.h from 2011-04-16.
21945 <menu_help_message, prev_menu_help_message>: Constify.
21946 (IT_menu_make_room): menu->help_text is now `const char **';
21949 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21950 to changes in oldXMenu/XMenu.h from 2011-04-16.
21951 (struct XMenu): Declare `help_text' `const char **'.
21953 * xfaces.c <Qunspecified>: Make extern again.
21955 * syntax.c: Include sys/types.h before including regex.h, as
21958 * doc.c (get_doc_string): Improve the format passed to `error'.
21960 * doprnt.c (doprnt): Improve commentary.
21962 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21964 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21967 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21968 changes in globals.h immediately force recompilation.
21969 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21970 $(CURDIR)/s/ms-w32.h.
21971 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21973 * character.c (Fchar_direction): Function deleted.
21974 (syms_of_character): Don't defsubr it.
21975 <char-direction-table>: Deleted.
21977 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21979 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21980 * doprnt.c: Include limits.h.
21981 (SIZE_MAX): New macro.
21982 (doprnt): Return a size_t value. 2nd arg is now size_t.
21983 Many local variables are now size_t instead of int or unsigned.
21984 Improve overflow protection. Support `l' modifier for integer
21985 conversions. Support %l conversion. Don't assume an EMACS_INT
21986 argument for integer conversions and for %c.
21988 * lisp.h (doprnt): Restore prototype.
21990 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21991 $(SRC)/character.h.
21993 * Makefile.in (base_obj): Add back doprnt.o.
21995 * deps.mk (doprnt.o): Add back prerequisites.
21996 (callint.o): Depend on character.h.
21998 * eval.c (internal_lisp_condition_case): Include the handler
21999 representation in the error message.
22000 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22001 when breaking from the loop.
22003 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22005 * callint.c (Fcall_interactively): When displaying error message
22006 about invalid control letter, pass the character's codepoint, not
22007 a pointer to its multibyte form. Improve display of the character
22008 in octal and display also its hex code.
22010 * character.c (char_string): Use %x to display the (unsigned)
22011 codepoint of an invalid character, to avoid displaying a bogus
22014 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22015 `error', not SYMBOL_NAME itself.
22017 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22018 character arguments to `error'.
22020 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22021 to `error' in error message about FINAL_CHAR argument. Make sure
22022 FINAL_CHAR is a character, and use %c when it is passed as
22023 argument to `error'.
22025 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22027 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22029 * w32.c: Include <time.h>.
22030 (sys_localtime): New function.
22032 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22034 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22036 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22038 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22040 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22041 zombies (Bug#8467).
22043 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22045 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22046 gl_state.e_property when gl_state.object is Qt.
22048 * insdel.c (make_gap_larger): Remove limitation of buffer size
22051 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22053 * xdisp.c (lookup_glyphless_char_display)
22054 (produce_glyphless_glyph): Handle cons cell entry in
22055 glyphless-char-display.
22056 (Vglyphless_char_display): Document it.
22058 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22059 glyphless-char-display.
22061 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22063 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22065 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22067 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22068 definition for no-X builds.
22070 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22072 Static checks with GCC 4.6.0 and non-default toolkits.
22074 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22076 * process.c (keyboard_bit_set): Define only if SIGIO.
22077 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22078 (send_process): Repair possible setjmp clobbering.
22080 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22082 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22084 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22086 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22087 Define only if needed.
22089 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22090 by pacifying GCC about it. Maybe it's time to retire it?
22091 * xfaces.c (USG, __TIMEVAL__): Likewise.
22093 * dispextern.h (struct redisplay_interface): Rename param
22094 to avoid shadowing.
22095 * termhooks.h (struct terminal): Likewise.
22096 * xterm.c (xembed_send_message): Likewise.
22098 * insdel.c (make_gap_smaller): Define only if
22099 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22101 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22104 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22105 so that we aren't warned about unused symbols.
22107 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22109 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22111 * xfns.c (x_real_positions): Mark locals as initialized.
22113 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22115 * xterm.c: Fix problems found by static analysis with other toolkits.
22116 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22117 (x_dispatch_event): Declare static if USE_GTK, and
22118 define if USE_GTK || USE_X_TOOLKIT.
22119 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22120 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22121 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22122 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22124 * xmenu.c (menu_help_callback): Pointer type fixes.
22125 Use const pointers when pointing at readonly data. Avoid pointer
22126 signedness clashes.
22127 (FALSE): Remove unused macro.
22128 (update_frame_menubar): Remove unused decl.
22130 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22132 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22133 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22134 (single_menu_item): Rename local to avoid shadowing.
22136 * keyboard.c (make_lispy_event): Remove unused local var.
22138 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22139 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22141 * bitmaps: Change bitmaps from unsigned char back to the X11
22142 compatible char. Avoid the old compiler warnings about
22143 out-of-range initializers by using, for example, '\xab' rather
22146 * xgselect.c (xgselect_initialize): Check vs interface
22147 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22149 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22151 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22152 to read-only memory.
22154 * fns.c (vector): Remove; this old hack is no longer needed.
22156 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22158 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22160 * xrdb.c (x_load_resources): Omit unused local.
22162 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22163 (x_window): Rename locals to avoid shadowing.
22164 (USG): Use the kludged USG macro, to pacify gcc.
22166 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22167 (x_term_init): Remove local to avoid shadowing.
22169 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22171 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22172 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22174 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22176 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22178 Fix regex.c, syntax.c and friends for buffers > 2GB.
22179 * syntax.h (struct gl_state_s): Declare character position members
22182 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22184 * textprop.c (verify_interval_modification, interval_of):
22185 Declare arguments EMACS_INT.
22187 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22190 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22192 * indent.c (Fvertical_motion): Local variable it_start is now
22195 * regex.c (re_match, re_match_2, re_match_2_internal)
22196 (bcmp_translate, regcomp, regexec, print_double_string)
22197 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22198 (re_compile_pattern, re_exec): Declare arguments and local
22199 variables `size_t' and `ssize_t' and return values `regoff_t', as
22201 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22202 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22203 <compile_stack_type>: `size' and `avail' are now `size_t'.
22205 * regex.h <regoff_t>: Use ssize_t, not int.
22206 (re_search, re_search_2, re_match, re_match_2): Arguments that
22207 specify buffer/string position and length are now ssize_t and
22208 size_t. Return type is regoff_t.
22210 2011-04-16 Ben Key <bkey76@gmail.com>
22212 * nsfont.m: Fixed bugs in ns_get_family and
22213 ns_descriptor_to_entity that were caused by using free to
22214 deallocate memory blocks that were allocated by xmalloc (via
22215 xstrdup). This caused Emacs to crash when compiled with
22216 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22217 --enable-checking=xmallocoverrun). xfree is now used to
22218 deallocate these memory blocks.
22220 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22222 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22224 emacs_write: Accept and return EMACS_INT for sizes.
22225 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22227 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22228 Accept and return EMACS_INT.
22229 (emacs_gnutls_write): Return the number of bytes written on
22231 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22232 (emacs_read, emacs_write): Remove check for negative size, as the
22233 Emacs source code has been audited now.
22234 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22235 (emacs_read, emacs_write): Use it.
22236 * process.c (send_process): Adjust to the new signatures of
22237 emacs_write and emacs_gnutls_write. Do not attempt to store
22238 a byte offset into an 'int'; it might overflow.
22239 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22241 * sound.c: Don't assume sizes fit in 'int'.
22242 (struct sound_device.period_size, alsa_period_size):
22243 Return EMACS_INT, not int.
22244 (struct sound_device.write, vox_write, alsa_write):
22245 Accept EMACS_INT, not int.
22246 (wav_play, au_play): Use EMACS_INT to store sizes and to
22247 record read return values.
22249 2011-04-15 Ben Key <bkey76@gmail.com>
22251 * keyboard.c (Qundefined): Don't declare static since it is used
22253 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22254 static since they are used in nsfont.m.
22256 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22258 * process.c (Qprocessp): Don't declare static.
22259 * lisp.h (Qprocessp): Declare again.
22261 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22263 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22265 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22267 Improve C-level modularity by making more things 'static'.
22269 Don't publish debugger-only interfaces to other modules.
22270 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22271 (verify_bytepos, count_markers): Move decls to the only modules
22273 * region-cache.h (pp_cache): Likewise.
22274 * window.h (check_all_windows): Likewise.
22275 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22277 * sysdep.c (croak): Now static, if
22278 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22279 * syssignal.h (croak): Declare only if not static.
22281 * alloc.c (refill_memory_reserve): Now static if
22282 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22283 * lisp.h (refill_memory_reserve): Declare only if not static.
22285 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22286 Define only if USE_LUCID.
22288 * xrdb.c (x_customization_string, x_rm_string): Now static.
22290 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22291 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22293 * xdisp.c (draw_row_with_mouse_face): Now static.
22294 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22296 * window.h (check_all_windows): Mark externally visible.
22298 * window.c (window_deletion_count): Now static.
22300 * undo.c: Make symbols static if they're not exported.
22301 (last_undo_buffer, last_boundary_position, pending_boundary):
22304 * textprop.c (interval_insert_behind_hooks): Now static.
22305 (interval_insert_in_front_hooks): Likewise.
22307 * term.c: Make symbols static if they're not exported.
22308 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22309 (max_frame_lines, tty_set_terminal_modes):
22310 (tty_reset_terminal_modes, tty_turn_off_highlight):
22311 (get_tty_terminal): Now static.
22312 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22313 * termhooks.h (term_mouse_moveto): Do not declare if
22314 HAVE_WINDOW_SYSTEM.
22315 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22316 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22318 * sysdep.c: Make symbols static if they're not exported.
22319 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22321 (sigprocmask_set, full_mask): Remove; unused.
22322 (wait_debugging): Mark as visible.
22323 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22324 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22326 * syntax.c (syntax_temp): Define only if !__GNUC__.
22328 * sound.c (current_sound_device, current_sound): Now static.
22330 * search.c (searchbufs, searchbuf_head): Now static.
22332 * scroll.c (scroll_cost): Remove; unused.
22333 * dispextern.h (scroll_cost): Remove decl.
22335 * region-cache.h (pp_cache): Mark as externally visible.
22337 * process.c: Make symbols static if they're not exported.
22338 (process_tick, update_tick, create_process, chan_process):
22339 (Vprocess_alist, proc_buffered_char, datagram_access):
22340 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22341 (deactivate_process): Mark defn as static, as well as decl.
22342 * lisp.h (create_process): Remove decl.
22343 * process.h (chan_process, Vprocess_alist): Remove decls.
22345 * print.c: Make symbols static if they're not exported.
22346 (print_depth, new_backquote_output, being_printed, print_buffer):
22347 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22348 (print_interval, print_number_index, initial_stderr_stream):
22350 * lisp.h (Fprinc): Remove decl.
22351 (debug_output_compilation_hack): Mark as externally visible.
22353 * sysdep.c (croak): Move decl from here to syssignal.h.
22354 * syssignal.h (croak): Put it here, so the API can be checked when
22355 'croak' is called from dissociate_if_controlling_tty.
22357 * minibuf.c: Make symbols static if they're not exported.
22358 (minibuf_save_list, choose_minibuf_frame): Now static.
22359 * lisp.h (choose_minibuf_frame): Remove decl.
22361 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22363 * lread.c: Make symbols static if they're not exported.
22364 (read_objects, initial_obarray, oblookup_last_bucket_number):
22366 (make_symbol): Remove; unused.
22367 * lisp.h (initial_obarray, make_symbol): Remove decls.
22369 * keyboard.c: Make symbols static if they're not exported.
22370 (single_kboard, recent_keys_index, total_keys, recent_keys):
22371 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22372 (this_single_command_key_start, echoing, last_auto_save):
22373 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22374 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22375 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22376 (Vlispy_mouse_stem, double_click_count):
22378 (force_auto_save_soon): Define only if SIGDANGER.
22379 (ignore_mouse_drag_p): Now static if
22380 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22381 (print_help): Remove; unused.
22382 (stop_character, last_timer_event): Mark as externally visible.
22383 * keyboard.h (ignore_mouse_drag_p): Declare only if
22384 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22385 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22386 * lisp.h (echoing): Remove decl.
22387 (force_auto_save_soon): Declare only if SIGDANGER.
22388 * xdisp.c (redisplay_window): Simplify code, to make it more
22389 obvious that ignore_mouse_drag_p is not accessed if !defined
22390 USE_GTK && !defined HAVE_NS.
22392 * intervals.c: Make symbols static if they're not exported.
22393 (merge_properties_sticky, merge_interval_right, delete_interval):
22395 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22397 * insdel.c: Make symbols static if they're not exported.
22398 However, leave prepare_to_modify_buffer alone. It's never
22399 called from outside this function, but that appears to be a bug.
22400 (combine_after_change_list, combine_after_change_buffer):
22401 (adjust_after_replace, signal_before_change): Now static.
22402 (adjust_after_replace_noundo): Remove; unused.
22403 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22404 (signal_before_change): Remove decls.
22406 * indent.c (val_compute_motion, val_vmotion): Now static.
22408 * image.c: Make symbols static if they're not exported.
22409 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22411 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22412 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22414 * fringe.c (standard_bitmaps): Now static.
22415 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22417 * frame.c: Make symbols static if they're not exported.
22418 (x_report_frame_params, make_terminal_frame): Now static.
22419 (get_frame_param): Now static, unless HAVE_NS.
22420 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22421 (x_get_resource_string): Remove; not used.
22422 * frame.h (make_terminal_frame, x_report_frame_params):
22423 (x_get_resource_string); Remove decls.
22424 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22425 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22427 * font.c, fontset.c: Make symbols static if they're not exported.
22428 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22429 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22430 * font.c (font_close_object): Now static.
22431 * font.h (font_close_object): Remove.
22432 * fontset.c (FONTSET_OBJLIST): Remove.
22433 (free_realized_fontset) #if-0 the body, which does nothing.
22434 (face_suitable_for_char_p): #if-0, as it's never called.
22435 * fontset.h (face_suitable_for_char_p): Remove decl.
22436 * xfaces.c (face_at_string_position):
22437 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22438 since 0 is always ASCII.
22440 * fns.c (weak_hash_tables): Now static.
22442 * fileio.c: Make symbols static if they're not exported.
22443 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22444 (Vwrite_region_annotation_buffers): Now static.
22446 * eval.c: Make symbols static if they're not exported.
22447 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22448 * lisp.h (backtrace_list): Remove decl.
22450 * emacs.c: Make symbols static if they're not exported.
22451 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22452 (fatal_error_code, fatal_error_signal_hook, standard_args):
22454 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22455 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22456 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22457 * lisp.h (fatal_error_signal_hook): Remove decl.
22458 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22460 * editfns.c: Move a (normally-unused) function to its only use.
22461 * editfns.c, lisp.h (get_operating_system_release): Remove.
22462 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22463 worth the hassle of breaking this out.
22465 * xterm.c: Make symbols static if they're not exported.
22466 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22467 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22468 (x_destroy_window, x_delete_display):
22470 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22471 (x_mouse_leave): Remove; unused.
22472 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22473 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22474 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22476 (x_mouse_leave): Declare only if WINDOWSNT.
22477 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22478 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22481 * ftxfont.c: Make symbols static if they're not exported.
22482 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22484 * font.h (ftxfont_driver): Likewise.
22486 * xfns.c: Make symbols static if they're not exported.
22487 (x_last_font_name, x_display_info_for_name):
22488 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22489 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22490 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22491 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22492 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22493 (last_show_tip_args): Now static.
22494 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22495 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22496 (x_screen_planes): Remove; unused.
22497 * dispextern.h (x_screen_planes): Remove decl.
22499 * dispnew.c: Make symbols static if they're not exported.
22500 * dispextern.h (redraw_garbaged_frames, scrolling):
22501 (increment_row_positions): Remove.
22502 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22503 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22505 (redraw_garbaged_frames): Remove; unused.
22507 * xfaces.c: Make symbols static if they're not exported.
22508 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22510 * xterm.h (defined_color): Remove decls.
22511 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22512 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22513 (menu_face_changed_default, defined_color, free_realized_face):
22514 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22515 (ascii_face_of_lisp_face): Remove; unused.
22517 * xdisp.c: Make symbols static if they're not exported.
22518 * dispextern.h (scratch_glyph_row, window_box_edges):
22519 (glyph_to_pixel_coords, set_cursor_from_row):
22520 (get_next_display_element, set_iterator_to_next):
22521 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22522 (show_mouse_face): Remove decls
22523 * frame.h (message_buf_print): Likewise.
22524 * lisp.h (pop_message, set_message, check_point_in_composition):
22526 * xterm.h (set_vertical_scroll_bar): Likewise.
22527 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22528 (message_buf_print, scratch_glyph_row, displayed_buffer):
22529 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22530 (get_next_display_element, show_mouse_face, window_box_edges):
22531 (frame_to_window_pixel_xy, check_point_in_composition):
22532 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22533 (glyph_to_pixel_coords): Remove; unused.
22535 * dired.c (file_name_completion): Now static.
22537 * dbusbind.c (xd_in_read_queued_messages): Now static.
22539 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22540 * data.c (circular_list_error): Remove.
22542 * commands.h (last_point_position, last_point_position_buffer):
22543 (last_point_position_window): Remove decls.
22544 * keyboard.c: Make these variables static.
22546 * coding.h (coding, code_convert_region, encode_coding_gap):
22548 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22549 (iso_code_class, detect_coding, code_convert_region): Now static.
22550 (encode_coding_gap): Remove; unused.
22552 * chartab.c (chartab_chars, chartab_bits): Now static.
22554 * charset.h (charset_iso_8859_1): Remove decl.
22555 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22558 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22559 * ccl.c (Vccl_program_table): Now static.
22560 (check_ccl_update): Remove; unused.
22562 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22563 * category.h: ... from here.
22564 * category.c (check_category_table, set_category_set): Now static.
22566 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22567 * lisp.h: Remove these decls.
22569 * buffer.c (buffer_count): Remove unused var.
22571 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22572 so that it's not optimized away.
22573 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22574 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22575 exported only to the debugger.
22577 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22578 * atimer.h (run_all_atimers): Remove; not exported.
22580 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22581 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22582 was inaccessible from Lisp.
22583 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22584 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22586 alloc.c: Import and export fewer symbols, and remove unused items.
22587 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22589 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22590 it's not optimized away by whole-program optimization.
22591 (message_enable_multibyte, free_misc): Remove.
22592 (catchlist, handlerlist, mark_backtrace):
22593 Declare only if BYTE_MARK_STACK.
22594 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22595 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22596 (message_enable_multibyte): Remove decl.
22597 (free_misc, interval_free_list, float_block, float_block_index):
22598 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22599 (cons_free_list, last_marked_index):
22601 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22602 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22603 (mark_backtrace): Define only if BYTE_MARK_STACK.
22604 * xdisp.c (message_enable_multibyte): Now static.
22606 Declare Lisp_Object Q* variables to be 'static' if not exported.
22607 This makes it easier for human readers (and static analyzers)
22608 to see whether these variables are used from other modules.
22609 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22610 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22611 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22612 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22613 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22614 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22615 * xmenu.c, xselect.c:
22616 Declare Q* vars static if they are not used in other modules.
22617 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22618 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22619 Remove decls of unexported vars.
22620 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22622 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22624 Make Emacs functions such as Fatom 'static' by default.
22625 This makes it easier for human readers (and static analyzers)
22626 to see whether these functions can be called from other modules.
22627 DEFUN now defines a static function. To make the function external
22628 so that it can be used in other C modules, use the new macro DEFUE.
22629 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22630 (Finit_image_library):
22631 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22632 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22633 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22634 Remove decls, since these functions are now static.
22635 (Funintern, Fget_internal_run_time): New decls, since these functions
22636 were already external.
22638 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22639 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22640 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22641 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22642 * keyboard.c, keymap.c, lread.c:
22643 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22644 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22645 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22646 Mark functions with DEFUE instead of DEFUN,
22647 if they are used in other modules.
22648 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22649 decls for now-static functions.
22650 * buffer.h (Fdelete_overlay): Remove decl.
22651 * callproc.c (Fgetenv_internal): Mark as internal.
22652 * composite.c (Fremove_list_of_text_properties): Remove decl.
22653 (Fcomposition_get_gstring): New forward static decl.
22654 * composite.h (Fcomposite_get_gstring): Remove decl.
22655 * dired.c (Ffile_attributes): New forward static decl.
22656 * doc.c (Fdocumntation_property): New forward static decl.
22657 * eval.c (Ffetch_bytecode): New forward static decl.
22658 (Funintern): Remove extern decl; now in .h file where it belongs.
22659 * fileio.c (Fmake_symbolic_link): New forward static decl.
22660 * image.c (Finit_image_library): New forward static decl.
22661 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22662 * intervals.h (Fprevious_property_change):
22663 (Fremove_list_of_text_properties): Remove decls.
22664 * keyboard.c (Fthis_command_keys): Remove decl.
22665 (Fcommand_execute): New forward static decl.
22666 * keymap.c (Flookup_key): New forward static decl.
22667 (Fcopy_keymap): Now static.
22668 * keymap.h (Flookup_key): Remove decl.
22669 * process.c (Fget_process): New forward static decl.
22670 (Fprocess_datagram_address): Mark as internal.
22671 * syntax.c (Fsyntax_table_p): New forward static decl.
22672 (skip_chars): Remove duplicate decl.
22673 * textprop.c (Fprevious_property_change): New forward static decl.
22674 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22676 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22677 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22679 * editfns.c (Fformat): Remove unreachable code.
22681 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22683 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22686 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22688 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22689 when at ZV. (Bug#8487)
22691 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22693 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22695 * keyboard.c (parse_tool_bar_item): Likewise.
22696 * sound.c (sound_cleanup, alsa_close): Likewise.
22697 * termcap.c (tgetent): Likewise.
22698 * xfns.c (x_default_font_parameter): Likewise.
22699 * xsettings.c (read_and_apply_settings): Likewise.
22701 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22702 (overrun_check_free): Protoize.
22704 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22706 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22707 since callers should never pass a negative size.
22708 Change the signature to match that of plain 'read' and 'write'; see
22709 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22710 * lisp.h: Update prototypes of emacs_write and emacs_read.
22712 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22714 * xdisp.c (redisplay_window): Don't try to determine the character
22715 position of the scroll margin if the window start point w->startp
22716 is outside the buffer's accessible region. (Bug#8468)
22718 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22720 Fix write-region and its subroutines for buffers > 2GB.
22721 * fileio.c (a_write, e_write): Modify declaration of arguments and
22722 local variables to support buffers larger than 2GB.
22723 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22725 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22726 argument, local variables, and return value.
22728 * lisp.h: Update prototypes of emacs_write and emacs_read.
22730 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22732 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22734 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22736 Fix more problems found by GCC 4.6.0's static checks.
22738 * xdisp.c (vmessage): Use a better test for character truncation.
22740 * charset.c (load_charset_map): <, not <=, for optimization,
22741 and to avoid potential problems with integer overflow.
22742 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22743 * casetab.c (set_identity, shuffle): Likewise.
22744 * editfns.c (Fformat): Likewise.
22745 * syntax.c (skip_chars): Likewise.
22747 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22748 This also lets GCC 4.6.0 generate slightly better loop code.
22750 * callint.c (Fcall_interactively): <, not <=, for optimization.
22751 (Fcall_interactively): Count the number of arguments produced,
22752 not the number of arguments given. This is simpler and lets GCC
22753 4.6.0 generate slightly better code.
22755 * ftfont.c: Distingish more carefully between FcChar8 and char.
22756 The previous code passed unsigned char * to a functions like
22757 strlen and xstrcasecmp that expect char *, which does not
22758 conform to the C standard.
22759 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22760 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22761 char * when the C standard requires it.
22763 * keyboard.c (read_char): Remove unused var.
22765 * eval.c: Port to Windows vsnprintf (Bug#8435).
22766 Include <limits.h>.
22767 (SIZE_MAX): Define if the headers do not.
22768 (verror): Do not give up if vsnprintf returns a negative count.
22769 Instead, grow the buffer. This ports to Windows vsnprintf, which
22770 does not conform to C99. Problem reported by Eli Zaretskii.
22771 Also, simplify the allocation scheme, by avoiding the need for
22772 calling realloc, and removing the ALLOCATED variable.
22774 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22776 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22777 But keep the doprint source code for now, as we might revamp it
22778 and use it again (Bug#8435).
22779 * lisp.h (doprnt): Remove.
22780 * Makefile.in (base_obj): Remove doprnt.o.
22781 * deps.mk (doprnt.o): Remove.
22783 error: Print 32- and 64-bit integers portably (Bug#8435).
22784 Without this change, on typical 64-bit hosts error ("...%d...", N)
22785 was used to print both 32- and 64-bit integers N, which relied on
22786 undefined behavior.
22787 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22788 * lisp.h (error, verror): Mark as printf-like functions.
22789 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22790 Report overflow in size calculations when allocating printf buffer.
22791 Do not truncate output string at its first null byte.
22792 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22793 Truncate the output at a character boundary, since vsnprintf does not
22795 * charset.c (check_iso_charset_parameter): Convert internal
22796 character to string before calling 'error', since %c now has the
22798 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22799 overflow when computing char to be passed to 'error'. Do not
22800 pass Lisp_Object to 'error'; pass the integer instead.
22801 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22802 formatted with plain %d.
22804 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22806 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22808 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22810 * xterm.c (x_catch_errors): Remove duplicate declaration.
22812 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22814 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22816 2011-04-10 Jim Meyering <meyering@redhat.com>
22818 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22819 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22820 return ssize_t not "int", and use size_t as the buffer length.
22821 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22822 * gnutls.h: Update declarations.
22823 * process.c (read_process_output): Use ssize_t, to match.
22824 (send_process): Likewise.
22826 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22828 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22830 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22832 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22833 Use unsigned char, to match FcChar8 type definition.
22835 * xterm.c (handle_one_xevent):
22836 * xmenu.c (create_and_show_popup_menu):
22837 * xselect.c (x_decline_selection_request)
22838 (x_reply_selection_request): Avoid type-punned deref of X events.
22840 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22842 Fix some uses of `int' instead of EMACS_INT.
22843 * search.c (string_match_1, fast_string_match)
22844 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22845 (scan_buffer, find_next_newline_no_quit)
22846 (find_before_next_newline, search_command, Freplace_match)
22847 (Fmatch_data): Make some `int' variables be EMACS_INT.
22849 * xdisp.c (display_count_lines): 3rd argument and return value now
22850 EMACS_INT. All callers changed.
22851 (pint2hrstr): Last argument is now EMACS_INT.
22853 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22854 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22855 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22856 (decode_coding_utf_16, decode_coding_emacs_mule)
22857 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22858 (decode_coding_ccl, decode_coding_charset)
22859 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22860 (decode_coding_iso_2022, decode_coding_emacs_mule)
22861 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22862 <char_offset, last_offset>: Declare EMACS_INT.
22863 (encode_coding_utf_8, encode_coding_utf_16)
22864 (encode_coding_emacs_mule, encode_invocation_designation)
22865 (encode_designation_at_bol, encode_coding_iso_2022)
22866 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22867 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22869 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22870 (encode_invocation_designation): Last argument P_NCHARS is now
22872 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22873 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22875 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22878 * ccl.c (Fccl_execute_on_string): Declare some variables
22881 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22883 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22885 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22887 * process.c (Fformat_network_address): Doc fix.
22889 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22891 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22893 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22895 * keyboard.c (read_char): Call Lisp function help-form-show,
22896 instead of using internal_with_output_to_temp_buffer.
22897 (Qhelp_form_show): New var.
22898 (syms_of_keyboard): Use DEFSYM macro.
22900 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22902 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22904 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22906 * process.c (Flist_processes): Remove to Lisp.
22907 (list_processes_1): Delete.
22909 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22911 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22913 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22915 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22917 Fix more problems found by GCC 4.6.0's static checks.
22919 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22921 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22923 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22925 * xdisp.c (vmessage): Mark as a printf-like function.
22927 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22929 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22931 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22932 printf-like functions.
22933 (tiff_load): Add casts to remove these marks before passing them
22934 to system-supplied API.
22936 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22938 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22939 This avoids several warnings with gcc -Wstrict-overflow.
22940 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22941 directly, rather than having caller test rule sign. This avoids
22942 some unnecessary tests.
22943 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22944 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22945 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22947 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22948 (xfont_open): Avoid unnecessary tests.
22950 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22952 * composite.h, composite.c (composition_gstring_put_cache):
22953 Use EMACS_INT, not int, for length.
22955 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22956 breaking out part of COMPOSITION_DECODE_RULE.
22957 (COMPOSITION_DECODE_RULE): Use it.
22958 * composite.c (get_composition_id): Remove unused local vars,
22959 by using the new macro.
22961 * textprop.c (set_text_properties_1): Change while to do-while,
22962 since the condition is always true at first.
22964 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22965 (interval_deletion_adjustment): Return unsigned value.
22968 * process.c (list_processes_1, create_pty, read_process_output):
22969 (exec_sentinel): Remove vars that were set but not used.
22970 (create_pty): Remove unnecessary "volatile"s.
22971 (Fnetwork_interface_info): Avoid possibility of int overflow.
22972 (read_process_output): Do adaptive read buffering even if carryover.
22973 (read_process_output): Simplify nbytes computation if buffered.
22975 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22977 * syntax.c (scan_words): Remove var that was set but not used.
22978 (update_syntax_table): Use unsigned instead of int.
22980 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22981 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22982 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22984 * print.c (print_error_message): Avoid int overflow.
22986 * font.c (font_list_entities): Redo for clarity,
22987 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22989 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22990 (font_score): Avoid potential overflow in diff calculation.
22992 * fns.c (substring_both): Remove var that is set but not used.
22993 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22995 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22997 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22998 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22999 can always succeed if overflow has undefined behavior.
23001 * search.c (boyer_moore, wordify): Remove vars set but not used.
23002 (wordify): Omit three unnecessary tests.
23004 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23005 All callers changed. This avoids the need for an unused var.
23007 * casefiddle.c (casify_region): Remove var that is set but not used.
23009 * dired.c (file_name_completion): Remove var that is set but not used.
23011 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23013 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23014 (Finsert_file_contents): Remove unnecessary code checking fd.
23016 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23017 Check for integer overflow on size calculations.
23019 * buffer.c (Fprevious_overlay_change): Remove var that is set
23022 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23023 Remove vars that are set but not used.
23024 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23025 (timer_check_2): Mark vars as initialized.
23027 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23029 * image.c (lookup_image): Remove var that is set but not used.
23030 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23032 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23033 that are set but not used.
23035 * xfns.c (make_invisible_cursor): Don't return garbage
23036 if XCreateBitmapFromData fails (Bug#8410).
23038 * xselect.c (x_get_local_selection, x_handle_property_notify):
23039 Remove vars that are set but not used.
23041 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23042 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23044 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23045 Remove var that is set but not used.
23046 (scroll_bar_windows_size): Now size_t, not int.
23047 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23048 Check for overflow.
23050 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23051 (map_tty_color) [!defined MSDOS]: Likewise.
23053 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23055 * coding.c: Remove vars that are set but not used.
23056 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23057 All callers changed.
23058 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23059 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23060 (decode_coding_charset): Remove vars that are set but not used.
23062 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23063 that is set but not used.
23065 * print.c (print_object): Remove var that is set but not used.
23067 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23068 The gnulib version avoids calling malloc in the usual case,
23069 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23070 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23071 * filelock.c (current_lock_owner): Likewise.
23072 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23073 * sysdep.c: Include allocator.h, careadlinkat.h.
23074 (emacs_no_realloc_allocator): New static constant.
23075 (emacs_readlink): New function.
23076 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23077 ../lib/careadlinkat.h.
23079 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23081 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23082 first non-nil return value).
23084 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23086 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23087 if not defined (Bug#8403).
23089 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23091 * xdisp.c (display_count_lines): Remove parameter `start',
23092 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23093 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23094 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23095 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23096 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23097 and thereabouts. All callers changed.
23098 (get_per_char_metric): Remove parameter `f', unused since
23099 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23101 2011-04-02 Jim Meyering <meyering@redhat.com>
23103 do not dereference NULL upon failed strdup
23104 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23105 (ns_get_family): Likewise.
23107 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23109 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23111 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23113 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23116 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23118 Add lexical binding.
23120 * window.c (Ftemp_output_buffer_show): New fun.
23121 (Fsave_window_excursion):
23122 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23124 * lread.c (lisp_file_lexically_bound_p): New function.
23125 (Fload): Bind Qlexical_binding.
23126 (readevalloop): Remove `evalfun' arg.
23127 Bind Qinternal_interpreter_environment.
23128 (Feval_buffer): Bind Qlexical_binding.
23129 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23131 (syms_of_lread): Declare `lexical-binding'.
23133 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23135 * keyboard.c (eval_dyn): New fun.
23136 (menu_item_eval_property): Use it.
23138 * image.c (parse_image_spec): Use Ffunctionp.
23140 * fns.c (concat, mapcar1): Accept byte-code-functions.
23142 * eval.c (Fsetq): Handle lexical vars.
23143 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23144 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23145 (FletX, Flet): Obey lexical binding.
23146 (Fcommandp): Handle closures.
23147 (Feval): New `lexical' arg.
23148 (eval_sub): New function extracted from Feval. Use it almost
23149 everywhere where Feval was used. Look up vars in lexical env.
23151 (Ffunctionp): Move from subr.el.
23152 (Ffuncall): Handle closures.
23153 (apply_lambda): Remove `eval_flags'.
23154 (funcall_lambda): Handle closures and new byte-code-functions.
23155 (Fspecial_variable_p): New function.
23156 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23157 but without exporting it to Lisp.
23159 * doc.c (Fdocumentation, store_function_docstring):
23160 * data.c (Finteractive_form): Handle closures.
23162 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23165 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23167 (exec_byte_code): New function extracted from Fbyte_code to handle new
23168 calling convention for byte-code-functions. Add new byte-codes.
23170 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23172 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23174 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23176 * xdisp.c (redisplay_internal): Fix prototype.
23178 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23180 * xdisp.c (SCROLL_LIMIT): New macro.
23181 (try_scrolling): Use it when setting scroll_limit.
23182 Limit scrolling to 100 screen lines.
23183 (redisplay_window): Even when falling back on "recentering",
23184 position point in the window according to scroll-conservatively,
23185 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23187 (try_scrolling): When point is above the window, allow searching
23188 as far as scroll_max, or one screenful, to compute vertical
23189 distance from PT to the scroll margin position. This prevents
23190 try_scrolling from unnecessarily failing when
23191 scroll-conservatively is set to a value slightly larger than the
23192 window height. Clean up the case of PT below the margin at bottom
23193 of window: scroll_max can no longer be INT_MAX. When aggressive
23194 scrolling is in use, don't let point enter the opposite scroll
23195 margin as result of the scroll.
23196 (syms_of_xdisp) <scroll-conservatively>: Document the
23197 threshold of 100 lines for never-recentering scrolling.
23199 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23201 * dispextern.h (move_it_by_lines):
23202 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23203 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23204 (message_log_check_duplicate): Remove parameters `prev_bol' and
23205 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23206 (redisplay_internal): Remove parameter `preserve_echo_area',
23207 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23209 * indent.c (Fvertical_motion):
23210 * window.c (window_scroll_pixel_based, Frecenter):
23211 Don't pass `need_y_p' to `move_it_by_lines'.
23213 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23215 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23216 steal a few bits to be more compact.
23217 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23218 Remove unneeded casts.
23220 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23222 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23224 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23225 binding" message (bug#7967).
23227 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23229 Fix more problems found by GCC 4.6.0's static checks.
23231 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23232 Remove unused local var.
23234 * editfns.c (Fmessage_box): Remove unused local var.
23236 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23237 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23238 Omit unused local vars.
23239 * window.c (shrink_windows): Omit unused local var.
23240 * menu.c (digest_single_submenu): Omit unused local var.
23241 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23242 Omit unused local var.
23244 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23245 Don't assume string length fits in int.
23246 (keyremap_step, read_key_sequence): Use size_t for sizes.
23247 (read_key_sequence): Don't check last_real_key_start redundantly.
23249 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23250 instead of alloca (Bug#8344).
23252 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23253 (Fbacktrace_frame): Don't assume nframes fits in int.
23255 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23257 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23260 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23262 * cm.c (calccost): Turn while-do into do-while, for clarity.
23264 * keyboard.c (syms_of_keyboard): Use the same style as later
23265 in this function when indexing through an array. This also
23266 works around GCC bug 48267.
23268 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23270 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23272 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23273 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23275 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23276 This avoids undefined behavior on integer overflow, and is a bit
23277 more convenient anyway since it is compared to a size_t variable.
23279 Variadic C functions now count arguments with size_t, not int.
23280 This avoids an unnecessary limitation on 64-bit machines, which
23281 caused (substring ...) to crash on large vectors (Bug#8344).
23282 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23283 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23284 All variadic functions and their callers changed accordingly.
23285 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23286 * data.c (arith_driver, float_arith_driver): Likewise.
23287 * editfns.c (general_insert_function): Likewise.
23288 * eval.c (struct backtrace.nargs, interactive_p)
23289 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23290 (funcall_lambda, mark_backtrace): Likewise.
23291 * fns.c (concat): Likewise.
23292 * frame.c (x_set_frame_parameters): Likewise.
23293 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23294 0 if not found, not -1. All callers changed.
23296 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23297 (stack_copy_size): Now size_t, not int.
23298 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23300 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23302 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23303 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23304 All callers changed.
23306 * lisp.h (multibyte_char_to_unibyte):
23307 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23308 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23309 * character.h (CHAR_TO_BYTE8):
23310 * cmds.c (internal_self_insert):
23311 * editfns.c (general_insert_function):
23312 * keymap.c (push_key_description):
23313 * search.c (Freplace_match):
23314 * xdisp.c (message_dolog, set_message_1): All callers changed.
23316 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23318 * keyboard.c (safe_run_hook_funcall): New function.
23319 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23320 don't set the hook to nil, but remove the offending function instead.
23321 (Qcommand_hook_internal): Remove, unused.
23322 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23323 Vcommand_hook_internal.
23325 * eval.c (enum run_hooks_condition): Remove.
23326 (funcall_nil, funcall_not): New functions.
23327 (run_hook_with_args): Call each function through a `funcall' argument.
23328 Remove `cond' argument, now redundant.
23329 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23330 (Frun_hook_with_args_until_failure): Adjust accordingly.
23331 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23333 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23335 * dispextern.h (string_buffer_position): Remove declaration.
23337 * print.c (strout): Remove parameter `multibyte', unused since
23338 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23340 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23341 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23342 All callers changed.
23344 * w32.c (_wsa_errlist): Use braces for struct initializers.
23346 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23347 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23348 All callers changed.
23349 (string_buffer_position): Likewise. Also, make static (it's never
23350 used outside xdisp.c).
23351 (cursor_row_p): Remove parameter `w', unused since
23352 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23353 (decode_mode_spec): Remove parameter `precision', introduced during
23354 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23355 All callers changed.
23357 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23359 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23361 2011-03-27 Anders Lindgren <andlind@gmail.com>
23363 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23364 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23365 (ns_update_auto_hide_menu_bar): New functions.
23366 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23367 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23368 ns_constrain_all_frames.
23369 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23370 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23372 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23374 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23376 2011-03-27 Glenn Morris <rgm@gnu.org>
23378 * syssignal.h: Replace RETSIGTYPE with void.
23379 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23380 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23381 Replace SIGTYPE with void everywhere.
23382 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23383 * s/template.h (SIGTYPE): Remove commented out definition.
23385 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23387 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23388 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23390 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23392 * w32.c (read_unc_volume): Use parameter `henum', instead of
23393 global variable `wget_enum_handle'.
23395 * keymap.c (describe_vector): Remove parameters `indices' and
23396 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23397 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23399 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23401 * keyboard.c (timer_check): Remove parameter `do_it_now',
23402 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23403 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23404 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23406 * keyboard.c (read_char):
23407 * w32menu.c (w32_menu_display_help):
23408 * xmenu.c (show_help_event, menu_help_callback):
23409 Adjust calls to `show_help_echo'.
23411 * gtkutil.c (xg_maybe_add_timer):
23412 * keyboard.c (readable_events):
23413 * process.c (wait_reading_process_output):
23414 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23416 * insdel.c (adjust_markers_gap_motion):
23417 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23418 (gap_left, gap_right): Don't call it.
23420 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23422 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23423 incurred during fontification.
23425 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23427 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23428 (DEFVAR_PER_BUFFER): Don't pass it.
23430 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23431 (scrolling_window): Don't pass it.
23433 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23435 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23437 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23439 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23440 of variables specific to SELinux and computation of `encoded_absname'.
23442 * image.c (XPutPixel): Remove unused variable `height'.
23444 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23446 * unexw32.c (get_section_info): Remove unused variable `section'.
23448 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23449 (system_process_attributes): Remove unused variable `sess'.
23450 (sys_read): Remove unused variable `err'.
23452 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23453 (w32_wnd_proc): Remove unused variable `isdead'.
23454 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23455 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23456 (x_create_tip_frame): Remove unused variable `tem'.
23458 * w32inevt.c (w32_console_read_socket):
23459 Remove unused variable `no_events'.
23461 * w32term.c (x_draw_composite_glyph_string_foreground):
23462 Remove unused variable `width'.
23464 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23466 * w32term.c (x_set_glyph_string_clipping):
23467 Don't pass uninitialized region to CombineRgn.
23469 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23471 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23472 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23473 (Fx_close_connection): Remove unused variable `i'.
23475 * w32font.c (w32font_draw): Return number of glyphs.
23476 (w32font_open_internal): Remove unused variable `i'.
23477 (w32font_driver): Add missing initializer.
23479 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23480 (fill_in_menu): Remove unused variable `items_added'.
23482 * w32term.c (last_mouse_press_frame): Remove static global variable.
23483 (w32_clip_to_row): Remove unused variable `f'.
23484 (x_delete_terminal): Remove unused variable `i'.
23486 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23487 (NOTHING): Remove unused static global variable.
23488 (uniscribe_check_otf): Remove unused variable `table'.
23489 (uniscribe_font_driver): Add missing initializers.
23491 2011-03-23 Julien Danjou <julien@danjou.info>
23493 * term.c (Fsuspend_tty, Fresume_tty):
23494 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23495 * window.c (temp_output_buffer_show):
23496 * insdel.c (signal_before_change):
23497 * frame.c (Fhandle_switch_frame):
23498 * fileio.c (Fdo_auto_save):
23499 * emacs.c (Fkill_emacs):
23500 * editfns.c (save_excursion_restore):
23501 * cmds.c (internal_self_insert):
23502 * callint.c (Fcall_interactively):
23503 * buffer.c (Fkill_all_local_variables):
23504 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23506 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23507 unconditionally since it does the check itself.
23509 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23511 Fix more problems found by GCC 4.5.2's static checks.
23513 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23514 the first time through the loop, since we know p0 < p1 then.
23515 This also avoids a gcc -Wstrict-overflow warning.
23517 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23518 leading to a memory leak, possible in functions like
23519 load_charset_map_from_file that can allocate an unbounded number
23520 of objects (Bug#8318).
23522 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23523 that could (at least in theory) be that large.
23525 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23526 This is less likely to overflow, and avoids undefined behavior if
23527 overflow does occur. All callers changed. Use strtoul to scan
23528 for the unsigned long integer.
23529 (pint2hrstr): Simplify and tune code slightly.
23530 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23532 * scroll.c (do_scrolling): Work around GCC bug 48228.
23533 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23535 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23536 This also avoids a warning with gcc -Wstrict-overflow.
23537 (validate_x_resource_name): Simplify count usage.
23538 This also avoids a warning with gcc -Wstrict-overflow.
23540 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23543 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23545 * process.c (Fmake_network_process): Use socklen_t, not int,
23546 where POSIX says socklen_t is required in portable programs.
23547 This fixes a porting bug on hosts like 64-bit HP-UX, where
23548 socklen_t is wider than int (Bug#8277).
23549 (Fmake_network_process, server_accept_connection):
23550 (wait_reading_process_output, read_process_output):
23553 * process.c: Rename or move locals to avoid shadowing.
23554 (list_processes_1, Fmake_network_process):
23555 (read_process_output_error_handler, exec_sentinel_error_handler):
23556 Rename or move locals.
23557 (Fmake_network_process): Define label "retry_connect" only if needed.
23558 (Fnetwork_interface_info): Fix pointer signedness.
23559 (process_send_signal): Add cast to avoid pointer signedness problem.
23560 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23561 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23563 Make tparam.h and terminfo.c consistent.
23564 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23565 Include tparam.h instead, since it declares them.
23566 * cm.h (PC): Remove extern decl; tparam.h now does this.
23567 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23568 * terminfo.c: Include tparam.h, to check interfaces.
23569 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23570 (tparam): Adjust signature to match interface in tparam.h;
23571 this removes some undefined behavior. Check that outstring and len
23572 are zero, which they always are with Emacs.
23573 * tparam.h (PC, BC, UP): New extern decls.
23575 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23576 (xftfont_open): Rename locals to avoid shadowing.
23578 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23579 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23580 (OTF_TAG_SYM): Omit macro if not needed.
23581 (ftfont_list): Remove unused local.
23582 (get_adstyle_property, ftfont_pattern_entity):
23583 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23584 Rename locals to avoid shadowing.
23586 * xfont.c (xfont_list_family): Mark var as initialized.
23588 * xml.c (make_dom): Now static.
23590 * composite.c (composition_compute_stop_pos): Rename local to
23592 (composition_reseat_it): Remove unused locals.
23593 (find_automatic_composition, composition_adjust_point): Likewise.
23594 (composition_update_it): Mark var as initialized.
23595 (find_automatic_composition): Mark vars as initialized,
23596 with a FIXME (Bug#8290).
23598 character.h: Rename locals to avoid shadowing.
23599 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23600 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23601 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23602 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23603 to avoid shadowing.
23605 * textprop.c (property_change_between_p): Remove; unused.
23607 * intervals.c (interval_start_pos): Now static.
23609 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23611 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23612 Rename locals to avoid shadowing.
23614 * sound.c (wav_play, au_play, Fplay_sound_internal):
23615 Fix pointer signedness.
23616 (alsa_choose_format): Remove unused local var.
23617 (wav_play): Initialize a variable to 0, to prevent undefined
23618 behavior (Bug#8278).
23620 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23622 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23624 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23625 clobbering (Bug#8298).
23626 * sysdep.c (sys_subshell): Likewise.
23627 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23629 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23630 This should get cleaned up, so that child_setup has the
23631 same signature on all platforms.
23633 * callproc.c (call_process_cleanup): Now static.
23634 (relocate_fd): Rename locals to avoid shadowing.
23636 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23638 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23639 not to be necessary, and produces flickering.
23641 2011-03-20 Glenn Morris <rgm@gnu.org>
23643 * config.in: Remove file.
23645 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23647 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23648 are now in src/globals.h.
23649 (syms_of_minibuf): Remove spurious & from previous change.
23651 2011-03-20 Leo Liu <sdl.web@gmail.com>
23653 * minibuf.c (completing-read-function): New variable.
23654 (completing-read-default): Rename from completing-read.
23655 (completing-read): Call completing-read-function.
23657 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23659 * xfaces.c (Fx_load_color_file):
23660 Read color file from absolute filename (bug#8250).
23662 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23664 * makefile.w32-in: Update dependencies.
23666 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23668 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23670 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23672 Fix more problems found by GCC 4.5.2's static checks.
23674 * process.c (make_serial_process_unwind, send_process_trap):
23675 (sigchld_handler): Now static.
23677 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23678 That way, the code declares only the vars that it needs.
23679 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23680 * s/cygwin.h (PTY_ITERATION): Likewise.
23681 * s/darwin.h (PTY_ITERATION): Likewise.
23682 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23684 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23685 * process.c (allocate_pty): Don't declare stb unless it's needed.
23687 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23688 (CONSTANTLIM): Remove; unused.
23689 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23690 Define only if needed.
23692 * unexelf.c (unexec): Name an expression,
23693 to avoid gcc -Wbad-function-cast warning.
23694 Use a different way to cause a compilation error if anyone uses
23695 n rather than nn, a way that does not involve shadowing.
23696 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23698 * deps.mk (unexalpha.o): Remove; unused.
23700 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23701 * unexec.h: New file.
23702 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23703 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23704 Depend on unexec.h.
23705 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23706 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23707 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23708 Change as necessary to match prototype in unexec.h.
23710 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23712 (back_comment, skip_chars): Mark vars as initialized.
23714 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23715 Rename locals to avoid shadowing.
23717 * lread.c (read1): Rewrite so as not to use empty "else".
23718 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23720 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23722 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23723 warning when compiling print.c.
23725 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23726 instead of using an uninitialized var.
23727 (font_sort_entities): Mark var as initialized.
23729 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23731 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23732 pointers to constants.
23733 (font_parse_fcname): Remove unused vars.
23734 (font_delete_unmatched): Now static.
23735 (font_get_spec): Remove; unused.
23736 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23737 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23738 Rename or move locals to avoid shadowing.
23740 * fns.c (require_nesting_list, require_unwind): Now static.
23741 (Ffillarray): Rename locals to avoid shadowing.
23743 * floatfns.c (domain_error2): Define only if needed.
23744 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23746 * alloc.c (mark_backtrace): Move decl from here ...
23747 * lisp.h: ... to here, so that it can be checked.
23749 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23750 (Fdefvar): Rewrite so as not to use empty "else".
23751 (lisp_indirect_variable): Name an expression,
23752 to avoid gcc -Wbad-function-cast warning.
23753 (Fdefvar): Rename locals to avoid shadowing.
23755 * callint.c (quotify_arg, quotify_args): Now static.
23756 (Fcall_interactively): Rename locals to avoid shadowing.
23757 Use const pointer when appropriate.
23759 * lisp.h (get_system_name, get_operating_system_release):
23760 Move decls here, to check interfaces.
23761 * process.c (get_operating_system_release): Move decl to lisp.h.
23762 * xrdb.c (get_system_name): Likewise.
23763 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23764 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23765 some of which prompt warnings from gcc -Wbad-function-cast.
23766 (Fformat_time_string, Fencode_time, Finsert_char):
23767 (Ftranslate_region_internal, Fformat):
23768 Rename or remove local vars to avoid shadowing.
23769 (Ftranslate_region_internal): Mark var as initialized.
23771 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23774 * lisp.h (eassert): Check that the argument compiles, even if
23775 ENABLE_CHECKING is not defined.
23777 * data.c (Findirect_variable): Name an expression, to avoid
23778 gcc -Wbad-function-cast warning.
23779 (default_value, arithcompare, arith_driver, arith_error): Now static.
23780 (store_symval_forwarding): Rename local to avoid shadowing.
23781 (Fmake_variable_buffer_local, Fmake_local_variable):
23782 Mark variables as initialized.
23783 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23785 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23786 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23787 Rename locals to avoid shadowing.
23788 (mark_stack): Move local variables into the #ifdef region where
23790 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23791 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23793 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23794 (GC_STRING_CHARS): Remove; not used.
23795 (Fmemory_limit): Cast sbrk's returned value to char *.
23797 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23798 avoids undefined behavior in theory.
23800 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23802 Use functions, not macros, for up- and down-casing (Bug#8254).
23803 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23804 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23805 to use the following functions instead of these macros.
23806 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23807 EMACS_INT, since callers assume the returned value fits in int.
23808 (upcase1): Likewise, for UPCASE_TABLE.
23809 (uppercasep, lowercasep, upcase): New static inline functions.
23810 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23811 the race-condition problem in the old DOWNCASE.
23813 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23814 Rename locals to avoid shadowing.
23815 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23816 (regex_compile, re_search_2, re_match_2_internal):
23817 Remove unused local vars.
23818 (FREE_VAR): Rewrite so as not to use empty "else",
23819 which gcc can warn about.
23820 (regex_compile, re_match_2_internal): Mark locals as initialized.
23821 (RETALLOC_IF): Define only if needed.
23822 (WORDCHAR_P): Likewise. This one is never needed, but is used
23823 only in a comment talking about a compiler bug, so put inside
23824 the #if 0 of that comment.
23825 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23826 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23829 * search.c (boyer_moore): Rename locals to avoid shadowing.
23830 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23831 (PREV_CHAR_BOUNDARY): Likewise.
23833 * search.c (simple_search): Remove unused var.
23835 * dired.c (compile_pattern): Move decl from here ...
23836 * lisp.h: ... to here, so that it can be checked.
23837 (struct re_registers): New forward decl.
23839 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23841 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23843 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23844 Rename locals to avoid shadowing.
23845 (Fvertical_motion): Mark locals as initialized.
23847 * casefiddle.c (casify_object, casify_region): Now static.
23848 (casify_region): Mark local as initialized.
23850 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23852 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23853 New macros, so that the caller can use some names other than
23854 gcpro1, gcpro2, etc.
23855 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23857 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23858 argument, for consistency with GCPRO2_VAR, etc: it is now the
23859 prefix of the variable, not the variable itself. All uses
23861 * dired.c (directory_files_internal, file_name_completion):
23862 Rename locals to avoid shadowing.
23864 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23865 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23866 dired.c's scmp function, had undefined behavior.
23867 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23868 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23869 * buffer.h: ... to here, because these macros use current_buffer,
23870 and the new implementation with inline functions needs to have
23871 current_buffer in scope now, rather than later when the macros
23873 (downcase, upcase1): New static inline functions.
23874 (DOWNCASE, UPCASE1): Reimplement using these functions.
23875 This avoids undefined behavior in expressions like
23876 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23877 from race conditions in accessing the global variables
23878 case_temp1 and case_temp2.
23879 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23880 * lisp.h (case_temp1, case_temp2): Remove their decls.
23881 * character.h (ASCII_CHAR_P): Move from here ...
23882 * lisp.h: ... to here, so that the inline functions mentioned
23883 above can use them.
23885 * dired.c (directory_files_internal_unwind): Now static.
23887 * fileio.c (file_name_as_directory, directory_file_name):
23888 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23890 (file_name_as_directory): Use const pointers when appropriate.
23891 (Fexpand_file_name): Likewise. In particular, newdir might
23892 point at constant storage, so make it a const pointer.
23893 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23894 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23896 (Fset_file_times, Finsert_file_contents, auto_save_error):
23897 Rename locals to avoid shadowing.
23899 * minibuf.c (choose_minibuf_frame_1): Now static.
23900 (Ftry_completion, Fall_completions): Rename or remove locals
23901 to avoid shadowing.
23903 * marker.c (bytepos_to_charpos): Remove; unused.
23905 * lisp.h (verify_bytepos, count_markers): New decls,
23906 so that gcc does not warn that these functions aren't declared.
23908 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23909 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23910 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23911 (copy_text): Remove unused local var.
23913 * filelock.c (within_one_second): Now static.
23914 (lock_file_1): Rename local to avoid shadowing.
23916 * buffer.c (fix_overlays_before): Mark locals as initialized.
23917 (fix_start_end_in_overlays): Likewise. This function should be
23918 simplified by using pointers-to-pointers, but that's a different
23920 (switch_to_buffer_1): Now static.
23921 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23922 (report_overlay_modification): Rename locals to avoid shadowing.
23924 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23925 Fix pointer signedness issue.
23926 (sys_subshell): Mark local as volatile if checking for lint,
23927 to suppress a gcc -Wclobbered warning that does not seem to be right.
23928 (MAXPATHLEN): Define only if needed.
23930 * process.c (serial_open, serial_configure): Move decls from here ...
23931 * systty.h: ... to here, so that they can be checked.
23933 * fns.c (get_random, seed_random): Move extern decls from here ...
23934 * lisp.h: ... to here, so that they can be checked.
23936 * sysdep.c (reset_io): Now static.
23937 (wait_for_termination_signal): Remove; unused.
23939 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23940 (copy_keymap_item, append_key, push_text_char_description):
23942 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23943 (DENSE_TABLE_SIZE): Remove; unused.
23944 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23945 (describe_map_tree):
23946 Rename locals to avoid shadowing.
23948 * keyboard.c: Declare functions static if they are not used elsewhere.
23949 (echo_char, echo_dash, cmd_error, top_level_2):
23950 (poll_for_input, handle_async_input): Now static.
23951 (read_char, kbd_buffer_get_event, make_lispy_position):
23952 (make_lispy_event, make_lispy_movement, apply_modifiers):
23953 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23954 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23955 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23956 (read_key_sequence, read_char): Mark locals as initialized.
23957 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23959 * keyboard.h (make_ctrl_char): New decl.
23960 (mark_kboards): Move decl here ...
23961 * alloc.c (mark_kboards): ... from here.
23963 * lisp.h (force_auto_save_soon): New decl.
23965 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23966 (DEFINE_DUMMY_FUNCTION): New macro.
23967 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23969 (main): Add casts to avoid warnings
23970 if GCC considers string literals to be constants.
23972 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23974 * dbusbind.c: Pointer signedness fixes.
23975 (xd_signature, xd_append_arg, xd_initialize):
23976 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23977 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23978 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23979 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23981 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23982 if GCC considers string literals to be constants.
23983 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23985 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23987 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23988 (print_preprocess, print_object): New macro to fix last change.
23990 * print.c (print_preprocess): Don't forget font objects.
23992 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23994 * emacs.c (USAGE3): Doc fixes.
23996 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23998 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24001 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
24003 * lisp.h (VWindow_system, Qfile_name_history):
24004 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24005 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24006 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24008 * w32select.c: Don't #include "keyboard.h".
24009 (run_protected): Add extern declaration for waiting_for_input.
24011 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24012 * w32console.c (detect_input_pending, read_input_pending)
24013 (encode_terminal_code):
24014 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24015 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24016 (w32_system_caret_y, Qfile_name_history):
24017 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24018 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24019 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24020 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24021 * w32proc.c (Qlocal, report_file_error):
24022 * w32term.c (Vwindow_system, updating_frame):
24023 * w32uniscribe.c (initialized, uniscribe_font_driver):
24024 Remove unneeded extern declarations.
24026 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
24028 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24030 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24032 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24033 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24034 These macros can no longer be used for assignment.
24036 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24037 Assign struct members directly, instead of using BUF_BEGV etc.
24038 (record_buffer_markers, fetch_buffer_markers): New functions for
24039 recording and fetching special buffer markers.
24040 (set_buffer_internal_1, set_buffer_temp): Use them.
24042 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24044 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24046 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24047 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24049 * xdisp.c (hscroll_window_tree):
24050 (reconsider_clip_changes): Use PT instead of BUF_PT.
24052 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24054 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24055 $(EMACS_ROOT)/lib/intprops.h.
24057 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24059 Fix more problems found by GCC 4.5.2's static checks.
24061 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24062 to unsigned char * to avoid compiler diagnostic.
24063 (xg_free_frame_widgets): Make it clear that a local variable is
24064 needed only if USE_GTK_TOOLTIP.
24065 (gdk_window_get_screen): Make it clear that this macro is needed
24066 only if USE_GTK_TOOLTIP.
24067 (int_gtk_range_get_value): New function, which avoids a diagnostic
24068 from gcc -Wbad-function-cast.
24069 (xg_set_toolkit_scroll_bar_thumb): Use it.
24070 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24071 diagnostic from gcc -Wbad-function-cast.
24072 (get_utf8_string, xg_get_file_with_chooser):
24073 Rename locals to avoid shadowing.
24074 (create_dialog): Move locals to avoid shadowing.
24076 * xgselect.c (xg_select): Remove unused var.
24078 * image.c (four_corners_best): Mark locals as initialized.
24079 (gif_load): Initialize transparent_p to zero (Bug#8238).
24080 Mark another local as initialized.
24081 (my_png_error, my_error_exit): Mark with NO_RETURN.
24083 * image.c (clear_image_cache): Now static.
24084 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24085 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24086 (x_edge_detection): Remove unnecessary cast that
24087 gcc -Wbad-function-cast diagnoses.
24088 (gif_load): Fix pointer signedness.
24089 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24090 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24092 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24094 Improve quality of tests for time stamp overflow.
24095 For example, without this patch (encode-time 0 0 0 1 1
24096 1152921504606846976) returns the obviously-bogus value (-948597
24097 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24098 reports time overflow. See
24099 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24100 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24101 * editfns.c: Include limits.h and intprops.h.
24102 (TIME_T_MIN, TIME_T_MAX): New macros.
24103 (time_overflow): Move earlier, to before first use.
24104 (hi_time, lo_time): New functions, for an accurate test for
24105 out-of-range times.
24106 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24107 (Fget_internal_run_time): Don't assume time_t fits in int.
24108 (make_time): Use list2 instead of Fcons twice.
24109 (Fdecode_time): More accurate test for out-of-range times.
24110 (check_tm_member): New function.
24111 (Fencode_time): Use it, to test for out-of-range times.
24112 (lisp_time_argument): Don't rely on undefined left-shift and
24113 right-shift behavior when checking for time stamp overflow.
24115 * editfns.c (time_overflow): New function, refactoring common code.
24116 (Fformat_time_string, Fdecode_time, Fencode_time):
24117 (Fcurrent_time_string): Use it.
24119 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24120 * dired.c (make_time): Move to ...
24121 * editfns.c (make_time): ... here.
24122 * systime.h: Note the move.
24124 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24126 * fringe.c (update_window_fringes): Remove unused variables.
24128 * unexmacosx.c (copy_data_segment): Also copy __got section.
24131 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24133 * termcap.c [MSDOS]: Include "msdos.h".
24134 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24135 Constify `char *' arguments and their references according to
24136 prototypes in tparam.h.
24138 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24140 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24141 Adapt all references accordingly.
24143 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24145 2011-03-11 Tom Tromey <tromey@redhat.com>
24147 * buffer.c (syms_of_buffer): Remove obsolete comment.
24149 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24151 * termhooks.h (encode_terminal_code): Declare prototype.
24153 * msdos.c (encode_terminal_code): Don't declare prototype.
24155 * term.c (encode_terminal_code): Now external again, used by
24156 w32console.c and msdos.c.
24158 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24159 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24161 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24163 Fix some minor problems found by GCC 4.5.2's static checks.
24165 * fringe.c (update_window_fringes): Mark locals as initialized
24167 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24169 * alloc.c (mark_fringe_data): Move decl from here ...
24170 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24171 to check its interface.
24172 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24174 * fontset.c (free_realized_fontset): Now static.
24175 (Fset_fontset_font): Rename local to avoid shadowing.
24176 (fontset_font): Mark local as initialized.
24177 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24179 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24181 * xselect.c (x_disown_buffer_selections): Remove; not used.
24182 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24183 (x_own_selection, Fx_disown_selection_internal): Rename locals
24184 to avoid shadowing.
24185 (x_handle_dnd_message): Remove local to avoid shadowing.
24187 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24188 so that the caller can use some name other than gcpro1.
24189 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24190 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24191 (Fx_backspace_delete_keys_p):
24192 Use them to avoid shadowing, and rename vars to avoid shadowing.
24193 (x_decode_color, x_set_name, x_window): Now static.
24194 (Fx_create_frame): Add braces to silence GCC warning.
24195 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24196 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24197 Remove unused locals.
24198 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24199 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24200 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24203 * xterm.h (x_mouse_leave): New decl.
24205 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24206 Remove unused functions.
24207 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24208 (x_calc_absolute_position): Now static.
24209 (XTread_socket): Don't define label "out" unless it's used.
24210 Don't declare local "event" unless it's used.
24211 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24212 unless they are used.
24213 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24214 (x_fatal_error_signal): Remove; not used.
24215 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24216 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24217 (x_error_catcher, x_connection_closed, x_error_handler):
24218 (x_error_quitter, xembed_send_message, x_iconify_frame):
24219 (my_log_handler): Rename locals to avoid shadowing.
24220 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24221 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24223 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24224 Rename or move locals to avoid shadowing.
24225 (tty_defined_color, merge_face_heights): Now static.
24226 (free_realized_faces_for_fontset): Remove; not used.
24227 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24228 does not deduce is never used uninitialized.
24229 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24230 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24232 * terminal.c (store_terminal_param): Now static.
24234 * xmenu.c (menu_highlight_callback): Now static.
24235 (set_frame_menubar): Remove unused local.
24236 (xmenu_show): Rename parameter to avoid shadowing.
24237 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24238 since they might point to immutable storage.
24239 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24240 since it's unused otherwise.
24242 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24243 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24244 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24245 avoids a gcc -Wuninitialized diagnostic.
24246 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24247 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24248 does not deduce are never used uninitialized.
24250 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24252 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24253 * window.c (window_loop, size_window):
24254 (run_window_configuration_change_hook, enlarge_window): Likewise.
24256 * window.c (display_buffer): Now static.
24257 (size_window): Mark variables that gcc -Wuninitialized
24258 does not deduce are never used uninitialized.
24259 * window.h (check_all_windows): New decl, to forestall
24260 gcc -Wmissing-prototypes diagnostic.
24261 * dispextern.h (bidi_dump_cached_states): Likewise.
24263 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24265 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24266 Include <limits.h>.
24267 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24268 and to avoid gcc -Wuninitialized warning.
24269 (load_charset_map): Mark variables that gcc -Wuninitialized
24270 does not deduce are never used uninitialized.
24271 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24273 * coding.c (coding_set_source, coding_set_destination):
24274 Use "else { /* comment */ }" rather than "else /* comment */;"
24275 for clarity, and to avoid gcc -Wempty-body warning.
24276 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24277 a block, when the outer 'i' will do.
24278 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24279 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24280 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24281 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24282 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24283 Rename locals to avoid shadowing.
24284 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24285 * coding.c (emacs_mule_char, encode_invocation_designation):
24286 Now static, since they're not used elsewhere.
24287 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24288 (decode_coding_object, encode_coding_object, detect_coding_system):
24289 (decode_coding_emacs_mule): Mark variables that gcc
24290 -Wuninitialized does not deduce are never used uninitialized.
24291 (detect_coding_iso_2022): Initialize a local variable that might
24292 be used uninitialized. Leave a FIXME because it's not clear that
24293 this initialization is needed. (Bug#8211)
24294 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24295 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24296 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24297 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24298 Remove unused macros.
24300 * category.c (hash_get_category_set): Remove unused local var.
24301 (copy_category_table): Now static, since it's not used elsewhere.
24302 * character.c (string_count_byte8): Likewise.
24304 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24305 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24307 * chartab.c (copy_sub_char_table): Now static, since it's not used
24309 (sub_char_table_ref_and_range, char_table_ref_and_range):
24310 Rename locals to avoid shadowing.
24311 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24313 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24314 (BIDI_BOB): Remove unused macro.
24316 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24317 deduce are never used uninitialized.
24318 * term.c (encode_terminal_code): Likewise.
24320 * term.c (encode_terminal_code): Now static. Remove unused local.
24322 * tparam.h: New file.
24323 * term.c, tparam.h: Include it.
24324 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24325 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24326 Move these decls to tparam.h, and make them agree with what
24327 is actually in tparam.c. The previous trick of using incompatible
24328 decls in different modules does not conform to the C standard.
24329 All callers of tparam changed to use tparam's actual API.
24330 * tparam.c (tparam1, tparam, tgoto):
24331 Use const pointers where appropriate.
24333 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24334 * cm.h (struct cm): Likewise.
24335 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24336 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24337 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24338 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24339 (turn_on_face, init_tty): Likewise.
24340 * termchar.h (struct tty_display_info): Likewise.
24342 * term.c (term_mouse_position): Rename local to avoid shadowing.
24344 * alloc.c (mark_ttys): Move decl from here ...
24345 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24347 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24349 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24351 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24353 * search.c (compile_pattern_1): Remove argument regp, unused since
24354 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24355 (compile_pattern): Don't pass it.
24357 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24359 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24360 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24362 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24364 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24366 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24367 gdk_window_get_screen, gdk_window_get_geometry,
24368 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24369 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24370 (xg_get_pixbuf_from_pixmap): New function.
24371 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24372 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24373 Call xg_get_pixbuf_from_pixmap instead of
24374 gdk_pixbuf_get_from_drawable.
24375 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24376 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24377 (xg_check_special_colors): Use GtkStyleContext and its functions
24379 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24380 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24381 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24382 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24383 Call gtk_widget_get_preferred_size.
24384 (xg_frame_resized): gdk_window_get_geometry only takes 5
24386 (xg_win_to_widget, xg_event_is_for_menubar):
24387 Call gdk_x11_window_lookup_for_display.
24388 (xg_set_widget_bg): New function.
24389 (delete_cb): New function.
24390 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24391 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24392 (xg_set_background_color): Call xg_set_widget_bg.
24393 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24394 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24395 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24396 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24398 (update_frame_tool_bar): Call gtk_widget_hide.
24399 (xg_initialize): Use GDK_KEY_g.
24401 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24403 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24405 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24406 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24407 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24409 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24411 * w32xfns.c (select_palette): Check success of RealizePalette against
24412 GDI_ERROR, not zero.
24414 See ChangeLog.11 for earlier changes.
24416 ;; Local Variables:
24420 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24422 This file is part of GNU Emacs.
24424 GNU Emacs is free software: you can redistribute it and/or modify
24425 it under the terms of the GNU General Public License as published by
24426 the Free Software Foundation, either version 3 of the License, or
24427 (at your option) any later version.
24429 GNU Emacs is distributed in the hope that it will be useful,
24430 but WITHOUT ANY WARRANTY; without even the implied warranty of
24431 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24432 GNU General Public License for more details.
24434 You should have received a copy of the GNU General Public License
24435 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.