Minor cleanup in last commit in get_it_property.
[bpt/emacs.git] / src / ChangeLog
1 2013-06-10 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (get_it_property): Use it->window instead of generating
4 a Lisp object from it->w.
5
6 2013-06-09 Eli Zaretskii <eliz@gnu.org>
7
8 * xdisp.c (get_it_property): If it->object is a buffer, pass to
9 get-char-property the window that is being rendered, instead of
10 the buffer, to support window-specific overlays. (Bug#14575)
11 (compute_display_string_pos): When W is NULL, use the current
12 buffer as the object to pass to get-char-property.
13 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
14 pointer member of the bidi iterator, since no window is pertinent
15 to this function.
16
17 2013-06-08 Eli Zaretskii <eliz@gnu.org>
18
19 * bidi.c (bidi_fetch_char): Accept additional argument, the window
20 being displayed, and pass it to compute_display_string_pos.
21 (bidi_level_of_next_char, bidi_resolve_explicit_1)
22 (bidi_paragraph_init): All callers changed.
23
24 * xdisp.c (init_from_display_pos, init_iterator)
25 (handle_single_display_spec, next_overlay_string)
26 (get_overlay_strings_1, reseat_1, reseat_to_string)
27 (push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set
28 bidi_it.w member from it->w.
29 (compute_display_string_pos): Accept additional argument, the
30 window being displayed, and pass it to Fget_char_property.
31 (Bug#14575)
32
33 * dispextern.h (struct bidi_it): New member w, the window being
34 displayed.
35 (compute_display_string_pos): Adjust prototype.
36
37 2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
38
39 * xgselect.c: Remove unneeded include xterm.h
40
41 * process.c (wait_reading_process_output): Check for NS before GLIB.
42 GLIB may be linked in due to rsvg, but ns_select must be called.
43
44 * xgselect.c (xg_select): Remove call to window_system_available
45 and g_main_context_pending at the top, so Gdk events (i.e. file
46 notify) are processed when Emacs is started with -nw.
47
48 2013-06-07 Eli Zaretskii <eliz@gnu.org>
49
50 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
51 (ctagsfiles3): New variable, includes only *.m files.
52 (TAGS): Use an explicit language name in the regular expressions,
53 to avoid transformation of '/SOMETHING' by MSYS to
54 'c:\MSYS\SOMETHING'.
55
56 2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
57
58 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
59
60 2013-06-06 Eli Zaretskii <eliz@gnu.org>
61
62 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
63 still need to set the mouse pointer shape and activate help-echo.
64 (Bug#14558)
65
66 2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
67
68 A few porting etc. fixes for the new file monitor code.
69 See the thread containing
70 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
71 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
72 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
73 (dir_monitor_callback, Fgfile_rm_watch):
74 Use assq_no_quit instead of Fassoc, for speed.
75 (dir_monitor_callback, Fgfile_rm_watch):
76 eassert that the monitor is a fixnum.
77 (dir_monitor_callback): No need for CDR_SAFE.
78 Simplify building of lisp with alternative tails.
79 (Fgfile_add_watch, Fgfile_rm_watch):
80 Do not assume glib functions set errno reliably on failure.
81 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
82 and signal an error otherwise.
83 (Fgfile_rm_watch): Prefer CONSP to !NILP.
84 Use Fdelq instead of Fdelete, for speed.
85
86 2013-06-05 Eli Zaretskii <eliz@gnu.org>
87
88 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
89 don't insist on being invoked on a highlighted tool-bar button.
90 Avoids losing tool-bar functionality when mouse-highlight is nil.
91 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
92 Don't highlight when mouse-highlight is nil.
93 (note_mouse_highlight): When mouse-highlight is nil, don't return
94 right away; instead, run tool-bar and mode-line highlight
95 subroutine, clear any existing highlight, and revert the mouse
96 pointer to its default shape. (Bug#14558)
97
98 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
99
100 * lisp.mk (lisp): Add prog-mode.el.
101
102 2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
103
104 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
105 * process.c (dummy_handler): New function.
106 (lib_child_handler): New static var.
107 (handle_child_signal): Invoke it.
108 (catch_child_signal): If a library has set up a signal handler,
109 save it into lib_child_handler.
110 (init_process_emacs): If using glib and not on Windows, tickle glib's
111 child-handling code so that it initializes its private SIGCHLD handler.
112 * syssignal.h (SA_SIGINFO): Default to 0.
113 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
114 31; it should no longer be needed now.
115
116 2013-06-05 Michael Albinus <michael.albinus@gmx.de>
117
118 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
119
120 * gfilenotify.c (globals_of_gfilenotify): New function.
121 (syms_of_gfilenotify): Move global initialization there.
122
123 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
124
125 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
126
127 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
128 * keyboard.c (menu_bar_items, tool_bar_items):
129 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
130 not override local keymaps any more.
131
132 2013-06-04 Eli Zaretskii <eliz@gnu.org>
133
134 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
135
136 2013-06-03 Eli Zaretskii <eliz@gnu.org>
137
138 * w32console.c (initialize_w32_display): Return the dimensions of
139 the console window via 2 additional arguments, not via the current
140 frame. This avoids crashes due to overrunning the bounds of
141 frame's decode_mode_spec_buffer, which is not resized following
142 the change of the frame dimensions from the initial 10x10.
143
144 * w32term.h (w32_initialize_display_info): Adjust prototype.
145
146 * term.c (init_tty): Take dimensions of the frame from the values
147 returned by initialize_w32_display.
148
149 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
150 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
151 (LIBES): Add $(GFILENOTIFY_LIBS).
152
153 * w32inevt.c (handle_file_notifications): Add dummy implementation
154 for !HAVE_W32NOTIFY.
155
156 * w32term.c: Wrap code with HAVE_W32NOTIFY.
157
158 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
159
160 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
161
162 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
163
164 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
165
166 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
167
168 Fix minor problems found by static checking.
169 * data.c (pure_write_error):
170 Use xsignal2, not Fsignal, as Fsignal might return.
171 * eval.c (set_backtrace_debug_on_exit): Now static.
172 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
173 No longer inline. EXTERN_INLINE is needed only for functions
174 defined in .h files. Reindent function header as per GNU style.
175 (backtrace_p, backtrace_top, backtrace_next):
176 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
177 compiler or linker. Add extern decls to pacify gcc -Wall.
178 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
179 Now static.
180 * frame.c (free_monitors): Define only on platforms that need it.
181 * nsterm.m (ns_term_init):
182 * process.c (catch_child_signal):
183 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
184 defined on all porting targets these days.
185 * process.c, process.h (catch_child_signal):
186 Make it extern only if NS_IMPL_GNUSTEP is defined.
187
188 2013-06-03 Eli Zaretskii <eliz@gnu.org>
189
190 * w32.c (gettimeofday): Make the signature identical to prototype
191 in nt/inc/sys/time.h.
192
193 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
194
195 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
196 .gdbinit.
197
198 * keyboard.c (safe_run_hooks_error): Improve error message.
199
200 * data.c (pure_write_error): Add `object' argument.
201 * puresize.h (CHECK_IMPURE): Use it.
202
203 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
204
205 * Makefile.in (NOTIFY_OBJ): New variable.
206 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
207
208 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
209 Call syms_of_gfilenotify.
210
211 * gfilenotify.c: New file.
212
213 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
214 and Qfile_w32notify.
215 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
216 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
217
218 * lisp.h: Declare syms_of_gfilenotify.
219
220 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
221
222 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
223
224 Merge the specpdl and backtrace stacks. Make the structure of the
225 specpdl entries more obvious via a tagged union of structs.
226 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
227 (enum specbind_tag): New enum.
228 (struct specbinding): Make it a tagged union of structs.
229 Add a case for backtrace records.
230 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
231 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
232 (backtrace_debug_on_exit): New accessors.
233 (struct backtrace): Remove.
234 (struct catchtag): Remove backlist field.
235 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
236 Move to eval.c.
237 (Flocal_variable_p): Speed up the common case where the binding is
238 already loaded.
239 * eval.c (backtrace_list): Remove.
240 (set_specpdl_symbol, set_specpdl_old_value): Remove.
241 (set_backtrace_args, set_backtrace_nargs)
242 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
243 (backtrace_next): New functions.
244 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
245 (unwind_to_catch, internal_lisp_condition_case)
246 (internal_condition_case, internal_condition_case_1)
247 (internal_condition_case_2, internal_condition_case_n): Don't bother
248 with backtrace_list any more.
249 (Fsignal): Adjust to new backtrace format.
250 (grow_specpdl): Move up.
251 (record_in_backtrace): New function.
252 (eval_sub, Ffuncall): Use it.
253 (apply_lambda): Adjust to new backtrace format.
254 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
255 data.c.
256 (specbind): Adjust to new specpdl format. Simplify.
257 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
258 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
259 backtrace format.
260 (mark_backtrace): Remove.
261 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
262 * xdisp.c (redisplay_internal): Use record_in_backtrace.
263 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
264 Use mark_specpdl.
265 * profiler.c (record_backtrace): Use get_backtrace.
266 (handle_profiler_signal): Use backtrace_top_function.
267 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
268 accessor functions.
269
270 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
271
272 * process.h (catch_child_signal): Declare.
273
274 * process.c (catch_child_signal): New function.
275 (init_process_emacs): Call it.
276
277 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
278 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
279 NS_IMPL_COCOA.
280 (x_set_cursor_type): Remove declaration.
281 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
282 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
283 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
284 (ns_get_color): Use F suffix on float.
285 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
286 (ns_get_rgb_color): Remove.
287 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
288 (note_mouse_movement): x and y are CGFloat.
289 (ns_draw_fringe_bitmap): Remove unused rowY.
290 Change #if to COCOA && >= 10_6.
291 (ns_draw_window_cursor): Remove unused overspill.
292 (ns_draw_underwave): width and x are EamcsCGFloat.
293 (ns_draw_box): thickness is CGFloat.
294 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
295 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
296 if not in main thread.
297 (ns_get_pending_menu_title, ns_check_menu_open)
298 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
299 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
300 (sendFromMainThread:): New method.
301 (changeFont:): size is CGFloat.
302 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
303 Disable warning about permanent text.
304 (characterIndexForPoint:): Adjust return type depending on GNUStep
305 version.
306 (mouseDown:): delta is CGFloat.
307 (updateFrameSize): Remove unised variable f.
308 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
309 Cast float to EmacsCGFloat.
310 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
311 also to -1 when restoring.
312 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
313 inside NS_IMPL_COCOA.
314 (toggleFullScreen:): Put call to toggleFullScreen inside
315 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
316 (setPosition:portion:whole:): por is CGFloat.
317 (getMouseMotionPart:window:x:y:): Add F suffix to float.
318 (mouseDown:): Use CGFloat.
319 (mouseDragged:): Remove unised variable edge.
320 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
321
322 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
323 of CGFloat differs.
324 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
325 when NS_IMPL_GNUSTEP.
326 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
327 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
328 (EmacsToolbar): Add clearAll. Add tag argument to
329 addDisplayItemWithImage.
330 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
331
332 * nsselect.m (ns_get_local_selection): Remove unused variable type.
333
334 * nsmenu.m (ns_update_menubar): Make static.
335 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
336 (fillWithWidgetValue:): Add cast to SEL for setAction.
337 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
338 (update_frame_tool_bar): Update code for GNUStep.
339 (clearAll): New method.
340 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
341 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
342 identifierToItem setObject and activeIdentifiers addObject before
343 call to insertItemWithItemIdentifier.
344 (validateVisibleItems): Fix indentation.
345 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
346 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
347 UtilityWindow to aStyle, remove call to setStyleMask.
348
349 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
350
351 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
352 (ns_charset_covers, ns_get_covering_families, nsfont_open):
353 Use F suffix on floats.
354 (ns_char_width): Returns CGFloat.
355 (ns_ascii_average_width): w is CGFloat instead of float.
356 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
357 DPSxshow.
358 (ns_glyph_metrics): CGFloat instead of float.
359
360 * nsfns.m (x_set_foreground_color, x_set_background_color):
361 Use EmacsCGFloat.
362 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
363 remove unused variables.
364 (Fns_read_file_name): Keep track if panel is for save.
365 Use ns_filename_from_panel/ns_directory_from_panel.
366 (Fns_list_services): delegate only used for COCOA.
367 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
368 Just return the input if GNUStep.
369 (x_screen_planes): Remove.
370 (Fxw_color_values): Use EmacsCGFloat
371 (Fns_display_monitor_attributes_list): Only get screen number for
372 Cocoa.
373 (getDirectory, getFilename): Removed from EmacsOpenPanel and
374 EmacsSavePanel.
375 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
376 ns_directory_from_panel.
377
378 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
379
380 * process.c (handle_child_signal): Also use WCONTINUED.
381 This is so that list-processes doesn't mistakenly list the process
382 as stopped, when the process has actually been continued and is
383 now running.
384
385 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
386
387 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
388 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
389 not already configured.
390
391 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
392
393 2013-05-29 Eli Zaretskii <eliz@gnu.org>
394
395 * Makefile.in (mostlyclean): Remove *.res files.
396
397 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
398
399 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
400 a buffer (bug#8447).
401
402 2013-05-27 Eli Zaretskii <eliz@gnu.org>
403
404 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
405 display vector, and we backtrack, handle the case that the
406 previous character position is also displayed from a display
407 vector or covered by a display string or image. (Bug#14476)
408
409 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
410
411 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
412 (struct MonitorInfo, free_monitors): Remove.
413 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
414 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
415 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
416 Qframes, Qsource.
417
418 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
419 (struct MonitorInfo, free_monitors): Remove.
420 (ns_screen_name): Make static.
421 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
422 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
423 Qframes, Qsource.
424
425 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
426 (struct MonitorInfo): New struct.
427 (free_monitors, make_monitor_attribute_list): Declare.
428
429 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
430 New Lisp_Object:s.
431 (free_monitors, make_monitor_attribute_list): New functions.
432 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
433 Qsource.
434
435 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
436
437 * callproc.c (call_process): Refine the doc string. (Bug#14045)
438
439 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
440
441 * keyboard.c: Apply keyboard decoding only to events that come directly
442 from the tty, not from unread-command-events (bug#14368).
443 (read_event_from_main_queue): New function, extracted from read_char).
444 (read_decoded_char): Remove.
445 (read_decoded_event_from_main_queue): New function to replace it.
446 (read_char): Use it.
447 (read_key_sequence): Use read_char rather than read_decoded_char.
448
449 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
450
451 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
452
453 * casetab.c (init_casetab_once): Fix last change (bug#14424).
454
455 2013-05-22 Kenichi Handa <handa@gnu.org>
456
457 The following changes are to fix the setting of
458 buffer-file-coding-system on, for instance, C-x RET c unix RET
459 _FILE_OF_DOS_EOL_TYPE_ RET.
460
461 * coding.h (struct coding_system): New member detected_utf8_chars.
462
463 * coding.c (detect_coding_utf_8): Count characters and check EOL
464 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
465 BOM is there.
466 (setup_coding_system): Do not initialize coding->head_ascii.
467 (check_ascii): Do not set coding->eol_seen but update it. Do not
468 call adjust_coding_eol_type here.
469 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
470 If the eol-type of CODING is already specified, adjust the eol type
471 of the found coding-system.
472 (decode_coding_gap): Cancel previous change. Utilize the
473 character numbers counted by detect_coding_utf_8. Fix detection
474 of BOM for utf-8.
475
476 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
477
478 * search.c (looking_at_1): Only set last_thing_searched if the match
479 changed the match-data (bug#14281).
480
481 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
482
483 * xdisp.c (reseat_at_previous_visible_line_start):
484 Already declared in dispextern.h, so remove it here.
485 (move_it_vertically_backward): Likewise.
486
487 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
488
489 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
490 (Fx_display_pixel_width, Fx_display_pixel_height)
491 (Fx_display_mm_width, Fx_display_mm_height):
492 Mention `display-monitor-attributes-list' in docstrings.
493
494 * nsfns.m (ns_get_screen): Remove function. All uses removed.
495 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
496 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
497 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
498 (Fx_display_backing_store, Fx_display_visual_class)
499 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
500 (Fx_display_grayscale_p, Fx_display_pixel_width)
501 (Fx_display_pixel_height, Fx_display_planes)
502 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
503 (Fx_display_screens): Don't confuse X11 screens with NS screens.
504 (Fx_display_mm_width, Fx_display_mm_height)
505 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
506 height for all physical monitors as in X11.
507
508 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
509 Return pixel width or height for all physical monitors as in X11.
510
511 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
512
513 Port --enable-gcc-warnings to clang.
514 * bytecode.c (exec_byte_code):
515 * regex.c:
516 Redo diagnostic pragmas to pacify clang, too.
517 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
518 * editfns.c (Fencode_time):
519 * fileio.c (file_accessible_directory_p):
520 * font.c (font_unparse_xlfd):
521 Use '&"string"[index]' instead of '"string" + (index)'.
522 * undo.c (user_error): Remove; unused.
523
524 2013-05-16 Eli Zaretskii <eliz@gnu.org>
525
526 * insdel.c (insert_1_both): Document the arguments, instead of
527 referring to insert_1, which no longer exists.
528
529 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
530 some window, increment windows_or_buffers_changed, so that
531 *Messages* display in that window is updated. (Bug#14408)
532
533 * w32.c: Include epaths.h.
534 (init_environment): Use cmdproxy.exe without leading directories.
535 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
536 case.
537 (gettimeofday): Adjust signature and return value to Posix
538 expectations.
539
540 * unexw32.c (open_output_file): Delete the existing emacs.exe
541 before creating it, to break the hard link to the versioned
542 executable.
543
544 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
545 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
546 (FIRSTFILE_OBJ): New variables.
547 (W32_RES): Rename to EMACSRES. All users changed.
548 (base_obj): Use $(CM_OBJ).
549 (ALLOBJS): Use $(FIRSTFILE_OBJ).
550 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
551 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
552 $(W32_RES_LINK) before $(LIBES).
553 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
554
555 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
556
557 * makefile.w32-in (DOC): Use just "DOC".
558
559 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
560
561 * process.c: Export default filters and sentinels to Elisp.
562 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
563 New constants.
564 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
565 (Fset_process_sentinel, Fformat_network_address):
566 Default to them instead of nil.
567 (server_accept_connection): Sentinels can't be nil any more.
568 (read_and_dispose_of_process_output): New function, extracted from
569 read_process_output.
570 (read_process_output): Use it; filters can't be nil.
571 (Finternal_default_process_filter): New function, extracted from
572 read_process_output.
573 (exec_sentinel_unwind): Remove function.
574 (exec_sentinel): Don't zilch sentinel while running.
575 (status_notify): Sentinels can't be nil.
576 (Finternal_default_process_sentinel): New function extracted from
577 status_notify.
578 (setup_process_coding_systems): Default filter is not nil any more.
579 (syms_of_process): Export new Elisp functions and initialize
580 new constants.
581 * lisp.h (make_lisp_proc): New function.
582
583 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
584
585 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
586
587 2013-05-14 Eli Zaretskii <eliz@gnu.org>
588
589 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
590 unless we know that the window w is a leaf window.
591 Another attempt at solving bug#14062.
592
593 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
594
595 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
596 fdesc (Bug#14375).
597
598 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
599
600 * image.c (gif_load): Check that subimages fit (Bug#14345).
601
602 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
603
604 * lread.c (skip_dyn_eof): New function.
605 (read1): Use it to skip the end of a file in response to #@00.
606
607 * doc.c (get_doc_string): Slightly relax the sanity checking.
608
609 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
610
611 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
612 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
613 (MonitorInfo): New struct.
614 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
615 (Fns_display_monitor_attributes_list): New functions.
616 (display-usable-bounds): Remove.
617 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
618 Qsource.
619
620 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
621
622 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
623 (GTK_CHECK_VERSION): New macro, if not already defined.
624 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
625 replaced by GTK_CHECK_VERSION.
626
627 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
628
629 * xterm.h (GTK_PREREQ): New macro.
630 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
631 to use this macro instead, for consistency and clarity.
632
633 2013-05-08 Eli Zaretskii <eliz@gnu.org>
634
635 * xdisp.c (row_for_charpos_p): New function, with code of
636 cursor_row_p, but accepts an additional argument CHARPOS instead
637 of using a hardcoded PT.
638 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
639 (row_containing_pos): Call row_for_charpos_p instead of partially
640 doing the same. Fixes cursor positioning under longlines-mode
641 when longlines-show-effect includes more than one newline, when
642 moving the cursor vertically up.
643
644 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
645
646 * makefile.w32-in (ACL_H): New macro.
647 ($(BLD)/fileio.$(O)): Update dependencies.
648
649 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
650
651 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
652 * Makefile.in (LIB_ACL): New macro.
653 (LIBACL_LIBS): Remove.
654 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
655 * fileio.c: Include <acl.h>.
656 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
657 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
658 !acl_errno_valid.
659 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
660 it ourselves.
661
662 * unexelf.c: Don't assume ElfW (Half) fits in int.
663 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
664 when dealing with ElfW (Half) values, since they can exceed 2**31
665 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
666 (entry_address): Omit unused NUM arg. All uses changed.
667
668 2013-05-07 Juri Linkov <juri@jurta.org>
669
670 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
671 to the string converted from number with `Fnumber_to_string'.
672 (Bug#14254)
673
674 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
675
676 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
677 This fixes a problem introduced by my previous change.
678
679 2013-05-07 Glenn Morris <rgm@gnu.org>
680
681 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
682
683 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
684
685 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
686
687 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
688
689 Static checking by GCC 4.8.0.
690 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
691 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
692 (x_get_monitor_attributes_fallback)
693 (x_get_monitor_attributes_xinerama)
694 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
695 Define only if USE_GTK.
696 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
697 (x_get_monitor_attributes_fallback): Omit unused locals.
698 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
699 Use double, not float, to avoid mixed-mode floating point arithmetic.
700
701 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
702 Jan Djärv <jan.h.d@swipnet.se>
703
704 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
705 (XINERAMA_CFLAGS): New macros.
706 (ALL_CFLAGS, LIBES): Use them.
707
708 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
709 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
710 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
711 (syms_of_xfns): DEFSYM them.
712 (struct MonitorInfo): New struct.
713 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
714 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
715 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
716 (x_get_monitor_attributes_xinerama): New functions.
717 (Fx_display_monitor_attributes_list): New primitive.
718 (syms_of_xfns): Defsubr it.
719
720 * xterm.h (x_display_info): Add Xatom_net_workarea and
721 Xatom_net_current_desktop.
722
723 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
724 and dpyinfo->Xatom_net_current_desktop.
725
726 2013-05-06 Eli Zaretskii <eliz@gnu.org>
727
728 * xdisp.c (pos_visible_p): Use the special code for finding the
729 beginning of a display property or overlay for any "replacing"
730 display property, not just for display strings. This solves
731 incorrect reporting of position by posn-at-point. (Bug#14241)
732
733 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
734
735 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
736 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
737 Verify that ElfW (Half) fits in int.
738 (fatal): Use same signature as lisp.h.
739 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
740 configure and build with -DUNEXELF_DEBUG without worrying about
741 other modules that use DEBUG.
742 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
743 possibly-wide integers now uses it instead of plain fprintf.
744 (entry_address): New function, which avoids problems with 32-bit
745 overflow on 64-bit hosts.
746 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
747 (round_up): Don't assume the remainder fits in int.
748 (find_section): Use bool for boolean. Simplify debug code.
749 (unexec): Don't assume file sizes fit in int or size_t.
750 Omit unnecessary trailing newline in 'fatal' format.
751 Use strerror rather than outputting decimal error number.
752 Remove unused code when emacs is not defined;
753 this file relies on Emacs now.
754 Don't assume e_phnum and e_shnum are positive.
755
756 * regex.c: Fix problems when DEBUG is defined.
757 (extract_number, extract_number_and_incr): Define regardless of
758 whether DEBUG is defined; that's simpler and makes the code less
759 likely to go stale in the normal case when DEBUG is not defined.
760 Return int rather than taking an int * arg. All callers changed.
761 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
762 Remove, replacing with ...
763 (DEBUG_PRINT): New macro. All callers changed.
764 (DEBUG_COMPILES_ARGUMENTS): New macro.
765 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
766 (print_compiled_pattern, print_double_string) [DEBUG]:
767 Use prototype rather than old-style definition.
768 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
769 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
770 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
771 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
772 Don't assume ptrdiff_t, size_t, and long are the same width as int.
773 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
774 This matters only when DEBUG is defined.
775
776 2013-05-05 Eli Zaretskii <eliz@gnu.org>
777
778 * xdisp.c (set_iterator_to_next): Set the
779 ignore_overlay_strings_at_pos_p flag only if we are _really_
780 iterating over an overlay string, as indicated by the
781 current.overlay_string_index member. (Bug#14306)
782
783 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
784
785 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
786 to where it is used, to avoid autorelease issues (Bug#14050).
787
788 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
789
790 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
791 * fileio.c (syms_of_fileio): Implement this.
792 * filelock.c (create_lock_file): If symbolic links don't work, so
793 we use a regular file as a lock file, do not fsync the lock file;
794 it's not needed.
795
796 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
797
798 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
799 (syms_of_minibuf): Adjust accodingly.
800 * lread.c (Fread):
801 * callint.c (Fcall_interactively): Adjust calls accordingly.
802
803 2013-05-04 Eli Zaretskii <eliz@gnu.org>
804
805 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
806 w->contents is a buffer before computing everything else.
807 Use parentheses to disambiguate last part of the condition.
808
809 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
810 assertion violations. (Bug#14062)
811
812 2013-05-01 David Reitter <david.reitter@gmail.com>
813
814 * nsfns.m (ns_tooltip): Initialize.
815
816 2013-04-28 Eli Zaretskii <eliz@gnu.org>
817
818 * coding.c (decode_coding_gap): Don't remove the character before
819 a newline unless it's a CR character. (Bug#14287)
820
821 2013-04-28 Dan Nicolaescu <dann@gnu.org>
822
823 * dispextern.h (struct face): Move enum face_underline_type
824 earlier so that bitfields can be in the same word.
825
826 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
827
828 * nsfns.m (handlePanelKeys): New function.
829 (EmacsOpenPanel:performKeyEquivalent:)
830 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
831 arrows/function/control and copy/paste keys (Bug#14296).
832
833 2013-04-27 Juri Linkov <juri@jurta.org>
834
835 * callint.c (Fcall_interactively): Call `Qread_number' for
836 interactive code letter `n' instead of using duplicate code.
837 (Bug#14254)
838
839 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
840
841 * systime.h (make_timeval): Declare as 'const'.
842
843 2013-04-27 Kenichi Handa <handa@gnu.org>
844
845 * font.c (font_open_entity): Always open a font of manageable
846 size.
847
848 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
849
850 Port better to AIX (Bug#14258).
851 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
852 to pacify AIX xlc.
853
854 2013-04-24 Kenichi Handa <handa@gnu.org>
855
856 * coding.c (decode_coding_iso_2022): When an invalid escape
857 sequence is encountered, reset the invocation and designation
858 status to the safest one.
859
860 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
861
862 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
863 Without this fix, "make distclean" leaves stamp-h1 behind.
864
865 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
866
867 * w32fns.c (w32_fullscreen_rect): New function to compute the
868 window rectangle for the given fullscreen mode.
869 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
870 longer tunes the window size. This keeps the window's edges flush
871 with the screen and allows the taskbar to hide itself in fullboth.
872
873 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
874 window decorations and uses the entire screen.
875
876 * w32term.h (w32_fullscreen_rect) Add prototype.
877 (struct w32_output): Replace normal_width, normal_height,
878 normal_top, and normal_left members with a single normal_placement
879 struct.
880 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
881 Remove macros.
882 (FRAME_NORMAL_PLACEMENT): New macro.
883
884 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
885
886 * minibuf.c (Ftest_completion): Silence compiler warning.
887
888 2013-04-15 Eli Zaretskii <eliz@gnu.org>
889
890 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
891 bug#14062.
892
893 * frame.h (WINDOW_FRAME): Protect macro and its argument with
894 parentheses.
895
896 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
897 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
898 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
899 parentheses where appropriate.
900
901 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
902
903 * keyboard.c (timer_start_idle): Remove no-longer-used local.
904
905 2013-04-14 Eli Zaretskii <eliz@gnu.org>
906
907 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
908 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
909 Mention in the doc string that setting these variables takes
910 effect only after a call to set-window-buffer. (Bug#14200)
911
912 2013-04-13 Eli Zaretskii <eliz@gnu.org>
913
914 * indent.c (Fvertical_motion): Don't consider display strings on
915 overlay strings as display strings on the buffer position we
916 started from. This prevents vertical cursor motion from jumping
917 more than one line when there's an overlay string with a display
918 property at end of line.
919 Reported by Karl Chen <Karl.Chen@quarl.org> in
920 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
921
922 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
923
924 * window.c (select_window): `record_buffer' even if window is
925 already selected (bug#14191).
926
927 2013-04-11 Eli Zaretskii <eliz@gnu.org>
928
929 * window.c (Fwindow_end): Test more flags, including the buffer's
930 last_overlay_modified flag, to determine whether the window's
931 display is really up-to-date. Prevents the function from
932 returning a stale value. (Bug#14170)
933 (Fwindow_line_height): Fix the test for up-to-date-ness of the
934 current matrix.
935
936 2013-04-10 Eli Zaretskii <eliz@gnu.org>
937
938 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
939 garbaged only if it is not already the top frame on its TTY.
940 This prevents flickering due to constant redrawing of TTY frames when
941 there are GUI frames open in the same session. (Bug#13864)
942
943 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
944
945 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
946 of marking the idle timers directly.
947
948 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
949
950 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
951 tables (bug#14054).
952
953 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
954
955 * window.c (select_window): Don't record_buffer while the invariant is
956 temporarily broken (bug#14161).
957
958 * fns.c (Fdelq): Don't assume !NILP => CONSP.
959
960 2013-04-07 Eli Zaretskii <eliz@gnu.org>
961
962 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
963
964 2013-04-07 Romain Francoise <romain@orebokech.com>
965
966 Ignore additional platform-specific ACL errors (Bug#13702).
967 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
968 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
969
970 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
971
972 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
973 f->output_data.ns.
974
975 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
976
977 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
978 This bug was introduced by my 2013-02-25 change that simplified
979 data_start configuration. Without this change, on GNU/Linux
980 an Emacs configured with --enable-profiling fails immediately
981 due to a profiler signal.
982 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
983 with these flags. On platforms where special flags are needed
984 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
985 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
986 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
987
988 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
989
990 Get rid of some platform-specific functions examining window
991 system and its capabilities. This is a partial rework of the
992 2013-04-05 change.
993 * lisp.h (have_menus_p): Remove prototype. This function is
994 replaced with platform-independent window_system_available.
995 (check_window_system): Move to...
996 * frame.h (decode_window_system_frame, window_system_available):
997 ...here, add new prototypes.
998 * frame.c (window_system_available, decode_window_system_frame):
999 New functions.
1000 (check_window_system): Platform-independent now.
1001 * xterm.h (x_in_use): Remove declaration.
1002 (check_x_frame):
1003 * w32term.h (check_x_frame):
1004 * nsterm.h (check_x_frame): Remove prototypes. This function
1005 is replaced with platform-independent decode_window_system_frame.
1006 * msdos.c (have_menus_p): Remove.
1007 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
1008 Remove platform-specific functions. Use check_window_system,
1009 decode_window_system_frame and check_ns_display_info where
1010 appropriate. Minor style and comment tweaks.
1011 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
1012 (check_x_frame): Likewise.
1013 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
1014 Likewise.
1015 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
1016 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
1017 * xmenu.c, xselect.c: All related users changed.
1018
1019 2013-04-03 Kenichi Handa <handa@gnu.org>
1020
1021 The following changes is to optimize the code for reading UTF-8
1022 files.
1023
1024 * coding.c (check_ascii): Rename from detect_ascii. Return value
1025 changed. Check EOL format. Do not call adjust_coding_eol_type
1026 here.
1027 (check_utf_8): New function.
1028 (adjust_coding_eol_type): Do nothing if already adjusted.
1029 (detect_coding): Compare the return value of check_ascii with
1030 coding->src_bytes. Call adjust_coding_eol_type if necessary.
1031 (decode_coding_gap): Optimize for valid UTF-8.
1032
1033 2013-03-21 Kenichi Handa <handa@gnu.org>
1034
1035 * coding.c (syms_of_coding): Cancel previous change.
1036
1037 * insdel.c (insert_from_gap): Fix previous change.
1038
1039 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
1040
1041 Consistently use platform-specific function to detect window system.
1042 * lisp.h (check_window_system): New prototype. This function is
1043 going to replace check_x, check_w32 and check_ns.
1044 (have_menus_p): Mention msdos.c in comment.
1045 * fontset.c (check_window_system_func): Remove. Adjust all users.
1046 * fontset.h (check_window_system_func): Remove prototype.
1047 * nsterm.h (check_ns):
1048 * xterm.h (check_x):
1049 * w32term.h (check_w32): Likewise.
1050 * menu.c (Fx_popup_menu): Use check_window_system.
1051 * msdos.c (check_window_system): Define for MS-DOS.
1052 * nsfns.m (check_window_system): Define for NS. Adjust all users.
1053 * w32fns.c (check_window_system): Likewise for MS-Windows.
1054 * xfns.c (check_window_system): Likewise for X.
1055 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
1056 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
1057
1058 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
1059
1060 Prefer < to > in range checks such as 0 <= i && i < N.
1061 This makes it easier to visualize quantities on a number line.
1062 This patch doesn't apply to all such range checks,
1063 only to the range checks affected by the 2013-03-24 change.
1064 This patch reverts most of the 2013-03-24 change.
1065 * alloc.c (xpalloc, Fgarbage_collect):
1066 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
1067 * character.c (string_escape_byte8):
1068 * charset.c (read_hex):
1069 * data.c (cons_to_unsigned):
1070 * dispnew.c (update_frame_1):
1071 * doc.c (Fsubstitute_command_keys):
1072 * doprnt.c (doprnt):
1073 * editfns.c (hi_time, decode_time_components):
1074 * fileio.c (file_offset):
1075 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1076 * font.c (font_intern_prop):
1077 * frame.c (x_set_alpha):
1078 * gtkutil.c (get_utf8_string):
1079 * indent.c (check_display_width):
1080 * keymap.c (Fkey_description):
1081 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
1082 * lread.c (read1):
1083 * minibuf.c (read_minibuf_noninteractive):
1084 * process.c (wait_reading_process_output):
1085 * search.c (Freplace_match):
1086 * window.c (get_phys_cursor_glyph):
1087 * xdisp.c (redisplay_internal):
1088 * xsmfns.c (smc_save_yourself_CB):
1089 Prefer < to > for range checks.
1090 * dispnew.c (sit_for): Don't mishandle NaNs.
1091 This fixes a bug introduced in the 2013-03-24 change.
1092 * editfns.c (decode_time_components): Don't hoist comparison.
1093 This fixes another bug introduced in the 2013-03-24 change.
1094
1095 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
1096
1097 * frame.h (struct frame): Drop scroll_bottom_vpos
1098 member becaue all real users are dead long ago.
1099 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
1100 * xdisp.c (redisplay_internal): Adjust user.
1101
1102 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
1103
1104 * nsmenu.m (showAtX:Y:for:): setLevel to
1105 NSPopUpMenuWindowLevel (Bug#13998).
1106
1107 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
1108
1109 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
1110 (ns_check_pending_open_menu): Declare.
1111
1112 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
1113 (x_activate_menubar): Update the menu with title that matches
1114 ns_get_pending_menu_title, and call
1115 ns_check_pending_openmenu (Bug#12698).
1116 (menuWillOpen:): New method.
1117 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
1118
1119 * nsterm.m (menu_will_open_state, menu_mouse_point)
1120 (menu_pending_title): New varaibles.
1121 (ns_get_pending_menu_title, ns_check_menu_open)
1122 (ns_check_pending_open_menu): New functions.
1123
1124 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
1125
1126 * indent.c (current_column_bol_cache): Remove leftover which is not
1127 used in Fmove_to_column any more.
1128 (current_column, scan_for_column): Adjust users.
1129 * keyboard.c (last_point_position_buffer, last_point_position_window):
1130 Remove leftovers which are not used for recording undo any more.
1131 (command_loop_1, syms_of_keyboard): Adjust users.
1132 * xdisp.c (last_max_ascent): Remove leftover which is not used in
1133 redisplay_window any more.
1134 (move_it_to): Adjust user.
1135
1136 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
1137
1138 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1139 Update dependencies.
1140
1141 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1142
1143 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1144 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1145 forward references.
1146
1147 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1148
1149 * window.h (struct window): Replace hchild, vchild and buffer slots
1150 with the only contents slot. This is possible because each valid
1151 window may have either the child window (in vertical or horizontal
1152 combination) or buffer to display (for the leaf window). Using that,
1153 a lof of operations to traverse and/or change window hierarchies may
1154 be simplified. New member horizontal is used to distinguish between
1155 horizontal and vertical combinations of internal windows.
1156 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1157 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1158 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1159 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1160 Use contents slot, not buffer, where appropriate.
1161 (wset_combination): New function.
1162 (wset_buffer): Add eassert.
1163 (Fframe_first_window): Simplify the loop reaching first window.
1164 (Fwindow_buffer): Use WINDOW_LEAF_P.
1165 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1166 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1167 (unshow_buffer): Convert initial debugging check to eassert.
1168 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1169 (make_parent_window, window_resize_check, window_resize_apply)
1170 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1171 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1172 Adjust to match struct window changes.
1173 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1174 (mark_window_cursors_off, count_windows, get_leaf_windows)
1175 (foreach_window_1): Simplify the loop.
1176 * alloc.c (mark_object): Do not check for the leaf window because
1177 internal windows has no glyph matrices anyway.
1178 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1179 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1180 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1181 (build_frame_matrix_from_window_tree, mirror_make_current)
1182 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1183 (update_window_tree, set_window_update_flags): Simplify the loop.
1184 (sync_window_with_frame_matrix_rows): Enforce live window.
1185 Use contents slot, not buffer, where appropriate.
1186 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1187 and WINDOW_HORIZONTAL_COMBINATION_P.
1188 (make_frame_visible_1): Simplify the loop.
1189 Use contents slot, not buffer, where appropriate.
1190 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1191 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1192 (expose_window_tree): Likewise.
1193 Use contents slot, not buffer, where appropriate.
1194 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1195 to avoid deleted windows. Use contents slot instead of buffer.
1196 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1197 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1198 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1199 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1200
1201 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1202
1203 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1204 identify the reasons for assertion violations in bug#14062 and
1205 similar ones.
1206 (Fx_show_tip): Fix compilation error under
1207 "--enable-check-lisp-object-type". (Bug#14073)
1208
1209 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1210 Reported by <rzl24ozi@gmail.com>.
1211
1212 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1213
1214 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1215 start marker...
1216 (unwind_with_echo_area_buffer): ...to restore it here.
1217 This is needed to ensure that...
1218 (redisplay_window): ...both window markers are valid here,
1219 which is verified by eassert.
1220 * editfns.c (save_excursion_save): Do not assume that
1221 selected_window always displays the buffer.
1222 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1223 Fix comment.
1224
1225 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1226
1227 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1228 the upcase table.
1229
1230 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1231
1232 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1233
1234 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1235
1236 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1237 since MinGW's w32api headers do. This avoids compiler warnings.
1238
1239 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1240 if already defined.
1241
1242 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1243
1244 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1245
1246 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1247
1248 * gtkutil.c (style_changed_cb): Check if frame is live and an
1249 X frame (Bug#14038).
1250
1251 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1252
1253 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1254 Define only for _WIN32_WINNT less than 0x0500.
1255 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1256 MinGW64.
1257 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1258 see its own definitions of 'struct timeval' and 'struct timezone'.
1259
1260 Fix incompatibilities between MinGW.org and MinGW64 headers.
1261 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1262
1263 * w32.c (REPARSE_DATA_BUFFER): Guard with
1264 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1265
1266 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1267
1268 * xterm.c: Include X11/XKBlib.h
1269 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1270
1271 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1272
1273 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1274 written backwards.
1275 * blockinput.h (input_blocked_p): Likewise.
1276 * bytecode.c (exec_byte_code): Likewise.
1277 * callproc.c (call_process_kill, call_process_cleanup)
1278 (Fcall_process): Likewise.
1279 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1280 (Fccl_execute_on_string): Likewise.
1281 * character.c (string_escape_byte8): Likewise.
1282 * charset.c (read_hex): Likewise.
1283 * cm.c (calccost): Likewise.
1284 * data.c (cons_to_unsigned): Likewise.
1285 * dired.c (directory_files_internal, file_name_completion):
1286 Likewise.
1287 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1288 (sit_for): Likewise.
1289 * doc.c (Fsubstitute_command_keys): Likewise.
1290 * doprnt.c (doprnt): Likewise.
1291 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1292 * emacsgtkfixed.c: Likewise.
1293 * fileio.c (file_offset, Fwrite_region): Likewise.
1294 * floatfns.c (Fexpt, fmod_float): Likewise.
1295 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1296 Likewise.
1297 * font.c (font_intern_prop): Likewise.
1298 * frame.c (x_set_alpha): Likewise.
1299 * gtkutil.c (get_utf8_string): Likewise.
1300 * indent.c (check_display_width): Likewise.
1301 * intervals.c (create_root_interval, rotate_right, rotate_left)
1302 (split_interval_right, split_interval_left)
1303 (adjust_intervals_for_insertion, delete_node)
1304 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1305 (merge_interval_right, merge_interval_left, copy_intervals)
1306 (set_intervals_multibyte_1): Likewise.
1307 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1308 * keymap.c (Fkey_description): Likewise.
1309 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1310 * lread.c (openp, read_integer, read1, string_to_number):
1311 Likewise.
1312 * menu.c (ensure_menu_items): Likewise.
1313 * minibuf.c (read_minibuf_noninteractive): Likewise.
1314 * print.c (printchar, strout): Likewise.
1315 * process.c (create_process, Faccept_process_output)
1316 (wait_reading_process_output, read_process_output, send_process)
1317 (wait_reading_process_output): Likewise.
1318 * profiler.c (make_log, handle_profiler_signal): Likewise.
1319 * regex.c (re_exec): Likewise.
1320 * regex.h: Likewise.
1321 * search.c (looking_at_1, Freplace_match): Likewise.
1322 * sysdep.c (get_child_status, procfs_ttyname)
1323 (procfs_get_total_memory): Likewise.
1324 * systime.h (EMACS_TIME_VALID_P): Likewise.
1325 * term.c (dissociate_if_controlling_tty): Likewise.
1326 * window.c (get_phys_cursor_glyph): Likewise.
1327 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1328 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1329 Likewise.
1330 * xfns.c (Fx_window_property): Likewise.
1331 * xmenu.c (set_frame_menubar): Likewise.
1332 * xselect.c (x_get_window_property, x_handle_dnd_message):
1333 Likewise.
1334 * xsmfns.c (smc_save_yourself_CB): Likewise.
1335 * xterm.c (x_scroll_bar_set_handle): Likewise.
1336
1337 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1338
1339 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1340 to be optional or nil. Adjust comment and convert it to docstring.
1341 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1342 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1343
1344 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1345
1346 Static checking by GCC 4.8-20130319.
1347 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1348 * process.c (Fset_process_datagram_address)
1349 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1350 * xdisp.c (get_char_face_and_encoding):
1351 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1352 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1353 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1354
1355 2013-03-24 Ken Brown <kbrown@cornell.edu>
1356
1357 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1358 fix compilation on 64-bit Cygwin, where underscores are not
1359 automatically prepended.
1360
1361 * w32term.c (w32_initialize): Silence compiler warning.
1362
1363 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1364
1365 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1366 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1367 variables, to save and restore frame dimensions.
1368 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1369 after returning from a 'fullscreen' configuration.
1370 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1371 to avoid races between the main thread and the input thread.
1372
1373 * w32term.h (struct w32_output): New members normal_width,
1374 normal_height, normal_top, normal_left, and prev_fsmode.
1375 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1376 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1377 members of a frame.
1378
1379 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1380 'fullscreen' parameter. Always record previous width and height
1381 of the frame, except when switching out of maximized modes, so
1382 that they could be restored correctly, instead of resetting to the
1383 default frame dimensions. Send SC_RESTORE command to the frame,
1384 unless we are going to send SC_MAXIMIZE, to restore the frame
1385 resize hints in the mouse pointer shown by the window manager.
1386 (Bug#14032)
1387
1388 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1389
1390 * lisp.h (get_frame_param): Adjust conditions for prototype
1391 declaration.
1392
1393 2013-03-22 Ken Brown <kbrown@cornell.edu>
1394
1395 * unexcw.c: Drop unneeded inclusion of w32common.h.
1396 (report_sheap_usage): Declare.
1397 (read_exe_header): Add magic numbers for x86_64.
1398 (fixup_executable): Fix printf format specifier for unsigned long
1399 argument.
1400
1401 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1402
1403 * frame.h (struct frame): Put menu_bar_window under #ifdef
1404 because this member is not needed when X toolkit is in use.
1405 (fset_menu_bar_window):
1406 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1407 (free_glyphs, update_frame):
1408 * xdisp.c (expose_frame): Likewise.
1409 (display_menu_bar): Likewise. Remove redundant eassert.
1410 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1411 toolkit is in use.
1412
1413 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1414
1415 Use functions and constants to manipulate Lisp_Save_Value objects.
1416 This replaces code that used macros and strings and token-pasting.
1417 The change makes the C source a bit easier to follow,
1418 and shrinks the Emacs executable a bit.
1419 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1420 (make_save_value): Change 1st arg from string to enum. All callers
1421 changed.
1422 (INTX): Remove.
1423 (mark_object): Use if, not #if, for GC_MARK_STACK.
1424 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1425 (XSAVE_OBJECT): Now functions, not macros.
1426 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1427 the constant was never used.
1428 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1429 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1430 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1431 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1432 New constants.
1433 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1434 type3 with a single member save_type. All uses changed.
1435 (save_type, set_save_pointer, set_save_integer): New functions.
1436 * print.c (PRINTX): Remove.
1437
1438 * alloc.c: Remove redundant static declarations.
1439
1440 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1441
1442 * window.h (struct window): Convert left_col, top_line, total_lines
1443 and total_cols from Lisp_Objects to integers. Adjust comments.
1444 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1445 Remove.
1446 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1447 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1448 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1449 Adjust users where appropriate.
1450
1451 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1452
1453 * frame.h (struct frame): Drop resx and resy because the same data is
1454 available from window system-specific output context. Adjust users.
1455 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1456 New functions to provide defaults when no window system available.
1457 (FRAME_RES_X, FRAME_RES_Y): New macros.
1458 (NUMVAL): Move from xdisp.c.
1459 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1460 (Ffont_face_attributes, Fopen_font):
1461 * image.c (gs_load):
1462 * w32font.c (fill_in_logfont):
1463 * xdisp.c (calc_pixel_width_or_height):
1464 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1465 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1466
1467 2013-03-20 Kenichi Handa <handa@gnu.org>
1468
1469 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1470 to 1 (temporary workaround until a bug related to ASCII
1471 optimization is fixed).
1472
1473 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1474
1475 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1476 Signal error if window is not internal. Adjust docstring.
1477 (delete_all_child_windows): Use combination_limit to save the buffer.
1478 (Fset_window_configuration): Adjust accordingly.
1479 * print.c (syms_of_print): Initialize debugging output not here...
1480 (init_print_once): ...but in a new function here.
1481 * lisp.h (init_print_once): Add prototype.
1482 * emacs.c (main): Add call to init_print_once. Adjust comments.
1483
1484 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1485
1486 * window.c (window_resize_check, window_resize_apply)
1487 (window_from_coordinates, recombine_windows, set_window_buffer)
1488 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1489 (Fsplit_window_internal, Fdelete_window_internal)
1490 (freeze_window_starts): Use bool for booleans.
1491 * window.h (window_frame_coordinates, resize_frame_windows)
1492 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1493
1494 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1495
1496 * dispnew.c (bitch_at_user): Use `user-error'.
1497
1498 2013-03-17 Ken Brown <kbrown@cornell.edu>
1499
1500 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1501 as return type of image_background. (Bug#13981)
1502 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1503
1504 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1505
1506 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1507 (ns_select): Don't return with result uninitialized.
1508
1509 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1510 and getDirectory.
1511
1512 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1513 New functions.
1514 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1515 directories. If filename is nil, get directory name (Bug#13932).
1516 Use getFilename and getDirectory.
1517 (getFilename, getDirectory): New methods for EmacsSavePanel and
1518 EmacsOpenPanel.
1519 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1520
1521 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1524
1525 2013-03-15 Kenichi Handa <handa@gnu.org>
1526
1527 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1528 (adjust_after_replace): Make it back to static. Delete the third
1529 arg text_at_gap_tail. Cancel the code for handling it.
1530
1531 * coding.h (struct coding_system): New member eol_seen.
1532
1533 * coding.c (detect_ascii): New function.
1534 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1535 when the source bytes are actually scanned. On detecting for
1536 coding_category_utf_8_auto, call detect_ascii instead of scanning
1537 source bytes directly.
1538 (produce_chars): Call insert_from_gap with the new arg 0.
1539 (encode_coding): Likewise.
1540 (decode_coding_gap): Control ASCII optimization by the variable
1541 disable_ascii_optimization instead of #ifndef .. #endif.
1542 Deccode EOL format according to coding->eol_seen.
1543 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1544 variable.
1545
1546 * lisp.h (adjust_after_replace): Cancel externing it.
1547 (insert_from_gap): Adjust prototype.
1548
1549 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1550
1551 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1552 FULLSCREEN_MAXIMIZED. (Bug#13935)
1553
1554 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1555
1556 * region-cache.c (find_cache_boundary, move_cache_gap)
1557 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1558 Simplify debugging check and convert to eassert. Adjust comment.
1559 (pp_cache): Put under ENABLE_CHECKING.
1560
1561 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1562
1563 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1564 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1565 and WM_ACTIVATEAPP.
1566 (w32fullscreen_hook): If the frame is visible, reset
1567 f->want_fullscreen flag after changing the frame size. If the
1568 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1569 (Bug#13953)
1570
1571 2013-03-13 Daniel Colascione <dancol@dancol.org>
1572
1573 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1574 too so that these builds can use Cygwin's file conversion
1575 functions. (We've been building and linking cygw32.o all along
1576 and just not using it.)
1577
1578 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 File synchronization fixes (Bug#13944).
1581 * Makefile.in (LIB_FDATASYNC): New macro.
1582 (LIBES): Use it.
1583 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1584 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1585 Don't worry about HAVE_FSYNC, since a substitute fsync is
1586 available if the system lacks one.
1587 (Fwrite_regin): Retry fsync if interrupted.
1588
1589 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1590
1591 * w32term.c (w32_read_socket): If the Emacs frame is being
1592 activated, call w32fullscreen_hook, to make sure the new frame
1593 dimensions are in effect. (Bug#13937)
1594
1595 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1596
1597 * xdisp.c (init_iterator): Simplify because both character and byte
1598 positions are either specified or -1. Add eassert. Adjust comment.
1599 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1600 character and byte positions can be obtained from marker.
1601
1602 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1603
1604 Static checking by Sun C 5.12.
1605 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1606 * bytecode.c (exec_byte_code):
1607 * dispnew.c (init_display):
1608 * eval.c (error):
1609 * fileio.c (Fsubstitute_in_file_name):
1610 * keyboard.c (Fevent_convert_list):
1611 * keymap.c (Fsingle_key_description):
1612 * term.c (maybe_fatal, fatal):
1613 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1614 * xsmfns.c (Fhandle_save_session):
1615 Omit unreachable code.
1616 * keymap.c (map_keymap_char_table_item): Cast void * to
1617 a function pointer type; the C Standard requires this.
1618
1619 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1620 Include <sys/param.h> unconditionally, as that works elsewhere and
1621 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1622 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1623 and FreeBSD now.
1624
1625 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1626
1627 * insdel.c (adjust_after_replace): Use bool for boolean.
1628
1629 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1630
1631 * keyboard.c: Move keyboard decoding to read_key_sequence.
1632 (decode_keyboard_code): Remove.
1633 (tty_read_avail_input): Don't try to decode input.
1634 (read_decoded_char): New function.
1635 (read_key_sequence): Use it.
1636
1637 2013-03-10 Daniel Colascione <dancol@dancol.org>
1638
1639 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1640 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1641 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1642 w32fns.c.
1643
1644 * w32term.c (construct_drag_n_drop): Use the above macros to make
1645 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1646
1647 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1648 properly display non-ASCII frame titles in cygw32 builds.
1649
1650 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1651 call ShellExecute in cygw32 builds.
1652
1653 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1654 common file dialog code.
1655
1656 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1657 can just use du like other systems.
1658
1659 * coding.c (from_unicode_buffer): Declare.
1660 * coding.c (from_unicode_buffer): Implement.
1661
1662 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1663
1664 * lread.c: Minor cleanup.
1665 (FROM_FILE_P): New macro.
1666 (skip_dyn_bytes, unreadchar, read1): Use it.
1667 (read_list): Consolidate duplicated code.
1668
1669 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1670
1671 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1672
1673 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1674 (redisplay_internal, set_cursor_from_row, try_window)
1675 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1676 (display_line, notice_overwritten_cursor)
1677 (mouse_face_from_buffer_pos, note_mouse_highlight):
1678 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1679 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1680 (mouse_face_from_string_pos, fast_find_string_pos):
1681 Use MATRIX_ROW_VPOS.
1682
1683 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1684
1685 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1686
1687 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1688 MATRIX_MODE_LINE_ROW.
1689
1690 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1691
1692 2013-03-10 handa <handa@gnu.org>
1693
1694 * lisp.h (adjust_after_replace): Extern it.
1695
1696 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1697 case of detection for coding_category_utf_8_auto.
1698 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1699 Skip decoding if all bytes are ASCII.
1700
1701 * insdel.c (adjust_after_replace): Make it public. New arg
1702 text_at_gap_tail.
1703 (adjust_after_insert): Call adjust_after_replace with the new arg
1704 value 0.
1705
1706 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1707
1708 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1709 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1710 from Elisp via unread-command-events.
1711
1712 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1713 functions to mean "no change".
1714
1715 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1716
1717 region-cache.c, scroll.c, search.c: Use bool for booleans.
1718 * lisp.h (compile_pattern):
1719 * scroll.c (do_scrolling, do_direct_scrolling):
1720 * search.c (struct regexp_cache, compile_pattern_1)
1721 (compile_pattern, string_match_1, search_command)
1722 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1723 (search_regs_saved, Fregexp_quote):
1724 Use bool for boolean.
1725 * region-cache.c (region_cache_forward, region_cache_backward):
1726 Fix comments to match code: these functions return int, not boolean.
1727
1728 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1729
1730 * search.c (find_newline): Accept start and end byte positions
1731 as arguments and allow -1 if not known.
1732 (find_newline_no_quit): Likewise for start position.
1733 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1734 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1735 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1736 * editfns.c (Fconstrain_to_field): Break long line.
1737 Adjust call to find_newline.
1738 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1739 Use DEC_BOTH to start next search from the previous buffer
1740 position, where appropriate.
1741 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1742 (get_visually_first_element, move_it_vertically_backward): Likewise.
1743 Obtain byte position from the display iterator, where appropriate.
1744
1745 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1746
1747 print.c, process.c: Use bool for booleans.
1748 * lisp.h (wait_reading_process_output):
1749 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1750 (strout, debug_output_compilation_hack, float_to_string, print)
1751 (print_object):
1752 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1753 (decode_status, status_message, create_process, create_pty)
1754 (Fmake_network_process, Fnetwork_interface_info)
1755 (wait_reading_process_output, read_process_output)
1756 (write_queue_push, write_queue_pop, process_send_signal)
1757 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1758 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1759 Use bool for booleans.
1760 * process.c (Fnetwork_interface_list): Remove unused local.
1761 (connect_counter): Now EMACS_INT, not int.
1762
1763 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1764
1765 * bidi.c (bidi_fetch_char): Swap first and second arguments
1766 to match other functions accepting character and byte positions.
1767 Adjust comment.
1768 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1769 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1770 when you need just to move to the previous buffer position.
1771 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1772
1773 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1774
1775 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1776
1777 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1778
1779 Avoid character to byte conversions in motion subroutines.
1780 * indent.h (compute_motion, vmotion): Add byte position argument.
1781 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1782 Add eassert.
1783 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1784 Use list5 for return value.
1785 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1786 Adjust comments, style and calls to compute_motion.
1787 (Fvertical_motion): Adjust call to vmotion.
1788 * window.c (Fdelete_other_windows_internal): Record window start
1789 byte position and adjust call to vmotion.
1790 (window_scroll_line_based): Likewise with call to compute_motion.
1791 Use SET_PT_BOTH.
1792 (Frecenter): Adjust calls to vmotion.
1793
1794 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1795
1796 * lisp.h (list2i, list3i): New functions.
1797 (list4i): Move from window.c and make LISP_INLINE.
1798 * editfns.c (make_lisp_time):
1799 * fns.c (Flocale_info):
1800 * keyboard.c (parse_modifiers):
1801 * xterm.c (x_ewmh_activate_frame): Use list2i.
1802 * instel.c (signal_after_change):
1803 * nsfns.m (Fx_server_version, Fxw_color_values):
1804 * w32fns.c (Fxw_color_values, Fx_server_version):
1805 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1806 * fileio.c (Fvisited_file_modtime):
1807 * nsfns.m (Fns_display_usable_bounds):
1808 * w32.c (ltime): Use list4i.
1809
1810 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1811
1812 * search.c (find_newline_no_quit): Rename from find_next_newline.
1813 Add commentary.
1814
1815 * lisp.h (find_newline_no_quit): Rename prototype.
1816
1817 * xdisp.c (back_to_previous_line_start)
1818 (forward_to_next_line_start, get_visually_first_element)
1819 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1820 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1821 * bidi.c (bidi_find_paragraph_start): Callers of
1822 find_newline_no_quit changed.
1823
1824 * msdos.c: Change encoding to cp850. (Bug#13879)
1825 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1826
1827 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1828
1829 Coding system support cleanup and minor refactoring.
1830 * coding.h (enum coding_result_code): Remove
1831 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1832 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1833 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1834 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1835 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1836 (decode_coding_region, encode_coding_region, decode_coding_string):
1837 Remove unused compatibility macros.
1838 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1839 (record_conversion_result): Adjust user.
1840 (syms_of_coding): Likewise.
1841 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1842 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1843 (decode_coding_object): Simplify since xrealloc never returns NULL.
1844 Add eassert.
1845
1846 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1849 * sysdep.c (list_system_processes)
1850 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1851 Make it a stub in this case; otherwise the build might fail,
1852 and this code hasn't been tested on such hosts anyway.
1853 Problem reported by Nelson H. F. Beebe in
1854 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1855 and analyzed by Jérémie Courrèges-Anglas in
1856 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1857
1858 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1859
1860 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1861 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1862 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1863 * bidi.c (bidi_find_paragraph_start): Likewise.
1864 * indent.c (vmotion): Likewise.
1865
1866 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1867
1868 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1869 * filelock.c: Include <c-ctype.h>.
1870 (MAX_LFINFO): New top-level constant.
1871 (lock_info_type): Remove members pid, boot_time. Add members at,
1872 dot, colon. Change user member to be the entire buffer, not a
1873 pointer. This allows us to handle the case where a foreign
1874 pid or boot time exceeds the local range. All uses changed.
1875 (LINKS_MIGHT_NOT_WORK): New constant.
1876 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1877 (defined_WINDOWSNT): Remove.
1878 (MAKE_LOCK_NAME, file_in_lock_file_name):
1879 Always use .#FILE (not .#-FILE) for the file lock,
1880 even if it is a regular file.
1881 (rename_lock_file): New function.
1882 (create_lock_file): Use it.
1883 (create_lock_file, read_lock_data):
1884 Prefer a symbolic link for the lock file, falling back on a
1885 regular file if symlinks don't work. Do not try to create
1886 symlinks on MS-Windows, due to security hassles. Stick with
1887 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1888 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1889 host may be using a Windowsish file system, and cannot use
1890 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1891 doesn't work. Don't fail merely because of a symlink-contents
1892 length limit in the current file system; fall back on regular
1893 files. Increase the symlink contents length limit to 8 KiB, this
1894 should be big enough for any real use and doesn't crunch the
1895 stack.
1896 (create_lock_file, lock_file_1, read_lock_data):
1897 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1898 (lock_file_1): Return error number, not bool. All callers changed.
1899 (ELOOP): New macro, if not already defined.
1900 (read_lock_data): Return size of lock file contents, not Lisp object.
1901 All callers changed. Handle a race condition if some other process
1902 replaces a regular-file lock with a symlink lock or vice versa,
1903 while we're trying to read the lock.
1904 (current_lock_owner): Parse contents more carefully, to help avoid
1905 confusing a regular-file lock with some other application's use
1906 of the file. Check for lock file contents being too long, or
1907 not parsing correctly.
1908 (current_lock_owner, lock_file):
1909 Allow foreign pid and boot times that exceed the local range.
1910 (current_lock_owner, lock_if_free, lock_file):
1911 Simplify allocation of lock file contents.
1912 * w32.c (sys_rename_replace): New function, containing most of
1913 the contents of the old sys_rename.
1914 (sys_rename): Use it.
1915 (fchmod): New dummy function.
1916 * w32.h (sys_rename_replace, fchmod): New decls.
1917
1918 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1919
1920 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1921 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1922 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1923 <dmantipov@yandex.ru>.
1924
1925 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1926
1927 * composite.c (get_composition_id, fill_gstring_header):
1928 Use make_uninit_vector where appropriate.
1929 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1930 * xselect.c (clean_local_selection_data): Likewise.
1931
1932 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1933
1934 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1935 * image.c (imagemagick_load_image): Calculate height and width
1936 after flattening the image, not before.
1937
1938 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1939
1940 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1941 * ftfont.c (ftfont_shape_by_flt): Likewise.
1942 * w32uniscribe.c (uniscribe_shape): Likewise.
1943
1944 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1947 The old approach, which fell back on DIR/.#FILE.0 through
1948 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1949 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1950 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1951 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1952 because the locking mechanism was never reliable in that case).
1953 This patch fixes this and other bugs discovered by a code
1954 inspection that was prompted by
1955 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1956 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1957 to avoid interoperability problems between the MS-Windows and
1958 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1959 instances of Emacs now ignore each others' locks.
1960 * filelock.c (defined_WINDOWSNT): New constant.
1961 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1962 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1963 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1964 regular files on MS-Windows hosts.
1965 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1966 Use SAFE_ALLOCA to avoid problems with long file names.
1967 (MAX_LFINFO): Now a local constant, not a global macro.
1968 (IS_LOCK_FILE): Remove.
1969 (lock_file_1): Don't inspect errno if symlink call succeeds;
1970 that's not portable.
1971 (lock_file): Document that this function can return if lock
1972 creation fails.
1973 (lock_file): Don't access freed storage.
1974
1975 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1976
1977 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1978
1979 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 * textprop.c: Use bool for booleans.
1982 (validate_interval_range, Fadd_text_properties)
1983 (Fremove_text_properties): Prefer bool to int when either works.
1984
1985 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1986
1987 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1988 If the interval tree changes as a side effect of calling
1989 modify_region, re-do processing starting from the call to
1990 validate_interval_range. (Bug#13743)
1991
1992 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1993
1994 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1995 (Bug#13546).
1996
1997 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1998
1999 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
2000 _SH_DENYRW flag, instead of emacs_open, to deny any other process
2001 access to the lock file until it is written and closed.
2002 (Bug#13807)
2003
2004 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * callint.c (Qcall_interactively):
2007 * macros.c (Qexecute_kbd_macro):
2008 Now static.
2009
2010 2013-02-26 Bastien Guerry <bzg@gnu.org>
2011
2012 * window.c (Frecenter): Tiny docstring enhancement.
2013
2014 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2015
2016 Minor textprop integer cleanup.
2017 * intervals.h, textprop.c (add_text_properties_from_list):
2018 Return void, not int, since nobody uses the return value.
2019 * textprop.c (validate_plist, add_properties, remove_properties)
2020 (Fadd_text_properties):
2021 Don't assume list length fits in int.
2022 (interval_has_all_properties, interval_has_some_properties)
2023 (interval_has_some_properties_list, add_properties, remove_properties)
2024 (Fadd_text_properties, Fremove_text_properties)
2025 (Fremove_list_of_text_properties, text_property_stickiness):
2026 Use bool for booleans.
2027 (Fadd_text_properties, Fremove_text_properties):
2028 (Fremove_list_of_text_properties):
2029 Reindent do-while as per GNU style.
2030
2031 2013-02-25 Eli Zaretskii <eliz@gnu.org>
2032
2033 Implement CLASH_DETECTION for MS-Windows.
2034
2035 * filelock.c [WINDOWSNT]: Include w32.h.
2036 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2037 function of that name. Up-case the macro arguments.
2038 (IS_LOCK_FILE): New macro.
2039 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2040 (create_lock_file): New function, with body extracted from
2041 lock_file_1.
2042 [WINDOWSNT]: Implement lock files by writing a regular file with
2043 the lock information as its contents.
2044 (read_lock_data): New function, on Posix platforms just calls
2045 emacs_readlinkat.
2046 [WINDOWSNT]: Read the lock info from the file.
2047 (current_lock_owner): Call read_lock_data instead of calling
2048 emacs_readlinkat directly.
2049 (lock_file) [WINDOWSNT]: Run the file name through
2050 dostounix_filename.
2051
2052 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2053 just check if the process by that PID exists.
2054
2055 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2056 also present, as doing so will fail to error out if the file
2057 already exists.
2058
2059 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2060
2061 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2062 (Fremove_list_of_text_properties): Skip all of the intervals in
2063 the region between START and END that already have resp. don't
2064 have the requested properties, not just the first one.
2065 Add assertions that the loop afterwards always modifies the
2066 properties. (Bug#13743)
2067
2068 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2069
2070 * callint.c (Fcall_interactively): Use the right lexical environment
2071 for `interactive' specs (bug#13811).
2072 * eval.c (Feval): Accept a lexical environment.
2073
2074 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2075
2076 Simplify data_start configuration (Bug#13783).
2077 This is a followon simplification to the fix for Bug#13650.
2078 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2079 (START_FILES): Remove. All uses removed.
2080 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2081 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2082 (buildobj.h): Use it.
2083 ($(ALLOBJS)): Depend on globals.h.
2084 (temacs$(EXEEXT)): Use $(ALLOBJS).
2085 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2086 * deps.mk (vm-limit.o):
2087 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2088 Do not depend on mem-limits.h.
2089 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2090 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2091 [__GNUC__ && !ORDINARY_LINK]: Remove.
2092 * mem-limits.h, pre-crt0.c: Remove.
2093 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2094 * unexcoff.c (etext): New decl.
2095 (make_hdr): Use DATA_START instead of start_of_data.
2096 * vm-limit.c: Move most of mem-limits.h's contents here.
2097 (data_start): New decl. It's OK if this is approximate,
2098 so simplify-away some unnecessary exactness.
2099 (POINTER): Remove; all uses removed.
2100 (data_space_start): Now char *, to avoid casts.
2101 (exceeds_lisp_ptr): New function, replacing the old
2102 EXCEEDS_LISP_PTR macro. All uses changed.
2103 (check_memory_limits): Simplify and remove casts.
2104 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2105 (memory_warnings): Use data_start instead of start_of_data.
2106
2107 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2108
2109 * xdisp.c (set_message): Only check for debug-on-message if STRING
2110 is a string. (Bug#13797)
2111
2112 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 Fix regression introduced by July 10 filelock.c patch.
2115 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2116 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2117 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2118 and diagnosed by Andreas Schwab in
2119 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2120
2121 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 Assume C89 or better.
2124 * ralloc.c (SIZE, POINTER, NIL):
2125 * vm-limit.c (POINTER):
2126 Remove, replacing all uses with C89 equivalents. These old
2127 symbols were present only for porting to pre-C89 platforms.
2128
2129 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
2130
2131 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2132 This avoids warning messages reported as part of Bug#13546.
2133
2134 2013-02-21 Ken Brown <kbrown@cornell.edu>
2135
2136 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2137
2138 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2139
2140 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2141
2142 * keyboard.c (Qcommand_execute): New var.
2143 (command_loop_1, read_char): Use it.
2144 (Fcommand_execute): Remove, replace by an Elisp implementation.
2145 (syms_of_keyboard): Adjust accordingly.
2146
2147 2013-02-19 Daniel Colascione <dancol@dancol.org>
2148
2149 * sheap.c (report_sheap_usage): Use message, not message1, so
2150 that we don't try to create a buffer while we're in the middle
2151 of dumping Emacs. Explain why.
2152
2153 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2154
2155 * search.c (find_newline): Return byte position in bytepos.
2156 Adjust comment.
2157 (find_next_newline_no_quit, find_before_next_newline):
2158 Add bytepos argument.
2159 * lisp.h (find_newline, find_next_newline_no_quit)
2160 (find_before_next_newline): Adjust prototypes.
2161 * bidi.c (bidi_find_paragraph_start):
2162 * editfns.c (Fconstrain_to_field, Fline_end_position):
2163 * indent.c (compute_motion, vmotion):
2164 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2165 (get_visually_first_element, move_it_vertically_backward):
2166 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2167
2168 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2169
2170 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2171 resources were not orderly released.
2172
2173 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2174
2175 * xdisp.c (x_draw_vertical_border): For a window that is neither
2176 the leftmost nor the rightmost, redraw both the left and the right
2177 vertical borders. (Bug#13723)
2178
2179 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2180
2181 * xml.c (init_libxml2_functions):
2182 * sound.c (sound_warning):
2183 * sheap.c (report_sheap_usage):
2184 * process.c (wait_reading_process_output):
2185 * msdos.c (XMenuActivate):
2186 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2187 * keyboard.c (top_level_1):
2188 * editfns.c (Fmessage, Fmessage_box):
2189 * callint.c (Fcall_interactively):
2190 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2191
2192 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2193
2194 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2195 * frame.c (syms_of_frame): ... to here.
2196
2197 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2198
2199 * w32.c (sys_chown): Remove unused function.
2200
2201 * w32term.c <input_signal_count>: Declare 'volatile'
2202 unconditionally. (Bug#9066)
2203
2204 * w32.c (set_errno): Reset h_errno and don't set it to any other
2205 value. Set errno instead.
2206 (check_errno): Reset h_errno.
2207 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2208 (sys_gethostname, sys_getservbyname, sys_getpeername)
2209 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2210 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2211 h_errno.
2212 (sys_gethostbyname): Set h_errno only errors detected.
2213
2214 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2215
2216 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2217
2218 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2219
2220 * keyboard.c (read_char): Fix calculation of auto-save time out
2221 when auto-save-timeout is less than 4. (Bug#13720)
2222
2223 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2224 time. Improve diagnostics in DebPrint. (Bug#13546)
2225
2226 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2227 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2228 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2229 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2230 make sure errno is set to an appropriate value. (Bug#13546)
2231 (socket_to_fd): Add assertion against indexing fd_info[] with a
2232 value that is out of bounds.
2233 (sys_accept): If fd is negative, do not set up the child_process
2234 structure for reading.
2235
2236 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2237
2238 * composite.c (fill_gstring_header): Remove useless prototype.
2239 Break long line.
2240 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2241 * print.c (PRINTDECLARE, print_object):
2242 * search.c (compile_pattern, fast_looking_at, search_buffer):
2243 (simple_search, boyer_moore, Freplace_match):
2244 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2245 (get_overlay_arrow_glyph_row, display_mode_element):
2246 (decode_mode_spec_coding, message3):
2247 * xfaces.c (face_at_string_position): Use bool for booleans.
2248 Adjust comments.
2249
2250 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2251
2252 Fix AIX port (Bug#13650).
2253 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2254 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2255 was #undeffed earlier, so it cannot be used as a macro here.
2256 Use the constant and not the macro.
2257
2258 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2259
2260 * w32proc.c (new_child): If no vacant slots are found in
2261 child_procs[], make another pass looking for slots whose process
2262 has exited or died. (Bug#13546)
2263
2264 * w32.c (sys_pipe): When failing due to file descriptors above
2265 MAXDESC, set errno to EMFILE.
2266 (_sys_read_ahead): Update cp->status when failing to read serial
2267 communications input, so that the status doesn't stay at
2268 STATUS_READ_IN_PROGRESS. (Bug#13546)
2269
2270 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2271
2272 * gtkutil.c (tb_size_cb): New function.
2273 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2274
2275 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2276
2277 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2278 an event.
2279
2280 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2281
2282 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2283
2284 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2285
2286 * font.c (font_range): Add pos_byte argument. Adjust comment
2287 and break long line.
2288 * font.h (font_range): Adjust prototype.
2289 * composite.c (autocmp_chars): Pass byte position to font_range.
2290 Break long line. Remove useless prototype and format comment.
2291
2292 2013-02-13 Glenn Morris <rgm@gnu.org>
2293
2294 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2295
2296 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 Improve AIX port some more (Bug#13650).
2299 With this, it should be as good as it was in 23.3, though it's
2300 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2301 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2302 * unexaix.c (start_of_text): Remove.
2303 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2304 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2305 (orig_load_scnptr, orig_data_scnptr):
2306 Now off_t, not long, since they are file offsets.
2307 (make_hdr): Use _data, not start_of_data ().
2308 This is the key part of the fix.
2309 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2310 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2311
2312 * pre-crt0.c (data_start): Initialize to 1.
2313 This ports to compilers that optimize the external declaration
2314 'int x = 0;' as if it were 'int x;' to shrink the executable.
2315
2316 Improve AIX port (Bug#13650).
2317 This doesn't fix the bug, but it makes progress: Emacs builds now.
2318 * unexaix.c: Include inttypes.h, stdarg.h.
2319 (report_error, report_error_1): Mark as _Noreturn.
2320 (report_error): Don't report the wrong errno.
2321 (report_error_1): Now varargs. All callers changed.
2322 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2323 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2324 (write_ptr): Use %p to print address rather than %lx and a cast
2325 to unsigned long. Grow buffer a bit, to be safer.
2326
2327 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2328
2329 * bidi.c (bidi_resolve_neutral): After finding the next
2330 non-neutral character, accept NEUTRAL_ON type as well, because
2331 directional control characters, such as LRE and RLE, have their
2332 type converted to that by bidi_resolve_weak. This avoids aborts
2333 when LRE/RLE follows a run of neutrals.
2334 (bidi_move_to_visually_next): Assert that return value of
2335 bidi_peek_at_next_level is non-negative. Negative values will
2336 cause an infloop.
2337
2338 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2339
2340 Minor getenv-related fixes.
2341 * callproc.c (Fcall_process_region) [!DOS_NT]:
2342 Avoid unnecessary duplicate call to getenv.
2343 * callproc.c (init_callproc):
2344 * dispnew.c (init_display):
2345 * sysdep.c (sys_subshell):
2346 Omit unnecessary cast of getenv or egetenv.
2347
2348 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2349
2350 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2351 Update dependencies.
2352
2353 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2354
2355 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2356 marker's position.
2357 (display_line): Set w->region_showing to the value of
2358 it->region_beg_charpos, not to -1. This fixes redisplay
2359 optimization when cursor is moved up after M->. (Bug#13623)
2360 (Bug#13626)
2361 (try_scrolling): Scroll text up more if point is too close to ZV
2362 and inside the scroll margin. This makes sure point is moved
2363 outside the scroll margin in these cases.
2364
2365 * window.h (struct window): region_showing can no longer be
2366 negative.
2367
2368 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2369
2370 Tune by using memchr and memrchr.
2371 * doc.c (Fsnarf_documentation):
2372 * fileio.c (Fsubstitute_in_file_name):
2373 * search.c (find_newline, scan_newline):
2374 * xdisp.c (pos_visible_p, display_count_lines):
2375 Use memchr and memrchr rather than scanning byte-by-byte.
2376 * search.c (find_newline): Rename from scan_buffer.
2377 Omit first arg TARGET, as it's always '\n'. All callers changed.
2378
2379 Clean up read_key_sequence a tiny bit more.
2380 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2381 (read_key_sequence): Remove unused locals.
2382
2383 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2384
2385 Clean up read_key_sequence a bit; reread active keymaps after first event.
2386 * keyboard.c (read_char, read_char_x_menu_prompt)
2387 (read_char_minibuf_menu_prompt):
2388 Replace nmaps+maps with a single `map' arg.
2389 (follow_key): Operate on a single map.
2390 (active_maps): New function.
2391 (test_undefined): Also return true for nil bindings.
2392 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2393 a single (composed) keymap. Remember `first_event' to choose the right
2394 set of active keymaps. Recompute the set of keymaps after receiving
2395 the first event. Remove GOBBLE_FIRST_EVENT.
2396 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2397 * keyboard.h (read_char): Update declaration.
2398 * lread.c (read_filtered_event): Adjust call to read_char.
2399
2400 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2401
2402 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2403 Don't use the limitation on backwards movement when lines are truncated
2404 in the window. (Bug#13675)
2405
2406 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2407
2408 * marker.c (set_marker_internal): If desired position is passed
2409 as a marker, avoid call to buf_charpos_to_bytepos.
2410 * window.c (Fset_window_point): Omit redundant type checking.
2411 (Fset_window_start): Likewise. Format comment.
2412 (window_scroll_pixel_based): Use set_marker_restricted_both
2413 with character and byte positions obtained from an iterator.
2414 (Fset_window_configuration): Use set_marker_restricted_both.
2415 * xdisp.c (message_dolog): Likewise.
2416
2417 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2418
2419 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2420 When text lines are longer than window's screen lines, don't move back
2421 too far. This speeds up some redisplay operations. (Bug#13675)
2422
2423 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 * syntax.c (scan_sexps_forward): Fix byte position calculation
2426 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2427
2428 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2431 that was not needed.
2432
2433 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2434
2435 Minor hashing refactoring.
2436 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2437 (sxhash_float): Return EMACS_UINT, for consistency with the other
2438 hash functions.
2439 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2440 non-static inline function and therefore can't use static vars.
2441 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2442 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2443 with the other hash functions.
2444
2445 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2446
2447 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2448 XXXXXX part of the temporary file pattern is not downcased even
2449 when w32-downcase-file-names is non-nil. (Bug#13661)
2450
2451 * xdisp.c (decode_mode_spec): Remove handling of %t.
2452
2453 * msdos.c (careadlinkatcwd): Remove.
2454
2455 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2456
2457 * lread.c (skip_dyn_bytes): New function (bug#12598).
2458 (read1): Use it. Use getc instead of READCHAR to read bytes.
2459 (load_each_byte): Remove. Update users.
2460
2461 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2462
2463 * search.c (scan_buffer): Calculate end byte position just once.
2464 (scan_newline): Do not recalculate start_byte.
2465 (search_command): Use eassert.
2466 * syntax.c (struct lisp_parse_state): New member location_byte.
2467 (scan_sexps_forward): Record from_byte and avoid redundant
2468 character to byte position calculation ...
2469 (Fparse_partial_sexp): ... here. Break too long line.
2470
2471 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 * lisp.h (make_uninit_vector): New function.
2474 * alloc.c (Fvector, Fmake_byte_code):
2475 * ccl.c (Fregister_ccl_program):
2476 * charset.c (Fdefine_charset_internal, define_charset_internal):
2477 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2478 * composite.c (syms_of_composite):
2479 * font.c (Fquery_font, Ffont_info, syms_of_font):
2480 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2481 * ftfont.c (ftfont_shape_by_flt):
2482 * indent.c (recompute_width_table):
2483 * nsselect.m (clean_local_selection_data):
2484 * syntax.c (init_syntax_once):
2485 * w32unsubscribe.c (uniscribe_shape):
2486 * window.c (Fcurrent_window_configuration):
2487 * xfaces.c (Fx_family_fonts):
2488 * xselect.c (selection_data_to_lisp_data): Use it.
2489
2490 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2491
2492 * coding.c (Fdefine_coding_system_internal): Use AREF where
2493 argument is known to be a vector.
2494 * fns.c (Flocale_info): Likewise for ASET.
2495 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2496 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2497
2498 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2499
2500 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2501 height.
2502
2503 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2504 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2505 updateCollectionBehaviour.
2506
2507 * nsterm.m (NEW_STYLE_FS): Remove.
2508 (ns_last_use_native_fullscreen): New variable.
2509 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2510 (x_set_window_size): Do not take title bar and tool bar into account
2511 if isFullscreen returns YES.
2512 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2513 (check_native_fs): New function.
2514 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2515 (ns_term_init): Remove NEW_STYLE_FS.
2516 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2517 and tool bar if isFullscreen returns NO.
2518 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2519 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2520 with HAVE_NATIVE_FS.
2521 (window:willUseFullScreenPresentationOptions:): New method.
2522 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2523 Hide toolbar if not enabled (Bug#13444).
2524 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2525 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2526 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2527 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2528 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2529 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2530 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2531 (syms_of_nsterm): Add ns-use-native-fullscreen.
2532
2533 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 * fileio.c (Qchoose_write_coding_system): Now static.
2536
2537 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2538
2539 * xdisp.c (window_buffer_changed): region_showing can be negative,
2540 which still means region is being displayed.
2541 (redisplay_internal): Resurrect code that forced redisplay of the
2542 whole window when showing region and the mark has changed.
2543 Record the new mark position to allow redisplay optimizations.
2544 (display_line): If it->region_beg_charpos is non-zero, set the
2545 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2546
2547 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2548 not bitfield of 1 bit.
2549
2550 2013-02-03 Daniel Colascione <dancol@dancol.org>
2551
2552 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2553 daemon mode works on cygw32 when Emacs is installed and not just
2554 during development.
2555
2556 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2557
2558 Avoid file time stamp bug on MS-Windows (Bug#13149).
2559 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2560 as FAT32 doesn't update time stamps when truncating them.
2561 Also, check that a file time stamp is not a multiple of 100 ns;
2562 this should catch all instances of the problem on MS-Windows,
2563 as its native file system resolution is 100 ns or worse, and
2564 checking for a non-multiple of 100 ns should impose only a small
2565 overhead on systems with ns resolution.
2566
2567 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2568
2569 Avoid encoding file names on MS-Windows when they need to be run
2570 through dostounix_filename.
2571 * w32.c (normalize_filename): Accept an additional argument
2572 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2573 downcase it even if w32-downcase-file-names is non-nil.
2574 (dostounix_filename): Accept an additional argument MULTIBYTE and
2575 pass it to normalize_filename.
2576 (emacs_root_dir): Adjust.
2577
2578 * msdos.h (dostounix_filename): Adjust prototype.
2579
2580 * w32.h (dostounix_filename): Adjust prototype.
2581
2582 * msdos.c (dostounix_filename): Accept an additional argument and
2583 ignore it.
2584 (init_environment): Adjust callers of dostounix_filename.
2585
2586 * fileio.c (Ffile_name_directory, file_name_as_directory)
2587 (directory_file_name, Fexpand_file_name)
2588 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2589 dostounix_filename.
2590 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2591 non-nil.
2592 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2593 variables, as egetenv is case-insensitive for DOS_NT.
2594
2595 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2596 with an encoded file name.
2597
2598 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2599 Adjust calls to dostounix_filename.
2600
2601 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2602
2603 * unexw32.c (unexec): Adjust call to dostounix_filename.
2604
2605 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2606
2607 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2608 dostounix_filename.
2609
2610 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2611 dostounix_filename.
2612
2613 * callproc.c (Fcall_process): Make sure program name in PATH and
2614 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2615 is passed to exec/spawnve, which fails unless the file-name
2616 encoding is UTF-8.
2617
2618 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2619 even if w32-quote-process-args is nil.
2620
2621 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 Fix timestamp bug when write-region appends nothing (Bug#13149).
2624 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2625 the file's time stamp doesn't change if Emacs happens to write nothing
2626 to the file, and on a buggy file system this could cause Emacs to
2627 incorrectly infer that the file system doesn't have the bug.
2628 Avoid this problem by inhibiting the inference in this case.
2629
2630 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2631
2632 * window.h (struct window): Convert base_line_number, base_line_pos
2633 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2634 Convert region_showing member from Lisp_Object to bitfield.
2635 Remove sequence_number member. Adjust comments.
2636 * window.c (sequence_number): Remove.
2637 (make_window): Initialize column_number_displayed.
2638 * print.c (print_object): Follow the printed representation of
2639 frames and print window pointer to distinguish between windows.
2640 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2641 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2642 (wset_column_number_displayed, wset_region_showing): Remove.
2643 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2644 (try_scrolling, try_cursor_movement, redisplay_window)
2645 (try_window_reusing_current_matrix, try_window_id, display_line)
2646 (display_mode_lines, decode_mode_spec): Adjust users.
2647 * .gdbinit (pwinx): Do not print sequence_number.
2648
2649 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2650
2651 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2652 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2653 * dired.c: Include <fcntl.h>.
2654 (open_directory): New function, which uses open and fdopendir
2655 rather than opendir. DOS_NT platforms still use opendir, though.
2656 (directory_files_internal, file_name_completion): Use it.
2657 (file_attributes): New function, with most of the old Ffile_attributes.
2658 (directory_files_internal, Ffile_attributes): Use it.
2659 (file_attributes, file_name_completion_stat): First arg is now fd,
2660 not dir name. All uses changed. Use fstatat rather than lstat +
2661 stat.
2662 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2663 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2664 (emacs_readlinkat): New function, with much of the old
2665 Ffile_symlink_p, but with an fd argument for speed.
2666 It uses readlinkat rather than careadlinkatcwd, so that it
2667 need not assume the working directory.
2668 (Ffile_symlink_p): Use it.
2669 * filelock.c (current_lock_owner): Use emacs_readlinkat
2670 rather than emacs_readlink.
2671 * lisp.h (emacs_readlinkat): New decl.
2672 (READLINK_BUFSIZE, emacs_readlink): Remove.
2673 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2674 (emacs_norealloc_allocator, emacs_readlink): Remove.
2675 This stuff is moved to fileio.c.
2676 * w32.c (fstatat, readlinkat): New functions.
2677 (careadlinkat): Don't check that fd == AT_FDCWD.
2678 (careadlinkatcwd): Remove; no longer needed.
2679
2680 2013-01-31 Glenn Morris <rgm@gnu.org>
2681
2682 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2683 (Fwrite_region): Update for new choose_write_coding_system args.
2684 Move the last piece of choose_write_coding_system here. (Bug#13522)
2685 (syms_of_fileio): Add choose-write-coding-system.
2686
2687 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2688
2689 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2690 (sys_close): Zero out the flags for the file descriptor before
2691 closing it. (Bug#13546)
2692
2693 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2694 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2695 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2696 DBCS. (Bug#13553)
2697
2698 * w32.c (w32_get_long_filename, init_environment, readlink):
2699 Support file names encoded in DBCS codepages.
2700 (readlink): Use the current file-name-coding-system, not the ANSI
2701 codepage, to decode and handle targets of symlinks.
2702
2703 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2704
2705 * w32.c (opendir): Now accepts a 'const char *'.
2706
2707 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2708
2709 Remove obsolete redisplay code. See the discussion at
2710 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2711 * dispnew.c (preemption_period, preemption_next_check): Remove.
2712 (Vredisplay_preemption_period): Likewise.
2713 (update_frame, update_single_window, update_window, update_frame_1):
2714 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2715 used, following the 2012-06-22 change.
2716
2717 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2718
2719 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2720
2721 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2722
2723 * font.c (num_fonts): Remove the leftover from old
2724 debugging code. Adjust comment style here and there.
2725 * insdel.c (insert_1): Remove.
2726 * lisp.h (insert_1): Remove prototype.
2727 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2728
2729 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2730
2731 * w32.c (max_filename_mbslen): New function.
2732 (normalize_filename, readdir): Use it to detect locales where ANSI
2733 encoding of file names uses a double-byte character set (DBCS).
2734 If a DBCS encoding is used, advance by characters using
2735 CharNextExA, instead of incrementing a 'char *' pointer.
2736 Use _mbslwr instead of _strlwr. (Bug#13515)
2737
2738 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2739 request of memory reservation to 1.7GB. (Bug#13065)
2740
2741 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2742
2743 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2744 at check_extra_latin label. (Bug#13505)
2745
2746 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2747
2748 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2749 Avoid redundant calls to strlen.
2750
2751 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Drop async_visible and async_iconified fields of struct frame.
2754 This is possible because async input is gone; for details, see
2755 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2756 * frame.h (struct frame): Remove async_visible and async_iconified
2757 members, convert garbaged to unsigned bitfield. Adjust comments.
2758 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2759 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2760 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2761 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2762 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2763 * w32term.c: Ditto.
2764 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2765 properly. Likewise for obscured.
2766 * xterm.c: Ditto.
2767 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2768 properly.
2769 * nsterm.m: Ditto.
2770 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2771
2772 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2775 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2776
2777 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2778
2779 * xdisp.c (message2, message2_nolog): Remove functions.
2780 (message3, message3_nolog): Extract nbytes and multibyteness directly
2781 from the string. Change all callers.
2782 (message3_nolog): Don't set message_enable_multibyte since set_message
2783 will reset it anyway.
2784 (message1, message1_nolog): Use message3.
2785 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2786 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2787 (set_message): Drop all but the second arg, which has to be a string.
2788 (set_message_1): Simplify now that we know that a1 is NULL and the
2789 second arg is a string.
2790 * frame.h (struct frame): Remove `message_buf' field.
2791 Use glyphs_initialized_p instead.
2792 (FRAME_MESSAGE_BUF): Remove macro.
2793 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2794 * lisp.h (message2, message2_nolog): Remove declarations.
2795 (message3, message3_nolog): Update declarations.
2796 * keyboard.c (read_char_minibuf_menu_text)
2797 (read_char_minibuf_menu_width): Remove vars.
2798 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2799 to correctly handle multibyte strings.
2800 * frame.c (delete_frame): Don't free message_buf any more.
2801 * editfns.c (message_text, message_length): Remove vars.
2802 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2803 * fileio.c (auto_save_error): Use message3 instead of message2.
2804 * dispnew.c (adjust_frame_message_buffer): Remove function.
2805
2806 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2807
2808 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2809 real estate used for the tool bar and the menu bar.
2810
2811 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2812
2813 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2814 hidden buffer is prepared to modification (Bug#13164).
2815
2816 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2817
2818 * window.h (struct window): Change window_end_valid member from
2819 Lisp_Object to a bitfield. Adjust comments.
2820 (wset_window_end_valid): Remove.
2821 * window.c (adjust_window_count): Clear window_end_valid.
2822 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2823 (Fwindow_line_height, set_window_buffer, Frecenter)
2824 (Fsplit_window_internal, Fdelete_other_windows_internal)
2825 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2826 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2827 * xdisp.c (check_window_end, reconsider_clip_changes)
2828 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2829 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2830 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2831
2832 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2833
2834 * xdisp.c (mark_window_display_accurate): Simplify the loop
2835 assuming that the only one of vchild, hchild or buffer window
2836 slots is non-nil. Call mark_window_display_accurate_1 for
2837 the leaf windows only.
2838 (mark_window_display_accurate_1): Always assume leaf window.
2839 Adjust comment.
2840
2841 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2842
2843 * emacs.c (Qkill_emacs_hook): Now static.
2844
2845 * fileio.c (Finsert_file_contents): Simplify.
2846 Remove unnecessary assignments and tests.
2847
2848 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2849
2850 * w32.c (acl_set_file): Don't test for errors unless
2851 set_file_security returns FALSE. Avoids spurious errors when
2852 saving files.
2853
2854 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2855
2856 * fileio.c (Finsert_file_contents): Revert code introduced at
2857 2013-01-18 in favor of the simpler and generally better fix.
2858 Save stack space by removing 'buffer' and reusing 'read_buf'
2859 where appropriate.
2860
2861 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 * lisp.h (eabs): Define unconditionally (Bug#13419).
2864 The old "#if !defined (eabs)" was an unnecessary revenant of back
2865 when this macro was called "abs". Document 'eabs' better.
2866
2867 2013-01-19 Glenn Morris <rgm@gnu.org>
2868
2869 * fns.c (Frandom): Doc fix.
2870
2871 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2872
2873 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2874 segfault when there are lots of overlays.
2875
2876 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2877 when there are lots of overlays.
2878 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2879 for the details and a way to reproduce.
2880
2881 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2882
2883 * fileio.c: Use O_APPEND to append.
2884 This corresponds better to the natural interpretation of "append",
2885 and avoids the need to open the output file twice, or to invoke
2886 lseek when APPEND is neither nil nor a number.
2887 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2888 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2889 file possibly twice, and lseeking to its end; this avoids the
2890 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2891 at the same time: the combination is never needed and apparently
2892 it doesn't work with DOS_NT.
2893
2894 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2895 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2896
2897 Allow floating-point file offsets.
2898 Problem reported by Vitalie Spinu in
2899 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2900 * fileio.c (emacs_lseek): Remove.
2901 (file_offset): New function.
2902 (Finsert_file_contents, Fwrite_region): Use it.
2903
2904 2013-01-19 Chong Yidong <cyd@gnu.org>
2905
2906 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2907 aborting on Fsignal (Bug#13289).
2908
2909 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2910
2911 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2912 set_file_security as failure due to insufficient privileges.
2913 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2914 (fstat): Return owner and group like 'stat' and 'lstat' do.
2915
2916 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2917
2918 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2919 The bug was observed on Ubuntu operating inside a virtual machine,
2920 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2921 The workaround introduces a race condition on non-buggy hosts,
2922 but it's an unlikely race and anyway there's a nearly identical
2923 nearby race that can't be fixed.
2924 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2925 New static vars.
2926 (Fwrite_region): Test for file system time stamp bug.
2927 (init_fileio): New function.
2928 * lisp.h (init_fileio): Declare it.
2929 * emacs.c (main): Call it.
2930
2931 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2932 and make it more consistent with other stat-failure diagnostics.
2933
2934 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2935
2936 Fix crash when inserting data from non-regular files.
2937 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2938 for the error description produced by valgrind.
2939 * fileio.c (read_non_regular): Rename to read_contents.
2940 Free Lisp_Save_Value object used to pass parameters.
2941 (read_non_regular_quit): Rename to read_contents_quit.
2942 (Finsert_file_contents): Redesign internal file reading loop to adjust
2943 gap and end positions after each read and so help make_gap to work
2944 properly. Do not signal an I/O error too early and so do not leave
2945 not yet decoded characters in a buffer, which was the reason of
2946 redisplay crash. Use list2 to build return value. Adjust comments.
2947
2948 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2949
2950 Close a race when statting and reading files (Bug#13149).
2951 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2952 This avoids a race if the file is renamed between stat and open.
2953 This race is not the problem originally noted in Bug#13149;
2954 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2955
2956 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2957
2958 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2959 objects, related functions and macros.
2960 (make_save_value): Adjust prototype.
2961 (make_save_pointer): New prototype.
2962 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2963 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2964 * alloc.c (format_save_value): Rename to make_save_value.
2965 (make_save_pointer): New function.
2966 (record_xmalloc): Use make_save_pointer.
2967 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2968 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2969 Change users of make_save_value to make_save_pointer.
2970 Likewise for format_save_value and make_save_value.
2971
2972 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2975 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2976 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2977 debugging stubs.
2978
2979 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2980
2981 * alloc.c (free_save_value): Now static.
2982
2983 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2984
2985 * keymap.c (map_keymap_internal): Use format_save_value.
2986 (map_keymap_char_table_item): Adjust accordingly.
2987 * fileio.c (non_regular_fd, non_regular_inserted)
2988 (non_regular_nbytes): Remove.
2989 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2990 Use format_save_value to pass parameters to read_non_regular.
2991 (read_non_regular): Use XSAVE_ macros to extract parameters.
2992 Adjust comment.
2993 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2994 format_save_value.
2995 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2996
2997 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2998
2999 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
3000 extraction from any Lisp_Save_Value slot. Add type checking.
3001 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
3002 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
3003 * xselect.c: All users changed.
3004
3005 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3006
3007 Some convenient bits to deal with Lisp_Save_Values.
3008 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
3009 (allocate_misc): Remove prototype.
3010 (format_save_value): New prototype.
3011 * alloc.c (allocate_misc): Revert back to static.
3012 (format_save_value): New function to build Lisp_Save_Value
3013 object with the specified internal structure.
3014 (make_save_value): Reimplement using format_save_value.
3015 * editfns.c (save_excursion_save): Use format_save_value.
3016 (save_excursion_restore): Use XSAVE_OBJECT.
3017
3018 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3019
3020 Avoid needless casts with XSAVE_POINTER.
3021 * alloc.c (mark_object) [GC_MARK_STACK]:
3022 * dired.c (directory_files_internal_unwind):
3023 * fileio.c (do_auto_save_unwind):
3024 * gtkutil.c (pop_down_dialog):
3025 * keymap.c (map_keymap_char_table_item):
3026 * lread.c (load_unwind):
3027 * nsmenu.m (pop_down_menu):
3028 * print.c (print_object) [GC_MARK_STACK]:
3029 * xfns.c (clean_up_file_dialog):
3030 * xmenu.c (cleanup_widget_value_tree):
3031 Omit casts between XSAVE_POINTER and a pointer type.
3032
3033 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3036 * eval.c (eval_sub): Protect `form' from being GCed before its
3037 car and cdr becomes protected with the backtrace entry.
3038
3039 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3040
3041 Make Lisp_Save_Value more versatile storage for up to four objects.
3042 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3043 (struct Lisp_Save_Value): New layout. Adjust comments.
3044 (XSAVE_POINTER): New macro.
3045 (XSAVE_INTEGER): Likewise.
3046 (allocate_misc): Add prototype.
3047 (free_misc): Likewise.
3048 * alloc.c (allocate_misc): Now global.
3049 (free_misc): Likewise. Adjust comment.
3050 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3051 (free_save_value): Likewise.
3052 (mark_object): Likewise.
3053 * editfns.c (save_excursion_save): Pack everything within
3054 Lisp_Save_Value and so avoid xmalloc.
3055 (save_excursion_restore): Adjust to match new layout. Use free_misc
3056 because we do not allocate extra memory any more. Add eassert.
3057 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3058 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3059 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3060 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3061 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3062
3063 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3064
3065 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3066 (nsfont_draw): Remove disabling of LCD smoothing.
3067 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3068 Bug#11484 with LCD smoothing on.
3069
3070 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3071
3072 Fix SIGDANGER handlers, for AIX (Bug#13408).
3073 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3074 Move handlers here from emacs.c; they were out of place.
3075
3076 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3077
3078 * xterm.c (syms_of_xterm): Adjust documentation for
3079 scroll-bar-adjust-thumb-portion.
3080
3081 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3082
3083 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3084 determine whether scroll bar thumb size should be adjusted or
3085 not. Use variable for MOTIF.
3086
3087 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
3088 GTK.
3089
3090 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3091
3092 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3093 event is generated.
3094 (doCommandBySelector:): Set processingCompose to NO.
3095
3096 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3097 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3098 (nsfont_list_family): Add block/unblock_input calls.
3099 (nsfont_open): Move block_input earlier. Add unblock_input before early
3100 return.
3101 (nsfont_draw): Add block/unblock_input calls.
3102
3103 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3106 for old_charpos and old_bytepos.
3107
3108 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3109
3110 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3111 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3112 Clear tzvalbuf_in_environ if this workaround is in effect.
3113 Problem and fix reported by Kazuhiro Ito.
3114
3115 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3116
3117 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3118 Fix ambiguous doc string cross-reference(s).
3119
3120 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3121 doc string cross-reference(s).
3122
3123 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3124 string cross-reference(s).
3125
3126 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3127
3128 Avoid unnecessary byte position calculation for the gap movement.
3129 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3130 anyway, all of them should use move_gap_both instead.
3131 * lisp.h (move_gap): Remove prototype.
3132 * insdel.c (move_gap): Remove.
3133 (move_gap_both): Add eassert.
3134 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3135 * xml.c (parse_region): Likewise.
3136
3137 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3138
3139 emacsclient -t should not suspend Emacs server (Bug#13387)
3140 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3141 New functions.
3142 * term.c (init_tty): Use them instead of rolling our own code.
3143 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3144 switches from 'signal' to 'pthread_sigmask', which is safer in
3145 multithreaded applications.
3146 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3147 which has already arranged for that.
3148 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3149 This is the main part of the bug fix.
3150
3151 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3152
3153 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3154 x_last_font_name (Bug#13403).
3155
3156 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3157
3158 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3159 the type of per-buffer values where appropriate.
3160 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3161 predicate, which is how it's really used now. Adjust comment.
3162 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3163 * buffer.c (buffer_slot_type_mismatch): Remove.
3164 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3165 predicate. Adjust comment.
3166 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3167 fill-column, left-margin, tab-width, buffer-saved-size,
3168 left-margin-width, right-margin-width, left-fringe-width,
3169 right-fringe-width, scroll-bar-width and buffer-display-count.
3170 Use Qstringp for default-directory, buffer-file-name,
3171 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3172 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3173 line-spacing.
3174 * data.c (store_symval_forwarding): Adjust to call the predicate.
3175
3176 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3177
3178 * w32.c (get_name_and_id, acl_set_file):
3179 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3180
3181 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3182
3183 * lisp.h (make_gap_1): New prototype.
3184 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3185 gap size values.
3186 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3187 naming convention.
3188 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3189 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3190 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3191 (make_gap_1): New function to adjust the gap of any buffer.
3192 * coding.c (coding_alloc_by_making_gap): Use it.
3193 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3194 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3195
3196 2013-01-08 Juri Linkov <juri@jurta.org>
3197
3198 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3199 of (supports :underline (:style wave)). (Bug#13000)
3200
3201 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3202
3203 * undo.c (Fprimitive_undo): Move to simple.el.
3204 (syms_of_undo): Remove declarations for Sprimitive_undo.
3205
3206 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3207
3208 * keyboard.c (echo_add_key): Rename from echo_add_char.
3209
3210 2013-01-06 Chong Yidong <cyd@gnu.org>
3211
3212 * keyboard.c (echo_add_char): New function, factored out from
3213 echo_char. Don't add a space if the previous echo string was
3214 empty (Bug#13255).
3215 (echo_char): Use it.
3216 (read_key_sequence): When echoing mock input, ensure that the
3217 trailing dash is properly added.
3218
3219 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3220
3221 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3222 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3223 digits for buffer positions, before misalignment starts.
3224 Display "0" for integer "object" field.
3225 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3226 Display the newline glyph more unambiguously.
3227
3228 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3229
3230 * nsterm.m (ns_draw_underwave):
3231 * w32term.c (w32_draw_underwave):
3232 * xterm.c (x_draw_underwave): Make underwave look more triangular
3233 and also degrade gracefully for small fonts. (Bug#13000)
3234
3235 * nsterm.m (ns_draw_text_decoration):
3236 * w32term.c (x_draw_glyph_string):
3237 * xterm.c (x_draw_glyph_string): Don't use previous underline
3238 thickness and position if previous underline type is underwave.
3239
3240 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3241
3242 * fileio.c (Ffile_acl): Undocument return format.
3243
3244 2013-01-02 Glenn Morris <rgm@gnu.org>
3245
3246 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3247
3248 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 Simplify via eabs.
3251 * dired.c (file_name_completion):
3252 * doc.c (get_doc_string):
3253 * floatfns.c (round2):
3254 * font.c (font_score, font_delete_unmatched):
3255 * fringe.c (compute_fringe_widths):
3256 * lread.c (read_list):
3257 * minibuf.c (Ftry_completion):
3258 * term.c (tty_ins_del_lines):
3259 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3260 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3261
3262 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3263
3264 * w32.c (unsetenv): Set up the string passed to _putenv
3265 correctly.
3266 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3267 for the bug this caused.
3268
3269 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3270
3271 * coding.c (Qmac): Now static.
3272
3273 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3274
3275 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3276 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3277 handlebox_widget. Set toolbar_in_hbox to false/true, set
3278 toolbar_is_packed to true.
3279 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3280 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3281 Show all on TOOLBAR_TOP_WIDGET.
3282 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3283 by TOOLBAR_TOP_WIDGET.
3284 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3285 Check toolbar_is_packed.
3286 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3287 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3288 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3289 false.
3290 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3291 (xg_update_menubar): Update title only if
3292 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3293 (xg_update_submenu): Skip tearoff only if
3294 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3295 (xg_initialize): Initialize xg_detached_menus only if
3296 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3297
3298 * xterm.h (struct x_output): Surround handlebox_widget with
3299 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3300 toolbar_in_hbox is bool.
3301
3302 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3303
3304 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3305 (LIBS_GNUSTEP): Define.
3306 (LIBES): Add $(LIBS_GNUSTEP).
3307 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3308
3309 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3310
3311 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3312 continuation glyph on a TTY with an indication of an empty line.
3313 (Bug#13277)
3314
3315 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3316
3317 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3318 file's SELinux context or ACLs successfully set, nil otherwise.
3319 (Bug#13298)
3320 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3321
3322 * w32proc.c (reader_thread): Avoid passing NULL handles to
3323 SetEvent and WaitForSingleObject.
3324
3325 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3326
3327 Port EXTERNALLY_VISIBLE to Clang 3.2.
3328 * conf_post.h (__has_attribute): New macro.
3329 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3330
3331 2012-12-27 Glenn Morris <rgm@gnu.org>
3332
3333 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3334 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3335
3336 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3337
3338 * fileio.c (file_name_as_directory, directory_file_name):
3339 Accept an additional argument MULTIBYTE to indicate whether the input C
3340 came from a multibyte or a unibyte Lisp string; all callers
3341 adjusted. Don't assume the input string is always multibyte.
3342 (Bug#13262)
3343 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3344 don't ENCODE_FILE them, and return a unibyte string if the input
3345 was unibyte.
3346 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3347 don't assume the input strings will always be multibyte. If the
3348 input strings are multibyte, decode strings obtained from C
3349 library functions.
3350
3351 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3352
3353 * lisp.h (toplevel): Add two notices to the comment about
3354 defining a new Lisp data type.
3355 * print.c (print_object): If Lisp_Save_Value object's pointer
3356 is the address of a memory area containing Lisp_Objects, try
3357 to print them.
3358 * alloc.c (valid_lisp_object_p): Adjust comment.
3359
3360 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 * keyboard.c (record_asynch_buffer_change): Initialize an event
3363 only if it's really needed.
3364 * frame.h (enum output_method): Remove output_mac member since
3365 it's a leftover from the deleted code.
3366 * frame.c (Fframep): Adjust user here ...
3367 * terminal.c (Fterminal_live_p): ... and here.
3368 * coding.c (Qmac): Now here because it's only used to denote
3369 end-of-line encoding type.
3370 (syms_of_coding): DEFSYM it.
3371 * frame.h (Qmac): Remove duplicated declaration.
3372
3373 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3374
3375 * window.c (select_window_1): Now static, since it's used only here.
3376
3377 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3378
3379 * window.c (window_body_cols): Subtract display margins from the
3380 window body width on TTYs as well. See
3381 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3382 for the original report.
3383
3384 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3385
3386 * xdisp.c (redisplay_window): Remove inner local variable
3387 because the outer shadowed one has the same meaning.
3388 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3389 set but never used.
3390 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3391 (xg_create_tool_bar): Adjust users.
3392
3393 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3394
3395 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3396 * buffer.c (Fget_buffer_create): Use it to set compact field of
3397 struct buffer_text to avoid accessing an uninitialized value
3398 when compact_buffer is called for the first time.
3399 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3400 (Fset_buffer_modified_p): Use buffer_window_count to check
3401 whether the buffer is displayed in some window.
3402 * xdisp.c (message_dolog): Likewise.
3403
3404 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3405
3406 * w32.c (acl_set_file): If setting the file security descriptor
3407 fails, and the new DACL is identical to the existing one, silently
3408 return success. This fixes problems for users backing up their
3409 own files without having the necessary privileges for setting
3410 security descriptors.
3411
3412 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3413 values.
3414 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3415 after WaitForSingleObject returns normally. This expedites reader
3416 thread shutdown when delete_child triggers it.
3417 (reap_subprocess): More accurate commentary for why we call
3418 delete_child only when cp->fd is negative.
3419
3420 * w32.c (sys_close): Do not call delete_child on a subprocess
3421 whose handle is not yet closed. Instead, set its file descriptor
3422 to a negative value, so that reap_subprocess will call
3423 delete_child on that subprocess when its SIGCHLD arrives.
3424 This avoids closing handles used for communications between sys_select
3425 and reader_thread, which doesn't give sys_select a chance to
3426 notice that the process exited and invoke the SIGCHLD handler for
3427 it.
3428
3429 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3430
3431 * nsfns.m (Fns_do_applescript): Run event loop until script has
3432 been executed (Bug#12969).
3433 (ns_run_ascript): Chech as_script for nil, set to nil after
3434 executing script.
3435
3436 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3437
3438 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3439
3440 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3441
3442 * w32term.c (w32fullscreen_hook): New function.
3443 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3444
3445 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3446
3447 * fileio.c (Finsert_file_contents): Doc fix.
3448
3449 * w32proc.c (new_child, delete_child, find_child_pid): For a
3450 subprocess, consider its slot being in use as long as its process
3451 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3452 slot when a new process is started immediately after killing
3453 another one, without waiting enough time for the first process to
3454 be reaped and resources allocated for it be orderly freed.
3455 (Bug#13086)
3456 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3457
3458 2012-12-21 Chong Yidong <cyd@gnu.org>
3459
3460 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3461
3462 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3463
3464 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3465
3466 * w32.c (get_name_and_id): Always pass NULL as the first argument
3467 of lookup_account_sid. Avoids crashes with UNC file names that
3468 refer to DFS domains, not to specific machine names. (Bug#12621)
3469 Remove now unused argument FNAME; all callers changed.
3470 (get_file_owner_and_group): Remove now unused argument FNAME; all
3471 callers changed.
3472
3473 2012-12-21 Chong Yidong <cyd@gnu.org>
3474
3475 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3476 error for invalid chars, don't check for a nil return value.
3477
3478 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3479
3480 Avoid calls to CHAR_TO_BYTE if byte position is known.
3481 * editfns.c (make_buffer_string_both): Use move_gap_both.
3482 (Fbuffer_string): Use make_buffer_string_both.
3483 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3484 Adjust comment.
3485 (buf_bytepos_to_charpos): Likewise.
3486 (charpos_to_bytepos): Remove.
3487 * fileio.c (Finsert_file_contents): Use move_gap_both.
3488 * search.c (Freplace_match): Likewise.
3489 * process.c (process_send_region): Likewise. Use convenient
3490 names for byte positions.
3491 * lisp.h (charpos_to_bytepos): Remove prototype.
3492 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3493 * insdel.c (move_gap): Likewise.
3494
3495 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3496
3497 * xdisp.c (redisplay_internal): Remove now-unused local.
3498
3499 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3500
3501 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3502 (redisplay_internal): Don't bother selecting the frame to get the
3503 proper value of frame-local variables (bug#13225).
3504
3505 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3506
3507 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3508 Rename 4th argument since it may be buffer or string. Adjust comment.
3509 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3510
3511 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 * coding.c (Fdetect_coding_region): Do not check start and end with
3514 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3515 (code_convert_region): Likewise.
3516
3517 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3518
3519 * w32.c (acl_get_file, acl_set_file): Run the file name through
3520 map_w32_filename, and resolve any symlinks in the file name, like
3521 Posix platforms do.
3522 (acl_set_file): Call revert_to_self, if any privileges were
3523 enabled.
3524
3525 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3526
3527 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3528 ($(BLD)/w32.$(O)): Update dependencies.
3529
3530 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3531
3532 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3533 propagate redisplay's scrolling (if any) to the right window.
3534 (redisplay_internal): Use ensure_selected_frame.
3535 (display_mode_lines): Complete last fix.
3536 * window.c (select_window_1): New func, extracted from select_window.
3537 (select_window): Use it.
3538 * window.h (select_window_1): Declare.
3539
3540 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3541
3542 Emulate Posix ACL APIs on MS-Windows.
3543 * w32.c: Include sddl.h and sys/acl.h.
3544 (SDDL_REVISION_1): Define if not already defined.
3545 (g_b_init_get_security_descriptor_dacl)
3546 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3547 (g_b_init_is_valid_security_descriptor)
3548 (g_b_init_set_file_security): New static flags.
3549 (globals_of_w32): Initialize them to zero.
3550 (SetFileSecurity_Name): New string constant.
3551 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3552 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3553 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3554 (IsValidSecurityDescriptor_Proc): New typedefs.
3555 (get_file_security, get_security_descriptor_owner)
3556 (get_security_descriptor_group): Set errno to ENOTSUP.
3557 (set_file_security, get_security_descriptor_dacl)
3558 (is_valid_security_descriptor, convert_sd_to_sddl)
3559 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3560 (acl_free, acl_get_file, acl_set_file): New functions.
3561
3562 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3563
3564 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3565
3566 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3567 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3568 for some of that bug's symptoms can now cause Emacs to abort.
3569 Remove the workaround.
3570 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3571 The bug that caused SIGCHLD to get lost has been fixed, and the
3572 workaround for it can now cause Emacs to abort.
3573
3574 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3575
3576 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3577 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3578 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3579
3580 2012-12-16 Romain Francoise <romain@orebokech.com>
3581
3582 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3583 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3584 and copy ACL entries of file in addition to SELinux context if set.
3585 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3586
3587 * Makefile.in (LIBACL_LIBS): New macro.
3588 (LIBES): Use it.
3589
3590 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3591
3592 * fileio.c (internal_delete_file): Use bool for boolean.
3593
3594 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3595
3596 Fix bug #13079 on MS-Windows with temp files not being deleted.
3597 * w32.h (_child_process): New members input_file and
3598 pending_deletion.
3599 (register_child): First argument is now pid_t.
3600 (record_infile, record_pending_deletion): New prototypes.
3601
3602 * w32proc.c (new_child): Initialize input_file and
3603 pending_deletion members of the child.
3604 (delete_child): Delete the child's temporary input file, if any,
3605 that is pending deletion.
3606 (register_child): First argument is now pid_t.
3607 (record_infile, record_pending_deletion): New functions.
3608 (reap_subprocess): Fix a typo in DebPrint string.
3609 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3610
3611 * fileio.c (internal_delete_file): Return an int again: non-zero
3612 if delete-file succeeds, zero otherwise.
3613
3614 * lisp.h (internal_delete_file): Adjust prototype.
3615
3616 * callproc.c (Fcall_process): Don't overwrite infile with result
3617 of DECODE_FILE.
3618 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3619 asynchronous subprocess, record the name of the input file name,
3620 if any.
3621 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3622 delete the file, record it as pending deletion when the subprocess
3623 exits.
3624
3625 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3626
3627 * editfns.c [HAVE_PWD_H]: Include grp.h.
3628
3629 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3630
3631 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3632
3633 Fix permissions bugs with setgid directories etc. (Bug#13125)
3634 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3635 to mark it as a placeholder. The old value was often wrong.
3636 The only user of this attribute has been changed to use
3637 file-ownership-preserved-p instead, with its new group arg.
3638 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3639
3640 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3641
3642 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3643 Keep selected_window and selected_frame in sync.
3644
3645 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3646
3647 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3648 try to get accurate owner and group information from NT file
3649 security APIs. This is to make most callers of 'stat' and
3650 'lstat', which don't need that information, much faster.
3651
3652 * dired.c (Ffile_attributes) [WINDOWSNT]:
3653 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3654 owner and group information from 'lstat'.
3655
3656 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3657
3658 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3659 as that confuses set-auto-coding, so insist on the head-read
3660 returning the full 1024 bytes. Let lseek compute the tail offset;
3661 less work for us. Do not ignore I/O errors when reading the tail.
3662
3663 * xdisp.c: Minor style fixes.
3664 (init_iterator): Hoist assignment out of if-expression.
3665 (markpos_of_region): Callers now test for sign, not for -1.
3666
3667 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Minor redisplay optimization when the region length is zero.
3670 * xdisp.c (markpos_of_region): New function.
3671 (init_iterator): Do not highlight the region of zero length.
3672 (redisplay_window): Check whether the region is of non-zero length.
3673 (try_cursor_movement): Allow if the region length is zero.
3674 (try_window_reusing_current_matrix, try_window_id): Likewise.
3675
3676 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3677
3678 * search.c (search_buffer): Check the inverse translations of each
3679 character in pattern when the buffer being searched is unibyte.
3680 (Bug#13084)
3681
3682 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3683
3684 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3685 files, fixing a regression from 24.2.
3686 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3687
3688 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3689
3690 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3691 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3692 Remove unnecessary S_ISLNK test, as (contra the comments) this
3693 function can't copy symlinks. Improve quality of error message
3694 when attempting to copy files that are neither regular files nor
3695 directories.
3696
3697 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3698
3699 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3700 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3701 * window.c (Frecenter):
3702 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3703 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3704
3705 2012-12-12 Daniel Colascione <dancol@dancol.org>
3706
3707 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3708 the dumped Emacs is not a sparse file, greatly improving Cygwin
3709 "make bootstrap" performance.
3710
3711 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3712
3713 * inotify.c (inotify_callback): Generate an Emacs event for every
3714 incoming inotify event.
3715
3716 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3717
3718 * xdisp.c (handle_face_prop): Fix logic of computing
3719 it->start_of_box_run_p.
3720 (append_space_for_newline): If the glyph row is R2L, reset the
3721 iterator's end_of_box_run_p flag before prepending the space glyph.
3722 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3723 iterator's start_of_box_run_p flag before prepending the stretch.
3724 (append_glyph, produce_image_glyph, append_composite_glyph)
3725 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3726 left_box_line_p and right_box_line_p flags of the glyph for R2L
3727 glyph rows. (Bug#13011)
3728
3729 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3730
3731 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3732 if changed buffer is not shown in a window.
3733 * insdel.c (prepare_to_modify_buffer): Likewise.
3734 * window.c (replace_buffer_in_windows_safely): Do nothing
3735 if buffer is not shown in a window.
3736 (Fforce_window_update): Likewise if string or buffer argument
3737 is passed.
3738
3739 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3740
3741 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3742 encoded_file_name, which is what it is.
3743
3744 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3745
3746 Consistently use marker_position and marker_byte_position.
3747 * fringe.c (Ffringe_bitmaps_at_pos):
3748 * indent.c (Fvertical_motion):
3749 * insdel.c (prepare_to_modify_buffer):
3750 * keyboard.c (make_lispy_position):
3751 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3752 (window_scroll_pixel_based, displayed_window_lines)
3753 (Fset_window_configuration):
3754 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3755 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3756 Replace direct access to marker fields with calls
3757 to marker_position and/or marker_byte_position.
3758
3759 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3760
3761 * makefile.w32-in (SIG2STR_H): New macro.
3762 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3763 ($(BLD)/w32notify.$(O)): Update dependencies.
3764
3765 2012-12-10 Daniel Colascione <dancol@dancol.org>
3766
3767 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3768 Windows file notification functionality unless WINDOWSNT.
3769
3770 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3771 declarations.
3772
3773 * w32fns.c (cache_system_info): Initialize the global hinst
3774 variable here so various initialization calls DTRT.
3775
3776 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3777 (hinst): Remove unneeded extern declaration.
3778 (_start): Remove initialization of above variables; remove
3779 initialization of hinst, as cache_system_info now does that.
3780
3781 * emacs.c (main): Call cache_system_info early in startup; we
3782 previously weren't calling it in Cygwin builds.
3783
3784 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3785 Teach the autoconf build system how to compile a Windows resource file
3786 and link it to Emacs.
3787
3788 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Per-buffer window counters.
3791 * buffer.h (struct buffer): New member window_count.
3792 (buffer_window_count): New function.
3793 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3794 Initialize window_count.
3795 (Fkill_buffer): Verify window_count for the buffer being killed.
3796 (modify_overlay): Do not force redisplay if buffer is not shown
3797 in any window.
3798 (init_buffer_once): Initialize window_count for buffer_defaults
3799 and buffer_local_symbols.
3800 * window.h (buffer_shared): Remove declaration.
3801 (wset_buffer): Convert from inline ...
3802 * window.c (wset_buffer): ... to an ordinary function.
3803 (adjust_window_count): New function.
3804 (make_parent_window): Use it.
3805 * xdisp.c (buffer_shared): Remove.
3806 (redisplay_internal, redisplay_window): Adjust users.
3807 (buffer_shared_and_changed): Use per-buffer window counter.
3808
3809 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3810
3811 Support for filesystem notifications on MS-Windows.
3812 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3813 and this is a TTY frame, signal the caller that keyboard input is
3814 available.
3815
3816 * w32xfns.c (drain_message_queue): Now returns an int: an
3817 indication whether any WM_EMACS_FILENOTIFY messages were found in
3818 the queue.
3819
3820 * w32inevt.c (handle_file_notifications): New function.
3821 (w32_console_read_socket): Call it to process file notifications.
3822
3823 * w32console.c (initialize_w32_display): Record the main thread ID
3824 in dwMainThreadId.
3825
3826 * deps.mk (inotify.o): New dependency list.
3827
3828 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3829
3830 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3831 (WM_EMACS_END): Bump value by 1.
3832 (notification_buffer_in_use, file_notifications)
3833 (notifications_size, notifications_desc): Declare.
3834 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3835 Add prototypes.
3836
3837 * w32term.c (lispy_file_action, queue_notifications): New functions.
3838 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3839 <Qrenamed_to>: New symbols.
3840 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3841
3842 * w32notify.c: New file, implements file event notifications for
3843 MS-Windows.
3844
3845 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3846 by posting it to the w32_read_socket queue.
3847
3848 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3849
3850 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3851 (GLOBAL_SOURCES): Add w32notify.c
3852 ($(BLD)/w32notify.$(O)): New set of dependencies.
3853
3854 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3855
3856 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3857 Handle FILE_NOTIFY_EVENT.
3858 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3859 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3860 w32notify-handle-event by default.
3861
3862 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3863 syms_of_w32notify.
3864
3865 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3866
3867 Support for filesystem notifications on GNU/Linux via inotify.
3868 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3869
3870 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3871
3872 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3873 (syms_of_keyboard): DEFSYM it.
3874 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3875 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3876 Qfile_inotify events.
3877 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3878 special-event-map to inotify-handle-event.
3879
3880 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3881
3882 * Makefile.in (base_obj): Add inotify.o.
3883
3884 * inotify.c: New file.
3885
3886 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3887
3888 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3889
3890 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3891
3892 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3893 DWORD_PTR, for compatibility with 64-bit builds.
3894
3895 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3896 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3897 (system_process_attributes): Use SIZE_T rather than DWORD, for
3898 compatibility with 64-bit builds.
3899
3900 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3901
3902 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3903
3904 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3905
3906 * indent.c (Fvertical_motion): If a display string will be
3907 displayed on the left or the right margin, don't consider it as a
3908 factor in cursor positioning. (Bug#13108)
3909
3910 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3911
3912 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3913
3914 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3915
3916 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3917 for string length.
3918
3919 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3920
3921 * w32.c (unsetenv): Return 0 if the input string is too long.
3922
3923 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3924
3925 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3926 * alloc.c (xputenv): New function.
3927 * dbusbind.c (Fdbus_init_bus):
3928 * emacs.c (main):
3929 * xterm.c (x_term_init):
3930 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3931 * editfns.c (initial_tz): Move static var decl up.
3932 (tzvalbuf_in_environ): New static var.
3933 (init_editfns): Initialize these two static vars.
3934 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3935 Save old TZ value on stack, if it's small.
3936 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3937 instead, use xputenv+unsetenv to set and restore TZ.
3938 (environbuf): Remove static var. All uses removed.
3939 (Fset_time_zone_rule): Do not save TZ and environ;
3940 no longer needed here.
3941 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3942 Move to inside set_time_zone_rule; they don't need file scope any more.
3943 (set_time_zone_rule): Maintain the TZ=value string separately.
3944 (syms_of_editfns): Don't initialize initial_tz;
3945 init_editfns now does it.
3946 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3947 * lisp.h (xputenv): New decl.
3948
3949 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3950
3951 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3952
3953 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3954
3955 * w32.c (unsetenv, sys_putenv): New functions.
3956
3957 2012-12-08 Chong Yidong <cyd@gnu.org>
3958
3959 * editfns.c (Finsert_char): Make the error message more
3960 informative (Bug#12992).
3961
3962 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3963
3964 Simplify get_lim_data.
3965 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3966 Remove USG and vlimit methods; no longer used these days.
3967 Add #error catchall just in case.
3968
3969 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3970 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3971 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3972 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3973 (deleted_pid_list, Fdelete_process, create_process)
3974 (record_child_status_change, handle_child_signal, deliver_child_signal)
3975 (init_process_emacs, syms_of_process):
3976 Assume SIGCHLD is defined.
3977 (parse_signal): Remove. All uses removed.
3978 (abbr_to_signal): New static function.
3979 (Fsignal_process): Use it to convert signal names to ints.
3980 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3981 kill (getpgrp (), ...).
3982 (emacs_sigaction_init): Assume SIGCHLD is defined.
3983 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3984 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3985 * syssignal.h (EMACS_KILLPG): Remove.
3986 All uses replaced by 'kill' with a negative pid.
3987 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3988 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3989
3990 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3991
3992 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3993 This will cause a production Emacs to dump core instead of
3994 infinite-looping.
3995
3996 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3997
3998 * frame.c (make_frame): Do not set window's buffer to t.
3999 * window.c (Fsplit_window_internal): Likewise. Previously it was
4000 used to indicate that the window is being set up. Now we use
4001 set_window_buffer for all new windows, so the condition in ...
4002 (Fset_window_buffer): ... is always true and can be removed.
4003
4004 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4005
4006 Convenient macro to check whether the buffer is hidden.
4007 * buffer.h (BUFFER_HIDDEN_P): New macro.
4008 * frame.c (make_frame): Use it. Adjust comment.
4009 * buffer.c (candidate_buffer): New function.
4010 (Fother_buffer, other_buffer_safely): Use it.
4011
4012 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4013
4014 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4015 if the child process is still running. Instead, exit the wait
4016 loop and return zero. (Bug#13086)
4017
4018 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4019
4020 * frame.h (x_char_width, x_char_height): Remove prototypes.
4021 * w32term.h (x_char_width, x_char_height): Likewise.
4022 * xfns.c (x_char_width, x_char_height): Remove.
4023 * w32fns.c (x_char_width, x_char_height): Likewise.
4024 * nsfns.c (x_char_width, x_char_height): Likewise.
4025 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4026 all window frames.
4027 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4028 * keyboard.c (command_loop_1): Remove prototype.
4029 (command_loop_2, top_level_1): Add static to match prototype.
4030
4031 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 Fix a recently-introduced delete-process race condition.
4034 * callproc.c, process.h (record_kill_process):
4035 New function, containing part of the old call_process_kill.
4036 (call_process_kill): Use it.
4037 This does not change call_process_kill's behavior.
4038 * process.c (Fdelete_process): Use record_kill_process to fix a
4039 race condition that could cause Emacs to lose track of a child.
4040
4041 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4042
4043 Avoid code duplication between prev_frame and next_frame.
4044 * frame.c (candidate_frame): New function. Add comment.
4045 (prev_frame, next_frame): Use it. Adjust comment.
4046
4047 2012-12-06 Eli Zaretskii <eliz@gnu.org>
4048
4049 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4050 fails, signal an error instead of continuing with an empty
4051 string. (Bug#13079)
4052 Encode expanded temp file pattern before passing it to mkstemp or
4053 mktemp.
4054
4055 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4056 Encode the file name before passing it to dostounix_filename, in
4057 case it will downcase it (under w32-downcase-file-names).
4058 (Bug#12933)
4059
4060 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4061
4062 Minor call-process cleanups.
4063 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4064 at the same time as other platforms, to simplify analysis.
4065 No need for fd0_volatile since we have synch_process_fd.
4066 Avoid needless emacs_close; arg is always negative.
4067
4068 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4069
4070 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4071 processes.
4072
4073 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4074
4075 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4076 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4077 and mouse_face_hidden members to a bitfields.
4078 * frame.h (struct frame): Remove set-but-not-used space_width member.
4079 (FRAME_SPACE_WIDTH): Remove.
4080 * nsterm.m, w32term.c, xterm.c: Adjust users.
4081 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4082 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4083 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4084 members to a bitfields.
4085
4086 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4087
4088 Don't let call-process be a zombie factory (Bug#12980).
4089 Fixing this bug required some cleanup of the signal-handling code.
4090 As a side effect, this change also fixes a longstanding rare race
4091 condition whereby Emacs could mistakenly kill unrelated processes,
4092 and it fixes a bug where a second C-g does not kill a recalcitrant
4093 synchronous process in GNU/Linux and similar platforms.
4094 The patch should also fix the last vestiges of Bug#9488,
4095 a bug which has mostly been fixed on the trunk by other changes.
4096 * callproc.c, process.h (synch_process_alive, synch_process_death)
4097 (synch_process_termsig, sync_process_retcode):
4098 Remove. All uses removed, to simplify analysis and so that
4099 less consing is done inside critical sections.
4100 * callproc.c (call_process_exited): Remove. All uses replaced
4101 with !synch_process_pid.
4102 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4103 These take the role of what used to be in unwind-protect arg.
4104 All uses changed.
4105 (block_child_signal, unblock_child_signal):
4106 New functions, to avoid races that could kill innocent-victim processes.
4107 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4108 (call_process_kill): Record killed processes as deleted, so that
4109 zombies do not clutter up the system. Do this inside a critical
4110 section, to avoid a race that would allow the clutter.
4111 (call_process_cleanup): Fix code so that the second C-g works again
4112 on common platforms such as GNU/Linux.
4113 (Fcall_process): Create the child process in a critical section,
4114 to fix a race condition. If creating an asynchronous process,
4115 record it as deleted so that zombies do not clutter up the system.
4116 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4117 light of these changes. Omit unnecessary call to emacs_close
4118 before failure, as the unwind-protect code does that.
4119 * callproc.c (call_process_cleanup):
4120 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4121 * process.c (record_deleted_pid): New function, containing
4122 code refactored out of Fdelete_process.
4123 (Fdelete_process): Use it.
4124 (process_status_retrieved): Remove. All callers changed to use
4125 child_status_change.
4126 (record_child_status_change): Remove, folding its contents into ...
4127 (handle_child_signal): ... this signal handler. Now, this
4128 function is purely a handler for SIGCHLD, and is not called after
4129 a synchronous waitpid returns; the synchronous code is moved to
4130 wait_for_termination. There is no need to worry about reaping
4131 more than one child now.
4132 * sysdep.c (get_child_status, child_status_changed): New functions.
4133 (wait_for_termination): Now takes int * status and bool
4134 interruptible arguments, too. Do not record child status change;
4135 that's now the caller's responsibility. All callers changed.
4136 Reimplement in terms of get_child_status.
4137 (wait_for_termination_1, interruptible_wait_for_termination):
4138 Remove. All callers changed to use wait_for_termination.
4139 * syswait.h: Include <stdbool.h>, for bool.
4140 (record_child_status_change, interruptible_wait_for_termination):
4141 Remove decls.
4142 (record_deleted_pid, child_status_changed): New decls.
4143 (wait_for_termination): Adjust to API changes noted above.
4144
4145 * bytecode.c, lisp.h (Qbytecode): Remove.
4146 No longer needed after 2012-11-20 interactive-p changes.
4147
4148 2012-12-03 Eli Zaretskii <eliz@gnu.org>
4149
4150 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4151 the scroll margin, move point outside the margin. (Bug#13055)
4152
4153 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4154
4155 * gtkutil.c (my_log_handler): New function.
4156 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4157
4158 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4159
4160 * lisp.h (modify_region): Rename to...
4161 (modify_region_1): ...new prototype.
4162 * textprop.c (modify_region): Now static. Adjust users.
4163 * insdel.c (modify_region): Rename to...
4164 (modify_region_1): ...new function to work with current buffer.
4165 Adjust comment and users. Use true and false for booleans.
4166
4167 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4168
4169 * alloc.c (free_save_value): New function.
4170 (safe_alloca_unwind): Use it.
4171 * lisp.h (free_save_value): New prototype.
4172 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4173 Add comment.
4174 (save_excursion_restore): Adjust to match saved data structure.
4175 Use free_save_value to offload some work from GC. Drop obsolete
4176 #if 0 code.
4177
4178 2012-12-03 Chong Yidong <cyd@gnu.org>
4179
4180 * fileio.c (Vauto_save_list_file_name): Doc fix.
4181
4182 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4183
4184 * w32fns.c: Remove prototype of atof.
4185 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4186 builds.
4187 (file_dialog_callback): Make it UINT_PTR.
4188
4189 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4190 with 64-bit builds.
4191
4192 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4193 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4194 defined.
4195
4196 2012-12-03 Glenn Morris <rgm@gnu.org>
4197
4198 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4199
4200 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4201
4202 Fix xpalloc confusion after memory is exhausted.
4203 * alloc.c (xpalloc): Comment fix.
4204 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4205 and signals an error, do not clear charset_table_size, as
4206 charset_table is still valid.
4207 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4208
4209 Use execve to avoid need to munge environ (Bug#13054).
4210 * callproc.c (Fcall_process):
4211 * process.c (create_process):
4212 Don't save and restore environ; no longer needed.
4213 * callproc.c (child_setup):
4214 Use execve, not execvp, to preserve environ.
4215
4216 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4217
4218 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4219
4220 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4221
4222 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4223 display for sliced images (Bug#10500).
4224
4225 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4226
4227 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4228
4229 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4230 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4231
4232 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4233
4234 * xdisp.c (window_outdated): Remove eassert since it hits
4235 some suspicious corner cases (see Bug#13007 and Bug#13012).
4236 (mode_line_update_needed): New function.
4237 (redisplay_internal, redisplay_window): Use it.
4238 (ensure_selected_frame): New function.
4239 (redisplay_internal, unwind_redisplay): Use it.
4240 (redisplay_internal): Move comment about buffer_shared...
4241 (buffer_shared_and_changed): ...near to its real use.
4242
4243 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 * callproc.c (Fcall_process): Don't misreport vfork failure.
4246
4247 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 * callproc.c (Fcall_process): Fix vfork portability problems.
4250 Do not assume that fd[0], count, filefd, and save_environ survive
4251 vfork. Fix bug whereby wrong errno value could be reported for
4252 pipe failure. Some minor cleanups, too, as follows. Move buf and
4253 bufsize to the context where they're needed. Change new_argv to
4254 be of type char **, as this is more convenient and avoids casts.
4255 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4256 Now local constants, not macros.
4257
4258 2012-11-18 Kenichi Handa <handa@gnu.org>
4259
4260 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4261 for the variable "f".
4262
4263 2012-11-13 Kenichi Handa <handa@gnu.org>
4264
4265 * font.c (font_unparse_xlfd): Exclude special characters from the
4266 generating XLFD name.
4267
4268 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4271 * dired.c (stat_uname, stat_gname):
4272 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4273
4274 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4275 * dired.c (directory_files_internal, file_name_completion):
4276 Assume EAGAIN and EINTR are defined.
4277
4278 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4279 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4280 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4281 * lread.c (readbyte_from_file): Assume EINTR is defined.
4282 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4283 Assume EIO and EAGAIN are defined.
4284 * unexcoff.c (write_segment): Assume EFAULT is defined.
4285
4286 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4287
4288 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4289 (Bug#11964)
4290
4291 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4292 highlighting on the frame was cleared. Prevents assertion
4293 violations when repeatedly clicking on the "Top" link of the
4294 "bread-crumbs" in Info buffers.
4295
4296 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4297
4298 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4299
4300 2012-11-24 Ken Brown <kbrown@cornell.edu>
4301
4302 * keyboard.c (HAVE_MOUSE):
4303 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4304 were always defined.
4305
4306 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4307
4308 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4309 between bpos_covered and bpos_max. This fixes cursor display when
4310 several display strings follow each other.
4311
4312 * .gdbinit (pgx): If the glyph's object is a string, display the
4313 pointer to string data, rather than the value of the string object
4314 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4315
4316 * indent.c (Fvertical_motion): If the starting position is covered
4317 by a display string, return to one position before that, to avoid
4318 overshooting it inside move_it_to. (Bug#12930)
4319
4320 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4321
4322 * frame.h (struct frame): Remove display_preempted member
4323 since all users are dead long ago.
4324 * nsterm.h (struct x_output): Use the only dummy member.
4325 * w32menu.c (pending_menu_activation): Remove since not
4326 really used.
4327 (set_frame_menubar): Adjust user.
4328 * w32term.h (struct x_output): Drop outdated #if 0 code.
4329 (struct w32_output): Use bitfields for explicit_parent,
4330 asked_for_visible and menubar_active members.
4331 Drop unused pending_menu_activation member.
4332 * xterm.h (struct x_output): Drop outdated #if 0 code.
4333 Use bitfields for explicit_parent, asked_for_visible,
4334 has_been_visible and net_wm_state_hidden_seen members.
4335
4336 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4337
4338 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4339 of a literal "/". (Bug#12955)
4340 (gl-stamp): Invoke fc.exe directly, not through cmd.
4341
4342 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4343
4344 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4345 * dired.c: Assume HAVE_DIRENT_H.
4346 (NAMLEN): Remove, replacing with ...
4347 (dirent_namelen): New function. All uses changed. Use the GNU macro
4348 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4349 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4350 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4351 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4352 $(NT_INC)/dirent.h.
4353 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4354 * ndir.h: Rename to ../nt/inc/dirent.h.
4355 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4356 Do not include <dirent.h>; no longer needed.
4357 * w32.c: Include <dirent.h> rather than "ndir.h".
4358
4359 2012-11-23 Chong Yidong <cyd@gnu.org>
4360
4361 * xftfont.c (xftfont_open): Remove duplicate assignment.
4362
4363 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4364
4365 * alloc.c (Fgarbage_collect): Unblock input after clearing
4366 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4367 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4368 * msdos.c (IT_frame_up_to_date): Use it here...
4369 * w32term.c (w32_frame_up_to_date): ...here...
4370 * xterm.c (XTframe_up_to_date): ...and here...
4371 * nsterm.m (ns_frame_up_to_date): ...but not here.
4372 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4373 Adjust users.
4374 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4375 Do not check whether GC is in progress.
4376
4377 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 * xdisp.c (window_buffer_changed): New function.
4380 (update_menu_bar, update_tool_bar): Use it to
4381 simplify large 'if' statements.
4382 (redisplay_internal): Generalize commonly used
4383 'tail' and 'frame' local variables.
4384
4385 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4386
4387 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4388 with Windows system header.
4389
4390 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4391
4392 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4393 * alloc.c: Assume unistd.h exists.
4394 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4395 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4396 (getwd) [USG]: Remove; no longer needed.
4397 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4398 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4399 * w32.h (getcwd): Remove decl.
4400
4401 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4402
4403 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4404 Make it set selected_window as well.
4405 (update_tool_bar): Use it.
4406
4407 2012-11-21 Ken Brown <kbrown@cornell.edu>
4408
4409 * emacs.c (main): Set the G_SLICE environment variable for all
4410 Cygwin builds, not just GTK builds. See
4411 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4412
4413 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4414
4415 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4416 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4417 Define for the MSVC compiler.
4418
4419 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4420
4421 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4422 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4423 dostounix_filename. Prevents crashes down the road, because
4424 dostounix_filename assumes it gets a unibyte string.
4425 Reported by Michel de Ruiter <michel@sentient.nl>, see
4426 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4427
4428 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4429
4430 Conflate Qnil and Qunbound for `symbol-function'.
4431 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4432 * lread.c (init_obarray): Set `function' fields to Qnil.
4433 * eval.c (Fcommandp): Ignore Qunbound.
4434 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4435 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4436 Test NILP rather than Qunbound.
4437 (Ffmakunbound): Set to Qnil.
4438 (Fsymbol_function): Never signal an error.
4439 (Finteractive_form): Ignore Qunbound.
4440
4441 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4442
4443 * eval.c (interactive_p): Remove no-longer-used decl.
4444
4445 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4446
4447 * xdisp.c (buffer_shared): Adjust comment.
4448 (buffer_shared_and_changed): New function.
4449 (prepare_menu_bars, redisplay_internal): Use it to
4450 decide whether all windows or frames should be updated.
4451 (window_outdated): New function.
4452 (text_outside_line_unchanged_p, redisplay_window): Use it.
4453 (redisplay_internal): Likewise. Fix indentation.
4454
4455 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4456
4457 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4458 (syms_of_eval): Remove corresponding defsubr.
4459 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4460
4461 2012-11-19 Daniel Colascione <dancol@dancol.org>
4462
4463 * w32fns.c (Fx_file_dialog):
4464 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4465 cygwin_convert_file_name*.
4466
4467 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4468 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4469
4470 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4471
4472 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4473
4474 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4475
4476 * w32select.c: Include w32common.h before w32term.h, so that
4477 windows.h gets included before w32term.h uses some of its
4478 features, see below.
4479
4480 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4481 New typedefs.
4482 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4483 New prototypes.
4484 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4485
4486 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4487
4488 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4489 (ns_select): Return at once if events are held (Bug#12834).
4490
4491 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4492
4493 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4494 Needed following 2012-10-20 change. (Bug#12902)
4495
4496 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4497
4498 * w32proc.c (waitpid): Remove unused label get_result.
4499
4500 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4501
4502 * makefile.w32-in (SYSWAIT_H): New macro.
4503 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4504 ($(BLD)/sysdep.$(O)): Update dependencies.
4505
4506 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4509 * callproc.c (relocate_fd): Assume F_DUPFD.
4510 * emacs.c, term.c (O_RDWR): Remove.
4511 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4512 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4513 * nsterm.m: Assume <fcntl.h> exists.
4514 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4515 (create_pty, Fmake_network_process, server_accept_connection)
4516 (wait_reading_process_output, init_process_emacs):
4517 Assume O_NONBLOCK.
4518 (wait_reading_process_output): Put in a special case for WINDOWSNT
4519 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4520 It's not clear this is needed, but it's a more-conservative change.
4521 (create_process): Assume FD_CLOEXEC.
4522 (create_process, create_pty): Assume O_NOCTTY.
4523 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4524 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4525 Omit if not DOS_NT, since F_GETFL is not defined there.
4526 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4527 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4528 (O_NOCTTY): Remove.
4529 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4530 lack it, since gnulib guarantees this.
4531 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4532
4533 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4534
4535 * w32.c (faccessat): Pretend that directories have the execute bit
4536 set. Emacs expects that, e.g., in files.el:cd-absolute.
4537
4538 * w32proc.c (create_child): Don't clip the PID of the child
4539 process to fit into an Emacs integer, as this is no longer a
4540 restriction.
4541 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4542 reaping only the process specified by PID argument, if that is
4543 positive. Use PID instead of dead_child to know which process to
4544 reap. Wait for the child to die only if WNOHANG is not in
4545 OPTIONS.
4546 (sys_select): Don't set dead_child.
4547
4548 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4549 as it is no longer needed.
4550
4551 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4552 no longer needed.
4553 (record_child_status_change): Remove the setting of
4554 record_at_most_one_child for the !WNOHANG case.
4555
4556 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4557
4558 Fix problems in ns port found by static checking.
4559 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4560 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4561 not to process group.
4562 (ns_select): Use emacs_write, not write, as that's more robust
4563 in the presence of signals.
4564 (fd_handler:): Check for read errors.
4565
4566 2012-11-16 Glenn Morris <rgm@gnu.org>
4567
4568 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4569
4570 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4571
4572 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4573
4574 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4575
4576 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4577 use the same value of thread handle.
4578 (start_timer_thread): If the timer thread exited (due to error),
4579 clean up by closing the two handles it used. Duplicate the caller
4580 thread's handle here, so it gets duplicated only once, when
4581 launching the timer thread. Set priority of the timer thread, not
4582 the caller thread.
4583 (getitimer): Don't duplicate the caller thread's handle here.
4584 (Bug#12832)
4585
4586 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4587
4588 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4589 called (Bug#12834).
4590
4591 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4592
4593 Remove no-longer-used pty_max_bytes variable.
4594 * process.c (pty_max_bytes): Remove; unused.
4595 (send_process): Do not set it.
4596
4597 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4598
4599 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4600 Update dependencies.
4601
4602 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4603
4604 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4605 This follows up on the 2012-09-29 patch that removed indirection
4606 for the 'function' field. Reported by Sergey Vinokurov in
4607 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4608
4609 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4610
4611 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4612 different name, as the MS runtime does not have such a function,
4613 and probably never will.) All callers changed. Ignore DIRFD
4614 value if PATH is an absolute file name, to match Posix spec
4615 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4616 symlinks.
4617
4618 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4619
4620 * xdisp.c (echo_area_display, redisplay_internal):
4621 Omit redundant check whether frame_garbaged is set.
4622
4623 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 Use faccessat, not access, when checking file permissions (Bug#12632).
4626 This fixes a bug that has been present in Emacs since its creation.
4627 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4628 which must set some sort of record. (Torek's bug report was against
4629 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4630 same common flaw.) See Torek's Usenet posting
4631 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4632 Posted: Fri Apr 8 14:18:56 1983.
4633 * Makefile.in (LIB_EACCESS): New macro.
4634 (LIBES): Use it.
4635 * callproc.c (init_callproc):
4636 * charset.c (init_charset):
4637 * fileio.c (check_existing, check_executable, check_writable)
4638 (Ffile_readable_p):
4639 * lread.c (openp, load_path_check):
4640 * process.c (allocate_pty):
4641 * xrdb.c (file_p):
4642 Use effective UID when checking permissions, not real UID.
4643 * callproc.c (init_callproc):
4644 * charset.c (init_charset):
4645 * lread.c (load_path_check, init_lread):
4646 Test whether directories are accessible, not merely whether they exist.
4647 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4648 * fileio.c (check_existing, check_executable, check_writable)
4649 (Ffile_readable_p):
4650 Use symbolic names instead of integers for the flags, as they're
4651 portable now.
4652 (check_writable): New arg AMODE. All uses changed.
4653 Set errno on failure.
4654 (Ffile_readable_p): Use faccessat, not stat + open + close.
4655 (Ffile_writable_p): No need to call check_existing + check_writable.
4656 Just call check_writable and then look at errno. This saves a syscall.
4657 dir should never be nil; replace an unnecessary runtime check
4658 with an eassert. When checking the parent directory of a nonexistent
4659 file, check that the directory is searchable as well as writable, as
4660 we can't create files in unsearchable directories.
4661 (file_directory_p): New function, which uses 'stat' on most platforms
4662 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4663 (Ffile_directory_p, Fset_file_times): Use it.
4664 (file_accessible_directory_p): New function, which uses a single
4665 syscall for efficiency.
4666 (Ffile_accessible_directory_p): Use it.
4667 * xrdb.c (file_p): Use file_directory_p.
4668 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4669 * lread.c (openp): When opening a file, use fstat rather than
4670 stat, as that avoids a permissions race. When not opening a file,
4671 use file_directory_p rather than stat.
4672 (dir_warning): First arg is now a usage string, not a format.
4673 Use errno. All uses changed.
4674 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4675 that merely introduced a race.
4676 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4677 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4678 and similarly for the other O_* flags.
4679 * w32.c (sys_faccessat): Rename from sys_access and switch to
4680 faccessat's API. All uses changed.
4681 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4682 (magic_db): Rename from magic_file_p.
4683 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4684 char *, so that we don't have to test for file existence
4685 separately from opening the file for reading. This removes a race
4686 fixes a permission-checking problem, and simplifies the code.
4687 All uses changed.
4688 (file_p): Remove; no longer needed.
4689
4690 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4691
4692 Omit glyphs initialization at startup.
4693 * dispnew.c (glyphs_initialized_initially_p): Remove.
4694 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4695 (Fredraw_frame): Move actual code from here...
4696 (redraw_frame): ...to here. Add eassert. Adjust comment.
4697 (Fredraw_display): Use redraw_frame.
4698 * xdisp.c (clear_garbaged_frames): Likewise.
4699
4700 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4701
4702 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4703 passed to pint2str and pint2hrstr to be at most the size of the
4704 frame's decode_mode_spec_buffer. This avoids crashes with very
4705 large values of FIELD_WIDTH argument to decode_mode_spec.
4706 (Bug#12867)
4707
4708 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4709
4710 Fix a race with verify-visited-file-modtime (Bug#12863).
4711 Since at least 1991 Emacs has ignored an mtime difference of no
4712 more than one second, but my guess is that this was to work around
4713 file system bugs that were fixed long ago. Since the race is
4714 causing problems now, let's remove that code.
4715 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4716 whose time stamp is off by no more than a second. Insist that the
4717 file time stamps match exactly.
4718
4719 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4720
4721 * frame.h (struct frame): Convert external_tool_bar member to
4722 1-bit unsigned bitfield.
4723 * termhooks.h (struct terminal): Remove mouse_moved member since
4724 all users are long dead. Adjust comment on mouse_position_hook.
4725
4726 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4727
4728 Simplify by using FOR_EACH_FRAME here and there.
4729 * frame.c (next_frame, prev_frame, other_visible_frames)
4730 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4731 * w32term.c (x_window_to_scroll_bar): Likewise.
4732 * window.c (window_list): Likewise.
4733 * xdisp.c (x_consider_frame_title): Likewise.
4734 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4735 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4736 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4737 * xmenu.c (menubar_id_to_frame): Likewise.
4738 * xselect.c (frame_for_x_selection): Likewise.
4739 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4740 (x_window_to_menu_bar): Likewise.
4741 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4742
4743 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4744
4745 * data.c (Qdefalias_fset_function): Now static.
4746
4747 Another tweak to vectorlike_header change.
4748 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4749 Remove, and replace all uses with ...
4750 (next_in_free_list, set_next_in_free_list):
4751 New functions, which respect C's aliasing rules better.
4752
4753 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 * window.c (list4i): Rename from 'quad'. All uses changed.
4756 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4757
4758 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4759
4760 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4761 warning about mixing declarations and code in ISO C90.
4762
4763 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4764
4765 * window.c (Fsplit_window_internal): Set combination limit of
4766 new parent window to t iff Vwindow_combination_limit is t;
4767 fixing a regression introduced with the change from 2012-09-22.
4768 (Fset_window_combination_limit): Fix doc-string.
4769
4770 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4771
4772 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4773 amount when the scroll margins are too large. When scrolling
4774 backwards in the buffer, give up if cannot reach point or the
4775 scroll margin within a reasonable number of screen lines.
4776 Fixes point position in window under scroll-up/down-aggressively when
4777 point is positioned many lines beyond the window top/bottom.
4778 (Bug#12811)
4779
4780 * ralloc.c (relinquish): If real_morecore fails to return memory
4781 to the system, don't crash; instead, leave the last heap
4782 unchanged and return. (Bug#12774)
4783
4784 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4785
4786 * lisp.h (AUTOLOADP): New macro.
4787 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4788 * data.c (Ffset): Remove special ad-advice-info handling.
4789 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4790 (Fsubr_arity): CSE.
4791 (Finteractive_form): Simplify.
4792 (Fquo): Don't insist on having at least 2 arguments.
4793 (Qdefalias_fset_function): New var.
4794
4795 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4796
4797 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4798
4799 * nsfont.m (Qcondensed, Qexpanded): New variables.
4800 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4801 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4802
4803 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Fix recently introduced crash on MS-Windows (Bug#12839).
4806 * w32term.h (struct scroll_bar): Use convenient header.
4807 (SCROLL_BAR_VEC_SIZE): Remove.
4808 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4809
4810 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4811
4812 Tweak last vectorlike_header change.
4813 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4814 vectorlike object on the free list. This is introduced to avoid
4815 some (but not all) pointer casting and aliasing problems, see
4816 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4817 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4818 objects.
4819 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4820
4821 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4822
4823 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4824 been removed, so remove them here also.
4825
4826 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4827
4828 * doc.c (Fdocumentation): Handle new property
4829 dynamic-docstring-function to replace the old ad-advice-info.
4830
4831 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * fns.c (Qeql, hashtest_eq): Now static.
4834
4835 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4836
4837 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4838 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4839 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4840 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4841
4842 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4843
4844 Use same hash function for hashfn_profiler as for hash_string etc.
4845 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4846 * lisp.h (sxhash_combine): New inline function, with the contents
4847 of the old SXHASH_COMBINE.
4848 * profiler.c (hashfn_profiler): Use it, instead of having a
4849 special hash function containing a comparison that always yields 1.
4850
4851 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4852
4853 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4854 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4855 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4856 Remove unused vars.
4857
4858 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4859
4860 * image.c (xpm_make_color_table_h): Fix compiler error because
4861 make_hash_table changed.
4862
4863 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4864
4865 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4866
4867 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4868
4869 Use ad-hoc comparison function for the profiler's hash-tables.
4870 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4871 (make_log): Use them.
4872 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4873 call Fequal any more.
4874 (Ffunction_equal): New function.
4875 (cmpfn_profiler, hashfn_profiler): New functions.
4876 (syms_of_profiler): Initialize them.
4877 * lisp.h (struct hash_table_test): New struct.
4878 (struct Lisp_Hash_Table): Use it.
4879 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4880 * fns.c (make_hash_table): Take a struct to describe the test.
4881 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4882 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4883 (hash_lookup, hash_remove_from_table): Move assertion checking of
4884 hashfn result here. Check hash-equality before calling cmpfn.
4885 (Fmake_hash_table): Adjust call to make_hash_table.
4886 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4887 (syms_of_fns): Initialize them.
4888 * emacs.c (main): Move syms_of_fns earlier.
4889 * xterm.c (syms_of_xterm):
4890 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4891 * print.c (print_object): Adjust to new hash-table struct.
4892 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4893
4894 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4895
4896 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4897 value of w32-scroll-lock-modifier is neither nil nor one of the
4898 known key modifiers. (Bug#12806)
4899
4900 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4901
4902 Shrink struct vectorlike_header to the only size field.
4903 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4904 Adjust comment.
4905 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4906 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4907 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4908 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4909 information from the vector header. Adjust comment.
4910 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4911 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4912 layout.
4913 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4914 (struct vectorlike_header): Remove next member. Adjust comment.
4915 (struct Lisp_Subr): Add convenient header. Adjust comment.
4916 (allocate_pseudovector): Adjust prototype.
4917 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4918 (sweep_string, lisp_malloc): Remove useless prototypes.
4919 (enum mem_type): Adjust comment.
4920 (NEXT_IN_FREE_LIST): New macro.
4921 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4922 (Fmake_bool_vector): Likewise.
4923 (struct large_vector): New type to represent allocation unit for
4924 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4925 (large_vectors): Change type to struct large_vector.
4926 (allocate_vector_from_block): Simplify.
4927 (PSEUDOVECTOR_NBYTES): Replace with...
4928 (vector_nbytes): ...new function. Adjust users.
4929 (sweep_vectors): Adjust processing of large vectors.
4930 (allocate_vectorlike): Likewise.
4931 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4932 Add easserts. Adjust XSETPVECTYPESIZE usage.
4933 (allocate_buffer): Use BUFFER_PVEC_INIT.
4934 (live_vector_p): Adjust to match large vector.
4935 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4936 * buffer.h (struct buffer): Add next member.
4937 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4938 New macros.
4939 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4940 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4941 (copy_hash_table): Adjust to match vector header change.
4942 * lread.c (defsubr): Use XSETPVECTYPE.
4943 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4944 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4945 (xvecsize): New command.
4946
4947 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4948
4949 * keyboard.c (event_to_kboard): Do not dereference
4950 frame_or_window field of SELECTION_REQUEST_EVENT
4951 and SELECTION_CLEAR_EVENT events (Bug#12814).
4952 * xterm.h (struct selection_input_event): Adjust comment.
4953
4954 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4955
4956 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4957 such as Scroll Lock, if the respective keys are treated as
4958 function keys, not as modifiers. This avoids destroying non-ASCII
4959 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4960
4961 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4962
4963 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4964
4965 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4966
4967 Restore some duplicate definitions (Bug#12814).
4968 This undoes part of the 2012-11-03 changes. Some people build
4969 with plain -g rather than with -g3, and they need the duplicate
4970 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4971 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4972 Define as macros, as well as as enums or as constants.
4973
4974 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4975
4976 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4977 to keypad keys (Bug#12816).
4978
4979 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 Minor adjustments of recently-changed frame functions.
4982 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4983 known to be a frame (we're in the FRAMEP branch).
4984 * lisp.h (Qframep): Remove decl. frame.h declares this.
4985 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4986 since they're meant for Lisp fixnum values.
4987
4988 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4989
4990 * window.c (Fwindow_combination_limit): Revert to the only
4991 required argument and adjust docstring as suggested in
4992 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4993 by Martin Rudalics <rudalics@gmx.at>.
4994
4995 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4996
4997 Widely used frame validity and checking functions.
4998 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4999 * frame.c (decode_live_frame, decode_any_frame): New functions.
5000 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
5001 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
5002 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
5003 (Fframe_pointer_visible_p): Use decode_any_frame.
5004 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
5005 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
5006 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
5007 (Fframe_focus): Likewise. Allow zero number of arguments.
5008 Adjust docstring.
5009 (frame_buffer_list, frame_buffer_predicate): Remove.
5010 * lisp.h (frame_buffer_predicate): Remove prototype.
5011 * buffer.c (Fother_buffer): Use decode_any_frame.
5012 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5013 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5014 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5015 (Fclose_font, Ffont_info): Use decode_live_frame.
5016 * fontset.c (check_fontset_name): Likewise.
5017 * terminal.c (Fframe_terminal): Likewise.
5018 * w32fns.c (check_x_frame): Likewise.
5019 * window.c (Fminibuffer_window, Fwindow_at)
5020 (Fcurrent_window_configuration): Likewise.
5021 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5022 Likewise. Allow zero number of arguments. Adjust docstring.
5023 * dispnew.c (Fredraw_frame): Likewise.
5024 * xfaces.c (frame_or_selected_frame): Remove.
5025 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5026 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5027 (Fframe_face_alist): Use decode_live_frame.
5028 * xfns.c (check_x_frame): Likewise.
5029
5030 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5031
5032 * window.c (quad): New function.
5033 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5034 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5035 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5036 (Fwindow_line_height): Use it.
5037 (Fwindow_fringes): Use list3.
5038 (Fwindow_scroll_bars): Use list4.
5039 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5040 (Fwindow_combination_limit): Allow zero number of arguments.
5041
5042 2012-11-05 Eli Zaretskii <eliz@gnu.org>
5043
5044 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5045
5046 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5047 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5048 file descriptor 2 for standard error. (Bug#12805)
5049
5050 2012-11-05 Chong Yidong <cyd@gnu.org>
5051
5052 * process.c (wait_reading_process_output): Revert previous change.
5053
5054 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5055
5056 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5057 This removes code that has been obsolete since around 1990.
5058 * callproc.c (Fcall_process):
5059 * emacs.c (main):
5060 * process.c (create_process):
5061 * term.c (dissociate_if_controlling_tty):
5062 Assume setsid exists.
5063 * callproc.c (child_setup): Assume setpgid exists and behaves as
5064 per POSIX.1-1988 or later.
5065 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5066 * emacs.c (shut_down_emacs):
5067 * sysdep.c (sys_suspend, init_foreground_group):
5068 Assume getpgrp behaves as per POSIX.1-1998 or later.
5069 * msdos.c (setpgrp): Remove.
5070 (tcgetpgrp, setpgid, setsid): New functions.
5071 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5072 * term.c (no_controlling_tty): Remove; unused.
5073 * w32proc.c (setpgrp): Remove.
5074 (setsid, tcgetpgrp): New functions.
5075
5076 Simplify by assuming __fpending.
5077 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5078 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5079 Do not assume that __fpending's result fits in int.
5080
5081 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5082
5083 Remove EMACS_OUTQSIZE+sleep hack.
5084 * dispnew.c (update_frame_1): Remove hack for terminals slower
5085 than 2400 bps, which throttled Emacs by having it sleep.
5086 This code hasn't worked since at least 2007, when the multi-tty stuff
5087 was added, and anyway those old terminals are long dead.
5088 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5089 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5090
5091 Fix data-loss with --version (Bug#9574).
5092 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5093 as we can't assume that emacs_strerror is initialized, and strerror
5094 is good enough here.
5095 (main): Invoke atexit earlier, to catch earlier instances of
5096 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5097
5098 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5099
5100 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5101 (keyDown): Remap keypad keys to X11 virtual key codes.
5102
5103 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5104
5105 Fix data-loss with --batch (Bug#9574).
5106 * emacs.c: Include <close-stream.h>.
5107 (close_output_streams): New function.
5108 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5109 and handles errors appropriately.
5110 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5111 does that now.
5112
5113 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5114 The symptom is a diagnostic "GLib-WARNING **: In call to
5115 g_spawn_sync(), exit status of a child process was requested but
5116 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5117 waitpid(), so exit status can't be returned." The diagnostic
5118 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5119 The real bug is a race condition between Emacs and glib: Emacs
5120 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5121 so that glib can't find it. Work around the bug by invoking
5122 waitpid only on subprocesses that Emacs itself creates.
5123 * process.c (create_process, record_child_status_change):
5124 Don't use special value -1 in pid field, as the caller now must
5125 know the pid rather than having the callee infer it.
5126 The inference was sometimes incorrect anyway, due to another race.
5127 (create_process): Set new 'alive' member if child is created.
5128 (process_status_retrieved): New function.
5129 (record_child_status_change): Use it.
5130 Accept negative 1st argument, which means to wait for the
5131 processes that Emacs already knows about. Move special-case code
5132 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5133 processes that have already been waited for, by testing and
5134 clearing new 'alive' member.
5135 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5136 now does this internally.
5137 (handle_child_signal): Let record_child_status_change do all
5138 the work, since we do not want to reap all exited child processes,
5139 only the child processes that Emacs itself created.
5140 * process.h (Lisp_Process): New boolean member 'alive'.
5141
5142 Omit duplicate definitions no longer needed with gcc -g3.
5143 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5144 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5145 Define only as macros. There's no longer any need to also define
5146 these symbols as enums or as constants, since we now assume
5147 gcc -g3 when debugging.
5148
5149 2012-11-03 Eli Zaretskii <eliz@gnu.org>
5150
5151 * lisp.mk: Adjust comments to the fact that term/internal is now
5152 loaded from loadup.el.
5153
5154 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5155 (msdos_fatal_signal): New function.
5156 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5157 its argument list.
5158
5159 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5160 for GCC versions before 4.
5161 (emacs_raise): Define to call msdos_fatal_signal.
5162
5163 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5164 iterator when starting in the middle of a display or overlay
5165 string. (Bug#12745)
5166
5167 2012-11-03 Chong Yidong <cyd@gnu.org>
5168
5169 * process.c (wait_reading_process_output): Clean up the last
5170 change.
5171
5172 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5173
5174 * process.c (wait_reading_process_output): Avoid a race condition
5175 with SIGIO delivery (Bug#11536).
5176
5177 2012-11-03 Chong Yidong <cyd@gnu.org>
5178
5179 * buffer.c (cursor_type): Untabify docstring.
5180
5181 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 * frame.h (struct frame): Drop can_have_scroll_bars member
5184 which is meaningless for a long time. Adjust comments.
5185 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5186 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5187
5188 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5189
5190 * window.c (decode_next_window_args): Update window arg after
5191 calling decode_live_window and so fix crash reported at
5192 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5193 by Juanma Barranquero <lekktu@gmail.com>.
5194 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5195 * font.c (Ffont_at): Likewise.
5196
5197 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5198
5199 * widget.c (resize_cb): New function.
5200 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5201 (EmacsFrameResize): Check if all is up to date before changing frame
5202 size.
5203
5204 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5205
5206 Implement backtrace output for fatal errors on MS-Windows.
5207 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5208 (BACKTRACE_LIMIT_MAX): New macro.
5209 (w32_backtrace): New function.
5210 (emacs_abort): Use w32_backtrace when the user chooses not to
5211 attach a debugger. Update the text of the abort dialog.
5212
5213 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Window-related stuff cleanup here and there.
5216 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5217 Use decode_any_window.
5218 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5219 * xdisp.c (Fformat_mode_line): Likewise.
5220 * font.c (Ffont_at): Use decode_live_window.
5221 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5222 * window.c (decode_next_window_args): Likewise.
5223 (decode_any_window): Remove static.
5224 * window.h (decode_any_window): Add prototype.
5225 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5226 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5227 respectively.
5228
5229 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5230
5231 Remove pad from struct input_event.
5232 * termhooks.h (struct input_event): Remove padding field.
5233 Adjust comment.
5234 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5235 member is never cons for a long time. Adjust comment.
5236 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5237 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5238 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5239 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5240
5241 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5242
5243 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5244
5245 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5246
5247 Fix crash when using Emacs as commit editor for git (Bug#12697).
5248 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5249 and it is configured in conf_post.h.
5250 (Fcall_process): Don't invoke both setsid and setpgid; the former
5251 is enough, if it exists.
5252 * callproc.c (Fcall_process, child_setup):
5253 * process.c (create_process): Use setpgid.
5254 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5255 for the real thing.
5256 * dispnew.c (init_display): Initialize the foreground group
5257 if we are running a tty display.
5258 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5259 * lisp.h (init_foreground_group): New decl.
5260 * sysdep.c (inherited_pgroup): New static var.
5261 (init_foreground_group, tcsetpgrp_without_stopping)
5262 (narrow_foreground_group, widen_foreground_group): New functions.
5263 (init_sys_modes): Narrow foreground group.
5264 (reset_sys_modes): Widen foreground group.
5265
5266 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5267
5268 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5269
5270 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5271
5272 * minibuf.c (read_minibuf): Restore current buffer since
5273 choose_minibuf_frame calling Fset_frame_selected_window may
5274 change it (Bug#12766).
5275
5276 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5277
5278 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5279
5280 2012-10-30 Kenichi Handa <handa@gnu.org>
5281
5282 * font.c (Ffont_at): If WINDOW is specified and it is not
5283 displaying the current buffer, signal an error.
5284
5285 2012-10-29 Daniel Colascione <dancol@dancol.org>
5286
5287 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5288 In preparation for fixing bug#12739, move these functions from
5289 here...
5290
5291 * coding.h, coding.c: ... to here, and compile them only when
5292 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5293 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5294
5295 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5296
5297 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5298 (timer_loop, getitimer, setitimer): Use it instead of
5299 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5300 'clock'.
5301 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5302 literal 10000.
5303
5304 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5305
5306 * nsterm.m (NO_APPDEFINED_DATA): New define.
5307 (last_appdefined_event_data): New variable
5308 (last_appdefined_event): Remove.
5309 (ns_select): Initialize t from last_appdefined_event_data instead
5310 of [last_appdefined_event data1].
5311 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5312 remove last_appdefined_event (Bug#12698).
5313
5314 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5315
5316 * frame.c (x_set_font): Catch internal error.
5317
5318 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5319
5320 Avoid overflow in w32 implementation of interval timers.
5321 When possible, for ITIMER_PROF count only times the main thread
5322 actually executes.
5323 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5324 'volatile ULONGLONG' types. All the other data which was
5325 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5326 (GetThreadTimes_Proc): New typedef.
5327 (w32_get_timer_time): New function, returns a suitable time value
5328 for the timer.
5329 (timer_loop): Enter critical section when accessing ULONGLONG
5330 values of the itimer_data struct, as these accesses are no longer
5331 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5332 Remove unused variable.
5333 (init_timers): Initialize s_pfn_Get_Thread_Times.
5334 (start_timer_thread): Don't assign itimer->caller_thread here.
5335 (getitimer): Assign itimer->caller_thread here.
5336 (setitimer): Always call getitimer to get the value of ticks_now.
5337 (sys_spawnve): Avoid compiler warning about format mismatch.
5338
5339 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5340
5341 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5342 mouse movement events if the menu bar is active. This avoids
5343 producing a busy "hour-glass" cursor by Windows if the mouse
5344 pointer is positioned over a tooltip shown for some menu item.
5345
5346 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5347
5348 Don't assume process IDs fit in int.
5349 * emacs.c (shut_down_emacs) [!DOS_NT]:
5350 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5351 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5352 Use pid_t, not int, to store process IDs, as 'int'
5353 is not wide enough on a few platforms (e.g., AIX and IRIX).
5354
5355 2012-10-23 Kenichi Handa <handa@gnu.org>
5356
5357 The following change is to make face-font-rescale-alist work
5358 correctly for non-ASCII fonts.
5359
5360 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5361 (font_open_for_lface): Handle Vface_font_rescale_alist.
5362
5363 2012-10-23 Chong Yidong <cyd@gnu.org>
5364
5365 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5366
5367 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5368
5369 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5370 for screen font.
5371 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5372
5373 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5374 event (Bug#12681).
5375
5376 2012-10-21 Glenn Morris <rgm@gnu.org>
5377
5378 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5379
5380 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5381
5382 Port to OpenBSD 5.1.
5383 * frame.c (Fmouse_position, Fmouse_pixel_position):
5384 * xdisp.c (produce_stretch_glyph):
5385 Declare local vars only when they're needed.
5386 This is clearer and avoids a warning on OpenBSD about unused vars.
5387 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5388 This is safer, and avoids OpenBSD warnings about unused vars.
5389 * keyboard.c (record_menu_key): Remove unnecessary decl.
5390 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5391 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5392 as our definition clashes with OpenBSD's.
5393 * xfaces.c (load_face_colors, check_lface_attrs)
5394 (get_lface_attributes_no_remap, get_lface_attributes)
5395 (lface_fully_specified_p, x_supports_face_attributes_p)
5396 (tty_supports_face_attributes_p, face_fontset, realize_face)
5397 (realize_x_face, realize_tty_face):
5398 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5399 merely Lisp_Object *. This is more informative and avoids
5400 a warning on OpenBSD about accessing beyond an object's size.
5401
5402 2012-10-20 Chong Yidong <cyd@gnu.org>
5403
5404 * lread.c (Fload): Doc fix (Bug#12592).
5405
5406 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5407
5408 * font.c (Ffont_at): Fix previous change.
5409
5410 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5411
5412 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5413 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5414 for the reasons.
5415
5416 * alloc.c (NSTATICS): Decrease to 0x800.
5417
5418 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5419
5420 * fns.c (Fnreverse): Include the problem element when signaling an
5421 error (bug#12677).
5422
5423 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5424
5425 * nsterm.m (ns_select): Check writefds before call to
5426 FD_ISSET (Bug#12668).
5427
5428 2012-10-18 Daniel Colascione <dancol@dancol.org>
5429
5430 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5431 (staticpro): If we run out of staticpro slots, die with an
5432 informative error instead of just calling emacs_abort.
5433
5434 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5435
5436 Fix two flaws reported by Dmitry Antipov.
5437 * window.c (Ftemp_output_buffer_show): Remove.
5438 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5439 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5440
5441 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5442
5443 * makefile.w32-in ($(BLD)/w32.$(O)):
5444 ($(BLD)/vm-limit.$(O)):
5445 ($(BLD)/term.$(O)):
5446 ($(BLD)/unexw32.$(O)):
5447 ($(BLD)/fileio.$(O)):
5448 ($(BLD)/dispnew.$(O)): Update dependencies.
5449
5450 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5451 Add prototypes.
5452
5453 * w32proc.c: Include ctype.h.
5454
5455 * w32.h (init_environment, check_windows_init_file)
5456 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5457 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5458 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5459 (sys_link): Add prototypes.
5460
5461 * w32.c: Include w32select.h.
5462 (sys_access, e_malloc, sys_select): Add prototypes.
5463 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5464
5465 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5466
5467 * unexw32.c: Include lisp.h and w32.h.
5468
5469 * term.c [WINDOWSNT]: Include w32term.h.
5470
5471 * process.c [WINDOWSNT]: Add prototype of sys_select.
5472
5473 * fileio.c [WINDOWSNT]: Include w32.h.
5474
5475 * dispnew.c [WINDOWSNT]: Include w32.h.
5476
5477 * cygw32.c (Fcygwin_convert_path_to_windows)
5478 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5479 Lisp_Object values. (Bug#12661)
5480
5481 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5482 to Lisp_Object. (Bug#12661)
5483
5484 2012-10-17 Kenichi Handa <handa@gnu.org>
5485
5486 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5487 invalidate.
5488
5489 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5490
5491 * buffer.c (Fkill_buffer): When unchaining the marker,
5492 reset its buffer pointer to NULL (Bug#12652).
5493
5494 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5495
5496 Do not verify indirection counters of killed buffers (Bug#12579).
5497 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5498 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5499
5500 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5501
5502 * alloc.c (Fmake_byte_code): Fix typo in comment.
5503 * print.c (print_interval): Define as static to match prototype.
5504 * indent.c (disptab_matches_widthtab, recompute_width_table):
5505 Convert to eassert.
5506
5507 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5508
5509 * editfns.c (get_system_name): Remove.
5510 * lisp.h (get_system_name): Remove prototype.
5511 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5512 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5513
5514 2012-10-15 Daniel Colascione <dancol@dancol.org>
5515
5516 * dbusbind.c: Add comment explaining reason for previous change.
5517
5518 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5519
5520 * window.c (Fwindow_end): Rewrite check whether cached position
5521 can be used (Bug#12600).
5522 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5523 Set windows_or_buffers_changed.
5524
5525 2012-10-15 Daniel Colascione <dancol@dancol.org>
5526
5527 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5528 enabled by undefining the symbol "interface", which the platform
5529 headers define to something incompatible.
5530
5531 2012-10-14 Daniel Colascione <dancol@dancol.org>
5532
5533 * image.c (init_tiff_functions, init_imagemagick_functions)
5534 (init_svg_functions): Fix cygw32 build break by using these
5535 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5536
5537 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5538
5539 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5540
5541 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5542
5543 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5544
5545 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5546
5547 * coding.c (detect_coding): Set coding->id before calling
5548 this->detector.
5549
5550 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5551
5552 * fileio.c: Formatting fixes.
5553
5554 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5555
5556 Fix some stat-related races.
5557 * fileio.c (Fwrite_region): Avoid race condition if a file is
5558 removed or renamed by some other process immediately after Emacs
5559 writes it but before Emacs stats it. Do not assume that stat (or
5560 fstat) succeeds.
5561 * image.c (slurp_file): Resolve the file name with fopen + fstat
5562 rather than stat + fopen.
5563 (pbm_read_file) [0]: Remove unused code with stat race.
5564 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5565 Remove ineffective code with stat race.
5566
5567 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5568
5569 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5570
5571 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5572
5573 * nsterm.m (hold_event_q): New static variable.
5574 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5575 ! q_event_ptr.
5576 (hold_event): New function.
5577 (ns_read_socket): If hold_event_q have events, store them and
5578 return (Bug#12384).
5579 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5580 is zero (Bug#12384).
5581
5582 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5583
5584 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5585
5586 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5587
5588 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5589
5590 * fileio.c (check_existing): New function.
5591 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5592 instead of calling 'stat', when what's needed is to check whether
5593 a file exists. This avoids expensive system calls on MS-Windows.
5594 (Bug#12587)
5595
5596 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5597
5598 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5599 determine whether a file exists and is not a directory.
5600
5601 * lisp.h (check_existing): Add prototype.
5602
5603 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5604
5605 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5606
5607 2012-10-12 Glenn Morris <rgm@gnu.org>
5608
5609 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5610
5611 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5612
5613 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5614
5615 * eval.c (Fautoload): Remember previous autoload status in load-history.
5616
5617 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5620 * lread.c (load_each_byte, new_backquote_flag, readchar)
5621 (read_filtered_event, lisp_file_lexically_bound_p)
5622 (safe_to_load_version, Fload, complete_filename_p, openp)
5623 (build_load_history, readevalloop, read_escape, read1)
5624 (string_to_number, read_vector, read_list):
5625 * macros.c (Fstart_kbd_macro):
5626 * marker.c (CONSIDER):
5627 * menu.c (parse_single_submenu, digest_single_submenu)
5628 (find_and_return_menu_selection, Fx_popup_menu):
5629 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5630 (Ftry_completion):
5631 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5632 (ns_menu_show):
5633 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5634 (xmenu_show, xdialog_show):
5635 Use bool for booleans.
5636 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5637 as it's not a predicate. All uses changed. Omit unnecessary
5638 buffer termination.
5639
5640 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5641
5642 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5643 (save_excursion_restore): Do not restore mark if it was not saved.
5644
5645 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5646
5647 * marker.c (cached_modiff): EMACS_INT, not int.
5648
5649 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5650 instead of having a wrong decl.
5651 * nsmenu.m (waiting_for_input): Remove wrong decl.
5652
5653 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5654
5655 keyboard.c, keymap.c: Use bool for booleans.
5656 * dispnew.c (sit_for): Distinguish between 3-way display_option
5657 and boolean do_display.
5658 * keyboard.c (single_kboard, this_command_key_count_reset)
5659 (waiting_for_input, echoing, immediate_quit, input_pending)
5660 (interrupt_input, interrupts_deferred, pop_kboard)
5661 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5662 (command_loop_1, adjust_point_for_property)
5663 (safe_run_hooks_error, input_polling_used, read_char):
5664 (help_char_p, readable_events, kbd_buffer_events_waiting)
5665 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5666 (lucid_event_type_list_p, get_input_pending):
5667 (gobble_input, menu_separator_name_p, menu_bar_item)
5668 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5669 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5670 (keyremap_step, test_undefined, read_key_sequence)
5671 (detect_input_pending, detect_input_pending_ignore_squeezables)
5672 (detect_input_pending_run_timers, requeued_events_pending_p)
5673 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5674 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5675 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5676 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5677 (accessible_keymaps_1, Fkey_description, push_key_description):
5678 (shadow_lookup, struct where_is_internal_data)
5679 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5680 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5681 (describe_map, describe_vector):
5682 * menu.c (single_menu_item):
5683 * nsmenu.m (ns_update_menubar):
5684 * process.c (wait_reading_process_output):
5685 * search.c (scan_buffer, scan_newline):
5686 Use bool for boolean.
5687 * keyboard.c (timers_run, swallow_events)
5688 (detect_input_pending_run_timers):
5689 * process.c (wait_reading_process_output):
5690 Use unsigned for counter where wraparound-on-overflow is desired,
5691 since unsigned is guaranteed to have that behavior and signed is not.
5692 (read_char): Use ptrdiff_t for string length.
5693 (get_input_pending): Remove first argument, since it was always
5694 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5695 and behave as if it had that value. Return new value of
5696 input_pending. All callers changed.
5697 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5698 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5699 a string length.
5700 * keymap.c (push_key_description): Omit last arg, which was always 1.
5701 All callers changed.
5702
5703 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5704
5705 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5706
5707 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5708 ($(BLD)/term.$(O)): Update dependencies.
5709
5710 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5711
5712 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5713 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5714 initializer for PVEC_NORMAL_VECTOR.
5715
5716 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 Clean out old termopts cruft.
5719 * termopts.h (flow_control, meta_key): Remove unused decls.
5720 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5721 Don't include termopts.h.
5722
5723 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5724
5725 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5726
5727 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5728
5729 * commands.h (immediate_quit): Remove duplicate decl.
5730
5731 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5732
5733 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5734 caching.
5735 (nsfont_open): Remove setting of Vfonts_in_cache.
5736 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5737
5738 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5739
5740 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5741 match what GetLastError returns. Explain why the function is
5742 needed.
5743
5744 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5745 'is_tooltip_frame', to avoid confusion with its global namesake.
5746
5747 2012-10-08 Daniel Colascione <dancol@dancol.org>
5748
5749 * xdisp.c (start_hourglass): Call w32_note_current_window when
5750 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5751 build that caused Emacs to display the hourglass cursor forever.
5752
5753 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5754 which is broken under remote desktop, calculate the number of
5755 colors available for a display based on the display's number of
5756 planes and number of bits per pixel per plane. (bug#10397).
5757
5758 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5759
5760 * nsfont.m (Vfonts_in_cache): New variable.
5761 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5762 are used. Add cached fonts to Vfonts_in_cache.
5763 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5764
5765 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5766
5767 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5768 in nt/config.nt.
5769 (FONT_H): Define after FRAME_H.
5770 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5771 Update dependencies.
5772
5773 * w32term.c: Remove leftover declaration of keyboard_codepage.
5774
5775 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5776
5777 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5778 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5779 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5780 (GLOBAL_SOURCES): Add cygw32.c.
5781 ($(BLD)/unexw32.$(O)):
5782 ($(BLD)/w32.$(O)):
5783 ($(BLD)/w32console.$(O)):
5784 ($(BLD)/w32fns.$(O)):
5785 ($(BLD)/w32heap.$(O)):
5786 ($(BLD)/w32menu.$(O)):
5787 ($(BLD)/w32proc.$(O)): Add w32common.h.
5788
5789 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5790 'const char *'.
5791 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5792
5793 2012-10-08 Daniel Colascione <dancol@dancol.org>
5794
5795 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5796 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5797 accidental message numbering hole. Change other messages to
5798 match.
5799
5800 * w32select.h (HAVE_W32SELECT): Remove.
5801
5802 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5803 w32common.h instead of w32heap.h.
5804
5805 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5806 (get_allocation_unit, get_processor_type, get_w32_major_version)
5807 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5808 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5809 (OS_NT, os_subtype, cache_system_info): Move declarations to
5810 w32common.
5811
5812 * w32heap.c: Include w32common.h.
5813 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5814 (w32_minor_version, w32_build_number, w32_subtype):
5815 Remove duplicate definitions.
5816
5817 * w32fns.c: Include w32common.h; include w32heap.h only in
5818 WINDOWSNT.
5819
5820 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5821 Use `report_file_error' instead of `error' in order to better
5822 inform users of what went wrong. Increase NTGUI_UNICODE file
5823 dialog box file name length to 32k, the maximum allowed by the NT
5824 kernel.
5825
5826 * w32common.h: New file.
5827 (ROUND_UP, ROUND_DOWN, get_page_size)
5828 (get_allocation_unit, get_processor_type, get_w32_major_version)
5829 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5830 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5831 (OS_NT, os_subtype, cache_system_info): Move here.
5832
5833 * unexw32.c, unexcw.c: Include w32common.h.
5834
5835 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5836 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5837 to call syms_of_w32select.
5838
5839 * cygw32.h: Remove obsolete EXFUN declarations.
5840
5841 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5842
5843 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5844 of w32inevt.o from SOME_MACHINE_OBJECTS.
5845
5846 2012-10-08 Daniel Colascione <dancol@dancol.org>
5847
5848 * image.c: Permanent fix for JPEG compilation issue --- limit
5849 jpeglib `boolean' redefinition to Cygwin builds.
5850
5851 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5852
5853 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5854
5855 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5856 Cygwin.
5857
5858 2012-10-08 Daniel Colascione <dancol@dancol.org>
5859
5860 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5861 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5862 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5863 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5864 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5865 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5866 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5867 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5868 now a supported configuration.
5869
5870 * Makefile.in: consolidate image variables into LIBIMAGE; add
5871 W32_OBJ and W32_LIBS. Compile new files.
5872
5873 * conf_post.h:
5874 (_DebPrint) declare tracing facility for W32 debugging. We need
5875 to unify tracing later.
5876
5877 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5878 unconditional use of W32 Unicode functions. Cygwin runs only on
5879 100% Unicode operating systems.
5880
5881 * cygw32.c: New file. Define Cygwin-specific facilities.
5882 (Fcygwin_convert_path_to_windows)
5883 (Fcygwin_convert_path_from_windows): New user functions for
5884 accessing Cygwin path-munging routines.
5885
5886 * cygw32.h: New file.
5887 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5888 UTF-16LE strings temporarily inside non-Lisp-visible string
5889 objects.
5890
5891 (w32_strerror): Just what it says on the tin.
5892
5893 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5894 also run for Cygwin; both systems have the same problem with using
5895 GUI facilities in a forked child. Also call syms_of_cygw32,
5896 syms_of_w32select in correct places.
5897
5898 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5899 needs fork-then-exec for daemon launching.
5900
5901 * font.h: Include frame.h.
5902
5903 * image.c: Use the image library cache machinery only when we're
5904 compiling for native WINDOWSNT; Cygwin can use shared libraries
5905 like any other Unixlike system.
5906
5907 * keyboard.c: Clarify a comment regarding the input loop.
5908
5909 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5910 functions directly instead of trying to detect at runtime that our
5911 host operating system supports them. We make this change for two
5912 reasons: Cygwin lacks support for the multibyte character
5913 conversion functions used by the legacy menu code, and Cygwin
5914 never needs to rely on non-Unicode APIs.
5915
5916 * unexw32.c (hinst): Declare extern.
5917
5918 * w32.c: Change header order;
5919 (w32_strerror): Move to w32fns.c because we need it for
5920 non-WINDOWSNT builds.
5921
5922 * w32.h: Add #error macro to make sure we don't include w32.h for
5923 Cygwin builds. Remove w32select declarations.
5924
5925 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5926 w32fns.c. w32console.c is WINDOWSNT-only.
5927
5928 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5929 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5930 POSIXy alternative.
5931 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5932 (w32_major_version, w32_minor_version, w32_build_number)
5933 (os_subtype, sound_type): Define here
5934 (w32_defined_color): Make color parameter const for consistency
5935 with other _defined_color functions.
5936 (w32_createwindow): Unconditionally call w32_init_class instead of
5937 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5938 through the code is complex and unnecessary because class
5939 registration is practically free.
5940 (w32_name_of_message): New EMACSDEBUG-only function.
5941 (Fset_message_beep): Move here
5942 (Fx_open_connection): Require that the display name for Windows be
5943 "w32" for consistency, emacsclient disambiguation, and maybe, one
5944 day, multi-window-system support.
5945 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5946 Cygwin files for W32 GUI facilities, since these clearly don't
5947 expect Cygwin names.
5948 (_DebPrint): Define.
5949 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5950 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5951 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5952 (w32_last_error): Remove.
5953
5954 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5955
5956 * w32heap.c (syspage_mask): Declare here.
5957 (cache_system_info): Remove.
5958
5959 * w32inevt.c (faked_key): Define globally, not statically.
5960 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5961 (w32_console_toggle_lock_key): Move to w32fns.c.
5962
5963 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5964
5965 * w32proc.c (_DebPrint): Move to w32fns.c.
5966 * w32select.c: Include string.h, stdio.h for Cygwin.
5967 * w32select.h: New File.
5968
5969 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5970 get_osfhandle.
5971 (w32_message_fd): New variable. Under Cygwin, holds the file
5972 descriptor the system used to tell us about pending thread
5973 messages.
5974
5975 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5976 that prevented compilation under non-WINDOWSNT systems.
5977
5978 (w32_initialize): Open /dev/windows and assign it to
5979 w32_message_fd. Provide w32 feature.
5980
5981 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5982 (WM_EMACS_INPUT_READY): add.
5983 (prepend_msg, w32_message_fd): Declare globally.
5984
5985 * w32xfns.c:
5986 (keyboard_handle): Use only when WINDOWSNT.
5987 (notify_msg_ready): New function. Posts a message to the main
5988 thread's message queue under CYGWIN, which wakes up the main
5989 thread from select(2) by making the /dev/windows file descriptor
5990 ready. Under WINDOWSNT, it sets an event the same way the old
5991 code did.
5992
5993 (post, prepend_msg): Actually call notify_msg_ready instead of
5994 setting the input event directly.
5995
5996 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5997
5998 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5999 but it still has blocs in it, don't return it to the system,
6000 instead of aborting. (Bug#12402)
6001
6002 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
6003
6004 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
6005
6006 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6007 MAC_OS_X_VERSION_10_6.
6008 (syms_of_nsterm): Remove comment about Panther and above for
6009 ns-antialias-text.
6010 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6011 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6012 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6013
6014 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6015 MAC_OS_X_VERSION_10_4.
6016
6017 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6018 MAC_OS_X_VERSION_10_2.
6019
6020 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6021
6022 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6023 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6024
6025 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6026 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6027 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6028 Remove ns_in_resize check.
6029 (ns_clear_frame_area): Remove resize handle code.
6030
6031 * nsfns.m (ns_in_resize): Remove.
6032 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6033 Remove ns_in_resize check.
6034
6035 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6036
6037 Improve sys_siglist detection.
6038 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6039 defined as a macro, as is done in Solaris.
6040 (sys_siglist_entries): New macro.
6041 (save_strsignal): Use it.
6042 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6043 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6044
6045 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6046
6047 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6048 fullscreen/Fullscreen.
6049
6050 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6051 tobar_height is new.
6052
6053 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6054 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6055 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6056 (windowDidResize:): Check for correct window if old style fullscreen.
6057 Capitalize word in comment. Remove incorrect comment.
6058 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6059 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6060 error in drawing background.
6061 (toggleFullScreen:): Remove comment. Rearrange calls.
6062 Set toolbar values to zero, save old height in tobar_height.
6063 Restore tool bar height when leaving fullscreen.
6064 (canBecomeMainWindow): New function.
6065
6066 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6067
6068 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6069
6070 2012-10-05 Eli Zaretskii <eliz@gnu.org>
6071
6072 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6073
6074 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6075 that time stamps of directories could also be changed.
6076 Don't request the too broad GENERIC_WRITE, only the more restrictive
6077 FILE_WRITE_ATTRIBUTES access rights.
6078
6079 * fileio.c (Fset_file_times): Special-case ignoring errors for
6080 directories only on MSDOS, not on MS-Windows.
6081
6082 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6083
6084 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6085
6086 2012-10-04 Eli Zaretskii <eliz@gnu.org>
6087
6088 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6089 see whether CreateFile failed.
6090
6091 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6094 to avoid similar races.
6095 * keyboard.c (pending_signals): Now bool, not int.
6096
6097 Port timers to OpenBSD, plus check for timer failures.
6098 OpenBSD problem reported by Han Boetes.
6099 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6100 and/or setitimer.
6101 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6102 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6103 like OpenBSD, which has timer_settime but does not declare it.
6104 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6105 whether to use itimerspec-related primitives. All uses of
6106 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6107
6108 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6109
6110 * profiler.c (handle_profiler_signal): Fix a malloc race
6111 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6112
6113 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6114
6115 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6116
6117 2012-10-02 Eli Zaretskii <eliz@gnu.org>
6118
6119 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6120 consistent with the change in return value of 'safe_strsignal'.
6121
6122 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6123
6124 Prefer plain 'static' to 'static inline' (Bug#12541).
6125 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6126 (bidi_set_sor_type, bidi_push_embedding_level)
6127 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6128 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6129 (bidi_cache_search, bidi_cache_ensure_space)
6130 (bidi_cache_iterator_state, bidi_cache_find)
6131 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6132 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6133 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6134 Now 'static', not 'static inline'.
6135
6136 Count overruns when profiling; change units to ns.
6137 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6138 Give extra weight to samples after overruns, to attempt to count
6139 the time more accurately.
6140 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6141 the underlying primitives nominally do ns.
6142 (Fprofiler_cpu_start): Document the change. Mention that
6143 the sampling intervals are only approximate.
6144
6145 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6146
6147 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6148
6149 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6150 case for the special 0 coding-system.
6151
6152 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6153 (Fmake_overlay): Remove redundant tests.
6154 (fix_start_end_in_overlays): Remove redundant recentering.
6155
6156 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
6157
6158 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6159 Update dependencies.
6160
6161 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6162
6163 Fix a malloc race condition involving strsignal.
6164 A signal can arrive in the middle of a malloc, and Emacs's signal
6165 handler can invoke strsignal, which can invoke malloc, which is
6166 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6167 Fix it by altering the signal handler so that it does not invoke
6168 strsignal.
6169 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6170 * process.c (status_message): Use const pointer, in case strsignal
6171 is #defined to safe_strsignal.
6172 * sysdep.c (sys_siglist, init_signals): Always define and
6173 initialize a substitute sys_siglist if the system does not define
6174 one, even if HAVE_STRSIGNAL.
6175 (safe_strsignal): Rename from strsignal. Always define,
6176 using sys_siglist. Return a const pointer.
6177 * syssignal.h (safe_strsignal): New decl.
6178 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6179
6180 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6181
6182 * w32proc.c (timer_loop): Fix code that waits for timer
6183 expiration, to avoid high CPU usage.
6184
6185 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6186
6187 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6188 (sweep_weak_table): Remove redundant prototypes.
6189
6190 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6191
6192 * emacs.c: Move the inclusion of TERM_HEADER after including
6193 windows.h on WINDOWSNT. This avoids compilation problems with
6194 MSVC.
6195
6196 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6197
6198 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6199 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6200 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6201 as the previous version used 'void *'.
6202
6203 * ralloc.c (ROUNDUP): Fix last change.
6204 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6205 'size_t'.
6206
6207 * w32proc.c <disable_itimers>: New static flag.
6208 (init_timers): Initialize it to zero, after creating the critical
6209 sections used by the timer threads.
6210 (term_timers): Set to 1 before deleting the critical sections.
6211 (getitimer, setitimer): If disable_itimers is non-zero, return an
6212 error indication without doing anything. Reported by Fabrice
6213 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6214 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6215 return results.
6216 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6217 support timers.
6218
6219 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6220 term_ntproc after all the other bookkeeping, to get timers working
6221 as long as possible.
6222
6223 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6224
6225 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6226 Suggested by Juri Linkov in
6227 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6228
6229 Prefer plain 'static' to 'static inline' (Bug#12541).
6230 With static functions, modern compilers inline pretty well by
6231 themselves; advice from programmers often hurts as much as it helps.
6232 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6233 this change shrinks the text size of the Emacs executable by 1.1%
6234 without affecting CPU significantly in my benchmark.
6235 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6236 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6237 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6238 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6239 (bset_auto_fill_function, bset_auto_save_file_format)
6240 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6241 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6242 (bset_cache_long_line_scans, bset_case_fold_search)
6243 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6244 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6245 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6246 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6247 (bset_header_line_format, bset_indicate_buffer_boundaries)
6248 (bset_indicate_empty_lines, bset_invisibility_spec)
6249 (bset_left_fringe_width, bset_major_mode, bset_mark)
6250 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6251 (bset_name, bset_overwrite_mode, bset_pt_marker)
6252 (bset_right_fringe_width, bset_save_length)
6253 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6254 (bset_scroll_up_aggressively, bset_selective_display)
6255 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6256 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6257 (set_buffer_overlays_after):
6258 * category.c (bset_category_table):
6259 * charset.c (read_hex):
6260 * coding.c (produce_composition, produce_charset)
6261 (handle_composition_annotation, handle_charset_annotation)
6262 (char_encodable_p):
6263 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6264 (assign_row, set_frame_matrix_frame, make_current)
6265 (add_row_entry):
6266 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6267 * fns.c (maybe_resize_hash_table):
6268 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6269 * gmalloc.c (register_heapinfo):
6270 * image.c (lookup_image_type):
6271 * intervals.c (set_interval_object, set_interval_left)
6272 (set_interval_right, copy_interval_parent, rotate_right)
6273 (rotate_left, balance_possible_root_interval):
6274 * keyboard.c (kset_echo_string, kset_kbd_queue)
6275 (kset_keyboard_translate_table, kset_last_prefix_arg)
6276 (kset_last_repeatable_command, kset_local_function_key_map)
6277 (kset_overriding_terminal_local_map, kset_real_last_command)
6278 (kset_system_key_syms, clear_event, set_prop):
6279 * lread.c (digit_to_number):
6280 * marker.c (attach_marker, live_buffer, set_marker_internal):
6281 * nsterm.m (ns_compute_glyph_string_overhangs):
6282 * process.c (pset_buffer, pset_command)
6283 (pset_decode_coding_system, pset_decoding_buf)
6284 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6285 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6286 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6287 * syntax.c (bset_syntax_table, dec_bytepos):
6288 * terminal.c (tset_param_alist):
6289 * textprop.c (interval_has_some_properties)
6290 (interval_has_some_properties_list):
6291 * window.c (wset_combination_limit, wset_dedicated)
6292 (wset_display_table, wset_hchild, wset_left_fringe_width)
6293 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6294 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6295 (wset_right_fringe_width, wset_right_margin_cols)
6296 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6297 (wset_vertical_scroll_bar_type, wset_window_parameters):
6298 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6299 (wset_column_number_displayed, wset_region_showing)
6300 (window_box_edges, run_window_scroll_functions)
6301 (append_glyph_string_lists, prepend_glyph_string_lists)
6302 (append_glyph_string, set_glyph_string_background_width)
6303 (append_glyph, append_composite_glyph)
6304 (take_vertical_position_into_account):
6305 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6306 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6307 (lface_hash, lface_same_font_attributes_p, lookup_face):
6308 * xml.c (libxml2_loaded_p):
6309 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6310 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6311 Now 'static', not 'static inline'.
6312
6313 * bidi.c: Tune.
6314 (bidi_copy_it): Do the whole copy with a single memcpy.
6315 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6316
6317 Revert the FOLLOW-SYMLINKS change for file-attributes.
6318 Doing it right would require several changes to Tramp, and there's
6319 not enough time to get that tested before the freeze today.
6320 * dired.c (directory_files_internal, Ffile_attributes):
6321 Undo last change.
6322
6323 * frame.c (x_report_frame_params): Port better to wider ints.
6324 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6325 or that pointers can be printed in 15 decimal digits.
6326 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6327
6328 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6329
6330 Support x64 build on MS-Windows.
6331 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6332 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6333 compatibility with x64.
6334 (x_get_focus_frame): Add prototype.
6335
6336 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6337 defining an XRectangle structure.
6338
6339 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6340 arithmetics for compatibility with x64.
6341
6342 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6343 compatibility with x64.
6344
6345 * w32heap.h: Adjust prototypes and declarations.
6346
6347 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6348 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6349 DWORD, long, and unsigned long, for compatibility with x64.
6350 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6351 (sbrk): Argument is now of type ptrdiff_t.
6352
6353 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6354 less than 0x0500.
6355 (w32_msg_pump): Use WPARAM type for 'result'.
6356
6357 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6358 architecture.
6359 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6360 compatibility with x64.
6361
6362 * vm-limit.c (lim_data): Now size_t.
6363 (check_memory_limits): Adjust prototypes of real_morecore and
6364 __morecore to receive argument of type ptrdiff_t. Use size_t for
6365 five_percent and data_size.
6366
6367 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6368 variables, for compatibility with x64.
6369 (rva_to_section, offset_to_section, relocate_offset)
6370 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6371 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6372 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6373 for compatibility with x64.
6374
6375 * sysdep.c (STDERR_FILENO): Define if not already defined.
6376
6377 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6378 (__morecore): Argument type is now ptrdiff_t.
6379 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6380 (relinquish): Use ptrdiff_t type for 'excess'.
6381 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6382
6383 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6384 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6385 instead of a literal number.
6386
6387 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6388 (min): Define only if not already defined.
6389
6390 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6391 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6392 hosts.
6393
6394 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6395 'bitmaps' is a pointer.
6396
6397 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6398
6399 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6400
6401 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6402
6403 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6404 * dired.c (directory_files_internal, Ffile_attributes):
6405 New arg follow_symlinks. All uses changed.
6406
6407 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6408
6409 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6410
6411 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6412
6413 Support atimers and CPU profiler via profile.c on MS-Windows.
6414 * w32proc.c (sig_mask, crit_sig): New static variables.
6415 (sys_signal): Support SIGALRM and SIGPROF.
6416 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6417 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6418 sigfillset, and sigprocmask are no longer no-ops.
6419 (sigismember): New function.
6420 (struct itimer_data): New definition.
6421 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6422 (crit_prof): New static variables.
6423 (MAX_SINGLE_SLEEP): New definition.
6424 (timer_loop, stop_timer_thread, term_timers, init_timers)
6425 (start_timer_thread, getitimer, setitimer): New functions.
6426 (alarm): No longer a no-op, calls setitimer.
6427
6428 * w32.c (term_ntproc): Call term_timers.
6429 (init_ntproc): Make sure all signals are unblocked at startup, to
6430 erase any traces of dumping. Call init_timers.
6431
6432 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6433 Windows-specific code to display the hourglass mouse pointer is no
6434 longer used.
6435 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6436 to hourglass timer expiration.
6437 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6438 Remove, no longer used.
6439 (w32_note_current_window, show_hourglass, hide_hourglass):
6440 New functions, in support of hourglass cursor display similar to other
6441 window systems.
6442 (syms_of_w32fns): Don't initialize hourglass_timer.
6443
6444 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6445 WINDOWSNT as well.
6446 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6447
6448 * w32.h (init_timers, term_timers): Add prototypes.
6449
6450 2012-09-30 Kenichi Handa <handa@gnu.org>
6451
6452 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6453 to the buffer relocation which may be caused by ccl_driver.
6454
6455 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6456
6457 * xfns.c (Fx_file_dialog): Update comment.
6458
6459 * w32fns.c (Fx_file_dialog): Update comment.
6460
6461 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6462 Initialize panel name field if OSX >= 10.6.
6463
6464 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6465
6466 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6467
6468 * nsterm.m (NEW_STYLE_FS): New define.
6469 (ns_fullscreen_hook, windowWillEnterFullScreen)
6470 (windowDidEnterFullScreen, windowWillExitFullScreen)
6471 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6472 (setFSValue): New functions.
6473 (EmacsFSWindow): New implementation.
6474 (canBecomeKeyWindow): New function for EmacsFSWindow.
6475 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6476 (dealloc): Release nonfs_window if in fullscreen.
6477 (updateFrameSize:): Call windowDidMove to update top/left.
6478 (windowWillResize:toSize:): Check if frame is still maximized.
6479 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6480 next_maximized, maximized_width, maximized_height and nonfs_window.
6481 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6482 tbar_height.
6483 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6484 fullscreen. Set maximized_width/height. Act on next_maximized.
6485
6486 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6487 (EmacsView): Add variables for fullscreen.
6488 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6489 (EmacsFSWindow): New interface for fullscreen.
6490
6491 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6492
6493 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6494
6495 2012-09-30 Chong Yidong <cyd@gnu.org>
6496
6497 * fns.c (Frandom): Doc fix.
6498
6499 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6500
6501 * window.c (Vwindow_combination_limit): New default value.
6502 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6503
6504 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6505
6506 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6507 Suggested by Eli Zaretskii in
6508 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6509
6510 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6511
6512 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6513 HAVE_TIMER_SETTIME is defined.
6514
6515 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6516
6517 Profiler improvements: more-accurate timers, overflow checks.
6518 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6519 signal.h, setjmp.h. Include systime.h instead.
6520 (saturated_add): New function.
6521 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6522 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6523 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6524 New static vars.
6525 (enum profiler_cpu_running): New enum.
6526 (profiler_cpu_running): Now of that enum type, not bool.
6527 All uses changed to store the new value.
6528 (handle_profiler_signal): Rename from sigprof_handler_1,
6529 for consistency with other handlers. Do not check whether
6530 cpu_log is a hash-table if garbage collecting, since it
6531 doesn't matter in that case.
6532 (deliver_profiler_signal): Rename from sigprof_handler,
6533 for consistency with other handlers.
6534 (setup_cpu_timer): New function, with much of what used to be in
6535 Fprofiler_cpu_start. Check for out-of-range argument.
6536 Prefer timer_settime if available, and prefer
6537 thread cputime clocks, then process cputime clocks, then
6538 monotonic clocks, to the old realtime clock. Use make_timeval
6539 to round more-correctly when falling back to setitimer.
6540 (Fprofiler_cpu_start): Use it.
6541 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6542 Don't assume that passing NULL as the 2nd argument of setitimer
6543 is the same as passing a pointer to all-zero storage.
6544 Ignore SIGPROF afterwards.
6545 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6546 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6547 non-fatal signal handlers. Ignore SIGPROF on startup.
6548 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6549 in profiler.c, since sysdep.c now uses it.
6550
6551 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6552 Suggested by Eli Zaretskii in
6553 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6554
6555 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6556
6557 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6558
6559 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6560
6561 * lisp.h (struct backtrace): Remove indirection for `function' field.
6562 * xdisp.c (redisplay_internal):
6563 * profiler.c (record_backtrace, sigprof_handler_1):
6564 * alloc.c (Fgarbage_collect):
6565 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6566 (Fbacktrace_frame): Adjust accordingly.
6567
6568 2012-09-28 Glenn Morris <rgm@gnu.org>
6569
6570 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6571 (Frun_hook_with_args_until_failure): Doc fixes.
6572
6573 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6574
6575 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6576 Qautomatic_redisplay and change the symbol name. All users changed.
6577
6578 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6579
6580 * profiler.c (sigprof_handler): Fix race condition.
6581
6582 2012-09-28 Glenn Morris <rgm@gnu.org>
6583
6584 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6585
6586 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6587
6588 Check more robustly for timer_settime.
6589 * Makefile.in (LIB_TIMER_TIME): New macro.
6590 (LIBES): Add it.
6591 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6592 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6593 call timer_settime.
6594
6595 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6596
6597 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6598
6599 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6600
6601 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6602
6603 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6604
6605 * character.h (MAYBE_UNIFY_CHAR): Remove.
6606 * charset.c, charset.h (maybe_unify_char): Now static.
6607 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6608 Since this stuff is now private to charset.c, there's no need for
6609 a public macro and no need to inline by hand.
6610
6611 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6612 Stefan Monnier <monnier@iro.umontreal.ca>
6613 Juanma Barranquero <lekktu@gmail.com>
6614
6615 * profiler.c: New file.
6616 * Makefile.in (base_obj): Add profiler.o.
6617 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6618 ($(BLD)/profiler.$(O)): New target.
6619 * emacs.c (main): Call syms_of_profiler.
6620 * alloc.c (Qautomatic_gc): New constant.
6621 (MALLOC_PROBE): New macro.
6622 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6623 (total_bytes_of_live_objects): New function.
6624 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6625 Call malloc_probe for the memory profiler.
6626 (syms_of_alloc): Define Qautomatic_gc.
6627 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6628 race condition.
6629 (struct backtrace): Move definition...
6630 * lisp.h (struct backtrace): ..here.
6631 (Qautomatic_gc, profiler_memory_running): Declare vars.
6632 (malloc_probe, syms_of_profiler): Declare functions.
6633 * xdisp.c (Qautomatic_redisplay): New constant.
6634 (redisplay_internal): Record itself in backtrace_list.
6635 (syms_of_xdisp): Define Qautomatic_redisplay.
6636
6637 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6638 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6639
6640 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6641
6642 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 Prefer POSIX timers if available.
6645 They avoid a race if the timer is too close to the current time.
6646 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6647 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6648 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6649
6650 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6651
6652 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6653 CHAR_STRING_ADVANCE.
6654 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6655 STRING_CHAR_ADVANCE.
6656
6657 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6658
6659 Move Vlibrary_cache to emacs.c and reset before dumping.
6660
6661 * lisp.h (reset_image_types): Declare.
6662 [WINDOWSNT] (Vlibrary_cache): Declare.
6663
6664 * image.c (reset_image_types): New function.
6665
6666 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6667 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6668 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6669
6670 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6671 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6672
6673 * w32.h (Vlibrary_cache): Do not declare.
6674
6675 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6676
6677 * w32proc.c (sys_signal): Handle all signals defined by the
6678 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6679 handlers for signals supported by Windows. Don't override
6680 term_ntproc as the handler for SIGABRT.
6681 (sigaction): Rewrite to call sys_signal instead of duplicating its
6682 code.
6683 (sys_kill): Improve commentary.
6684
6685 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6686 consistency with a signature of a signal handler. All callers
6687 changed.
6688 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6689 install term_ntproc as a signal handler for SIGABRT, as that
6690 should be done by the dumped Emacs.
6691
6692 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6693
6694 * w32select.c (term_w32select): Protect against repeated
6695 invocation by setting clipboard_owner to NULL after calling
6696 DestroyWindow.
6697
6698 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6699 and term_ntproc to their modified signatures.
6700
6701 * character.c (char_string, string_char): Remove calls to
6702 MAYBE_UNIFY_CHAR. See the discussion starting at
6703 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6704 for the details.
6705
6706 2012-09-25 Chong Yidong <cyd@gnu.org>
6707
6708 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6709
6710 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6711
6712 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6713 when encountering an unknown bytecode.
6714
6715 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6716
6717 image.c, indent.c: Use bool for booleans.
6718 * dispextern.h (struct image_type): Members valid_p, load, init
6719 now return bool, not int. All uses changed.
6720 * image.c: Omit unnecessary static decls.
6721 (x_create_bitmap_mask, x_build_heuristic_mask):
6722 Return void, not int, since callers don't care about the return value.
6723 (x_create_bitmap_mask, define_image_type, valid_image_p)
6724 (struct image_keyword, parse_image_spec, image_spec_value)
6725 (check_image_size, image_background)
6726 (image_background_transparent, x_clear_image_1)
6727 (postprocess_image, lookup_image, x_check_image_size)
6728 (x_create_x_image_and_pixmap, xbm_image_p)
6729 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6730 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6731 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6732 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6733 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6734 (png_image_p, init_png_functions, png_load_body, png_load)
6735 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6736 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6737 (init_gif_functions, gif_load, imagemagick_image_p)
6738 (imagemagick_load_image, imagemagick_load, svg_image_p)
6739 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6740 (gs_load):
6741 * nsimage.m (ns_load_image):
6742 * nsterm.m (ns_defined_color):
6743 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6744 * xfns.c (x_defined_color):
6745 * xterm.c (x_alloc_lighter_color_for_widget)
6746 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6747 (x_alloc_lighter_color):
6748 * indent.c (disptab_matches_widthtab, current_column)
6749 (scan_for_column, string_display_width, indented_beyond_p)
6750 (compute_motion, vmotion, Fvertical_motion):
6751 Use bool for booleans.
6752
6753 2012-09-24 Chong Yidong <cyd@gnu.org>
6754
6755 * chartab.c (Fset_char_table_default): Obsolete function removed.
6756
6757 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6758
6759 Move pid_t related decls out of lisp.h.
6760 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6761 (interruptible_wait_for_termination):
6762 Move these decls from lisp.h to syswait.h, since they use pid_t.
6763 Needed on FreeBSD; see Herbert J. Skuhra in
6764 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6765 * callproc.c: Include syswait.h.
6766
6767 gnutls.c, gtkutil.c: Use bool for boolean.
6768 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6769 (emacs_gnutls_handle_error):
6770 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6771 (xg_hide_tooltip, xg_create_frame_widgets)
6772 (create_dialog, xg_uses_old_file_dialog)
6773 (xg_get_file_with_chooser, xg_get_file_with_selection)
6774 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6775 (xg_item_label_same_p, xg_update_menubar)
6776 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6777 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6778 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6779 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6780 (update_frame_tool_bar, free_frame_tool_bar):
6781 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6782 * nsmenu.m (ns_update_menubar):
6783 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6784 * xfns.c (Fx_show_tip) [USE_GTK]:
6785 Use bool for boolean.
6786 * gtkutil.c (xg_update_frame_menubar):
6787 * xmenu.c (update_frame_menubar):
6788 Return void, not int, since caller ignores return value.
6789 * gtkutil.c (xg_change_toolbar_position):
6790 Return void, not 1.
6791
6792 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6793
6794 * makefile.w32-in (BLOCKINPUT_H): Remove.
6795 (SYSSIGNAL_H): New macro.
6796 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6797 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6798 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6799 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6800 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6801 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6802 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6803 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6804 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6805 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6806 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6807 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6808 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6809 ($(BLD)/w32xfns.$(O)): Update dependencies.
6810
6811 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6812
6813 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6814 fatal_error_backtrace.
6815
6816 * w32proc.c (sys_kill): Undo last change: don't do anything when
6817 invoked to deliver SIGABRT to our own process. This is now
6818 handled by emacs_raise.
6819
6820 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6821
6822 * w32term.c (w32_read_socket): Remove leftover reference to
6823 interrupt_input_pending.
6824
6825 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6826
6827 Do not use SA_NODEFER.
6828 Problem reported by Dani Moncayo in
6829 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6830 * alloc.c (die):
6831 * sysdep.c (emacs_abort): Do not reset signal handler.
6832 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6833 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6834 wanted even on POSIXish hosts, and it doesn't work on Windows.
6835
6836 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6837
6838 * xterm.c (x_term_init): Call fixup_locale before and after calling
6839 gtk_init (Bug#12392).
6840
6841 2012-09-23 Chong Yidong <cyd@gnu.org>
6842
6843 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6844 Vdynamic_library_alist.
6845
6846 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6847 (Fgnutls_available_p): Caller changed.
6848
6849 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6850 (Flibxml_parse_xml_region): Likewise.
6851
6852 * dispextern.h (struct image_type): Remove arg from init function.
6853
6854 * image.c (Finit_image_library, lookup_image_type)
6855 (define_image_type): Remove now-unneeded second arg.
6856 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6857 (init_tiff_functions, init_gif_functions, init_svg_functions):
6858 Arglist and w32_delayed_load calling convention changed.
6859 (gs_type): Remove init_gs_functions; there is no such function.
6860 (valid_image_p, make_image): Fix caller to lookup_image_type.
6861
6862 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6863
6864 Simplify and avoid signal-handling races (Bug#12471).
6865 * alloc.c (die):
6866 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6867 Avoid recursive loop if there's a fatal error in the function itself.
6868 * atimer.c (pending_atimers):
6869 * blockinput.h: Don't include "atimer.h"; no longer needed.
6870 (interrupt_input_pending): Remove. All uses removed.
6871 pending_signals now counts both atimers and ordinary interrupts.
6872 This is less racy than having three separate pending-signal flags.
6873 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6874 (input_blocked_p):
6875 Rename from their upper-case counterparts BLOCK_INPUT,
6876 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6877 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6878 This makes it easier to access volatile variables more accurately.
6879 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6880 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6881 that's more reliable if the code is buggy and sets
6882 interrupt_input_blocked to a negative value. All uses changed.
6883 * atimer.c (deliver_alarm_signal):
6884 Remove. No need to deliver this to the parent; any thread can
6885 handle this signal now. All uses replaced by underlying handler.
6886 * atimer.c (turn_on_atimers):
6887 * dispnew.c (handle_window_change_signal):
6888 * emacs.c (handle_danger_signal):
6889 * keyboard.c (kbd_buffer_get_event):
6890 Don't reestablish signal handler; not needed with sigaction.
6891 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6892 (UNBLOCK_INPUT_TO):
6893 Rework to avoid unnecessary accesses to volatile variables.
6894 (UNBLOCK_INPUT_TO): Now a function.
6895 (totally_unblock_input, unblock_input): New decls.
6896 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6897 (init_data): Remove. Necessary stuff now done in init_signal.
6898 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6899 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6900 (fatal_error_code): Remove; no longer needed.
6901 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6902 it doesn't always backtrace. All uses changed. No need to reset
6903 signal to default, since sigaction and/or die does that for us now.
6904 Use emacs_raise (FOO), not kill (getpid (), FOO).
6905 (main): Check more-accurately whether we're dumping.
6906 Move fatal-error setup to sysdep.c
6907 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6908 * gtkutil.c (xg_get_file_name, xg_get_font):
6909 Remove no-longer-needed signal-mask manipulation.
6910 * keyboard.c, process.c (POLL_FOR_INPUT):
6911 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6912 * keyboard.c (read_avail_input): Remove.
6913 All uses replaced by gobble_input.
6914 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6915 (kbd_buffer_store_event_hold, gobble_input):
6916 (record_asynch_buffer_change) [USABLE_SIGIO]:
6917 (store_user_signal_events):
6918 No need to mess with signal mask.
6919 (gobble_input): If blocking input and there are terminals, simply
6920 set pending_signals to 1 and return. All hooks changed to not
6921 worry about whether input is blocked.
6922 (process_pending_signals): Clear pending_signals before processing
6923 them, in case a signal comes in while we're processing.
6924 By convention callers now test pending_signals before calling us.
6925 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6926 New functions, to support changes to blockinput.h.
6927 (handle_input_available_signal): Now extern.
6928 (reinvoke_input_signal): Remove. All uses replaced by
6929 handle_async_input.
6930 (quit_count): Now volatile, since a signal handler uses it.
6931 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6932 All callers changed. Block SIGINT only if not already blocked.
6933 Clear sigmask reliably, even if Fsignal returns, which it can.
6934 Omit unnecessary accesses to volatile var.
6935 (quit_throw_to_read_char): No need to restore sigmask.
6936 * keyboard.c (gobble_input, handle_user_signal):
6937 * process.c (wait_reading_process_output):
6938 Call signal-handling code rather than killing ourselves.
6939 * lisp.h: Include <float.h>, for...
6940 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6941 (pending_signals): Now volatile.
6942 (syms_of_data): Now const if IEEE floating point.
6943 (handle_input_available_signal) [USABLE_SIGIO]:
6944 (terminate_due_to_signal, record_child_status_change): New decls.
6945 * process.c (create_process): Avoid disaster if memory is exhausted
6946 while we're processing a vfork, by tightening the critical section
6947 around the vfork.
6948 (send_process_frame, process_sent_to, handle_pipe_signal)
6949 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6950 ignores SIGPIPE.
6951 (send_process): No need for setjmp/longjmp any more, since the
6952 SIGPIPE stuff is now gone. Instead, report an error if errno
6953 is EPIPE.
6954 (record_child_status_change): Now extern. PID and W are now args.
6955 Return void, not bool. All callers changed.
6956 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6957 Remove. All uses removed. This bug should be fixed now in a
6958 different way.
6959 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6960 and record the child status change directly. This avoids the
6961 need to futz with the signal mask.
6962 (process_fatal_action): Move here from emacs.c.
6963 (emacs_sigaction_flags): New function, containing
6964 much of what used to be in emacs_sigaction_init.
6965 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6966 caught by emacs, to make races less likely.
6967 (deliver_process_signal): Rename from handle_on_main_thread.
6968 All uses changed.
6969 (BACKTRACE_LIMIT_MAX): Now at top level.
6970 (thread_backtrace_buffer, threadback_backtrace_pointers):
6971 New static vars.
6972 (deliver_thread_signal, deliver_fatal_thread_signal):
6973 New functions, for more-accurate delivery of thread-specific signals.
6974 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6975 (deliver_arith_signal): Handle in this thread, not
6976 in the main thread, since it's triggered by this thread.
6977 (maybe_fatal_sig): New function.
6978 (init_signals): New arg DUMPING so that we can be more accurate
6979 about whether we're dumping. Caller changed.
6980 Treat thread-specific signals differently from process-general signals.
6981 Block all signals while handling fatal error; that's safer.
6982 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6983 on IEEE hosts.
6984 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6985 Ignore SIGPIPE unless batch.
6986 (emacs_backtrace): Output backtrace for the appropriate thread,
6987 which is not necessarily the main thread.
6988 * syssignal.h: Include <stdbool.h>.
6989 (emacs_raise): New macro.
6990 * xterm.c (x_connection_signal): Remove; no longer needed
6991 now that we use sigaction.
6992 (x_connection_closed): No need to mess with sigmask now.
6993 (x_initialize): No need to reset SIGPIPE handler here, since
6994 init_signals does this for us now.
6995
6996 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6997
6998 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6999 background rect may be larger (Bug#12245).
7000
7001 2012-09-23 Chong Yidong <cyd@gnu.org>
7002
7003 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
7004
7005 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7006
7007 * .gdbinit: Just stop at fatal_error_backtrace.
7008 See Stefan Monnier's request in
7009 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7010 Remove no-longer-used query of system type.
7011
7012 2012-09-22 Chong Yidong <cyd@gnu.org>
7013
7014 * search.c (Freplace_match): Doc fix (Bug#12325).
7015
7016 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7017
7018 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7019 (Fline_end_position): Doc fix.
7020
7021 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7022
7023 2012-09-22 Chong Yidong <cyd@gnu.org>
7024
7025 * dispextern.h (struct image_type): Add new slot, storing a type
7026 initialization function.
7027
7028 * image.c (define_image_type): Call the image initializer function
7029 if it is defined. Arguments and return value changed.
7030 (valid_image_p, make_image): Callers changed.
7031 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7032 (gif_type, imagemagick_type, svg_type, gs_type):
7033 Add initialization functions.
7034 (Finit_image_library): Call lookup_image_type.
7035 (CHECK_LIB_AVAILABLE): Macro deleted.
7036 (lookup_image_type): Call define_image_type here, rather than via
7037 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7038 (syms_of_image): Move define_image_type calls for xbm_type and
7039 pbm_type to lookup_image_type.
7040
7041 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7042
7043 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7044 'idle_timers' from here ...
7045 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7046 lists, to avoid infloops when the timer does something stupid,
7047 like reinvoke itself with the same or smaller time-out.
7048 (Bug#12447)
7049
7050 2012-09-22 Martin Rudalics <rudalics@gmx.at>
7051
7052 * window.c (Fsplit_window_internal): Handle only Qt value of
7053 Vwindow_combination_limit separately.
7054 (Qtemp_buffer_resize): New symbol.
7055 (Vwindow_combination_limit): New default value.
7056 Rewrite doc-string.
7057
7058 2012-09-22 Eli Zaretskii <eliz@gnu.org>
7059
7060 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7061 the new overlay string. (Bug#10159)
7062
7063 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7066 or that fprintf is async-signal-safe. POSIX doesn't require
7067 either assumption.
7068
7069 2012-09-22 Chong Yidong <cyd@gnu.org>
7070
7071 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7072 (Bug#8207).
7073
7074 2012-09-22 Kenichi Handa <handa@gnu.org>
7075
7076 * composite.c (composition_reseat_it): Handle the case that a
7077 grapheme cluster is not covered by a single font (Bug#12352).
7078
7079 2012-09-21 Chong Yidong <cyd@gnu.org>
7080
7081 * image.c (define_image_type): Avoid adding duplicate types to
7082 image_types (Bug#12463). Suggested by Jörg Walter.
7083
7084 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7085
7086 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7087 (print_load_command_name): Add case LC_DATA_IN_CODE.
7088 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7089
7090 2012-09-21 Glenn Morris <rgm@gnu.org>
7091
7092 * eval.c (Frun_hook_with_args_until_success)
7093 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7094
7095 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7096
7097 * fileio.c (Ffile_selinux_context): Only call freecon when
7098 lgetfilecon succeeded.
7099 (Fset_file_selinux_context): Likewise. (Bug#12444)
7100
7101 2012-09-21 Eli Zaretskii <eliz@gnu.org>
7102
7103 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7104 reordering, locate the cursor by calling set_cursor_from_row; if
7105 that fails, clear the desired glyph matrix before returning a
7106 failure indication to the caller. Fixes leaving garbled display
7107 when fast scrolling with a down-key. (Bug#12403)
7108 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7109 scrolling through multibyte text.
7110
7111 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7112
7113 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7114 calling mark_vectorlike since that's the one that marks the window.
7115 (mark_discard_killed_buffers): Mark the final cdr.
7116 * window.h (struct window): Move prev/next_buffers to the
7117 non-standard fields.
7118 * window.c (make_window): Initialize prev/next_buffers manually.
7119
7120 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7121
7122 Omit unused arg EXPECTED from socket hooks.
7123 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7124 * nsterm.m (ns_term_init):
7125 * termhooks.h (struct terminal.read_socket_hook):
7126 * w32inevt.c (w32_console_read_socket):
7127 * w32term.c (w32_read_socket):
7128 * xterm.c (XTread_socket):
7129 Omit unused arg EXPECTED. All callers changed.
7130 (store_user_signal_events): Return void, not int, since callers no
7131 longer care about the return value. All uses changed.
7132
7133 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
7134
7135 * w32gui.h (XParseGeometry): Do not declare.
7136
7137 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7138
7139 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7140 Ignore 'expected'. See Eli Zaretskii in
7141 <http://bugs.gnu.org/12471#8> (last line).
7142
7143 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7144 (XParseGeometry): Now static. Substitute extremal values for
7145 values that are out of range.
7146
7147 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7148
7149 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7150
7151 * nsfns.m (XParseGeometry): Remove.
7152 (Fx_create_frame): Call x_set_offset to correctly interpret
7153 top_pos in geometry.
7154
7155 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7156 (Fx_parse_geometry): If there is a space in string, call
7157 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7158
7159 2012-09-17 Eli Zaretskii <eliz@gnu.org>
7160
7161 * search.c (scan_buffer): Use character positions in calls to
7162 region_cache_forward and region_cache_backward, not byte
7163 positions. (Bug#12196)
7164
7165 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7166 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7167
7168 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7169 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7170 emacs_blocked_malloc, now deleted.
7171
7172 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7175 The workaround was for improving performance on Solaris 2.4, but
7176 is getting in the way now. Emacs will still work if someone is
7177 still running Solaris 2.4 in a museum somewhere; Sun dropped
7178 support for Solaris 2.4 in 2003.
7179 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7180 * process.c (create_process) [HAVE_WORKING_VFORK]:
7181 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7182 since Emacs no longer uses vfork on that platform.
7183
7184 2012-09-17 Glenn Morris <rgm@gnu.org>
7185
7186 * emacs.c: Use COPYRIGHT.
7187
7188 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7189
7190 Remove configure's --without-sync-input option (Bug#12450).
7191 When auditing signal-handling in preparation for cleaning it up,
7192 I found that SYNC_INPUT has race conditions and would be a real
7193 pain to fix. Since it's an undocumented and deprecated
7194 configure-time option, now seems like a good time to remove it.
7195 Also see <http://bugs.gnu.org/11080#16>.
7196 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7197 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7198 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7199 (malloc_hysteresis):
7200 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7201 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7202 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7203 (dont_register_blocks, bytes_used_when_reconsidered)
7204 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7205 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7206 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7207 Remove. All uses removed.
7208 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7209 implementation, one that depends on whether the new macro
7210 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7211 is defined.
7212 * atimer.c (run_timers, handle_alarm_signal):
7213 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7214 (handle_async_input, process_pending_signals)
7215 (handle_input_available_signal, init_keyboard):
7216 * nsterm.m (ns_read_socket):
7217 * process.c (wait_reading_process_output):
7218 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7219 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7220 (emacs_write):
7221 * xterm.c (XTread_socket):
7222 Assume SYNC_INPUT.
7223 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7224 * eval.c (handling_signal): Remove. All uses removed.
7225 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7226 All uses replaced with the SYNC_INPUT version.
7227 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7228 Remove decls.
7229 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7230 Now static.
7231
7232 * font.c (Ffont_shape_gstring): Remove unused local.
7233
7234 2012-09-16 Glenn Morris <rgm@gnu.org>
7235
7236 * Makefile.in (clean): No longer run nextstep's clean.
7237
7238 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7239 (ns_frag): Remove.
7240 (ns-app): Move here from ns.mk, and simplify.
7241 (clean): Simplify nextstep entry.
7242 * ns.mk: Remove file.
7243
7244 2012-09-17 Kenichi Handa <handa@gnu.org>
7245
7246 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7247 not covert the last few charactes.
7248
7249 2012-09-16 Kenichi Handa <handa@gnu.org>
7250
7251 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7252 here, but just check the validity of glyphs in the glyph-string.
7253
7254 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7255
7256 * window.c (Fwindow_parameter, Fset_window_parameter):
7257 Accept any window as argument (Bug#12452).
7258
7259 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7260
7261 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7262 to ns_term_init to avoid memory leak.
7263
7264 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7265 explicit retain/release.
7266 (ns_term_init): Only allow one display. Initialize outerpool and
7267 ns_*_types.
7268
7269 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7270
7271 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7272 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7273 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7274 the Microsoft problem in a different way, by altering ../nt/config.nt.
7275
7276 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7277
7278 * w32xfns.c:
7279 * w32uniscribe.c:
7280 * w32term.c:
7281 * w32select.c:
7282 * w32reg.c:
7283 * w32proc.c:
7284 * w32menu.c:
7285 * w32inevt.c:
7286 * w32heap.c:
7287 * w32font.c:
7288 * w32fns.c:
7289 * w32console.c:
7290 * w32.c:
7291 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7292 by lisp.h. This completes removal of setjmp.h inclusion
7293 erroneously announced in the previous commit. (Bug#12446)
7294
7295 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7296 more accurate.
7297
7298 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7299 not defined as a macro. The latter happens on MS-Windows.
7300 (Bug#12446)
7301
7302 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7303
7304 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7305 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7306 Some instances of '#include <setjmp.h>' removed, if the
7307 only reason for the instance was because "lisp.h" was included.
7308 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7309 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7310 and _longjmp with the new symbols. Emacs already uses _setjmp if
7311 available, so this change affects only POSIXish hosts that have
7312 sigsetjmp but not _setjmp, such as some versions of Solaris and
7313 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7314 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7315 (png_load_body) [HAVE_PNG]:
7316 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7317 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7318 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7319 since PNG requires jmp_buf. This is the only exception to the
7320 general rule that we now use sys_setjmp and sys_longjmp.
7321 This exception is OK since this code does not change the signal
7322 mask or longjmp out of a signal handler.
7323
7324 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7325
7326 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7327 Include "syssignal.h", for 'main_thread'.
7328
7329 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7330
7331 Avoid out-of-range marker position (Bug#12426).
7332 * insdel.c (replace_range, replace_range_2):
7333 Adjust markers before overlays, as suggested by comments.
7334 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7335 Remove redundant check before calling offset_intervals.
7336
7337 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7338
7339 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7340 current buffer (Bug#12387).
7341
7342 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7343
7344 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7345
7346 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 Use a more backwards-compatible timer format (Bug#12430).
7349 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7350 vector element, not from the 4th, since PSECS is now at the end.
7351 (Fcurrent_idle_time): Doc fix.
7352
7353 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7354
7355 Function to mark objects and remove killed buffers at once.
7356 * alloc.c (discard_killed_buffers): Rename to ...
7357 (mark_discard_killed buffers) ... new name. Add marking
7358 of remaining objects. Fix comment. Adjust users.
7359 (mark_object): Do not touch frame buffer lists here.
7360 * frame.c (delete_frame): Reset frame buffer lists here.
7361
7362 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7363
7364 Better workaround for GNOME bug when --enable-gcc-warnings.
7365 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7366 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7367 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7368
7369 Simplify SIGIO usage (Bug#12408).
7370 The code that dealt with SIGIO was crufty and confusing, e.g., it
7371 played tricks like "#undef SIGIO" but these tricks were not used
7372 consistently. Simplify mostly by not #undeffing standard symbols,
7373 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7374 or not as we please) rather than "defined SIGIO" (standard symbol
7375 that we probably shouldn't #undef).
7376 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7377 Modules that need it can include it.
7378 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7379 * dispextern.h (ignore_sigio): New decl.
7380 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7381 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7382 * emacs.c (shut_down_emacs):
7383 * keyboard.c (kbd_buffer_store_event_hold):
7384 Use ignore_sigio rather than invoking 'signal' directly.
7385 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7386 for FIONREAD.
7387 (FIONREAD, SIGIO): Do not #undef.
7388 (tty_read_avail_input): Use #error rather than a syntax error.
7389 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7390 for I_PIPE, used by SETUP_SLAVE_PTY.
7391 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7392 * sysdep.c (croak): Remove; no longer needed. This bit of
7393 temporary code, with Fred N. Fish's comment that it's temporary,
7394 has been in Emacs since at least 1992!
7395 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7396 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7397 * syssignal.h (croak): Remove decl.
7398 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7399 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7400 now that we're termios-only.
7401 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7402 * term.c (dissociate_if_controlling_tty): Use #error rather than
7403 a run-time error.
7404
7405 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7406 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7407 to work around GNOME bug 683906.
7408 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7409 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7410 This works around GCC bug 54561.
7411
7412 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7413
7414 More fixes for 'volatile' and setjmp/longjmp.
7415 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7416 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7417 (png_load_body) [HAVE_PNG]:
7418 (jpeg_load_body) [HAVE_JPEG]:
7419 New function, with most of the old parent function's body.
7420 (png_load) [HAVE_PNG]:
7421 (jpeg_load) [HAVE_JPEG]:
7422 Invoke the new function, to avoid longjmp munging our locals.
7423 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7424 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7425 longjmp is passed 2, as the C standard doesn't guarantee this.
7426 Instead, store the failure code into mgr->failure_code.
7427
7428 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7429
7430 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7431 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7432 (syms_of_keyboard): Remove support for unread-command-char.
7433
7434 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7435
7436 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7437 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7438 violation. (Bug#12426)
7439
7440 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7441
7442 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7443
7444 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7445
7446 * eval.c: Add `inhibit-debugger'.
7447 (Qinhibit_debugger): New symbol.
7448 (call_debugger): Bind it instead of Qdebug_on_error.
7449 (maybe_call_debugger): Test Vinhibit_debugger.
7450 (syms_of_eval): Define inhibit-debugger.
7451 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7452 (syms_of_xdisp): Remove inhibit-debug-on-message.
7453
7454 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7455
7456 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7457 If a nonvolatile local variable is written before a _longjmp to
7458 the frame containing the variable, and is read after the _longjmp,
7459 the value read is indeterminate. Some local variables of type
7460 'struct handler' and 'struct catchtag' are used in this way, so
7461 mark each of their slots as volatile if the slot can be set before
7462 _longjmp and read afterwards.
7463 * lisp.h (struct handler): var and chosen_clause are now volatile.
7464 (struct catchtag): val, next, and pdlcount are now volatile.
7465
7466 * bidi.c (bidi_push_it, bidi_pop_it):
7467 * fns.c (copy_hash_table):
7468 * image.c (define_image_type):
7469 * keyboard.c (kbd_buffer_store_event_hold):
7470 * process.c (Fprocess_send_eof):
7471 * xfaces.c (x_create_gc) [HAVE_NS]:
7472 * xgselect.c (xg_select):
7473 Prefer assignment to memcpy when either will do.
7474
7475 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7476 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7477 time an item is removed. No need to mark this function 'inline';
7478 the compiler knows better than we do.
7479
7480 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7481
7482 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7483 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7484 to change_frame_size (Bug#12388).
7485 (windowDidResize:): Pass YES to updateFrameSize.
7486
7487 * nsterm.h: Add delay parameter to updateFrameSize.
7488
7489 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7490
7491 Discard killed buffers from deleted window and frame objects.
7492 This reduces an amount of references to killed buffers and
7493 helps GC to reclaim them faster.
7494 * alloc.c (discard_killed_buffers): New function.
7495 (mark_object): Use it for deleted windows and frames.
7496 (mark_object): If symbol's value is set up for a killed buffer
7497 or deleted frame, restore its global binding.
7498 * data.c (swap_in_global_binding): Add GC notice.
7499 (swap_in_symval_forwarding): Use convenient set_blv_where.
7500 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7501 * window.h: ... to here.
7502
7503 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7504
7505 Convenient macro to check whether the buffer is live.
7506 * buffer.h (BUFFER_LIVE_P): New macro.
7507 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7508 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7509
7510 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7511
7512 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7513 composition cases (Bug#12364).
7514
7515 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7516 overhang of succeeding glyphs overlapping box cursor.
7517
7518 * w32term.c (x_draw_glyph_string): Likewise.
7519
7520 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7521
7522 Simplify, document, and port floating-point (Bug#12381).
7523 The porting part of this patch fixes bugs on non-IEEE platforms
7524 with frexp, ldexp, logb.
7525 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7526 Now static.
7527 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7528 support, by removing commented-out code and briefly listing the
7529 C89 functions excluded. The commented-out stuff was confusing
7530 maintenance, e.g., we thought we needed cbrt but it was commented out.
7531 (logb): Remove decl; no longer needed.
7532 (isfinite): New macro, if not already supplied.
7533 (isnan): Don't replace any existing macro.
7534 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7535 are present on all C89 platforms.
7536 (Ffrexp): Do not special-case zero, as frexp does the right thing
7537 for that case.
7538 (Flogb): Do not use logb, as it doesn't have the desired meaning
7539 on hosts that use non-base-2 floating point. Instead, stick with
7540 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7541 frexp, to avoid getting an unspecified result.
7542
7543 * xdisp.c (Qinhibit_debug_on_message): Now static.
7544
7545 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7546
7547 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7548 NSBezierPath (Bug#12131).
7549
7550 2012-09-10 Chong Yidong <cyd@gnu.org>
7551
7552 * fns.c (Fdelq, Fdelete): Doc fix.
7553
7554 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7555
7556 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7557 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7558
7559 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7560
7561 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7562 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7563 Use it.
7564
7565 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7566
7567 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7568 left fringe if the window has a left margin. This avoids leaving
7569 traces of the cursor because its leftmost pixel is not drawn over.
7570
7571 * dispnew.c (update_window_line): When the left margin area of a
7572 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7573 that screen line. (Bug#12277)
7574
7575 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 Assume C89 or later for math functions (Bug#12381).
7578 This simplifies the code, and makes it a bit smaller and faster,
7579 and (most important) makes it easier to clean up signal handling
7580 since we can stop worring about floating-point exceptions in
7581 library code. That was a problem before C89, but the problem
7582 went away many years ago on all practical Emacs targets.
7583 * data.c, image.c, lread.c, print.c:
7584 Don't include <math.h>; no longer needed.
7585 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7586 might be autoconfigured, as that never happens.
7587 * data.c (fmod):
7588 * doprnt.c (DBL_MAX_10_EXP):
7589 * print.c (DBL_DIG):
7590 Remove. C89 or later always defines these.
7591 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7592 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7593 (arith_error, domain_error, domain_error2):
7594 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7595 no longer needed -- we simply return what C returns. All uses removed.
7596 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7597 the wrapped code.
7598 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7599 Remove. All uses expanded, as these macros are no longer used
7600 more than once and are now more trouble than they're worth.
7601 (Ftan): Use tan, not sin / cos.
7602 (Flogb): Assume C89 frexp.
7603 (fmod_float): Assume C89 fmod.
7604 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7605 (init_floatfns): Remove. All uses removed.
7606
7607 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7608
7609 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7610 compositeToPoint for OSX < 10.6 (Bug#12390).
7611
7612 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7613
7614 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7615 This produces more-accurate results.
7616
7617 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7618
7619 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7620 changes (Bug#12088).
7621
7622 2012-09-08 Chong Yidong <cyd@gnu.org>
7623
7624 * syntax.c (Fstring_to_syntax): Doc fix.
7625
7626 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7627
7628 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7629 in the internal border.
7630 (x_set_window_size): Remove static variables and their usage.
7631 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7632 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7633 Remove fringe/internal border adjustment (Bug#11052).
7634 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7635 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7636 (ns_fix_rect_ibw): Remove.
7637 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7638 (ns_dumpglyphs_box_or_relief): Ditto.
7639 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7640 adjustment.
7641 (ns_dumpglyphs_image): Ditto.
7642 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7643 border adjustment.
7644 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7645 their usage. Add fringe_extended_p and its use as in other terms.
7646 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7647 scroll bar was removed.
7648 (updateFrameSize): New function.
7649 (windowDidResize): Move code to updateFrameSize and call it.
7650
7651 * nsterm.h (EmacsView): Add updateFrameSize.
7652
7653 2012-09-07 Chong Yidong <cyd@gnu.org>
7654
7655 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7656
7657 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7658
7659 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7660
7661 More signal-handler cleanup (Bug#12327).
7662 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7663 Problem introduced when merging patches. Noted by Eli Zaretskii in
7664 <http://bugs.gnu.org/12327#67>.
7665 * floatfns.c: Comment fix.
7666 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7667 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7668 and anyway the declaration is harmless even if SIGDANGER is not defined.
7669 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7670 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7671 source files not surprisingly expected syssignal.h to define, or
7672 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7673 Include <sys/ioctl.h>, for FIONREAD.
7674 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7675 This eliminates a problem whereby other files mysteriously had
7676 to include "syssignal.h" before including "systty.h" if they
7677 wanted to use "#ifdef SIGIO".
7678
7679 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7680
7681 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7682
7683 * w32.c (sigemptyset): Empty the set.
7684 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7685
7686 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7687
7688 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7689
7690 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7691 (mark_object): Likewise for frame objects.
7692
7693 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7694
7695 * syssignal.h (handle_on_main_thread): Always declare,
7696 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7697 This ports to platforms without HAVE_PTHREAD.
7698
7699 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 Signal-handler cleanup (Bug#12327).
7702 Emacs's signal handlers were written in the old 4.2BSD style with
7703 sigblock and sigmask and so forth, and this led to some
7704 inefficiencies and confusion. Rewrite these to use
7705 pthread_sigmask etc. without copying signal sets around. Also,
7706 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7707 'signal', and instead use functions that do not attempt to take
7708 over the system name space. This patch causes Emacs's text
7709 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7710 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7711 Do not include <signal.h> or "syssignal.h", as these
7712 modules do not use signals.
7713 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7714 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7715 Do not include <signal.h>, as "syssignal.h" does that for us now.
7716 * atimer.c (sigmask_atimers): New function.
7717 (block_atimers, unblock_atimers): New functions,
7718 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7719 All uses replaced.
7720 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7721 no longer needed here.
7722 * emacs.c (main): Inspect existing signal handler with sigaction,
7723 so that there's no need to block and unblock SIGHUP.
7724 * sysdep.c (struct save_signal): New member 'action', replacing
7725 old member 'handler'.
7726 (save_signal_handlers, restore_signal_handlers):
7727 Use sigaction instead of 'signal' to save and restore.
7728 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7729 New function. All users of 'signal' modified to use set_sighandler
7730 if they're writeonly, and to use sys_signal if they're read+write.
7731 (emacs_sigaction_init, forwarded_signal): New functions.
7732 (sys_signal): Remove. All uses replaced by calls to sigaction
7733 and emacs_sigaction_init, or by direct calls to 'signal'.
7734 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7735 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7736 all uses replaced by pthread_sigmask etc. calls.
7737 * syssignal.h: Include <signal.h>.
7738 (emacs_sigaction_init, forwarded_signal): New decls.
7739 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7740 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7741 (sigmask, sys_sigmask): Remove; no longer needed.
7742 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7743 (sigblock, sigunblock, sigfree):
7744 (sigsetmask) [!defined sigsetmask]:
7745 Remove. All uses replaced by pthread_sigmask.
7746 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7747 no longer need to be replaced, and its typical old uses
7748 are now done via emacs_sigaction_init and sigaction.
7749 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7750 (sys_sigdel): Remove; unused.
7751 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7752
7753 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7754
7755 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7756 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7757
7758 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7759
7760 Explicitly mark buffer_defaults and buffer_local_symbols.
7761 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7762 mark_local_symbols here.
7763 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7764 since special buffers aren't marked here any more.
7765 (allocate_buffer): Chain new buffer with all_buffers here...
7766 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7767 not here.
7768 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7769 (syms_of_buffer): Remove staticpro of the above.
7770 (init_buffer_once): Set names for buffer_defaults and
7771 buffer_local_symbols.
7772
7773 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7774
7775 Use bool for booleans in font-related modules.
7776 * font.c (font_intern_prop, font_style_to_value)
7777 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7778 (generate_otf_features, font_check_otf_features, font_check_otf)
7779 (font_match_p, font_list_entities, font_at):
7780 * fontset.c (fontset_id_valid_p, reorder_font_vector
7781 (fontset_find_font, Fset_fontset_font)
7782 (face_suitable_for_char_p) [0]:
7783 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7784 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7785 (m17n_flt_initialized, ftfont_shape_by_flt):
7786 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7787 * nsfont.m (nsfont_draw):
7788 * w32font.c (w32font_draw):
7789 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7790 Use bool for booleans.
7791 * font.h: Adjust to above API changes.
7792 (struct font, struct font_driver, struct font_driver_list):
7793 Use bool for booleans.
7794 (struct font): Remove useless member encoding_type.
7795 All users removed.
7796 * fontset.c, xftfont.c: Omit unnecessary static decls.
7797
7798 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7799
7800 * alloc.c (mark_object): Revert window marking code
7801 since it's unsafe for the Fset_window_configuration.
7802
7803 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 Fix race conditions with signal handlers and errno (Bug#12327).
7806 Be more systematic about preserving errno whenever a signal
7807 handler returns, even if it's not in the main thread. Do this by
7808 renaming signal handlers to distinguish between signal delivery
7809 and signal handling. All uses changed.
7810 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7811 * data.c (deliver_arith_signal): Rename from arith_error.
7812 * dispnew.c (deliver_window_change_signal): Rename from
7813 window_change_signal.
7814 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7815 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7816 * keyboard.c (deliver_input_available_signal): Rename from
7817 input_available_signal.
7818 (deliver_user_signal): Rename from handle_user_signal.
7819 (deliver_interrupt_signal): Rename from interrupt_signal.
7820 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7821 (deliver_child_signal): Rename from sigchld_handler.
7822 * atimer.c (handle_alarm_signal):
7823 * data.c (handle_arith_signal):
7824 * dispnew.c (handle_window_change_signal):
7825 * emacs.c (handle_fatal_signal, handle_danger_signal):
7826 * keyboard.c (handle_input_available_signal):
7827 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7828 * process.c (handle_pipe_signal, handle_child_signal):
7829 New functions, with the actual signal-handling code taken from the
7830 original respective signal handlers, sans the sporadic attempts to
7831 preserve errno, since that's now done by handle_on_main_thread.
7832 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7833 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7834 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7835 Move to sysdep.c.
7836 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7837 Move initialization of main_thread to sysdep.c's init_signals.
7838 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7839 our usage, and simplifies the mainline code.
7840 (record_child_status_change): New static function, as a helper
7841 for handle_child_signal, and with most of the old child handler's
7842 contents.
7843 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7844 (handle_child_signal): Use the above.
7845 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7846 Moved here from emacs.c.
7847 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7848 code moved here from emacs.c's main function.
7849 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7850 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7851 This lets callers save and restore errno properly.
7852
7853 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7854
7855 Remove redundant or unused things here and there.
7856 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7857 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7858 * editfns.c (Fcompare_buffer_substrings): Likewise.
7859 * frame.h (struct terminal, struct font_driver_list):
7860 Remove redundant declarations.
7861 * window.h (Qleft, Qright): Likewise.
7862
7863 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7864
7865 Do not mark objects from deleted buffers, windows and frames.
7866 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7867 (mark_object): Likewise for windows and frames.
7868
7869 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7870
7871 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7872 buffer_defaults and buffer_local_symbols as valid objects.
7873 Return special value to denote them.
7874
7875 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7876
7877 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7878 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7879 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7880 (file_name_absolute_p, Fsubstitute_in_file_name):
7881 (check_executable, check_writable, Ffile_accessible_directory_p)
7882 (Fset_file_selinux_context, Fdefault_file_modes)
7883 (Finsert_file_contents, choose_write_coding_system)
7884 (Fwrite_region, build_annotations, a_write, e_write)
7885 (Fdo_auto_save):
7886 * filelock.c (boot_time_initialized, get_boot_time)
7887 (get_boot_time_1, lock_file_1, within_one_second):
7888 * floatfns.c (in_float):
7889 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7890 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7891 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7892 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7893 * window.c (compare_window_configurations):
7894 Use bool for booleans.
7895 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7896 (Fdefault_file_modes): Now mode_t, not int, for modes.
7897 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7898 (internal_delete_file): Now returns void, not a (boolean) int,
7899 since nobody was looking at the return value.
7900 * lisp.h, window.h: Adjust to above API changes.
7901
7902 * xdisp.c (set_message): Simplify and reindent last change.
7903
7904 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7905
7906 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7907
7908 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7909
7910 * eval.c (call_debugger): Make the function non-static so that we
7911 can call it from set_message.
7912
7913 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7914 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7915
7916 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7917
7918 Give more-useful info on a fatal error (Bug#12328).
7919 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7920 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7921 of doing the work ourselves.
7922 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7923 do most of the work.
7924 (fatal_error_backtrace): New function, taken from the guts
7925 of the old fatal_error_signal, but with a new option to output
7926 a backtrace.
7927 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7928 info about the signal than just its number.
7929 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7930 * sysdep.c: Include <execinfo.h>
7931 (emacs_backtrace): New function, taken partly from the previous
7932 code of the 'die' function.
7933 (emacs_abort): Call fatal_error_backtrace rather than abort.
7934
7935 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7936
7937 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7938 eager (load-time) macro-expansion.
7939 * lisp.mk (lisp): Add macroexp.
7940
7941 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 Simplify redefinition of 'abort' (Bug#12316).
7944 Do not try to redefine the 'abort' function. Instead, redo
7945 the code so that it calls 'emacs_abort' rather than 'abort'.
7946 This removes the need for the NO_ABORT configure-time macro
7947 and makes it easier to change the abort code to do a backtrace.
7948 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7949 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7950 Remove; sysdep.c's emacs_abort now takes its place.
7951 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7952 'abort' changed to use 'emacs_abort'.
7953 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7954 (abort) [!defined abort]: Rename to ...
7955 (emacs_abort): ... new name.
7956 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7957 the place of the old 'abort' in emacs.c.
7958 * w32.c, w32fns.c (abort): Do not #undef.
7959 * w32.c (emacs_abort): Rename from w32_abort.
7960
7961 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7962
7963 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7964 offsets[j].dv, since the y axis of the screen coordinates points
7965 down, while the y axis of the font definition coordinates points
7966 up. This fixes display of Arabic diacritics such as KASRA and
7967 KASRATAN. (Bug#11860)
7968
7969 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7970
7971 Be more systematic about _setjmp vs setjmp.
7972 * alloc.c (test_setjmp, mark_stack):
7973 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7974 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7975 (png_load, my_error_exit, jpeg_load):
7976 * process.c (send_process_trap, send_process):
7977 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7978 The underscored versions are up to 30x faster on some hosts.
7979 Formerly, the code used setjmp+longjmp sometimes and
7980 _setjmp+_longjmp at other times, with no particular reason to
7981 prefer setjmp+longjmp.
7982
7983 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7984
7985 Fix minor problem found by static checking.
7986 * buffer.c (Fdelete_all_overlays): Return nil.
7987
7988 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7989
7990 * buffer.c (Fdelete_all_overlays): New function.
7991
7992 2012-09-03 Chong Yidong <cyd@gnu.org>
7993
7994 * gtkutil.c: Add extern decl for Qxft.
7995
7996 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7997
7998 * emacs.c, eval.c: Use bool for boolean.
7999 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
8000 (malloc_using_checking) [DOUG_LEA_MALLOC]:
8001 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
8002 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8003 (main, decode_env_path, Fdaemon_initialized):
8004 * eval.c (call_debugger, Finteractive_p, interactive_p):
8005 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
8006 (maybe_call_debugger, Fbacktrace):
8007 * process.c (read_process_output, exec_sentinel):
8008 Use bool for booleans.
8009 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8010 All callers changed.
8011 * eval.c (interactive_p): Omit always-true boolean argument
8012 EXCLUDE_SUBRS_P. All callers changed.
8013 * dispextern.h, lisp.h: Reflect above API changes.
8014 * firstfile.c (dummy): Use the address of 'main', whose signature
8015 won't change, instead of the address of 'initialize', whose
8016 signature just changed from int to bool.
8017 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8018 * msdos.c (fatal_error_in_progress): ... from here.
8019 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8020 of incrementing it.
8021 (redisplay_internal, unwind_redisplay): Simply clear
8022 REDISPLAYING_P when unwinding, instead of saving its previous,
8023 always-false value and then restoring it.
8024
8025 Clean up some extern decls.
8026 Mostly, this hoists extern decls out of .c files and into .h files.
8027 That way, we're more likely to catch errors if the interfaces change.
8028 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8029 declare xg_mark_data.
8030 * dispextern.h (x_frame_parm_handlers):
8031 * font.h (Qxft):
8032 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8033 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8034 (Qultra_bold, Qoblique, Qitalic):
8035 Move extern decl here from .c file.
8036 * alloc.c (xg_mark_data) [USE_GTK]:
8037 * doc.c (Qclosure):
8038 * eval.c (Qlexical_binding):
8039 * fns.c (time) [!HAVE_UNISTD_H]:
8040 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8041 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8042 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8043 * lread.c (Qinternal_interpreter_environment):
8044 * minibuf.c (Qbuffer):
8045 * process.c (QCfamily, QCfilter):
8046 * widget.c (free_frame_faces):
8047 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8048 * xfont.c (x_clear_errors):
8049 * xterm.c (x_frame_parm_handlers):
8050 Remove now-redundant extern decls.
8051 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8052 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8053 Now static.
8054 * xfaces.c: Remove unnecessary static decls.
8055 * xterm.c (updating_frame): Remove decl of nonexistent object.
8056
8057 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8058 when building globals.h, as the objects that are not built on
8059 this host are not needed to compile C files on this host.
8060
8061 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8062
8063 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8064
8065 * frame.h: Add missing prototype for x_wm_set_size_hint.
8066
8067 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8068
8069 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8070 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8071 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8072 (Fsubstitute_command_keys):
8073 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8074 (save_excursion_save, save_excursion_restore)
8075 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8076 (format_time_string, general_insert_function)
8077 (make_buffer_string, make_buffer_string_both)
8078 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8079 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8080 (copy_text, insert_1, insert_1_both, insert_from_string)
8081 (insert_from_string_before_markers, insert_from_string_1)
8082 (insert_from_buffer, insert_from_buffer_1, replace_range)
8083 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8084 (del_range_2, modify_region):
8085 * intervals.c (intervals_equal, balance_possible_root_interval)
8086 (adjust_intervals_for_insertion, merge_properties_sticky)
8087 (graft_intervals_into_buffer, lookup_char_property)
8088 (adjust_for_invis_intang, set_point_both)
8089 (get_property_and_range, compare_string_intervals)
8090 (set_intervals_multibyte_1, set_intervals_multibyte):
8091 * keyboard.c (decode_timer):
8092 Use bool for boolean.
8093 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8094 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8095
8096 2012-09-02 Chong Yidong <cyd@gnu.org>
8097
8098 * keymap.c (push_key_description): Print M-TAB as C-M-i
8099 (Bug#11758).
8100
8101 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
8102
8103 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8104 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8105 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8106 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8107 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8108 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8109 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8110
8111 2012-09-01 Eli Zaretskii <eliz@gnu.org>
8112
8113 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8114 more than one grapheme cluster passed to the shaper: compute the
8115 offset adjustment values separately for each cluster. (Bug#11860)
8116
8117 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8118 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8119 about implicit conversions from integer to pointer.
8120
8121 2012-09-01 Daniel Colascione <dancol@dancol.org>
8122
8123 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8124 system used too early.
8125
8126 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8127
8128 Better seed support for (random).
8129 * emacs.c (main): Call init_random.
8130 * fns.c (Frandom): Set the seed from a string argument, if given.
8131 Remove long-obsolete Gentzel cruft.
8132 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8133 (init_random): New function.
8134
8135 2012-09-01 Daniel Colascione <dancol@dancol.org>
8136
8137 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8138 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8139 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8140 x_wm_set_size_hint, x_query_colors, x_real_positions,
8141 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8142 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8143 all of which have been moved to common code.
8144
8145 * xfaces.c: Include TERM_HEADER instead of listing all possible
8146 window-system headers.
8147
8148 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8149 to match header.
8150
8151 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8152 directly accessing frame internals.
8153
8154 * w32font.h: Include font.h. Define syms_of_w32font and
8155 globals_of_w32font.
8156
8157 * process.c: Include TERM_HEADER instead of listing all possible
8158 window-system headers.
8159
8160 * nsterm.h: Remove declarations now in frame.h.
8161 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8162
8163 * menu.c: Include TERM_HEADER instead of listing all possible
8164 window-system headers.
8165
8166 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8167 window system.
8168
8169 * keyboard.c: Include TERM_HEADER instead of listing all possible
8170 window-system headers.
8171
8172 * image.c: Include TERM_HEADER instead of listing all possible
8173 window-system headers. Declare Vlibrary_cache when compiling for
8174 Windows.
8175
8176 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8177 window system declarations.
8178
8179 * frame.h: Move common functions here: set_frame_menubar,
8180 x_set_window_size, x_sync, x_get_focus_frame,
8181 x_set_mouse_position, x_set_mouse_pixel_position,
8182 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8183 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8184 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8185 x_activate_menubar, x_real_positions, x_bitmap_icon,
8186 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8187 and x_query_colors.
8188
8189 * frame.c: Include TERM_HEADER instead of listing all possible
8190 window-system headers.
8191
8192 * font.c: Include TERM_HEADER instead of listing all possible
8193 window-system headers.
8194
8195 * emacs.c: Include TERM_HEADER.
8196
8197 * dispnew.c: Include TERM_HEADER instead of listing all possible
8198 window-system headers.
8199
8200 * ccl.h: Include character.h.
8201
8202 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8203 the current window system; include in list of objects to link into
8204 Emacs.
8205
8206 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8207
8208 Remove mark_ttys function and fix tty_display_info initialization.
8209 * lisp.h (mark_ttys): Remove prototype.
8210 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8211 to mark_ttys because all possible values of 'top_frame' slot are
8212 the frames which are reachable from Vframe_list.
8213 * term.c (mark_ttys): Remove.
8214 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8215
8216 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8217
8218 Change struct frame bitfields from unsigned char to unsigned.
8219 * frame.h (struct frame): Change type of 'display_preempted',
8220 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8221 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8222 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8223 bitfields from unsigned char to unsigned.
8224
8225 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8226
8227 Remove unused member of struct x_output and struct w32_output.
8228 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8229 * w32term.h (struct w32_output): Likewise.
8230
8231 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8232
8233 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8234 does not become zero (Bug#12234).
8235
8236 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8239 for GCC 4.7.1 x86-64.
8240
8241 2012-08-30 Glenn Morris <rgm@gnu.org>
8242
8243 * lread.c (init_lread): For out-of-tree builds, only add the
8244 source directory's site-lisp dir to the load-path if it exists,
8245 consistent with in-tree builds. (Bug#12302)
8246
8247 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8248
8249 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8250 button_values to NULL. Call setStykeMask so dialogs get a close button.
8251 (windowShouldClose:): Set window_closed.
8252 (dealloc): New member, free button_values.
8253 (process_dialog:): Make member function. Remove window argument,
8254 replace window with self. Count buttons and allocate and store values
8255 in button_values.
8256 (addButton:value:row:): value is int with the name tag. Call setTag
8257 with tag. Remove return self, declare return value as void.
8258 (addString:row:): Remove return self, declare return value as void.
8259 (addSplit): Remove return self, declare return value as void.
8260 (clicked:): Remove return self, declare return value as void.
8261 Set dialog_return to button_values[seltag]. Code formatting change.
8262 (initFromContents:isQuestion:): Adjust call to process_dialog.
8263 Code formatting change.
8264 (timeout_handler:): Set timer_fired to YES.
8265 (runDialogAt:): Set timer_fired to NO.
8266 Handle click on close button as quit.
8267
8268 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8269 Add window_closed and button_values. Add void as return value for
8270 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8271 Add process_dialog as new member.
8272
8273 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8274
8275 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8276 is not one of the heaps we manage. (Bug#12242)
8277
8278 2012-08-28 Glenn Morris <rgm@gnu.org>
8279
8280 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8281
8282 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8283
8284 * window.c (Fset_window_configuration): Remove handling of
8285 auto-buffer-name window parameter. Install revision of reverted
8286 fix.
8287
8288 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8289
8290 Do not allow to set major mode for a dead buffer.
8291 * buffer.c (Fset_buffer_major_mode): Signal an error
8292 if the buffer is dead.
8293 (Fother_buffer, other_buffer_safely): Remove redundant
8294 nested declaration.
8295
8296 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8297
8298 Always use set_buffer_if_live to restore original buffer at unwind.
8299 * buffer.h (record_unwind_current_buffer): New function.
8300 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8301 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8302 * undo.c, window.c: Adjust users.
8303 * buffer.c (set_buffer_if_live): Fix comment.
8304
8305 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8306
8307 Fix usage of set_buffer_internal.
8308 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8309 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8310 * coding.c (decode_coding): Omit redundant test.
8311 * fileio.c (decide_coding_unwind): Likewise.
8312 * fns.c (secure_hash): Likewise.
8313 * insdel.c (modify_region): Likewise.
8314 * keyboard.c (command_loop_1): Likewise.
8315 * print.c (PRINTFINISH): Likewise.
8316 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8317
8318 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8319
8320 * dispnew.c: Use bool for boolean.
8321 (frame_garbaged, display_completed, delayed_size_change)
8322 (fonts_changed_p, add_window_display_history)
8323 (add_frame_display_history, verify_row_hash)
8324 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8325 (row_equal_p, realloc_glyph_pool)
8326 (allocate_matrices_for_frame_redisplay)
8327 (showing_window_margins_p)
8328 (adjust_frame_glyphs_for_frame_redisplay)
8329 (build_frame_matrix_from_leaf_window, make_current)
8330 (mirrored_line_dance, mirror_line_dance, update_frame)
8331 (update_window_tree, update_single_window)
8332 (check_current_matrix_flags, update_window, update_text_area)
8333 (update_window_line, set_window_update_flags, scrolling_window)
8334 (update_frame_1, scrolling, buffer_posn_from_coords)
8335 (do_pending_window_change, change_frame_size)
8336 (change_frame_size_1, sit_for):
8337 Use bool for boolean.
8338 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8339 and remove last int (actually boolean) argument, which was always 0.
8340 All callers changed.
8341 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8342 * dispextern.h (struct composition_it): Use bool for boolean.
8343 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8344 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8345 * dired.c (file_name_completion):
8346 Use bool for boolean. (This was missed in an earlier change.)
8347
8348 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8349
8350 * window.c (Fset_window_configuration): Revert first part of
8351 last change.
8352
8353 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8354
8355 * nsterm.h (NSPanel): New class variable dialog_return.
8356
8357 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8358 Initialize dialog_return.
8359 (windowShouldClose:): Use stop instead of stopModalWithCode.
8360 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8361 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8362 event.
8363 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8364 modal loop returns.
8365
8366 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8367
8368 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8369 * composite.c (find_composition, composition_gstring_p)
8370 (composition_reseat_it, find_automatic_composition):
8371 * data.c (let_shadows_buffer_binding_p)
8372 (let_shadows_global_binding_p, set_internal, make_blv)
8373 (Fmake_variable_buffer_local, Fmake_local_variable)
8374 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8375 (cons_to_signed, arith_driver):
8376 * dbusbind.c (xd_in_read_queued_messages):
8377 * dired.c (directory_files_internal, file_name_completion):
8378 Use bool for booleans.
8379 * dired.c (file_name_completion):
8380 * process.h (fd_callback):
8381 Omit int (actually boolean) argument. It wasn't being used.
8382 All uses changed.
8383 * composite.h, lisp.h: Reflect above API changes.
8384
8385 * cmds.c, coding.c: Use bool for booleans.
8386 * cmds.c (move_point, Fself_insert_command):
8387 * coding.h (struct composition status, struct coding_system):
8388 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8389 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8390 (emacs_mule_char, decode_coding_emacs_mule)
8391 (encode_coding_emacs_mule, detect_coding_iso_2022)
8392 (decode_coding_iso_2022, encode_invocation_designation)
8393 (encode_designation_at_bol, encode_coding_iso_2022)
8394 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8395 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8396 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8397 (encode_coding_raw_text, detect_coding_charset)
8398 (decode_coding_charset, encode_coding_charset, detect_eol)
8399 (detect_coding, get_translation_table, produce_chars)
8400 (consume_chars, reused_workbuf_in_use)
8401 (make_conversion_work_buffer, code_conversion_save)
8402 (decode_coding_object, encode_coding_object)
8403 (detect_coding_system, char_encodable_p)
8404 (Funencodable_char_position, code_convert_region)
8405 (code_convert_string, code_convert_string_norecord)
8406 (Fset_coding_system_priority):
8407 * fileio.c (Finsert_file_contents):
8408 Use bool for booleans.
8409 * coding.h, lisp.h: Reflect above API changes.
8410 * coding.c: Remove unnecessary static function decls.
8411 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8412 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8413 not a boolean 'int', since callers never look at the return value.
8414 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8415 * coding.h (decoding_buffer_size, encoding_buffer_size)
8416 (emacs_mule_string_char): Remove unused extern decls.
8417 (struct iso_2022_spec, struct coding_system):
8418 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8419 (struct emacs_mule_spec): Remove unused field 'full_support'.
8420 All initializations removed.
8421 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8422
8423 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8424
8425 Fix spare memory change (Bug#12286).
8426 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8427 (valid_lisp_object_p): Likewise.
8428
8429 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8430
8431 * window.c (Fset_window_configuration): Record any window's old
8432 buffer if it's replaced (see Bug#8789). If the new current
8433 buffer doesn't appear in the selected window, go to its old
8434 point (Bug#12208).
8435
8436 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8437
8438 Special MEM_TYPE_SPARE to denote reserved memory.
8439 * alloc.c (enum mem_type): New memory type.
8440 (refill_memory_reserve): Use new type for spare memory.
8441 This prevents live_cons_p and live_string_p from incorrect
8442 detection of uninitialized objects from spare memory as live.
8443
8444 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8445
8446 Spelling fixes.
8447 * Makefile.in (.PHONY): versioclean -> versionclean.
8448
8449 Remove unused external symbols.
8450 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8451 * window.c (Qwindow_valid_p, decode_valid_window):
8452 Now static, not extern.
8453 * data.c (Qinterval): Remove; unused.
8454 (syms_of_data): Do not define 'interval'.
8455 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8456 * window.h (decode_valid_window):
8457 Remove decls.
8458
8459 * character.c, charset.c, chartab.c: Use bool for booleans.
8460 * character.c (lisp_string_width, string_count_byte8)
8461 (string_escape_byte8):
8462 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8463 (load_charset_map_from_file, map_charset_chars)
8464 (Fdefine_charset_internal, define_charset_internal)
8465 (Fdeclare_equiv_charset, find_charsets_in_text)
8466 (Ffind_charset_region, char_charset, Fiso_charset):
8467 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8468 (sub_char_table_set, sub_char_table_set_range)
8469 (char_table_set_range, optimize_sub_char_table)
8470 (map_sub_char_table):
8471 Use bool for boolean.
8472 * character.c (str_to_unibyte): Omit last boolean argument; it was
8473 always 0. All callers changed.
8474 * character.h, charset.h: Adjust to match previous changes.
8475 * character.h (char_printable_p): Remove decl of nonexistent function.
8476 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8477 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8478 are all boolean, so make them single-bit bitfields.
8479
8480 * lisp.h (ASET): Remove attempt to detect side effects.
8481 It was meant to be temporary and it often doesn't work,
8482 because when IDX has side effects the behavior of IDX==IDX
8483 is undefined. See Stefan Monnier in
8484 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8485
8486 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8487
8488 * lisp.h (functionp): New function (extracted from Ffunctionp).
8489 (FUNCTIONP): Use it.
8490 * eval.c (Ffunctionp): Use it.
8491
8492 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8495 as that's faster and simpler than static storage. Don't bother
8496 with the g_main_context_query overhead if g_main_context_pending
8497 says no events are pending.
8498 (gfds, gfds_size): Remove these static vars.
8499 (xgselect_initialize): Remove; no longer needed.
8500 All uses and decls removed.
8501
8502 * emacs.c (fatal_error_signal_hook): Remove.
8503 All uses removed. This leftover from old code was always 0.
8504
8505 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8506 * casefiddle.c (casify_object, casify_region):
8507 * casetab.c (set_case_table):
8508 * category.c, category.h (word_boundary_p):
8509 * category.h (CHAR_HAS_CATEGORY):
8510 Use bool for booleans, instead of int.
8511
8512 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8513
8514 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8515
8516 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 On assertion failure, print backtrace if available.
8519 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8520 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8521 * Makefile.in (LIB_EXECINFO): New macro.
8522 (LIBES): Use it.
8523
8524 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8525 * bytecode.c (exec_byte_code):
8526 * callint.c (check_mark, Fcall_interactively):
8527 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8528 (getenv_internal, sync_process_alive, call_process_exited):
8529 * lisp.h (USE_SAFE_ALLOCA):
8530 Use bool for booleans, instead of int.
8531 * lisp.h, process.h: Adjust prototypes to match above changes.
8532 * callint.c (Fcall_interactively): Don't assume the mark's
8533 offset fits in 'int'.
8534
8535 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8536
8537 * buffer.c, buffer.h: Use bool for boolean.
8538 * buffer.c (reset_buffer_local_variables)
8539 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8540 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8541 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8542 (overlay_touches_p, overlay_strings, Foverlay_put)
8543 (report_overlay_modification, call_overlay_mod_hooks):
8544 (mmap_enlarge, mmap_set_vars):
8545 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8546 Use bool for booleans, instead of int.
8547 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8548 since the 1-or-0 return value is always ignored anyway.
8549 (mmap_initialized_p):
8550 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8551 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8552
8553 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 * bidi.c: Use bool for boolean.
8556 This is a bit more readable, and makes the text segment of bidi.o
8557 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8558 Presumably it's faster too.
8559 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8560 Now bool.
8561 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8562 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8563 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8564 (bidi_explicit_dir_char, bidi_level_of_next_char)
8565 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8566 Use bool for booleans, instead of int.
8567 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8568 (bidi_unshelve_cache): Adjust decls to match code.
8569
8570 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8571
8572 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8573 argument.
8574
8575 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8576
8577 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8578 * atimer.h: Include <stdbool.h>.
8579
8580 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8581
8582 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8583 compile time tests instead of run time tests on systems that do
8584 not use them.
8585 (FRAME_MAC_P): Remove leftover from deleted code.
8586 * frame.c (syms_of_frame): Remove leftover from deleted code.
8587
8588 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8589
8590 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8591
8592 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8593
8594 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8595 Otherwise, the compiler complains about (A?B:C) where B is void
8596 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8597 (fontset_add): Return void, for FONTSET_ADD.
8598
8599 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8600
8601 * alloc.c: Use bool for booleans.
8602 (gc_in_progress, abort_on_gc)
8603 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8604 (dont_register_blocks) [GC_MALLOC_CHECK]:
8605 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8606 (check_string_bytes, make_specified_string, memory_full)
8607 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8608 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8609 (mark_stack, valid_pointer_p, make_pure_string)
8610 (Fgarbage_collect, survives_gc_p, gc_sweep):
8611 Use bool for booleans, instead of int.
8612 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8613 Remove unused local.
8614 * alloc.c (PURE_POINTER_P):
8615 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8616 * editfns.c (Fformat):
8617 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8618 (Fdo_auto_save):
8619 * fns.c (sweep_weak_table):
8620 * lisp.h (suppress_checking, push_message, survives_gc_p)
8621 (make_pure_string, gc_in_progress, abort_on_gc):
8622 * lread.c (readchar, read1):
8623 * print.c (Fprin1_to_string):
8624 * xdisp.c (push_message):
8625 Use bool for booleans affected directly or indirectly by
8626 alloc.c's changes.
8627
8628 Make recently-introduced setters macros.
8629 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8630 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8631 (set_fontset_default, set_fontset_fallback): Rename from their
8632 upper-case counterparts, and make them functions rather than macros.
8633 This is more consistent with the other recently-introduced setters.
8634 These don't need to be inline, since they're local.
8635
8636 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8637
8638 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8639 the loop (Bug#12247).
8640
8641 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8642
8643 * lisp.h (vcopy): Use memcpy rather than our own loop.
8644 This fixes a performance regression introduced by the recent
8645 addition of vcopy. This means 'vcopy' will need to be modified
8646 for a copying collector, but that's OK. Also, tighten the
8647 checking in the assertion.
8648
8649 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8650
8651 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8652 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8653 non-base glyph for the width of the base character, according to
8654 what x_draw_composite_glyph_string_foreground expects.
8655 Generate WADJUST value according to composition_gstring_width's
8656 expectations, to produce correct width of the composed character.
8657 Reverse the sign of the DU offset produced by ScriptPlace.
8658
8659 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8660
8661 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8662
8663 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8664
8665 Avoid direct writes to contents member of struct Lisp_Vector.
8666 * lisp.h (vcopy): New function to copy data into vector.
8667 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8668 * fns.c (Ffillarray): Use ASET.
8669 * keyboard.c (timer_check_2): Use AREF and ASET.
8670 (append_tool_bar_item, Frecent_keys): Use vcopy.
8671 * lread.c (read_vector): Use ASET.
8672 * msdos.c (Frecent_doskeys): Use vcopy.
8673 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8674 (Finternal_merge_in_global_face): Use ASET and vcopy.
8675 * xfont.c (xfont_list_pattern): Likewise.
8676
8677 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8678
8679 * window.c (Fwindow_point): For the selected window always return
8680 the position of its buffer's point.
8681 (Fset_window_point): For the selected window always go in its
8682 buffer to the specified position.
8683
8684 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8685
8686 Setter macros for fontsets.
8687 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8688 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8689 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8690 Adjust users.
8691
8692 2012-08-20 Glenn Morris <rgm@gnu.org>
8693
8694 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8695 Don't assume that `ln -f' works.
8696
8697 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8698
8699 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8700 and later about non-assignments with no effect. See discussion at
8701 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8702 details.
8703
8704 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8705
8706 Inline setter functions for Lisp_Objects slots of struct specbinding.
8707 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8708 Adjust users.
8709
8710 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8711
8712 * window.c (select_window): Always make selected window's buffer
8713 current.
8714
8715 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8716
8717 Use AREF and ASET for docstrings of category tables.
8718 * category.h (CATEGORY_DOCSTRING): Use AREF.
8719 (SET_CATEGORY_DOCSTRING): Use ASET.
8720 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8721
8722 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8723
8724 Inline setter functions for hash table members.
8725 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8726 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8727 (set_hash_key_and_value, set_hash_index, set_hash_next)
8728 (set_hash_hash): New functions.
8729 * charset.c, fns.c: Adjust users.
8730
8731 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8732
8733 Inline getter and setter functions for per-buffer values.
8734 * buffer.h (per_buffer_default, set_per_buffer_default)
8735 (per_buffer_value, set_per_buffer_value): New functions.
8736 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8737 * buffer.c, data.c: Adjust users.
8738
8739 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8740
8741 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8742
8743 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8744
8745 Rely on <config.h> + <unistd.h> to declare 'environ',
8746 as gnulib does this if the system doesn't.
8747 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8748 Remove declaration. MS-Windows declares it on stdlib.h which is
8749 included by conf_post.h.
8750 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8751 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8752 * vm-limit.c: Include <unistd.h>, for 'environ'.
8753
8754 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8755 (start_of_data): Remove decl; mem-limits.h provides it.
8756
8757 * xdisp.c (handle_invisible_prop): Make it a bit faster
8758 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8759
8760 2012-08-19 Chong Yidong <cyd@gnu.org>
8761
8762 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8763 ends (Bug#3874).
8764
8765 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8766
8767 * .gdbinit: Use call instead of set when calling a function in the
8768 inferior.
8769
8770 * data.c (set_internal): Don't use set_blv_found.
8771 (Fkill_local_variable): Likewise.
8772
8773 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8774
8775 * nsfont.m (ns_ascii_average_width): Ensure the string
8776 ascii_printable is initialized with a null-terminated character
8777 array. Otherwise, it can contain undesired extra characters.
8778
8779 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8780
8781 port new setting code to Sun C 5.8 2005/10/13
8782 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8783 Return void, not Lisp_Object. Otherwise, the compiler
8784 complains about (A?B:C) where B is void and C is Lisp_Object
8785 when compiling CHAR_TABLE_SET, due to the recent change to
8786 the API of sub_char_table_set_contents.
8787
8788 2012-08-18 Chong Yidong <cyd@gnu.org>
8789
8790 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8791 for the string case (Bug#3874).
8792
8793 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8794
8795 * buffer.h (BSET): Remove (Bug#12215).
8796 Replace all uses with calls to new setter functions.
8797 (bset_bidi_paragraph_direction, bset_case_canon_table)
8798 (bset_case_eqv_table, bset_directory, bset_display_count)
8799 (bset_display_time, bset_downcase_table)
8800 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8801 (bset_last_selected_window, bset_local_var_alist)
8802 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8803 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8804 (bset_width_table):
8805 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8806 (bset_auto_fill_function, bset_auto_save_file_format)
8807 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8808 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8809 (bset_cache_long_line_scans, bset_case_fold_search)
8810 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8811 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8812 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8813 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8814 (bset_header_line_format, bset_indicate_buffer_boundaries)
8815 (bset_indicate_empty_lines, bset_invisibility_spec)
8816 (bset_left_fringe_width, bset_major_mode, bset_mark)
8817 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8818 (bset_name, bset_overwrite_mode, bset_pt_marker)
8819 (bset_right_fringe_width, bset_save_length)
8820 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8821 (bset_scroll_up_aggressively, bset_selective_display)
8822 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8823 (bset_word_wrap, bset_zv_marker):
8824 * category.c (bset_category_table):
8825 * syntax.c (bset_syntax_table):
8826 New setter functions.
8827
8828 * process.h (PSET): Remove (Bug#12215).
8829 Replace all uses with calls to new setter functions.
8830 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8831 (PROCESS_INLINE): New macro.
8832 (pset_childp): New setter function.
8833 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8834 * process.c (PROCESS_INLINE):
8835 Define to EXTERN_INLINE, so that the corresponding functions
8836 are compiled into code.
8837 (pset_buffer, pset_command, pset_decode_coding_system)
8838 (pset_decoding_buf, pset_encode_coding_system)
8839 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8840 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8841 (pset_type, pset_write_queue): New setter functions.
8842
8843 * window.h (WSET): Remove (Bug#12215).
8844 Replace all uses with calls to new setter functions.
8845 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8846 (WINDOW_INLINE): New macro.
8847 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8848 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8849 (wset_total_lines, wset_vertical_scroll_bar)
8850 (wset_window_end_pos, wset_window_end_valid)
8851 (wset_window_end_vpos): New setter functions.
8852 * window.c (WINDOW_INLINE):
8853 Define to EXTERN_INLINE, so that the corresponding functions
8854 are compiled into code.
8855 (wset_combination_limit, wset_dedicated, wset_display_table)
8856 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8857 (wset_new_normal, wset_new_total, wset_next_buffers)
8858 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8859 (wset_prev_buffers, wset_right_fringe_width)
8860 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8861 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8862 (wset_window_parameters):
8863 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8864 (wset_column_number_displayed, wset_region_showing):
8865 New setter functions.
8866
8867 * termhooks.h (TSET): Remove (Bug#12215).
8868 Replace all uses with calls to new setter functions.
8869 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8870 (TERMHOOKS_INLINE): New macro.
8871 (tset_charset_list, tset_selection_alist): New setter functions.
8872 * terminal.c (TERMHOOKS_INLINE):
8873 Define to EXTERN_INLINE, so that the corresponding functions
8874 are compiled into code.
8875 (tset_param_alist): New setter function.
8876
8877 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8878
8879 * keyboard.h (KSET): Remove (Bug#12215).
8880 Replace all uses with calls to new setter functions.
8881 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8882 (KEYBOARD_INLINE): New macro.
8883 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8884 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8885 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8886 New setter functions.
8887 * keyboard.c (KEYBOARD_INLINE):
8888 Define to EXTERN_INLINE, so that the corresponding functions
8889 are compiled into code.
8890 (kset_echo_string, kset_kbd_queue)
8891 (kset_keyboard_translate_table, kset_last_prefix_arg)
8892 (kset_last_repeatable_command, kset_local_function_key_map)
8893 (kset_overriding_terminal_local_map, kset_real_last_command)
8894 (kset_system_key_syms): New setter functions.
8895
8896 * frame.h (FSET): Remove (Bug#12215).
8897 Replace all uses with calls to new setter functions.
8898 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8899 (FRAME_INLINE): New macro.
8900 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8901 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8902 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8903 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8904 (fset_param_alist, fset_root_window, fset_scroll_bars)
8905 (fset_selected_window, fset_title, fset_tool_bar_items)
8906 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8907 * frame.c (FRAME_INLINE):
8908 Define to EXTERN_INLINE, so that the corresponding functions
8909 are compiled into code.
8910 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8911
8912 A few more naming-convention fixes for getters and setters.
8913 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8914 and rename from buffer_overlays_set_before.
8915 (set_buffer_overlays_after): Move here from buffer.h, and rename
8916 from buffer_overlays_set_after.
8917 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8918 All uses changed.
8919 (set_buffer_intervals): Rename from buffer_set_intervals.
8920 * intervals.c (set_interval_object): Move here from intervals.h,
8921 and rename from interval_set_object.
8922 (set_interval_left): Move here from intervals.h, and rename from
8923 interval_set_left.
8924 (set_interval_right): Move here from intervals.h, and rename from
8925 interval_set_right.
8926 (copy_interval_parent): Move here from intervals.h, and rename from
8927 interval_copy_parent.
8928 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8929 (set_interval_plist): Rename from interval_set_plist.
8930 Return void, not Lisp_Object, since no caller uses the result.
8931 * lisp.h (string_intervals): Rename from string_get_intervals.
8932 (set_string_intervals): Rename from string_set_intervals.
8933
8934 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8935 (set_char_table_contents): Rename from char_table_set_contents.
8936 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8937 All uses changed. See the end of
8938 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8939
8940 * lisp.h (CSET): Remove (Bug#12215).
8941 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8942 (set_char_table_purpose): New functions,
8943 replacing CSET. All uses changed. For example, replace
8944 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8945 "set_char_table_parent (char_table, parent);".
8946 The old version was confusing because it used the same name
8947 'parent' for two different things.
8948
8949 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8950
8951 Functions to get and set Lisp_Object fields of buffer-local variables.
8952 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8953 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8954 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8955 * data.c, eval.c, frame.c: Adjust users.
8956
8957 2012-08-17 Chong Yidong <cyd@gnu.org>
8958
8959 * xfaces.c (merge_face_vectors): If the target font specfies a
8960 font spec, make the font's attributes take precedence over
8961 directly-specified attributes.
8962 (merge_face_ref): Recognize :font.
8963
8964 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8965
8966 Do not use memcpy for copying intervals.
8967 * intervals.c (reproduce_interval): New function.
8968 (reproduce_tree, reproduce_tree_obj): Use it.
8969 (reproduce_tree_obj): Remove prototype.
8970
8971 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8972
8973 * lisp.h (duration_to_sec_usec): Remove unused decl.
8974
8975 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8976
8977 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8978 to an allocated instance of NSString, not to the class itself.
8979
8980 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8981
8982 * makefile.w32-in (C_CTYPE_H): New macro.
8983 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8984 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8985 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8986
8987 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8988
8989 Use ASCII tests for character types.
8990 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8991 * xfns.c, xterm.c:
8992 Don't include <ctype.h>; was not needed.
8993 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8994 * sysdep.c, xfaces.c:
8995 Include <c-ctype.h> instead of <ctype.h>.
8996 * nsterm.m: Include <c-ctype.h>.
8997 * charset.c (read_hex):
8998 * doc.c (Fsnarf_documentation):
8999 * fileio.c (IS_DRIVE) [WINDOWSNT]:
9000 (DRIVE_LETTER) [DOS_NT]:
9001 (Ffile_name_directory, Fexpand_file_name)
9002 (Fsubstitute_in_file_name):
9003 * font.c (font_parse_xlfd, font_parse_fcname):
9004 * frame.c (x_set_font_backend):
9005 * gtkutil.c (xg_get_font):
9006 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
9007 * nsimage.m (hexchar):
9008 * nsterm.m (ns_xlfd_to_fontname):
9009 * sysdep.c (system_process_attributes):
9010 * xfaces.c (hash_string_case_insensitive):
9011 Use C-locale tests instead of locale-specific tests for character
9012 types, since we want the ASCII interpretation here, not the
9013 interpretation suitable for whatever happens to be the current locale.
9014
9015 2012-08-16 Martin Rudalics <rudalics@gmx.at>
9016
9017 Consistently check windows for validity/liveness
9018 (Bug#11984, Bug#12025, Bug#12026).
9019 * lisp.h (CHECK_VALID_WINDOW): New macro.
9020 * window.c (decode_window): Rename to decode_live_window.
9021 (decode_valid_window, Fwindow_valid_p): New functions.
9022 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9023 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9024 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9025 (Fwindow_prev_sibling, Fwindow_combination_limit)
9026 (Fset_window_combination_limit, Fwindow_use_time)
9027 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9028 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9029 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9030 (Fwindow_hscroll, Fset_window_hscroll)
9031 (Fwindow_redisplay_end_trigger)
9032 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9033 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9034 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9035 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9036 (Fwindow_end, Fset_window_point, Fset_window_start)
9037 (Fpos_visible_in_window_p, Fwindow_line_height)
9038 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9039 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9040 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9041 (Fset_window_parameter, Fwindow_display_table)
9042 (Fset_window_display_table, Fdelete_other_windows_internal)
9043 (Fset_window_buffer, Fset_window_new_total)
9044 (Fset_window_new_normal, Fdelete_window_internal)
9045 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9046 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9047 (Fwindow_scroll_bars): Check whether argument window is a valid or
9048 live window. Update doc-strings.
9049 (syms_of_window): New symbol Qwindow_valid_p.
9050 * keyboard.c (Fposn_at_x_y): Check whether argument
9051 frame_or_window denotes a valid window.
9052
9053 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9054
9055 Fix previous char table change.
9056 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9057 * chartab.c (optimize_sub_char_table): Likewise.
9058
9059 2012-08-16 Chong Yidong <cyd@gnu.org>
9060
9061 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9062
9063 * xfont.c (xfont_open):
9064 * xftfont.c (xftfont_open): Set the font's max_width field.
9065
9066 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9067 min_width to space_width and average_width to the average over
9068 printable ASCII characters.
9069 (ns_char_width): Code cleanup.
9070 (ns_ascii_average_width): New utility function.
9071
9072 * font.h (struct font): Update comments.
9073
9074 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9075
9076 Simple interface to set Lisp_Object fields of character tables.
9077 * lisp.h (CSET): New macro.
9078 (char_table_set_extras, char_table_set_contents)
9079 (sub_char_table_set_contents): New function.
9080 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9081 * syntax.c: Adjust users.
9082
9083 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9084
9085 * eval.c (eval_sub): Bind lexical-binding.
9086 * lread.c (Qlexical_binding): Make non-static.
9087
9088 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9089
9090 * nsmenu.m (popupSession): Remove.
9091 (pop_down_menu): Remove endModalSession.
9092 (timeout_handler:): New method.
9093 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9094 Call runModalForWindow. Check timer_fired when it returns.
9095 If not set, cancel timer and break out of loop.
9096 Otherwise loop again, with a new timeout.
9097
9098 * nsterm.m: Include fcntl.h if present.
9099 (fd_entry, t_readfds, inNsSelect): Remove.
9100 (select_writefds, select_valid, select_timeout, selfds)
9101 (select_mutex, apploopnr): Add.
9102 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9103 Otherwise call kbd_buffer_store_event.
9104 (ns_send_appdefined): Remove release of fd_entry.
9105 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9106 Increment and decrement apploopnr.
9107 (ns_select): If no file descriptors, just do a NSTimer.
9108 Otherwise copy read/write masks and start select thread (fd_handler).
9109 Start main loop and wait for application defined event.
9110 Inform select thread to stop selecting after main loop is exited.
9111 (ns_term_init): Create selfds pipe and set non-blocking.
9112 Initialize select_mutex. Start the select thread (fd_handler).
9113 (fd_handler:): Loop forever, wait for info from the main thread
9114 to either start or stop selecting. When select returns, send
9115 and appdefined event.
9116 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9117 If not call kbd_buffer_store_event.
9118
9119 * nsterm.h (EmacsApp): fd_handler takes id argument.
9120 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9121
9122 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9123
9124 2012-08-15 Eli Zaretskii <eliz@gnu.org>
9125
9126 * region-cache.c (move_cache_gap): Update gap_len using the actual
9127 growth of the boundaries array. Do not change cache_len.
9128 (Bug#12196)
9129
9130 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9131
9132 Generalize and cleanup font subsystem checks.
9133 * font.h (FONT_DEBUG, font_assert): Remove.
9134 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9135 Change font_assert to eassert. Use eassert where appropriate.
9136
9137 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9138
9139 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9140
9141 2012-08-15 Chong Yidong <cyd@gnu.org>
9142
9143 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9144 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9145 extract the font descriptor instead of just the font name.
9146 In that case, return a font spec instead of a string.
9147 (x_last_font_name): Move to this file from xfns.c.
9148
9149 * xfns.c (Fx_select_font): The return value can also be a font
9150 spec. Move x_last_font_name management to gtkutil.c.
9151
9152 * xfaces.c: Make font weight and style symbols non-static.
9153
9154 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9155
9156 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9157 (bug#12117).
9158
9159 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9160
9161 * alloc.c (Fgarbage_collect): Use plural form consistently.
9162
9163 2012-08-14 Eli Zaretskii <eliz@gnu.org>
9164
9165 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9166 iteration through the command loop. Fixes a problem whereby mouse
9167 movements are ignored until the first mouse click.
9168
9169 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9170
9171 Use bool, not int, for Lisp booleans.
9172 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9173 makes Emacs a bit smaller and presumably a bit faster.
9174 * lisp.h: Include <stdbool.h>.
9175 (struct Lisp_Boolfwd, defvar_bool):
9176 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9177 * regex.c [!emacs]: Include <stdbool.h>.
9178 (false, true): Remove; <stdbool.h> does this for us now.
9179
9180 2012-08-14 Chong Yidong <cyd@gnu.org>
9181
9182 * character.c (Fcharacterp): Doc fix (Bug#12076).
9183
9184 * data.c (Findirect_variable): Doc fix (Bug#11040).
9185
9186 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9187
9188 * editfns.c (Fformat): Doc fix (Bug#12059).
9189 (Fsave_current_buffer): Doc fix (Bug#11542).
9190
9191 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9192
9193 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9194 (bug#12022).
9195
9196 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9197
9198 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9199 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9200 * minibuf.c (choose_minibuf_frame, read_minibuf):
9201 * w32fns.c (x_create_tip_frame):
9202 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9203 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9204
9205 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9206
9207 * intervals.c (offset_intervals): Remove obsolete comment.
9208
9209 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9210
9211 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9212
9213 2012-08-14 Gergely Risko <gergely@risko.hu>
9214
9215 * coding.c (decode_coding): Record buffer modification before
9216 disabling undo_list (Bug#11773).
9217
9218 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9219
9220 Revert and cleanup some recent overlay changes.
9221 * buffer.h (enum overlay_type): Remove.
9222 (buffer_get_overlays, buffer_set_overlays): Likewise.
9223 (buffer_set_overlays_before, buffer_set_overlays_after):
9224 New function. Adjust users.
9225 (unchain_both): Add eassert.
9226
9227 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9228
9229 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9230
9231 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9232
9233 * gtkutil.c (xg_mark_data): Don't assume C99.
9234
9235 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9236
9237 * gtkutil.c (xg_frame_tb_info): New struct.
9238 (TB_INFO_KEY): New define.
9239 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9240 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9241 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9242 if not present.
9243 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9244 is up to date. Otherwise store new data.
9245 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9246
9247 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9248
9249 Use KSET for write access to Lisp_Object members of struct kboard.
9250 * keyboard.h (KSET): New macro.
9251 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9252 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9253 * xterm.c: Adjust users.
9254
9255 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9256
9257 Use BSET for write access to Lisp_Object members of struct buffer.
9258 * buffer.h (BSET): New macro.
9259 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9260 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9261 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9262 * window.c, xdisp.c, xfns.c: Adjust users.
9263
9264 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9265
9266 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9267
9268 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9269
9270 * nsterm.m (not_in_argv): New function.
9271 (application:openFile, application:openTempFile:):
9272 (application:openFileWithoutUI:, application:openFiles:): Open file
9273 if not_in_argv returns non-zero (bug#12171).
9274
9275 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9276 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9277 Define for Gtk+ versions less than 3.2.
9278 (xg_get_font_name): Use those functions/macros here.
9279 Reported by Frans Oilinki <moilinki@gmail.com>.
9280
9281 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9282
9283 * unexmacosx.c (copy_data_segment): Copy initialized data in
9284 statically linked libraries from input file rather than memory.
9285
9286 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9287 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9288 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9289
9290 2012-08-10 Glenn Morris <rgm@gnu.org>
9291
9292 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9293 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9294
9295 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9296
9297 Fix last change to allow compilation with low optimization levels.
9298 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9299 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9300
9301 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9302
9303 Use common inline syntax in intervals.h.
9304 * intervals.h (INTERVALS_INLINE): New macro.
9305 Change all users from LISP_INLINE.
9306
9307 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9308
9309 Define Qnone once for all platforms.
9310 * frame.c (Qnone): Define here.
9311 (syms_of_frame): DEFSYM it.
9312 * lisp.h (Qnone): New declaration.
9313 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9314 * xfns.c: Remove duplication. Adjust users.
9315
9316 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9317
9318 Remove unused macros from intervals.h.
9319 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9320 * intervals.c: Adjust comment.
9321
9322 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9323
9324 * w32fns.c <w32_unicode_gui>: New static variable.
9325 (globals_of_w32fns): Initialize it according to os_subtype.
9326 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9327 testing os_subtype.
9328
9329 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9330 Eli Zaretskii <eliz@gnu.org>
9331
9332 Fix bug #10299 with Unicode characters sent by customized
9333 keyboards created by MSKLC.
9334 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9335 (w32_init_class): Use it to initialize the Emacs class with either
9336 ANSI or Unicode API calls.
9337 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9338 later.
9339 (w32_wnd_proc): If the character code sent by WM_CHAR or
9340 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9341 original message. Call DefWindowProcW on NT and later.
9342
9343 2012-08-10 Glenn Morris <rgm@gnu.org>
9344
9345 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9346
9347 * lisp.h (DIRECTORY_SEP): Let configure set it.
9348
9349 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9350
9351 Use TSET for write access to Lisp_Object slots of struct terminal.
9352 * termhooks.h (TSET): New macro.
9353 * coding.c, terminal.c, xselect.c: Adjust users.
9354
9355 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9356
9357 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9358 the failing expression, include them in the error message.
9359 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9360 * lisp.h (internal_condition_case_n): Update declaration.
9361
9362 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9363
9364 Inline functions to examine and change buffer overlays.
9365 * buffer.c (unchain_both): New function.
9366 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9367 (buffer_has_overlays): New function.
9368 (enum overlay_type): New enum.
9369 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9370 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9371
9372 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9373
9374 Inline functions to examine and change buffer intervals.
9375 * alloc.c (mark_interval_tree): Remove.
9376 (MARK_INTERVAL_TREE): Simplify.
9377 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9378 * intervals.c (buffer_balance_intervals): New function.
9379 (graft_intervals_into_buffer): Adjust indentation.
9380 (set_intervals_multibyte): Simplify.
9381 * buffer.h (BUF_INTERVALS): Remove.
9382 (buffer_get_intervals, buffer_set_intervals): New function.
9383 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9384 * intervals.c, textprop.c: Adjust users.
9385
9386 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9387
9388 Inline functions to examine and change string intervals.
9389 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9390 (string_get_intervals, string_set_intervals): New function.
9391 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9392 * lread.c, print.c, textprop.c: Adjust users.
9393
9394 2012-08-08 Glenn Morris <rgm@gnu.org>
9395
9396 * lisp.mk (lisp): Remove language/persian.elc.
9397
9398 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9399
9400 Cleanup intervals.
9401 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9402 (NULL_INTERVAL_P): Likewise. Adjust users.
9403 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9404 Adjust comment. Move under #if 0.
9405 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9406 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9407
9408 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9409
9410 Check total length of intervals with eassert.
9411 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9412 * intervals.c: Change all users to eassert.
9413
9414 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9415
9416 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9417 Rename fields to match removal of FGET and WGET and disuse of
9418 INTERNAL_FIELD in Lisp_Cons.
9419
9420 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9421
9422 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9423 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9424 name since all xname users are fixed long time ago. Do not
9425 use INTERNAL_FIELD.
9426 (set_symbol_name, set_symbol_function, set_symbol_plist):
9427 (set_symbol_next, set_overlay_plist): New function.
9428 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9429 (struct Lisp_Overlay): Likewise.
9430 (CVAR, MVAR, SVAR): Remove.
9431 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9432 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9433 * xterm.c: Adjust users.
9434 * .gdbinit: Change to use name field of struct Lisp_Symbol
9435 where appropriate.
9436
9437 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9438
9439 Basic functions to set Lisp_Object and pointer slots of intervals.
9440 * intervals.h (interval_set_parent, interval_set_object):
9441 (interval_set_left, interval_set_right, interval_set_plist):
9442 (interval_copy_parent): New function.
9443 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9444 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9445 Adjust indentation.
9446 (INTERVAL_SIZE): Remove. Adjust users.
9447 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9448
9449 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9450
9451 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9452 * process.h (PGET): Remove.
9453 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9454 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9455
9456 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9457
9458 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9459 * window.h (WGET): Remove.
9460 (struct window): Do not use INTERNAL_FIELD.
9461 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9462 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9463 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9464 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9465 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9466 Adjust users.
9467
9468 2012-08-07 Chong Yidong <cyd@gnu.org>
9469
9470 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9471 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9472 (Fdelete_window_internal): Signal an error if the window is not on
9473 a live frame (Bug#12025).
9474
9475 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9476
9477 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9478 * frame.h (FGET): Remove.
9479 (struct frame): Do not use INTERNAL_FIELD.
9480 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9481 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9482 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9483 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9484
9485 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9486
9487 * w32.c: Silence compiler warnings.
9488 (map_w32_filename): Remove unused variable `is_fat'.
9489 (chase_symlinks): Add parentheses around expression.
9490
9491 2012-08-06 Glenn Morris <rgm@gnu.org>
9492
9493 * sysdep.c: Respect BROKEN_GETWD.
9494
9495 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9496 Let configure handle it.
9497 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9498
9499 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9500
9501 Use GCALIGNMENT where appropriate.
9502 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9503 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9504 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9505
9506 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9507
9508 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9509 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9510
9511 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9512
9513 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9514 that should be sufficient for everyone.
9515
9516 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9517
9518 * keyboard.c (timer_check_2): Add break so timer_check returns next
9519 timeout.
9520
9521 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9522
9523 Fix Windows build errors introduced after converting to WGET and WSET.
9524 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9525 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9526
9527 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9528
9529 * nsterm.m (ns_frame_rehighlight): Use FSET.
9530
9531 * nsmenu.m (ns_update_menubar): Use FSET.
9532
9533 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9534
9535 Separate read and write access to Lisp_Object slots of Lisp_Process.
9536 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9537 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9538
9539 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9540
9541 Separate read and write access to Lisp_Object slots of struct window.
9542 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9543 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9544 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9545 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9546 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9547 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9548 Adjust users.
9549
9550 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9551
9552 Fix Windows build errors introduced after converting to FGET and FSET.
9553 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9554 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9555 (w32_judge_scroll_bars): Change to use FSET.
9556 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9557
9558 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 Fix replacement typo.
9561 * window.c (replace_window): Set root_window instead of
9562 selected_window. This fixes a total window subsystem
9563 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9564
9565 2012-08-06 Glenn Morris <rgm@gnu.org>
9566
9567 * lisp.mk (lisp): Add language/persian.elc.
9568
9569 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9570
9571 Separate read and write access to Lisp_Object slots of struct frame.
9572 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9573 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9574 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9575 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9576 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9577
9578 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9579
9580 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9581
9582 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9583
9584 Generalize common compile-time constants.
9585 * lisp.h (header_size, bool_header_size, word_size): Now here.
9586 (struct Lisp_Vector): Add comment.
9587 (struct Lisp_Bool_Vector): Move up to define handy constants.
9588 (VECSIZE, PSEUDOVECSIZE): Simplify.
9589 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9590 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9591 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9592 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9593 * xfont.c, xmenu.c: Use word_size where appropriate.
9594
9595 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9596
9597 * search.c (Freplace_match): Treat \? in the replacement text
9598 literally (Bug#8161).
9599
9600 2012-08-05 Chong Yidong <cyd@gnu.org>
9601
9602 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9603 * frame.c (Vdelete_frame_functions):
9604 * emacs.c (Vkill_emacs_hook): Doc fix.
9605
9606 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9607
9608 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9609 --with-x-toolkit=no builds.
9610 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9611
9612 2012-08-04 Chong Yidong <cyd@gnu.org>
9613
9614 * syntax.c (Fmodify_syntax_entry): Doc fix.
9615
9616 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9617
9618 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9619 * w32.c (init_environment): Change the default values of many
9620 environment variables in dflt_envvars[] to NULL, to avoid pushing
9621 them into environment when they were not already defined.
9622 Remove the code that deletes site-lisp subdirectories from the default
9623 value of EMACSLOADPATH, as it is no longer needed.
9624 (check_windows_init_file): Now external, not static.
9625 Use Vload_path as is, without adding anything, as this function is now
9626 called when Vload_path is already set up.
9627
9628 * w32.h (check_windows_init_file): Add prototype.
9629
9630 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9631 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9632 compatibility with Posix platforms.
9633 (main): Move the call to check_windows_init_file to here from
9634 w32.c.
9635 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9636 any, in the DEFALT argument into the root of the Emacs build or
9637 installation tree, as appropriate.
9638
9639 * callproc.c (init_callproc_1): Call decode_env_path instead of
9640 doing its equivalent by hand.
9641 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9642 the code that sets Vexec_path run on MS-Windows.
9643
9644 * lread.c (init_lread): Add comments to #ifdef's.
9645
9646 * msdos.c (dos_set_window_size, IT_update_begin)
9647 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9648 instead of direct references.
9649
9650 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 Export DEFAULT_REHASH_* to GDB.
9653 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9654 Now constants, not macros.
9655
9656 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 Remove unnecessary casts involving pointers.
9659 These casts are no longer needed now that we assume C89 or later,
9660 since they involve casting to or from void *.
9661 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9662 (make_pure_float, make_pure_vector):
9663 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9664 * macros.c (Fstart_kbd_macro):
9665 * menu.c (find_and_return_menu_selection):
9666 * minibuf.c (read_minibuf_noninteractive):
9667 * sysdep.c (closedir):
9668 * xdisp.c (x_produce_glyphs):
9669 * xfaces.c (compare_fonts_by_sort_order):
9670 * xfns.c (x_real_positions, select_visual):
9671 * xselect.c (x_stop_queuing_selection_requests)
9672 (x_get_window_property, x_get_window_property_as_lisp_data):
9673 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9674 Remove unnecessary pointer casts.
9675 * alloc.c (record_xmalloc): New function.
9676 * lisp.h (record_xmalloc): New decl.
9677 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9678 more like a function. This is because the pointer cast is not
9679 needed. All uses changed.
9680 * print.c (print_string, print_error_message): Avoid length recalc.
9681
9682 Improve fix for macroexp crash with debugging (Bug#12118).
9683 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9684 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9685 not supposed to be invoked from the garbage collector.
9686 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9687 (gc_aset): New function, which is like ASET but can be
9688 used in the garbage collector.
9689 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9690 (set_hash_index): Use it instead of ASET.
9691
9692 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9693
9694 Support symlinks on latest versions of MS-Windows.
9695 * w32.c: Include winioctl.h and aclapi.h.
9696 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9697 (revert_to_self): Forward declarations of static functions.
9698 <static BOOL g_b_init_get_security_info>:
9699 <g_b_init_create_symbolic_link>: New static flags.
9700 (globals_of_w32): Initialize them to zero.
9701 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9702 (map_w32_filename): Improve commentary. Simplify switch.
9703 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9704 headers (most versions of MinGW w32api don't).
9705 (get_security_info, create_symbolic_link)
9706 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9707 New functions.
9708 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9709 in the argument file name.
9710 (sys_access): Call unc_volume_file_attributes only if
9711 GetFileAttributes fails with network-related error codes.
9712 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9713 have the required privileges.
9714 (get_file_security_desc_by_name): Rename from
9715 get_file_security_desc.
9716 (stat_worker): New function, with most of the guts of 'stat', and
9717 with addition of handling of symlinks and support for 'lstat'.
9718 If possible, get file's attributes and security information by
9719 handle, not by name. Produce S_IFLNK bit for symlinks, when
9720 called from 'lstat'.
9721 (stat, lstat): New functions, call 'stat_worker'.
9722 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9723 symlinks when the underlying filesystem supports them.
9724
9725 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 Fix macroexp crash on Windows with debugging (Bug#12118).
9728 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9729 checking subscripts; problem introduced with the recent
9730 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9731 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9732 since it's used in non-static inline functions now.
9733
9734 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9735 Don't assume buffer size fits in 'int'. Remove unused local.
9736
9737 Use C99-style 'extern inline' if available.
9738 * buffer.h (BUFFER_INLINE):
9739 * category.h (CATEGORY_INLINE):
9740 * character.h (CHARACTER_INLINE):
9741 * charset.h (CHARSET_INLINE):
9742 * composite.h (COMPOSITE_INLINE):
9743 * dispextern.h (DISPEXTERN_INLINE):
9744 * lisp.h (LISP_INLINE):
9745 * systime.h (SYSTIME_INLINE):
9746 New macro, replacing 'static inline' in this header.
9747 * buffer.h, category.h, character.h, charset.h, composite.h:
9748 * dispextern.h, lisp.h, systime.h:
9749 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9750 * alloc.c (LISP_INLINE):
9751 * buffer.c (BUFFER_INLINE):
9752 * category.c (CATEGORY_INLINE):
9753 * character.c (CHARACTER_INLINE):
9754 * charset.c (CHARSET_INLINE):
9755 * composite.c (COMPOSITE_INLINE):
9756 * dispnew.c (DISPEXTERN_INLINE):
9757 * sysdep.c (SYSTIME_INLINE):
9758 Define to EXTERN_INLINE, so that the corresponding functions
9759 are compiled into code.
9760 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9761 (INLINE_HEADER_END): New macros.
9762 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9763 since it's used in non-static inline functions now.
9764 (VALMASK) [!USE_LSB_TAG]: Likewise.
9765
9766 2012-08-02 Glenn Morris <rgm@gnu.org>
9767
9768 * s/: Remove empty directory.
9769
9770 * s/ms-w32.h: Move to ../nt/inc.
9771 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9772 Update for new ms-w32.h location.
9773
9774 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9775
9776 Port to Solaris 8.
9777 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9778
9779 2012-08-02 Glenn Morris <rgm@gnu.org>
9780
9781 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9782 hard-coding the path separator.
9783
9784 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9785
9786 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9787 This how ASET and AREF are supposed to work, and makes
9788 it easier to think about future improvements. See
9789 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9790 * charset.h (set_charset_attr): New function.
9791 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9792 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9793 (aref_addr): New function. All uses of &AREF(...) changed.
9794 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9795 (set_hash_index): New functions. All lvalue-style uses of
9796 HASH_KEY etc. changed.
9797 * keyboard.c (set_prop): New function. All lvalue-style uses
9798 of PROP changed.
9799
9800 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9801
9802 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9803 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9804 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9805 * nsfns.m (ns_set_name_as_filename): Likewise.
9806 * nsmenu.m (ns_update_menubar): Likewise.
9807 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9808
9809 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9810
9811 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9812 Adapt to latest changes in field names of the corresponding Lisp
9813 objects.
9814
9815 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9816
9817 2012-08-01 Glenn Morris <rgm@gnu.org>
9818
9819 * s/msdos.h: Remove file.
9820 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9821 * Makefile.in (S_FILE): Remove.
9822 (config_h): Remove S_FILE.
9823
9824 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9825
9826 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9827 Remove; moved to nt/config.nt.
9828
9829 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9830
9831 Use INTERNAL_FIELD for conses and overlays.
9832 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9833 Remove obsolete comment.
9834 (MVAR): New macro.
9835 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9836 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9837
9838 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9839
9840 Use INTERNAL_FIELD for symbols.
9841 * lisp.h (SVAR): New macro. Adjust users.
9842 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9843 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9844
9845 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9846
9847 Use INTERNAL_FIELD for processes.
9848 * process.h (PVAR): New macro. Adjust style.
9849 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9850 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9851
9852 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9853
9854 Use INTERNAL_FIELD for windows.
9855 * window.h (WVAR): New macro.
9856 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9857 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9858 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9859 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9860 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9861 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9862
9863 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9864
9865 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9866
9867 2012-08-01 Glenn Morris <rgm@gnu.org>
9868
9869 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9870 Move to configure.ac.
9871
9872 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9873
9874 * makefile.w32-in (CONFIG_H): Update dependencies.
9875 (CONF_POST_H): New macro.
9876
9877 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9878
9879 2012-07-31 Glenn Morris <rgm@gnu.org>
9880
9881 * Makefile.in (S_FILE): No longer set by configure.
9882
9883 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9884 is available.
9885 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9886
9887 * process.h (NULL_DEVICE):
9888 * emacs.c (SEPCHAR):
9889 * editfns.c (USER_FULL_NAME): Let configure set them.
9890
9891 * s/README, s/template.h: Remove files.
9892
9893 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9894
9895 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9896 Move to configure.ac.
9897
9898 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9899
9900 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9901 resulting renaming of 'struct frame' members.
9902
9903 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9904
9905 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9906 after introduction of FVAR.
9907
9908 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9909
9910 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9911
9912 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9913 instead of compositeToPoint.
9914 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9915
9916 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9917
9918 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9919
9920 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9921 * lisp.h (INTERNAL_FIELD): New macro.
9922 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9923 (BVAR): Change to use INTERNAL_FIELD.
9924 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9925 (KVAR): Change to use INTERNAL_FIELD.
9926 * frame.h (FVAR): New macro.
9927 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9928 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9929 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9930 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9931 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9932
9933 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9934
9935 Miscellaneous fixes for non-default X toolkits.
9936 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9937 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9938 Move under #ifdef USE_LUCID.
9939 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9940 definition and usage to avoid warnings.
9941
9942 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9943
9944 * nsterm.m (openFiles): Fix previous checkin.
9945
9946 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9947
9948 * indent.c (compute_motion): Remove unused local.
9949
9950 2012-07-31 Glenn Morris <rgm@gnu.org>
9951
9952 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9953
9954 * conf_post.h [USG5_4]:
9955 Move remaining contents of s/usg5-4-common.h here.
9956 * s/usg5-4-common.h: Remove file.
9957
9958 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9959 * s/irix6-5.h: Remove file.
9960
9961 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9962 * s/darwin.h: Remove file.
9963
9964 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9965 * s/hpux10-20.h: Remove file, which is now empty.
9966
9967 2012-07-30 Glenn Morris <rgm@gnu.org>
9968
9969 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9970 * Makefile.in (config_h): Add conf_post.h.
9971 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9972
9973 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9974
9975 * nsterm.m (ns_do_open_file): New variable.
9976 (ns_term_init): Set ns_do_open_file to YES after run returns.
9977 (openFile, openTempFile, openFileWithoutUI, openFiles):
9978 Open files only if ns_do_open_file.
9979
9980 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9981
9982 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9983 This no-op macro hasn't been needed for many years.
9984 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9985
9986 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9987 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9988 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9989 gdb_make_enums_visible.
9990 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9991 (DIRECTORY_SEP): Now a constant, not a macro.
9992
9993 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9994
9995 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9996 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9997
9998 * w32term.c <w32_keyboard_codepage>: Renamed from
9999 keyboard_codepage and now external. All users changed.
10000
10001 * w32term.h: Add declaration of w32_keyboard_codepage.
10002
10003 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
10004 the codepage to translate keys to Unicode. If this argument is
10005 -1, use the value returned by GetConsoleCP. All callers changed.
10006
10007 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10008
10009 Update .PHONY listings in makefiles.
10010 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10011 bootstrap-clean, distclean, maintainer-clean, versioclean,
10012 extraclean, frc.
10013
10014 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10015 This is a bit clearer. Fix some commentary typos.
10016
10017 2012-07-30 Glenn Morris <rgm@gnu.org>
10018
10019 * s/netbsd.h: Let configure include signal.h if needed.
10020 Remove file, which is now empty.
10021
10022 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10023 Let configure set them.
10024 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10025 No more need to undefine.
10026
10027 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10028
10029 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10030 non-single-byte char when adding meta modifier. (Bug#12090)
10031
10032 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10033
10034 Convert safe_call to use variable number of arguments.
10035 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10036 (safe_call2): Fix comment.
10037 * lisp.h (safe_call): Adjust prototype.
10038 * coding.c (encode_coding_object): Change to use safe_call2.
10039 * xfaces.c (merge_face_heights): Change to use safe_call1.
10040
10041 2012-07-30 Glenn Morris <rgm@gnu.org>
10042
10043 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10044 does that unconditionally. Remove file, which is now empty.
10045
10046 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10047 Remove empty files.
10048
10049 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10050
10051 Export to GDB most of lisp.h's remaining object-like macros.
10052 * lisp.h (min, max): Move earlier, because they're used earlier now.
10053 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10054 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10055 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10056 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10057 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10058 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10059 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10060 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10061 Now constants, for GDB. They need not be macros.
10062 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10063 Now constants, for GDB, as well as macros, for static initializers.
10064 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10065 Move to after the definition of struct Lisp_Char_Table,
10066 since the former now needs that type defined.
10067 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10068 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10069 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10070 New enums, for gdb_make_enums_visible.
10071 (GLYPH_MODE_LINE_FACE): Remove; unused.
10072 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10073 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10074 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10075 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10076 enum maxargs, enum MAX_ALLOCA.
10077 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10078 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10079 no longer needed, now that they are done in lisp.h.
10080
10081 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10082
10083 Cleanup string bytes checking.
10084 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10085 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10086 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10087 (check_sblock, compact_small_strings): Simplify.
10088
10089 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10092 These macros are confusing and no longer need to be defined, as
10093 the enum values now suffice. All uses replaced with definiens.
10094 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10095
10096 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
10097
10098 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10099 ($(BLD)/w32console.$(O)): Update dependencies.
10100
10101 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10102
10103 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10104 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10105 time. Adjust users.
10106 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10107
10108 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10109
10110 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10111 setting sitelisp (Bug#12010).
10112
10113 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10114
10115 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10116
10117 * w32heap.c (cache_system_info):
10118 * w32.c (sys_rename):
10119 * w32proc.c (find_child_console, sys_kill): All users changed.
10120
10121 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10122
10123 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10124
10125 2012-07-29 Eli Zaretskii <eliz@gnu.org>
10126
10127 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10128
10129 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10130
10131 Cleanup statistics calculation in Fgarbage_collect.
10132 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10133 Fix zombies percentage calculation. Simplify elapsed time calculation.
10134
10135 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10136
10137 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10138 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10139 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10140 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10141 (replace_range, replace_range_2, del_range_2): Change to eassert.
10142 * marker.c (byte_char_debug_check): Adjust style.
10143
10144 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10145
10146 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10147 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10148 long-ago-commented-out code that talks about "WIN32".
10149 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10150 All uses changed.
10151
10152 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10153
10154 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10155 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10156 Simplify by using alignof.
10157 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10158 * lisp.h: Include <stdalign.h>.
10159 (GCALIGNMENT): New macro and constant.
10160 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10161 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10162 (stdalign): New macro, if not already defined.
10163
10164 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10165
10166 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10167 * w32inevt.c: Include w32inevt.h.
10168 (w32_read_console_input): New inline function, calls either
10169 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10170 w32_console_unicode_input.
10171 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10172 (w32_kbd_patch_key, key_event): Use the codepage returned by
10173 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10174 (key_event): use uChar.UnicodeChar only if
10175 w32_console_unicode_input is non-zero.
10176
10177 * w32console.c: Include w32heap.h.
10178 <w32_console_unicode_input>: New global variable.
10179 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10180 family of Windows, zero otherwise.
10181
10182 * w32inevt.h: Declare w32_console_unicode_input.
10183
10184 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10185 --without-x. (Bug#11742)
10186
10187 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10188
10189 Adjust GDB to reflect pvec_type changes (Bug#12036).
10190 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10191 2012-07-04 changes to pseudovector representation.
10192 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10193
10194 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10195
10196 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10197 bus address.
10198 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10199
10200 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10201
10202 * alloc.c (listn): Fix the order the arguments are consed onto the
10203 list.
10204
10205 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10206 enumeration constants, as PURE and HEAP are too general, and clash
10207 with other headers and sources, such as gmalloc.c and the
10208 MS-Windows system headers. All users changed.
10209
10210 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10211
10212 Revert last save_excursion_save and save_excursion_restore changes.
10213 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10214 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10215
10216 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10217
10218 Fix recently-introduced typos in Windows port.
10219 Reported by Martin Rudalics <rudalics@gmx.at>.
10220 * w32.c (init_environment): Replace comma with semicolon.
10221 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10222
10223 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10224
10225 Improve GDB symbol export (Bug#12036).
10226 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10227 arms of an 'if', not using conditional expressions; otherwise GDB
10228 complains about the types in the unevaluated arm when the argument
10229 is an integer literal.
10230 (xgetint): Simplify expression.
10231 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10232 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10233 Zaretskii in <http://bugs.gnu.org/12036#13>.
10234 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10235 needed now that we have gdb_make_enums_visible.
10236 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10237 (enum enum_USE_LSB_TAG):
10238 New enum types, packaging up enums that need to be exported to GDB.
10239
10240 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10241
10242 Utility function to make a list from specified amount of objects.
10243 * lisp.h (enum constype): New datatype.
10244 (listn): New prototype.
10245 * alloc.c (listn): New function.
10246 (Fmemory_use_count, syms_of_alloc): Use it.
10247 * buffer.c (syms_of_buffer): Likewise.
10248 * callint.c (syms_of_callint): Likewise.
10249 * charset.c (define_charset_internal): Likewise.
10250 * coding.c (syms_of_coding): Likewise.
10251 * keymap.c (syms_of_keymap): Likewise.
10252 * search.c (syms_of_search): Likewise.
10253 * syntax.c (syms_of_syntax): Likewise.
10254 * w32.c (init_environment): Likewise.
10255 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10256 * xdisp.c (syms_of_xdisp): Likewise.
10257 * xfns.c (syms_of_xfns): Likewise.
10258
10259 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10260
10261 Fast save_excursion_save and save_excursion_restore.
10262 * lisp.h (struct Lisp_Excursion): New data type.
10263 (PVEC_EXCURSION): New pseudovector type.
10264 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10265 to deal with it. Adjust comments.
10266 (init_marker, attach_marker): New prototype.
10267 (unchain_marker): Adjust prototype.
10268 * marker.c (attach_marker): Change to global.
10269 (init_marker): New function.
10270 * alloc.c (Fmake_marker, build_marker): Use it.
10271 (build_marker): More easserts.
10272 (mark_object): Handle struct Lisp_Excursion.
10273 * editfns.c (save_excursion_save, save_excursion_restore):
10274 Reimplement to use struct Lisp_Excursion. Add comments.
10275
10276 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10277
10278 Fix export of symbols to GDB (Bug#12036).
10279 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10280 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10281 emacs.c, as this is a more-suitable home. Had this been done earlier
10282 the fix for 12036 would have avoided some of the problems noted in
10283 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10284 would have been more obvious.
10285 * emacs.c: Do not include <verify.h>; no longer needed.
10286 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10287 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10288 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10289 Remove; now done in lisp.h.
10290 * lisp.h (PUBLISH_TO_GDB): New macro.
10291 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10292 (DATA_SEG_BITS): Use it.
10293 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10294 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10295 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10296 not be usable in #if. This simplifies things.
10297
10298 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10299
10300 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10301
10302 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10303
10304 Simplify export of symbols to GDB (Bug#12036).
10305 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10306 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10307 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10308 Adjust to changes in lisp.h and emacs.c, by using
10309 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10310 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10311 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10312 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10313 instead of gdb_valbits.
10314 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10315 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10316 instead of gdb_array_mark_flag.
10317 (xboolvector): Get size from $->size, not $->header.size.
10318 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10319 (xreload, hook-run, hookpost-run): Remove.
10320 * emacs.c: Include <verify.h>.
10321 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10322 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10323 Remove.
10324 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10325 (gdb_USE_LSB_TAG): New enum constants.
10326 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10327 Also define these as enum constants, so they're visible to GDB.
10328 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10329 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10330 as constants, so they're visible to GDB.
10331 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10332 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10333 Now enum constants, not macros, so they're visible to GDB.
10334 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10335 more convenient now. All uses changed.
10336 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10337 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10338
10339 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10340
10341 Explicitly free restriction data that are not needed anymore.
10342 * editfns.c (save_restriction_restore): Free restriction data.
10343
10344 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10345
10346 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10347 add argument, tune behavior, and adjust all callers.
10348
10349 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10350
10351 Use typedef for EMACS_INT, EMACS_UINT.
10352 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10353 than macros. This simplifies debugging in the usual case, since
10354 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10355 and it allows expressions involving EMACS_INT casts.
10356 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10357
10358 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10359
10360 * nsterm.m (ns_read_socket): Return early if there is a modal
10361 window (Bug#12043).
10362
10363 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10364
10365 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10366 that FOCUS-FRAME can be omitted.
10367
10368 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10369
10370 Adjust buffer text indirection counters at the end of Fkill_buffer.
10371 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10372 buffer is definitely dead. This should really fix an issue reported
10373 by Christoph Scholtes again. (Bug#12007).
10374 (init_buffer_once): Initialize indirection counters of
10375 buffer_defaults and buffer_local_symbols (for sanity and safety).
10376
10377 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10378
10379 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10380 and continuation glyphs on tooltip frames, leave them at zero.
10381 Avoids continued lines in tooltips. (Bug#11832)
10382
10383 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10384
10385 Simplify copy_overlay.
10386 * buffer.c (copy_overlay): Simplify. Use build_marker.
10387 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10388
10389 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10390
10391 * print.c (print_object): Don't crash when a frame's name is nil
10392 or invalid. (Bug#12025)
10393
10394 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10395 it signals an error when a tooltip frame is being created.
10396
10397 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10398
10399 Cleanup miscellaneous objects allocation and initialization.
10400 * alloc.c (allocate_misc): Change to static. Add argument to
10401 specify the subtype. Adjust comment and users.
10402 (build_overlay): New function.
10403 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10404 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10405 (allocate_misc): Remove prototype.
10406 (build_overlay): Add prototype.
10407
10408 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10409
10410 Swap buffer text indirection counters in Fbuffer_swap_text.
10411 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10412 This avoids crash reported by Christoph Scholtes at
10413 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10414
10415 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10416
10417 * nsmenu.m (Popdown_data): New struct.
10418 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10419 free Popdown_data.
10420 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10421 (initWithContentRect): Make imgView and contentView non-static
10422 and autorelease them. Also autorelease img and matrix (Bug#12005).
10423 (dealloc): Remove (Bug#12005).
10424
10425 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10426
10427 Adjust consing_since_gc when objects are explicitly freed.
10428 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10429 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10430 (free_cons, free_misc): Subtract object size from consing_since_gc.
10431
10432 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10433
10434 Simplify and cleanup markers positioning code.
10435 * marker.c (attach_marker): More useful eassert.
10436 (live_buffer, set_marker_internal): New function.
10437 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10438 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10439
10440 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10441
10442 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10443 as it's limited by the amount of memory, not by INT_MAX.
10444
10445 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10446
10447 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10448 in special-event-map. See the discussion at
10449 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10450 for the reasons.
10451
10452 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10453 info.dwItemData. Fixes crashes on 64-bit Windows.
10454 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10455
10456 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10457
10458 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10459 (conversationIdentifier): Return value is NSInteger.
10460 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10461
10462 2012-07-21 Chong Yidong <cyd@gnu.org>
10463
10464 * window.c (decode_any_window): Signal an error if the window is
10465 on a dead frame (Bug#11984).
10466
10467 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10468
10469 Add indirection counting to speed up Fkill_buffer.
10470 * buffer.h (struct buffer): New member.
10471 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10472 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10473 base buffer indirection counter.
10474 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10475 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10476 through buffer list if indirection counter is 0.
10477
10478 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10479
10480 Extend the value returned by Fgarbage_collect with heap statistics.
10481 * alloc.c (Qheap): New symbol.
10482 (syms_of_alloc): DEFSYM it.
10483 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10484 (Fmemory_free): Remove.
10485 (syms_of_alloc): Don't defsubr it.
10486 * buffer.c (Fcompact_buffer): Remove.
10487 (syms_of_buffer): Don't defsubr it.
10488
10489 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10490
10491 Make maybe_gc inline.
10492 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10493 * lisp.h (consing_since_gc, gc_relative_threshold)
10494 (memory_full_cons_threshold): Revert declaration.
10495 (maybe_gc): Remove prototype, define as inline.
10496 * alloc.c: Remove old commented-out code.
10497 (consing_since_gc, gc_relative_threshold)
10498 (memory_full_cons_threshold): Revert to global.
10499 (maybe_gc): Remove.
10500
10501 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10502
10503 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10504 * lisp.h (build_unibyte_string): New function.
10505 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10506 * sysdep.c, w32fns.c, xfns.c: Use it.
10507 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10508 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10509 Adjust users accordingly.
10510 * font.h (font_open_by_name): Adjust prototype.
10511
10512 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10513
10514 Cleanup calls to Fgarbage_collect.
10515 * lisp.h (maybe_gc): New prototype.
10516 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10517 Remove declarations.
10518 * alloc.c (maybe_gc): New function.
10519 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10520 Make them static.
10521 * bytecode.c (MAYBE_GC): Use maybe_gc.
10522 * eval.c (eval_sub, Ffuncall): Likewise.
10523 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10524 to avoid dependency from auto-save feature.
10525
10526 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10529 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10530 'for_each_per_buffer_object_at'.
10531 All uses changed. It's better to use upper-case for macros that
10532 cannot be implemented as functions, to give the reader a clue
10533 that they're special.
10534
10535 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10536
10537 * alloc.c (Fgarbage_collect): Tweak docstring.
10538
10539 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10540
10541 Tweak the value returned from Fgarbage_collect again.
10542 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10543 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10544 Adjust documentation.
10545 (total_vector_bytes): Rename to total_vector_slots, adjust
10546 accounting.
10547 (total_free_vector_bytes): Rename to total_free_vector_slots,
10548 adjust accounting.
10549 (Qstring_bytes, Qvector_slots): New symbols.
10550 (syms_of_alloc): DEFSYM them.
10551
10552 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10553
10554 Buffer compaction primitive which may be used from Lisp.
10555 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10556 (syms_of_buffer): Register Fcompact_buffer.
10557 * alloc.c (Fgarbage_collect): Use compact_buffer.
10558 * buffer.h (compact_buffer): New prototype.
10559 (struct buffer_text): New member.
10560
10561 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10562
10563 New macro to iterate over all buffers, miscellaneous cleanups.
10564 * lisp.h (all_buffers): Remove declaration.
10565 * buffer.h (all_buffers): Add declaration, with comment.
10566 (for_each_buffer): New macro.
10567 * alloc.c (Fgarbage_collect, mark_object): Use it.
10568 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10569 (init_buffer): Likewise.
10570 * data.c (Fset_default): Likewise.
10571 * coding.c (code_conversion_restore): Remove redundant check
10572 for dead buffer.
10573 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10574
10575 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10576
10577 Fix bug that created negative-length intervals.
10578 * intervals.c (merge_interval_right, merge_interval_left):
10579 Do not zero out this interval if it is absorbed by its children,
10580 as this interval's total length doesn't change in that case. See
10581 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10582
10583 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10584
10585 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10586 when invoking (make-bool-vector N t) and N is a positive
10587 multiple of 8 -- the last 8 bits were mistakenly cleared.
10588
10589 Remove some struct layout assumptions in bool vectors.
10590 * alloc.c (bool_header_size): New constant.
10591 (header_size, word_size): Move earlier, as they're now used earlier.
10592 Use 'word_size' in a few more places, where it's appropriate.
10593 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10594 padding before the data member of a bool vector.
10595 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10596 than doing the check by hand with an abort ().
10597
10598 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10599
10600 * eval.c (Fdefvar): Don't check constants since we only set the var if
10601 it's not yet defined anyway (bug#11904).
10602
10603 * lisp.h (last_undo_boundary): Declare new var.
10604 * keyboard.c (command_loop_1): Set it.
10605 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10606 were auto-added by the command loop (bug#11774).
10607
10608 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10609
10610 * w32font.c (Qsymbol): Remove local definition.
10611 (syms_of_w32font): Don't DEFSYM it.
10612
10613 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10614
10615 Fix sweep_vectors to handle large bool vectors correctly.
10616 * alloc.c (sweep_vectors): Account total_vector_bytes for
10617 bool vectors larger than VBLOCK_BYTES_MAX.
10618
10619 2012-07-18 Chong Yidong <cyd@gnu.org>
10620
10621 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10622 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10623
10624 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10625
10626 Return more descriptive data from Fgarbage_collect.
10627 Suggested by Stefan Monnier in
10628 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10629 * alloc.c (bounded_number): New function.
10630 (total_buffers, total_vectors): New variable.
10631 (total_string_size): Rename to total_string_bytes, adjust users.
10632 (total_vector_size): Rename to total_vector_bytes, adjust users.
10633 (sweep_vectors): Account total_vectors and total_vector_bytes.
10634 (Fgarbage_collect): New return value. Adjust documentation.
10635 (gc_sweep): Account total_buffers.
10636 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10637 (VECTOR_SIZE): Remove.
10638 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10639 (Qinterval, Qmisc): New symbols.
10640 (syms_of_data): Initialize them.
10641 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10642 (Qcons, Qbuffer): New declarations.
10643
10644 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10647 Round up, not down. Improve doc.
10648
10649 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10650
10651 Restore old code in allocate_string_data to avoid Faset breakage.
10652 Reported by Julien Danjou <julien@danjou.info> in
10653 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10654 * alloc.c (allocate_string_data): Restore old code with minor
10655 adjustments, fix comment to explain this subtle issue.
10656
10657 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10658
10659 Remove FILE_SYSTEM_CASE.
10660 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10661
10662 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10663 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10664 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10665 call-process-region passes it through expand-file-name.
10666
10667 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10668
10669 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10670
10671 Fix crash when creating indirect buffer (Bug#11917)
10672 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10673 Don't handle unbound variables specially if non-zero.
10674 (Fbuffer_local_variables): Pass zero.
10675 (clone_per_buffer_values): Pass non-zero.
10676
10677 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10678
10679 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10680 to make the loop interruptible.
10681
10682 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10683
10684 * gnutls.c (emacs_gnutls_handshake): Only retry if
10685 GNUTLS_E_INTERRUPTED.
10686
10687 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10688
10689 Cleanup and convert miscellaneous checks to eassert.
10690 * alloc.c (mark_interval): Fix comment, partially rephrase
10691 old comment from intervals.h (see below).
10692 * intervals.c (find_interval, adjust_intervals_for_insertion)
10693 (delete_interval, adjust_intervals_for_deletion)
10694 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10695 Convert to eassert.
10696 (adjust_intervals_for_insertion, make_new_interval):
10697 Remove obsolete and unused code.
10698 * intervals.h (struct interval): Remove obsolete comment.
10699 * textprotp.c (erase_properties): Remove unused code.
10700 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10701 (Fremove_list_of_text_properties): Convert to eassert.
10702
10703 2012-07-17 Chong Yidong <cyd@gnu.org>
10704
10705 * editfns.c (Finsert_char): Doc fix.
10706
10707 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10708
10709 Fix previous change to make Fmemory_free always accurate.
10710 * alloc.c (make_interval): Update total_free_intervals.
10711 (make_float): Likewise for total_free_floats.
10712 (free_cons, Fcons): Likewise for total_free_conses.
10713 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10714 Likewise for total_free_vector_bytes.
10715 (Fmake_symbol): Likewise for total_free_symbols.
10716 (bytes_free): Remove.
10717
10718 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10719
10720 Simple free memory accounting feature.
10721 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10722 (sweep_vectors): Accumulate size of free vectors.
10723 (Fgarbage_collect): Setup bytes_free.
10724 (Fmemory_free): New function.
10725 (syms_of_alloc): Register it.
10726
10727 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10728
10729 Cleanup overlays checking.
10730 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10731 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10732 eassert and OVERLAYP.
10733 (sort_overlays): Change to use OVERLAYP.
10734
10735 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10736
10737 * editfns.c (Finsert_char): Make it interactive, and make the
10738 second arg optional. Copy interactive spec and docstring from
10739 ucs-insert.
10740
10741 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10744 Unlike the other wrapped functions, fabs has an unspecified
10745 effect on errno.
10746
10747 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10748
10749 * nsterm.m (keyDown): Interpret flags without left/right bits
10750 as the left key (Bug#11670).
10751
10752 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10753
10754 Remove empty and useless init functions.
10755 * lisp.h (init_character_once, init_fns, init_image)
10756 (init_filelock, init_sound): Remove prototype.
10757 * character.c (init_character_once): Remove.
10758 * filelock.c (init_filelock): Likewise.
10759 * fns.c (init_fns): Likewise.
10760 * image.c (init_image): Likewise.
10761 * sound.c (init_sound): Likewise.
10762 * emacs.c (main): Adjust accordingly.
10763
10764 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10765
10766 * gtkutil.h: Tiny cleanups.
10767 (use_old_gtk_file_dialog): Remove useless declaration.
10768 (xg_uses_old_file_dialog): Add suggested const attribute.
10769
10770 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10771
10772 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10773 (bidi_paragraph_init): Use it to limit search forward for a strong
10774 directional character in abnormally large paragraphs full of
10775 neutral or weak characters. (Bug#11943)
10776
10777 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10778
10779 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10780 the toolbar (Bug#9451).
10781 (xg_make_tool_item): Give the widget event box a transparent
10782 background.
10783
10784 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10785
10786 Cleanup basic allocation variables and functions.
10787 * alloc.c (ignore_warnings, init_intervals, init_float)
10788 (init_cons, init_symbol, init_marker): Remove.
10789 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10790 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10791 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10792 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10793 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10794 (staticidx, init_alloc_once, init_strings, free_ablock):
10795 Remove redundant initialization.
10796 * fns.c (init_weak_hash_tables): Remove.
10797 * lisp.h (init_weak_hash_tables): Remove prototype.
10798
10799 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10800
10801 Use zero_vector where appropriate.
10802 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10803 accordingly.
10804 * lisp.h (zero_vector): New declaration.
10805 * font.c (null_vector): Remove.
10806 (syms_of_font): Remove initialization and staticpro.
10807 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10808 * keymap.c (Faccessible_keymaps): Likewise.
10809
10810 2012-07-15 Leo Liu <sdl.web@gmail.com>
10811
10812 * fringe.c: Fix typo in comments.
10813
10814 2012-07-14 Leo Liu <sdl.web@gmail.com>
10815
10816 * fringe.c: Add a new bitmap exclamation-mark.
10817
10818 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10819
10820 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10821
10822 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10823 (HAVE_MENUS): Don't define, defined by editing config.in with
10824 msdos/sed2v2.inp.
10825 (GMALLOC_INHIBIT_VALLOC): Don't define.
10826 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10827
10828 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10829
10830 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10831
10832 2012-07-14 Glenn Morris <rgm@gnu.org>
10833
10834 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10835 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10836 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10837
10838 2012-07-13 Glenn Morris <rgm@gnu.org>
10839
10840 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10841
10842 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10843 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10844
10845 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10846
10847 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10848 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10849 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10850 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10851 where appropriate.
10852 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10853 as boolean expression.
10854 (x_set_window_size): Remove unused variable toolbar.
10855 (ns_get_color_default, ns_mod_to_lisp): Remove.
10856 (ns_mouse_position): Remove unused variables xchar and ychar.
10857 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10858 (ns_set_vertical_scroll_bar): Remove unused variable count.
10859 (ns_delete_terminal): Remove unused variable i.
10860 (ns_term_init): Remove unused variables r, g and b.
10861 (mouseDown): Remove unused variable window.
10862 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10863 (initFrameFromEmacs): Remove unused variable vbextra.
10864 (mouseEntered): Remove unused variables p and dpyinfo.
10865 (mouseExited): Remove unused variables p and r.
10866 (ns_define_frame_cursor, ns_clear_frame_area)
10867 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10868 (menuDown): Assign [sender tag] to variable and cast the variable.
10869
10870 * nsterm.h (menuDown): Add id as type to argument sender.
10871 (ns_display_info_for_name): Add Lisp_Object argument.
10872 (ns_term_init): Add Lisp_Object argument.
10873 (ns_map_event_to_object): Add void argument.
10874 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10875 prototype with arguments and only declare if __OBJC__.
10876 (nxatoms_of_nsselect): Add void argument.
10877 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10878 (ns_alloc_autorelease_pool): Add void argument.
10879 (ns_release_autorelease_pool): Add void* argument.
10880 (ns_get_defaults_value): Add const char* argument.
10881
10882 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10883 (initFromContents): Use SSDATA where appropriate.
10884 (ns_update_menubar): Add braces to ambigous if-else.
10885 (initWithTitle): Put () around assignment in if statement.
10886 (ns_menu_show): Remove unused variables window and keymap.
10887 (update_frame_tool_bar): Remove unused variable selected_p.
10888 (initWithContentRect): Remove unused variable this_cmd_name.
10889
10890 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10891 appropriate.
10892 (setXBMColor): Remove unused variable len.
10893 (setPixmapData): Put () around assignment in loop statement.
10894
10895 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10896 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10897 where appropriate.
10898 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10899 around assignment in loop statement.
10900 (nsfont_open): Remove unused variable i.
10901 (nsfont_open): Remove unused variable len.
10902 (nsfont_draw): Remove unused variable cs.
10903
10904 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10905 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10906 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10907 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10908 (Fns_font_name, Fns_perform_service)
10909 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10910 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10911 (ns_set_name): Remove unused variable view.
10912 (x_set_menu_bar_lines): Remove unused variable olines.
10913 (x_set_tool_bar_lines): Remove unused variable root_window.
10914 (Fns_list_colors): Put () around assignment in while statement.
10915 (Fns_perform_service): Remove unused variable len.
10916 (Fns_display_usable_bounds): Remove unused variable top.
10917 (syms_of_nsfns): Remove unused variable i.
10918
10919 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10920 memcpy (Bug#11907).
10921
10922 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10923
10924 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10925 and free it with DestroyExceptionInfo (Bug#11558).
10926
10927 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10928
10929 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10930 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10931 Set here, not in nt/config.nt.
10932
10933 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10934
10935 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10936 cursor overflow into the last glyph on display line when the right
10937 fringe is off. (Bug#11832)
10938
10939 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10940
10941 * xdisp.c (produce_special_glyphs): Now static.
10942 * dispextern.h (produce_special_glyphs): Remove decl.
10943
10944 2012-07-13 Glenn Morris <rgm@gnu.org>
10945
10946 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10947 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10948
10949 * s/usg5-4-common.h (USG, USG5):
10950 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10951 * s/sol2-6.h (SOLARIS2):
10952 * s/irix6-5.h (IRIX6_5):
10953 * s/hpux10-20.h (USG, USG5, HPUX):
10954 * s/gnu-linux.h (USG, GNU_LINUX):
10955 * s/freebsd.h (BSD_SYSTEM):
10956 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10957 * s/cygwin.h (CYGWIN):
10958 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10959 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10960
10961 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10962
10963 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10964
10965 2012-07-13 Glenn Morris <rgm@gnu.org>
10966
10967 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10968
10969 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10970
10971 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10972 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10973
10974 2012-07-12 Glenn Morris <rgm@gnu.org>
10975
10976 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10977
10978 * process.c (init_process_emacs): Rename from init_process.
10979 The old name is also the name of a Mach system call.
10980 * lisp.h, emacs.c: Update for this name change.
10981 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10982 longer needed.
10983
10984 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10987 memmove call that removes glyphs covered by the left truncation
10988 glyph. Improve commentary.
10989 (display_line): Fix display of continuation glyphs on GUI frames
10990 when the right fringe is turned off and variable-size fonts are
10991 used in the window. Move the code that appends a stretch glyph to
10992 produce_special_glyphs, so that it could be used for truncation
10993 and continuation glyphs alike.
10994 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10995 glyph of a suitably computed width, to align the special glyphs at
10996 the window margin. Code moved from display_line. (Bug#11832)
10997
10998 2012-07-12 Glenn Morris <rgm@gnu.org>
10999
11000 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
11001
11002 * s/gnu-linux.h, s/hpux10-20.h:
11003 Do not unconditionally define HAVE_XRMSETDATABASE.
11004
11005 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
11006
11007 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
11008
11009 Fix typos that broke OS X build.
11010 Reported by Randal L. Schwartz in
11011 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11012 * nsterm.m (ns_timeout): Add missing local decl.
11013 (ns_get_color): snprintf -> sprintf, to fix typo.
11014
11015 2012-07-12 Glenn Morris <rgm@gnu.org>
11016
11017 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11018 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11019 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11020 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11021
11022 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11023 Move PTY_OPEN to configure.
11024
11025 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11026 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11027 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11028
11029 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11030
11031 Use empty_unibyte_string where applicable.
11032 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11033 * lread.c (read1): Likewise.
11034 * xsettings.c (syms_of_xsettings): Likewise.
11035
11036 2012-07-12 Glenn Morris <rgm@gnu.org>
11037
11038 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11039 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11040 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11041 * s/hpux10-20.h (RUN_TIME_REMAP):
11042 * s/bsd-common.h (TABDLY): Move to configure.
11043
11044 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11045
11046 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11047
11048 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11049 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11050
11051 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11052
11053 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11054 * s/template.h: Move NARROWPROTO to configure.
11055
11056 2012-07-11 Glenn Morris <rgm@gnu.org>
11057
11058 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11059 unused since 2011-01-17 change to systty.h.
11060
11061 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11062 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11063 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11064
11065 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11066
11067 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11068
11069 2012-07-11 Glenn Morris <rgm@gnu.org>
11070
11071 * s/darwin.h, s/gnu-linux.h, s/template.h:
11072 Move INTERRUPT_INPUT to configure.
11073
11074 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11075
11076 Minor adjustments to interning code.
11077 * lisp.h (intern, intern_c_string): Redefine as static inline
11078 wrappers for intern_1 and intern_c_string_1, respectively.
11079 (intern_1, intern_c_string_1): Rename prototypes.
11080 * lread.c (intern_1, intern_c_string_1, oblookup):
11081 Simplify Vobarray checking.
11082 * font.c (font_intern_prop): Likewise. Adjust comment.
11083 * w32font.c (intern_font_name): Likewise.
11084
11085 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11086
11087 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11088
11089 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11090 of Fcar/Fcdr if possible.
11091 * font.c (check_otf_features): Likewise.
11092 * fontset.c (Fnew_fontset): Likewise.
11093 * gnutls.c (Fgnutls_boot): Likewise.
11094 * minibuf.c (read_minibuf): Likewise.
11095 * msdos.c (IT_set_frame_parameters): Likewise.
11096 * xmenu.c (Fx_popup_dialog): Likewise.
11097 * w32menu.c (Fx_popup_dialog): Likewise.
11098
11099 2012-07-11 Glenn Morris <rgm@gnu.org>
11100
11101 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11102 since nothing has defined it on these platforms.
11103
11104 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11105 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11106
11107 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11108 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11109 Move CLASH_DETECTION to configure.
11110
11111 * s/gnu.h: Remove file, which is now empty.
11112
11113 * s/gnu.h, s/gnu-linux.h:
11114 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11115
11116 2012-07-11 John Wiegley <johnw@newartisans.com>
11117
11118 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11119 function attribute, so we only use it if it exists in the
11120 compiler.
11121
11122 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11123
11124 Avoid call to strlen in fast_c_string_match_ignore_case.
11125 * search.c (fast_c_string_match_ignore_case): Change to use
11126 length argument. Adjust users accordingly.
11127 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11128
11129 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11130
11131 Assume mkdir, rmdir.
11132 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11133 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11134
11135 Assume rename.
11136 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11137
11138 Assume perror.
11139 * s/hpux10-20.h (HAVE_PERROR): Remove.
11140 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11141 Remove dummy definition, as this problem was obsolete long ago.
11142
11143 Assume strerror.
11144 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11145
11146 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11147
11148 Avoid calls to strlen in font processing functions.
11149 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11150 (font_open_by_name): Change to use length argument.
11151 Adjust users accordingly.
11152 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11153 Adjust prototypes.
11154 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11155 Change to return ptrdiff_t.
11156 (xfont_list_pattern, xfont_match): Use length returned by
11157 xfont_decode_coding_xlfd.
11158 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11159
11160 2012-07-11 Glenn Morris <rgm@gnu.org>
11161
11162 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11163 Move DONT_REOPEN_PTY to configure.
11164
11165 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11166 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11167
11168 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11169
11170 Remove "#define unix" that is no longer needed (Bug#11905).
11171 * s/aix4-2.h (unix): Remove; no longer needed.
11172
11173 EMACS_TIME simplification (Bug#11875).
11174 This replaces macros (which typically do not work in GDB)
11175 with functions, typedefs and enums, making the code easier to debug.
11176 The functional style also makes code easier to read and maintain.
11177 * systime.h: Include <sys/time.h> on all hosts, not just if
11178 WINDOWSNT, since 'struct timeval' is needed in general.
11179 (EMACS_TIME): Now a typedef, not a macro.
11180 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11181 not macros.
11182 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11183 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11184 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11185 (EMACS_TIME_LE): Now functions, not macros.
11186 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11187 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11188 which are not functions. All uses rewritten to use:
11189 (make_emacs_time): New function.
11190 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11191 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11192 not functions. All uses rewritten to use the following, respectively:
11193 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11194 (add_emacs_time, sub_emacs_time): New functions.
11195 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11196 * fileio.c (Fcopy_file):
11197 * xterm.c (XTflash): Get the current time closer to when it's used.
11198 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11199
11200 * bytecode.c (targets): Suppress -Woverride-init warnings.
11201
11202 Simplify by avoiding confusing use of strncpy etc.
11203 * doc.c (Fsnarf_documentation):
11204 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11205 * frame.c (Fmake_terminal_frame):
11206 * gtkutil.c (get_utf8_string):
11207 * lread.c (openp):
11208 * nsmenu.m (ns_update_menubar):
11209 * regex.c (regerror):
11210 Prefer memcpy to strncpy and strncat when either will do.
11211 * fileio.c (Fsubstitute_in_file_name):
11212 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11213 (menu_separator_name_p):
11214 * nsmenu.m (ns_update_menubar):
11215 Prefer memcmp to strncmp when either will do.
11216 * nsterm.m: Include <ftoastr.h>.
11217 (ns_get_color):
11218 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11219 Prefer snprintf to strncpy.
11220 * nsterm.m (ns_term_init):
11221 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11222 * nsterm.m (ns_term_init):
11223 Avoid the need for strncpy, by using build_string or
11224 make_unibyte_string directly. Use dtoastr, not snprintf.
11225 * process.c (Fmake_network_process): Diagnose service names that
11226 are too long, rather than silently truncating them or creating
11227 non-null-terminated names.
11228 (Fnetwork_interface_info): Likewise, for interface names.
11229 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11230 Prefer sprintf to strncat.
11231 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11232 Prefer vsnprintf to vsprintf + strncpy.
11233
11234 2012-07-10 Glenn Morris <rgm@gnu.org>
11235
11236 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11237 Clarify fallback case.
11238
11239 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11240
11241 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11242 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11243 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11244 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11245 where argument type is known to be a Lisp_Cons.
11246
11247 2012-07-10 Tom Tromey <tromey@redhat.com>
11248
11249 * bytecode.c (BYTE_CODE_THREADED): New macro.
11250 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11251 (enum byte_code_op): New type.
11252 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11253 (exec_byte_code): Use them. Use token threading when applicable.
11254
11255 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11256
11257 Optimize pure C strings initialization.
11258 * lisp.h (make_pure_string): Fix prototype.
11259 (build_pure_c_string): New function, defined as static inline. This
11260 provides a better opportunity to optimize away calls to strlen when
11261 the function is called with compile-time constant argument.
11262 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11263 argument, adjust users accordingly. Use build_pure_c_string where
11264 appropriate.
11265 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11266 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11267 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11268
11269 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11270
11271 Avoid calls to strlen in miscellaneous functions.
11272 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11273 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11274 * lread.c (openp): Likewise.
11275
11276 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11277
11278 Avoid calls to strlen in path processing functions.
11279 * fileio.c (file_name_as_directory): Add comment. Change to add
11280 srclen argument and return the length of result. Adjust users
11281 accordingly.
11282 (directory_file_name): Fix comment. Change to add srclen argument,
11283 swap 1st and 2nd arguments to obey the common convention.
11284 Adjust users accordingly.
11285 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11286
11287 2012-07-10 Glenn Morris <rgm@gnu.org>
11288
11289 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11290 Move PENDING_OUTPUT_COUNT definition to configure.
11291
11292 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11293 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11294 * s/gnu.h (DATA_START): Move definitions to configure.
11295
11296 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11297 We include usg5-4-common.h, which defines them both.
11298
11299 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11300 O_RDONLY already includes it).
11301
11302 Stop ns builds setting the EMACSLOADPATH environment variable.
11303 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11304 Now it does not set EMACSLOADPATH, just returns the load-path string.
11305 * nsterm.h: Update accordingly.
11306 * lread.c [HAVE_NS]: Include nsterm.h.
11307 (init_lread) [HAVE_NS]: Use ns_load_path.
11308 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11309
11310 2012-07-09 Glenn Morris <rgm@gnu.org>
11311
11312 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11313 since the included bsd-common.h does so.
11314
11315 Stop ns builds setting the EMACSPATH environment variable.
11316 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11317 (ns_init_paths): Do not set EMACSPATH.
11318 * nsterm.h (ns_exec_path): Add it.
11319 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11320 Use ns_exec_path.
11321
11322 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11323
11324 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11325
11326 * process.c (wait_reading_process_output): 'waitchannels' was unset
11327 when read_kbd || !NILP (wait_for_cell); fix this.
11328
11329 Add GCC-style 'const' attribute to functions that can use it.
11330 * character.h (char_resolve_modifier_mask):
11331 * keyboard.h (make_ctrl_char):
11332 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11333 (init_character_once, next_almost_prime, init_fns, init_image)
11334 (flush_pending_output, init_sound):
11335 * mem-limits.h (start_of_data):
11336 * menu.h (finish_menu_items):
11337 Add ATTRIBUTE_CONST.
11338 * emacs.c (DEFINE_DUMMY_FUNCTION):
11339 Declare the dummy function with ATTRIBUTE_CONST.
11340 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11341 Add decls with ATTRIBUTE_CONST.
11342
11343 Minor improvements to make_formatted_string.
11344 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11345 where int is good enough, as vsprintf returns an int.
11346 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11347
11348 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11349
11350 Use make_formatted_string to avoid double length calculation.
11351 * lisp.h (make_formatted_string): New prototype.
11352 * alloc.c (make_formatted_string): New function.
11353 * buffer.c (Fgenerate_new_buffer_name): Use it.
11354 * dbusbind.c (syms_of_dbusbind): Likewise.
11355 * editfns.c (Fcurrent_time_zone): Likewise.
11356 * filelock.c (get_boot_time): Likewise.
11357 * frame.c (make_terminal_frame, set_term_frame_name)
11358 (x_report_frame_params): Likewise.
11359 * image.c (gs_load): Likewise.
11360 * minibuf.c (get_minibuffer): Likewise.
11361 * msdos.c (dos_set_window_size): Likewise.
11362 * process.c (make_process): Likewise.
11363 * xdisp.c (ensure_echo_area_buffers): Likewise.
11364 * xsettings.c (apply_xft_settings): Likewise.
11365
11366 2012-07-09 Glenn Morris <rgm@gnu.org>
11367
11368 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11369 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11370 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11371 * nsterm.h (ns_etc_directory): Add it.
11372 * callproc.c [HAVE_NS]: Include nsterm.h.
11373 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11374
11375 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11376
11377 Move marker debugging code under MARKER_DEBUG.
11378 * marker.c (MARKER_DEBUG): Move marker debugging code under
11379 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11380 for bootstrap with --enable-checking (~3x slowdown reported
11381 by Juanma Barranquero <lekktu@gmail.com>).
11382 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11383
11384 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11385
11386 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11387 See <http://bugs.gnu.org/11825#29>.
11388
11389 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11390
11391 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11392 has no font, use the frame's font. (Bug#11813)
11393 (display_line): Add commentary about displaying truncation glyphs
11394 on GUI frames.
11395 (produce_special_glyphs): Move here from term.c.
11396
11397 * term.c (produce_special_glyphs): Move to xdisp.c.
11398
11399 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11400 section.
11401
11402 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11403
11404 * xdisp.c (display_line): Avoid warning about implicit declaration
11405 of FRAME_FONT.
11406
11407 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11408
11409 * lisp.h: Remove empty conditional.
11410
11411 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11412
11413 * lread.c (load_path_check): Now static.
11414
11415 Fix some minor --with-ns problems found by static checking.
11416 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11417 (x_set_font) [!HAVE_X_WINDOWS]:
11418 * image.c (xpm_load_image) [HAVE_NS]:
11419 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11420 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11421 Remove unused local.
11422 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11423 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11424 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11425 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11426 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11427 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11428 Fix pointer signedness problem.
11429 * xfaces.c (FRAME_X_FONT_TABLE):
11430 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11431
11432 2012-07-07 Glenn Morris <rgm@gnu.org>
11433
11434 * lread.c (load_path_check): New function, split from init_lread.
11435 (init_lread): Reorganize. Motivation:
11436 If EMACSLOADPATH is set, check/warn about that rather than the
11437 defaults, which we are not going to use. Hence we can remove
11438 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11439 Don't warn if site-lisp directories are missing.
11440 If not installed, start from a blank load-path, since
11441 PATH_LOADSEARCH refers to the eventual installation directories.
11442
11443 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11444
11445 Support truncation and continuation glyphs on GUI frames, when
11446 fringes are disabled. (Bug#11832)
11447 * xdisp.c (init_iterator): Get dimensions of truncation and
11448 continuation glyphs even if on GUI frames.
11449 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11450 or both, are absent.
11451 (start_display, move_it_in_display_line_to): Handle the case of a
11452 GUI frame without a fringe to display continuation or truncation
11453 glyphs.
11454 (insert_left_trunc_glyphs): Support GUI frames: make sure
11455 truncation glyphs overwrite enough glyphs from the current line to
11456 have sufficient space in pixels.
11457 (display_line): Support truncation and continuation glyphs on GUI
11458 frames. If some spare pixels are left on the line after inserting
11459 the truncation glyphs, fill that space with a stretch glyph of a
11460 suitably computed width.
11461
11462 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11463 produce_glyphs, to support GUI sessions.
11464
11465 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11466
11467 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11468
11469 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11470
11471 Do not require float-time's arg to fit in time_t (Bug#11825).
11472 This works better on hosts where time_t is unsigned, and where
11473 float-time is applied to the (negative) difference between two times.
11474 * editfns.c (decode_time_components): Last arg is now double *,
11475 not int *, and means to store all the result as a double, without
11476 worrying about whether the seconds part fits in time_t.
11477 All callers changed.
11478 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11479 All callers changed.
11480 (Ffloat_time): Do not fail merely because the specified time falls
11481 outside of time_t range.
11482
11483 2012-07-07 Glenn Morris <rgm@gnu.org>
11484
11485 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11486 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11487 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11488
11489 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11490
11491 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11492 Update dependencies.
11493
11494 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11495
11496 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11497
11498 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11499 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11500 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11501 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11502 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11503 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11504
11505 * xfont.c (compare_font_names): Redo to omit the need for casts.
11506
11507 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11508
11509 * xfns.c (Fx_change_window_property): Doc fix.
11510 * w32fns.c (Fx_change_window_property): Doc fix.
11511
11512 * w32fns.c (Fx_window_property): Accept the same arguments as the
11513 X Windows version. Doc fix.
11514 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11515
11516 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11517 Eli Zaretskii <eliz@gnu.org>
11518
11519 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11520 Windows-specific code from nt/config.nt moved here.
11521 Obsolete settings removed.
11522
11523 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 * process.c: Avoid unnecessary calls to gettime.
11526 (wait_reading_process_output): Don't get the time of day
11527 when gobbling data immediately and not waiting, as there's no need
11528 for it in that case. This removes a FIXME.
11529
11530 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11531
11532 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11533 is defined (Bug#11768).
11534
11535 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11536
11537 Fix marker debugging code.
11538 * marker.c (byte_char_debug_check): Do not perform the check
11539 if buffer is not multibyte.
11540 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11541 Call byte_char_debug_check with correct arguments.
11542
11543 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11544
11545 Compile marker debugging code only if ENABLE_CHECKING is defined.
11546 * marker.c (byte_char_debug_check, count_markers):
11547 Use only if ENABLE_CHECKING is defined.
11548 (byte_debug_flag): Remove.
11549 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11550 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11551
11552 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11553
11554 Avoid code repetition in marker-related functions.
11555 * marker.c (attach_marker): New function.
11556 (Fset_marker, set_marker_restricted, set_marker_both)
11557 (set_marker_restricted_both): Use it.
11558 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11559 Consistently rename charno to charpos.
11560 (marker_position): Add eassert.
11561 (marker_byte_position): Convert to eassert.
11562
11563 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11564
11565 Simplify list operations in unchain_overlay and unchain_marker.
11566 * buffer.c (unchain_overlay): Simplify. Add comment.
11567 * marker.c (unchain_marker): Simplify. Fix comments.
11568
11569 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11570
11571 Introduce fast path for the widely used marker operation.
11572 * alloc.c (build_marker): New function.
11573 * lisp.h (build_marker): New prototype.
11574 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11575 * composite.c (autocmp_chars): Likewise.
11576 * editfns.c (buildmark): Remove.
11577 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11578 (save_restriction_save): Use build_marker.
11579 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11580 * window.c (save_window_save): Likewise.
11581
11582 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11583
11584 Do not use Fdelete_overlay in delete_all_overlays
11585 to avoid redundant calls to unchain_overlay.
11586 * buffer.c (drop_overlay): New function.
11587 (delete_all_overlays, Fdelete_overlay): Use it.
11588 * minibuf.c (get_minibuffer): Fix comment.
11589
11590 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11591
11592 Port to OpenBSD 5.1 amd64.
11593 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11594 This is needed for OpenBSD, and should be harmless on all BSD systems.
11595 Also, include <sys/sysctl.h>, as it should be available on all
11596 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11597 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11598 use p_pid member, not kp_proc.pid.
11599
11600 2012-07-06 Glenn Morris <rgm@gnu.org>
11601
11602 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11603
11604 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11605
11606 More xmalloc and related cleanup.
11607 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11608 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11609 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11610 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11611 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11612 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11613 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11614 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11615 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11616 * xterm.c:
11617 Omit needless casts involving void * pointers and allocation.
11618 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11619 as the former is more robust if P's type is changed.
11620 Prefer xzalloc to xmalloc + memset 0.
11621 Simplify malloc-or-realloc to realloc.
11622 Don't worry about xmalloc returning a null pointer.
11623 Prefer xstrdup to xmalloc + strcpy.
11624 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11625 growing it.
11626 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11627 alloca of a constant.
11628
11629 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11630
11631 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11632 hscroll is larger than the line width. Fixes long and futile
11633 looping inside extend_face_to_end_of_line (on a TTY) producing
11634 glyphs that are not needed and thrown away.
11635
11636 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11637
11638 * marker.c (set_marker_restricted_both): Simplify by using
11639 clip_to_bounds.
11640
11641 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11642
11643 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11644
11645 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11646
11647 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11648 not defined (Bug#11768).
11649 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11650 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11651 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11652 followed by gtk_box_set_homogeneous (Bug#11768).
11653 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11654 (update_theme_scrollbar_width, xg_create_scroll_bar):
11655 Use gtk_scrollbar_new (Bug#11768).
11656 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11657 (is_box_type): New function (Bug#11768).
11658 (xg_tool_item_stale_p): Call is_box_type.
11659 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11660 with default display (Bug#11768).
11661
11662 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11663
11664 * xdisp.c (window_hscroll_limited): New function.
11665 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11666 coordinates when window's hscroll is set to insanely large
11667 values. (Bug#11857)
11668
11669 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11670
11671 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11672 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11673
11674 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11675
11676 Cleanup xmalloc.
11677 * lisp.h (xzalloc): New prototype. Omit needless casts.
11678 * alloc.c (xzalloc): New function. Omit needless casts.
11679 * charset.c: Omit needless casts. Convert all calls to
11680 xmalloc with following memset to xzalloc.
11681 * dispnew.c: Likewise.
11682 * fringe.c: Likewise.
11683 * image.c: Likewise.
11684 * sound.c: Likewise.
11685 * term.c: Likewise.
11686 * w32fns.c: Likewise.
11687 * w32font.c: Likewise.
11688 * w32term.c: Likewise.
11689 * xfaces.c: Likewise.
11690 * xfns.c: Likewise.
11691 * xterm.c: Likewise.
11692 * atimer.c: Omit needless casts.
11693 * buffer.c: Likewise.
11694 * callproc.c: Likewise.
11695 * ccl.c: Likewise.
11696 * coding.c: Likewise.
11697 * composite.c: Likewise.
11698 * doc.c: Likewise.
11699 * doprnt.c: Likewise.
11700 * editfns.c: Likewise.
11701 * emacs.c: Likewise.
11702 * eval.c: Likewise.
11703 * filelock.c: Likewise.
11704 * fns.c: Likewise.
11705 * gtkutil.c: Likewise.
11706 * keyboard.c: Likewise.
11707 * lisp.h: Likewise.
11708 * lread.c: Likewise.
11709 * minibuf.c: Likewise.
11710 * msdos.c: Likewise.
11711 * print.c: Likewise.
11712 * process.c: Likewise.
11713 * region-cache.c: Likewise.
11714 * search.c: Likewise.
11715 * sysdep.c: Likewise.
11716 * termcap.c: Likewise.
11717 * terminal.c: Likewise.
11718 * tparam.c: Likewise.
11719 * w16select.c: Likewise.
11720 * w32.c: Likewise.
11721 * w32reg.c: Likewise.
11722 * w32select.c: Likewise.
11723 * w32uniscribe.c: Likewise.
11724 * widget.c: Likewise.
11725 * xdisp.c: Likewise.
11726 * xmenu.c: Likewise.
11727 * xrdb.c: Likewise.
11728 * xselect.c: Likewise.
11729
11730 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11731
11732 * fileio.c (time_error_value): Check the right error number.
11733 Problem reported by Troels Nielsen in
11734 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11735
11736 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11737
11738 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11739 This should be fixed in a better way; see Eli Zaretskii in
11740 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11741 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11742
11743 * fileio.c (time_error_value): Rename from special_mtime.
11744 The old name's problems were noted by Eli Zaretskii in
11745 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11746
11747 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11748 This variable's comment says Emacs needs at least one GDB-visible
11749 symbol of type enum pvec_type, to work around GDB problems.
11750 The symbol's value doesn't matter.
11751
11752 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11753 that causes compilation to fail on pre-C99 compilers.
11754
11755 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11756
11757 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11758 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11759
11760 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11761
11762 * buffer.c (init_buffer_once): Fix initialization of
11763 headers for buffer_defaults and buffer_local_symbols.
11764 Reported by Juanma Barranquero <lekktu@gmail.com>.
11765
11766 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11767
11768 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11769 * lisp.h (enum pvec_type): Use fewer bits.
11770 (PSEUDOVECTOR_SIZE_BITS): New constant.
11771 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11772 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11773 change in pvec_type.
11774 (PSEUDOVECTOR_TYPEP): New macro.
11775 (TYPED_PSEUDOVECTORP): Use it.
11776 * fns.c (internal_equal): Adapt code to extract pvectype.
11777 * emacs.c (gdb_pvec_type): Update type.
11778 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11779 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11780 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11781 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11782 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11783 abusing vector->header.next.nbytes.
11784 (live_vector_p): Use PVEC_TYPE.
11785 (mark_object): Adapt code to extract pvectype. Use switch.
11786
11787 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11788
11789 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11790 Tighten new eassert a bit.
11791
11792 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11793
11794 Fix compilation with --enable-gcc-warnings and -O1
11795 optimization level.
11796 * doprnt.c (doprnt): Change type of tem to int, initialize
11797 to avoid compiler warning. Add eassert.
11798 * search.c (simple_search): Initialize match_byte to avoid
11799 compiler warning. Add eassert.
11800
11801 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11802
11803 Avoid weird behavior with large horizontal scrolls.
11804 Without this change, for example, large hscroll values would
11805 mess up Emacs's display on Fedora 15 x86, presumably due to
11806 overflows in int calculations in the display code.
11807 Also, if buffers had long lines, Emacs would freeze.
11808 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11809 (set_window_hscroll): New function, containing the old guts of
11810 Fset_window_hscroll. Return the clipped value.
11811 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11812 This avoids the need to check against PTRDIFF_MAX.
11813
11814 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11815
11816 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11817
11818 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11819
11820 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11821
11822 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11823 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11824 since GCC 4.4.6 issues a bogus warning for them.
11825
11826 Fix bugs in file timestamp newness comparisons.
11827 * fileio.c (Ffile_newer_than_file_p):
11828 * lread.c (Fload): Use full timestamp resolution of files,
11829 not just the 1-second resolution, so that files that are only
11830 slightly newer still count as newer.
11831 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11832 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11833
11834 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11835
11836 * fileio.c: Improve handling of file time marker. (Bug#11852)
11837 (special_mtime): New function.
11838 (Finsert_file_contents, Fverify_visited_file_modtime):
11839 Use it to set special mtime values consistently.
11840
11841 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11842
11843 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11844 marker for non-existing file. (Bug#11852)
11845
11846 2012-07-03 Glenn Morris <rgm@gnu.org>
11847
11848 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11849 and did not make it into globals.h).
11850
11851 2012-07-03 Tom Tromey <tromey@redhat.com>
11852
11853 * window.c (Fset_window_margins, Fset_window_fringes)
11854 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11855 * textprop.c (Fprevious_property_change): No longer static.
11856 * syntax.c (Fsyntax_table_p): No longer static.
11857 * process.c (Fget_process, Fprocess_datagram_address): No longer
11858 static.
11859 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11860 * keyboard.c (Fcommand_execute): No longer static.
11861 Remove EXFUN.
11862 * insdel.c (Fcombine_after_change_execute): No longer static.
11863 * image.c (Finit_image_library): No longer static.
11864 * fileio.c (Fmake_symbolic_link): No longer static.
11865 * eval.c (Ffetch_bytecode): No longer static.
11866 * editfns.c (Fuser_full_name): No longer static.
11867 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11868 No longer static.
11869 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11870 static.
11871 * dired.c (Ffile_attributes): No longer static.
11872 * composite.c (Fcomposition_get_gstring): No longer static.
11873 * callproc.c (Fgetenv_internal): No longer static.
11874
11875 * ccl.h: Remove EXFUNs.
11876 * buffer.h: Remove EXFUNs.
11877 * dispextern.h: Remove EXFUNs.
11878 * intervals.h: Remove EXFUNs.
11879 * fontset.h: Remove EXFUN.
11880 * font.h: Remove EXFUNs.
11881 * dosfns.c (system_process_attributes): Remove EXFUN.
11882 * keymap.h: Remove EXFUNs.
11883 * lisp.h: Remove EXFUNs.
11884 * w32term.h: Remove EXFUNs.
11885 * window.h: Remove EXFUNs.
11886 * xsettings.h: Remove EXFUN.
11887 * xterm.h: Remove EXFUN.
11888
11889 2012-07-03 Glenn Morris <rgm@gnu.org>
11890
11891 * lisp.h (Frandom): Make it visible to C.
11892 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11893 buffer for invisible buffers. (Bug#1229)
11894
11895 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11896
11897 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11898 values which aren't power of 2.
11899 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11900 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11901 accordingly.
11902
11903 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11904
11905 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11906
11907 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11908
11909 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11910
11911 * alloc.c (allocate_vector_block): Remove redundant
11912 calls to mallopt if DOUG_LEA_MALLOC is defined.
11913 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11914 avoid calls to mallopt if zero_vector is returned.
11915
11916 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11917
11918 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11919 is enabled, avoid dereferencing NULL current_sblock if
11920 running undumped.
11921
11922 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11923
11924 Cleanup basic buffer management.
11925 * buffer.h (struct buffer): Change layout to use generic vector
11926 marking code. Fix some comments. Change type of 'clip_changed'
11927 to bitfield. Remove unused #ifndef old.
11928 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11929 (GET_OVERLAYS_AT): Fix indentation.
11930 (for_each_per_buffer_object_at): New macro.
11931 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11932 (Fbuffer_local_variables): Use it.
11933 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11934 * alloc.c (allocate_buffer): Adjust to match new layout of
11935 struct buffer. Fix comment.
11936 (mark_overlay): New function.
11937 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11938 Lisp area of struct buffer.
11939 (mark_object): Use it. Adjust marking of misc objects
11940 and related comments.
11941
11942 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11943
11944 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11945 wrapper that is not needed because the wrapped code is a no-op (zero
11946 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11947 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11948
11949 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11950
11951 * alloc.c (mark_buffer): Simplify. Remove prototype.
11952 (mark_object): Add comment. Reorganize marking of vector-like
11953 objects. Use CHECK_LIVE for all vector-like objects except buffers
11954 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11955 Avoid redundant calls to mark_vectorlike for bool vectors.
11956
11957 2012-06-30 Glenn Morris <rgm@gnu.org>
11958
11959 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11960
11961 * epaths.in (PATH_SITELOADSEARCH): New.
11962 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11963 This is rather than relying on --enable-locallisppath elements
11964 having "site-lisp" in their names. (Bug#10208#25, 11658)
11965
11966 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11967
11968 * w32proc.c (sys_select): Accept and ignore one more argument.
11969
11970 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11971
11972 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11973 (pselect) [!MS_DOS]: Redirect to sys_select.
11974
11975 * sysdep.c: Don't include dos.h and dosfns.h.
11976
11977 * process.c (sys_select):
11978 * msdos.c (sys_select): Accept one more argument and ignore it.
11979
11980 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11981 adapt data types and code to that.
11982
11983 * dosfns.c:
11984 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11985 which clashes with the gnulib function of the same name.
11986
11987 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11988
11989 * font.c (font_style_to_value, font_style_symbolic)
11990 (font_prop_validate_style): Add type checks for values in
11991 font_style_table.
11992
11993 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11994 argument.
11995 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11996 uses.
11997
11998 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11999
12000 * xdisp.c (try_window_id): Undo last change.
12001
12002 * w32.c (getwd): Adjust commentary about startup_dir.
12003 (init_environment): Always call sys_access, even in non-MSVC
12004 builds. Don't chdir to the directory of the Emacs executable.
12005 This undoes code from 1997 which was justified by the need to
12006 "avoid conflicts when removing and renaming directories". But its
12007 downside was that every relative file name was being interpreted
12008 relative to the directory of the Emacs executable, which can never
12009 be TRT. In particular, it broke sys_access when called with
12010 relative file names.
12011 (sys_access): Map GetLastError to errno.
12012
12013 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12014
12015 * window.h (struct window): Change type of 'fringes_outside_margins'
12016 to bitfield. Fix comment. Adjust users accordingly.
12017 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12018 Adjust comment.
12019 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12020 to ptrdiff_t.
12021
12022 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12023
12024 * gnutls.c (emacs_gnutls_handshake):
12025 Add QUIT to make the loop interruptible.
12026
12027 2012-06-29 Glenn Morris <rgm@gnu.org>
12028
12029 * charset.c (init_charset): Make lack of etc/charsets fatal.
12030
12031 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12032
12033 * editfns.c (region_limit): Fix type mismatch.
12034
12035 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12036
12037 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12038 undefined. Convert from xassert to eassert.
12039 * nsmenu.m: Convert from xassert to eassert.
12040 * nsterm.m: Likewise.
12041
12042 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12043
12044 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12045
12046 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12047
12048 Avoid integer overflow on scroll-left and scroll-right.
12049 * window.c (HSCROLL_MAX): New macro.
12050 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12051 overflow when requested scroll falls outside ptrdiff_t range.
12052
12053 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12054
12055 * window.h (struct window): Change type of 'hscroll',
12056 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12057 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12058 Adjust users accordingly.
12059 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12060 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12061 from EMACS_INT to ptrdiff_t.
12062 (make_window): Omit redundant initialization.
12063
12064 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
12065
12066 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12067
12068 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12069
12070 * window.h (struct window): Change type of 'use_time' and
12071 'sequence_number' from Lisp_Object to int.
12072 * frame.c (make_frame): Adjust users accordingly.
12073 * print.c (print_object): Likewise.
12074 * window.c (select_window, Fwindow_use_time, make_parent_window)
12075 (make_window): Likewise.
12076
12077 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12078
12079 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12080 enabled with --enable-checking=[all,glyphs] configure option.
12081 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12082 adjust comments accordingly.
12083 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12084 undefined, adjust comments accordingly.
12085 * image.c: Likewise.
12086 * scroll.c: Likewise.
12087 * w32fns.c: Likewise.
12088 * w32term.c: Likewise.
12089 * xdisp.c: Likewise.
12090 * xfaces.c: Likewise.
12091 * xfns.c: Likewise.
12092 * xterm.c: Likewise.
12093
12094 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12095
12096 Generalize run-time debugging checks.
12097 * dispextern.h (XASSERTS): Remove.
12098 * fontset.c (xassert): Remove.
12099 Convert from xassert to eassert.
12100 * alloc.c: Convert from xassert to eassert.
12101 * bidi.c: Likewise.
12102 * dispnew.c: Likewise.
12103 * fns.c: Likewise.
12104 * fringe.c: Likewise.
12105 * ftfont.c: Likewise.
12106 * gtkutil.c: Likewise.
12107 * image.c: Likewise.
12108 * keyboard.c: Likewise.
12109 * menu.c: Likewise.
12110 * process.c: Likewise.
12111 * scroll.c: Likewise.
12112 * sound.c: Likewise.
12113 * term.c: Likewise.
12114 * w32console.c: Likewise.
12115 * w32fns.c: Likewise.
12116 * w32term.c: Likewise.
12117 * window.c: Likewise.
12118 * xdisp.c: Likewise.
12119 * xfaces.c: Likewise.
12120 * xfns.c: Likewise.
12121 * xselect.c: Likewise.
12122 * xterm.c: Likewise.
12123
12124 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12125
12126 * fns.c (maybe_resize_hash_table): Output message when growing the
12127 purify-hashtable.
12128
12129 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12130
12131 * alloc.c (allocate_string_data): Remove dead code.
12132 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12133 avoid GCC warning about unused macro.
12134
12135 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12136
12137 * alloc.c (allocate_string): Omit intervals initialization.
12138 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12139 as in make_pure_string and make_pure_c_string.
12140
12141 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12142
12143 * alloc.c (allocate_string): Fix last change.
12144
12145 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12146
12147 * alloc.c (allocate_string): Remove two redundant calls
12148 to memset, add explicit initialization where appropriate.
12149
12150 2012-06-27 Glenn Morris <rgm@gnu.org>
12151
12152 * lisp.mk (lisp): Remove paths.elc.
12153
12154 2012-06-27 Chong Yidong <cyd@gnu.org>
12155
12156 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12157
12158 2012-06-26 John Wiegley <johnw@newartisans.com>
12159
12160 * unexmacosx.c (copy_data_segment): Add two section names used
12161 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12162
12163 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12164 when building with Clang.
12165
12166 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12167
12168 * eval.c (Fapply): Allow calling it with a single argument.
12169
12170 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12171
12172 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12173 _stricmp and _strnicmp.
12174 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12175
12176 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12177
12178 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12179 allocated window.
12180 (allocate_process): Likewise for new process.
12181 (allocate_terminal): Change to use offsetof.
12182 (allocate_frame): Likewise.
12183 * frame.c (make_frame): Omit redundant initialization.
12184 * window.c (make_parent_window): Use memset.
12185 (make_window): Omit redundant initialization.
12186 * process.c (make_process): Omit redundant initialization.
12187 * terminal.c (create_terminal): Likewise.
12188
12189 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12190
12191 * term.c (delete_tty): Remove redundant call to memset.
12192
12193 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12194
12195 * alloc.c: Remove build_string.
12196 * lisp.h: Define build_string as static inline. This provides
12197 a better opportunity to optimize away calls to strlen when the
12198 function is called with compile-time constant argument.
12199 * image.c (imagemagick_error): Convert to build_string.
12200 * w32proc.c (sys_spawnve): Likewise.
12201 * xterm.c (x_term_init): Likewise.
12202
12203 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12204
12205 Use sprintf return value instead of invoking strlen on result.
12206 In the old days this wasn't portable, since some sprintf
12207 implementations returned char *. But they died out years ago and
12208 Emacs already assumes sprintf returns int.
12209 Similarly for float_to_string.
12210 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12211 * ccl.c (ccl_driver):
12212 * character.c (string_escape_byte8):
12213 * data.c (Fnumber_to_string):
12214 * doprnt.c (doprnt):
12215 * print.c (print_object):
12216 * xdisp.c (message_dolog):
12217 * xfns.c (syms_of_xfns):
12218 Use sprintf or float_to_string result to avoid need to call strlen.
12219 * data.c (Fnumber_to_string):
12220 Use make_unibyte_string, since the string must be ASCII.
12221 * lisp.h, print.c (float_to_string): Now returns int length.
12222 * term.c (produce_glyphless_glyph):
12223 Use sprintf result rather than recomputing it.
12224
12225 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12226 * Makefile.in (ALL_CFLAGS):
12227 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12228 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12229
12230 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12231
12232 * dispextern.h (xstrcasecmp): Define to library function
12233 strcasecmp if available.
12234 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12235
12236 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12237
12238 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12239 Avoid comma operator.
12240 * menu.c (push_submenu_start, push_submenu_end)
12241 (push_left_right_boundary, push_menu_pane): Likewise.
12242 * msdos.c (dos_rawgetc): Likewise.
12243
12244 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12245
12246 * xfns.c (xic_create_fontsetname): Remove redundant calls
12247 to memset.
12248
12249 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12250
12251 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12252 sprintf already null-terminates its output.
12253
12254 * xfns.c (x_window): Remove redundant cast.
12255
12256 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12257
12258 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12259 `const char *' to `char *' to avoid compiler warning.
12260
12261 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12262
12263 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12264 instead of truncating it to 63 (admittedly a generous limit).
12265
12266 * process.c: Fix spelling and caps in comments.
12267
12268 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12269
12270 * emacs.c (setpgrp): Remove definition, unused.
12271 * sysdep.c (setpgrp): Remove definition, not used in this file.
12272
12273 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12274
12275 * makefile.w32-in: Update dependencies.
12276
12277 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12278
12279 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12280 (SYSTIME_H): Add nt/inc/sys/time.h.
12281
12282 * systime.h [WINDOWSNT]: Include sys/time.h.
12283
12284 * s/ms-w32.h (struct timespec): Definition moved from
12285 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12286
12287 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12288
12289 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12290 * buffer.h (buffer_slot_type_mismatch):
12291 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12292 * eval.c (unwind_to_catch):
12293 * image.c (my_png_error, my_error_exit):
12294 * keyboard.c (quit_throw_to_read_char, user_error)
12295 (Fexit_recursive_edit, Fabort_recursive_edit):
12296 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12297 (wrong_type_argument, buffer_overflow, __executable_start)
12298 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12299 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12300 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12301 (fatal):
12302 (child_setup) [!DOS_NT]:
12303 * lread.c (end_of_file_error, invalid_syntax):
12304 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12305 * puresize.h (pure_write_error):
12306 * search.c (matcher_overflow):
12307 * sound.c (sound_perror, alsa_sound_perror):
12308 * sysdep.c, syssignal.h (croak):
12309 * term.c (maybe_fatal, vfatal):
12310 * textprop.c (text_read_only):
12311 * undo.c (user_error):
12312 * unexmacosx.c (unexec_error):
12313 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12314 Use _Noreturn rather than NO_RETURN.
12315 No need for separate decl merely because of _Noreturn.
12316 * sound.c (sound_warning, parse_sound):
12317 Remove unnecessary forward decls.
12318
12319 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12320
12321 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12322 * lisp.h (WAIT_READING_MAX): New macro.
12323 * dispnew.c (Fsleep_for, sit_for):
12324 * keyboard.c (kbd_buffer_get_event):
12325 * process.c (Faccept_process_output):
12326 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12327 This improves on the previous patch, which introduced a bug
12328 when time_t is unsigned and as wide as intmax_t.
12329 See <http://bugs.gnu.org/9000#51>.
12330
12331 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12332
12333 * dispnew.c (sit_for, Fsleep_for):
12334 * keyboard.c (kbd_buffer_get_event):
12335 * process.c (Faccept_process_output): Avoid compiler warnings when
12336 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12337
12338 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12339
12340 * makefile.w32-in: Update dependencies.
12341
12342 * w32.c (ltime): Add return type and declare static.
12343 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12344
12345 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12348 Privately reported by Herbert J. Skuhra.
12349 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12350 All uses changed.
12351 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12352 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12353
12354 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12355
12356 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12357 last argument of make_unibyte_string.
12358
12359 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12360 language ID in the event parameters.
12361
12362 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12363 event.code, not the obscure "character set ID".
12364
12365 2012-06-23 Chong Yidong <cyd@gnu.org>
12366
12367 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12368
12369 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12370
12371 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12372 * w32.c (fdutimens): New function.
12373
12374 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12375
12376 * s/ms-w32.h (pselect): Redirect to sys_select.
12377
12378 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12379
12380 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12381 in the logic of incrementing and decrementing the value of
12382 use_relocatable_buffers.
12383
12384 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12385
12386 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12387 Privately reported by Herbert J. Skuhra.
12388 [__FreeBSD__]: Remove "*/" typo after "#include".
12389 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12390 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12391 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12392 Don't assume EMACS_TIME and struct timeval are the same type.
12393
12394 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12395
12396 Support higher-resolution time stamps (Bug#9000).
12397 The time stamps are only nanosecond-resolution at the C level,
12398 since that's the best that any real-world system supports now.
12399 But they are picosecond-resolution at the Lisp level, as that's
12400 easy, and leaves room for future OS improvements.
12401
12402 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12403 (LIBES): Use it.
12404
12405 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12406 Don't get current time unless it's needed.
12407
12408 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12409 now provides it if it's absent.
12410 (start_atimer): Port to higher-res time stamps.
12411 Check for time stamp overflow. Don't get current time more
12412 often than is needed.
12413
12414 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12415 Include systime.h, not time.h.
12416 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12417
12418 * dired.c: Include stat-time.h.
12419 (Ffile-attributes): File times now have higher resolution.
12420
12421 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12422 (struct image): Timestamp now has higher resolution.
12423
12424 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12425 has at least microseconds now. All uses removed.
12426 (update_frame, update_single_window, update_window, update_frame_1)
12427 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12428 (duration_to_sec_usec): Remove; no longer needed.
12429
12430 * editfns.c (time_overflow): Now extern.
12431 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12432 (float-time, Fformat_time_string, Fcurrent_time_string)
12433 (Fcurrent_time_zone): Accept and generate higher-resolution
12434 time stamps.
12435 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12436 (decode_time_components, lisp_seconds_argument): New functions.
12437 (make_time): Now static.
12438 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12439 Report an error if the time is invalid, rather than having the caller
12440 do that.
12441
12442 * fileio.c: Include <stat-time.h>
12443 (Fcopy_file): Copy higher-resolution time stamps.
12444 Prefer to set the time stamp via a file descriptor if that works.
12445 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12446 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12447 (Fvisited_file_modtime, Fset_visited_file_modtime):
12448 Support higher-resolution time stamps.
12449
12450 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12451
12452 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12453
12454 * image.c (prepare_image_for_display, clear_image_cache)
12455 (lookup_image): Port to higer-resolution time stamps.
12456
12457 * keyboard.c (start_polling, bind_polling_period):
12458 Check for time stamp overflow.
12459 (read_char, kbd_buffer_get_event, timer_start_idle)
12460 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12461 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12462 Port to higher-resolution time stamps. Do not assume time_t is signed.
12463 (decode_timer): New function. Timers are now vectors of length 9,
12464 not 8, to accommodate the picosecond component.
12465 (timer_check_2): Use it.
12466
12467 * nsterm.m (select_timeout, timeval_subtract): Remove.
12468 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12469 as they're a bit more accurate and handle overflow better.
12470 (ns_select): Change prototype to be compatible with pselect.
12471 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12472 * nsterm.h (ns_select): Adjust prototype.
12473
12474 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12475 us-resolution time stamps.
12476 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12477
12478 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12479
12480 * lisp.h (time_overflow): New decl.
12481 (wait_reading_process_output): First arg is now intmax_t, not int,
12482 to accommodate larger waits.
12483
12484 * process.h (struct Lisp_Process.read_output_delay):
12485 Now counts nanoseconds, not microseconds.
12486 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12487 EMACS_HAS_USECS.
12488 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12489 (wait_reading_process_output):
12490 Port to ns-resolution time stamps.
12491 (Faccept_process_output, wait_reading_process_output):
12492 Check for time stamp overflow. Do not assume time_t is signed.
12493 (select_wrapper): Remove; we now use pselect.
12494 (Fprocess_attributes): Now generates ns-resolution time stamps.
12495
12496 * sysdep.c: Include utimens.h. Don't include utime.h
12497 or worry about struct utimbuf; gnulib does that for us now.
12498 (gettimeofday): Remove; gnulib provides a substitute.
12499 (make_timeval): New function.
12500 (set_file_times): Now sets ns-resolution time stamps.
12501 New arg FD; all uses changed.
12502 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12503 (system_process_attributes):
12504 Now returns ns-resolution time stamp. All uses changed.
12505 Check for time stamp overflow.
12506
12507 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12508 provides a substitute now.
12509
12510 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12511 since it guarantees struct timespec.
12512 (EMACS_TIME): Now struct timespec, so that we can support
12513 ns-resolution time stamps.
12514 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12515 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12516 (EMACS_USECS): Remove.
12517 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12518 so multiply the arg by 1000 before storing it.
12519 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12520 New macros.
12521 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12522 Port to ns-resolution time stamps.
12523 (EMACS_TIME_NEG_P): Remove; replaced by....
12524 (EMACS_TIME_SIGN): New macro.
12525 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12526 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12527 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12528 (make_timeval, make_lisp_time, decode_time_components): New decls.
12529 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12530 that it mishandled time_t overflow. You can't compare by subtracting!
12531 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12532 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12533
12534 * term.c: Include <sys/time.h>.
12535 (timeval_to_Time): New function, for proper overflow wraparound.
12536 (term_mouse_position, term_mouse_click): Use it.
12537
12538 * undo.c (record_first_change): Support higher-resolution time stamps
12539 in the undo buffer.
12540 (Fprimitive_undo): Use them when restoring time stamps.
12541
12542 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12543 (w32_get_internal_run_time):
12544 Port to higher-resolution Emacs time stamps.
12545 (ltime): Now accepts single 64-bit integer, as that's more convenient
12546 for callers.
12547
12548 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12549
12550 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12551 for compatibility with pselect. Support ns-resolution time stamps.
12552
12553 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12554
12555 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12556 Check for time stamp overflow, and support ns-resolution time stamps.
12557
12558 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12559 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12560 (timeval_subtract): Remove; no longer needed.
12561 (XTflash, XTring_bell, x_wait_for_event):
12562 Port to ns-resolution time stamps. Don't assume time_t is signed.
12563
12564 2012-06-22 Chong Yidong <cyd@gnu.org>
12565
12566 * xdisp.c (x_consider_frame_title): Revert last change.
12567
12568 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12569
12570 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12571 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12572 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12573 staticidx goes up to 1597 out of 1600 = 0x640.)
12574
12575 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12576
12577 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12578 Otherwise, the umask might be mistakenly 0 while handling input signals.
12579
12580 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12581
12582 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12583
12584 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12585
12586 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12587 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12588 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12589 access to `contents' member of Lisp_Vector objects with AREF and ASET
12590 where appropriate.
12591
12592 2012-06-19 Chong Yidong <cyd@gnu.org>
12593
12594 * frame.c (delete_frame): When selecting a frame on a different
12595 text terminal, do not alter the terminal's top-frame.
12596
12597 * xdisp.c (format_mode_line_unwind_data): Record the target
12598 frame's selected window and its terminal's top-frame.
12599 (unwind_format_mode_line): Restore them.
12600 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12601 Callers changed.
12602 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12603 since tty frames can be explicitly named.
12604 (prepare_menu_bars): Likewise.
12605
12606 * term.c (Ftty_top_frame): New function.
12607
12608 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12609
12610 Port byte-code-meter to modern targets.
12611 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12612 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12613 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12614 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12615 (METER_1, METER_2): Simplify.
12616
12617 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12618
12619 * data.c (Fdefalias): Return `symbol' (bug#11686).
12620
12621 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12622
12623 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12624 gets killed during executing of this function (Bug#11665).
12625 Try to always return Qt when the buffer has been actually killed.
12626 (Vkill_buffer_query_functions): In doc-string say that functions
12627 run by this hook should not change the current buffer.
12628
12629 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12630
12631 Fix recently-introduced process.c problems found by static checking.
12632 * process.c (write_queue_push, write_queue_pop, send_process):
12633 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12634 (write_queue_pop): Fix pointer signedness problem.
12635 (send_process): Remove unused local.
12636
12637 2012-06-17 Chong Yidong <cyd@gnu.org>
12638
12639 * xdisp.c (redisplay_internal): No need to redisplay terminal
12640 frames that are not on top.
12641
12642 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12643
12644 * process.c (make_process): Initialize write_queue.
12645 (write_queue_push, write_queue_pop): New functions.
12646 (send_process): Use them to maintain correct ordering of process
12647 writes (Bug#10815).
12648
12649 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12650
12651 * lisp.h (eassert): Assume C89 or later.
12652 This removes the need for CHECK.
12653 (CHECK): Remove. Its comments about always evaluating its
12654 argument were confusing, as 'eassert' typically does not evaluate
12655 its argument.
12656
12657 * coding.c (produce_chars): Use ptrdiff_t, not int.
12658
12659 * xterm.c (x_draw_underwave): Check for integer overflow.
12660 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12661
12662 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12663
12664 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12665 referenced (Bug#11583).
12666
12667 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12668
12669 Implement wave-style variant of underlining.
12670 * dispextern.h (face_underline_type): New enum.
12671 (face): Add field for underline type.
12672 * nsterm.m (ns_draw_underwave): New function.
12673 (ns_draw_text_decoration): Use it.
12674 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12675 New functions.
12676 (x_draw_glyph_string): Use them.
12677 * xfaces.c (Qline, Qwave): New Lisp objects.
12678 (check_lface_attrs, merge_face_ref)
12679 (Finternal_set_lisp_face_attribute, realize_x_face):
12680 Handle wave-style underline face attributes.
12681 * xterm.c (x_draw_underwave): New function.
12682 (x_draw_glyph_string): Use it.
12683
12684 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12685
12686 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12687 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12688 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12689 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12690 ($(BLD)/w32select.$(O)): Update dependencies.
12691
12692 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12693
12694 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12695 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12696 * character.c (_fetch_multibyte_char_p): Remove.
12697 * alloc.c: Include "character.h" before "buffer.h".
12698 * bidi.c: Likewise.
12699 * buffer.c: Likewise.
12700 * bytecode.c: Likewise.
12701 * callint.c: Likewise.
12702 * callproc.c: Likewise.
12703 * casefiddle.c: Likewise.
12704 * casetab.c: Likewise.
12705 * category.c: Likewise.
12706 * cmds.c: Likewise.
12707 * coding.c: Likewise.
12708 * composite.c: Likewise.
12709 * dired.c: Likewise.
12710 * dispnew.c: Likewise.
12711 * doc.c: Likewise.
12712 * dosfns.c: Likewise.
12713 * editfns.c: Likewise.
12714 * emacs.c: Likewise.
12715 * fileio.c: Likewise.
12716 * filelock.c: Likewise.
12717 * font.c: Likewise.
12718 * fontset.c: Likewise.
12719 * fringe.c: Likewise.
12720 * indent.c: Likewise.
12721 * insdel.c: Likewise.
12722 * intervals.c: Likewise.
12723 * keyboard.c: Likewise.
12724 * keymap.c: Likewise.
12725 * lread.c: Likewise.
12726 * macros.c: Likewise.
12727 * marker.c: Likewise.
12728 * minibuf.c: Likewise.
12729 * nsfns.m: Likewise.
12730 * nsmenu.m: Likewise.
12731 * print.c: Likewise.
12732 * process.c: Likewise.
12733 * regex.c: Likewise.
12734 * region-cache.c: Likewise.
12735 * search.c: Likewise.
12736 * syntax.c: Likewise.
12737 * term.c: Likewise.
12738 * textprop.c: Likewise.
12739 * undo.c: Likewise.
12740 * unexsol.c: Likewise.
12741 * w16select.c: Likewise.
12742 * w32fns.c: Likewise.
12743 * w32menu.c: Likewise.
12744 * window.c: Likewise.
12745 * xdisp.c: Likewise.
12746 * xfns.c: Likewise.
12747 * xmenu.c: Likewise.
12748 * xml.c: Likewise.
12749 * xselect.c: Likewise.
12750
12751 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12752
12753 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12754 If all the glyphs of the glyph row came from strings, and we have no
12755 cursor positioning clues, put the cursor on the first glyph of the
12756 row.
12757 (handle_face_prop): Use chunk-relative overlay string index when
12758 indexing into it->string_overlays array. (Bug#11653)
12759 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12760 the rightmost. (Bug#11720)
12761
12762 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12763
12764 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12765 (CATEGORY_MEMBER): Enforce 1/0 value.
12766 * category.c (_temp_category_set): Remove.
12767
12768 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12769
12770 * window.c (Fdelete_other_windows_internal)
12771 (Fdelete_window_internal): Don't access frame's mouse highlight
12772 info of the initial frame. (Bug#11677)
12773
12774 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12775
12776 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12777 Assume USE_2_TAGS_FOR_INTS.
12778 (xreload): Adjust $tagmask width to match recent lisp.h change.
12779
12780 Simplify lisp.h in minor ways that should not affect code.
12781 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12782 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12783 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12784 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12785 (INTTYPEBITS): New macro, for clarity.
12786 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12787 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12788 Simplify now that USE_LSB_TAG is always defined.
12789 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12790 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12791
12792 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12793
12794 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12795
12796 2012-06-13 Glenn Morris <rgm@gnu.org>
12797
12798 * s/bsd-common.h (BSD4_3):
12799 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12800
12801 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12802
12803 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12804 instead of union.
12805 (XLI, XIL): Define.
12806 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12807 Use them.
12808 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12809 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12810 * alloc.c (widen_to_Lisp_Object): Remove.
12811 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12812 * frame.c (delete_frame): Remove outdated comment.
12813 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12814 USE_LISP_UNION_TYPE.
12815 (Fw32_unregister_hot_key): Likewise.
12816 (Fw32_toggle_lock_key): Likewise.
12817 * w32menu.c (add_menu_item): Likewise.
12818 (w32_menu_display_help): Use XIL instead of checking
12819 USE_LISP_UNION_TYPE.
12820 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12821 (init_heap): Likewise.
12822 * w32term.c (w32_read_socket): Update comment.
12823
12824 2012-06-13 Glenn Morris <rgm@gnu.org>
12825
12826 * s/usg5-4-common.h, src/s/unixware.h:
12827 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12828
12829 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12830
12831 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12832
12833 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12834 * alloc.c (make_number) [!defined make_number]:
12835 Remove, as lisp.h always defines this now.
12836 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12837 (roundup_size): Verify that it is a power of 2.
12838 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12839 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12840 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12841 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12842 USE_LSB_TAG now is always defined to be either 0 or 1.
12843 All uses changed.
12844 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12845 code works fine either way, and efficiency is not a concern here,
12846 as the union type is for debugging, not for production.
12847 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12848 Use an inline function on all platforms when using the union type,
12849 since this is simpler and 'static inline' can be used portably
12850 within Emacs now.
12851 (LISP_INITIALLY_ZERO): New macro.
12852 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12853 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12854
12855 2012-06-12 Glenn Morris <rgm@gnu.org>
12856
12857 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12858
12859 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12860
12861 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12862 Move BROKEN_SIGIO to configure.
12863
12864 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12865 Move NO_TERMIO to configure.
12866
12867 2012-06-12 Chong Yidong <cyd@gnu.org>
12868
12869 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12870 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12871 MagickExportImagePixels is undefined.
12872
12873 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12874
12875 * image.c (imagemagick_load_image): Remove unused label.
12876
12877 2012-06-11 Glenn Morris <rgm@gnu.org>
12878
12879 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12880 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12881 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12882 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12883
12884 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12885
12886 * alloc.c (make_byte_code): New function.
12887 (Fmake_byte_code): Use it. Don't purify here.
12888 * lread.c (read1): Use it as well to avoid extra allocation.
12889
12890 2012-06-11 Chong Yidong <cyd@gnu.org>
12891
12892 * image.c (imagemagick_load_image): Implement transparency.
12893
12894 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12895
12896 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12897 account for preceding backslashes. (Bug#11663)
12898
12899 2012-06-09 Chong Yidong <cyd@gnu.org>
12900
12901 * term.c: Support italics in capable terminals (Bug#9652).
12902 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12903 (turn_on_face): Output using TS_enter_italic_mode if available.
12904 Don't handle unused blinking and alt-charset cases.
12905 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12906 and tty_alt_charset_p cases.
12907 (tty_capable_p, init_tty): Support italics.
12908
12909 * termchar.h (struct tty_display_info): Add field for italics.
12910 Remove unused blink field.
12911
12912 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12913 Handle slant.
12914
12915 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12916 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12917 tty_alt_charset_p. Add tty_italic_p.
12918
12919 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12920
12921 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12922 dbus_type_is_basic if available.
12923 (xd_extract_signed, xd_extract_unsigned): Rename from
12924 extract_signed and extract_unsigned, respectively. Adapt callers.
12925
12926 2012-06-09 Chong Yidong <cyd@gnu.org>
12927
12928 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12929
12930 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12931 case (Bug#9752).
12932
12933 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12934
12935 * xdisp.c (vmessage): Treat frame message as multibyte.
12936 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12937 would generate the diagnostic "Making \302\247 buffer-local while
12938 let-bound!".
12939
12940 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12941
12942 * dispnew.c (showing_window_margins_p): Undo last change, which
12943 was done due to an inadvertent commit.
12944 (adjust_frame_glyphs_for_frame_redisplay): Do call
12945 showing_window_margins_p.
12946
12947 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12948
12949 * eval.c (Fmake_var_non_special): New primitive.
12950 (syms_of_eval): Defsubr it.
12951 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12952
12953 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12954
12955 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12956 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12957
12958 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12959
12960 * alloc.c (allocate_vectorlike): Fix last change.
12961
12962 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12963
12964 Block-based vector allocation of small vectors.
12965 * lisp.h (struct vectorlike_header): New field `nbytes',
12966 adjust comment accordingly.
12967 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12968 to denote vector blocks. Adjust users (live_vector_p,
12969 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12970 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12971 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12972 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12973 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12974 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12975 (roundup_size): New constant.
12976 (struct vector_block): New data type.
12977 (vector_blocks, vector_free_lists, zero_vector): New variables.
12978 (all_vectors): Rename to `large_vectors'.
12979 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12980 (sweep_vectors): New functions.
12981 (allocate_vectorlike): Return `zero_vector' as the only vector of
12982 0 items. Allocate new vector from block if vector size is less than
12983 or equal to VBLOCK_BYTES_MAX.
12984 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12985 (init_alloc_once): Add call to init_vectors.
12986
12987 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12988
12989 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12990
12991 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12992
12993 * doprnt.c (doprnt): Truncate multibyte char correctly.
12994 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12995 would mishandle a string argument "Xc" if X was a multibyte
12996 character of length 2: it would truncate after X's first byte
12997 rather than including all of X.
12998
12999 2012-06-06 Chong Yidong <cyd@gnu.org>
13000
13001 * buffer.c (word_wrap): Doc fix.
13002
13003 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
13004
13005 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
13006
13007 2012-06-03 Glenn Morris <rgm@gnu.org>
13008
13009 * xdisp.c (tool-bar-style): Doc fix.
13010
13011 2012-06-03 Ulrich Müller <ulm@gentoo.org>
13012
13013 * Makefile.in (PAXCTL): Define.
13014 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13015 binary via PaX flags if the paxctl utility is available.
13016 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13017 Restore PaX flags to their default. (Bug#11398)
13018
13019 2012-06-03 Chong Yidong <cyd@gnu.org>
13020
13021 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13022 buffer (Bug#11226).
13023
13024 2012-06-03 Chong Yidong <cyd@gnu.org>
13025
13026 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13027 (note_mode_line_or_margin_highlight): If there is no help echo,
13028 use mode-line-default-help-echo. Handle the case where the mouse
13029 position is past the end of the mode line string.
13030
13031 * buffer.c (buffer_local_value_1): New function, split from
13032 Fbuffer_local_value; can return Qunbound.
13033 (Fbuffer_local_value): Use it.
13034 (Vmode_line_format): Docstring tweaks.
13035
13036 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13037
13038 * sysdep.c (system_process_attributes): Improve comment.
13039
13040 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13041
13042 * keyboard.c: Export real-this-command to Elisp.
13043 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13044 and DEFVAR it. Update all users.
13045
13046 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13047
13048 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13049
13050 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13051 Convert pctcpu and pctmem to Lisp float properly.
13052 Let the compiler fold better, as 100.0/0x8000 is exact.
13053
13054 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13055
13056 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13057 cons_block.
13058
13059 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13060
13061 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13062
13063 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13064
13065 For a 'struct window', replace some Lisp_Object fields to
13066 bitfields where appropriate, remove unused fields.
13067 * window.h (struct window): Remove unused 'last_mark_x' and
13068 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13069 change its type from Lisp_Object to bitfield.
13070 Change type of 'force_start', 'optional_new_start',
13071 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13072 fields from Lisp_Object to bitfield. Adjust users accordingly.
13073
13074 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13075
13076 Pacify gcc -Wdouble-precision when using Xaw.
13077 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13078 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13079 Use 'float' consistently, rather than 'float' in most places
13080 and 'double' in a couple of places.
13081
13082 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13083
13084 * xdisp.c (handle_stop): Detect whether we have overlay strings
13085 loaded by testing it->current.overlay_string_index to be
13086 non-negative, instead of checking whether n_overlay_strings is
13087 positive. (Bug#11587)
13088
13089 2012-05-31 Chong Yidong <cyd@gnu.org>
13090
13091 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13092
13093 * doc.c (Fsubstitute_command_keys): Doc fix.
13094
13095 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13096
13097 * search.c (search_buffer): Remove calls to
13098 r_alloc_inhibit_buffer_relocation, as it is now called by
13099 maybe_unify_char, which was the cause of relocation of buffer text
13100 in bug#11519.
13101
13102 2012-05-31 Eli Zaretskii <eliz@gnu.org>
13103
13104 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13105 for the duration of call to load_charset, to avoid problems with
13106 callers of maybe_unify_char that access buffer text through C
13107 pointers.
13108
13109 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13110 decrement the inhibition flag, instead of just setting or
13111 resetting it.
13112
13113 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13114
13115 Remove obsolete '#define static' cruft.
13116 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13117 This #undef was "temporary" in 2000; it is no longer needed
13118 now that '#define static' has gone away.
13119 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13120 (gray_bitmap_bits): Remove; no longer needed.
13121 All uses replaced with definiens.
13122 * xterm.c: Include "bitmaps/gray.xbm".
13123
13124 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13125
13126 Clean up __executable_start, monstartup when --enable-profiling.
13127 The following changes affect the code only when profiling.
13128 * dispnew.c (__executable_start): Rename from safe_bcopy.
13129 Define only on platforms that need it.
13130 * emacs.c: Include <sys/gmon.h> when profiling.
13131 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13132 (__executable_start): Remove decl, since lisp.h does it now.
13133 (safe_bcopy): Remove decl; no longer has that name.
13134 (main): Coalesce #if into single bit of code, for simplicity.
13135 Cast pointers to uintptr_t, since standard libraries want integers
13136 and not pointers.
13137 * lisp.h (__executable_start): New decl.
13138
13139 2012-05-31 Glenn Morris <rgm@gnu.org>
13140
13141 * image.c (Fimagemagick_types): Doc fix.
13142
13143 2012-05-30 Jim Meyering <meyering@redhat.com>
13144
13145 * callproc.c (Fcall_process_region): Include directory component
13146 in mkstemp error message (Bug#11586).
13147
13148 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13149
13150 * alloc.c, lisp.h (make_pure_vector): Now static.
13151
13152 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13153
13154 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13155 Move to byte-run.el.
13156 (Fautoload): Do the hash-doc more carefully.
13157 * data.c (Fdefalias): Purify definition, except for keymaps.
13158 (Qdefun): Move from eval.c.
13159 * lisp.h (Qdefun): Remove.
13160 * lread.c (read1): Tiny simplification.
13161
13162 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
13163
13164 Do not create empty overlays with the evaporate property (Bug#9642).
13165 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13166 Bug#9642, but explicitly check that the buffer the overlay would
13167 be moved to is live and rearrange lines to make sure that errors
13168 will not put the overlay in an inconsistent state.
13169 (Fdelete_overlay): Cosmetics.
13170
13171 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13172
13173 * w32term.c (my_bring_window_to_top): New function.
13174 (x_raise_frame): Use handle returned by DeferWindowPos, which
13175 could be different from the original one.
13176 Call my_bring_window_to_top instead of my_set_foreground_window.
13177 (Bug#11513)
13178
13179 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13180 by calling BringWindowToTop.
13181
13182 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13183 (WM_EMACS_END): Increase by one.
13184
13185 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13186
13187 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13188 This avoids undefined behavior that might cause the eassert
13189 to not catch an out-of-range value.
13190
13191 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13192
13193 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13194 Update dependencies.
13195
13196 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13197
13198 * bidi.c (bidi_mirror_char): Fix last change.
13199
13200 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13201
13202 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13203 when referring to sectname field in printf format.
13204
13205 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13206
13207 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13208 Only r_alloc_inhibit_buffer_relocation needed to be added;
13209 the others were already declared.
13210
13211 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13212 before checking whether it's out of range. Put the check inside
13213 eassert. See
13214 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13215
13216 2012-05-27 Ken Brown <kbrown@cornell.edu>
13217
13218 * callproc.c (Fcall_process): Restore a line that was accidentally
13219 commented out in the 2011-02-13 change (bug#11547).
13220
13221 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13222
13223 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13224 defined on ralloc.c.
13225
13226 * buffer.c [REL_ALLOC]: Remove prototypes of
13227 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13228 they are now on lisp.h.
13229
13230 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13231
13232 * search.c (search_buffer): Use it to inhibit relocation of buffer
13233 text while re_search_2 is doing its job, because re_search_2 is
13234 passed C pointers to buffer text. (Bug#11519)
13235
13236 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13237 Update value to 24.
13238
13239 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13240 state after an additional call to move_it_in_display_line_to, keep
13241 the values of it->max_ascent and it->max_descent found for the
13242 entire line.
13243 (pos_visible_p): Revert the comparison against bottom_y to what it
13244 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13245 (Bug#11464)
13246
13247 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13248
13249 Fix coding-related core dumps with gcc -ftrapv.
13250 The code was computing A - B, where A and B are pointers, and B is
13251 random garbage. This can lead to core dumps on platforms that
13252 have special pointer registers, and it also leads to core dumps on
13253 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13254 A - B only when B is initialized properly.
13255 * coding.c (coding_set_source, coding_set_destination): Return void.
13256 (coding_change_source, coding_change_destinations): New functions,
13257 with the old behaviors of coding_set_source and coding_set_destination.
13258 All callers that need an offset changed to use these new functions.
13259
13260 2012-05-26 Glenn Morris <rgm@gnu.org>
13261
13262 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13263
13264 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13265
13266 Extend mouse support on W32 text-mode console.
13267 * xdisp.c (draw_row_with_mouse_face):
13268 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13269
13270 * w32console.c: Include window.h.
13271 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13272 New functions.
13273 (initialize_w32_display): Initialize mouse-highlight data.
13274
13275 * w32inevt.c: Include termchar.h and window.h.
13276 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13277 moves, call note_mouse_highlight. If help_echo changed, call
13278 gen_help_event to produce help-echo message in the echo area.
13279 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13280 highlight info.
13281
13282 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13283
13284 * lread.c (read1): Simplify slightly to avoid an overflow warning
13285 with GCC 4.7.0 on x86-64.
13286
13287 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13288
13289 * bidi.c (bidi_mirror_char): Revert last change: an int is
13290 definitely wide enough here.
13291
13292 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13293
13294 Fix integer width and related bugs (Bug#9874).
13295 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13296 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13297 (string_bytes, check_sblock, allocate_string_data):
13298 (compact_small_strings, Fmake_bool_vector, make_string)
13299 (make_unibyte_string, make_multibyte_string)
13300 (make_string_from_bytes, make_specified_string)
13301 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13302 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13303 (mark_vectorlike):
13304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13305 (allocate_pseudovector):
13306 Use int, not EMACS_INT, where int is wide enough.
13307 (inhibit_garbage_collection, Fgarbage_collect):
13308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13309 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13310 int might not be wide enough.
13311 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13312 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13313 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13314 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13315 (bidi_level_of_next_char, bidi_move_to_visually_next):
13316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13317 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13318 (Fkill_buffer, Fset_buffer_major_mode)
13319 (advance_to_char_boundary, Fbuffer_swap_text)
13320 (Fset_buffer_multibyte, overlays_at, overlays_in)
13321 (overlay_touches_p, struct sortvec, record_overlay_string)
13322 (overlay_strings, recenter_overlay_lists)
13323 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13324 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13325 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13326 (Foverlay_recenter, last_overlay_modification_hooks_used)
13327 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13329 (validate_region): Omit unnecessary test for b <= e,
13330 since that's guaranteed by the previous test.
13331 (adjust_overlays_for_delete): Avoid pos + length overflow.
13332 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13333 (report_overlay_modification):
13334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13335 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13336 Omit pointer cast, which isn't needed anyway, and doesn't work
13337 after the EMACS_INT -> ptrdiff_t change.
13338 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13339 * buffer.h: Adjust decls to match defn changes elsewhere.
13340 (struct buffer_text, struct buffer):
13341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13342 Use EMACS_INT, not int, where int might not be wide enough.
13343 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13344 not int, to avoid needless 32-bit limit on 64-bit hosts.
13345 (exec_byte_code): Use tighter memory-full test, one that checks
13346 for alloca overflow. Don't compute the address of the object just
13347 before an array, as that's not portable. Use EMACS_INT, not
13348 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13349 * callint.c (Fcall_interactively):
13350 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13351 * callproc.c (call_process_kill, Fcall_process):
13352 Don't assume pid_t fits into an Emacs fixnum.
13353 (call_process_cleanup, Fcall_process, child_setup):
13354 Don't assume pid_t fits into int.
13355 (call_process_cleanup, Fcall_process, delete_temp_file)
13356 (Fcall_process_region):
13357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13358 (Fcall_process): Simplify handling of volatile integers.
13359 Use int, not EMACS_INT, where int will do.
13360 * casefiddle.c (casify_object, casify_region, operate_on_word)
13361 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13363 (casify_object): Avoid integer overflow when overallocating buffer.
13364 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13365 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13366 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13367 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13368 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13369 integers are now checked earlier. All uses replaced with XINT.
13370 (ccl_driver):
13371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13372 For CCL_MapSingle, check that content and value are in int range.
13373 (ccl_driver, Fregister_code_conversion_map):
13374 Check that Vcode_version_map_vector is a vector.
13375 (resolve_symbol_ccl_program): Check that vector header is in range.
13376 Always copy the vector, so that we can check its contents reliably
13377 now rather than having to recheck each instruction as it's being
13378 executed. Check that vector words fit in 'int'.
13379 (ccl_get_compiled_code, Fregister_ccl_program)
13380 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13381 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13382 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13383 contents are in range.
13384 (Fccl_execute_on_string): Check that status is in range.
13385 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13386 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13387 Accept and return EMACS_INT, not int, because callers can pass values
13388 out of 'int' range.
13389 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13390 (multibyte_chars_in_text, parse_str_as_multibyte)
13391 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13392 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13393 (string_escape_byte8, Fget_byte):
13394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13395 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13396 avoid mishandling large integers.
13397 * character.h: Adjust decls to match defn changes elsewhere.
13398 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13399 (Ffind_charset_region):
13400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13401 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13402 (load_charset_map_from_vector, Fdefine_charset_internal):
13403 Don't assume fixnum fits in int.
13404 (load_charset_map_from_vector, Fmap_charset_chars):
13405 Remove now-unnecessary CHECK_NATNUMs.
13406 (Fdefine_charset_internal): Check ranges here, more carefully.
13407 Don't rely on undefined behavior with signed left shift overflow.
13408 Don't assume unsigned int fits into fixnum, or that fixnum fits
13409 into unsigned int. Don't require max_code to be a valid fixnum;
13410 that's not true for gb10830 4-byte on a 32-bit host. Allow
13411 invalid_code to be a cons, for the same reason. Require code_offset
13412 to be a character. Avoid int overflow if max_char is close
13413 to INT_MAX.
13414 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13415 this is intended anyway and avoids some undefined behavior.
13416 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13417 INDEX_TO_CODE_POINT, as that's what it expects.
13418 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13419 * charset.h (DECODE_CHAR): Return int, not unsigned;
13420 this is what was intended anyway, and it avoids undefined behavior.
13421 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13422 integer-overflow issues.
13423 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13424 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13425 where the argument is EMACS_INT, and this behavior is not intended.
13426 * chartab.c (Fmake_char_table, Fset_char_table_range)
13427 (uniprop_get_decoder, uniprop_get_encoder):
13428 Don't assume fixnum fits in int.
13429 * cmds.c (move_point): New function, that does the gist of
13430 Fforward_char and Fbackward_char, but does so while checking
13431 for integer overflow more accurately.
13432 (Fforward_char, Fbackward_char): Use it.
13433 (Fforward_line, Fend_of_line, internal_self_insert)
13434 (internal_self_insert):
13435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13436 Fix a FIXME, by checking for integer overflow when calculating
13437 target_clm and actual_clm.
13438 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13439 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13440 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13441 (coding_alloc_by_making_gap, alloc_destination)
13442 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13443 (encode_coding_utf_16, detect_coding_emacs_mule)
13444 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13445 (detect_coding_iso_2022, decode_coding_iso_2022)
13446 (encode_invocation_designation, encode_designation_at_bol)
13447 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13448 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13449 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13450 (encode_coding_ccl, encode_coding_raw_text)
13451 (detect_coding_charset, decode_coding_charset)
13452 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13453 (produce_composition, produce_charset, produce_annotation)
13454 (decode_coding, handle_composition_annotation)
13455 (handle_charset_annotation, consume_chars, decode_coding_gap)
13456 (decode_coding_object, encode_coding_object, detect_coding_system)
13457 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13458 (code_convert_region, code_convert_string)
13459 (Fdefine_coding_system_internal)
13460 (coding_set_source, coding_set_destination):
13461 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13462 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13463 (Fdefine_coding_system_internal):
13464 Don't assume fixnums fit in int.
13465 (decode_coding_gap, decode_coding_object, encode_coding_object)
13466 (Fread_coding_system, Fdetect_coding_region)
13467 (Funencodable_char_position, Fcheck_coding_systems_region)
13468 (get_translation, handle_composition_annotation, consume_chars):
13469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13470 (consume_chars): Rewrite to not calculate an address outside buffer.
13471 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13472 Don't access memory outside of the args array.
13473 (Fdefine_coding_system_internal): Check for charset-id overflow.
13474 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13475 result of ENCODE_CHAR.
13476 * coding.h: Adjust decls to match defn changes elsewhere.
13477 (struct coding_system):
13478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13479 * composite.c (get_composition_id, find_composition)
13480 (run_composition_function, update_compositions)
13481 (compose_text, composition_gstring_put_cache)
13482 (composition_gstring_p, composition_gstring_width)
13483 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13484 (composition_compute_stop_pos, composition_reseat_it)
13485 (composition_update_it, struct position_record)
13486 (find_automatic_composition, composition_adjust_point)
13487 (Fcomposition_get_gstring, Ffind_composition_internal):
13488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13489 (update_compositions):
13490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13491 * composite.h: Adjust decls to match defn changes elsewhere.
13492 (struct composition):
13493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13494 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13495 Do not attempt to compute the address of the object just before a
13496 buffer; this is not portable.
13497 (Faref, Faset):
13498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13499 (Faset): Use int, not EMACS_INT, where int is wide enough.
13500 (Fstring_to_number): Don't assume fixnums fit in int.
13501 (Frem): Don't assume arg is nonnegative.
13502 * dbusbind.c (xd_append_arg): Check for integers out of range.
13503 (Fdbus_call_method): Don't overflow the timeout int.
13504 (extract_signed, extract_unsigned): New functions.
13505 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13506 (xd_get_connection_references): Return ptrdiff_t, not int.
13507 All uses changed.
13508 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13509 (xd_read_message_1):
13510 Use int, not unsigned, where the dbus API uses int.
13511 (Fdbus_message_internal): Don't overflow mtype.
13512 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13513 * dired.c (directory_files_internal, file_name_completion, scmp)
13514 (file_name_completion_stat):
13515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13516 (file_name_completion): Don't overflow matchcount.
13517 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13518 * dispextern.h: Adjust decls to match defn changes elsewhere.
13519 (struct text_pos, struct glyph, struct bidi_saved_info)
13520 (struct bidi_string_data, struct bidi_it, struct composition_it)
13521 (struct it):
13522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13523 (struct display_pos, struct composition_it, struct it):
13524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13525 * dispnew.c (increment_matrix_positions)
13526 (increment_row_positions, mode_line_string)
13527 (marginal_area_string):
13528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13529 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13530 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13531 (duration_to_sec_usec): New function, to check for overflow better.
13532 (Fsleep_for, sit_for): Use it.
13533 * doc.c (get_doc_string, store_function_docstring):
13534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13535 (get_doc_string, Fsnarf_documentation):
13536 Use int, not EMACS_INT, where int is wide enough.
13537 (get_doc_string):
13538 Use SAFE_ALLOCA, not alloca.
13539 Check for overflow when converting EMACS_INT to off_t.
13540 * doprnt.c (doprnt):
13541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13542 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13543 Don't assume uid_t fits into fixnum.
13544 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13545 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13546 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13547 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13548 (general_insert_function)
13549 (Finsert_char, make_buffer_string, make_buffer_string_both)
13550 (update_buffer_properties, Fbuffer_substring)
13551 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13552 (Fsubst_char_in_region, check_translation)
13553 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13554 (transpose_markers, Ftranspose_regions):
13555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13556 (clip_to_bounds): Move to lisp.h as an inline function).
13557 (Fconstrain_to_field): Don't assume integers are nonnegative.
13558 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13559 (Fsubst_char_in_region, Fsave_restriction):
13560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13561 (Femacs_pid): Don't assume pid_t fits into fixnum.
13562 (lo_time): Use int, not EMACS_INT, when int suffices.
13563 (lisp_time_argument): Check for usec out of range.
13564 (Fencode_time): Don't assume fixnum fits in int.
13565 (Fuser_login_name, Fuser_full_name): Signal an error
13566 if a uid argument is out of range, rather than relying on
13567 undefined behavior.
13568 (Fformat_time_string): Remove now-unnecessary check.
13569 lisp_time_argument checks for out-of-range usec now.
13570 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13571 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13572 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13573 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13574 (init_cmdargs, Fdump_emacs):
13575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13576 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13577 the bottom (typically) 32 bits of the fixnum.
13578 * eval.c (specpdl_size, call_debugger):
13579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13580 (when_entered_debugger, Fbacktrace_debug):
13581 Don't assume fixnum can fit in int.
13582 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13583 the object just before a buffer; this is not portable.
13584 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13585 (grow_specpdl, unbind_to):
13586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13587 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13588 (grow_specpdl): Simplify allocation by using xpalloc.
13589 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13590 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13591 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13592 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13593 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13594 (a_write, e_write):
13595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13596 (Fcopy_file, non_regular_nbytes, read_non_regular)
13597 (Finsert_file_contents):
13598 Use int, not EMACS_INT, where int is wide enough.
13599 (READ_BUF_SIZE): Verify that it fits in int.
13600 (Finsert_file_contents): Check that counts are in proper range,
13601 rather than assuming fixnums fit into ptrdiff_t etc.
13602 Don't assume fixnums fit into int.
13603 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13604 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13605 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13606 (string_char_to_byte, string_byte_to_char)
13607 (string_make_multibyte, string_to_multibyte)
13608 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13609 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13610 (substring_both, Fdelete, internal_equal, Ffillarray)
13611 (Fclear_string, mapcar1)
13612 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13613 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13614 (larger_vector, make_hash_table, maybe_resize_hash_table)
13615 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13616 (Fmaphash, secure_hash):
13617 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13618 (concat): Check for string index and length overflow.
13619 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13620 (Frequire):
13621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13622 (larger_vector): New API (vec, incr_min, size_max) replaces old
13623 one (vec, new_size, init). This catches size overflow.
13624 INIT was removed because it was always Qnil.
13625 All callers changed.
13626 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13627 the upper bound on a hash table index size.
13628 (make_hash_table, maybe_resize_hash_table): Use it.
13629 (secure_hash): Computer start_byte and end_byte only after
13630 they're known to be in ptrdiff_t range.
13631 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13632 (Ffont_get_glyphs, Ffont_at):
13633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13634 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13635 (Flist_fonts, Fopen_font):
13636 Don't assume fixnum can fit in int.
13637 (check_gstring): Don't assume index can fit in int.
13638 (font_match_p): Check that fixnum is a character, not a nonnegative
13639 fixnum, since the later code needs to stuff it into an int.
13640 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13641 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13642 conversion overflow issues.
13643 (Fopen_font): Check for integer out of range.
13644 (Ffont_get_glyphs): Don't assume index can fit in int.
13645 * font.h: Adjust decls to match defn changes elsewhere.
13646 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13647 integer overflow.
13648 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13649 printmax_t, where ptrdiff_t is wide enough.
13650 (Finternal_char_font):
13651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13652 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13653 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13654 (Fset_frame_position, x_set_frame_parameters)
13655 (x_set_line_spacing, x_set_border_width)
13656 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13657 Check that fixnums are in proper range for system types.
13658 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13660 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13661 Use SAFE_ALLOCA_LISP, not alloca.
13662 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13663 intptr_t is wide enough.
13664 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13665 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13666 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13667 Check for fixnum out of range.
13668 * ftfont.c (ftfont_list): Don't assume index fits in int.
13669 Check that fixnums are in proper range for system types.
13670 (ftfont_shape_by_flt):
13671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13672 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13674 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13675 Check that fixnums are in proper range for system types.
13676 * gnutls.h: Adjust decls to match defn changes elsewhere.
13677 * gtkutil.c (xg_dialog_run):
13678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13679 (update_frame_tool_bar):
13680 Check that fixnums are in proper range for system types.
13681 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13682 (lookup_image): Check that fixnums are in range for system types.
13683 * indent.c (last_known_column, last_known_column_point):
13684 (current_column_bol_cache):
13685 (skip_invisible, current_column, check_display_width):
13686 (check_display_width, scan_for_column, current_column_1)
13687 (Findent_to, Fcurrent_indentation, position_indentation)
13688 (indented_beyond_p, Fmove_to_column, compute_motion):
13689 (Fcompute_motion, Fvertical_motion):
13690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13691 (last_known_column_modified): Use EMACS_INT, not int.
13692 (check_display_width):
13693 (Fcompute_motion):
13694 Check that fixnums and floats are in proper range for system types.
13695 (compute_motion): Don't assume index or fixnum fits in int.
13696 (compute_motion, Fcompute_motion):
13697 Use int, not EMACS_INT, when it is wide enough.
13698 (vmotion): Omit local var start_hpos that is always 0; that way
13699 we don't need to worry about overflow in expressions involving it.
13700 * indent.h: Adjust decls to match defn changes elsewhere.
13701 (struct position):
13702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13703 Use int, not EMACS_INT, where int is wide enough.
13704 Remove unused members ovstring_chars_done and tab_offset;
13705 all uses removed.
13706 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13707 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13708 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13709 (make_gap, copy_text, insert, insert_and_inherit)
13710 (insert_before_markers, insert_before_markers_and_inherit)
13711 (insert_1, count_combining_before, count_combining_after)
13712 (insert_1_both, insert_from_string)
13713 (insert_from_string_before_markers, insert_from_string_1)
13714 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13715 (adjust_after_replace, adjust_after_insert, replace_range)
13716 (replace_range_2, del_range, del_range_1, del_range_byte)
13717 (del_range_both, del_range_2, modify_region)
13718 (prepare_to_modify_buffer, signal_before_change)
13719 (signal_after_change, Fcombine_after_change_execute):
13720 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13721 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13722 (balance_an_interval, split_interval_right, split_interval_left)
13723 (find_interval, next_interval, update_interval)
13724 (adjust_intervals_for_insertion, delete_node, delete_interval)
13725 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13726 (static_offset_intervals, offset_intervals)
13727 (merge_interval_right, merge_interval_left, make_new_interval)
13728 (graft_intervals_into_buffer, temp_set_point_both)
13729 (temp_set_point, set_point, adjust_for_invis_intang)
13730 (set_point_both, move_if_not_intangible, get_property_and_range)
13731 (get_local_map, copy_intervals, copy_intervals_to_string)
13732 (compare_string_intervals, set_intervals_multibyte_1):
13733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13734 * intervals.h: Adjust decls to match defn changes elsewhere.
13735 (struct interval):
13736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13737 * keyboard.c (this_command_key_count, this_single_command_key_start)
13738 (before_command_key_count, before_command_echo_length, echo_now)
13739 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13740 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13741 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13742 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13743 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13744 (last_non_minibuf_size, last_point_position, echo_truncate)
13745 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13746 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13747 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13748 (stuff_buffered_input):
13749 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13750 (last_auto_save, command_loop_1, read_char):
13751 Use EMACS_INT, not int, to avoid integer overflow.
13752 (record_char): Avoid overflow in total_keys computation.
13753 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13754 * keyboard.h: Adjust decls to match defn changes elsewhere.
13755 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13756 (Fkey_description, Fdescribe_vector, Flookup_key):
13757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13758 (click_position): New function, to check that positions are in range.
13759 (Fcurrent_active_maps):
13760 (describe_command):
13761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13762 (Faccessible_keymaps, Fkey_description):
13763 (preferred_sequence_p):
13764 Don't assume fixnum can fit into int.
13765 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13766 Check for integer overflow in size calculations.
13767 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13768 avoid mishandling large integers.
13769 * lisp.h: Adjust decls to match defn changes elsewhere.
13770 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13771 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13772 (struct Lisp_Marker):
13773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13774 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13775 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13776 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13777 All callers changed.
13778 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13779 Assume the arg has valid form, since it always does.
13780 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13781 unsigned integer system type.
13782 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13783 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13785 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13786 (duration_to_sec_usec): New decl.
13787 * lread.c (read_from_string_index, read_from_string_index_byte)
13788 (read_from_string_limit, readchar, unreadchar, openp)
13789 (read_internal_start, read1, oblookup):
13790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13791 (Fload, readevalloop, Feval_buffer, Feval_region):
13792 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13793 (openp): Check for out-of-range argument to 'access'.
13794 (read1): Use int, not EMACS_INT, where int is wide enough.
13795 Don't assume fixnum fits into int.
13796 Fix off-by-one error that can read outside a buffer.
13797 (read_filtered_event): Use duration_to_sec_usec
13798 to do proper overflow checking on durations.
13799 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13800 in size calculation.
13801 (Fexecute_kbd_macro):
13802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13803 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13804 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13805 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13806 (set_marker_both, set_marker_restricted_both, marker_position)
13807 (marker_byte_position, Fbuffer_has_markers_at):
13808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13809 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13810 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13811 It now merely ensures that the menu is large enough, without
13812 necessarily growing it, as this avoids some integer overflow issues.
13813 All callers changed.
13814 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13816 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13817 Use SAFE_ALLOCA_LISP, not alloca.
13818 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13819 to EMACS_INT. Check that fixnums are in proper range for system types.
13820 * minibuf.c (minibuf_prompt_width, string_to_object)
13821 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13822 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13824 (get_minibuffer, read_minibuf_unwind):
13825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13826 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13827 this simplifies overflow checking. All callers changed.
13828 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13829 (Ftest_completion):
13830 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13831 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13832 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13833 Check that fixnums are in proper range for system types.
13834 (Fx_create_frame, Fx_show_tip):
13835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13836 * nsfont.m (ns_findfonts, nsfont_list_family):
13837 Don't assume fixnum fits in long.
13838 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13840 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13841 wide enough.
13842 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13844 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13845 (PRINTDECLARE, PRINTPREPARE):
13846 (strout, print_string):
13847 (print, print_preprocess, print_check_string_charset_prop)
13848 (print_object):
13849 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13850 (PRINTDECLARE):
13851 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13853 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13854 (printchar, strout): Use xpalloc to catch size calculation overflow.
13855 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13856 (print_error_message): Use SAFE_ALLOCA, not alloca.
13857 (print_object): Use int, not EMACS_INT, where int is wide enough.
13858 (print_depth, new_backquote_output, print_number_index):
13859 Use ptrdiff_t, not int, where int might not be wide enough.
13860 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13861 (Fset_process_window_size, Fformat_network_address)
13862 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13863 (sigchld_handler):
13864 Check that fixnums are in proper range for system types.
13865 (Fsignal_process): Simplify by avoiding a goto.
13866 Check for process-ids out of pid_t range rather than relying on
13867 undefined behavior.
13868 (process_tick, update_tick): Use EMACS_INT, not int.
13869 (Fformat_network_address, read_process_output, send_process)
13870 (Fprocess_send_region, status_notify):
13871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13872 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13873 (wait_reading_process_output, read_process_output, exec_sentinel):
13874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13875 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13876 (Faccept_process_output): Use duration_to_sec_usec to do proper
13877 overflow checking on durations.
13878 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13879 Don't assume pid_t fits in int.
13880 * process.h (struct Lisp_Process): Members tick and update_tick
13881 are now of type EMACS_INT, not int.
13882 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13883 configured --with-wide-int.
13884 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13885 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13886 * search.c (looking_at_1, string_match_1):
13887 (fast_string_match, fast_c_string_match_ignore_case)
13888 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13889 (scan_newline, find_before_next_newline, search_command)
13890 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13891 (set_search_regs, wordify):
13892 (Freplace_match):
13893 (Fmatch_data):
13894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13895 (string_match_1, search_buffer, set_search_regs):
13896 (Fmatch_data):
13897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13898 (wordify): Check for overflow in size calculation.
13899 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13900 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13901 Check that fixnums are in proper range for system types.
13902 * sound.c (struct sound_device)
13903 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13904 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13905 (Fplay_sound_internal):
13906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13907 * syntax.c (struct lisp_parse_state, find_start_modiff)
13908 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13909 (Fparse_partial_sexp):
13910 Don't assume fixnums can fit in int.
13911 (struct lisp_parse_state, find_start_pos, find_start_value)
13912 (find_start_value_byte, find_start_begv)
13913 (update_syntax_table, char_quoted, dec_bytepos)
13914 (find_defun_start, prev_char_comend_first, back_comment):
13915 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13916 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13918 (Finternal_describe_syntax_value): Check that match_lisp is a
13919 character, not an integer, since the code stuffs it into int.
13920 (scan_words, scan_sexps_forward):
13921 Check that fixnums are in proper range for system types.
13922 (Fforward_word):
13923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13924 (scan_sexps_forward):
13925 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13926 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13927 * syntax.h: Adjust decls to match defn changes elsewhere.
13928 (struct gl_state_s):
13929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13930 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13931 MOST_POSITIVE_FIXNUM.
13932 * sysdep.c (wait_for_termination_1, wait_for_termination)
13933 (interruptible_wait_for_termination, mkdir):
13934 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13935 (emacs_read, emacs_write):
13936 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13937 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13938 and double all fit in int.
13939 * term.c (set_tty_color_mode):
13940 Check that fixnums are in proper range for system types.
13941 * termhooks.h (struct input_event):
13942 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13943 * textprop.c (validate_interval_range, interval_of)
13944 (Fadd_text_properties, set_text_properties_1)
13945 (Fremove_text_properties, Fremove_list_of_text_properties)
13946 (Ftext_property_any, Ftext_property_not_all)
13947 (copy_text_properties, text_property_list, extend_property_ranges)
13948 (verify_interval_modification):
13949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13950 (Fnext_single_char_property_change)
13951 (Fprevious_single_char_property_change):
13952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13953 (copy_text_properties):
13954 Check for integer overflow in index calculation.
13955 * undo.c (last_boundary_position, record_point, record_insert)
13956 (record_delete, record_marker_adjustment, record_change)
13957 (record_property_change):
13958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13959 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13961 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13962 (Fx_hide_tip, Fx_file_dialog):
13963 * w32menu.c (set_frame_menubar):
13964 Use ptrdiff_t, not int, for consistency with rest of code.
13965 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13966 (select_window, Fdelete_other_windows_internal)
13967 (window_scroll_pixel_based, window_scroll_line_based)
13968 (Frecenter, Fset_window_configuration):
13969 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13970 (Fset_window_hscroll, run_window_configuration_change_hook)
13971 (set_window_buffer, temp_output_buffer_show, scroll_command)
13972 (Fscroll_other_window, Frecenter):
13973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13974 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13975 Don't assume fixnum fits in int.
13976 (Fset_window_scroll_bars):
13977 Check that fixnums are in proper range for system types.
13978 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13979 (string_pos, c_string_pos, number_of_chars, init_iterator)
13980 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13981 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13982 (compute_display_string_end, handle_face_prop)
13983 (face_before_or_after_it_pos, handle_invisible_prop)
13984 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13985 (display_prop_intangible_p, string_buffer_position_lim)
13986 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13987 (get_overlay_strings_1, get_overlay_strings)
13988 (iterate_out_of_display_property, forward_to_next_line_start)
13989 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13990 (get_next_display_element, set_iterator_to_next)
13991 (get_visually_first_element, compute_stop_pos_backwards)
13992 (handle_stop_backwards, next_element_from_buffer)
13993 (move_it_in_display_line_to, move_it_in_display_line)
13994 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13995 (add_to_log, message_dolog, message_log_check_duplicate)
13996 (message2, message2_nolog, message3, message3_nolog
13997 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13998 (current_message_1, truncate_echo_area, truncate_message_1)
13999 (set_message, set_message_1, store_mode_line_noprop)
14000 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
14001 (text_outside_line_unchanged_p, check_point_in_composition)
14002 (reconsider_clip_changes)
14003 (redisplay_internal, set_cursor_from_row, try_scrolling)
14004 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
14005 (redisplay_window, find_last_unchanged_at_beg_row)
14006 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
14007 (trailing_whitespace_p, find_row_edges, display_line)
14008 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
14009 (display_mode_element, store_mode_line_string)
14010 (pint2str, pint2hrstr, decode_mode_spec)
14011 (display_count_lines, display_string, draw_glyphs)
14012 (x_produce_glyphs, x_insert_glyphs)
14013 (rows_from_pos_range, mouse_face_from_buffer_pos)
14014 (fast_find_string_pos, mouse_face_from_string_pos)
14015 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14017 (safe_call, init_from_display_pos, handle_fontified_prop)
14018 (handle_single_display_spec, load_overlay_strings)
14019 (with_echo_area_buffer, setup_echo_area_for_printing)
14020 (display_echo_area, echo_area_display)
14021 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14022 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14023 (redisplay_window, dump_glyph_row, display_mode_line)
14024 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14025 (handle_display_spec, display_prop_string_p):
14026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14027 (handle_single_display_spec, build_desired_tool_bar_string)
14028 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14029 (get_specified_cursor_type):
14030 Check that fixnums are in proper range for system types.
14031 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14032 (Flookup_image_map):
14033 Don't assume fixnums fit in int.
14034 (compare_overlay_entries):
14035 Avoid mishandling comparisons due to subtraction overflow.
14036 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14037 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14038 (handle_tool_bar_click):
14039 Use int, not unsigned, since we prefer signed and the signedness
14040 doesn't matter here.
14041 (get_next_display_element, next_element_from_display_vector):
14042 Use int, not EMACS_INT, when int is wide enough.
14043 (start_hourglass): Use duration_to_sec_usec to do proper
14044 overflow checking on durations.
14045 * xfaces.c (Fbitmap_spec_p):
14046 Check that fixnums are in proper range for system types.
14047 (compare_fonts_by_sort_order):
14048 Avoid mishandling comparisons due to subtraction overflow.
14049 (Fx_family_fonts, realize_basic_faces):
14050 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14051 (Fx_family_fonts):
14052 Don't assume fixnum fits in int.
14053 Use SAFE_ALLOCA_LISP, not alloca.
14054 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14055 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14056 (face_at_buffer_position, face_for_overlay_string)
14057 (face_at_string_position):
14058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14059 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14060 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14061 (Fx_show_tip):
14062 Check that fixnums are in proper range for system types.
14063 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14064 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14066 (Fx_change_window_property): Don't assume fixnums fit in int.
14067 * xfont.c (xfont_chars_supported):
14068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14069 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14070 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14072 * xml.c (parse_region):
14073 * xrdb.c (magic_file_p):
14074 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14075 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14076 (x_get_local_selection, x_reply_selection_request)
14077 (x_handle_selection_request, wait_for_property_change):
14078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14079 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14080 short is wide enough.
14081 (x_send_client_event): Don't assume fixnum fits in int.
14082 * xterm.c (x_x_to_emacs_modifiers):
14083 Don't assume EMACS_INT overflows nicely into int.
14084 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14085 may come from Lisp.
14086 (handle_one_xevent): NATNUMP can eval its arg twice.
14087 (x_connection_closed):
14088 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14089 * xterm.h: Adjust decls to match defn changes elsewhere.
14090 (struct scroll_bar): Use struct vectorlike_header
14091 rather than rolling our own approximation.
14092 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14093
14094 2012-05-25 Glenn Morris <rgm@gnu.org>
14095
14096 * lisp.mk (lisp): Update for more files being compiled now.
14097
14098 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14099
14100 * lread.c: Remove `read_pure' which makes no difference.
14101 (read_pure): Remove var.
14102 (unreadpure): Remove function.
14103 (readevalloop): Don't call read_list with -1 flag.
14104 (read1, read_vector): Don't test read_pure any more.
14105 (read_list): Simplify.
14106
14107 * fileio.c, character.h: Minor style tweaks.
14108
14109 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14110
14111 * window.h (clip_changed): Remove useless declaration.
14112
14113 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
14114
14115 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14116 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14117
14118 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14119
14120 Remove src/m/*.
14121 This directory predates autoconf and is no longer needed nowadays.
14122 Move its few remaining bits of functionality to where they're needed.
14123 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14124 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14125 * m/template.h: Remove.
14126 * Makefile.in (M_FILE): Remove. All uses removed.
14127 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14128 * lisp.h (USE_LSB_TAG):
14129 * mem-limits.h (EXCEEDS_LISP_PTR):
14130 Use VAL_MAX, not VALBITS, in #if.
14131 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14132 (EMACS_UINT): Define unconditionally now.
14133 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14134 (BITS_PER_EMACS_INT): New constants, replacing
14135 what used to be in config.h, but not useful in #if.
14136 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14137 define them any more.
14138 (VAL_MAX): New macro.
14139 (VALMASK): Use it.
14140 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14141 BITS_PER_EMACS_INT, in #if.
14142 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14143 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14144 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14145 * s/ms-w32.h (DATA_START):
14146 Move here from removed file m/intel386.h.
14147 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14148 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14149
14150 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14151
14152 Assume C89 or later.
14153 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14154 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14155 (xrealloc):
14156 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14157 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14158 * textprop.c, tparam.c (NULL): Remove.
14159 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14160 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14161 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14162 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14163 * xterm.c (input_signal_count): Assume volatile works.
14164
14165 2012-05-21 Ken Brown <kbrown@cornell.edu>
14166
14167 * xgselect.c (xg_select): Fix first argument in call to 'select'
14168 (bug#11508).
14169
14170 2012-05-20 Ken Brown <kbrown@cornell.edu>
14171
14172 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14173 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14174
14175 2012-05-19 Ken Brown <kbrown@cornell.edu>
14176
14177 * xfns.c (x_in_use): Remove `static' qualifier.
14178 * xterm.h (x_in_use): Declare.
14179 * xgselect.c: Include xterm.h.
14180 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14181 and `display_arg' (bug#9754).
14182
14183 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14186
14187 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14188 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14189
14190 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14191
14192 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14193
14194 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14195 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14196
14197 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14198 reference to image_cache->refcount.
14199 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14200
14201 2012-05-17 Juri Linkov <juri@jurta.org>
14202
14203 * search.c (Fword_search_regexp, Fword_search_backward)
14204 (Fword_search_forward, Fword_search_backward_lax)
14205 (Fword_search_forward_lax): Move functions to isearch.el
14206 (bug#10145, bug#11381).
14207
14208 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14209
14210 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14211
14212 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14213
14214 * lread.c (init_obarray): Declare Qt and Qnil as special.
14215
14216 2012-05-14 Glenn Morris <rgm@gnu.org>
14217
14218 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14219 Put "libexec" before "bin", for the sake of init_callproc_1.
14220
14221 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14222
14223 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14224
14225 * unexaix.c: Port to more-recent AIX compilers.
14226 (report_error, report_error_1, make_hdr, copy_sym)
14227 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14228 Make arguments const char *, not char *, to avoid violations of C
14229 standard and to fix some AIX warnings reported by Gilles Pion.
14230
14231 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14232
14233 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14234 already have overlays loaded.
14235 (handle_single_display_spec): Before returning without displaying
14236 fringe bitmap, synchronize the bidi iterator with the main display
14237 iterator, by calling iterate_out_of_display_property.
14238 (iterate_out_of_display_property): Detect buffer iteration by
14239 testing that it->string is a Lisp string.
14240 (get_next_display_element): When the current object is exhausted,
14241 and there's something on it->stack, call set_iterator_to_next to
14242 proceed with what's on the stack, instead of returning zero.
14243 (set_iterator_to_next): If called at the end of a Lisp string,
14244 proceed to consider_string_end without incrementing string
14245 position. Don't increment display vector index past the end of
14246 the display vector. (Bug#11417)
14247 (pos_visible_p): Don't report a position visible when move_it_to
14248 stopped at the last line of window, which happens to be scanned
14249 backwards by the bidi iteration. (Bug#11464)
14250
14251 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14252
14253 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14254 and right-margin display specs even if the spec is invalid or we
14255 are on a TTY, and thus unable to display on the fringes.
14256 That's because the text with the property will not be displayed anyway,
14257 so we need to signal to the caller that this is a "replacing"
14258 display spec. This fixes display when the spec is invalid or we
14259 are on a TTY.
14260
14261 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14262
14263 * unexaix.c (make_hdr): Fix typo in prototype.
14264 This bug broke the build on AIX. Problem reported by Gilles Pion.
14265
14266 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14267
14268 * keyboard.c (kbd_buffer_get_event): Read special events also in
14269 batch mode. (Bug#11415)
14270
14271 2012-05-12 Glenn Morris <rgm@gnu.org>
14272
14273 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14274
14275 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14276
14277 * lisp.mk (lisp): Add newcomment.elc.
14278
14279 2012-05-12 Glenn Morris <rgm@gnu.org>
14280
14281 * Makefile.in (MKDIR_P): New, set by configure.
14282 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14283
14284 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14285
14286 Remove unused function hourglass_started.
14287 * dispextern.h (hourglass_started):
14288 * w32fns.c (hourglass_started):
14289 * xdisp.c (hourglass_started): Remove.
14290
14291 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14292
14293 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14294 Update dependencies.
14295
14296 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14297
14298 * xgselect.c (xg_select): Put maxfds+1 into a var.
14299 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14300
14301 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14302
14303 2012-05-10 Dave Abrahams <dave@boostpro.com>
14304
14305 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14306 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14307
14308 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14309
14310 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14311 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14312 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14313 Initialize xd_registered_buses.
14314
14315 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14316
14317 Untag more efficiently if USE_LSB_TAG.
14318 This is based on a proposal by YAMAMOTO Mitsuharu in
14319 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14320 For an admittedly artificial (nth 8000 longlist) benchmark on
14321 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14322 Emacs's overall text size by 1%.
14323 * lisp.h (XUNTAG): New macro.
14324 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14325 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14326 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14327 * eval.c (Fautoload):
14328 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14329 * frame.h (XFRAME): Use XUNTAG.
14330
14331 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14332 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14333 Remove unportable assumptions about print widths of types like
14334 dbus_uint32_t.
14335 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14336 intptr_t when converting between pointer and integer, to avoid GCC
14337 warnings about wrong width.
14338
14339 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14340
14341 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14342 stack for each reader_thread, instead of defaulting to 8MB
14343 determined by the linker. This avoids failures in creating
14344 subprocesses on Windows 7, see the discussion in this thread:
14345 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14346
14347 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14348
14349 Fix up display of the *Minibuf-0* buffer in the mini window.
14350 * keyboard.c (read_char): Don't clear the echo area if there's no
14351 message to clear.
14352 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14353 contents of *Minibuf-0*) if there's no message displayed in its stead.
14354
14355 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14356
14357 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14358 batch mode.
14359
14360 2012-05-06 Chong Yidong <cyd@gnu.org>
14361
14362 * lisp.mk (lisp): Update.
14363
14364 2012-05-05 Jim Meyering <meyering@redhat.com>
14365
14366 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14367
14368 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14369
14370 * data.c (PUT_ERROR): New macro.
14371 (syms_of_data): Use it. Add new error type `user-error'.
14372 * undo.c (user_error): New function.
14373 (Fprimitive_undo): Use it.
14374 * print.c (print_error_message): Adjust print style for `user-error'.
14375 * keyboard.c (user_error): New function.
14376 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14377
14378 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14379
14380 Do not limit current-time-string to years 1000..9999.
14381 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14382 (Fcurrent_time_string): Support any year that is supported by the
14383 underlying localtime representation. Don't use asctime, as it
14384 has undefined behavior for years outside the range -999..9999.
14385
14386 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14387
14388 Fix race conditions involving setenv, gmtime, localtime, asctime.
14389 Without this fix, interrupts could mess up code that uses these
14390 nonreentrant functions, since setting TZ invalidates existing
14391 tm_zone or tzname values, and since most of these functions return
14392 pointers to static storage.
14393 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14394 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14395 Grow the critical sections to include not just invoking
14396 localtime/gmtime, but also accessing these functions' results
14397 including their tm_zone values if any, and any related TZ setting.
14398 (format_time_string): Last arg is now struct tm *, not struct tm **,
14399 so that the struct tm is saved in the critical section.
14400 All callers changed. Simplify allocation of initial buffer, partly
14401 motivated by the fact that memory allocation needs to be outside
14402 the critical section.
14403
14404 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14405
14406 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14407 with RESET_INTERVAL.
14408
14409 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14410 Remove duplicated buffer name initialization.
14411
14412 2012-05-02 Jim Meyering <jim@meyering.net>
14413
14414 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14415
14416 * xfns.c (x_window): Use xstrdup (Bug#11375).
14417
14418 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14419
14420 * xdisp.c (pos_visible_p): If already at a newline from the
14421 display string before the 'while' loop, don't walk back the glyphs
14422 from it3.glyph_row. Solves assertion violation when the display
14423 string begins with a newline (egg.el). (Bug#11367)
14424
14425 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14426
14427 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14428 Move to simple.el.
14429
14430 2012-05-01 Glenn Morris <rgm@gnu.org>
14431
14432 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14433 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14434 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14435 All were removed before 23.1.
14436
14437 * dispnew.c: Remove HAVE_LIBNCURSES test;
14438 it is always true on relevant platforms.
14439
14440 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14441 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14442
14443 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14444
14445 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14446
14447 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14448 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14449 Remove.
14450
14451 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14452
14453 Do not avoid creating empty evaporating overlays (Bug#9642).
14454 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14455 That is, do not delete an evaporating overlay if it becomes
14456 empty after its bounds are adjusted to fit within its buffer.
14457 This fix caused other problems, and I'm reverting it until we get
14458 to the bottom of them.
14459
14460 2012-04-27 Chong Yidong <cyd@gnu.org>
14461
14462 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14463
14464 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14465
14466 * xdisp.c (pos_visible_p): If the window start position is beyond
14467 ZV, start the display from buffer beginning. Prevents assertion
14468 violation in init_iterator when the minibuffer window is scrolled
14469 via the scroll bar.
14470
14471 * window.c (window_scroll_pixel_based): Likewise.
14472
14473 2012-04-27 Chong Yidong <cyd@gnu.org>
14474
14475 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14476
14477 2012-04-27 Glenn Morris <rgm@gnu.org>
14478
14479 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14480 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14481
14482 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14483
14484 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14485 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14486
14487 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14488
14489 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14490 display element, check also the underlying string or buffer
14491 character. (Bug#11341)
14492
14493 * w32menu.c: Include w32heap.h.
14494 (add_menu_item): If the call to AppendMenuW (via
14495 unicode_append_menu) fails, disable Unicode menus only if we are
14496 running on Windows 9X/Me.
14497
14498 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14499
14500 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14501 (xgetint): Add missing shift for LSB tags.
14502
14503 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14504
14505 * keyboard.c (read_char): Don't wipe echo area for select window
14506 events: These might get delayed via `mouse-autoselect-window'
14507 (Bug#11304).
14508
14509 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14510
14511 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14512 manipulation of :loaded-from data.
14513
14514 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14515
14516 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14517 now a cons (bug#11311).
14518
14519 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14520
14521 Do not create empty overlays with the evaporate property (Bug#9642).
14522 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14523 if it becomes empty after its bounds are adjusted to fit within
14524 its buffer. Without this fix, in a nonempty buffer (let ((o
14525 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14526 yields an empty overlay that has the evaporate property, which is
14527 not supposed to happen.
14528
14529 Fix minor GTK3 problems found by static checking.
14530 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14531 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14532 (struct _EmacsFixedClass, emacs_fixed_get_type):
14533 Move decls here from emacsgtkfixed.h, since they needn't be public.
14534 (emacs_fixed_get_type): Now static.
14535 (emacs_fixed_class_init): Omit unused local.
14536 (emacs_fixed_child_type): Remove; unused.
14537 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14538 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14539 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14540 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14541 (EMACS_FIXED_GET_CLASS): Remove; unused.
14542 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14543
14544 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14545 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14546
14547 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14548
14549 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14550 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14551 (__malloc_size_t, __malloc_ptrdiff_t):
14552 Remove. All uses removed, replaced by the definiens if needed,
14553 since we can assume C89 or better now.
14554 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14555 (protect_malloc_state, align, get_contiguous_space)
14556 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14557 (malloc_atfork_handler_child, malloc_enable_thread)
14558 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14559 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14560 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14561 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14562 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14563 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14564 Define using prototypes, not old style.
14565 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14566 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14567 (align): Don't assume that signed integer overflow wraps around.
14568 Omit unused local var.
14569 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14570 (_free_internal_nolock, memalign, mallochook, reallochook):
14571 Omit no-longer-needed casts.
14572 (valloc): Use getpagesize, not __getpagesize.
14573 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14574 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14575
14576 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14577
14578 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14579
14580 Move functions from C to Lisp. Make non-blocking method calls
14581 the default. Implement further D-Bus standard interfaces.
14582
14583 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14584 (QCdbus_request_name_allow_replacement)
14585 (QCdbus_request_name_replace_existing)
14586 (QCdbus_request_name_do_not_queue)
14587 (QCdbus_request_name_reply_primary_owner)
14588 (QCdbus_request_name_reply_in_queue)
14589 (QCdbus_request_name_reply_exists)
14590 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14591 (QCdbus_registered_serial, QCdbus_registered_method)
14592 (QCdbus_registered_signal): New Lisp objects.
14593 (XD_DEBUG_MESSAGE): Use sizeof.
14594 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14595 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14596 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14597 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14598 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14599 (xd_signature, xd_append_arg): Allow float for integer types.
14600 (xd_get_connection_references): New function.
14601 (xd_get_connection_address): Rename from xd_initialize.
14602 Return cached address.
14603 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14604 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14605 level.
14606 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14607 Return number of refcounts.
14608 (Fdbus_get_unique_name): Make stronger parameter check.
14609 (Fdbus_message_internal): New defun.
14610 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14611 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14612 (Fdbus_send_signal, Fdbus_register_service)
14613 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14614 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14615 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14616 (Vdbus_compiled_version, Vdbus_runtime_version)
14617 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14618 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14619 (Vdbus_message_type_signal): New defvars.
14620 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14621 Adapt docstring.
14622
14623 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14624
14625 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14626 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14627 Do not assume ptrdiff_t is the same width as 'int'.
14628
14629 * alloc.c: Handle unusual debugging option combinations.
14630 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14631 since the two debugging options are incompatible.
14632 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14633 is defined.
14634 (mem_init, mem_insert, mem_insert_fixup):
14635 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14636 (NEED_MEM_INSERT): Remove; no longer needed.
14637
14638 2012-04-22 Leo Liu <sdl.web@gmail.com>
14639
14640 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14641
14642 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14643
14644 * sysdep.c [__FreeBSD__]: Minor cleanups.
14645 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14646 Use Emacs indenting style more consistently. Avoid some casts.
14647 Use 'double' consistently rather than mixing 'float' and 'double'.
14648
14649 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14650
14651 * sysdep.c (list_system_processes, system_process_attributes):
14652 Add implementation for FreeBSD (Bug#5243).
14653
14654 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14655
14656 * lisp.mk (lisp): Update.
14657
14658 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14659
14660 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14661 It is never used otherwise.
14662
14663 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14664
14665 * print.c (print_preprocess): Only check print_depth if print-circle
14666 is nil.
14667 (print_object): Check for cycles even when print-circle is nil and
14668 print-gensym is t, but only check print_depth if print-circle is nil.
14669
14670 2012-04-20 Chong Yidong <cyd@gnu.org>
14671
14672 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14673 set the status to "failed" and ensure that sentinel is run.
14674
14675 2012-04-20 Glenn Morris <rgm@gnu.org>
14676
14677 * process.c (Fset_process_inherit_coding_system_flag)
14678 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14679 (Fmake_network_process, Fmake_serial_process): Doc fix.
14680
14681 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14682
14683 * xdisp.c (string_buffer_position_lim): Limit starting position to
14684 BEGV.
14685 (set_cursor_from_row): If called for a mode-line or header-line
14686 row, return zero immediately.
14687 (try_cursor_movement): If inside continuation line, don't back up
14688 farther than the first row after the header line, if any.
14689 Don't consider the header-line row as "partially visible", even if
14690 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14691
14692 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14693
14694 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14695 (bug#11238).
14696
14697 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14698 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14699
14700 configure: new option --enable-gcc-warnings (Bug#11207)
14701 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14702 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14703 (ALL_CFLAGS): Use new macros rather than old.
14704 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14705 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14706 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14707 -Wunused-result, -Wunused-variable. This should go away once
14708 the Emacs and Gnulib regex code is merged.
14709 (xmalloc, xrealloc): Now static.
14710
14711 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14712
14713 * dired.c (Fsystem_groups): Remove unused local.
14714
14715 2012-04-17 Glenn Morris <rgm@gnu.org>
14716
14717 * dired.c (Fsystem_users): Doc fix.
14718
14719 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14720
14721 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14722 (syms_of_dired): Add them.
14723
14724 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14725
14726 Fix minor alloc.c problems found by static checking.
14727 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14728 New extern decls, to avoid calling undeclared functions.
14729 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14730 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14731 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14732 (NEED_MEM_INSERT): New macro.
14733 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14734 Remove one incorrect comment and fix another.
14735
14736 Fix minor ralloc.c problems found by static checking.
14737 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14738 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14739 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14740 (r_alloc_sbrk): Now static.
14741
14742 Improve ralloc.c interface checking.
14743 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14744 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14745 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14746 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14747 [REL_ALLOC]: ... to here, to check interface.
14748 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14749 Remove decls. This fixes an "It stinks!".
14750
14751 * alloc.c (which_symbols): Fix alignment issue / type clash.
14752
14753 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14754
14755 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14756 (struct Lisp_Misc_Any): Likewise.
14757 (struct Lisp_Free): Likewise.
14758 * alloc.c (union aligned_Lisp_Symbol): Define.
14759 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14760 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14761 (union aligned_Lisp_Misc): Define.
14762 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14763 aligned_Lisp_Misc instead of union Lisp_Misc.
14764 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14765
14766 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14767
14768 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14769 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14770 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14771 * s/netbsd.h, s/sol2-6.h:
14772 Remove definition of GC_MARK_STACK, since the default now works.
14773 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14774 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14775 no longer the default.
14776 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14777
14778 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14779
14780 * lread.c (lisp_file_lexically_bound_p):
14781 Fix hang at ";-*-\n" (bug#11238).
14782
14783 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14784
14785 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14786 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14787
14788 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14789
14790 * nsterm.m (constrainFrameRect): Always constrain when there is only
14791 one screen (Bug#10962).
14792
14793 2012-04-13 Ken Brown <kbrown@cornell.edu>
14794
14795 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14796
14797 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14798
14799 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14800
14801 2012-04-11 Daniel Colascione <dancol@dancol.org>
14802
14803 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14804 against is gone. It's better to use vfork now so that when Cygwin
14805 gains a new, working vfork, we use it automatically (bug#10398).
14806
14807 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14808
14809 * window.c (save_window_save): Obey window-point-insertion-type.
14810
14811 2012-04-11 Glenn Morris <rgm@gnu.org>
14812
14813 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14814
14815 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14816
14817 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14818
14819 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14820
14821 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14822 (force_quit_count): New var.
14823 (handle_interrupt): Use it.
14824
14825 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14826
14827 * w32.c (w32_delayed_load): Record the full path of the library
14828 being loaded (bug#10424).
14829
14830 2012-04-09 Glenn Morris <rgm@gnu.org>
14831
14832 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14833 not just in the obarray, before snarfing them. (Bug#11036)
14834
14835 * Makefile.in ($(leimdir)/leim-list.el):
14836 Pass EMACS rather than BUILT_EMACS.
14837
14838 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14839
14840 * process.c (make_process):
14841 * process.h: Add integer `gnutls_handshakes_tried' member to
14842 process struct.
14843
14844 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14845 Add convenience `GNUTLS_LOG2i' macro.
14846
14847 * gnutls.c (gnutls_log_function2i): Convenience log function.
14848 (emacs_gnutls_read): Use new log functions,
14849 `gnutls_handshakes_tried' process member, and
14850 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14851 attempts per process (connection).
14852
14853 2012-04-09 Chong Yidong <cyd@gnu.org>
14854
14855 * eval.c (Fuser_variable_p, user_variable_p_eh)
14856 (lisp_indirect_variable): Functions deleted.
14857 (Fdefvar): Caller changed.
14858
14859 * callint.c (Finteractive, Fcall_interactively):
14860 * minibuf.c (Fread_variable): Callers changed.
14861
14862 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14863
14864 * xdisp.c (set_cursor_from_row): If the display string appears in
14865 the buffer at position that is closer to point than the position
14866 after the display string, display the cursor on the first glyph of
14867 the display string. Fixes cursor display when a 'display' text
14868 property immediately follows invisible text. (Bug#11094)
14869
14870 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14871
14872 composite.c: use 'double' consistently
14873 * composite.c (get_composition_id): Use 'double' consistently
14874 instead of converting 'float' to 'double' and vice versa; this is
14875 easier to understand and avoids a GCC warning.
14876
14877 2012-04-09 Glenn Morris <rgm@gnu.org>
14878
14879 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14880 preparation for dumping it with emacs. (Bug#4789)
14881 (leimdir): New variable.
14882 ($(leimdir)/leim-list.el): New rule.
14883 (emacs$(EXEEXT)): Depend on leim-list.el.
14884
14885 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14886 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14887 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14888
14889 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14890
14891 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14892 proper alignment.
14893
14894 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14895
14896 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14897 Remove unused local variable.
14898
14899 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14900
14901 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14902 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14903 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14904 objects, as mark_maybe_pointer will catch them otherwise.
14905 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14906 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14907
14908 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14909
14910 Fix typo that broke non-Windows builds.
14911 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14912
14913 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14914
14915 Support building on MS-Windows with libxml2.
14916
14917 * makefile.w32-in (OBJ2): Add xml.$(O).
14918 (GLOBAL_SOURCES): Add xml.c.
14919 ($(BLD)/xml.$(O)): New dependency list.
14920
14921 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14922 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14923 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14924 [!WINDOWSNT]: New macros.
14925 (init_libxml2_functions, libxml2_loaded_p): New functions.
14926 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14927 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14928 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14929 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14930 linked in).
14931 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14932 Call init_libxml2_functions before calling libxml2 functions.
14933 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14934
14935 * emacs.c: Don't include libxml/parser.h.
14936 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14937 xmlCleanupParser directly.
14938
14939 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14940
14941 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14942
14943 * indent.c (Fvertical_motion): If there is a display string at
14944 point, use it.vpos to compute how many lines to backtrack after
14945 move_it_to point. (Bug#11133)
14946
14947 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14948
14949 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14950 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14951 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14952 macros related to unification of CJK characters. For the details,
14953 see the discussion following the message here:
14954 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14955
14956 2012-04-04 Chong Yidong <cyd@gnu.org>
14957
14958 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14959
14960 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14961
14962 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14963 instead of alloca. (Bug#11138)
14964
14965 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14966
14967 * w32menu.c (is_simple_dialog): Properly check lisp types.
14968 (Bug#11141)
14969
14970 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14971
14972 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14973 position we get to after a call to move_it_to fails the
14974 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14975 only if we wind up in a string from display property. (Bug#11063)
14976
14977 * window.c (Fdelete_other_windows_internal): Invalidate the row
14978 and column information about mouse highlight, so that redisplay
14979 restores it after reallocating the glyph matrices. (Bug#7464)
14980
14981 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14982 string comes from a `display' text property, use the buffer
14983 position of that property as if we actually saw that position in
14984 the row's glyphs.
14985 (move_it_by_lines): Remove the assertion that
14986 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14987 violated when there's a before-string at the beginning of a line.
14988 (Bug#11063)
14989
14990 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14991
14992 * xdisp.c (append_space_for_newline): If the default face was
14993 remapped, use the remapped face for the appended newline.
14994 (extend_face_to_end_of_line): Use the remapped default face for
14995 extending the face to the end of the line.
14996 (display_line): Call extend_face_to_end_of_line when the default
14997 face was remapped. (Bug#11068)
14998
14999 2012-03-29 Eli Zaretskii <eliz@gnu.org>
15000
15001 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
15002
15003 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15004
15005 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
15006
15007 2012-03-27 Glenn Morris <rgm@gnu.org>
15008
15009 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15010 Doc fixes.
15011
15012 2012-03-26 Kenichi Handa <handa@m17n.org>
15013
15014 * dispextern.h (struct glyph): Fix previous change. Change the
15015 bit length of glyphless.ch to 25 (Bug#11082).
15016
15017 2012-03-26 Chong Yidong <cyd@gnu.org>
15018
15019 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15020 (command_loop_1): Use it; inhibit selection update for
15021 handle-select-window too (Bug#8996).
15022
15023 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15024
15025 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15026
15027 2012-03-25 Kenichi Handa <handa@m17n.org>
15028
15029 * dispextern.h (struct glyph): Change the bit length of
15030 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15031
15032 2012-03-24 Eli Zaretskii <eliz@gnu.org>
15033
15034 * s/ms-w32.h (tzname): Include time.h before redirecting to
15035 _tzname. Fixes the MSVC build. (Bug#9960)
15036
15037 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15038
15039 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15040 characters.
15041
15042 * xterm.c (XTread_socket): Only modify handling_signal if
15043 !SYNC_INPUT. (Bug#11080)
15044
15045 2012-03-23 Eli Zaretskii <eliz@gnu.org>
15046
15047 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15048 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15049 when fetching a multibyte character consumes more bytes than
15050 CHAR_BYTES returns, due to unification of CJK characters in
15051 string_char. (Bug#11073)
15052
15053 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15054
15055 * process.c (wait_reading_process_output): Handle pty disconnect
15056 by refraining from sending oneself a SIGCHLD (bug#10933).
15057
15058 2012-03-22 Chong Yidong <cyd@gnu.org>
15059
15060 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15061
15062 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15063 Mark string as coming from a prefix property.
15064 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15065 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15066
15067 2012-03-21 Chong Yidong <cyd@gnu.org>
15068
15069 * xfaces.c (Vface_remapping_alist): Doc fix.
15070
15071 2012-03-20 Eli Zaretskii <eliz@gnu.org>
15072
15073 * w32proc.c (Fw32_set_console_codepage)
15074 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15075 Doc fixes.
15076
15077 2012-03-20 Chong Yidong <cyd@gnu.org>
15078
15079 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15080 to reflect default non-nil value of redisplay-dont-pause.
15081
15082 2012-03-19 Kenichi Handa <handa@m17n.org>
15083
15084 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15085 it fit in a valid range (Bug#11003).
15086
15087 2012-03-18 Eli Zaretskii <eliz@gnu.org>
15088
15089 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15090 that is not from display property, accept the row as a "cursor
15091 row" if one of the string's character has a non-nil `cursor'
15092 property. Fixes cursor positioning when there are newlines in
15093 overlay strings, e.g. in icomplete.el. (Bug#11035)
15094
15095 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15096
15097 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15098
15099 2012-03-12 Chong Yidong <cyd@gnu.org>
15100
15101 * eval.c (inhibit_lisp_code): Rename from
15102 inhibit_window_configuration_change_hook; move from window.c.
15103
15104 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15105 * window.c (run_window_configuration_change_hook)
15106 (syms_of_window): Callers changed.
15107
15108 2012-03-11 Chong Yidong <cyd@gnu.org>
15109
15110 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15111
15112 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15113
15114 2012-03-10 Chong Yidong <cyd@gnu.org>
15115
15116 * frame.c (other_visible_frames): Don't assume the selected frame
15117 is visible (Bug#10955).
15118
15119 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15120
15121 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15122
15123 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15124
15125 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15126 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15127 zero (Bug#10954).
15128
15129 2012-03-03 Glenn Morris <rgm@gnu.org>
15130
15131 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15132
15133 2012-03-02 Eli Zaretskii <eliz@gnu.org>
15134
15135 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15136 position past the first glyph_row that ends at ZV. (Bug#10902)
15137 (redisplay_window, next_element_from_string): Fix typos in
15138 comments.
15139 (redisplay_window): Pass to move_it_vertically the margin in
15140 pixels, not in screen lines.
15141
15142 2012-03-02 Glenn Morris <rgm@gnu.org>
15143
15144 * buffer.c (buffer-list-update-hook): Doc fix.
15145
15146 2012-02-29 Eli Zaretskii <eliz@gnu.org>
15147
15148 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15149 push_it before setting up the iterator for the first overlay
15150 string, even if we have an empty string loaded.
15151 (next_overlay_string): If there's an empty string on the iterator
15152 stack, pop the stack. (Bug#10903)
15153
15154 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15155
15156 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15157 Suggested by Stefan Monnier in
15158 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15159 * alloc.c (widen_to_Lisp_Object): New static function.
15160 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15161 and widening them to Lisp_Objects. This would work even if
15162 USE_LSB_TAG is defined and wide integers are used, which might
15163 happen in a future version of Emacs.
15164
15165 2012-02-25 Chong Yidong <cyd@gnu.org>
15166
15167 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15168 Doc fix.
15169
15170 * xselect.c (Fx_selection_exists_p): Doc fix.
15171 (x_clipboard_manager_save_all): Print an informative message
15172 before saving to clipboard manager.
15173
15174 2012-02-24 Chong Yidong <cyd@gnu.org>
15175
15176 * keyboard.c (process_special_events): Handle all X selection
15177 requests in kbd_buffer, not just the next one (Bug#8869).
15178
15179 2012-02-23 Chong Yidong <cyd@gnu.org>
15180
15181 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15182 call when setting menu-bar-lines and tool-bar-lines parameters.
15183 (unwind_create_frame_1): New helper function.
15184
15185 * window.c (inhibit_window_configuration_change_hook): New var.
15186 (run_window_configuration_change_hook): Obey it.
15187 (syms_of_window): Initialize it.
15188
15189 2012-02-22 Chong Yidong <cyd@gnu.org>
15190
15191 * xterm.c (x_draw_image_relief): Add missing type check for
15192 Vtool_bar_button_margin (Bug#10743).
15193
15194 2012-02-21 Chong Yidong <cyd@gnu.org>
15195
15196 * fileio.c (Vfile_name_handler_alist): Doc fix.
15197
15198 * buffer.c (Fget_file_buffer): Protect against invalid file
15199 handler return value.
15200
15201 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15202
15203 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15204 when computing $valmask.
15205
15206 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15207 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15208 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15209 It's useless in that case, and it can cause problems on hosts
15210 that allocate halves of EMACS_INT values separately.
15211 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15212 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15213 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15214 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15215 it avoids undefined behavior on hosts where shifting right by more
15216 than the word width has undefined behavior.
15217
15218 2012-02-19 Chong Yidong <cyd@gnu.org>
15219
15220 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15221 (Funhandled_file_name_directory, Ffile_name_as_directory)
15222 (Fdirectory_file_name, Fexpand_file_name)
15223 (Fsubstitute_in_file_name): Protect against invalid file handler
15224 return values (Bug#10845).
15225
15226 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15227
15228 * .gdbinit (pitx): Fix incorrect references to fields of the
15229 iterator stack.
15230
15231 2012-02-17 Chong Yidong <cyd@gnu.org>
15232
15233 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15234
15235 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15236
15237 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15238 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15239
15240 2012-02-15 Chong Yidong <cyd@gnu.org>
15241
15242 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15243 marked as special. Also, starting docstrings with * is obsolete.
15244
15245 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15246
15247 * gnutls.c (emacs_gnutls_write): Fix last change.
15248
15249 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15250
15251 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15252 send_process.
15253
15254 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15255
15256 * keymap.c (Fsingle_key_description): Handle char ranges.
15257
15258 2012-02-12 Chong Yidong <cyd@gnu.org>
15259
15260 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15261 as that creates a dangerous corner case.
15262
15263 * window.c (Fdelete_window_internal): Invalidate the mouse
15264 highlight (Bug#9904).
15265
15266 2012-02-12 Glenn Morris <rgm@gnu.org>
15267
15268 * xselect.c (Fx_own_selection_internal)
15269 (Fx_get_selection_internal, Fx_disown_selection_internal)
15270 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15271 * nsselect.m (Fx_own_selection_internal)
15272 (Fx_disown_selection_internal, Fx_selection_exists_p)
15273 (Fx_selection_owner_p, Fx_get_selection_internal):
15274 Sync docs and argument specs with the xselect.c versions.
15275
15276 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15277
15278 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15279
15280 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15281
15282 * w32select.c (Fx_selection_exists_p): Sync doc string and
15283 argument list with xselect.c. (Bug#10783)
15284
15285 * w16select.c (Fx_selection_exists_p): Sync doc string and
15286 argument list with xselect.c. (Bug#10783)
15287
15288 2012-02-10 Glenn Morris <rgm@gnu.org>
15289
15290 * fns.c (Fsecure_hash): Doc fix.
15291
15292 2012-02-09 Kenichi Handa <handa@m17n.org>
15293
15294 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15295
15296 2012-02-07 Chong Yidong <cyd@gnu.org>
15297
15298 * buffer.c (Fbuffer_local_variables)
15299 (buffer_lisp_local_variables): Handle unbound vars correctly;
15300 don't let Qunbound leak into Lisp.
15301
15302 2012-02-07 Glenn Morris <rgm@gnu.org>
15303
15304 * image.c (Fimagemagick_types): Doc fix.
15305
15306 * image.c (imagemagick-render-type): Change it from a lisp object
15307 to an integer. Move the doc here from the lisp manual.
15308 Treat all values not equal to 0 the same.
15309
15310 2012-02-06 Chong Yidong <cyd@gnu.org>
15311
15312 * doc.c (store_function_docstring): Avoid applying docstring of
15313 alias to base function (Bug#2603).
15314
15315 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15316
15317 * .gdbinit (pp1, pv1): Remove redundant defines.
15318 (pr): Use pp.
15319
15320 2012-02-04 Chong Yidong <cyd@gnu.org>
15321
15322 * nsterm.m: Declare a global (Bug#10694).
15323
15324 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15325
15326 * w32.c (get_emacs_configuration_options):
15327 Include --enable-checking, if specified, in the return value.
15328
15329 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15330
15331 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15332 after rounding frame sizes. (Bug#9723)
15333
15334 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15335
15336 * keyboard.c (adjust_point_for_property): Don't position point
15337 before BEGV. (Bug#10696)
15338
15339 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15340
15341 Handle overflow when computing char display width (Bug#9496).
15342 * character.c (char_width): Return EMACS_INT, not int.
15343 (char_width, c_string_width): Check for overflow when
15344 computing the width; this is possible now that individual
15345 characters can have unbounded width. Problem introduced
15346 by merge from Emacs 23 on 2012-01-19.
15347
15348 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15349
15350 * dbusbind.c (Fdbus_register_method): Mention the return value
15351 :ignore in the docstring.
15352
15353 2012-02-02 Glenn Morris <rgm@gnu.org>
15354
15355 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15356
15357 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15358 Unconditionally set to t. (Bug#10673)
15359 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15360 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15361 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15362
15363 2012-02-02 Kenichi Handa <handa@m17n.org>
15364
15365 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15366 0, do not call append_composite_glyph.
15367
15368 2012-02-02 Kenichi Handa <handa@m17n.org>
15369
15370 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15371 NULL (Bug#6988).
15372 (x_produce_glyphs): If the component of a composition is a null
15373 string, set it->pixel_width to 1 to avoid zero-width glyph.
15374
15375 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15376
15377 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15378 first 2 arguments are identical. This makes inserting large
15379 output from a subprocess an order of magnitude faster on
15380 MS-Windows, where all sbrk'ed memory is always contiguous.
15381
15382 2012-01-31 Glenn Morris <rgm@gnu.org>
15383
15384 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15385 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15386 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15387
15388 2012-01-29 Glenn Morris <rgm@gnu.org>
15389
15390 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15391
15392 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15393
15394 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15395
15396 2012-01-28 Chong Yidong <cyd@gnu.org>
15397
15398 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15399
15400 2012-01-26 Chong Yidong <cyd@gnu.org>
15401
15402 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15403
15404 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15405 repeat counts (Bug#10507).
15406
15407 2012-01-26 Glenn Morris <rgm@gnu.org>
15408
15409 * lread.c (syms_of_lread): Doc fix.
15410
15411 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15412
15413 * coding.c (encode_designation_at_bol): Change return value to
15414 EMACS_INT.
15415
15416 2012-01-25 Chong Yidong <cyd@gnu.org>
15417
15418 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15419
15420 2012-01-21 Chong Yidong <cyd@gnu.org>
15421
15422 * floatfns.c (Fcopysign): Make the second argument non-optional,
15423 since nil is not allowed anyway.
15424
15425 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15426
15427 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15428 (send_process): Likewise.
15429
15430 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15431
15432 * window.c (save_window_save, Fcurrent_window_configuration)
15433 (Vwindow_persistent_parameters): Do not use Qstate.
15434 Rewrite doc-strings.
15435
15436 2012-01-19 Kenichi Handa <handa@m17n.org>
15437
15438 * character.c (char_width): New function.
15439 (Fchar_width, c_string_width, lisp_string_width):
15440 Use char_width (Bug#9496).
15441
15442 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15443
15444 * window.c (Vwindow_persistent_parameters): New variable.
15445 (Fset_window_configuration, save_window_save): Handle persistent
15446 window parameters.
15447
15448 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15449
15450 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15451 thrashing the stack of the thread. (Bug#9087)
15452
15453 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15454
15455 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15456
15457 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15458
15459 * xdisp.c (rows_from_pos_range): Handle the case where the
15460 highlight ends on a newline. (Bug#10464)
15461 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15462 he end column for display of highlight that ends on a newline
15463 before a R2L line.
15464
15465 2012-01-11 Glenn Morris <rgm@gnu.org>
15466
15467 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15468 from load-path also when installation-directory is nil. (Bug#10208)
15469
15470 2012-01-10 Glenn Morris <rgm@gnu.org>
15471
15472 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15473
15474 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15475 Update template values to be closer to their typical values these days.
15476
15477 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15478
15479 * xdisp.c (rows_from_pos_range): Accept additional argument
15480 DISP_STRING, and accept any glyph in a row whose object is that
15481 string as eligible for mouse highlight. Fixes mouse highlight of
15482 display strings from overlays. (Bug#10464)
15483
15484 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15485
15486 emacs: fix an auto-save permissions race condition (Bug#10400)
15487 * fileio.c (auto_saving_dir_umask): New static var.
15488 (Fmake_directory_internal): Use it.
15489 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15490 creating the directory. The old code temporarily assigns
15491 too-generous permissions to the directory.
15492 (do_auto_save_eh): Clear it.
15493 (Fdo_auto_save): Catch all errors, not just file errors, so
15494 that the var is always cleared.
15495
15496 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15497
15498 * search.c (scan_buffer): Pass character positions to
15499 know_region_cache, not byte positions. (Bug#6540)
15500
15501 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15502
15503 * w32.c (sys_rename): Report EXDEV when rename of a directory
15504 fails because the target is on another logical disk. (Bug#10284)
15505
15506 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15507
15508 * xterm.c (x_embed_request_focus): New function.
15509
15510 * xterm.h: Add prototype.
15511
15512 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15513
15514 2012-01-05 Glenn Morris <rgm@gnu.org>
15515
15516 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15517
15518 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15519
15520 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15521 Load gnutls_transport_set_lowat only if GnuTLS version is below
15522 2.11.1.
15523 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15524 GnuTLS versions below 2.11.1.
15525
15526 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15527
15528 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15529 to the doc string advising against its use for altering the way
15530 windows are scrolled.
15531
15532 2011-12-28 Kenichi Handa <handa@m17n.org>
15533
15534 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15535 coding-system ASCII compatible only when it does not produce BOM
15536 on encoding (Bug#10383).
15537
15538 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15539
15540 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15541 can scroll.
15542 (create_and_show_popup_menu): Always use menu_position_func for
15543 Gtk3 (Bug#10361).
15544
15545 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15546
15547 * callint.c (Fcall_interactively): Don't truncate prompt string.
15548
15549 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15550
15551 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15552 property that ends at ZV, so that the bidi iteration could be
15553 resumed from there (after widening). (Bug#10360)
15554
15555 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15556
15557 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15558
15559 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15560
15561 * nsterm.m (x_free_frame_resources):
15562 Release f->output_data.ns->miniimage.
15563 (ns_index_color): Fix indentation. Do not retain
15564 color_table->colors[i].
15565
15566 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15567 before returning.
15568
15569 * nsfns.m (x_set_background_color): Assign return value from
15570 ns_index_color to face-background instead of NSColor*.
15571 (ns_implicitly_set_icon_type): Fix indentation.
15572 Change assignment in for loop to comparison.
15573
15574 * emacs.c (ns_pool): New variable.
15575 (main): Assign ns_pool.
15576 (Fkill_emacs): Call ns_release_autorelease_pool.
15577
15578 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15579 autorelease fdesc, release fdAttrs and tdict.
15580 (ns_get_covering_families): Release charset.
15581 (ns_findfonts): Release NSFontDescriptor created with new.
15582 (ns_uni_to_glyphs): Fix indentation.
15583 (setString): Release attrStr before assigning new value.
15584
15585 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15586
15587 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15588 and NS_IMPL_COCOA.
15589 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15590 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15591
15592 2011-12-18 David Reitter <reitter@cmu.edu>
15593
15594 * nsterm.m (ns_term_init): Subscribe for notifications
15595 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15596 to method trackingNotification in EmacsMenu.
15597
15598 * nsmenu.m (trackingMenu): New variable.
15599 (trackingNotification): New method (from Aquamacs).
15600 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15601 from Aquamacs (Bug#7030).
15602
15603 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15604
15605 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15606 (symbol_to_nsstring): Fix indentation.
15607 (ns_symbol_to_pb): New function.
15608 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15609 (Fns_rotate_cut_buffers_internal): Remove.
15610 (Fns_store_selection_internal): Rename from
15611 Fns_store_cut_buffer_internal.
15612 (ns_get_foreign_selection, Fx_own_selection_internal)
15613 (Fx_disown_selection_internal, Fx_selection_exists_p)
15614 (Fns_get_selection_internal, Fns_store_selection_internal):
15615 Use ns_symbol_to_pb and check if return value is nil.
15616 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15617 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15618 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15619 renamed to Sns_store_selection_internal.
15620 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15621 and remove this function.
15622 (ns_handle_selection_clear): Remove, never used.
15623 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15624 here.
15625
15626 2011-12-17 Ken Brown <kbrown@cornell.edu>
15627
15628 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15629 GID is unknown (Bug#10257).
15630
15631 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15632
15633 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15634 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15635 which caused a build failure on GNU/Linux IA-64. This problem was
15636 introduced by my 2011-10-07 patch.
15637
15638 2011-12-15 Juri Linkov <juri@jurta.org>
15639
15640 * image.c (imagemagick_error): New function. (Bug#10112)
15641 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15642 Use `imagemagick_error' where ImageMagick functions return
15643 `MagickFalse'.
15644 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15645 proper order.
15646
15647 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15648
15649 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15650 fill background (Bug#8992).
15651
15652 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15653
15654 * window.c (Vwindow_combination_resize)
15655 (Vwindow_combination_limit): Use t instead of non-nil in
15656 doc-strings.
15657 (Vrecenter_redisplay): Add first sentence of doc-string on
15658 separate line.
15659 (Frecenter): Fix doc-string typo.
15660
15661 2011-12-11 Kenichi Handa <handa@m17n.org>
15662
15663 * coding.c (Funencodable_char_position): Pay attention to the
15664 buffer text relocation (Bug#9389).
15665
15666 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15667
15668 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15669 gtk_init (Bug#10100).
15670
15671 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15672
15673 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15674 IT->string is nil. (Bug#10263)
15675
15676 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15677
15678 * nsterm.h (x_free_frame_resources): Declare.
15679
15680 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15681 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15682
15683 * nsterm.h (ns_get_defaults_value): Declare.
15684
15685 * nsterm.m (ns_default): Call ns_get_defaults_value.
15686
15687 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15688
15689 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15690 (Bug#10170)
15691
15692 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15693
15694 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15695 that where the value of an _OBJC_* symbol points to is in the .bss
15696 section (Bug#10240).
15697
15698 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15699
15700 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15701 after the loop to call ccl_driver at least once (Bug#8619).
15702
15703 2011-12-08 Kenichi Handa <handa@m17n.org>
15704
15705 * ftfont.c (get_adstyle_property): Fix previous change
15706 (Bug#10233).
15707
15708 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15709
15710 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15711 dirs from the default value of EMACSLOADPATH (bug#10208).
15712
15713 2011-12-07 Glenn Morris <rgm@gnu.org>
15714
15715 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15716 installation and source directories as well. (Bug#10208)
15717
15718 2011-12-06 Chong Yidong <cyd@gnu.org>
15719
15720 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15721
15722 2011-12-06 Glenn Morris <rgm@gnu.org>
15723
15724 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15725 as an error, not just -1. (Bug#10217)
15726
15727 2011-12-05 Chong Yidong <cyd@gnu.org>
15728
15729 * keyboard.c (process_special_events): New function.
15730 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15731
15732 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15733
15734 * coding.c (encode_designation_at_bol): Don't use uninitialized
15735 local variable (Bug#9318).
15736
15737 2011-12-05 Kenichi Handa <handa@m17n.org>
15738
15739 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15740 return Qnil (Bug#8046, Bug#10193).
15741
15742 2011-12-05 Kenichi Handa <handa@m17n.org>
15743
15744 * coding.c (encode_designation_at_bol): New args charbuf_end and
15745 dst. Return the number of produced bytes. Callers changed.
15746 (coding_set_source): Return how many bytes coding->source was
15747 relocated.
15748 (coding_set_destination): Return how many bytes
15749 coding->destination was relocated.
15750 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15751 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15752
15753 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15754
15755 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15756 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15757 macro (Bug#9318).
15758
15759 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15760
15761 The following changes are to fix Bug#9318.
15762
15763 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15764 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15765 (encode_coding_iso_2022, encode_coding_sjis)
15766 (encode_coding_big5, encode_coding_charset): Use the above macros.
15767
15768 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15769
15770 * lisp.h (process_quit_flag): Fix external declaration.
15771
15772 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15773
15774 Don't macro-inline non-performance-critical code.
15775 * eval.c (process_quit_flag): New function.
15776 * lisp.h (QUIT): Use it.
15777
15778 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15779
15780 * nsfns.m (get_geometry_from_preferences): New function.
15781 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15782
15783 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15784
15785 * emacs.c (Qkill_emacs): Define.
15786 (syms_of_emacs): Initialize it.
15787 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15788 Qquit_flag to `kill-emacs' instead.
15789 (quit_throw_to_read_char): Add parameter `from_signal'.
15790 All callers changed. Call Fkill_emacs if requested and safe.
15791 * lisp.h (QUIT): Call Fkill_emacs if requested.
15792
15793 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15794
15795 * widget.c (update_wm_hints): Return if wmshell is null.
15796 (widget_update_wm_size_hints): New function.
15797
15798 * widget.h (widget_update_wm_size_hints): Declare.
15799
15800 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15801 widget_update_wm_size_hints (Bug#10104).
15802
15803 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15804
15805 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15806 before a newline, prepare the bidi iterator for consuming the
15807 newline, and keep the current paragraph direction. (Bug#10183)
15808 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15809
15810 2011-12-02 Juri Linkov <juri@jurta.org>
15811
15812 * search.c (Fword_search_regexp): New Lisp function created from
15813 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15814 (Fword_search_backward, Fword_search_forward)
15815 (Fword_search_backward_lax, Fword_search_forward_lax):
15816 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15817 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15818
15819 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15820
15821 * fileio.c (Finsert_file_contents): Move after-change-function call
15822 to before the "handled:" label, since all "goto handled" appear in
15823 cases where the *-change-functions have already been properly called
15824 (bug#10117).
15825
15826 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15827
15828 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15829 waiting for input. (Bug#10169)
15830
15831 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15832
15833 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15834 verifies glyph row's hash code--we have just reallocated the
15835 glyphs, so their contents can be complete garbage. (Bug#10164)
15836
15837 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15838
15839 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15840
15841 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15842
15843 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15844 attributes are tested _before_ calling verify_row_hash, to protect
15845 against GCC re-ordering of the tests. (Bug#10164)
15846
15847 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15848
15849 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15850
15851 * xterm.c (handle_one_xevent): Only set async_visible and friends
15852 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15853 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15854 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15855
15856 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15857
15858 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15859 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15860 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15861 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15862 All uses changed to use GCPRO1 etc.
15863 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15864 Revert to old implementation (i.e., before 2011-03-11).
15865
15866 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15867
15868 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15869 of scroll runs so as to avoid assigning disabled bogus rows and
15870 unnecessary graphics copy operations.
15871
15872 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15873
15874 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15875 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15876 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15877 (malloc, free, realloc, calloc): Redirect to e_* only when
15878 compiling Emacs.
15879
15880 * lisp.h (GCTYPEBITS): Move before first use.
15881 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15882 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15883 this macro definition.
15884
15885 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15886 _MSC_VER.
15887
15888 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15889
15890 * gtkutil.c (xg_create_frame_widgets):
15891 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15892 present with Gtk+ 2.0.
15893
15894 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15895
15896 * fileio.c (Finsert_file_contents): Undo previous change; see
15897 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15898
15899 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15900
15901 Rename locals to avoid shadowing.
15902 * fileio.c (Finsert_file_contents):
15903 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15904 * process.c (wait_reading_process_output):
15905 Rename inner 'proc' to 'p' to avoid shadowing.
15906 Indent for consistency with usual Emacs style.
15907
15908 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15909
15910 * xdisp.c (redisplay_window): If cursor row is not fully visible
15911 after recentering, and scroll-conservatively is set to a large
15912 number, scroll window by a few more lines to make the cursor fully
15913 visible and out of scroll-margin. (Bug#10105)
15914 (start_display): Don't move to the next line if the display should
15915 start at a newline that is part of a display vector or an overlay
15916 string. (Bug#10119)
15917
15918 2011-11-24 Juri Linkov <juri@jurta.org>
15919
15920 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15921 after the `MagickPingImage' call. (Bug#10112)
15922
15923 2011-11-23 Chong Yidong <cyd@gnu.org>
15924
15925 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15926
15927 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15928
15929 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15930 making another buffer current. (Bug#10114)
15931
15932 2011-11-23 Glenn Morris <rgm@gnu.org>
15933
15934 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15935
15936 2011-11-23 Chong Yidong <cyd@gnu.org>
15937
15938 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15939 using it (Bug#5984).
15940
15941 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15942
15943 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15944 and header-lines, as they don't have one computed for them.
15945 (Bug#10098)
15946
15947 * .gdbinit (prow): Make displayed values more self-explaining.
15948 Add row's hash code.
15949
15950 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15951
15952 * process.c (wait_reading_process_output): Fix asynchrounous
15953 GnuTLS socket handling on some versions of the GnuTLS library.
15954 (wait_reading_process_output): Add comment and URL.
15955
15956 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15957
15958 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15959
15960 2011-11-21 Chong Yidong <cyd@gnu.org>
15961
15962 * window.c (Fnext_window, Fprevious_window): Doc fix.
15963
15964 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15965
15966 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15967
15968 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15969
15970 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15971
15972 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15973
15974 * window.c (Fset_window_combination_limit): Rename argument
15975 STATUS to LIMIT.
15976 (Vwindow_combination_limit): Remove "status" from doc-string.
15977
15978 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15979
15980 * m/ibms390.h: Remove.
15981 * m/ibms390x.h: Don't include "ibms390.h".
15982
15983 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15984
15985 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15986 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15987
15988 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15989
15990 * casetab.c (Fset_case_table):
15991 * charset.c (Fcharset_after): Fix typos.
15992
15993 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15994
15995 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15996 Otherwise, valgrind does not work on some platforms.
15997 Problem reported by Andreas Schwab in
15998 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15999 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
16000 is set, removing the need for VIRT_ADDRESS_VARIES.
16001 (PURE_P): Use a more-efficient implementation that needs just one
16002 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16003 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
16004 to 4 (xorl, subq, cmpq, setbe).
16005 * alloc.c (pure): Always extern now, since that's the
16006 VIRT_ADDR_VARIES behavior.
16007 (PURE_POINTER_P): Use a single comparison, not two, for
16008 consistency with the new puresize.h.
16009 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16010 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16011 Remove VIRT_ADDR_VARIES no longer needed.
16012
16013 2011-11-19 Eli Zaretskii <eliz@gnu.org>
16014
16015 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16016 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16017 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16018 behave as if the cursor position were at the window margin.
16019
16020 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16021 and the cursor position is out of bounds, behave as if the cursor
16022 position were at the window margin. (Bug#10075)
16023
16024 2011-11-18 Chong Yidong <cyd@gnu.org>
16025
16026 * window.c (Fwindow_combination_limit): Make first argument
16027 non-optional, since it is meaningless for live windows like the
16028 selected window.
16029
16030 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16031
16032 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16033
16034 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16035
16036 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16037 (graft_intervals_into_buffer): Simplify.
16038
16039 2011-11-18 Eli Zaretskii <eliz@gnu.org>
16040
16041 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16042 hash values of the two rows.
16043 (copy_row_except_pointers): Preserve the used[] arrays and the
16044 hash values of the two rows. (Bug#10035)
16045 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16046
16047 * xdisp.c (row_hash): New function, body extracted from
16048 compute_line_metrics.
16049 (compute_line_metrics): Call row_hash, instead of computing the
16050 hash code inline.
16051
16052 * dispnew.c (verify_row_hash): Call row_hash for computing the
16053 hash code of a row, instead of duplicating code from xdisp.c.
16054
16055 * dispextern.h (row_hash): Add prototype.
16056
16057 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16058
16059 * frame.c (delete_frame): Don't delete the terminal when the last
16060 X frame is closed if emacs is built with GTK toolkit.
16061
16062 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
16063
16064 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16065
16066 2011-11-17 Martin Rudalics <rudalics@gmx.at>
16067
16068 * window.c (Vwindow_splits): Rename to
16069 Vwindow_combination_resize. Suggested by Juri Linkov.
16070 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16071 of Vwindow_splits.
16072
16073 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
16074
16075 * nsfns.m (Fns_font_name):
16076 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16077
16078 2011-11-16 Martin Rudalics <rudalics@gmx.at>
16079
16080 * window.h (window): Rename slot "nest" to "combination_limit".
16081 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16082 (Fset_window_nest): Rename to Fset_window_combination_limit.
16083 (Vwindow_nest): Rename to Vwindow_combination_limit.
16084 (recombine_windows, make_parent_window, make_window)
16085 (Fsplit_window_internal, saved_window)
16086 (Fset_window_configuration, save_window_save): Rename all
16087 occurrences of window_nest to window_combination_limit.
16088
16089 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
16090
16091 * image.c (imagemagick_load_image): Fix typo.
16092
16093 2011-11-14 Eli Zaretskii <eliz@gnu.org>
16094
16095 * xdisp.c (display_line): Move the call to
16096 highlight_trailing_whitespace before the call to
16097 compute_line_metrics, since the latter needs to see the final
16098 faces of all the glyphs to compute ROW's hash value.
16099 Fixes assertion violations in row_equal_p. (Bug#10035)
16100
16101 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
16102
16103 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16104 just return (bug#10044).
16105
16106 2011-11-12 Eli Zaretskii <eliz@gnu.org>
16107
16108 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16109 with user-defined heap size. Bump the default size of the temacs
16110 heap to 27MB, to avoid memory warning when running temacs.
16111 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16112
16113 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16114 current_matrix and desired_matrix. (Bug#9990)
16115 (verify_row_hash) [XASSERTS]: New function.
16116 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16117 that the hash value of glyph rows is correct.
16118
16119 2011-11-12 Martin Rudalics <rudalics@gmx.at>
16120
16121 * window.h (window): Remove splits slot.
16122 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16123 (Fdelete_other_windows_internal, make_parent_window)
16124 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16125 (Fset_window_configuration, save_window_save): Don't deal with
16126 split status of windows.
16127 (saved_window): Remove splits slot.
16128 (Vwindow_splits): Rewrite doc-string.
16129
16130 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16131
16132 * xfns.c (unwind_create_frame):
16133 * nsfns.m (unwind_create_frame):
16134 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16135 Vframe_list (Bug#9999).
16136
16137 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16138
16139 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16140
16141 2011-11-11 Kenichi Handa <handa@m17n.org>
16142
16143 * callproc.c (Fcall_process): Set the member dst_multibyte of
16144 process_coding.
16145
16146 2011-11-11 Johan Bockgård <bojohan@gnu.org>
16147
16148 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16149 avoid a crash (bug#9496).
16150
16151 2011-11-09 Chong Yidong <cyd@gnu.org>
16152
16153 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16154 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16155
16156 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16157
16158 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16159
16160 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16161
16162 Avoid some portability problems by eschewing 'extern inline' functions.
16163 The trivial performance wins aren't worth the portability hassles; see
16164 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16165 et seq.
16166 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16167 (window_box_width, window_box_left, window_box_left_offset)
16168 (window_box_right, window_box_right_offset): Undo previous change,
16169 by removing the "extern"s.
16170 * intervals.c (adjust_intervals_for_insertion)
16171 (adjust_intervals_for_deletion): Undo previous change,
16172 making these static again.
16173 (offset_intervals, temp_set_point_both, temp_set_point)
16174 (copy_intervals_to_string): No longer inline.
16175 * xdisp.c (window_text_bottom_y, window_box_width)
16176 (window_box_height, window_box_left_offset)
16177 (window_box_right_offset, window_box_left, window_box_right)
16178 (window_box): No longer inline.
16179
16180 2011-11-08 Chong Yidong <cyd@gnu.org>
16181
16182 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16183 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16184 Signal an error if not a live window.
16185 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16186 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16187
16188 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16189
16190 * lisp.h (syms_of_abbrev): Remove declaration.
16191 Reported by CHENG Gao <chenggao@royau.me>.
16192
16193 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16194
16195 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16196 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16197 of temacs in GUI mode.
16198
16199 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16200
16201 * window.h: Declare delete_all_child_windows instead of
16202 delete_all_subwindows.
16203 * window.c (Fwindow_nest, Fset_window_nest)
16204 (Fset_window_new_total, Fset_window_new_normal)
16205 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16206 (delete_all_subwindows): Rename to delete_all_child_windows.
16207 (Fdelete_other_windows_internal, Fset_window_configuration):
16208 Call delete_all_child_windows instead of delete_all_subwindows.
16209 * frame.c (delete_frame): Call delete_all_child_windows instead
16210 of delete_all_subwindows.
16211
16212 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16213
16214 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16215 This is also needed for porting to any host where GC_MARK_STACK is
16216 not GC_MAKE_GCPROS_NOOPS.
16217 (which_symbols): Use it.
16218
16219 2011-11-07 Kenichi Handa <handa@m17n.org>
16220
16221 * coding.c (coding_set_destination): Check coding->src_pos only
16222 when coding->src_object is a buffer (bug#9910).
16223
16224 * process.c (send_process): Set the member src_multibyte of coding
16225 to 0 (bug#9911) when sending a unibyte text.
16226
16227 * callproc.c (Fcall_process): Set the member src_multibyte of
16228 process_coding to 0 (bug#9912).
16229
16230 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16231
16232 * xmenu.c (cleanup_widget_value_tree): New function.
16233 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16234 calling free_menubar_widget_value_tree directly (Bug#9830).
16235
16236 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16237
16238 Fix some portability problems with 'inline'.
16239 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16240 (window_box_width, window_box_left, window_box_left_offset)
16241 (window_box_right, window_box_right_offset): Declare extern.
16242 Otherwise, these inline functions do not conform to C99 and
16243 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16244 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16245 * intervals.c (adjust_intervals_for_insertion)
16246 (adjust_intervals_for_deletion): Now extern, because otherwise the
16247 extern inline functions 'offset_intervals' couldn't refer to it.
16248 (static_offset_intervals): Remove.
16249 (offset_intervals): Rewrite using the old contents of
16250 static_offset_intervals. The old version didn't conform to C99
16251 because an extern inline function contained a reference to an
16252 identifier with static linkage.
16253
16254 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16255
16256 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16257 GC.
16258
16259 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16260
16261 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16262 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16263 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16264 return Qleft_to_right.
16265
16266 2011-11-06 Chong Yidong <cyd@gnu.org>
16267
16268 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16269 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16270 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16271 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16272 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16273 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16274 (Fwindow_vscroll): Doc fix.
16275 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16276 argument, since it makes no sense to pass a live window and for
16277 consistency with window-child.
16278
16279 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16280
16281 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16282 support MSVC.
16283
16284 2011-11-05 Jason Rumney <jasonr@gnu.org>
16285
16286 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16287 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16288 fonts (Bug#6029).
16289 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16290 bitwise arithmetic preventing use of unicode-sip and non-truetype
16291 opentype fonts.
16292
16293 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16294
16295 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16296 "emacs"-only part.
16297
16298 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16299 initialization code to keep similarity to xfns.c after changes
16300 from 2011-11-05.
16301
16302 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16303
16304 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16305 (unwind_create_frame): New function (Bug#9943).
16306 (Fx_create_frame): Restructure code to be more similar to the one in
16307 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16308 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16309 Move terminal->reference_count++ just before making the frame official
16310 (Bug#9943).
16311
16312 * nsterm.m (x_free_frame_resources): New function.
16313 (x_destroy_window): Move code to x_free_frame_resources.
16314
16315 * xfns.c (unwind_create_frame): Fix comment.
16316 (Fx_create_frame, x_create_tip_frame):
16317 Move terminal->reference_count++ just before making the frame
16318 official. Move initialization of image_cache_refcount and
16319 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16320
16321 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16322
16323 Support MSVC build with newer versions of Visual Studio.
16324 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16325 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16326 nt/gmake.defs.
16327
16328 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16329 which are not supported by MSVC.
16330 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16331 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16332 bitfields.
16333 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16334 types in bitfields.
16335 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16336
16337 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16338
16339 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16340
16341 Support MSVC build with newer versions of Visual Studio.
16342 * w32.c: Don't include w32api.h for MSVC.
16343 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16344
16345 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16346 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16347 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16348 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16349 e_* cousins.
16350 (alloca) [_MSC_VER]: Define to _alloca.
16351
16352 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16353
16354 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16355
16356 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16357
16358 * xdisp.c (note_mouse_highlight): If either of
16359 previous/next-single-property-change returns nil, treat that as
16360 the beginning or the end of the buffer. (Bug#9955)
16361
16362 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16363
16364 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16365 label is not null (Bug#9951).
16366 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16367 may be NULL.
16368
16369 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16370
16371 * window.c (Fwindow_body_size): Mention in the doc string that the
16372 return value is in frame's canonical units. (Bug#9949)
16373
16374 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16375
16376 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16377
16378 * w32fns.c (unwind_create_frame): If needed, free the glyph
16379 matrices of the partially constructed frame. (Bug#9943)
16380 * xfns.c (unwind_create_frame): Likewise.
16381
16382 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16383
16384 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16385 Don't stop backward scan on the continuation glyph, even though
16386 its CHARPOS is positive.
16387 (mouse_face_from_buffer_pos, note_mouse_highlight):
16388 Rename cover_string to disp_string.
16389
16390 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16391
16392 * window.c (temp_output_buffer_show): Don't use
16393 Vtemp_buffer_show_specifiers.
16394 (Vtemp_buffer_show_specifiers): Remove unused variable.
16395
16396 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16397
16398 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16399 past the beginning of the current glyph matrix.
16400
16401 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16402
16403 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16404 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16405 HAVE_GTK3 (Bug#9869).
16406
16407 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16408 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16409
16410 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16411
16412 * xterm.c: Declare x_handle_net_wm_state to return int.
16413 (handle_one_xevent): Check if we are iconified but don't have
16414 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16415 (get_current_wm_state): Return non-zero if not hidden,
16416 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16417 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16418 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16419 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16420
16421 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16422
16423 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16424 so that this new function doesn't get optimized away by a
16425 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16426
16427 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16428
16429 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16430
16431 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16432
16433 Fix the `xbytecode' command.
16434 * .gdbinit (xprintbytestr): New command.
16435 (xwhichsymbols): Rename from `which'; all callers changed.
16436 (xbytecode): Print the byte-code string as well.
16437
16438 2011-10-29 Kim Storm <storm@cua.dk>
16439
16440 * alloc.c (which_symbols): New function.
16441
16442 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16443
16444 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16445 line. (Bug#9903)
16446
16447 2011-10-29 Glenn Morris <rgm@gnu.org>
16448
16449 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16450 Not clear what it was for, and it causes various bugs. (Bug#9839)
16451
16452 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16453
16454 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16455 possible random value that matches one of those tested as
16456 condition to clear the mouse face.
16457
16458 2011-10-28 Chong Yidong <cyd@gnu.org>
16459
16460 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16461
16462 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16463
16464 * window.c (make_window): Initialize phys_cursor_on_p.
16465
16466 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16467
16468 * lisp.h (struct Lisp_Symbol): Update comments.
16469
16470 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16471
16472 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16473
16474 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16475
16476 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16477 <oslsachem@gmail.com> for helping to debug this.
16478
16479 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16480 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16481 (g_b_init_get_glyph_outline_w): New static variables.
16482 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16483 (GetGlyphOutlineW_Proc): New typedefs.
16484 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16485 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16486 New functions.
16487 (w32font_open_internal, compute_metrics):
16488 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16489 instead of calling the "wide" APIs directly.
16490
16491 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16492
16493 * w32.h (syms_of_w32font): Add prototype.
16494
16495 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16496
16497 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16498 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16499 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16500 (Fmove_to_window_line): Doc fix.
16501
16502 2011-10-27 Chong Yidong <cyd@gnu.org>
16503
16504 * process.c (make_process): Set gnutls_state to NULL.
16505
16506 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16507 non-NULL, regardless of GNUTLS_INITSTAGE.
16508 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16509 an error. Set process slots as soon as we allocate them.
16510
16511 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16512
16513 2011-10-27 Chong Yidong <cyd@gnu.org>
16514
16515 * gnutls.c (emacs_gnutls_deinit): New function.
16516 Deallocate credentials structures as well as calling gnutls_deinit.
16517 (Fgnutls_deinit, Fgnutls_boot): Use it.
16518
16519 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16520 (deactivate_process): Call emacs_gnutls_deinit.
16521
16522 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16523
16524 * image.c (x_create_x_image_and_pixmap):
16525 * w32.c (sys_rename, w32_delayed_load):
16526 * w32font.c (fill_in_logfont):
16527 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16528
16529 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16530
16531 * w32fns.c (w32_default_color_map): New function,
16532 extracted from Fw32_default_color_map.
16533 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16534
16535 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16536
16537 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16538
16539 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16540
16541 * keyboard.c (test_undefined): New function (bug#9751).
16542 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16543
16544 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16545
16546 * sysdep.c (init_sys_modes): Fix the check for the controlling
16547 terminal (Bug#6649).
16548
16549 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16550
16551 * dispextern.h (struct bidi_it): New member next_en_type.
16552
16553 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16554 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16555 current character, check also for next_en_type being WEAK_EN.
16556 (bidi_resolve_weak): Don't enter the expensive loop if the current
16557 position is before next_en_pos. Record the bidi type of the first
16558 non-ET, non-BN character we find, in addition to its position.
16559 (bidi_level_of_next_char): Invalidate next_en_type when
16560 next_en_pos is over-stepped.
16561
16562 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16563
16564 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16565 * editfns.c: Rewrite current-time-zone so that it invokes
16566 the equivalent of (format-time-string "%Z") to get the time zone name.
16567 This fixes a bug when the time zone name contains characters that
16568 need converting from the system time locale to Emacs internal format.
16569 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16570 that patch fixed format-time-string to do the conversion, but
16571 I forgot to fix current-time-zone.
16572 (format_time_string): New function, containing most of
16573 what Fformat_time_string used to contain.
16574 (Fformat_time_string): Rewrite in terms of format_time_string.
16575 This doesn't change this function's behavior.
16576 (current-time-zone): Rewrite to use format_time_string.
16577 This fixes the bug reported by Michael Schierl in
16578 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16579 Jason Rumney's 2007-06-07 change worked around this bug, but
16580 didn't fix it.
16581 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16582
16583 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16584
16585 * xdisp.c (start_display): If the character at POS is displayed
16586 via a display vector, reset IT->current.dpvec_index to zero.
16587 (try_window_reusing_current_matrix): If a line ends in a display
16588 vector or the next line starts in a display vector, continue
16589 redrawing the window even though the character position of
16590 start_row was reached.
16591 (Bug#9771, part 2)
16592
16593 2011-10-18 Chong Yidong <cyd@gnu.org>
16594
16595 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16596 with nobreak-char-display too.
16597
16598 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16599
16600 Fix part 3 of bug#9771.
16601 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16602 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16603 non-neutral characters if the current character is a paragraph
16604 separator (a.k.a. Newline). This avoids running the same
16605 expensive loop twice, once when we consume the preceding newline
16606 and the other time when the line actually needs to be displayed.
16607 Avoid the loop when we see neutrals on the base embedding level
16608 following a character whose directionality is the same as the
16609 paragraph's. This avoids running the expensive loop when a line
16610 ends in a long sequence of neutrals, like control characters.
16611 Add assertion against STRONG_AL type. Slightly rearrange code
16612 that determines the type of a neutral given the first non-neutral
16613 that follows it.
16614 (bidi_level_of_next_char): Set next_en_pos to zero when
16615 invalidating its info.
16616
16617 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16618
16619 * xdisp.c (push_display_prop): Determine whether to record string
16620 or buffer position by IT->string, not by IT->method. Allow
16621 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16622 (move_it_vertically_backward): Don't look for character position
16623 immediately after the newline when in a continuation line.
16624 (Bug#9771, part 1)
16625
16626 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16627
16628 * window.c (coordinates_in_window): Rewrite and delabelize
16629 vertical border check. (Bug#5357) (Bug#9618)
16630
16631 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16632
16633 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16634 errors in XSetWindowBorder (bug#9310).
16635
16636 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16637
16638 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16639 avoid crash when xmalloc overrun checking is enabled.
16640
16641 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16642
16643 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16644 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16645 cursor motion with <left> and <right> arrow keys.
16646
16647 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16648 some callers set that themselves.
16649
16650 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16651
16652 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16653 display string and the previous row comes from the same string and
16654 is empty. (Bug#9739) (Bug#9738)
16655
16656 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16657
16658 * doc.c (get_doc_string): Encode file name (bug#9735).
16659
16660 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16661
16662 * bidi.c (bidi_level_of_next_char):
16663 * xdisp.c (get_visually_first_element): Remove old incorrect
16664 comments regarding the Unicode Line Separator character.
16665
16666 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16667
16668 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16669
16670 * alloc.c (Fgc_status): Do not access beyond zombies array
16671 boundary if nzombies > MAX_ZOMBIES.
16672 * alloc.c (dump_zombies): Add missing format specifier.
16673
16674 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16675
16676 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16677 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16678
16679 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16680 Some packages use them to denote characters with modifiers.
16681
16682 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16683
16684 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16685 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16686 matching a pp-number. Rename parameter var to var1.
16687
16688 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16689
16690 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16691
16692 2011-10-08 Glenn Morris <rgm@gnu.org>
16693
16694 * callint.c (Fcall_interactively): Give a more explicit error for the
16695 'c' case with a non-character input. (Bug#8479)
16696
16697 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16698
16699 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16700 lines.
16701 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16702 lines that are hscrolled on the left.
16703
16704 * dispnew.c (buffer_posn_from_coords): Account for a possible
16705 presence of header-line. (Bug#4426)
16706
16707 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16708
16709 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16710 Don't advertise functionality which we discourage or doesn't work.
16711
16712 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16713
16714 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16715 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16716 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16717 this makes Emacs dump core during garbage collection on rare
16718 occasions. sizeof is obviously inferior to offsetof here, so
16719 stick with offsetof.
16720 (GC_POINTER_ALIGNMENT): New macro.
16721 (mark_memory): Omit 3rd (offset) arg; caller changed.
16722 Don't assume EMACS_INT alignment is the same as pointer alignment.
16723
16724 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16725
16726 * keyboard.c (read_key_sequence_remapped): New var.
16727 (read_key_sequence): Compute remapping in the right buffer.
16728 (command_loop_1): Use read_key_sequence's remapping directly.
16729
16730 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16731
16732 * dired.c (file_name_completion): Don't expand file name.
16733 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16734 before checking file name handler.
16735
16736 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16737 they've been requested explicitly (bug#9591).
16738
16739 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16740
16741 * keymap.c (Fsingle_key_description): Use make_specified_string
16742 instead of build_string to build string from push_key_description.
16743 (Bug#5193)
16744
16745 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16746
16747 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16748 This fixes a Y2038 bug on 64-bit hosts.
16749 * buffer.c (reset_buffer):
16750 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16751 (Fclear_buffer_auto_save_failure):
16752 Use 0, not -1, to represent an unset failure time, since time_t
16753 might not be signed.
16754
16755 Remove dependency on glibc malloc internals.
16756 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16757 Move back here from lisp.h, but with their new implementations.
16758 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16759 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16760 * charset.c (charset_table_init): New static var.
16761 (syms_of_charset): Use it instead of xmalloc. This removes a
16762 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16763 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16764 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16765 Move back to alloc.c.
16766 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16767 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16768
16769 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16770
16771 * nsterm.m (windowDidResize): Call x_set_window_size only when
16772 ns_in_resize is true. Otherwise set pixelwidth/height and
16773 call change_frame_size (Bug#9628).
16774
16775 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16776
16777 Port --enable-checking=all to Fedora 14 x86-64.
16778 * charset.c (syms_of_charset): Also account for glibc malloc's
16779 internal overhead when calculating the initial malloc maximum.
16780
16781 Port --enable-checking=all to Fedora 14 x86.
16782 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16783 Move to lisp.h.
16784 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16785 (overrun_check_realloc, overrun_check_free):
16786 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16787 That way, xmalloc returns a properly-aligned pointer even if
16788 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16789 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16790 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16791 into account when calculating the initial malloc maximum.
16792 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16793 Move here from alloc.c, so that charset.c can use it too.
16794 Properly align; the old code wasn't right for common 32-bit hosts
16795 when configured with --enable-checking=all.
16796 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16797 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16798
16799 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16800
16801 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16802 use EDOM.
16803
16804 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16805
16806 * xdisp.c (compute_display_string_end): If there's no display
16807 string at CHARPOS, return -1.
16808
16809 * bidi.c (bidi_fetch_char): When compute_display_string_end
16810 returns a negative value, treat the character as a normal
16811 character not covered by a display string. (Bug#9624)
16812
16813 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16814
16815 * lread.c (Fread_from_string): Fix typo in docstring.
16816
16817 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16818
16819 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16820 newline, reseat the iterator instead of bidi-iterating there one
16821 character at a time. (Bug#9610)
16822 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16823 TO_CHARPOS if the bidi iterator is at base embedding level.
16824
16825 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16826
16827 * lread.c (readevalloop): Use correct code for NBSP.
16828 (read1): Likewise. (Bug#9608)
16829
16830 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16831
16832 * dbusbind.c (Fdbus_register_signal): When service is not
16833 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16834
16835 2011-09-25 Glenn Morris <rgm@gnu.org>
16836
16837 * buffer.c (truncate-lines): Doc fix.
16838
16839 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16840
16841 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16842 (Fset_window_next_buffers): Doc fix.
16843
16844 2011-09-24 Glenn Morris <rgm@gnu.org>
16845
16846 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16847
16848 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16849
16850 Fix minor problems found by static checking.
16851 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16852 * indent.c (Fvertical_motion): Fix == vs = typo.
16853
16854 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16855
16856 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16857 Default value is now t. Doc fix.
16858
16859 * indent.c (Fvertical_motion): Compute and apply the overshoot
16860 logic when moving up, not only when moving down. Fix the
16861 confusing name and values of the it_overshoot_expected variable;
16862 logic changes accordingly. (Bug#9254) (Bug#9549)
16863
16864 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16865 CHARPOS is covered by a display string which includes newlines.
16866 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16867 is covered by a display string with embedded newlines.
16868
16869 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16870
16871 * dbusbind.c (Fdbus_register_signal): Add match rule to
16872 Vdbus_registered_objects_table. (Bug#9581)
16873 (Fdbus_register_method, Vdbus_registered_objects_table):
16874 Fix docstring.
16875
16876 2011-09-24 Jim Meyering <meyering@redhat.com>
16877
16878 do not ignore write error for any output size
16879 The previous change was incomplete.
16880 While it makes emacs --batch detect the vast majority of stdout
16881 write failures, errors were still ignored whenever the output size is
16882 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16883 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16884 && echo FAIL: ignored write error
16885 FAIL: ignored write error
16886 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16887 && echo FAIL: ignored write error
16888 FAIL: ignored write error
16889 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16890
16891 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16892
16893 * emacs.c (Fkill_emacs): In noninteractive mode exit
16894 non-successfully if a write error occurred on stdout. (Bug#9574)
16895
16896 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16897
16898 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16899 the xassert test.
16900
16901 * dispextern.h (struct it): Update the comment documenting what
16902 can it->OBJECT be.
16903
16904 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16905
16906 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16907 a display string, extend search for cursor position to end of row.
16908 (find_row_edges): If the row ends in a newline from a display
16909 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16910 Handle the case of a display string with multiple newlines.
16911 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16912 non-empty line. Fixes confusing cursor motion with arrow keys at
16913 the beginning of a line that starts with whitespace.
16914
16915 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16916
16917 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16918 (bug#9493).
16919
16920 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16921
16922 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16923 boolean (Bug#9154).
16924
16925 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16926
16927 * xdisp.c (display_line): Record maximum and minimum buffer
16928 positions even if no glyphs were produced (e.g., by a zero-width
16929 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16930 buffer positions that will be removed from the glyph row because
16931 they don't fit.
16932 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16933 column is beyond frame width: don't subtract 1 "pixel" when
16934 computing width of the stretch.
16935 (reseat_at_next_visible_line_start): Undo the change made on
16936 2011-09-17 that saved paragraph information and restored it after
16937 the call to `reseat'. (Bug#9545)
16938
16939 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16940
16941 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16942 and turn window cursor on if cleared (Bug#9415).
16943
16944 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16945
16946 * search.c (boyer_moore): Take unibyte characters from pattern
16947 literally. (Bug#9458)
16948
16949 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16950
16951 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16952
16953 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16954
16955 Fix minor problem found by static checking.
16956 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16957 initialized, to pacify gcc -Wuninitialized.
16958
16959 * fileio.c: Report proper errno when syscall falls.
16960 (Finsert_file_contents): Save and restore errno,
16961 so that report_file_error outputs the correct diagnostic.
16962 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16963
16964 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16965
16966 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16967
16968 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16969
16970 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16971 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16972
16973 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16974
16975 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16976 about the current paragraph and restore it after the call to reseat.
16977
16978 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16979 (bidi_find_paragraph_start): Search back for paragraph beginning
16980 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16981 (bidi_move_to_visually_next): Only trigger paragraph-related
16982 computations when the last character is a newline or at EOB, not
16983 just any NEUTRAL_B. (Bug#9470)
16984
16985 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16986 truncated lines if point is covered by a display string. (Bug#9524)
16987
16988 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16989
16990 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16991 (cons_to_x_long): New function.
16992 (lisp_data_to_selection_data): Use it. Correct the test for
16993 short-versus-long data; it was negated. Break out of vector
16994 loop, for efficiency, when a long datum is discovered.
16995
16996 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16997
16998 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16999
17000 2011-09-16 Eli Zaretskii <eliz@gnu.org>
17001
17002 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
17003 GCC PR/17406) by declaring this function with external scope.
17004
17005 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17006
17007 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
17008 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17009
17010 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17011
17012 * editfns.c (Fformat): Correctly handle text properties on "%%".
17013
17014 2011-09-15 Eli Zaretskii <eliz@gnu.org>
17015
17016 * xterm.c (x_draw_composite_glyph_string_foreground):
17017 * w32term.c (x_draw_composite_glyph_string_foreground):
17018 * term.c (encode_terminal_code):
17019 * composite.c (composition_update_it, get_composition_id):
17020 * xdisp.c (get_next_display_element)
17021 (fill_composite_glyph_string): Add comments about special meaning
17022 of TAB characters in a composition.
17023
17024 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17025
17026 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17027 This occurs when processing a multibyte format.
17028 Problem reported by Wolfgang Jenker.
17029
17030 2011-09-15 Johan Bockgård <bojohan@gnu.org>
17031
17032 * xdisp.c (try_cursor_movement): Only check for exact match if
17033 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17034
17035 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17036
17037 Remove unused external symbols.
17038 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17039 * xdisp.c (calc_pixel_width_or_height): Now static.
17040 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17041 * indent.c (check_display_width):
17042 * w32term.c: Fix comment to match code.
17043 * xterm.c, xterm.h (x_catching_errors): Remove.
17044
17045 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17046
17047 * xselect.c: Use signed conversions more consistently (Bug#9498).
17048 (selection_data_to_lisp_data): Assume incoming selection data are
17049 signed integers, not unsigned. This is to be consistent with
17050 outgoing selection data, which was modified to use signed integers
17051 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17052 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17053 expects long, not unsigned long.
17054
17055 2011-09-14 Eli Zaretskii <eliz@gnu.org>
17056
17057 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17058 computation of loop end. Reported by Johan Bockgård
17059 <bojohan@gnu.org>.
17060
17061 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
17062
17063 * frame.c (Fother_visible_frames_p): Function deleted.
17064
17065 2011-09-12 Eli Zaretskii <eliz@gnu.org>
17066
17067 * indent.c (compute_motion): Process display vector front to back
17068 rather than the other way around. (Bug#2496)
17069
17070 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17071
17072 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17073
17074 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
17075
17076 * minibuf.c (Fread_from_minibuffer): Doc fix.
17077
17078 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17079
17080 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17081 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17082
17083 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17084
17085 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17086 value for non-existent files.
17087
17088 2011-09-11 Eli Zaretskii <eliz@gnu.org>
17089
17090 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17091 set its "size" to -1. This will set the modtime_size field of
17092 the corresponding buffer to -1, which is what
17093 verify-visited-file-modtime expects for files that do not exist.
17094 (Bug#9139)
17095
17096 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17097
17098 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17099 here ...
17100 * lisp.h: ... from here. push_key_description is no longer
17101 defined in keyboard.c, so its declaration should not be in
17102 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17103 logically belongs with push_key_description.
17104
17105 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17106
17107 * buffer.h: Include <sys/types.h> instead of <time.h>.
17108 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17109 Problem reported by Herbert J. Skuhra.
17110
17111 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17112
17113 * xml.c (parse_region): Make the parsing work for
17114 non-comment-starting XML files again (bug#9144).
17115
17116 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17117
17118 * image.c (gif_load): Fix calculation of bottom and right corner.
17119 (Bug#9468)
17120
17121 2011-09-10 Eli Zaretskii <eliz@gnu.org>
17122
17123 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17124 redisplay in small windows.
17125
17126 2011-09-09 Eli Zaretskii <eliz@gnu.org>
17127
17128 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17129
17130 2011-09-08 Martin Rudalics <rudalics@gmx.at>
17131
17132 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17133 Operate on live windows only.
17134
17135 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
17136
17137 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17138
17139 2011-09-07 Eli Zaretskii <eliz@gnu.org>
17140
17141 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17142 only under bidi iteration.
17143
17144 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17145
17146 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17147
17148 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17149
17150 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17151 Without this fix, the command to link temacs failed due to an
17152 undefined symbol __builtin_isnan. This is because
17153 /usr/include/iso/math_c99.h #defines isnan(x) to
17154 __builtin_isnan(x), but the bundled gcc, which identifies itself
17155 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17156 a __builtin_isnan.
17157 * floatfns.c (isnan): #undef, and then #define to a clone of
17158 what's in data.c.
17159 (Fisnan): Always define, since it's always available now.
17160 (syms_of_floatfns): Always define isnan at the Lisp level.
17161
17162 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17163
17164 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17165
17166 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17167
17168 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17169 The previous code assumed that file offsets (off_t values) fit in
17170 EMACS_INT variables, which is not true on typical 32-bit hosts.
17171 The code messed up by falsely reporting buffer overflow in cases
17172 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17173 when "big" contains more than 2**29 bytes, even though this
17174 inserts just one byte and does not overflow the buffer.
17175 (Finsert_file_contents): Store file offsets as off_t
17176 values, not as EMACS_INT values. Check for overflow when
17177 converting between EMACS_INT and off_t. When checking for
17178 buffer overflow or for overlap, take the offsets into account.
17179 Don't use EMACS_INT for small values where int suffices.
17180 When checking for overlap, fix a typo: ZV was used where
17181 ZV_BYTE was intended.
17182 (Fwrite_region): Don't assume off_t fits into 'long'.
17183 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17184
17185 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17186
17187 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17188
17189 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17190
17191 sprintf-related integer and memory overflow issues (Bug#9412).
17192
17193 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17194 (esprintf, exprintf, evxprintf): New functions.
17195 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17196 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17197 (modify_event_symbol): Do not assume that the length of
17198 name_alist_or_stem is safe to alloca and fits in int.
17199 (Fexecute_extended_command): Likewise for function name and binding.
17200 (Frecursion_depth): Wrap around reliably on integer overflow.
17201 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17202 since some callers pass EMACS_INT values.
17203 (Fsingle_key_description): Don't crash if symbol name contains more
17204 than MAX_ALLOCA bytes.
17205 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17206 (get_minibuffer): Arg is now EMACS_INT, not int.
17207 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17208 (esprintf, exprintf, evxprintf): New decls.
17209 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17210
17211 * dbusbind.c (signature_cat): New function.
17212 (xd_signature, Fdbus_register_signal):
17213 Do not overrun buffer; instead, report string overflow.
17214
17215 * dispnew.c (add_window_display_history): Don't overrun buffer.
17216 Truncate instead; this is OK since it's just a log.
17217
17218 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17219 even if the time zone offset is outlandishly large.
17220 Don't mishandle offset == INT_MIN.
17221
17222 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17223 when creating daemon; the previous buffer-overflow check was incorrect.
17224
17225 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17226 which has the guts of the old verror function.
17227
17228 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17229 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17230
17231 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17232 (font_unparse_xlfd): Don't blindly alloca long strings.
17233 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17234 fits in int, when using sprintf. Use single snprintf to count
17235 length of string rather than counting it via multiple sprintfs;
17236 that's simpler and more reliable.
17237 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17238 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17239 sprintf, in case result does not fit in int.
17240
17241 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17242 (fontset_from_font): Print it.
17243
17244 * frame.c (tty_frame_count): Now printmax_t, not int.
17245 (make_terminal_frame, set_term_frame_name): Print it.
17246 (x_report_frame_params): In X, window IDs are unsigned long,
17247 not signed long, so print them as unsigned.
17248 (validate_x_resource_name): Check for implausibly long names,
17249 and don't assume name length fits in 'int'.
17250 (x_get_resource_string): Don't blindly alloca invocation name;
17251 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17252 not fit in int.
17253
17254 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17255 (xg_check_special_colors, xg_set_geometry):
17256 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17257
17258 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17259 Use esprintf, not sprintf, in case result does not fit in int.
17260
17261 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17262 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17263 it as a large positive number.
17264 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17265 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17266
17267 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17268 in case result does not fit in int.
17269
17270 * print.c (float_to_string): Detect width overflow more reliably.
17271 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17272 buffer overrun. Don't assume list length fits in 'int'. Treat
17273 print length of 0 as 0, not as infinity; to be consistent with other
17274 uses of print length in this function. Don't overflow print length
17275 index. Don't assume hash table size fits in 'long', or that
17276 vectorlike size fits in 'unsigned long'.
17277
17278 * process.c (make_process): Use printmax_t, not int, to format
17279 process-name gensyms.
17280
17281 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17282
17283 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17284 to avoid potential buffer overrun.
17285
17286 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17287 if X resource line is longer than 512 bytes.
17288
17289 * xfns.c (x_window): Make sprintf buffer a bit bigger
17290 to avoid potential buffer overrun.
17291
17292 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17293
17294 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17295
17296 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17297
17298 Integer overflow fixes for scrolling, etc.
17299 Without these, Emacs silently mishandles large integers sometimes.
17300 For example, "C-u 4294967297 M-x recenter" was treated as if
17301 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17302
17303 * xdisp.c (try_window_id): Check Emacs fixnum range before
17304 converting to 'int'.
17305
17306 * window.c (window_scroll_line_based, Frecenter):
17307 Check that an Emacs fixnum is in range before assigning it to 'int'.
17308 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17309 values converted from Emacs fixnums.
17310 (Frecenter): Don't wrap around a line count if it is out of 'int'
17311 range; instead, treat it as an extreme value.
17312 (Fset_window_configuration, compare_window_configurations):
17313 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17314
17315 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17316 that can exceed INT_MAX. Check that EMACS_INT value is in range
17317 before assigning it to the (possibly-narrower) index.
17318 (match_limit): Don't assume that a fixnum can fit in 'int'.
17319
17320 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17321 exceed INT_MAX.
17322
17323 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17324 (Fvertical_motion): Don't wrap around LINES values that don't fit
17325 in 'int'. Instead, treat them as extreme values. This is good
17326 enough for windows, which can't have more than INT_MAX lines anyway.
17327
17328 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17329
17330 * Require libxml/parser.h to avoid compilation warning.
17331
17332 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17333
17334 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17335 since this reportedly can destroy thread storage.
17336
17337 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17338
17339 * syntax.c (find_defun_start): Update all cache variables if
17340 exiting early (Bug#9401).
17341
17342 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17343
17344 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17345
17346 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17347 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17348 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17349
17350 * term.c (tty_append_glyph): New function.
17351 (produce_stretch_glyph): Static function and its prototype deleted.
17352
17353 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17354 Add prototypes.
17355
17356 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17357
17358 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17359 when checking :margin (Bug#9390).
17360 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17361 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17362 so that the name doesn't mislead. All uses changed.
17363
17364 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17365
17366 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17367 set_tty_hooks.
17368
17369 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17370
17371 * xdisp.c (move_it_to): Don't bail out early when reaching
17372 position beyond to_charpos, if we are scanning backwards.
17373 (move_it_vertically_backward): When DY == 0, make sure we get to
17374 the first character in the line after the newline.
17375
17376 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17377
17378 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17379 (ccl_driver): Do not generate an out-of-range pointer.
17380 (Fccl_execute_on_string): Remove unnecessary check for
17381 integer overflow, noted by Stefan Monnier in
17382 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17383 Remove a FIXME that didn't need fixing.
17384 Simplify the newly-introduced buffer reallocation code.
17385
17386 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17387
17388 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17389
17390 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17391
17392 Integer and memory overflow issues (Bug#9196).
17393
17394 * doc.c (get_doc_string): Rework so that
17395 get_doc_string_buffer_size is the actual buffer size, rather than
17396 being 1 less than the actual buffer size; this makes xpalloc more
17397 convenient.
17398
17399 * image.c (x_allocate_bitmap_record, cache_image):
17400 * xselect.c (Fx_register_dnd_atom):
17401 Simplify previous changes by using xpalloc.
17402
17403 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17404 since either will do and ptrdiff_t is convenient with xpalloc.
17405
17406 * charset.c (charset_table_size)
17407 (struct charset_sort_data.priority): Now ptrdiff_t.
17408 (charset_compare): Don't overflow if priorities differ greatly.
17409 (Fsort_charsets): Don't assume list length fits in int.
17410 Check for size-calculation overflow when allocating sort data.
17411 (syms_of_charset): Allocate an initial charset table that is
17412 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17413
17414 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17415
17416 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17417 The actual value is always <= INT_MAX, and leaving it unsigned made
17418 overflow checking harder.
17419
17420 * dispextern.h (struct glyph_matrix.rows_allocated)
17421 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17422 with xpalloc. The values are still always <= INT_MAX.
17423
17424 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17425
17426 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17427 (SAFE_NALLOCA): New macro.
17428
17429 * region-cache.c (struct boundary.pos, find_cache_boundary)
17430 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17431 (set_cache_region, invalidate_region_cache)
17432 (revalidate_region_cache, know_region_cache, region_cache_forward)
17433 (region_cache_backward, pp_cache):
17434 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17435 so that ptrdiff_t * can be passed to xpalloc.
17436 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17437 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17438 (pp_cache): Don't assume cache_len fits in int.
17439 * region-cache.h: Adjust extern decls to match.
17440
17441 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17442 EMACS_INT, since either will do, for xpalloc.
17443
17444 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17445 (xnmalloc, xnrealloc, xpalloc): New functions.
17446
17447 * bidi.c (bidi_shelve_header_size): New constant.
17448 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17449 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17450
17451 * bidi.c (bidi_cache_shrink):
17452 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17453 (overlay_strings):
17454 Don't update size of array until after memory allocation succeeds,
17455 because xmalloc/xrealloc may not return.
17456 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17457 now that we have proper integer overflow checking.
17458 (record_overlay_string, overlay_strings): Catch overflows when
17459 calculating size of overlay_str_buf.
17460
17461 * callproc.c (Fcall_process): Check for size overflow when
17462 calculating size of args2.
17463 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17464 Normally we prefer signed values, but sticking with ptrdiff_t would
17465 require adding more-complicated checks.
17466
17467 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17468 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17469 Redo buffer-overflow calculations to avoid integer overflow.
17470 Add a FIXME comment where memory seems to be over-allocated.
17471
17472 * character.c (Fstring): Check for size-calculation overflow.
17473
17474 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17475 unnecessary integer overflow. Check for size overflow.
17476 (encode_coding_object): Don't update size until xmalloc succeeds.
17477
17478 * composite.c (get_composition_id): Check for overflow in glyph
17479 length calculations.
17480
17481 Integer and memory overflow fixes for display code.
17482 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17483 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17484 (scrolling_window): Check for overflow in size calculations.
17485 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17486 Don't assume glyph table len fits in int.
17487 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17488 (row_table_size): Now ptrdiff_t, not int.
17489 (scrolling_window): Avoid overflow in size calculations.
17490 Don't update size until allocation succeeds.
17491 * fns.c (concat): Check for overflow in size calculations.
17492 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17493 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17494 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17495
17496 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17497 (get_doc_string): Check for size calculation overflow.
17498 Don't update size until allocation succeeds.
17499 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17500 EMACS_INT, where ptrdiff_t will do.
17501 (Fsubstitute_command_keys): Check for string overflow.
17502
17503 * editfns.c (set_time_zone_rule): Don't assume environment length
17504 fits in int.
17505 (message_length): Now ptrdiff_t, not int.
17506 (Fmessage_box): Don't update size until allocation succeeds.
17507 Don't assume message length fits in int.
17508 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17509
17510 * emacs.c (main): Do not reallocate argv, since there is a null at
17511 the end that can be overwritten, and this way there's no need to
17512 worry about size-calculation overflow.
17513 (sort_args): Check for size-calculation overflow.
17514
17515 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17516 alloc succeeds.
17517 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17518
17519 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17520 (x_set_scroll_bar_width, x_figure_window_size):
17521 Check for integer overflow.
17522 (x_set_alpha): Do not assume XINT fits in int.
17523
17524 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17525 This is for the members text_lines, text_cols, total_lines, total_cols,
17526 where the system imposes an 'int' limit.
17527
17528 * fringe.c (Fdefine_fringe_bitmap):
17529 Don't update size until alloc works.
17530
17531 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17532 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17533
17534 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17535 Check for size-calculation overflow.
17536 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17537 do, as we prefer signed integers.
17538 (id_to_widget.max_size, id_to_widget.used)
17539 (xg_store_widget_in_map, xg_remove_widget_from_map)
17540 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17541 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17542 Use and return ptrdiff_t, not int.
17543 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17544 * gtkutil.h: Change prototypes to match the above.
17545
17546 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17547 are duplicate now that they've been promoted to lisp.h.
17548 (x_allocate_bitmap_record, x_alloc_image_color)
17549 (make_image_cache, cache_image, xpm_load):
17550 Don't update size until alloc is done.
17551 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17552 (x_detect_edges):
17553 Check for size calculation overflow.
17554 (ct_colors_allocated_max): New constant.
17555 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17556 overflow.
17557
17558 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17559 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17560 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17561 Use ptrdiff_t, not int, to count maps.
17562 (read_char_minibuf_menu_prompt): Check for overflow in size
17563 calculations. Don't update size until allocation succeeds.
17564 Redo calculations to avoid overflow.
17565 * keyboard.h: Change prototypes to match the above.
17566
17567 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17568 to count maps.
17569 (current_minor_maps): Check for size calculation overflow.
17570 * keymap.h: Change prototypes to match the above.
17571
17572 * lread.c (read1, init_obarray): Don't update size until alloc done.
17573
17574 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17575 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17576
17577 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17578 Now ptrdiff_t, not int.
17579 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17580 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17581
17582 * process.c (Fnetwork_interface_list): Check for overflow
17583 in size calculation.
17584
17585 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17586
17587 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17588 overflow. Don't bother calling xmalloc when xrealloc will do.
17589
17590 * search.c (Freplace_match): Check for size calculation overflow.
17591 (Fset_match_data): Don't assume list lengths fit in 'int'.
17592
17593 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17594 for command line length. Do not attempt to address one before the
17595 beginning of an array, as that's not portable.
17596
17597 * term.c (max_frame_lines): Remove; unused.
17598 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17599 not int.
17600 (encode_terminal_code, calculate_costs): Check for size
17601 calculation overflow.
17602 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17603 table lengths and related sizes. Don't update size until alloc
17604 done. Redo calculations to avoid overflow.
17605 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17606
17607 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17608 subtracting pointers.
17609 (gobble_line): Check for overflow more carefully. Don't update size
17610 until alloc done.
17611
17612 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17613 Don't update size until alloc done.
17614 Redo size calculations to avoid overflow.
17615 Check for size calculation overflow.
17616 (main) [DEBUG]: Fix typo in invoking tparam1.
17617
17618 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17619 Use ptrdiff_t, not int, for sizes.
17620 (store_mode_line_noprop_char): Don't update size until alloc done.
17621
17622 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17623 Use ptrdiff_t, not int, for sizes.
17624 (Finternal_make_lisp_face, cache_face):
17625 Check for size calculation overflow.
17626 (cache_face): Treat size calculation overflows as if they were
17627 memory exhaustion (the usual treatment), rather than aborting.
17628
17629 * xfns.c (x_encode_text, x_set_name_internal)
17630 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17631 sizes, since they can exceed INT_MAX in size. Check for size
17632 calculation overflow.
17633
17634 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17635 (xg_select): Check for size calculation overflow.
17636 Don't update size until alloc done.
17637
17638 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17639 as sprintf is limited to int lengths.
17640
17641 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17642 (X_LONG_MIN): New macros.
17643 Use them to make the following changes clearer.
17644 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17645 This change doesn't affect the value now, but it may help remind
17646 future maintainers not to raise the value too much later.
17647 (SELECTION_QUANTUM): Remove, replacing with ...
17648 (selection_quantum): ... new function, which avoids overflow.
17649 All uses changed.
17650 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17651 assumption that selection length fits in 'int'.
17652 (x_reply_selection_request, x_handle_selection_request)
17653 (x_get_window_property, receive_incremental_selection)
17654 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17655 (lisp_data_to_selection_data, clean_local_selection_data):
17656 Use ptrdiff_t, not int, to record length of selection.
17657 (x_reply_selection_request, x_get_window_property)
17658 (receive_incremental_selection, x_property_data_to_lisp):
17659 Redo calculations to avoid overflow.
17660 (x_reply_selection_request): When sending hint, ceiling it at
17661 X_LONG_MAX rather than relying on wraparound overflow to send
17662 something.
17663 (x_get_window_property, receive_incremental_selection)
17664 (lisp_data_to_selection_data, x_property_data_to_lisp):
17665 Check for size-calculation overflow.
17666 (x_get_window_property, receive_incremental_selection)
17667 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17668 Don't store size until memory allocation succeeds.
17669 (x_get_window_property): Plug memory leak on memory exhaustion.
17670 Don't double-block input; malloc is safe here. Don't assume 2**34
17671 - 4 fits in unsigned long. Add an xassert to check
17672 XGetWindowProperty overflow. Be more careful about overflow
17673 calculations, and distinguish size from memory overflow better.
17674 (receive_incremental_selection): When tracing, don't assume
17675 unsigned int is less than INT_MAX.
17676 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17677 harmful) conversions of unsigned short to int.
17678 (lisp_data_to_selection_data): Don't assume that integers
17679 in the range -65535 through -1 fit in an X unsigned short.
17680 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17681 result parameters unless successful. Rely on cons_to_unsigned
17682 to report problems with elements; the old code wasn't right anyway.
17683 (x_check_property_data): Check for int overflow; we cannot use
17684 a wider type due to X limits.
17685 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17686
17687 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17688
17689 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17690 (x_term_init): Check for size calculation overflow.
17691 (x_color_cells): Don't store size until memory allocation succeeds.
17692 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17693 Don't assume alloca size is less than MAX_ALLOCA.
17694 (x_term_init): Don't assume length fits in int (sprintf is limited
17695 to int size).
17696
17697 Use ptrdiff_t for composition IDs.
17698 * character.c (lisp_string_width):
17699 * composite.c (composition_table_size, n_compositions)
17700 (get_composition_id, composition_gstring_from_id):
17701 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17702 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17703 * window.c (Frecenter):
17704 Use ptrdiff_t, not int, for composition IDs.
17705 * composite.c (get_composition_id): Check for integer overflow.
17706 * composite.h: Adjust prototypes to match the above changes.
17707
17708 Use ptrdiff_t for hash table indexes.
17709 * category.c (hash_get_category_set):
17710 * ccl.c (ccl_driver):
17711 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17712 * coding.c (coding_system_charset_list, detect_coding_system):
17713 * coding.h (struct coding_system.id):
17714 * composite.c (get_composition_id, gstring_lookup_cache):
17715 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17716 * image.c (xpm_get_color_table_h):
17717 * lisp.h (hash_lookup, hash_put):
17718 * minibuf.c (Ftest_completion):
17719 Use ptrdiff_t for hash table indexes, not int (which is too
17720 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17721 32-bit --with-wide-int hosts).
17722
17723 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17724 Add a FIXME comment about memory leaks.
17725 (syms_of_charset): Don't assume xmalloc returns.
17726
17727 Don't assume that stated character widths fit in int.
17728 * character.c (Fchar_width, c_string_width, lisp_string_width):
17729 * character.h (CHAR_WIDTH):
17730 * indent.c (MULTIBYTE_BYTES_WIDTH):
17731 Use sanitize_char_width to avoid undefined and/or bad behavior
17732 with outlandish widths.
17733 * character.h (sanitize_tab_width): Rename from sanitize_width,
17734 now that we have two such functions. All uses changed.
17735 (sanitize_char_width): New inline function.
17736
17737 Don't assume that tab-width fits in int.
17738 * character.h (sanitize_width): New inline function.
17739 (SANE_TAB_WIDTH): New macro.
17740 (ASCII_CHAR_WIDTH): Use it.
17741 * indent.c (sane_tab_width): Remove. All uses replaced by
17742 SANE_TAB_WIDTH (current_buffer).
17743 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17744
17745 * fileio.c: Integer overflow issues with file modes.
17746 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17747
17748 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17749 Remove unreachable code.
17750 (read_hex, load_charset_map_from_file): Check for integer overflow.
17751
17752 * xterm.c: Don't go over XClientMessageEvent limit.
17753 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17754 (x_send_scroll_bar_event): Likewise. Check that the size does not
17755 exceed limits imposed by XClientMessageEvent, as well as the usual
17756 ptrdiff_t and size_t limits.
17757
17758 * keyboard.c: Overflow, signedness and related fixes.
17759 (make_lispy_movement): Use same integer type in forward decl
17760 that is used in the definition.
17761 (read_key_sequence, keyremap_step):
17762 Change bufsize argument back to int, undoing my 2011-03-30 change.
17763 We prefer signed types, and int is wide enough here.
17764 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17765 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17766 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17767 length, not size_t. Use ptrdiff_t for index, not int.
17768 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17769 possibility of integer overflow.
17770
17771 Overflow, signedness and related fixes for images.
17772
17773 * dispextern.h (struct it.stack[0].u.image.image_id)
17774 (struct_it.image_id, struct image.id, struct image_cache.size)
17775 (struct image_cache.used, struct image_cache.ref_count):
17776 * gtkutil.c (update_frame_tool_bar):
17777 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17778 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17779 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17780 * nsmenu.m (update_frame_tool_bar):
17781 * xdisp.c (calc_pixel_width_or_height):
17782 * xfns.c (image_cache_refcount):
17783 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17784 on typical 64-bit hosts.
17785
17786 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17787 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17788 Omit unnecessary casts to int.
17789 (parse_image_spec): Check that integers fall into 'int' range
17790 when the callers expect that.
17791 (image_ascent): Redo ascent calculation to avoid int overflow.
17792 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17793 (lookup_image): Remove unnecessary tests.
17794 (xbm_image_p): Locals are now of int, not EMACS_INT,
17795 since parse_image_check makes sure they fit into int.
17796 (png_load, gif_load, svg_load_image):
17797 Prefer int to unsigned where either will do.
17798 (tiff_handler): New function, combining the cores of the
17799 old tiff_error_handler and tiff_warning_handler.
17800 This function is rewritten to use vsnprintf and thereby avoid
17801 stack buffer overflows. It uses only the features of vsnprintf
17802 that are common to both POSIX and native Microsoft.
17803 (tiff_error_handler, tiff_warning_handler): Use it.
17804 (tiff_load, gif_load, imagemagick_load_image):
17805 Don't assume :index value fits in 'int'.
17806 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17807 (imagemagick_load_image): Check that crop parameters fit into
17808 the integer types that MagickCropImage accepts. Don't assume
17809 Vimagemagick_render_type has a nonnegative value. Don't assume
17810 size_t fits in 'long'.
17811 (gs_load): Use printmax_t to print the widest integers possible.
17812 Check for integer overflow when computing image height and width.
17813
17814 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17815
17816 * xdisp.c (redisplay_window): Don't force window start if point
17817 will be invisible in the resulting window. (Bug#9324)
17818
17819 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17820
17821 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17822 the display spec is of the form `(space ...)'.
17823 (handle_display_spec): Return the value returned by
17824 handle_single_display_spec, not just 1 or zero.
17825 (handle_single_display_spec): If the display spec is of the form
17826 `(space ...)', and specifies display in the text area, return 2
17827 rather than 1.
17828 (try_cursor_movement): Check for the need to scroll more
17829 accurately, and prefer exact match for point under bidi.
17830 Don't advance `row' beyond the last row of the window.
17831
17832 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17833 into disp_prop; all users changed.
17834
17835 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17836 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17837 for the text covered by the display property.
17838
17839 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17840
17841 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17842 Change return value to nil.
17843 (Frecord_buffer): Delete unused function.
17844
17845 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17846
17847 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17848 buffers, return left-to-right.
17849 (set_cursor_from_row): Consider candidate row a win if its glyph
17850 represents a newline and point is on that newline. Fixes cursor
17851 positioning on the newline at EOL of R2L text within L2R
17852 paragraph, and vice versa.
17853 (try_cursor_movement): Check continued rows, in addition to
17854 continuation rows. Fixes unwarranted scroll when point enters a
17855 continued line of R2L text within an L2R paragraph, or vice versa.
17856 (cursor_row_p): Consider the case of point being equal to
17857 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17858 from the end of a short line to the beginning of a continued line
17859 of R2L text within L2R paragraph.
17860 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17861 composed characters.
17862
17863 * bidi.c (bidi_check_type): Use xassert.
17864 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17865 members.
17866
17867 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17868
17869 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17870 a character.
17871
17872 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17873
17874 * nsfont.m (ns_otf_to_script): Fix typo.
17875
17876 2011-08-22 Kenichi Handa <handa@m17n.org>
17877
17878 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17879 extra slot even if the purpose is char-code-property-table.
17880
17881 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17882
17883 * xdisp.c (redisplay_window): When computing centering_position,
17884 account for the height of the header line. (Bug#8874)
17885
17886 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17887 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17888 candidate is selected by the mouse, and that candidate has a
17889 composed character under the mouse.
17890
17891 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17892 coordinates reported by pos-visible-in-window-p for a composed
17893 character in column zero.
17894
17895 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17896
17897 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17898
17899 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17900
17901 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17902 consider it a hit if to_charpos is anywhere in the range of the
17903 composed buffer positions.
17904
17905 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17906
17907 * image.c (gif_load): Don't assume that each subimage has the same
17908 dimensions as the base image. Handle disposal method that is
17909 "undefined" by the gif spec (Bug#9335).
17910
17911 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17912
17913 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17914 (Fcondition_case): Document `debug' symbol in error handler.
17915
17916 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17917
17918 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17919 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17920 from an Org mode buffer to a Speedbar frame.
17921
17922 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17923 a composition, take its buffer position from IT->cmp_it.charpos.
17924 Fixes cursor positioning at the beginning of a line that begins
17925 with a composed character.
17926
17927 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17928
17929 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17930 character bidirectional type, use STRONG_L instead. Fixes crashes
17931 in a buffer produced by `describe-categories'.
17932
17933 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17934 members before the level stack, so they would be saved and
17935 restored when copying iterator state. Fixes incorrect reordering
17936 around TABs covered by display properties.
17937
17938 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17939
17940 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17941
17942 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17943
17944 * eval.c (internal_condition_case, internal_condition_case_1)
17945 (internal_condition_case_2, internal_condition_case_n):
17946 Remove unnecessary aborts (Bug#9081).
17947
17948 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17949
17950 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17951 has no `load' handler, try opening the file locally. (Bug#9311)
17952
17953 2011-08-16 Ken Brown <kbrown@cornell.edu>
17954
17955 * gmalloc.c: Expand comment.
17956
17957 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17958
17959 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17960 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17961
17962 2011-08-16 Ken Brown <kbrown@cornell.edu>
17963
17964 Fix memory allocation problems in Cygwin build (Bug#9273).
17965
17966 * unexcw.c (__malloc_initialized): Declare external variable.
17967 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17968
17969 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17970 New variables.
17971 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17972 dumped emacs.
17973 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17974 in the static heap.
17975 [CYGWIN] (special_realloc): New function.
17976 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17977 requests to realloc storage in the static heap.
17978
17979 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17980
17981 * bidi.c (bidi_initialize): Remove unused local.
17982
17983 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17984
17985 * bidimirror.h:
17986 * biditype.h: Remove file.
17987 * makefile.w32-in ($(BLD)/bidi.$(O)):
17988 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17989
17990 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17991
17992 * chartab.c: Improve commentary for the uniprop_table API.
17993
17994 * bidi.c (bidi_paragraph_init): Support zero value of
17995 bidi_ignore_explicit_marks_for_paragraph_level.
17996 (bidi_initialize): Use uniprop_table instead of including
17997 biditype.h and bidimirror.h.
17998
17999 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
18000 coordinates of the iterator when restoring from ppos_it.
18001 (Bug#9296)
18002
18003 2011-08-14 Kenichi Handa <handa@m17n.org>
18004
18005 * process.c (create_process): Call setup_process_coding_systems
18006 after the pid of the process is set to -1 (Bug#8162).
18007
18008 2011-08-14 Eli Zaretskii <eliz@gnu.org>
18009
18010 * xdisp.c (move_it_in_display_line_to): Don't invoke
18011 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18012 ppos_it. Fixes vertical cursor motion when line beginning is
18013 covered by an image. (Bug#9296)
18014
18015 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18016
18017 * nsterm.h (ns_run_ascript): Declare.
18018 (NSAPP_DATA2_RUNASSCRIPT): Define.
18019
18020 * nsfns.m (as_script, as_result, as_status): New static variables.
18021 (ns_run_ascript): New function.
18022 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18023 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18024 the event loop. Get status from as_status (Bug#7276).
18025
18026 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18027 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18028 the event loop (Bug#7276).
18029
18030 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18031
18032 * gnutls.c (QCgnutls_bootprop_priority)
18033 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18034 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18035 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18036 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18037 (QCgnutls_bootprop_verify_hostname_error)
18038 (QCgnutls_bootprop_callbacks_verify): Rename from
18039 Qgnutls_bootprop_..., all uses changed.
18040
18041 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18042 uses changed.
18043
18044 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18045
18046 * xfaces.c (Qframe_set_background_mode): Now static.
18047 * dispextern.h (Qframe_set_background_mode): Remove decl.
18048
18049 * process.c (Fnetwork_interface_info): Declare local only if needed.
18050
18051 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18052
18053 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18054 (Fnetwork_interface_list): Allocate in increments of bytes instead
18055 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18056 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18057 sockaddr.
18058 (struct ifflag_def): notrailers is smart on OSX.
18059 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18060 Get hardware address with getifaddrs if available.
18061
18062 2011-08-12 Eli Zaretskii <eliz@gnu.org>
18063
18064 * xdisp.c (iterate_out_of_display_property): xassert that
18065 IT->position is set to within IT->object's boundaries. Break from
18066 the loop as soon as EOB is reached; avoids infloops in redisplay
18067 when IT->position is set up wrongly due to some bug.
18068 Set IT->current to match the bidi iterator unconditionally.
18069 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18070 entry. Force push_it to save on the stack the current
18071 buffer/string position, to be restored by pop_it. Fix flags in
18072 the iterator structure wrt the object coming from a display
18073 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18074 properties. (Bug#9284)
18075
18076 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18077
18078 * fontset.c (fontset_get_font_group): Add proper type checks.
18079 (Bug#9172)
18080
18081 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18082
18083 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18084 and LC_VERSION_MIN_MACOSX.
18085 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18086 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18087
18088 2011-08-08 Eli Zaretskii <eliz@gnu.org>
18089
18090 * xdisp.c (forward_to_next_line_start): Allow to use the
18091 no-display-properties-and-no-overlays under bidi display.
18092 Set disp_pos in the bidi iterator to avoid searches for display
18093 properties and overlays.
18094
18095 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
18096
18097 * editfns.c (Fset_time_zone_rule): Document relationship with the
18098 setenv function.
18099
18100 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18101 the font entity extracted from the cache (Bug#8109).
18102
18103 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
18104
18105 * composite.c (autocmp_chars): Don't reset point. That is done by
18106 restore_point_unwind (Bug#5984).
18107
18108 2011-08-07 Juri Linkov <juri@jurta.org>
18109
18110 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18111 to show the arg `TIME' instead of `TIMEVAL'.
18112
18113 2011-08-06 Eli Zaretskii <eliz@gnu.org>
18114
18115 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18116 display property strides EOL and includes a newline, as in
18117 longlines-mode. (Bug#9254)
18118 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18119 word-wrap under bidirectional display. (Bug#9224)
18120
18121 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18122 is non-zero, even if the data buffer is NULL. Fixes a crash in
18123 vertical-motion with longlines-mode. (Bug#9254)
18124
18125 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18126
18127 * bidi.c <bidi_cache_total_alloc>: Now static.
18128 (bidi_initialize): Initialize bidi_cache_total_alloc.
18129
18130 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18131 cache. (Bug#9221)
18132
18133 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18134 amount allocated this far in `bidi_cache_total_alloc'.
18135 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18136 non-zero, only free the data buffer without restoring the cache
18137 contents. All callers changed.
18138
18139 * dispextern.h (bidi_unshelve_cache): Update prototype.
18140
18141 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18142 (move_it_in_display_line, move_it_to)
18143 (move_it_vertically_backward, move_it_by_lines): Replace the call
18144 to xfree to an equivalent call to bidi_unshelve_cache.
18145 (move_it_in_display_line_to): Fix logic of returning
18146 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18147
18148 2011-08-05 Eli Zaretskii <eliz@gnu.org>
18149
18150 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18151 came from a string character with a `cursor' property. (Bug#9229)
18152
18153 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18154
18155 * Makefile.in (LIB_PTHREAD): New variable.
18156 (LIBES): Add LIB_PTHREAD (Bug#9216).
18157
18158 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18159 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18160
18161 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18162
18163 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18164
18165 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18166
18167 * xterm.c (x_find_topmost_parent): New function.
18168 (x_set_frame_alpha): Find topmost parent window with
18169 x_find_topmost_parent and set the property there also (bug#9181).
18170 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18171
18172 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18173
18174 * callproc.c (Fcall_process): Avoid vfork clobbering
18175 the local vars buffer, coding_systems, current_dir.
18176
18177 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18178
18179 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18180
18181 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18182
18183 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18184 so that it is not optimized away.
18185
18186 * xdisp.c (compute_display_string_pos): Remove unused local.
18187
18188 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18189
18190 Fix slow cursor motion and scrolling in large buffers with
18191 selective display, like Org Mode buffers. (Bug#9218)
18192
18193 * dispextern.h (struct bidi_it): New member disp_prop_p.
18194
18195 * xdisp.c: Remove one-slot cache of display string positions.
18196 (compute_display_string_pos): Accept an additional argument
18197 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18198 for a display string or property. If found, set DISP_PROP_P
18199 non-zero.
18200
18201 * bidi.c (bidi_fetch_char): Accept an additional argument
18202 DISP_PROP_P, and pass it to compute_display_string_pos.
18203 Only handle text covered by a display string if DISP_PROP_P is returned
18204 non-zero. All callers of bidi_fetch_char changed.
18205
18206 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18207
18208 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18209
18210 2010-12-03 Don March <don@ohspite.net>
18211
18212 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18213 last character M-[char] is translated to ESC [char] (bug#7541).
18214
18215 2011-08-02 Kenichi Handa <handa@m17n.org>
18216
18217 * lisp.h (uniprop_table): Extern it.
18218
18219 * chartab.c (uniprop_table): Make it non-static.
18220
18221 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18222
18223 * xdisp.c (forward_to_next_line_start): Accept additional argument
18224 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18225 on the newline.
18226 (reseat_at_next_visible_line_start): Use the bidi iterator state
18227 returned by forward_to_next_line_start to restore the state of
18228 it->bidi_it after backing up to previous newline. (Bug#9212)
18229
18230 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18231
18232 * regex.c (re_comp): Protoize.
18233 (re_exec): Fix return type.
18234 (regexec): Fix type of `ret'. (Bug#9203)
18235
18236 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18237
18238 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18239 This is needed if max-image-size is a floating-point number.
18240
18241 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18242
18243 * print.c (print_object): Print empty symbol as ##.
18244
18245 * lread.c (read1): Read ## as empty symbol.
18246
18247 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18248
18249 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18250 setting frame foreground color (Bug#9175).
18251 (x_set_background_color): Likewise.
18252
18253 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18254 contents (Bug#9176).
18255 (EmacsTooltip -init): Remove bezels and add shadows to
18256 tooltip windows.
18257
18258 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18259 or scroll bar (Bug#8470).
18260
18261 * nsfont.m (nsfont_open): Remove assignment to voffset and
18262 unnecessary vars hshink, expand, hd, full_height, min_height.
18263 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18264
18265 * nsterm.h (nsfont_info): Remove voffset field.
18266
18267 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18268
18269 Implement strike-through and overline on NextStep (Bug#8863).
18270
18271 * nsfont.m (nsfont_open): Use underline position provided by font,
18272 instead of hard-coded value of 2.
18273 (nsfont_draw): Call ns_draw_text_decoration instead.
18274
18275 * nsterm.h: Add declaration for ns_draw_text_decoration.
18276
18277 * nsterm.m (ns_draw_text_decoration): New function for drawing
18278 underline, overline, and strike-through.
18279 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18280 ns_draw_text_decoration. Change treatment of cursor drawing to
18281 accommodate underlining, etc.
18282
18283 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18284
18285 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18286 default.
18287
18288 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18289
18290 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18291 Without this fix, if a signal arrives just after memory fills up,
18292 'malloc' might be invoked reentrantly.
18293
18294 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18295 In other words, assume that every image size is allowed, on non-X
18296 hosts. This assumption is probably wrong, but it lets Emacs compile.
18297
18298 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18299
18300 * regex.c (re_iswctype): Convert return values to boolean.
18301
18302 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18303
18304 * xdisp.c (compute_display_string_pos): Don't use cached display
18305 string position if the buffer had its restriction changed.
18306 (Bug#9184)
18307
18308 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18309
18310 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18311
18312 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18313
18314 Integer signedness and overflow and related fixes. (Bug#9079)
18315
18316 * bidi.c: Integer size and overflow fixes.
18317 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18318 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18319 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18320 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18321 (bidi_find_other_level_edge):
18322 Use ptrdiff_t instead of EMACS_INT where either will do.
18323 This works better on 32-bit hosts configured --with-wide-int.
18324 (bidi_cache_ensure_space): Check for size-calculation overflow.
18325 Use % rather than repeated addition, for better worst-case speed.
18326 Don't set bidi_cache_size until after xrealloc returns, because it
18327 might not return.
18328 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18329 (bidi_cache_ensure_space): Also check that the bidi cache size
18330 does not exceed that of the largest Lisp string or buffer. See Eli
18331 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18332
18333 * alloc.c (__malloc_size_t): Remove.
18334 All uses replaced by size_t. See Andreas Schwab's note
18335 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18336
18337 * image.c: Improve checking for integer overflow.
18338 (check_image_size): Assume that f is nonnull, since
18339 it is always nonnull in practice. This is one less thing to
18340 worry about when checking for integer overflow later.
18341 (x_check_image_size): New function, which checks for integer
18342 overflow issues inside X.
18343 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18344 This removes the need for a memory_full check.
18345 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18346 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18347 (xbm_read_bitmap_data): Change locals back to 'int', since
18348 their values must fit in 'int'.
18349 (xpm_load_image, png_load, tiff_load):
18350 Invoke x_create_x_image_and_pixmap earlier,
18351 to avoid much needless work if the image is too large.
18352 (tiff_load): Treat overly large images as if
18353 x_create_x_image_and_pixmap failed, not as malloc failures.
18354 (gs_load): Use x_check_image_size.
18355
18356 * gtkutil.c: Omit integer casts.
18357 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18358 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18359
18360 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18361
18362 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18363 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18364 would wrongly return t on a 64-bit host.
18365
18366 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18367 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18368 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18369 and therefore cause GCC to emit a bogus diagnostic in some cases.
18370
18371 * image.c: Integer signedness and overflow and related fixes.
18372 This is not an exhaustive set of fixes, but it's time to
18373 record what I've got.
18374 (lookup_pixel_color, check_image_size): Remove redundant decls.
18375 (check_image_size): Don't assume that arbitrary EMACS_INT values
18376 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18377 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18378 (tiff_load, imagemagick_load_image):
18379 Check for overflow in size calculations.
18380 (x_create_x_image_and_pixmap): Remove unnecessary test for
18381 xmalloc returning NULL; that can't happen.
18382 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18383 (xpm_color_bucket): Use better integer hashing function.
18384 (xpm_cache_color): Don't possibly over-allocate memory.
18385 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18386 (gif_memory_source):
18387 Use ptrdiff_t, not int or size_t, to record sizes.
18388 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18389 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18390 either works, as we prefer signed integers.
18391 (tiff_read_from_memory, tiff_write_from_memory):
18392 Return tsize_t, not size_t, since that's what the TIFF API wants.
18393 (tiff_read_from_memory): Don't fail simply because the read would
18394 go past EOF; instead, return a short read.
18395 (tiff_load): Omit no-longer-needed casts.
18396 (Fimagemagick_types): Don't assume size fits into 'int'.
18397
18398 Improve hashing quality when configured --with-wide-int.
18399 * fns.c (hash_string): New function, taken from sxhash_string.
18400 Do not discard information about ASCII character case; this
18401 discarding is no longer needed.
18402 (sxhash-string): Use it. Change sig to match it. Caller changed.
18403 * lisp.h: Declare it.
18404 * lread.c (hash_string): Remove, since we now use fns.c's version.
18405 The fns.c version returns a wider integer if --with-wide-int is
18406 specified, so this should help the quality of the hashing a bit.
18407
18408 * emacs.c: Integer overflow minor fix.
18409 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18410 Define only if GNU_LINUX.
18411 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18412
18413 * dispnew.c: Integer signedness and overflow fixes.
18414 Remove unnecessary forward decls, that were a maintenance hassle.
18415 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18416 All uses changed.
18417 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18418 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18419 (prepare_desired_row, line_draw_cost):
18420 Use int, not unsigned, where either works.
18421 (save_current_matrix, restore_current_matrix):
18422 Use ptrdiff_t, not size_t, where either works.
18423 (init_display): Check for overflow more accurately, and without
18424 relying on undefined behavior.
18425
18426 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18427 Remove, replacing with the new symbols in lisp.h. All uses changed.
18428 * fileio.c (make_temp_name):
18429 * filelock.c (lock_file_1, lock_file):
18430 * xdisp.c (message_dolog):
18431 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18432 Use pMd etc. instead.
18433 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18434 replacing the pWIDE etc. symbols removed from editfns.c.
18435
18436 * keyboard.h (num_input_events): Now uintmax_t.
18437 This is (very slightly) less likely to mess up due to wraparound.
18438 All uses changed.
18439
18440 * buffer.c: Integer signedness fixes.
18441 (alloc_buffer_text, enlarge_buffer_text):
18442 Use ptrdiff_t rather than size_t when either will do, as we prefer
18443 signed integers.
18444
18445 * alloc.c: Integer signedness and overflow fixes.
18446 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18447 (__malloc_size_t): Default to size_t, not to int.
18448 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18449 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18450 Prefer ptrdiff_t to size_t when either would do, as we prefer
18451 signed integers.
18452 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18453 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18454 Now const. Initialize with values that are in range even if char
18455 is signed.
18456 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18457 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18458 These functions do the right thing with sizes > 2**32.
18459 (check_depth): Now ptrdiff_t, not int.
18460 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18461 Adjust to new way of storing sizes. Check for size overflow bugs
18462 in rest of code.
18463 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18464 slightly wrong anyway, as it missed one instance of
18465 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18466 (refill_memory_reserve): Omit needless cast to size_t.
18467 (mark_object_loop_halt): Mark as externally visible.
18468
18469 * xselect.c: Integer signedness and overflow fixes.
18470 (Fx_register_dnd_atom, x_handle_dnd_message):
18471 Use ptrdiff_t, not size_t, since we prefer signed.
18472 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18473 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18474 x_dnd_atoms_size and x_dnd_atoms_length.
18475
18476 * doprnt.c: Prefer signed to unsigned when either works.
18477 * eval.c (verror):
18478 * doprnt.c (doprnt):
18479 * lisp.h (doprnt):
18480 * xdisp.c (vmessage):
18481 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18482 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18483 prefer signed arithmetic to avoid comparison confusion.
18484 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18485 but is a bit tricky.
18486
18487 Assume freestanding C89 headers, string.h, stdlib.h.
18488 * data.c, doprnt.c, floatfns.c, print.c:
18489 Include float.h unconditionally.
18490 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18491 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18492 * regex.c: Likewise for stddef.h, string.h.
18493 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18494 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18495 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18496 (STDC_HEADERS): Remove obsolete defines.
18497 * sysdep.c: Include limits.h unconditionally.
18498
18499 Assume support for memcmp, memcpy, memmove, memset.
18500 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18501 * regex.c (memcmp, memcpy):
18502 Remove; we assume C89 now.
18503
18504 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18505 (__malloc_safe_bcopy): Remove; no longer needed.
18506
18507 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18508 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18509 well either way, and we prefer signed to unsigned.
18510
18511 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18512
18513 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18514 closes the connection while we're reading (bug#9182).
18515
18516 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18517
18518 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18519 are specified (Bug#9168).
18520
18521 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18522
18523 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18524 Found by GCC static checking and --with-wide-int on a 32-bit host.
18525
18526 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18527
18528 * xdisp.c (compute_display_string_pos): Fix logic of caching
18529 previous display string position. Initialize cached_prev_pos to
18530 -1. Fixes slow-down at the beginning of a buffer.
18531
18532 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18533
18534 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18535 for attrs[LFACE_FONTSET_INDEX].
18536
18537 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18538
18539 * xml.c (parse_region): Remove unused local
18540 that was recently introduced.
18541
18542 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18543
18544 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18545 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18546
18547 * xdisp.c (move_it_in_display_line_to): Record the best matching
18548 position for TO_CHARPOS while scanning the line, and restore it on
18549 exit if none of the characters scanned was an exact match.
18550 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18551 when exact match is impossible due to invisible text, and the
18552 lines are truncated.
18553
18554 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18555
18556 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18557 for OSX >= 10.7.
18558
18559 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18560
18561 Fix a significant slow-down of cursor motion with C-n, C-p,
18562 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18563 auto-repeat under bidi redisplay in fontified buffers.
18564 * xdisp.c (compute_stop_pos_backwards): New function.
18565 (next_element_from_buffer): Call compute_stop_pos_backwards to
18566 find a suitable prev_stop when we find ourselves before
18567 base_level_stop.
18568 (reseat): Don't look for prev_stop, as that could mean a very long
18569 run.
18570 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18571 <cached_disp_overlay_modiff>: Cache for last found display string
18572 position.
18573 (compute_display_string_pos): Return the cached position if asked
18574 about the same buffer in the same area of character positions, and
18575 the buffer wasn't changed since the time the display string
18576 position was cached.
18577
18578 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18579
18580 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18581 is an integer, which is important for empty lines. (Bug#9149)
18582
18583 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18584
18585 * frame.c (Fmodify_frame_parameters): In tty case, update the
18586 default face if necessary (Bug#4238).
18587
18588 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18589
18590 * editfns.c (Fstring_to_char): No need to explain what a character
18591 is in the docstring (Bug#6576).
18592
18593 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18594
18595 * xml.c (parse_region): Make sure we always return a tree.
18596
18597 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18598
18599 * xml.c (parse_region): If a document contains only comments,
18600 return that, too.
18601
18602 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18603
18604 * xml.c (make_dom): Return comments, too.
18605
18606 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18607
18608 Port to OpenBSD.
18609 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18610 and the surrounding thread.
18611 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18612 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18613 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18614 timer goes off.
18615 * s/openbsd.h (BROKEN_SIGIO): Define.
18616 * unexelf.c (unexec) [__OpenBSD__]:
18617 Don't update the .mdebug section of the Alpha COFF symbol table.
18618
18619 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18620
18621 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18622 (bug#8460).
18623
18624 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18625
18626 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18627 This fixes some race conditions on the permissions of any newly
18628 created file.
18629
18630 * alloc.c (valid_pointer_p): Use pipe, not open.
18631 This fixes some permissions issues when debugging.
18632
18633 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18634 If fchown fails to set both uid and gid, try to set just gid,
18635 as that is sometimes allowed. Adjust the file's mode to eliminate
18636 setuid or setgid bits that are inappropriate if fchown fails.
18637
18638 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18639
18640 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18641 to compare Lisp_Objects.
18642 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18643 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18644 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18645
18646 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18647
18648 * lread.c (read_integer): Unread even EOF character.
18649 (read1): Likewise. Properly record start position of symbol.
18650
18651 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18652 symbol character follows.
18653
18654 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18655
18656 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18657 This works around a problem with the previous change to Fcopy_file.
18658 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18659 and without this change, GCC might complain about discarding
18660 fchown's return value.
18661
18662 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18663
18664 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18665
18666 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18667
18668 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18669
18670 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18671
18672 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18673 it's used from the C level.
18674
18675 * process.c: Use the same condition for POLL_FOR_INPUT in both
18676 keyboard.c and process.c (bug#1858).
18677
18678 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18679
18680 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18681 (Fgnutls_boot): Use it.
18682
18683 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18684
18685 * doc.c (Fsubstitute_command_keys): Revert last change.
18686
18687 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18688
18689 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18690 quotes the next character, and doesn't affect other longer
18691 sequences (bug#8935).
18692
18693 * lread.c (syms_of_lread): Clarify that is isn't only
18694 `eval-buffer' and `eval-defun' that's affected by
18695 `lexical-binding' (bug#8460).
18696
18697 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18698
18699 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18700 bidi redisplay when a line includes both an image and is truncated.
18701
18702 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18703
18704 Fix minor problems found by static checking.
18705 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18706 (elsz): Now a signed constant, not a size_t var. We prefer signed
18707 types to unsigned, to avoid integer comparison confusion. Without
18708 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18709 "cannot optimize loop, the loop counter may overflow", a symptom
18710 of the confusion.
18711 * indent.c (Fvertical_motion): Mark locals as initialized.
18712 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18713
18714 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18715
18716 * search.c (Fre_search_backward): Mention `case-fold-search' in
18717 all the re_search_* functions (bug#8138).
18718
18719 * keyboard.c (Fopen_dribble_file): Document when the file is
18720 closed (bug#8056).
18721
18722 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18723
18724 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18725 bidi_cache_idx.
18726
18727 Support bidi reordering of display and overlay strings.
18728 * xdisp.c (compute_display_string_pos)
18729 (compute_display_string_end): Accept additional argument STRING.
18730 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18731 (reseat_to_string): Initialize bidi_it->string.s and
18732 bidi_it->string.schars.
18733 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18734 NULL (avoids a crash in bidi_paragraph_init).
18735 Initialize itb.string.lstring.
18736 (init_iterator): Call bidi_init_it only of a valid
18737 buffer position was specified. Initialize paragraph_embedding to
18738 L2R.
18739 (reseat_to_string): Initialize the bidi iterator.
18740 (display_string): If we need to ignore text properties of
18741 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18742 original value of -1 will not work with bidi.)
18743 (compute_display_string_pos): First arg is now struct
18744 `text_pos *'; all callers changed. Support display properties on
18745 Lisp strings.
18746 (compute_display_string_end): Support display properties on Lisp
18747 strings.
18748 (init_iterator, reseat_1, reseat_to_string): Initialize the
18749 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18750 when iterating on a string not from display properties).
18751 (compute_display_string_pos, compute_display_string_end):
18752 Fix calculation of the object to scan. Fixes an error when using
18753 arrow keys.
18754 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18755 base_level_stop; instead, set base_level_stop to BEGV.
18756 Fixes crashes in vertical-motion.
18757 (next_element_from_buffer): Improve commentary for when
18758 the iterator is before prev_stop.
18759 (init_iterator): Initialize bidi_p from the default value of
18760 bidi-display-reordering, not from buffer-local value. Use the
18761 buffer-local value only if initializing for buffer iteration.
18762 (handle_invisible_prop): Support invisible properties on strings
18763 that are being bidi-reordered.
18764 (set_iterator_to_next): Support bidi reordering of C strings and
18765 Lisp strings.
18766 (next_element_from_string): Support bidi reordering of Lisp
18767 strings.
18768 (handle_stop_backwards): Support Lisp strings as well.
18769 (display_string): Support display of R2L glyph rows.
18770 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18771 (init_iterator): Don't initialize it->bidi_p for strings
18772 here.
18773 (reseat_to_string): Initialize it->bidi_p for strings here.
18774 (next_element_from_string, next_element_from_c_string)
18775 (next_element_from_buffer): Add xassert's for correspondence
18776 between IT's object being iterated and it->bidi_it.string
18777 structure.
18778 (face_before_or_after_it_pos): Support bidi iteration.
18779 (next_element_from_c_string): Handle the case of the first string
18780 character that is not the first one in the visual order.
18781 (get_visually_first_element): New function, refactored from common
18782 parts of next_element_from_buffer, next_element_from_string, and
18783 next_element_from_c_string.
18784 (tool_bar_lines_needed, redisplay_tool_bar)
18785 (display_menu_bar): Force left-to-right direction. Add a FIXME
18786 comment for making that be controlled by a user option.
18787 (push_it, pop_it): Save and restore the state of the
18788 bidi iterator. Save and restore the bidi_p flag.
18789 (pop_it): Iterate out of display property for string iteration as
18790 well.
18791 (iterate_out_of_display_property): Support iteration over strings.
18792 (handle_single_display_spec): Set up it->bidi_it for iteration
18793 over a display string, and call bidi_init_it.
18794 (handle_single_display_spec, next_overlay_string)
18795 (get_overlay_strings_1, push_display_prop): Set up the bidi
18796 iterator for displaying display or overlay strings.
18797 (forward_to_next_line_start): Don't use the shortcut if
18798 bidi-iterating.
18799 (back_to_previous_visible_line_start): If handle_display_prop
18800 pushed the iterator stack, restore the internal state of the bidi
18801 iterator by calling bidi_pop_it same number of times.
18802 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18803 and we are bidi-iterating, don't decrement the iterator position;
18804 instead, set the first_elt flag in the bidi iterator, to produce
18805 the same effect.
18806 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18807 (push_display_prop): xassert that we are iterating a buffer.
18808 (push_it, pop_it): Save and restore paragraph_embedding member.
18809 (handle_single_display_spec, next_overlay_string)
18810 (get_overlay_strings_1, reseat_1, reseat_to_string)
18811 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18812 correctly. Don't assume unibyte strings are not bidi-reordered.
18813 (compute_display_string_pos)
18814 (compute_display_string_end): Fix handling the case of C string.
18815 (push_it, pop_it): Save and restore from_disp_prop_p.
18816 (handle_single_display_spec, push_display_prop): Set the
18817 from_disp_prop_p flag.
18818 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18819 (pop_it): Call iterate_out_of_display_property only if we are
18820 popping after iteration over a string that came from a display
18821 property. Fix a typo in popping stretch info. Add an assertion
18822 for verifying that the iterator position is in sync with the bidi
18823 iterator.
18824 (handle_single_display_spec, get_overlay_strings_1)
18825 (push_display_prop): Fix initialization of paragraph direction for
18826 string when that of the parent object is not yet determined.
18827 (reseat_1): Call bidi_init_it to resync the bidi
18828 iterator with IT's position. (Bug#7616)
18829 (find_row_edges): If ROW->start.pos gives position
18830 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18831 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18832 Reset the from_disp_prop_p flag.
18833 (SAVE_IT, RESTORE_IT): New macros.
18834 (pos_visible_p, face_before_or_after_it_pos)
18835 (back_to_previous_visible_line_start)
18836 (move_it_in_display_line_to, move_it_in_display_line)
18837 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18838 (try_scrolling, redisplay_window, display_line): Use them when
18839 saving a temporary copy of the iterator and restoring it back.
18840 (back_to_previous_visible_line_start, reseat_1)
18841 (init_iterator): Empty the bidi cache "stack".
18842 (move_it_in_display_line_to): If iterator ended up at
18843 EOL, but we never saw any buffer positions smaller than
18844 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18845 motion in bidi-reordered lines.
18846 (move_it_in_display_line_to): Record prev_method and prev_pos
18847 immediately before the call to set_iterator_to_next. Fixes cursor
18848 motion in bidi-reordered lines with stretch glyphs and strings
18849 displayed in margins. (Bug#8133) (Bug#8867)
18850 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18851 TO_CHARPOS.
18852 (pos_visible_p): Support positions in bidi-reordered lines.
18853 Save and restore bidi cache.
18854
18855 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18856 (bidi_paragraph_info): Delete unused struct.
18857 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18858 (bidi_cache_start): New variable.
18859 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18860 to zero.
18861 (bidi_cache_fetch_state, bidi_cache_search)
18862 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18863 (bidi_cache_find, bidi_peek_at_next_level)
18864 (bidi_level_of_next_char, bidi_find_other_level_edge)
18865 (bidi_move_to_visually_next): Compare cache index with
18866 bidi_cache_start rather than with zero.
18867 (bidi_fetch_char): Accept new argument STRING; all callers
18868 changed. Support iteration over a string. Support strings with
18869 display properties. Support unibyte strings. Fix the type of
18870 `len' according to what STRING_CHAR_AND_LENGTH expects.
18871 (bidi_paragraph_init, bidi_resolve_explicit_1)
18872 (bidi_resolve_explicit, bidi_resolve_weak)
18873 (bidi_level_of_next_char, bidi_move_to_visually_next):
18874 Support iteration over a string.
18875 (bidi_set_sor_type, bidi_resolve_explicit_1)
18876 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18877 can now be zero (for strings); special values 0 and -1 were
18878 changed to -1 and -2, respectively.
18879 (bidi_char_at_pos): New function.
18880 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18881 Call it instead of FETCH_MULTIBYTE_CHAR.
18882 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18883 initialized to valid values.
18884 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18885 values.
18886 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18887 the test for valid cached positions. Fix the logic for looking up
18888 the sentinel state in the cache. GCPRO the Lisp string we are
18889 iterating.
18890 (bidi_push_it, bidi_pop_it): New functions.
18891 (bidi_initialize): Initialize the bidi cache start stack pointer.
18892 (bidi_cache_ensure_space): New function, refactored from part of
18893 bidi_cache_iterator_state. Don't assume the required size is just
18894 one BIDI_CACHE_CHUNK away.
18895 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18896 (bidi_count_bytes, bidi_char_at_pos): New functions.
18897 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18898 always valid if bidi_cache_idx is valid.
18899 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18900 is valid if it's going to be used.
18901 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18902 (bidi_cache_fetch_state, bidi_cache_search)
18903 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18904 (bidi_cache_iterator_state, bidi_cache_find)
18905 (bidi_find_other_level_edge, bidi_cache_start_stack):
18906 All variables related to cache indices are now EMACS_INT.
18907
18908 * dispextern.h (struct bidi_string_data): New structure.
18909 (struct bidi_it): New member `string'. Make flag members be 1-bit
18910 fields, and put them last in the struct.
18911 (compute_display_string_pos, compute_display_string_end):
18912 Update prototypes.
18913 (bidi_push_it, bidi_pop_it): Add prototypes.
18914 (struct iterator_stack_entry): New members bidi_p,
18915 paragraph_embedding, and from_disp_prop_p.
18916 (struct it): Member bidi_p is now a bit field 1 bit wide.
18917 (bidi_shelve_cache, bidi_unshelve_cache):
18918 Declare prototypes.
18919
18920 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18921 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18922 and vector-like objects.
18923
18924 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18925 cache around display iteration.
18926
18927 * window.c (Fwindow_end, window_scroll_pixel_based)
18928 (displayed_window_lines, Frecenter): Save and restore the bidi
18929 cache around display iteration.
18930
18931 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18932
18933 * editfns.c (Fdelete_region): Clarify the use of the named
18934 parameters (bug#6788).
18935
18936 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18937
18938 * indent.c (Fvertical_motion): Set and restore w->pointm when
18939 saving and restoring the window's buffer (Bug#9006).
18940
18941 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18942
18943 * editfns.c (Fstring_to_char): Clarify just what is returned
18944 (bug#6576). Text by Eli Zaretskii.
18945
18946 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18947
18948 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18949
18950 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18951
18952 * buffer.c (mmap_find): Fix a typo.
18953
18954 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18955
18956 Fix execution of x selection hooks.
18957 * xselect.c (Qx_lost_selection_functions)
18958 (Qx_sent_selection_functions): New vars.
18959 (syms_of_xselect): DEFSYM them.
18960 (x_handle_selection_request): Pass Qx_sent_selection_functions
18961 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18962 (x_handle_selection_clear,x_clear_frame_selections):
18963 Pass Qx_lost_selection_functions rather than
18964 Vx_lost_selection_functions to Frun_hook_with_args.
18965
18966 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18967
18968 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18969 The old code sometimes used this field without initializing it.
18970
18971 * alloc.c (gc_sweep): Don't read past end of array.
18972 In theory, the old code could also have corrupted Emacs internals,
18973 though it'd be very unlikely.
18974
18975 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18976
18977 * character.c (Fcharacterp): Don't advertise optional ignored
18978 argument. (Bug#4026)
18979
18980 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18981
18982 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18983 key" (bug#4257).
18984
18985 * window.c (Fset_window_start): Doc fix (bug#4199).
18986 (Fset_window_hscroll): Ditto.
18987
18988 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18989
18990 Fix minor new problems caught by GCC 4.6.1.
18991 * term.c (init_tty): Remove unused local.
18992 * xsettings.c (store_monospaced_changed): Define this function only
18993 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18994 not used otherwise.
18995
18996 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18997
18998 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18999
19000 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
19001
19002 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
19003 are the mini-buffer and the echo area (bug#3320).
19004
19005 * term.c (init_tty): Remove support for supdup, c10 and perq
19006 terminals, which are no longer supported (bug#1482).
19007
19008 2011-07-10 Johan Bockgård <bojohan@gnu.org>
19009
19010 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19011
19012 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19013
19014 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19015 for non-popups (Bug#3642).
19016
19017 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19018
19019 * alloc.c (reset_malloc_hooks): Protoize.
19020 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19021 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19022 * cm.c (losecursor): Likewise.
19023 * data.c (fmod): Likewise.
19024 * dispnew.c (swap_glyphs_in_rows): Likewise.
19025 * emacs.c (memory_warning_signal): Likewise.
19026 * floatfns.c (float_error): Likewise.
19027 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19028 (otf_open, font_otf_capability, generate_otf_features)
19029 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19030 Likewise.
19031 * image.c (pbm_read_file): Likewise.
19032 * indent.c (string_display_width): Likewise.
19033 * intervals.c (check_for_interval, search_for_interval)
19034 (inc_interval_count, count_intervals, root_interval)
19035 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19036 * lread.c (defalias): Likewise.
19037 * ralloc.c (r_alloc_check): Likewise.
19038 * regex.c (set_image_of_range_1, set_image_of_range)
19039 (regex_grow_registers): Likewise.
19040 * sysdep.c (strerror): Likewise.
19041 * termcap.c (valid_filename_p, tprint, main): Likewise.
19042 * tparam.c (main): Likewise.
19043 * unexhp9k800.c (run_time_remap, save_data_space)
19044 (update_file_ptrs, read_header, write_header, calculate_checksum)
19045 (copy_file, copy_rest, display_header): Likewise.
19046 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19047 Likewise.
19048 * xdisp.c (check_it): Likewise.
19049 * xfaces.c (register_color, unregister_color, unregister_colors):
19050 Likewise.
19051 * xfns.c (print_fontset_result): Likewise.
19052 * xrdb.c (member, fatal, main): Likewise.
19053
19054 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19055
19056 Fix minor problems found by static checking (Bug#9031).
19057 * chartab.c (char_table_set_range, map_sub_char_table):
19058 Remove unused locals.
19059 (uniprop_table): Now static.
19060 * composite.c (_work_char): Remove unused static var.
19061
19062 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
19063
19064 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19065
19066 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19067
19068 * gtkutil.c (qttip_cb): Remove code without function.
19069
19070 2011-07-09 Eli Zaretskii <eliz@gnu.org>
19071
19072 * w32.c (pthread_sigmask): New stub.
19073
19074 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19075
19076 Use pthread_sigmask, not sigprocmask (Bug#9010).
19077 sigprocmask is portable only for single-threaded applications, and
19078 Emacs can be multi-threaded when it uses GTK.
19079 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19080 (LIBES): Use it.
19081 * callproc.c (Fcall_process):
19082 * process.c (create_process):
19083 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19084 Use pthread_sigmask, not sigprocmask.
19085
19086 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19087
19088 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19089 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19090 wrong (Bug#8591).
19091
19092 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19093
19094 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19095 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19096 (xg_hide_tooltip): Fix comment.
19097
19098 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19099 in registerServicesMenuSendTypes.
19100 (validRequestorForSendType): Don't check ns_return_types.
19101
19102 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19103 ns_return_type.
19104
19105 2011-07-08 Jason Rumney <jasonr@gnu.org>
19106
19107 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19108 SH_SHOW for hidden windows (Bug#5482).
19109
19110 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19111 frame struct members of non-existent frames (Bug#6284).
19112
19113 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19114
19115 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19116 variable firstTime not needed on OSX >= 10.6.
19117 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19118 >= 10.5. Use setKnobProportion, setDoubleValue.
19119
19120 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19121 (MAC_OS_X_VERSION_10_5): Define if not defined.
19122 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19123 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19124 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19125
19126 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19127 cString and lossyCString on OSX >= 10.4.
19128
19129 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19130 sizeToFit on OSX >= 10.2.
19131
19132 * nsimage.m (allocInitFromFile): Don't use deprecated method
19133 bestRepresentationForDevice on OSX >= 10.6.
19134
19135 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19136 to avoid warning.
19137
19138 * emacs.c: Declare unexec_init_emacs_zone.
19139
19140 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19141
19142 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19143
19144 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19145 on svcsMenu (Bug#8842).
19146
19147 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19148 ns_return_types.
19149 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19150
19151 * nsterm.m (QUTF8_STRING): Declare.
19152 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19153 (validRequestorForSendType): Return type is (id).
19154 Change indexOfObjectIdenticalTo to indexOfObject.
19155 Check if we have local selection before returning self (Bug#8842).
19156 (writeSelectionToPasteboard): Put local selection into paste board
19157 if we have a local selection (Bug#8842).
19158 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19159
19160 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19161 (ns_get_local_selection): Declare.
19162
19163 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19164
19165 * keymap.c (describe_map_tree): Don't insert a double newline at
19166 the end of the buffer (bug#1169) and return whether we inserted
19167 something.
19168
19169 * callint.c (Fcall_interactively): Change "reading args" to
19170 "providing args" to try to clarify what it does (bug#1010).
19171
19172 2011-07-07 Kenichi Handa <handa@m17n.org>
19173
19174 * composite.c (composition_compute_stop_pos): Ignore a static
19175 composition starting before CHARPOS (Bug#8915).
19176
19177 * xdisp.c (handle_composition_prop): Likewise.
19178
19179 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19180
19181 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19182 (Bug#9015)
19183
19184 2011-07-07 Kenichi Handa <handa@m17n.org>
19185
19186 * character.h (unicode_category_t): New enum type.
19187
19188 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19189 (Qchar_code_property_table): New variable.
19190 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19191 (UNIPROP_COMPRESSED_FORM_P): New macros.
19192 (char_table_ascii): Uncompress the compressed values.
19193 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19194 Uncompress the compressed values.
19195 (sub_char_table_ref_and_range): Likewise.
19196 (char_table_ref_and_range): Uncompress the compressed values.
19197 (sub_char_table_set): New arg is_uniprop. Callers changed.
19198 Uncompress the compressed values.
19199 (sub_char_table_set_range): Args changed. Callers changed.
19200 (char_table_set_range): Adjuted for the above change.
19201 (map_sub_char_table): Delete args default_val and parent. Add arg
19202 top. Give decoded values to a Lisp function.
19203 (map_char_table): Adjust for the above change. Give decoded
19204 values to a Lisp function. Gcpro more variables.
19205 (uniprop_table_uncompress)
19206 (uniprop_decode_value_run_length): New functions.
19207 (uniprop_decoder, uniprop_decoder_count): New variables.
19208 (uniprop_get_decoder, uniprop_encode_value_character)
19209 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19210 New functions.
19211 (uniprop_encoder, uniprop_encoder_count): New variables.
19212 (uniprop_get_encoder, uniprop_table)
19213 (Funicode_property_table_internal, Fget_unicode_property_internal)
19214 (Fput_unicode_property_internal): New functions.
19215 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19216 Sunicode_property_table_internal, Sget_unicode_property_internal,
19217 and Sput_unicode_property_internal. Defvar_lisp
19218 char-code-property-alist.
19219
19220 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19221 Vunicode_category_table.
19222
19223 * font.c (font_range): Adjust for the change of
19224 Vunicode_category_table.
19225
19226 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19227
19228 * m/iris4d.h: Remove file, move contents ...
19229 * s/irix6-5.h: ... here.
19230
19231 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19232
19233 Remove unportable assumption about struct layout (Bug#8884).
19234 * alloc.c (mark_buffer):
19235 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19236 (clone_per_buffer_values): Don't assume that
19237 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19238 This isn't true in general, and it's particularly not true
19239 if Emacs is configured with --with-wide-int.
19240 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19241 New macros, used in the buffer.c change.
19242
19243 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19244
19245 * xsettings.c: Use both GConf and GSettings if both are available.
19246 (store_config_changed_event): Add comment.
19247 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19248 (store_tool_bar_style_changed): New functions.
19249 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19250 (struct xsettings): Move font inside HAVE_XFT.
19251 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19252 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19253 Move inside HAVE_XFT.
19254 (something_changed_gsettingsCB): Rename from something_changedCB.
19255 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19256 also.
19257 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19258 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19259 (something_changed_gconfCB): Rename from something_changedCB.
19260 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19261 (parse_settings): Move check for font inside HAVE_XFT.
19262 (read_settings, apply_xft_settings): Add comment.
19263 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19264 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19265 call store_font_name_changed.
19266 (xft_settings_event): Add comment.
19267 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19268 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19269 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19270 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19271 (xsettings_initialize): Call init_gsettings last.
19272 (xsettings_get_system_font, xsettings_get_system_normal_font):
19273 Add comment.
19274
19275 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19276
19277 Random fixes. E.g., (random) never returned negative values.
19278 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19279 subseconds part to the entropy, as that's a bit more random.
19280 Prefer signed to unsigned, since the signedness doesn't matter and
19281 in general we prefer signed. When given a limit, use a
19282 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19283 latter isn't right if USE_2_TAGS_FOR_INTS.
19284 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19285 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19286
19287 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19288
19289 * textprop.c (text_property_stickiness):
19290 Obey Vtext_property_default_nonsticky.
19291 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19292 * w32fns.c (syms_of_w32fns):
19293 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19294
19295 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19296
19297 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19298 This is more efficient than Ffile_directory_p and avoids a minor race.
19299
19300 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19301
19302 * buffer.c (Foverlay_put): Say what the return value is
19303 (bug#7835).
19304
19305 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19306 is a directory before asking whether to use the file name
19307 (bug#7564).
19308 (barf_or_query_if_file_exists): Make the "File is a directory"
19309 error be more correct.
19310
19311 * fns.c (Frequire): Remove the mention of the .gz files, since
19312 that's installation-specific, but keep the mention of
19313 `get-load-suffixes'.
19314
19315 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19316
19317 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19318 Report string overflow if the output is too long.
19319
19320 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19321
19322 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19323 (syms_of_gnutls): Remove duplicate DEFSYM for
19324 Qgnutls_bootprop_verify_hostname_error, an error for
19325 Qgnutls_bootprop_verify_error (which is no longer used).
19326
19327 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19328 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19329 Also (re)move comments that are misplaced or no longer relevant.
19330
19331 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19332
19333 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19334
19335 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19336
19337 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19338 and background color parameters if they have been changed.
19339
19340 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19341
19342 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19343
19344 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19345
19346 * xsettings.c (SYSTEM_FONT): Define only when used.
19347 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19348
19349 * keymap.c (access_keymap_1): Now static.
19350
19351 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19352
19353 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19354 leave any prefix arg for the up event (Bug#1586).
19355
19356 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19357
19358 * lread.c (syms_of_lread): Mention single symbols defined by
19359 `defvar' or `defconst' (bug#7154).
19360
19361 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19362 (Frequire): Mention get-load-suffixes.
19363
19364 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19365
19366 * window.h (window): Remove clone_number slot.
19367 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19368 Remove.
19369 (make_parent_window, make_window, saved_window)
19370 (Fset_window_configuration, save_window_save): Don't deal with
19371 clone numbers.
19372 * buffer.c (Qclone_number): Remove declaration.
19373 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19374
19375 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19376
19377 Add multiple inheritance to keymaps.
19378 * keymap.c (Fmake_composed_keymap): New function.
19379 (Fset_keymap_parent): Simplify.
19380 (fix_submap_inheritance): Remove.
19381 (access_keymap_1): New function extracted from access_keymap to handle
19382 embedded parents and handle lists of maps.
19383 (access_keymap): Use it.
19384 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19385 (Fcopy_keymap): Handle embedded parents.
19386 (Fcommand_remapping, define_as_prefix): Simplify.
19387 (Fkey_binding): Simplify.
19388 (syms_of_keymap): Move minibuffer-local-completion-map,
19389 minibuffer-local-filename-completion-map,
19390 minibuffer-local-must-match-map, and
19391 minibuffer-local-filename-must-match-map to Elisp.
19392 (syms_of_keymap): Defsubr make-composed-keymap.
19393 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19394 (parse_menu_item): Trivial simplification.
19395
19396 2011-07-01 Glenn Morris <rgm@gnu.org>
19397
19398 * Makefile.in (SETTINGS_LIBS): Fix typo.
19399
19400 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19401
19402 * coding.c (Fencode_coding_string): Record the last coding system
19403 used, as the function doc string says (bug#8738).
19404
19405 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19406
19407 * xsettings.c (store_monospaced_changed): Take new font as arg and
19408 check for change against current_mono_font.
19409 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19410 (emacs_settings_constructor, emacs_settings_get_property)
19411 (emacs_settings_set_property, emacs_settings_class_init)
19412 (emacs_settings_init, gsettings_obj): Remove.
19413 (something_changedCB): New function for HAVE_GSETTINGS.
19414 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19415 with value as argument.
19416 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19417 g_settings_new (Bug#8967). Do not create gsettings_obj.
19418 Remove calls to g_settings_bind. Connect something_changedCB to
19419 "changed".
19420
19421 * xgselect.c: Add defined (HAVE_GSETTINGS).
19422 (xgselect_initialize): Ditto.
19423
19424 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19425 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19426 xg_select.
19427
19428 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19429
19430 * eval.c (struct backtrace): Simplify and port the data structure.
19431 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19432 signed bit field, as this assumption is not portable and it makes
19433 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19434 "char debug_on_exit : 1" as this is not portable either; instead,
19435 use the portable "unsigned int debug_on_exit : 1". Remove unused
19436 member evalargs. Remove obsolete comments about cc bombing out.
19437
19438 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19439
19440 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19441 Let HAVE_GSETTINGS override HAVE_GCONF.
19442 (store_monospaced_changed): New function.
19443 (EMACS_SETTINGS): A new type derived from GObject to handle
19444 GSettings notifications.
19445 (emacs_settings_constructor, emacs_settings_get_property)
19446 (emacs_settings_set_property, emacs_settings_class_init):
19447 New functions.
19448 (gsettings_client, gsettings_obj): New variables.
19449 (GSETTINGS_SCHEMA): New define.
19450 (something_changedCB): Call store_monospaced_changed.
19451 (init_gsettings): New function.
19452 (xsettings_initialize): Call init_gsettings.
19453 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19454 to NULL.
19455
19456 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19457 GCONF_CFLAGS/LIBS.
19458
19459 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19460
19461 * window.c (resize_root_window, grow_mini_window)
19462 (shrink_mini_window): Rename Qresize_root_window to
19463 Qwindow_resize_root_window and Qresize_root_window_vertically to
19464 Qwindow_resize_root_window_vertically.
19465
19466 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19467
19468 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19469
19470 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19471
19472 * makefile.w32-in: Redesign dependencies so they reflect more
19473 clearly which files are directly included by each source file,
19474 and not through other includes.
19475
19476 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19477
19478 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19479 (sort_overlays, overlay_strings): When an overlay's clone number
19480 matches the window's clone number process the overlay even if
19481 the overlay's window property doesn't match the current window.
19482
19483 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19484 (Fwindow_hchild): Rename to Fwindow_left_child.
19485 (Fwindow_next): Rename to Fwindow_next_sibling.
19486 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19487 (resize_window_check): Rename to window_resize_check.
19488 (resize_window_apply): Rename to window_resize_apply.
19489 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19490 (Fdelete_other_windows_internal, resize_frame_windows)
19491 (Fsplit_window_internal, Fdelete_window_internal)
19492 (grow_mini_window, shrink_mini_window)
19493 (Fresize_mini_window_internal): Fix callers accordingly.
19494
19495 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19496
19497 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19498 (emacs_fixed_set_min_size): Remove.
19499 (emacs_fixed_new): Take frame as argument.
19500
19501 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19502 (_EmacsFixedPrivate): Remove minwidth/height.
19503 Add struct frame *f.
19504 (emacs_fixed_init): Initialize priv->f.
19505 (get_parent_class, emacs_fixed_set_min_size): Remove.
19506 (emacs_fixed_new): Set priv->f to argument.
19507 (emacs_fixed_get_preferred_width)
19508 (emacs_fixed_get_preferred_height): Use min_width/height from
19509 frames size_hint to set minimum and natural (Bug#8919).
19510 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19511 and use min_width/height from frames size_hint to set
19512 min_width/height (Bug#8919).
19513
19514 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19515 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19516 Fix indentation.
19517
19518 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19519
19520 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19521 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19522 called at ZV.
19523
19524 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19525
19526 * process.c (wait_reading_process_output): Bypass select if
19527 waiting for a cell while ignoring keyboard input, and input is
19528 pending. Suggested by Jan Djärv (Bug#8869).
19529
19530 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19531
19532 Use gnulib's dup2 module instead of rolling our own.
19533 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19534
19535 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19536
19537 * dispnew.c (scrolling_window): Before scrolling, turn off a
19538 mouse-highlight in the window being scrolled.
19539
19540 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19541
19542 Move DEFSYM to lisp.h and use everywhere.
19543
19544 * character.h (DEFSYM): Move declaration...
19545 * lisp.h (DEFSYM): ...here.
19546
19547 * gnutls.c:
19548 * minibuf.c:
19549 * w32menu.c:
19550 * w32proc.c:
19551 * w32select.c: Don't include character.h.
19552
19553 * alloc.c (syms_of_alloc):
19554 * buffer.c (syms_of_buffer):
19555 * bytecode.c (syms_of_bytecode):
19556 * callint.c (syms_of_callint):
19557 * casefiddle.c (syms_of_casefiddle):
19558 * casetab.c (init_casetab_once):
19559 * category.c (init_category_once, syms_of_category):
19560 * ccl.c (syms_of_ccl):
19561 * cmds.c (syms_of_cmds):
19562 * composite.c (syms_of_composite):
19563 * dbusbind.c (syms_of_dbusbind):
19564 * dired.c (syms_of_dired):
19565 * dispnew.c (syms_of_display):
19566 * doc.c (syms_of_doc):
19567 * editfns.c (syms_of_editfns):
19568 * emacs.c (syms_of_emacs):
19569 * eval.c (syms_of_eval):
19570 * fileio.c (syms_of_fileio):
19571 * fns.c (syms_of_fns):
19572 * frame.c (syms_of_frame):
19573 * fringe.c (syms_of_fringe):
19574 * insdel.c (syms_of_insdel):
19575 * keymap.c (syms_of_keymap):
19576 * lread.c (init_obarray, syms_of_lread):
19577 * macros.c (syms_of_macros):
19578 * msdos.c (syms_of_msdos):
19579 * print.c (syms_of_print):
19580 * process.c (syms_of_process):
19581 * search.c (syms_of_search):
19582 * sound.c (syms_of_sound):
19583 * syntax.c (init_syntax_once, syms_of_syntax):
19584 * terminal.c (syms_of_terminal):
19585 * textprop.c (syms_of_textprop):
19586 * undo.c (syms_of_undo):
19587 * w32.c (globals_of_w32):
19588 * window.c (syms_of_window):
19589 * xdisp.c (syms_of_xdisp):
19590 * xfaces.c (syms_of_xfaces):
19591 * xfns.c (syms_of_xfns):
19592 * xmenu.c (syms_of_xmenu):
19593 * xsettings.c (syms_of_xsettings):
19594 * xterm.c (syms_of_xterm): Use DEFSYM.
19595
19596 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19597
19598 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19599
19600 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19601
19602 Integer and buffer overflow fixes (Bug#8873).
19603
19604 * print.c (printchar, strout): Check for string overflow.
19605 (PRINTPREPARE, printchar, strout):
19606 Don't set size unless allocation succeeds.
19607
19608 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19609 for sizes. Check for string overflow more accurately.
19610 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19611
19612 * macros.c: Integer and buffer overflow fixes.
19613 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19614 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19615 Use ptrdiff_t, not int, for sizes.
19616 Don't increment bufsize until after realloc succeeds.
19617 Check for size-calculation overflow.
19618 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19619
19620 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19621
19622 * lread.c: Integer overflow fixes.
19623 (read_integer): Radix is now EMACS_INT, not int,
19624 to improve quality of diagnostics for out-of-range radices.
19625 Calculate buffer size correctly for out-of-range radices.
19626 (read1): Check for integer overflow in radices, and in
19627 read-circle numbers.
19628 (read_escape): Avoid int overflow.
19629 (Fload, openp, read_buffer_size, read1)
19630 (substitute_object_recurse, read_vector, read_list, map_obarray):
19631 Use ptrdiff_t, not int, for sizes.
19632 (read1): Use EMACS_INT, not int, for sizes.
19633 Check for size overflow.
19634
19635 * image.c (cache_image): Check for size arithmetic overflow.
19636
19637 * lread.c: Integer overflow issues.
19638 (saved_doc_string_size, saved_doc_string_length)
19639 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19640 Now ptrdiff_t, not int.
19641 (read1): Don't assume doc string length fits in int. Check for
19642 out-of-range doc string lengths.
19643 (read_list): Don't assume file position fits in int.
19644 (read_escape): Check for hex character overflow.
19645
19646 2011-06-22 Leo Liu <sdl.web@gmail.com>
19647
19648 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19649 Move to minibuffer.el.
19650
19651 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19652
19653 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19654 The following patches are for when GLYPH_DEBUG && !XASSERT.
19655 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19656 * dispnew.c (flush_stdout):
19657 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19658 Mark as externally visible.
19659 * dispnew.c (check_window_matrix_pointers): Now static.
19660 * dispnew.c (window_to_frame_vpos):
19661 * xfns.c (unwind_create_frame):
19662 * xterm.c (x_check_font): Remove unused local.
19663 * scroll.c (CHECK_BOUNDS):
19664 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19665 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19666 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19667 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19668 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19669 Now static.
19670 (debug_method_add): Use va_list and vsprintf rather than relying
19671 on undefined behavior with wrong number of arguments.
19672 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19673 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19674 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19675 since we're not interested in debugging glyphs with old libraries.
19676 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19677 GCC 4.6.0's static checking.
19678
19679 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19680
19681 Integer overflow and signedness fixes (Bug#8873).
19682 A few related buffer overrun fixes, too.
19683
19684 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19685
19686 * dispextern.h (struct face.stipple):
19687 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19688 (x_bitmap_mask, x_allocate_bitmap_record)
19689 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19690 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19691 (x_create_bitmap_from_xpm_data):
19692 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19693 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19694 (.bitmaps_last):
19695 * xfaces.c (load_pixmap):
19696 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19697 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19698 (.bitmaps_last, struct x_output.icon_bitmap):
19699 Use ptrdiff_t, not int, for bitmap indexes.
19700 (x_allocate_bitmap_record): Check for size overflow.
19701 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19702
19703 Use ptrdiff_t, not int, for overlay counts.
19704 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19705 * editfns.c (overlays_around, get_pos_property):
19706 * textprop.c (get_char_property_and_overlay):
19707 * xdisp.c (next_overlay_change, note_mouse_highlight):
19708 * xfaces.c (face_at_buffer_position):
19709 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19710 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19711 (Fnext_overlay_change, Fprevious_overlay_change)
19712 (mouse_face_overlay_overlaps, Foverlays_in):
19713 Use ptrdiff_t, not int, for sizes.
19714 (overlays_at, overlays_in): Check for size-calculation overflow.
19715
19716 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19717
19718 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19719 (x_session_initialize): Do not assume string length fits in int.
19720
19721 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19722 This is unlikely, but can occur if DPI is outlandish.
19723
19724 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19725 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19726
19727 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19728 * xrdb.c (magic_file_p, search_magic_path):
19729 Omit last arg SUFFIX; it was always 0. All callers changed.
19730 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19731
19732 * xfont.c (xfont_match): Avoid need for strlen.
19733
19734 * xfns.c: Don't assume strlen fits in int.
19735 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19736
19737 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19738 not unsigned long, as we prefer signed integers. All callers changed.
19739 Detect integer overflow in repeat count.
19740 (message_dolog): Don't assume print length fits in 39 bytes.
19741 (display_mode_element): Don't assume strlen fits in int.
19742
19743 * termcap.c: Don't assume sizes fit in int and never overflow.
19744 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19745 (gobble_line): Check for size-calculation overflow.
19746
19747 * minibuf.c (Fread_buffer):
19748 * lread.c (intern, intern_c_string):
19749 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19750 Don't assume string length fits in int.
19751
19752 * keyboard.c (parse_tool_bar_item):
19753 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19754
19755 * font.c: Don't assume string length fits in int.
19756 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19757 Use ptrdiff_t, not int.
19758 (font_intern_prop): Don't assume string length fits in int.
19759 Don't assume integer property fits in fixnum.
19760 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19761
19762 * filelock.c: Fix some buffer overrun and integer overflow issues.
19763 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19764 Reformulate so as not to need the command string.
19765 Invoke gzip -cd rather than gunzip, as it's more portable.
19766 (lock_info_type, lock_file_1, lock_file):
19767 Don't assume pid_t and time_t fit in unsigned long.
19768 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19769 (current_lock_owner): Prefer signed type for sizes.
19770 Use memcpy, not strncpy, where memcpy is what is really wanted.
19771 Don't assume (via atoi) that time_t and pid_t fit in int.
19772 Check for time_t and/or pid_t out of range, e.g., via a network share.
19773 Don't alloca where an auto var works fine.
19774
19775 * fileio.c: Fix some integer overflow issues.
19776 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19777 Don't assume string length fits in int.
19778 (directory_file_name): Don't assume string length fits in long.
19779 (make_temp_name): Don't assume pid fits in int, or that its print
19780 length is less than 20.
19781
19782 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19783
19784 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19785
19786 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19787
19788 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19789 We prefer signed integers, even for size calculations.
19790
19791 * emacs.c: Don't assume string length fits in 'int'.
19792 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19793 (main): Don't invoke strlen when not needed.
19794
19795 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19796 (XD_DEBUG_MESSAGE): Don't waste a byte.
19797
19798 * callproc.c (getenv_internal_1, getenv_internal)
19799 (Fgetenv_internal):
19800 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19801
19802 * lread.c (invalid_syntax): Omit length argument.
19803 All uses changed. This doesn't fix a bug, but it simplifies the
19804 code away from its former Hollerith-constant appearance, and it's
19805 one less 'int' to worry about when looking at integer-overflow issues.
19806 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19807
19808 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19809 This didn't break anything, but it didn't help either.
19810 It's confusing to put a bogus integer in a place where the actual
19811 value does not matter.
19812 (LIST_END_P): Remove unused macro and its bogus comment.
19813 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19814
19815 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19816 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19817 implementation.
19818 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19819 We prefer signed types, and the value cannot exceed the EMACS_INT
19820 range anyway (because otherwise the length would not be representable).
19821 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19822 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19823 This avoids a GCC warning when WIDE_EMACS_INT.
19824
19825 * indent.c (sane_tab_width): New function.
19826 (current_column, scan_for_column, Findent_to, position_indentation)
19827 (compute_motion): Use it. This is just for clarity.
19828 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19829
19830 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19831
19832 * lisp.h (lint_assume): New macro.
19833 * composite.c (composition_gstring_put_cache):
19834 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19835
19836 * editfns.c, insdel.c:
19837 Omit unnecessary forward decls, to simplify future changes.
19838
19839 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19840
19841 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19842
19843 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19844 Use much-faster test for byte-length change.
19845 Don't assume string byte-length fits in 'int'.
19846 Check that character arg fits in 'int'.
19847 (mapcar1): Declare byte as byte, for clarity.
19848
19849 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19850
19851 * fns.c (concat): Catch string overflow earlier.
19852 Do not rely on integer wraparound.
19853
19854 * dispextern.h (struct it.overlay_strings_charpos)
19855 (struct it.selective): Now EMACS_INT, not int.
19856 * xdisp.c (forward_to_next_line_start)
19857 (back_to_previous_visible_line_start)
19858 (reseat_at_next_visible_line_start, next_element_from_buffer):
19859 Don't arbitrarily truncate the value of 'selective' to int.
19860
19861 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19862
19863 * composite.c: Don't truncate sizes to 'int'.
19864 (composition_gstring_p, composition_reseat_it)
19865 (composition_adjust_point): Use EMACS_INT, not int.
19866 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19867 not EMACS_UINT, for indexes.
19868
19869 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19870
19871 * buffer.c: Include <verify.h>.
19872 (struct sortvec.priority, struct sortstr.priority):
19873 Now EMACS_INT, not int.
19874 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19875 (struct sortstr.size, record_overlay_string)
19876 (struct sortstrlist.size, struct sortlist.used):
19877 Don't truncate size to int.
19878 (record_overlay_string): Check for size-calculation overflow.
19879 (init_buffer_once): Check at compile-time, not run-time.
19880
19881 2011-06-22 Jim Meyering <meyering@redhat.com>
19882
19883 Don't leak an XBM-image-sized buffer
19884 * image.c (xbm_load): Free the image buffer after using it.
19885
19886 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19887
19888 Port to Sun C.
19889 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19890 that Sun C diagnosed.
19891 * fns.c (secure_hash): Fix pointer signedness issue.
19892 * intervals.c (static_offset_intervals): New function.
19893 (offset_intervals): Use it.
19894
19895 2011-06-21 Leo Liu <sdl.web@gmail.com>
19896
19897 * deps.mk (fns.o):
19898 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19899 sha512.h.
19900
19901 * fns.c (secure_hash): Rename from crypto_hash_function and change
19902 the first arg to accept symbols.
19903 (Fsecure_hash): New primitive.
19904 (syms_of_fns): New symbols.
19905
19906 2011-06-20 Deniz Dogan <deniz@dogan.se>
19907
19908 * process.c (Fset_process_buffer): Clarify return value in
19909 docstring.
19910
19911 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19912
19913 * dispnew.c (add_window_display_history): Use BVAR.
19914
19915 * xdisp.c (debug_method_add): Use BVAR.
19916 (check_window_end, dump_glyph_matrix, dump_glyph)
19917 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19918
19919 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19920 Likewise.
19921
19922 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19923 check till after the cache is created in init_frame_faces.
19924
19925 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19926
19927 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19928
19929 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19930
19931 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19932 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19933 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19934
19935 Improve buffer-overflow checking (Bug#8873).
19936 * fileio.c (Finsert_file_contents):
19937 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19938 Remove the old (too-loose) buffer overflow checks.
19939 They weren't needed, since make_gap checks for buffer overflow.
19940 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19941 The old code merely checked for Emacs fixnum overflow, and relied
19942 on undefined (wraparound) behavior. The new code avoids undefined
19943 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19944
19945 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19946 Tune. Don't use wider integers than needed. Don't use alloca.
19947 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19948
19949 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19950
19951 * insdel.c, lisp.h (buffer_overflow): New function.
19952 (insert_from_buffer_1, replace_range, replace_range_2):
19953 * insdel.c (make_gap_larger):
19954 * editfns.c (Finsert_char):
19955 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19956
19957 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19958
19959 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19960
19961 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19962
19963 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19964 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19965
19966 * fileio.c: Don't assume EMACS_INT fits in off_t.
19967 (emacs_lseek): New static function.
19968 (Finsert_file_contents, Fwrite_region): Use it.
19969 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19970
19971 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19972
19973 * fns.c: Don't overflow int when computing a list length.
19974 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19975 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19976 truncation on 64-bit hosts. Check for QUIT every
19977 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19978 faster and is responsive enough.
19979 (Flength): Report an error instead of overflowing an integer.
19980 (Fsafe_length): Return a float if the value is not representable
19981 as a fixnum. This shouldn't happen except in contrived situations.
19982 (Fnthcdr, Fsort): Don't assume list length fits in int.
19983 (Fcopy_sequence): Don't assume vector length fits in int.
19984
19985 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19986 (header_size, word_size): New constants.
19987 (allocate_vectorlike): Don't check size overflow here.
19988 (allocate_vector): Check it here instead, since this is the only
19989 caller of allocate_vectorlike that could cause overflow.
19990 Check that the new vector's length is representable as a fixnum.
19991
19992 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19993 The previous code was bogus. For example, next_almost_prime (32)
19994 returned 39, which is undesirable as it is a multiple of 3; and
19995 next_almost_prime (24) returned 25, which is a multiple of 5 so
19996 why was the code bothering to check for multiples of 7?
19997
19998 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19999
20000 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
20001
20002 Variadic C functions now count arguments with ptrdiff_t.
20003 This partly undoes my 2011-03-30 change, which replaced int with size_t.
20004 Back then I didn't know that the Emacs coding style prefers signed int.
20005 Also, in the meantime I found a few more instances where arguments
20006 were being counted with int, which may truncate counts on 64-bit
20007 machines, or EMACS_INT, which may be unnecessarily wide.
20008 * lisp.h (struct Lisp_Subr.function.aMANY)
20009 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20010 Arg counts are now ptrdiff_t, not size_t.
20011 All variadic functions and their callers changed accordingly.
20012 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20013 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20014 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20015 * callint.c (Fcall_interactively): Check arg count for overflow,
20016 to avoid potential buffer overrun. Use signed char, not 'int',
20017 for 'varies' array, so that we needn't bother to check its size
20018 calculation for overflow.
20019 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20020 * eval.c (apply_lambda):
20021 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20022 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20023 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20024
20025 * callint.c (Fcall_interactively): Don't use index var as event count.
20026
20027 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20028 * mem-limits.h (SIZE): Remove; no longer used.
20029
20030 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20031
20032 Remove unnecessary casts.
20033 * xterm.c (x_term_init):
20034 * xfns.c (x_set_border_pixel):
20035 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20036 These aren't needed now that we assume ANSI C.
20037
20038 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20039 It's more likely to cause problems (due to unsigned overflow)
20040 than to cure them.
20041
20042 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20043
20044 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20045
20046 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20047
20048 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20049
20050 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20051
20052 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20053
20054 GLYPH_CODE_FACE returns EMACS_INT, not int.
20055 * dispextern.h (merge_faces):
20056 * xfaces.c (merge_faces):
20057 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20058 Don't assume EMACS_INT fits in int.
20059
20060 * character.h (CHAR_VALID_P): Remove unused parameter.
20061 * fontset.c, lisp.h, xdisp.c: All uses changed.
20062
20063 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20064
20065 * fns.c (concat): Minor tuning based on overflow analysis.
20066 This doesn't fix any bugs. Use int to hold character, instead
20067 of constantly refetching from Emacs object. Use XFASTINT, not
20068 XINT, for value known to be a character. Don't bother comparing
20069 a single byte to 0400, as it's always less.
20070
20071 * floatfns.c (Fexpt):
20072 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20073
20074 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20075 for characters.
20076
20077 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20078
20079 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20080 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20081 incorrectly succeed when S was a string, because 4294967386 was
20082 truncated before it was used.
20083
20084 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20085 Otherwise, an out-of-range integer could cause undefined behavior
20086 on a 64-bit host.
20087
20088 * composite.c: Use int, not EMACS_INT, for characters.
20089 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20090 EMACS_INT, for values that are known to be in character range.
20091 This doesn't fix any bugs but is the usual style inside Emacs and
20092 may generate better code on 32-bit machines.
20093
20094 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20095 This is for reasons similar to the recent CHAR_STRING fix.
20096 * charset.c (Fencode_char): Check that character arg is actually
20097 a character. Pass an int to ENCODE_CHAR.
20098 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20099 wider than 'int', as a compile-time check to prevent future regressions
20100 in this area.
20101
20102 * character.c (char_string): Remove unnecessary casts.
20103
20104 Make sure a 64-bit char is never passed to CHAR_STRING.
20105 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20106 by silently ignoring the top 32 bits, allowing some values
20107 that were far too large to be valid characters.
20108 * character.h: Include <verify.h>.
20109 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20110 arguments are no wider than unsigned, as a compile-time check
20111 to prevent future regressions in this area.
20112 * data.c (Faset):
20113 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20114 (Fsubst_char_in_region):
20115 * fns.c (concat):
20116 * xdisp.c (decode_mode_spec_coding):
20117 Adjust to CHAR_STRING's new requirement.
20118 * editfns.c (Finsert_char, Fsubst_char_in_region):
20119 * fns.c (concat): Check that character args are actually
20120 characters. Without this test, these functions did the wrong
20121 thing with wildly out-of-range values on 64-bit hosts.
20122
20123 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20124 These casts should not be needed on 32-bit hosts, either.
20125 * keyboard.c (read_char):
20126 * lread.c (Fload): Remove casts to unsigned.
20127
20128 * lisp.h (UNSIGNED_CMP): New macro.
20129 This fixes comparison bugs on 64-bit hosts.
20130 (ASCII_CHAR_P): Use it.
20131 * casefiddle.c (casify_object):
20132 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20133 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20134 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20135 * dispextern.h (FACE_FROM_ID):
20136 * keyboard.c (read_char): Use UNSIGNED_CMP.
20137
20138 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20139 not to EMACS_INT, to avoid GCC warning.
20140
20141 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20142
20143 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20144 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20145 isn't needed on 32-bit machines.
20146
20147 * buffer.c (Fgenerate_new_buffer_name):
20148 Use EMACS_INT for count, not int.
20149 (advance_to_char_boundary): Return EMACS_INT, not int.
20150
20151 * data.c (Qcompiled_function): Now static.
20152
20153 * window.c (window_body_lines): Now static.
20154
20155 * image.c (gif_load): Rename local to avoid shadowing.
20156
20157 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20158 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20159 * alloc.c (make_save_value): Integer argument is now of type
20160 ptrdiff_t, not int.
20161 (mark_object): Use ptrdiff_t, not int.
20162 * lisp.h (pD): New macro.
20163 * print.c (print_object): Use it.
20164
20165 * alloc.c: Use EMACS_INT, not int, to count objects.
20166 (total_conses, total_markers, total_symbols, total_vector_size)
20167 (total_free_conses, total_free_markers, total_free_symbols)
20168 (total_free_floats, total_floats, total_free_intervals)
20169 (total_intervals, total_strings, total_free_strings):
20170 Now EMACS_INT, not int. All uses changed.
20171 (Fgarbage_collect): Compute overall total using a double, so that
20172 integer overflow is less likely to be a problem. Check for overflow
20173 when converting back to an integer.
20174 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20175 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20176 These were 'int' variables that could overflow on 64-bit hosts;
20177 they were never used, so remove them instead of repairing them.
20178 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20179 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20180 Previously, this ceilinged at INT_MAX, but that doesn't work on
20181 64-bit machines.
20182 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20183
20184 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20185 (allocate_vectorlike): Check for ptrdiff_t overflow.
20186 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20187 when a (possibly-narrower) signed value would do just as well.
20188 We prefer using signed arithmetic, to avoid comparison confusion.
20189
20190 * alloc.c: Catch some string size overflows that we were missing.
20191 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20192 for convenience in STRING_BYTES_MAX.
20193 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20194 The definition here is exact; the one in lisp.h was approximate.
20195 (allocate_string_data): Check for string overflow. This catches
20196 some instances we weren't catching before. Also, it catches
20197 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20198 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20199 and ptrdiff_t and EMACS_INT are both 64 bits.
20200
20201 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20202 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20203 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20204
20205 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20206
20207 * alloc.c (Fmake_string): Check for out-of-range init.
20208
20209 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20210
20211 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20212
20213 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20214
20215 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20216 xg_get_default_scrollbar_width.
20217
20218 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20219 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20220 (style_changed_cb): Call update_theme_scrollbar_width and call
20221 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20222 all frames (Bug#8505).
20223 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20224 Call gtk_window_set_resizable if HAVE_GTK3.
20225 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20226 and height if HAVE_GTK3 (Bug#8505).
20227 (scroll_bar_width_for_theme): New variable.
20228 (update_theme_scrollbar_width): New function.
20229 (xg_get_default_scrollbar_width): Move code to
20230 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20231 (xg_initialize): Call update_theme_scrollbar_width.
20232
20233 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20234
20235 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20236
20237 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20238
20239 * frame.c (make_frame): Call other_buffer_safely instead of
20240 other_buffer.
20241
20242 * window.c (temp_output_buffer_show): Call display_buffer with
20243 second argument Vtemp_buffer_show_specifiers and reset latter
20244 immediately after the call.
20245 (Vtemp_buffer_show_specifiers): New variable.
20246 (auto_window_vscroll_p, next_screen_context_lines)
20247 (Vscroll_preserve_screen_position): Remove leading asterisks from
20248 doc-strings.
20249
20250 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20251
20252 Fix minor problems found by GCC 4.6.0 static checking.
20253 * buffer.c (Qclone_number): Remove for now, as it's unused.
20254 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20255 (record_buffer): Remove unused local.
20256 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20257 (set_frame_buffer_list): Remove; unused.
20258 * frame.h (other_visible_frames): Remove decl.
20259 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20260 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20261 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20262 if HAVE_GPM.
20263 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20264 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20265 Define only if HAVE_GPM.
20266 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20267 (update_hints_inhibit): Remove; never set. All uses removed.
20268 * widgetprv.h (emacsFrameClassRec): Remove decl.
20269 * window.c (delete_deletable_window): Now returns void, since it
20270 wasn't returning anything.
20271 (compare_window_configurations): Remove unused locals.
20272 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20273 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20274 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20275 the same widths as pointers. This follows up on the 2011-05-06 patch.
20276 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20277 * xterm.h: Likewise.
20278 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20279
20280 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20281
20282 * makefile.w32-in: Update dependencies.
20283 (LISP_H): Add lib/intprops.h.
20284
20285 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20286
20287 * image.c (gif_load): Add animation frame delay to the metadata.
20288 (syms_of_image): Use DEFSYM. New symbol `delay'.
20289
20290 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20291
20292 * window.c (delete_deletable_window): Re-add.
20293 (Fset_window_configuration): Rewrite to handle dead buffers and
20294 consequently deletable windows.
20295 (window_tree, Fwindow_tree): Remove. Supply functionality in
20296 window.el.
20297 (compare_window_configurations): Simplify code.
20298
20299 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20300
20301 * image.c (imagemagick_load_image): Fix type mismatch.
20302 (Fimagemagick_types): Likewise.
20303
20304 * window.h (replace_buffer_in_windows): Declare.
20305
20306 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20307
20308 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20309 Qclone_number. Remove external declaration of Qdelete_window.
20310 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20311 code.
20312 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20313 Run Qbuffer_list_update_hook if allowed.
20314 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20315 buffer list implementation.
20316 (other_buffer_safely): New function.
20317 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20318 calls to replace_buffer_in_windows and
20319 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20320 if allowed.
20321 (record_buffer): Inhibit quitting and rewrite using quittable
20322 functions. Run Qbuffer_list_update_hook if allowed.
20323 (Frecord_buffer, Funrecord_buffer): New functions.
20324 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20325 Move switch-to-buffer to window.el.
20326 (bury-buffer): Move to window.el.
20327 (Vbuffer_list_update_hook): New variable.
20328
20329 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20330 section.
20331
20332 * window.h (resize_frame_windows): Move up in code.
20333 (Fwindow_frame): Remove EXFUN.
20334 (replace_buffer_in_all_windows): Remove prototype.
20335 (replace_buffer_in_windows_safely): Add prototype.
20336
20337 * window.c: Declare Qdelete_window static again. Move down
20338 declaration of select_count.
20339 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20340 (Fother_window): Move to window.el.
20341 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20342 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20343 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20344 window.el.
20345 (replace_buffer_in_windows): Implement by calling
20346 Qreplace_buffer_in_windows.
20347 (replace_buffer_in_all_windows): Remove with some functionality
20348 moved into replace_buffer_in_windows_safely.
20349 (replace_buffer_in_windows_safely): New function.
20350 (select_window_norecord, select_frame_norecord): Move in front
20351 of run_window_configuration_change_hook. Remove now obsolete
20352 declarations.
20353 (Fset_window_buffer): Rewrite doc-string.
20354 Call Qrecord_window_buffer.
20355 (keys_of_window): Move binding for other-window to window.el.
20356
20357 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20358
20359 * dispextern.h (struct image): Replace data member, whose int_val
20360 and ptr_val fields were not used by anything, with a single
20361 lisp_val object.
20362
20363 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20364 (gif_clear_image, gif_load, imagemagick_load_image)
20365 (gs_clear_image, gs_load): Callers changed.
20366
20367 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20368
20369 * buffer.h: Include <time.h>, for time_t.
20370 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20371
20372 Fix minor problems found by static checking.
20373
20374 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20375
20376 Make identifiers static if they are not used in other modules.
20377 * data.c (Qcompiled_function, Qframe, Qvector):
20378 * image.c (QimageMagick, Qsvg):
20379 * minibuf.c (Qmetadata):
20380 * window.c (resize_window_check, resize_root_window): Now static.
20381 * window.h (resize_window_check, resize_root_window): Remove decls.
20382
20383 * window.c (window_deletion_count, delete_deletable_window):
20384 Remove; unused.
20385 (window_body_lines): Now static.
20386 (Fdelete_other_windows_internal): Mark vars as initialized.
20387 Make sure 'resize_failed' is initialized.
20388 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20389 (resize_window_apply): Remove unused local.
20390 * window.h (delete_deletable_window): Remove decl.
20391
20392 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20393 (imagemagick_load_image): Fix pointer signedness problem by changing
20394 last arg from unsigned char * to char *. All uses changed.
20395 Also, fix a local for similar reasons.
20396 Remove unused locals. Remove locals to avoid shadowing.
20397 (fn_rsvg_handle_free): Remove; unused.
20398 (svg_load, svg_load_image): Fix pointer signedness problem.
20399 (imagemagick_load_image): Don't use garbage pointer image_wand.
20400
20401 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20402
20403 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20404
20405 * image.c (gif_load): Fix omitted cast error introduced by
20406 2011-06-06 change.
20407
20408 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20409
20410 * window.h (resize_proportionally, orig_total_lines)
20411 (orig_top_line): Remove from window structure.
20412 (set_window_height, set_window_width, change_window_heights)
20413 (Fdelete_window): Remove prototypes.
20414 (resize_frame_windows): Remove duplicate declaration.
20415
20416 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20417
20418 * window.h (resize_frame_windows, resize_window_check)
20419 (delete_deletable_window, resize_root_window)
20420 (resize_frame_windows): Declare prototypes.
20421
20422 * window.c (resize_window_apply): Make definition be "static" to
20423 match the prototype.
20424
20425 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20426
20427 * window.c: Remove declarations of Qwindow_size_fixed,
20428 window_min_size_1, window_min_size_2, window_min_size,
20429 size_window, window_fixed_size_p, enlarge_window, delete_window.
20430 Remove static from declaration of Qdelete_window, it's
20431 temporarily needed by Fbury_buffer.
20432 (replace_window): Don't assign orig_top_line and
20433 orig_total_lines.
20434 (Fdelete_window, delete_window): Remove. Window deletion is
20435 handled by window.el.
20436 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20437 Replace Fdelete_window calls with calls to Qdelete_window.
20438 (Fdelete_other_windows): Remove. Deleting other windows is
20439 handled by window.el.
20440 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20441 handled in window.el.
20442 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20443 Window minimum sizes are handled in window.el.
20444 (shrink_windows, size_window, set_window_height)
20445 (set_window_width, change_window_heights, window_height)
20446 (window_width, CURBEG, CURSIZE, enlarge_window)
20447 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20448 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20449 handled in window.el.
20450 (make_dummy_parent): Rename to make_parent_window and give it a
20451 second argument horflag.
20452 (make_window): Don't set resize_proportionally any more.
20453 (Fsplit_window): Remove. Windows are split in window.el.
20454 (save_restore_action, save_restore_orig_size)
20455 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20456 Resize mini windows in window.el.
20457 (grow_mini_window, shrink_mini_window): Implement by calling
20458 Qresize_root_window_vertically, resize_window_check and
20459 resize_window_apply.
20460 (saved_window, Fset_window_configuration, save_window_save):
20461 Do not handle orig_top_line, orig_total_lines, and
20462 resize_proportionally.
20463 (window_min_height, window_min_width): Move to window.el.
20464 (keys_of_window): Move bindings for delete-other-windows,
20465 split-window, delete-window and enlarge-window to window.el.
20466
20467 * buffer.c: Temporarily extern Qdelete_window.
20468 (Fbury_buffer): Temporarily call Qdelete_window instead of
20469 Fdelete_window (Fbury_buffer will move to window.el soon).
20470
20471 * frame.c (set_menu_bar_lines_1): Remove code handling
20472 orig_top_line and orig_total_lines.
20473
20474 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20475 set_window_height but set heights directly.
20476 (change_frame_size_1): Use resize_frame_windows.
20477
20478 * xdisp.c (init_xdisp): Don't use set_window_height but set
20479 heights directly.
20480
20481 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20482 Use resize_frame_windows instead of change_window_heights and run
20483 run_window_configuration_change_hook.
20484
20485 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20486 instead of change_window_heights and run
20487 run_window_configuration_change_hook.
20488
20489 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20490
20491 * window.c (replace_window): Rename second argument REPLACEMENT to
20492 NEW. New third argument SETFLAG. Rewrite.
20493 (delete_window, make_dummy_parent): Call replace_window with
20494 third argument 1.
20495 (window_list_1): Move down in code.
20496 (run_window_configuration_change_hook): Move set_buffer part
20497 before select_frame_norecord part in order to unwind correctly.
20498 Rename count1 to count.
20499 (recombine_windows, delete_deletable_window, resize_root_window)
20500 (Fdelete_other_windows_internal)
20501 (Frun_window_configuration_change_hook, make_parent_window)
20502 (resize_window_check, resize_window_apply, Fresize_window_apply)
20503 (resize_frame_windows, Fsplit_window_internal)
20504 (Fdelete_window_internal, Fresize_mini_window_internal):
20505 New functions.
20506 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20507
20508 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20509
20510 * window.h (window): Add some new members to window structure -
20511 normal_lines, normal_cols, new_total, new_normal, clone_number,
20512 splits, nest, prev_buffers, next_buffers.
20513 (WINDOW_TOTAL_SIZE): Move here from window.c.
20514 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20515
20516 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20517 Remove.
20518 (make_dummy_parent): Set new members of windows structure.
20519 (make_window): Move down in code. Handle new members of window
20520 structure.
20521 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20522 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20523 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20524 (Fset_window_prev_buffers, Fwindow_next_buffers)
20525 (Fset_window_next_buffers, Fset_window_clone_number):
20526 New functions.
20527 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20528 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20529 Doc-string fixes.
20530 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20531 Argument WINDOW can be now internal window too.
20532 (Fwindow_use_time): Move up in code.
20533 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20534 Rewrite doc-string.
20535 (Fset_window_configuration, saved_window)
20536 (Fcurrent_window_configuration, save_window_save): Handle new
20537 members of window structure.
20538 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20539 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20540 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20541 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20542 Qget_mru_window, Qresize_root_window,
20543 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20544 Qauto_buffer_name; staticpro them.
20545
20546 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20547
20548 * window.c (Fwindow_total_size, Fwindow_left_column)
20549 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20550 (Fwindow_list_1): New functions.
20551 (window_box_text_cols): Replace with window_body_cols.
20552 (Fwindow_width, Fscroll_left, Fscroll_right):
20553 Use window_body_cols instead of window_box_text_cols.
20554 (delete_window, Fset_window_configuration):
20555 Call delete_all_subwindows with window as argument.
20556 (delete_all_subwindows): Take a window as argument and not a
20557 structure. Rewrite.
20558 (window_loop): Remove handling of GET_LRU_WINDOW and
20559 GET_LARGEST_WINDOW.
20560 (Fget_lru_window, Fget_largest_window): Move to window.el.
20561
20562 * window.h: Extern window_body_cols instead of
20563 window_box_text_cols. delete_all_subwindows now takes a
20564 Lisp_Object as argument.
20565
20566 * indent.c (compute_motion, Fcompute_motion):
20567 Use window_body_cols instead of window_box_text_cols.
20568
20569 * frame.c (delete_frame): Call delete_all_subwindows with root
20570 window as argument.
20571
20572 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20573
20574 * fns.c (Fputhash): Document return value.
20575
20576 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20577
20578 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20579
20580 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20581
20582 Cons<->int and similar integer overflow fixes (Bug#8794).
20583
20584 Check for overflow when converting integer to cons and back.
20585 * charset.c (Fdefine_charset_internal, Fdecode_char):
20586 Use cons_to_unsigned to catch overflow.
20587 (Fencode_char): Use INTEGER_TO_CONS.
20588 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20589 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20590 * data.c (long_to_cons, cons_to_long): Remove.
20591 (cons_to_unsigned, cons_to_signed): New functions.
20592 These signal an error for invalid or out-of-range values.
20593 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20594 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20595 * font.c (Ffont_variation_glyphs):
20596 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20597 * lisp.h: Include <intprops.h>.
20598 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20599 (cons_to_signed, cons_to_unsigned): New decls.
20600 (long_to_cons, cons_to_long): Remove decls.
20601 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20602 (Fprimitive_undo): Use CONS_TO_INTEGER.
20603 * xfns.c (Fx_window_property): Likewise.
20604 * xselect.c: Include <limits.h>.
20605 (x_own_selection, selection_data_to_lisp_data):
20606 Use INTEGER_TO_CONS.
20607 (x_handle_selection_request, x_handle_selection_clear)
20608 (x_get_foreign_selection, Fx_disown_selection_internal)
20609 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20610 (lisp_data_to_selection_data): Use cons_to_unsigned.
20611 (x_fill_property_data): Use cons_to_signed.
20612 Report values out of range.
20613
20614 Check for buffer and string overflow more precisely.
20615 * buffer.h (BUF_BYTES_MAX): New macro.
20616 * lisp.h (STRING_BYTES_MAX): New macro.
20617 * alloc.c (Fmake_string):
20618 * character.c (string_escape_byte8):
20619 * coding.c (coding_alloc_by_realloc):
20620 * doprnt.c (doprnt):
20621 * editfns.c (Fformat):
20622 * eval.c (verror):
20623 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20624 since they may not be the same number.
20625 * editfns.c (Finsert_char):
20626 * fileio.c (Finsert_file_contents):
20627 Likewise for BUF_BYTES_MAX.
20628
20629 * image.c: Use ptrdiff_t, not int, for sizes.
20630 (slurp_file): Switch from int to ptrdiff_t.
20631 All uses changed.
20632 (slurp_file): Check that file size fits in both size_t (for
20633 malloc) and ptrdiff_t (for sanity and safety).
20634
20635 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20636 if b->modtime has its maximal value.
20637
20638 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20639
20640 Don't assume time_t can fit into int.
20641 * buffer.h (struct buffer.modtime): Now time_t, not int.
20642 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20643 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20644
20645 Minor fixes for signed vs unsigned integers.
20646 * character.h (MAYBE_UNIFY_CHAR):
20647 * charset.c (maybe_unify_char):
20648 * keyboard.c (read_char, reorder_modifiers):
20649 XINT -> XFASTINT, since the integer must be nonnegative.
20650 * ftfont.c (ftfont_spec_pattern):
20651 * keymap.c (access_keymap, silly_event_symbol_error):
20652 XUINT -> XFASTINT, since the integer must be nonnegative.
20653 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20654 since it makes no difference and we prefer signed.
20655 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20656 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20657 nonnegative.
20658
20659 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20660
20661 * window.h (Fwindow_frame): Declare.
20662
20663 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20664
20665 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20666 (SPARE_MEMORY): Always define.
20667 (LARGE_REQUEST): Remove.
20668 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20669
20670 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20671
20672 * lisp.h: Move EXFUNS for Fframe_root_window,
20673 Fframe_first_window and Fset_frame_selected_window to window.h.
20674
20675 * window.h: Move EXFUNS for Fframe_root_window,
20676 Fframe_first_window and Fset_frame_selected_window here from
20677 lisp.h.
20678
20679 * frame.c (Fwindow_frame, Fframe_first_window)
20680 (Fframe_root_window, Fframe_selected_window)
20681 (Fset_frame_selected_window): Move to window.c.
20682 (Factive_minibuffer_window): Move to minibuf.c.
20683 (Fother_visible_frames_p): New function.
20684
20685 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20686
20687 * window.c (decode_window, decode_any_window): Move up in code.
20688 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20689 (inhibit_frame_unsplittable): Remove unused variable.
20690 (Fwindow_buffer): Move up and rewrite doc-string.
20691 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20692 (Fwindow_prev): New functions.
20693 (Fwindow_frame): Move here from frame.c. Accept any window as
20694 argument.
20695 (Fframe_root_window, Fframe_first_window)
20696 (Fframe_selected_window): Move here from frame.c. Accept frame
20697 or arbitrary window as argument. Update doc-strings.
20698 (Fminibuffer_window): Move up in code.
20699 (Fwindow_minibuffer_p): Move up in code and simplify.
20700 (Fset_frame_selected_window): Move here from frame.c.
20701 Marginal rewrite.
20702 (Fselected_window, select_window, Fselect_window): Move up in
20703 code. Minor doc-string fixes.
20704
20705 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20706
20707 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20708 Do not assume that spare memory exists; that assumption is valid
20709 only if SYSTEM_MALLOC.
20710 (LARGE_REQUEST): New macro, so that the issue of large requests
20711 is separated from the issue of spare memory.
20712
20713 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20714
20715 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20716 format. (Bug#8806)
20717
20718 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20719
20720 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20721 before statements.
20722
20723 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20724
20725 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20726
20727 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20728
20729 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20730 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20731
20732 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20733
20734 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20735
20736 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20737
20738 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20739 (x_clipboard_manager_save): Add return value.
20740 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20741 New error handlers.
20742 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20743 Obey Vx_select_enable_clipboard_manager. Catch errors in
20744 x_clipboard_manager_save (Bug#8779).
20745 (Vx_select_enable_clipboard_manager): New variable.
20746 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20747
20748 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20749
20750 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20751
20752 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20753
20754 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20755 in the current matrix if keep_current_p is non-zero.
20756
20757 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20758
20759 * bidi.c (bidi_level_of_next_char): Fix last change.
20760
20761 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20762
20763 Support bidi reordering of text covered by display properties.
20764
20765 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20766 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20767 (bidi_cache_search, bidi_cache_iterator_state)
20768 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20769 (bidi_level_of_next_char, bidi_move_to_visually_next):
20770 Support character positions inside a run of characters covered by a
20771 display string.
20772 (bidi_paragraph_init, bidi_resolve_explicit_1)
20773 (bidi_level_of_next_char): Call bidi_fetch_char and
20774 bidi_fetch_char_advance instead of FETCH_CHAR and
20775 FETCH_CHAR_ADVANCE.
20776 (bidi_init_it): Initialize new members.
20777 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20778 definitions.
20779 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20780 instead of using explicit *_CHAR codes.
20781 (bidi_resolve_explicit, bidi_resolve_weak):
20782 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20783 bidirectional text is supported only in multibyte buffers.
20784 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20785 it to initialize the frame_window_p member of struct bidi_it.
20786 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20787 (bidi_resolve_explicit, bidi_resolve_weak)
20788 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20789 bidi_it->nchars is non-positive.
20790 (bidi_level_of_next_char): Don't try to lookup the cache for the
20791 next/previous character if nothing is cached there yet, or if we
20792 were just reseat()'ed to a new position.
20793
20794 * xdisp.c (set_cursor_from_row): Set start and stop points
20795 according to the row's direction when priming the loop that looks
20796 for the glyph on which to display cursor.
20797 (single_display_spec_intangible_p): Function deleted.
20798 (display_prop_intangible_p): Reimplement to call
20799 handle_display_spec instead of single_display_spec_intangible_p.
20800 Accept 3 additional arguments needed by handle_display_spec.
20801 This fixes incorrect cursor motion across display property with complex
20802 values: lists, `(when COND...)' forms, etc.
20803 (single_display_spec_string_p): Support property values that are
20804 lists with the argument STRING its top-level element.
20805 (display_prop_string_p): Fix the condition for processing a
20806 property that is a list to be consistent with handle_display_spec.
20807 (handle_display_spec): New function, refactored from the
20808 last portion of handle_display_prop.
20809 (compute_display_string_pos): Accept additional argument
20810 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20811 value of a `display' property is a "replacing spec".
20812 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20813 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20814 the display property, but just return a value indicating whether
20815 the display property will replace the characters it covers.
20816 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20817 frame_window_p members of struct bidi_it.
20818 (compute_display_string_pos, compute_display_string_end):
20819 New functions.
20820 (push_it): Accept second argument POSITION, where pop_it should
20821 jump to continue iteration.
20822 (reseat_1): Initialize bidi_it.disp_pos.
20823
20824 * keyboard.c (adjust_point_for_property): Adjust the call to
20825 display_prop_intangible_p to its new signature.
20826
20827 * dispextern.h (struct bidi_it): New member frame_window_p.
20828 (bidi_init_it): Update prototypes.
20829 (display_prop_intangible_p): Update prototype.
20830 (compute_display_string_pos, compute_display_string_end):
20831 Declare prototypes.
20832 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20833 EMACS_INT.
20834
20835 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20836
20837 Malloc failure behavior now depends on size of allocation.
20838 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20839 * lisp.h: Change signatures accordingly.
20840 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20841 All callers changed. (Bug#8762)
20842
20843 * gnutls.c: Use Emacs's memory allocators.
20844 Without this change, the gnutls library would invoke malloc etc.
20845 directly, which causes problems on non-SYNC_INPUT hosts, and which
20846 runs afoul of improving memory_full behavior. (Bug#8761)
20847 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20848 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20849 xfree instead of the default malloc, realloc, free.
20850 (Fgnutls_boot): No need to check for memory allocation failure,
20851 since xmalloc does that for us.
20852
20853 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20854 * category.c (hash_get_category_set):
20855 * ccl.c (ccl_driver):
20856 * charset.c (Fdefine_charset_internal):
20857 * charset.h (struct charset.hash_index):
20858 * composite.c (get_composition_id, gstring_lookup_cache)
20859 (composition_gstring_put_cache):
20860 * composite.h (struct composition.hash_index):
20861 * dispextern.h (struct image.hash):
20862 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20863 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20864 (hashfn_equal, hashfn_user_defined, make_hash_table)
20865 (maybe_resize_hash_table, hash_lookup, hash_put)
20866 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20867 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20868 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20869 * image.c (make_image, search_image_cache, lookup_image)
20870 (xpm_put_color_table_h):
20871 * lisp.h (struct Lisp_Hash_Table):
20872 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20873 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20874 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20875 * alloc.c (allocate_vectorlike):
20876 Check for overflow in vector size calculations.
20877 * ccl.c (ccl_driver):
20878 Check for overflow when converting EMACS_INT to int.
20879 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20880 need to be updated by these changes.
20881 * fns.c (make_hash_table, maybe_resize_hash_table):
20882 Check for integer overflow with large hash tables.
20883 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20884 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20885 (SXHASH_REDUCE): New macro.
20886 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20887 Use it instead of discarding useful hash info with large hash values.
20888 (sxhash_float): New function.
20889 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20890 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20891 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20892 Rewrite to use FIXNUM_BITS, as this simplifies things.
20893 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20894 Adjust signatures to match updated version of code.
20895 (consing_since_gc): Now EMACS_INT, since a single hash table can
20896 use more than INT_MAX bytes.
20897
20898 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20899
20900 Make it possible to build with GCC-4.6+ -O2 -flto.
20901
20902 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20903
20904 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20905
20906 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20907 Call minibuffer-inactive-mode.
20908
20909 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20910
20911 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20912 Update dependencies.
20913
20914 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20915
20916 * data.c (init_data): Remove code for UTS, this system is not
20917 supported anymore.
20918
20919 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20920
20921 Don't force ./temacs to start in terminal mode.
20922
20923 * frame.c (make_initial_frame): Initialize faces in all cases, not
20924 only when CANNOT_DUMP is defined.
20925 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20926
20927 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20928
20929 * dispnew.c (add_window_display_history): Use const for the string
20930 pointer. Remove declaration, not needed.
20931
20932 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20933
20934 Use 'inline', not 'INLINE'.
20935 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20936 * alloc.c, fontset.c (INLINE): Remove.
20937 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20938 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20939 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20940 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20941 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20942
20943 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20944
20945 Make it possible to run ./temacs.
20946
20947 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20948 syms_of_callproc does the same thing. Remove test for
20949 "initialized", do it in the caller.
20950 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20951
20952 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20953
20954 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20955 (read_minibuf): Use get_minibuffer.
20956 (syms_of_minibuf): Use DEFSYM.
20957 (Qmetadata): New var.
20958 * data.c (Qbuffer): Don't make it static.
20959 (syms_of_data): Use DEFSYM.
20960
20961 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20962
20963 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20964 (CCL_CODE_MIN): New macro.
20965
20966 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20967
20968 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20969
20970 * eval.c (Qdebug): Now static.
20971 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20972 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20973 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20974
20975 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20976
20977 * image.c: Various fixes to ImageMagick code comments.
20978 (Fimagemagick_types): Doc fix.
20979
20980 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20981
20982 Minor fixes prompted by GCC 4.6.0 warnings.
20983
20984 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20985
20986 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20987 (x_clipboard_manager_save_all): Move extern decl to ...
20988 * xterm.h: ... here, so that it can be checked for consistency.
20989
20990 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20991
20992 * xselect.c (x_clipboard_manager_save_frame)
20993 (x_clipboard_manager_save_all): New functions.
20994 (Fx_clipboard_manager_save): Lisp function deleted.
20995
20996 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20997 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20998
20999 * xterm.h: Update prototype.
21000
21001 2011-05-28 William Xu <william.xwl@gmail.com>
21002
21003 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
21004 exiting (Bug#8239).
21005
21006 2011-05-28 Jim Meyering <meyering@redhat.com>
21007
21008 Avoid a sign-extension bug in crypto_hash_function.
21009 * fns.c (to_uchar): Define.
21010 (crypto_hash_function): Use it to convert some newly-signed
21011 variables to unsigned, to avoid sign-extension bugs. For example,
21012 without this change, (md5 "truc") would evaluate to
21013 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21014 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21015 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21016
21017 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21018
21019 Integer overflow fixes.
21020
21021 * dbusbind.c: Serial number integer overflow fixes.
21022 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21023 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21024 to hold a serial number that is too large for a fixnum.
21025 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21026 Check for serial numbers out of range. Decode any serial number
21027 that was so large that it became a float. (Bug#8722)
21028
21029 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21030 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21031 Use XFASTINT rather than XUINT when numbers are nonnegative.
21032 (xd_append_arg, Fdbus_method_return_internal):
21033 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21034 arguments, check that Lisp number is nonnegative, rather than
21035 silently wrapping negative numbers around. (Bug#8722)
21036 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21037 (Bug#8722)
21038
21039 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21040
21041 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21042
21043 ccl: Add integer overflow checks.
21044 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21045 (IN_INT_RANGE): New macros.
21046 (ccl_driver): Use them to check for integer overflow when
21047 decoding a CCL program. Many of the new checks are whether XINT (x)
21048 fits in int; it doesn't always, on 64-bit hosts. The new version
21049 doesn't catch all possible integer overflows, but it's an
21050 improvement. (Bug#8719)
21051
21052 * alloc.c (make_event_array): Use XINT, not XUINT.
21053 There's no need for unsigned here.
21054
21055 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21056 This follows up to the 2011-05-06 change that substituted uintptr_t
21057 for EMACS_INT. This case wasn't caught back then.
21058
21059 Rework Fformat to avoid integer overflow issues.
21060 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21061 now (part of C89). Include <verify.h>.
21062 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21063 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21064 (Fformat): Avoid the prepass trying to compute sizes; it was only
21065 approximate and thus did not catch overflow reliably. Instead, walk
21066 through the format just once, formatting and computing sizes as we go,
21067 checking for integer overflow at every step, and allocating a larger
21068 buffer as needed. Keep track separately whether the format is
21069 multibyte. Keep only the most-recently calculated precision, rather
21070 than them all. Record whether each argument has been converted to
21071 string. Use EMACS_INT, not int, for byte and char and arg counts.
21072 Support field widths and precisions larger than INT_MAX. Avoid
21073 sprintf's undefined behavior with conversion specifications such as %#d
21074 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21075 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21076 formatting out-of-range floating point numbers with int
21077 formats. (Bug#8668)
21078
21079 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21080
21081 * data.c: Avoid integer truncation in expressions involving floats.
21082 * data.c: Include <intprops.h>.
21083 (arith_driver): When there's an integer overflow in an expression
21084 involving floating point, convert the integers to floating point
21085 so that the resulting value does not suffer from catastrophic
21086 integer truncation. For example, on a 64-bit host (* 4
21087 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21088 Do not rely on undefined behavior after integer overflow.
21089
21090 merge count_size_as_multibyte, parse_str_to_multibyte
21091 * character.c, character.h (count_size_as_multibyte):
21092 Rename from parse_str_to_multibyte; all uses changed.
21093 Check for integer overflow.
21094 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21095 since it's now a duplicate of the other. This is more of
21096 a character than a buffer op, so better that it's in character.c.
21097 * fns.c, print.c: Adjust to above changes.
21098
21099 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21100
21101 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21102
21103 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21104
21105 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21106 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21107 (x_clipboard_manager_save): Now static.
21108 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21109
21110 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21111 (crypto_hash_function): Now static.
21112 Fix pointer signedness problems. Avoid unnecessary initializations.
21113
21114 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
21115
21116 * termhooks.h (Vselection_alist): Make it terminal-local.
21117
21118 * terminal.c (create_terminal): Initialize it.
21119
21120 * xselect.c: Support for clipboard managers.
21121 (Vselection_alist): Move to termhooks.h as terminal-local var.
21122 (LOCAL_SELECTION): New macro.
21123 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21124 (symbol_to_x_atom): Remove gratuitous arg.
21125 (x_handle_selection_request, lisp_data_to_selection_data)
21126 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21127 (x_own_selection, x_get_local_selection, x_convert_selection):
21128 New arg, specifying work frame. Use terminal-local Vselection_alist.
21129 (some_frame_on_display): Delete unused function.
21130 (Fx_own_selection_internal, Fx_get_selection_internal)
21131 (Fx_disown_selection_internal, Fx_selection_owner_p)
21132 (Fx_selection_exists_p): New optional frame arg.
21133 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21134 (x_handle_selection_clear): Don't treat other terminals with the
21135 same keyboard specially. Use the terminal-local Vselection_alist.
21136 (x_clear_frame_selections): Use Frun_hook_with_args.
21137
21138 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21139
21140 * xterm.h: Add support for those atoms.
21141
21142 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
21143
21144 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21145 (converted_selections, conversion_fail_tag): New global variables.
21146 (x_selection_request_lisp_error): Free the above.
21147 (x_get_local_selection): Remove unnecessary code.
21148 (x_reply_selection_request): Args changed; handle arbitrary array
21149 of converted selections stored in converted_selections.
21150 Separate the XChangeProperty and SelectionNotify steps.
21151 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21152 (x_convert_selection): New function.
21153 (x_handle_selection_event): Simplify.
21154 (x_get_foreign_selection): Don't ignore incoming requests while
21155 waiting for an answer; this will fail when we implement
21156 SAVE_TARGETS, and seems unnecessary anyway.
21157 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21158 (Vx_sent_selection_functions): Doc fix.
21159
21160 2011-05-26 Leo Liu <sdl.web@gmail.com>
21161
21162 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21163
21164 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21165
21166 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21167
21168 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21169 for fringe update if it has periodic bitmap.
21170 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21171 and fringe_bitmap_periodic_p.
21172
21173 * fringe.c (get_fringe_bitmap_data): New function.
21174 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21175 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21176 row. Mark glyph row for fringe update if periodicity changed.
21177
21178 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21179 for fringe update unless it has periodic bitmap.
21180
21181 2011-05-25 Kenichi Handa <handa@m17n.org>
21182
21183 * xdisp.c (get_next_display_element): Set correct it->face_id for
21184 a static composition.
21185
21186 2011-05-24 Leo Liu <sdl.web@gmail.com>
21187
21188 * deps.mk (fns.o):
21189 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21190
21191 * fns.c (crypto_hash_function, Fsha1): New function.
21192 (Fmd5): Use crypto_hash_function.
21193 (syms_of_fns): Add Ssha1.
21194
21195 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21196
21197 * gnutls.c: Remove unused macros.
21198 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21199 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21200 Remove macros that are defined and never used.
21201 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21202
21203 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21204
21205 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21206 (Fx_get_selection_internal): Minor cleanup.
21207 (Fx_own_selection_internal): Rename arguments for consistency with
21208 select.el.
21209
21210 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21211
21212 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21213
21214 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21215
21216 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21217
21218 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21219
21220 * dispnew.c (scrolling_window): Don't exclude the case that the
21221 last enabled row in the desired matrix touches the bottom boundary.
21222
21223 2011-05-21 Glenn Morris <rgm@gnu.org>
21224
21225 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21226 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21227 and add some more files.
21228
21229 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21230
21231 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21232 report_file_error introduced by the change from 2011-05-07.
21233
21234 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21235
21236 * systime.h (Time): Define only if emacs is defined.
21237 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21238 where the include path doesn't have X11/X.h by default. See
21239 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21240
21241 2011-05-20 Kenichi Handa <handa@m17n.org>
21242
21243 * composite.c (find_automatic_composition): Fix previous change.
21244
21245 2011-05-20 Glenn Morris <rgm@gnu.org>
21246
21247 * lisp.mk: New file, split from Makefile.in.
21248 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21249 (shortlisp): Remove.
21250 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21251
21252 2011-05-19 Glenn Morris <rgm@gnu.org>
21253
21254 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21255 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21256 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21257 (lisp): Set the order to that of loadup.el.
21258 (shortlisp): Make it a copy of $lisp.
21259 (SOME_MACHINE_LISP): Remove.
21260 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21261 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21262
21263 2011-05-18 Kenichi Handa <handa@m17n.org>
21264
21265 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21266 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21267 (find_automatic_composition): Mostly rewrite for efficiency.
21268
21269 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21270
21271 * makefile.w32-in: Update dependencies.
21272
21273 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21274
21275 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21276 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21277
21278 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21279
21280 Fix some integer overflow issues, such as string length overflow.
21281
21282 * insdel.c (count_size_as_multibyte): Check for string overflow.
21283
21284 * character.c (lisp_string_width): Check for string overflow.
21285 Use EMACS_INT, not int, for string indexes and lengths; in
21286 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21287 the resulting string length overflows an EMACS_INT; instead,
21288 report a string overflow if no precision given. When checking for
21289 precision exhaustion, use a check that cannot possibly have
21290 integer overflow. (Bug#8675)
21291 * character.h (lisp_string_width): Adjust to new signature.
21292
21293 * alloc.c (string_overflow): New function.
21294 (Fmake_string): Use it. This doesn't change behavior, but saves
21295 a few bytes and will simplify future changes.
21296 * character.c (string_escape_byte8): Likewise.
21297 * lisp.h (string_overflow): New decl.
21298
21299 Fixups, following up to the user-interface timestamp change.
21300 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21301 for UI timestamps, instead of unsigned long.
21302 * msdos.c (mouse_get_pos): Likewise.
21303 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21304 * w32gui.h (Time): Define by including "systime.h" rather than by
21305 declaring it ourselves. (Bug#8664)
21306
21307 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21308 * image.c (clear_image_cache): Likewise.
21309
21310 * term.c (term_mouse_position): Don't assume time_t wraparound.
21311
21312 Be more systematic about user-interface timestamps.
21313 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21314 and sometimes 'EMACS_UINT', to represent these timestamps.
21315 This change causes it to use 'Time' uniformly, as that's what X uses.
21316 This makes the code easier to follow, and makes it easier to catch
21317 integer overflow bugs such as Bug#8664.
21318 * frame.c (Fmouse_position, Fmouse_pixel_position):
21319 Use Time, not unsigned long, for user-interface timestamps.
21320 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21321 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21322 * keyboard.h (last_event_timestamp): Likewise.
21323 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21324 * menu.h (xmenu_show): Likewise.
21325 * term.c (term_mouse_position): Likewise.
21326 * termhooks.h (struct input_event.timestamp): Likewise.
21327 (struct terminal.mouse_position_hook): Likewise.
21328 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21329 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21330 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21331 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21332 what it was before.
21333 * menu.h, termhooks.h: Include "systime.h", for Time.
21334
21335 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21336 Don't assume that the difference between two unsigned long values
21337 can fit into an integer. At this point, we know button_down_time
21338 <= event->timestamp, so the difference must be nonnegative, so
21339 there's no need to cast the result if double-click-time is
21340 nonnegative, as it should be; check that it's nonnegative, just in
21341 case. This bug is triggered when events are more than 2**31 ms
21342 apart (about 25 days). (Bug#8664)
21343
21344 * xselect.c (last_event_timestamp): Remove duplicate decl.
21345 (x_own_selection): Remove needless cast to unsigned long.
21346
21347 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21348 that always fit in int. Use a sentinel instead of a counter, to
21349 avoid a temp and to allay GCC's concerns about possible int overflow.
21350 * frame.h (struct frame): Use int for menu_bar_items_used
21351 instead of EMACS_INT, since it always fits in int.
21352
21353 * menu.c (grow_menu_items): Check for int overflow.
21354
21355 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21356
21357 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21358 Before, the code was not consistent. These values cannot exceed
21359 2**31 - 1 so there's no need to make them unsigned.
21360 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21361 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21362 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21363 as modifiers.
21364 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21365
21366 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21367 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21368 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21369 presumably because the widths might not match.
21370
21371 * window.c (size_window): Avoid needless test at loop start.
21372
21373 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21374
21375 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21376
21377 2011-05-12 Drew Adams <drew.adams@oracle.com>
21378
21379 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21380
21381 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21382
21383 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21384 `width' to `bar_area_x' and `bar_area_width', respectively.
21385 (x_scroll_run): Take account of fringe background extension.
21386
21387 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21388 Rename local vars `left' and `width' to `bar_area_x' and
21389 `bar_area_width', respectively.
21390 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21391 background extension.
21392
21393 2011-05-10 Jim Meyering <meyering@redhat.com>
21394
21395 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21396
21397 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21398
21399 * image.c (Finit_image_library): Return t for built-in image types,
21400 like pbm and xbm. (Bug#8640)
21401
21402 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21403
21404 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21405
21406 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21407
21408 * w32console.c (Fset_screen_color): Doc fix.
21409 (Fget_screen_color): New function.
21410 (syms_of_ntterm): Defsubr it.
21411
21412 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21413 unlink the temporary file if Fcall_process didn't create it in the
21414 first place.
21415 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21416 child process will be redirected to a file specified with `:file'.
21417 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21418 cue to call_process_cleanup not to close that handle.
21419
21420 2011-05-07 Ben Key <bkey76@gmail.com>
21421
21422 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21423 one of two shell specific rules, either bootstrap-temacs-CMD or
21424 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21425 to the previous implementation of the bootstrap-temacs rule.
21426 The bootstrap-temacs-CMD rule is similar to the previous
21427 implementation of the bootstrap-temacs rule except that it
21428 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21429 variable.
21430
21431 These changes, along with some changes to nt/configure.bat,
21432 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21433 earlier fix to add support for --cflags and --ldflags options
21434 that include quotes so that it works whether make uses cmd or
21435 sh as the shell.
21436
21437 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21438
21439 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21440 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21441 is a constant.
21442 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21443 a string. Handle both cases.
21444 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21445 (Fdbus_register_method): Use Qinvalid_function.
21446
21447 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21448
21449 * makefile.w32-in: Update dependencies.
21450 (LISP_H): Add inttypes.h and stdin.h.
21451 (PROCESS_H): Add unistd.h.
21452
21453 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21454
21455 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21456 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21457
21458 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21459
21460 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21461
21462 * term.c (vfatal): Remove stray call to va_end.
21463 It's not needed and the C Standard doesn't allow it here anyway.
21464
21465 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21466 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21467
21468 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21469 bytes.
21470
21471 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21472
21473 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21474
21475 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21476
21477 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21478
21479 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21480
21481 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21482 * charset.c (Fdefine_charset_internal): Don't initialize
21483 charset.code_space[15]. The value was garbage, on hosts with
21484 32-bit int (Bug#8600).
21485
21486 * lread.c (read_integer): Be more consistent with string-to-number.
21487 Use string_to_number to do the actual conversion; this avoids
21488 rounding errors and fixes some other screwups. Without this fix,
21489 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21490 (digit_to_number): Move earlier, for benefit of read_integer.
21491 Return -1 if the digit is out of range for the base, -2 if it is
21492 not a digit in any supported base. (Bug#8602)
21493
21494 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21495
21496 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21497 to match comment at start of function. This also removes a
21498 GCC warning about overflow in a 32+64-bit port.
21499
21500 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21501
21502 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21503 Reported by Stefan Monnier in
21504 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21505 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21506 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21507
21508 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21509 (EMACS_UINTPTR): Likewise, with uintptr_t.
21510
21511 * lisp.h: Prefer 64-bit EMACS_INT if available.
21512 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21513 on 32-bit hosts that have 64-bit int, so that they can access
21514 large files.
21515 However, temporarily disable this change unless the temporary
21516 symbol WIDE_EMACS_INT is defined.
21517
21518 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21519
21520 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21521 This removes an assumption that EMACS_INT and long are the same
21522 width as pointers. The assumption is true for Emacs porting targets
21523 now, but we want to make other targets possible.
21524 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21525 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21526 In the rest of the code, change types of integers that hold casted
21527 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21528 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21529 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21530 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21531 No need to cast type when ORing.
21532 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21533 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21534 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21535 assume EMACS_INT is the same width as char *.
21536 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21537 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21538 Remove no-longer-needed casts.
21539 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21540 (xg_tool_bar_help_callback, xg_make_tool_item):
21541 Use EMACS_INTPTR to hold an integer
21542 that will be cast to void *; this can avoid a GCC warning
21543 if EMACS_INT is not the same width as void *.
21544 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21545 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21546 (current_message_1, set_message_1):
21547 Use a local to convert to proper width without a cast.
21548 * xmenu.c (dialog_selection_callback): Likewise.
21549
21550 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21551 Also, don't assume VALBITS / RAND_BITS is less than 5,
21552 and don't rely on undefined behavior when shifting a 1 left into
21553 the sign bit.
21554 * lisp.h (get_random): Change signature to match.
21555
21556 * lread.c (hash_string): Use size_t, not int, for hash computation.
21557 Normally we prefer signed values; but hashing is special, because
21558 it's better to use unsigned division on hash table sizes so that
21559 the remainder is nonnegative. Also, size_t is the natural width
21560 for hashing into memory. The previous code used 'int', which doesn't
21561 retain enough info to hash well into very large tables.
21562 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21563
21564 * dbusbind.c: Don't possibly lose pointer info when converting.
21565 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21566 Use XPNTR rather than XHASH, so that the high-order bits of
21567 the pointer aren't lost when converting through void *.
21568
21569 * eval.c (Fautoload): Don't double-shift a pointer.
21570
21571 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21572
21573 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21574
21575 * gnutls.c (DEF_GNUTLS_FN):
21576 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21577
21578 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21579
21580 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21581 marker. (Bug#8610)
21582
21583 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21584
21585 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21586 New version that can reserve upto 2GB of heap space.
21587
21588 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21589
21590 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21591
21592 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21593
21594 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21595 `gnutls_certificate_set_x509_key_file'.
21596
21597 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21598
21599 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21600 Update dependencies.
21601
21602 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21603
21604 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21605 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21606 Remove unused parameter `fildes'.
21607 * process.c (read_process_output, send_process): Don't pass it.
21608
21609 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21610
21611 Fix previous change: the library cache is defined in w32.c.
21612 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21613 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21614
21615 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21616
21617 Implement dynamic loading of GnuTLS on Windows.
21618
21619 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21620 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21621 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21622 Declare.
21623
21624 * gnutls.c (Qgnutls_dll): Define.
21625 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21626 (gnutls_*): Declare function pointers.
21627 (init_gnutls_functions): New function to initialize function pointers.
21628 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21629 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21630 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21631 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21632 (emacs_gnutls_write, emacs_gnutls_read)
21633 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21634 (Fgnutls_available_p): New function.
21635 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21636 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21637 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21638
21639 * image.c: Include w32.h.
21640 (Vimage_type_cache): Delete.
21641 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21642 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21643 (w32_delayed_load): Move to w32.c.
21644
21645 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21646
21647 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21648 (w32_delayed_load): Move from image.c. When loading a library, record
21649 its filename in the :loaded-from property of the library id.
21650 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21651 Initialize and staticpro them.
21652 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21653
21654 * process.c: Include lisp.h before w32.h, not after.
21655 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21656 instead of gnutls_record_check_pending.
21657
21658 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21659
21660 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21661
21662 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21663 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21664 as passed in.
21665
21666 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21667
21668 * xterm.c (x_set_frame_alpha): Do not set property on anything
21669 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21670
21671 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21672
21673 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21674
21675 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21676
21677 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21678 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21679 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21680 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21681 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21682 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21683 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21684 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21685 (Qgnutls_bootprop_callbacks_verify): Make static.
21686
21687 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21688
21689 * callproc.c: Indentation fixup.
21690
21691 * sysdep.c (wait_for_termination_1): Make static.
21692 (wait_for_termination, interruptible_wait_for_termination):
21693 Move after wait_for_termination_1.
21694
21695 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21696
21697 * sysdep.c (interruptible_wait_for_termination): New function
21698 which is like wait_for_termination, but allows keyboard
21699 interruptions.
21700
21701 * callproc.c (Fcall_process): Add (:file "file") as an option for
21702 the STDOUT buffer.
21703 (Fcall_process_region): Ditto.
21704
21705 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21706
21707 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21708 rather than `XVECTOR (FOO)->size'.
21709
21710 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21711 inttypes.h, as a gnulib replacement is used if it not available in
21712 system headers.
21713
21714 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21715
21716 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21717 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21718 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21719
21720 * coding.c (coding_alloc_by_realloc): Error out if destination
21721 will grow beyond MOST_POSITIVE_FIXNUM.
21722 (decode_coding_emacs_mule): Abort if there isn't enough place in
21723 charbuf for the composition carryover bytes. Reserve an extra
21724 space for up to 2 characters produced in a loop.
21725 (decode_coding_iso_2022): Abort if there isn't enough place in
21726 charbuf for the composition carryover bytes.
21727
21728 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21729
21730 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21731 aborting when %lld or %lll format is passed.
21732 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21733 %llo or %llx format is passed. (Bug#8545)
21734
21735 * window.c (window_scroll_line_based): Use a marker instead of
21736 simple variables to record original value of point. (Bug#7952)
21737
21738 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21739 produced by %s or %c overflows available buffer space. (Bug#8545)
21740
21741 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21742
21743 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21744 (SIZE_MAX): Move defn after all includes, as they might #define it.
21745
21746 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21747
21748 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21749
21750 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21751
21752 * keyboard.c (Qdelayed_warnings_hook): Define.
21753 (command_loop_1): Run `delayed-warnings-hook'
21754 if Vdelayed_warnings_list is non-nil.
21755 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21756 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21757
21758 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21759
21760 * doprnt.c (doprnt): Don't return value smaller than the buffer
21761 size if the message was truncated. (Bug#8545).
21762
21763 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21764
21765 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21766 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21767
21768 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21769
21770 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21771
21772 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21773
21774 * makefile.w32-in: Update dependencies.
21775
21776 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21777
21778 Improve `doprnt' and its usage. (Bug#8545)
21779 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21780 `format_end'. Remove support for %l as a conversion specifier.
21781 Don't use xrealloc. Improve diagnostics when the %l size modifier
21782 is used. Update the commentary.
21783
21784 * eval.c (verror): Simplify calculation of size_t.
21785
21786 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21787 messages.
21788
21789 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21790
21791 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21792 change.
21793
21794 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21795
21796 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21797 This makes this file independent of the recent pseudovector change.
21798
21799 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21800
21801 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21802
21803 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21804 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21805 Remove unused local.
21806 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21807
21808 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21809 GCC 4.6.0 optimizes based on type-based alias analysis.
21810 For example, if b is of type struct buffer * and v of type struct
21811 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21812 != &v->size, and therefore "v->size = 1; b->size = 2; return
21813 v->size;" must therefore return 1. This assumption is incorrect
21814 for Emacs, since it type-puns struct Lisp_Vector * with many other
21815 types. To fix this problem, this patch adds a new type struct
21816 vectorlike_header that documents the constraints on layout of vectors
21817 and pseudovectors, and helps optimizing compilers not get fooled
21818 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21819 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21820 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21821 the size member.
21822 (XSETPVECTYPE): Rewrite in terms of new macro.
21823 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21824 This is a bit clearer, and further avoids the possibility of
21825 undesirable aliasing.
21826 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21827 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21828 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21829 since Lisp_Subr is a special case (no "next" field).
21830 (ASIZE): Now uses header.size rather than size.
21831 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21832 to avoid the hassle of writing XVECTOR (foo)->header.size.
21833 (struct vectorlike_header): New type.
21834 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21835 object, to help avoid aliasing.
21836 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21837 (SUBRP): Likewise, since Lisp_Subr is a special case.
21838 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21839 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21840 (struct Lisp_Hash_Table): Combine first two members into a single
21841 struct vectorlike_header member. All uses of "size" and "next" members
21842 changed to be "header.size" and "header.next".
21843 * buffer.h (struct buffer): Likewise.
21844 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21845 * frame.h (struct frame): Likewise.
21846 * process.h (struct Lisp_Process): Likewise.
21847 * termhooks.h (struct terminal): Likewise.
21848 * window.c (struct save_window_data, struct saved_window): Likewise.
21849 * window.h (struct window): Likewise.
21850 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21851 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21852 * buffer.c (init_buffer_once): Likewise.
21853 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21854 special case.
21855 * process.c (Fformat_network_address): Use local var for size,
21856 for brevity.
21857
21858 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21859
21860 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21861 * data.c (atof): Remove decl; no longer used or needed.
21862 (digit_to_number): Move to lread.c.
21863 (Fstring_to_number): Use new string_to_number function, to be
21864 consistent with how the Lisp reader treats infinities and NaNs.
21865 Do not assume that floating-point numbers represent EMACS_INT
21866 without losing information; this is not true on most 64-bit hosts.
21867 Avoid double-rounding errors, by insisting on integers when
21868 parsing non-base-10 numbers, as the documentation specifies.
21869 * lisp.h (string_to_number): New decl, replacing ...
21870 (isfloat_string): Remove.
21871 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21872 (read1): Do not accept +. and -. as integers; this
21873 appears to have been a coding error. Similarly, do not accept
21874 strings like +-1e0 as floating point numbers. Do not report
21875 overflow for integer overflows unless the base is not 10 which
21876 means we have no simple and reliable way to continue.
21877 Break out the floating-point parsing into a new
21878 function string_to_number, so that Fstring_to_number parses
21879 floating point numbers consistently with the Lisp reader.
21880 (digit_to_number): Move here from data.c. Make it static inline.
21881 (E_CHAR, EXP_INT): Remove, replacing with ...
21882 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21883 (string_to_number): New function, replacing isfloat_string.
21884 This function checks for valid syntax and produces the resulting
21885 Lisp float number too. Rework it so that string-to-number
21886 no longer mishandles examples like "1.0e+". Use strtoumax,
21887 so that overflow for non-base-10 numbers is reported only when
21888 there's no portable and simple way to convert to floating point.
21889
21890 * textprop.c (set_text_properties_1): Rewrite for clarity,
21891 and to avoid GCC warning about integer overflow.
21892
21893 * intervals.h (struct interval): Use EMACS_INT for members
21894 where EMACS_UINT might cause problems. See
21895 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21896 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21897 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21898 All uses changed.
21899 (offset_intervals): Tell GCC not to worry about length overflow
21900 when negating a negative length.
21901
21902 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21903 (overrun_check_free): Likewise.
21904
21905 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21906 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21907 word size.
21908
21909 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21910 (gnutls_make_error): Rename local to avoid shadowing.
21911 (gnutls_emacs_global_deinit): ifdef out; not used.
21912 (Fgnutls_boot): Use const for pointer to readonly storage.
21913 Comment out unused local. Fix pointer signedness problems.
21914
21915 * lread.c (openp): Don't stuff size_t into an 'int'.
21916 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21917 about possible signed overflow.
21918
21919 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21920 (GDK_KEY_g): Don't define if already defined.
21921 (xg_prepare_tooltip): Avoid pointer signedness problem.
21922 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21923
21924 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21925 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21926
21927 * xfns.c (Fx_window_property): Simplify a bit,
21928 to make a bit faster and to avoid GCC 4.6.0 warning.
21929 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21930
21931 * fns.c (internal_equal): Don't assume size_t fits in int.
21932
21933 * alloc.c (compact_small_strings): Tighten assertion a little.
21934
21935 Replace pEd with more-general pI, and fix some printf arg casts.
21936 * lisp.h (pI): New macro, generalizing old pEd macro to other
21937 conversion specifiers. For example, use "...%"pI"d..." rather
21938 than "...%"pEd"...".
21939 (pEd): Remove. All uses replaced with similar uses of pI.
21940 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21941 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21942 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21943 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21944 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21945 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21946 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21947 64-bit hosts.
21948 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21949 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21950 * print.c (safe_debug_print, print_object): Likewise.
21951 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21952 to int.
21953 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21954 avoiding the 0 flag, which is not portable.
21955 * process.c (Fmake_network_process): Use pI to avoid cast.
21956 * region-cache.c (pp_cache): Likewise.
21957 * xdisp.c (decode_mode_spec): Likewise.
21958 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21959 behavior on 64-bit hosts with printf arg.
21960 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21961 (x_stop_queuing_selection_requests): Likewise.
21962 (x_get_window_property): Don't truncate byte count to an 'int'
21963 when tracing.
21964
21965 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21966 here, since it parses constructs like leading '-' and spaces,
21967 which are not wanted; and it overflows with large numbers.
21968 Instead, simply match F[0-9]+, which is what is wanted anyway.
21969
21970 * alloc.c: Remove unportable assumptions about struct layout.
21971 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21972 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21973 (allocate_vectorlike, make_pure_vector): Use the new macros,
21974 plus offsetof, to remove unportable assumptions about struct layout.
21975 These assumptions hold on all porting targets that I know of, but
21976 they are not guaranteed, they're easy to remove, and removing them
21977 makes further changes easier.
21978
21979 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21980 This doesn't fix a bug but makes the code clearer.
21981 (string_overrun_cookie): Now const. Use initializers that
21982 don't formally overflow signed char, to avoid warnings.
21983 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21984 can cause Emacs to crash when string overrun checking is enabled.
21985 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21986 multiple of sizeof (EMACS_INT); it need not be, if
21987 alignof(EMACS_INT) < sizeof (EMACS_INT).
21988 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21989
21990 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21991
21992 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21993
21994 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21995
21996 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21997 supposed to be handshaking. (Bug#8556)
21998 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21999
22000 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
22001
22002 * lisp.h (Qdebug): List symbol.
22003 * eval.c (Qdebug): Restore global linkage.
22004 * keyboard.c (debug-on-event): New variable.
22005 (handle_user_signal): Break into debugger when debug-on-event
22006 matches the current signal symbol.
22007
22008 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22009
22010 * alloc.c (check_sblock, check_string_bytes)
22011 (check_string_free_list): Convert to standard C.
22012
22013 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22014
22015 * w32.c (emacs_gnutls_push): Fix typo.
22016
22017 2011-04-25 Eli Zaretskii <eliz@gnu.org>
22018
22019 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22020 "cast to pointer from integer of different size".
22021
22022 Improve doprnt and its use in verror. (Bug#8545)
22023 * doprnt.c (doprnt): Document the set of format control sequences
22024 supported by the function. Use SAFE_ALLOCA instead of always
22025 using `alloca'.
22026
22027 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22028 is one byte too soon. Don't use xrealloc; instead xfree and
22029 xmalloc anew.
22030
22031 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22032
22033 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22034 callbacks stage.
22035
22036 * gnutls.c: Renamed global_initialized to
22037 gnutls_global_initialized. Added internals for the
22038 :verify-hostname-error, :verify-error, and :verify-flags
22039 parameters of `gnutls-boot' and documented those parameters in the
22040 docstring. Start callback support.
22041 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22042 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22043 on error. Return error code.
22044 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22045 (emacs_gnutls_read): Likewise.
22046 (Fgnutls_boot): Return handshake error code.
22047 (emacs_gnutls_handle_error): New function.
22048 (wsaerror_to_errno): Likewise.
22049
22050 * w32.h (emacs_gnutls_pull): Add prototype.
22051 (emacs_gnutls_push): Likewise.
22052
22053 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22054 (emacs_gnutls_push): Likewise.
22055
22056 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22057
22058 * process.c (wait_reading_process_output): Check if GnuTLS
22059 buffered some data internally if no FDs are set for TLS
22060 connections.
22061
22062 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22063 (LIBS): Link to USER_LIBS.
22064 ($(BLD)/gnutls.$(0)): New target.
22065
22066 2011-04-24 Eli Zaretskii <eliz@gnu.org>
22067
22068 * xdisp.c (handle_single_display_spec): Rename the
22069 display_replaced_before_p argument into display_replaced_p, to
22070 make it consistent with the commentary. Fix typos in the
22071 commentary.
22072
22073 * textprop.c (syms_of_textprop): Remove dead code.
22074 (copy_text_properties): Delete obsolete commentary about an
22075 interface that was deleted long ago. Fix typos in the description
22076 of arguments.
22077
22078 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22079 to changes in oldXMenu/XMenu.h from 2011-04-16.
22080 <menu_help_message, prev_menu_help_message>: Constify.
22081 (IT_menu_make_room): menu->help_text is now `const char **';
22082 adjust.
22083
22084 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22085 to changes in oldXMenu/XMenu.h from 2011-04-16.
22086 (struct XMenu): Declare `help_text' `const char **'.
22087
22088 * xfaces.c <Qunspecified>: Make extern again.
22089
22090 * syntax.c: Include sys/types.h before including regex.h, as
22091 required by POSIX.
22092
22093 * doc.c (get_doc_string): Improve the format passed to `error'.
22094
22095 * doprnt.c (doprnt): Improve commentary.
22096
22097 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22098
22099 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22100 them with etags.
22101
22102 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22103 changes in globals.h immediately force recompilation.
22104 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22105 $(CURDIR)/s/ms-w32.h.
22106 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22107
22108 * character.c (Fchar_direction): Function deleted.
22109 (syms_of_character): Don't defsubr it.
22110 <char-direction-table>: Deleted.
22111
22112 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22113
22114 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22115 * doprnt.c: Include limits.h.
22116 (SIZE_MAX): New macro.
22117 (doprnt): Return a size_t value. 2nd arg is now size_t.
22118 Many local variables are now size_t instead of int or unsigned.
22119 Improve overflow protection. Support `l' modifier for integer
22120 conversions. Support %l conversion. Don't assume an EMACS_INT
22121 argument for integer conversions and for %c.
22122
22123 * lisp.h (doprnt): Restore prototype.
22124
22125 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22126 $(SRC)/character.h.
22127
22128 * Makefile.in (base_obj): Add back doprnt.o.
22129
22130 * deps.mk (doprnt.o): Add back prerequisites.
22131 (callint.o): Depend on character.h.
22132
22133 * eval.c (internal_lisp_condition_case): Include the handler
22134 representation in the error message.
22135 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22136 when breaking from the loop.
22137
22138 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22139
22140 * callint.c (Fcall_interactively): When displaying error message
22141 about invalid control letter, pass the character's codepoint, not
22142 a pointer to its multibyte form. Improve display of the character
22143 in octal and display also its hex code.
22144
22145 * character.c (char_string): Use %x to display the (unsigned)
22146 codepoint of an invalid character, to avoid displaying a bogus
22147 negative value.
22148
22149 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22150 `error', not SYMBOL_NAME itself.
22151
22152 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22153 character arguments to `error'.
22154
22155 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22156 to `error' in error message about FINAL_CHAR argument. Make sure
22157 FINAL_CHAR is a character, and use %c when it is passed as
22158 argument to `error'.
22159
22160 2011-04-23 Eli Zaretskii <eliz@gnu.org>
22161
22162 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22163
22164 * w32.c: Include <time.h>.
22165 (sys_localtime): New function.
22166
22167 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22168
22169 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22170
22171 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22172
22173 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22174
22175 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22176 zombies (Bug#8467).
22177
22178 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22179
22180 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22181 gl_state.e_property when gl_state.object is Qt.
22182
22183 * insdel.c (make_gap_larger): Remove limitation of buffer size
22184 to <= INT_MAX.
22185
22186 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22187
22188 * xdisp.c (lookup_glyphless_char_display)
22189 (produce_glyphless_glyph): Handle cons cell entry in
22190 glyphless-char-display.
22191 (Vglyphless_char_display): Document it.
22192
22193 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22194 glyphless-char-display.
22195
22196 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22197
22198 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22199
22200 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22201
22202 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22203 definition for no-X builds.
22204
22205 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22206
22207 Static checks with GCC 4.6.0 and non-default toolkits.
22208
22209 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22210
22211 * process.c (keyboard_bit_set): Define only if SIGIO.
22212 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22213 (send_process): Repair possible setjmp clobbering.
22214
22215 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22216
22217 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22218
22219 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22220
22221 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22222 Define only if needed.
22223
22224 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22225 by pacifying GCC about it. Maybe it's time to retire it?
22226 * xfaces.c (USG, __TIMEVAL__): Likewise.
22227
22228 * dispextern.h (struct redisplay_interface): Rename param
22229 to avoid shadowing.
22230 * termhooks.h (struct terminal): Likewise.
22231 * xterm.c (xembed_send_message): Likewise.
22232
22233 * insdel.c (make_gap_smaller): Define only if
22234 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22235
22236 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22237 it.
22238
22239 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22240 so that we aren't warned about unused symbols.
22241
22242 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22243
22244 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22245
22246 * xfns.c (x_real_positions): Mark locals as initialized.
22247
22248 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22249
22250 * xterm.c: Fix problems found by static analysis with other toolkits.
22251 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22252 (x_dispatch_event): Declare static if USE_GTK, and
22253 define if USE_GTK || USE_X_TOOLKIT.
22254 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22255 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22256 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22257 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22258
22259 * xmenu.c (menu_help_callback): Pointer type fixes.
22260 Use const pointers when pointing at readonly data. Avoid pointer
22261 signedness clashes.
22262 (FALSE): Remove unused macro.
22263 (update_frame_menubar): Remove unused decl.
22264
22265 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22266
22267 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22268 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22269 (single_menu_item): Rename local to avoid shadowing.
22270
22271 * keyboard.c (make_lispy_event): Remove unused local var.
22272
22273 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22274 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22275
22276 * bitmaps: Change bitmaps from unsigned char back to the X11
22277 compatible char. Avoid the old compiler warnings about
22278 out-of-range initializers by using, for example, '\xab' rather
22279 than 0xab.
22280
22281 * xgselect.c (xgselect_initialize): Check vs interface
22282 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22283
22284 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22285
22286 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22287 to read-only memory.
22288
22289 * fns.c (vector): Remove; this old hack is no longer needed.
22290
22291 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22292 Remove unused var.
22293 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22294
22295 * xrdb.c (x_load_resources): Omit unused local.
22296
22297 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22298 (x_window): Rename locals to avoid shadowing.
22299 (USG): Use the kludged USG macro, to pacify gcc.
22300
22301 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22302 (x_term_init): Remove local to avoid shadowing.
22303
22304 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22305
22306 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22307 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22308
22309 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22310
22311 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22312
22313 Fix regex.c, syntax.c and friends for buffers > 2GB.
22314 * syntax.h (struct gl_state_s): Declare character position members
22315 EMACS_INT.
22316
22317 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22318
22319 * textprop.c (verify_interval_modification, interval_of):
22320 Declare arguments EMACS_INT.
22321
22322 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22323 EMACS_INT.
22324
22325 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22326
22327 * indent.c (Fvertical_motion): Local variable it_start is now
22328 EMACS_INT.
22329
22330 * regex.c (re_match, re_match_2, re_match_2_internal)
22331 (bcmp_translate, regcomp, regexec, print_double_string)
22332 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22333 (re_compile_pattern, re_exec): Declare arguments and local
22334 variables `size_t' and `ssize_t' and return values `regoff_t', as
22335 appropriate.
22336 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22337 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22338 <compile_stack_type>: `size' and `avail' are now `size_t'.
22339
22340 * regex.h <regoff_t>: Use ssize_t, not int.
22341 (re_search, re_search_2, re_match, re_match_2): Arguments that
22342 specify buffer/string position and length are now ssize_t and
22343 size_t. Return type is regoff_t.
22344
22345 2011-04-16 Ben Key <bkey76@gmail.com>
22346
22347 * nsfont.m: Fixed bugs in ns_get_family and
22348 ns_descriptor_to_entity that were caused by using free to
22349 deallocate memory blocks that were allocated by xmalloc (via
22350 xstrdup). This caused Emacs to crash when compiled with
22351 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22352 --enable-checking=xmallocoverrun). xfree is now used to
22353 deallocate these memory blocks.
22354
22355 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22356
22357 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22358
22359 emacs_write: Accept and return EMACS_INT for sizes.
22360 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22361 et seq.
22362 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22363 Accept and return EMACS_INT.
22364 (emacs_gnutls_write): Return the number of bytes written on
22365 partial writes.
22366 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22367 (emacs_read, emacs_write): Remove check for negative size, as the
22368 Emacs source code has been audited now.
22369 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22370 (emacs_read, emacs_write): Use it.
22371 * process.c (send_process): Adjust to the new signatures of
22372 emacs_write and emacs_gnutls_write. Do not attempt to store
22373 a byte offset into an 'int'; it might overflow.
22374 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22375
22376 * sound.c: Don't assume sizes fit in 'int'.
22377 (struct sound_device.period_size, alsa_period_size):
22378 Return EMACS_INT, not int.
22379 (struct sound_device.write, vox_write, alsa_write):
22380 Accept EMACS_INT, not int.
22381 (wav_play, au_play): Use EMACS_INT to store sizes and to
22382 record read return values.
22383
22384 2011-04-15 Ben Key <bkey76@gmail.com>
22385
22386 * keyboard.c (Qundefined): Don't declare static since it is used
22387 in nsfns.m.
22388 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22389 static since they are used in nsfont.m.
22390
22391 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22392
22393 * process.c (Qprocessp): Don't declare static.
22394 * lisp.h (Qprocessp): Declare again.
22395
22396 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22397
22398 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22399
22400 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22401
22402 Improve C-level modularity by making more things 'static'.
22403
22404 Don't publish debugger-only interfaces to other modules.
22405 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22406 (verify_bytepos, count_markers): Move decls to the only modules
22407 that need them.
22408 * region-cache.h (pp_cache): Likewise.
22409 * window.h (check_all_windows): Likewise.
22410 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22411
22412 * sysdep.c (croak): Now static, if
22413 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22414 * syssignal.h (croak): Declare only if not static.
22415
22416 * alloc.c (refill_memory_reserve): Now static if
22417 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22418 * lisp.h (refill_memory_reserve): Declare only if not static.
22419
22420 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22421 Define only if USE_LUCID.
22422
22423 * xrdb.c (x_customization_string, x_rm_string): Now static.
22424
22425 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22426 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22427
22428 * xdisp.c (draw_row_with_mouse_face): Now static.
22429 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22430
22431 * window.h (check_all_windows): Mark externally visible.
22432
22433 * window.c (window_deletion_count): Now static.
22434
22435 * undo.c: Make symbols static if they're not exported.
22436 (last_undo_buffer, last_boundary_position, pending_boundary):
22437 Now static.
22438
22439 * textprop.c (interval_insert_behind_hooks): Now static.
22440 (interval_insert_in_front_hooks): Likewise.
22441
22442 * term.c: Make symbols static if they're not exported.
22443 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22444 (max_frame_lines, tty_set_terminal_modes):
22445 (tty_reset_terminal_modes, tty_turn_off_highlight):
22446 (get_tty_terminal): Now static.
22447 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22448 * termhooks.h (term_mouse_moveto): Do not declare if
22449 HAVE_WINDOW_SYSTEM.
22450 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22451 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22452
22453 * sysdep.c: Make symbols static if they're not exported.
22454 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22455 Now static.
22456 (sigprocmask_set, full_mask): Remove; unused.
22457 (wait_debugging): Mark as visible.
22458 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22459 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22460
22461 * syntax.c (syntax_temp): Define only if !__GNUC__.
22462
22463 * sound.c (current_sound_device, current_sound): Now static.
22464
22465 * search.c (searchbufs, searchbuf_head): Now static.
22466
22467 * scroll.c (scroll_cost): Remove; unused.
22468 * dispextern.h (scroll_cost): Remove decl.
22469
22470 * region-cache.h (pp_cache): Mark as externally visible.
22471
22472 * process.c: Make symbols static if they're not exported.
22473 (process_tick, update_tick, create_process, chan_process):
22474 (Vprocess_alist, proc_buffered_char, datagram_access):
22475 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22476 (deactivate_process): Mark defn as static, as well as decl.
22477 * lisp.h (create_process): Remove decl.
22478 * process.h (chan_process, Vprocess_alist): Remove decls.
22479
22480 * print.c: Make symbols static if they're not exported.
22481 (print_depth, new_backquote_output, being_printed, print_buffer):
22482 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22483 (print_interval, print_number_index, initial_stderr_stream):
22484 Now static.
22485 * lisp.h (Fprinc): Remove decl.
22486 (debug_output_compilation_hack): Mark as externally visible.
22487
22488 * sysdep.c (croak): Move decl from here to syssignal.h.
22489 * syssignal.h (croak): Put it here, so the API can be checked when
22490 'croak' is called from dissociate_if_controlling_tty.
22491
22492 * minibuf.c: Make symbols static if they're not exported.
22493 (minibuf_save_list, choose_minibuf_frame): Now static.
22494 * lisp.h (choose_minibuf_frame): Remove decl.
22495
22496 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22497
22498 * lread.c: Make symbols static if they're not exported.
22499 (read_objects, initial_obarray, oblookup_last_bucket_number):
22500 Now static.
22501 (make_symbol): Remove; unused.
22502 * lisp.h (initial_obarray, make_symbol): Remove decls.
22503
22504 * keyboard.c: Make symbols static if they're not exported.
22505 (single_kboard, recent_keys_index, total_keys, recent_keys):
22506 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22507 (this_single_command_key_start, echoing, last_auto_save):
22508 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22509 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22510 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22511 (Vlispy_mouse_stem, double_click_count):
22512 Now static.
22513 (force_auto_save_soon): Define only if SIGDANGER.
22514 (ignore_mouse_drag_p): Now static if
22515 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22516 (print_help): Remove; unused.
22517 (stop_character, last_timer_event): Mark as externally visible.
22518 * keyboard.h (ignore_mouse_drag_p): Declare only if
22519 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22520 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22521 * lisp.h (echoing): Remove decl.
22522 (force_auto_save_soon): Declare only if SIGDANGER.
22523 * xdisp.c (redisplay_window): Simplify code, to make it more
22524 obvious that ignore_mouse_drag_p is not accessed if !defined
22525 USE_GTK && !defined HAVE_NS.
22526
22527 * intervals.c: Make symbols static if they're not exported.
22528 (merge_properties_sticky, merge_interval_right, delete_interval):
22529 Now static.
22530 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22531
22532 * insdel.c: Make symbols static if they're not exported.
22533 However, leave prepare_to_modify_buffer alone. It's never
22534 called from outside this function, but that appears to be a bug.
22535 (combine_after_change_list, combine_after_change_buffer):
22536 (adjust_after_replace, signal_before_change): Now static.
22537 (adjust_after_replace_noundo): Remove; unused.
22538 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22539 (signal_before_change): Remove decls.
22540
22541 * indent.c (val_compute_motion, val_vmotion): Now static.
22542
22543 * image.c: Make symbols static if they're not exported.
22544 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22545 if USE_GTK.
22546 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22547 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22548
22549 * fringe.c (standard_bitmaps): Now static.
22550 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22551
22552 * frame.c: Make symbols static if they're not exported.
22553 (x_report_frame_params, make_terminal_frame): Now static.
22554 (get_frame_param): Now static, unless HAVE_NS.
22555 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22556 (x_get_resource_string): Remove; not used.
22557 * frame.h (make_terminal_frame, x_report_frame_params):
22558 (x_get_resource_string); Remove decls.
22559 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22560 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22561
22562 * font.c, fontset.c: Make symbols static if they're not exported.
22563 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22564 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22565 * font.c (font_close_object): Now static.
22566 * font.h (font_close_object): Remove.
22567 * fontset.c (FONTSET_OBJLIST): Remove.
22568 (free_realized_fontset) #if-0 the body, which does nothing.
22569 (face_suitable_for_char_p): #if-0, as it's never called.
22570 * fontset.h (face_suitable_for_char_p): Remove decl.
22571 * xfaces.c (face_at_string_position):
22572 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22573 since 0 is always ASCII.
22574
22575 * fns.c (weak_hash_tables): Now static.
22576
22577 * fileio.c: Make symbols static if they're not exported.
22578 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22579 (Vwrite_region_annotation_buffers): Now static.
22580
22581 * eval.c: Make symbols static if they're not exported.
22582 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22583 * lisp.h (backtrace_list): Remove decl.
22584
22585 * emacs.c: Make symbols static if they're not exported.
22586 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22587 (fatal_error_code, fatal_error_signal_hook, standard_args):
22588 Now static.
22589 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22590 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22591 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22592 * lisp.h (fatal_error_signal_hook): Remove decl.
22593 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22594
22595 * editfns.c: Move a (normally-unused) function to its only use.
22596 * editfns.c, lisp.h (get_operating_system_release): Remove.
22597 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22598 worth the hassle of breaking this out.
22599
22600 * xterm.c: Make symbols static if they're not exported.
22601 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22602 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22603 (x_destroy_window, x_delete_display):
22604 Now static.
22605 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22606 (x_mouse_leave): Remove; unused.
22607 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22608 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22609 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22610 Remove decls.
22611 (x_mouse_leave): Declare only if WINDOWSNT.
22612 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22613 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22614 USE_X_TOOLKIT.
22615
22616 * ftxfont.c: Make symbols static if they're not exported.
22617 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22618 HAVE_FREETYPE.
22619 * font.h (ftxfont_driver): Likewise.
22620
22621 * xfns.c: Make symbols static if they're not exported.
22622 (x_last_font_name, x_display_info_for_name):
22623 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22624 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22625 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22626 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22627 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22628 (last_show_tip_args): Now static.
22629 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22630 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22631 (x_screen_planes): Remove; unused.
22632 * dispextern.h (x_screen_planes): Remove decl.
22633
22634 * dispnew.c: Make symbols static if they're not exported.
22635 * dispextern.h (redraw_garbaged_frames, scrolling):
22636 (increment_row_positions): Remove.
22637 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22638 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22639 Now static.
22640 (redraw_garbaged_frames): Remove; unused.
22641
22642 * xfaces.c: Make symbols static if they're not exported.
22643 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22644 Remove decls.
22645 * xterm.h (defined_color): Remove decls.
22646 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22647 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22648 (menu_face_changed_default, defined_color, free_realized_face):
22649 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22650 (ascii_face_of_lisp_face): Remove; unused.
22651
22652 * xdisp.c: Make symbols static if they're not exported.
22653 * dispextern.h (scratch_glyph_row, window_box_edges):
22654 (glyph_to_pixel_coords, set_cursor_from_row):
22655 (get_next_display_element, set_iterator_to_next):
22656 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22657 (show_mouse_face): Remove decls
22658 * frame.h (message_buf_print): Likewise.
22659 * lisp.h (pop_message, set_message, check_point_in_composition):
22660 Likewise.
22661 * xterm.h (set_vertical_scroll_bar): Likewise.
22662 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22663 (message_buf_print, scratch_glyph_row, displayed_buffer):
22664 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22665 (get_next_display_element, show_mouse_face, window_box_edges):
22666 (frame_to_window_pixel_xy, check_point_in_composition):
22667 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22668 (glyph_to_pixel_coords): Remove; unused.
22669
22670 * dired.c (file_name_completion): Now static.
22671
22672 * dbusbind.c (xd_in_read_queued_messages): Now static.
22673
22674 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22675 * data.c (circular_list_error): Remove.
22676
22677 * commands.h (last_point_position, last_point_position_buffer):
22678 (last_point_position_window): Remove decls.
22679 * keyboard.c: Make these variables static.
22680
22681 * coding.h (coding, code_convert_region, encode_coding_gap):
22682 Remove decls.
22683 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22684 (iso_code_class, detect_coding, code_convert_region): Now static.
22685 (encode_coding_gap): Remove; unused.
22686
22687 * chartab.c (chartab_chars, chartab_bits): Now static.
22688
22689 * charset.h (charset_iso_8859_1): Remove decl.
22690 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22691 Now static.
22692
22693 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22694 * ccl.c (Vccl_program_table): Now static.
22695 (check_ccl_update): Remove; unused.
22696
22697 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22698 * category.h: ... from here.
22699 * category.c (check_category_table, set_category_set): Now static.
22700
22701 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22702 * lisp.h: Remove these decls.
22703
22704 * buffer.c (buffer_count): Remove unused var.
22705
22706 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22707 so that it's not optimized away.
22708 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22709 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22710 exported only to the debugger.
22711
22712 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22713 * atimer.h (run_all_atimers): Remove; not exported.
22714
22715 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22716 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22717 was inaccessible from Lisp.
22718 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22719 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22720
22721 alloc.c: Import and export fewer symbols, and remove unused items.
22722 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22723 is defined.
22724 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22725 it's not optimized away by whole-program optimization.
22726 (message_enable_multibyte, free_misc): Remove.
22727 (catchlist, handlerlist, mark_backtrace):
22728 Declare only if BYTE_MARK_STACK.
22729 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22730 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22731 (message_enable_multibyte): Remove decl.
22732 (free_misc, interval_free_list, float_block, float_block_index):
22733 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22734 (cons_free_list, last_marked_index):
22735 Now static.
22736 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22737 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22738 (mark_backtrace): Define only if BYTE_MARK_STACK.
22739 * xdisp.c (message_enable_multibyte): Now static.
22740
22741 Declare Lisp_Object Q* variables to be 'static' if not exported.
22742 This makes it easier for human readers (and static analyzers)
22743 to see whether these variables are used from other modules.
22744 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22745 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22746 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22747 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22748 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22749 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22750 * xmenu.c, xselect.c:
22751 Declare Q* vars static if they are not used in other modules.
22752 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22753 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22754 Remove decls of unexported vars.
22755 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22756
22757 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22758
22759 Make Emacs functions such as Fatom 'static' by default.
22760 This makes it easier for human readers (and static analyzers)
22761 to see whether these functions can be called from other modules.
22762 DEFUN now defines a static function. To make the function external
22763 so that it can be used in other C modules, use the new macro DEFUE.
22764 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22765 (Finit_image_library):
22766 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22767 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22768 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22769 Remove decls, since these functions are now static.
22770 (Funintern, Fget_internal_run_time): New decls, since these functions
22771 were already external.
22772
22773 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22774 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22775 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22776 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22777 * keyboard.c, keymap.c, lread.c:
22778 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22779 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22780 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22781 Mark functions with DEFUE instead of DEFUN,
22782 if they are used in other modules.
22783 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22784 decls for now-static functions.
22785 * buffer.h (Fdelete_overlay): Remove decl.
22786 * callproc.c (Fgetenv_internal): Mark as internal.
22787 * composite.c (Fremove_list_of_text_properties): Remove decl.
22788 (Fcomposition_get_gstring): New forward static decl.
22789 * composite.h (Fcomposite_get_gstring): Remove decl.
22790 * dired.c (Ffile_attributes): New forward static decl.
22791 * doc.c (Fdocumntation_property): New forward static decl.
22792 * eval.c (Ffetch_bytecode): New forward static decl.
22793 (Funintern): Remove extern decl; now in .h file where it belongs.
22794 * fileio.c (Fmake_symbolic_link): New forward static decl.
22795 * image.c (Finit_image_library): New forward static decl.
22796 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22797 * intervals.h (Fprevious_property_change):
22798 (Fremove_list_of_text_properties): Remove decls.
22799 * keyboard.c (Fthis_command_keys): Remove decl.
22800 (Fcommand_execute): New forward static decl.
22801 * keymap.c (Flookup_key): New forward static decl.
22802 (Fcopy_keymap): Now static.
22803 * keymap.h (Flookup_key): Remove decl.
22804 * process.c (Fget_process): New forward static decl.
22805 (Fprocess_datagram_address): Mark as internal.
22806 * syntax.c (Fsyntax_table_p): New forward static decl.
22807 (skip_chars): Remove duplicate decl.
22808 * textprop.c (Fprevious_property_change): New forward static decl.
22809 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22810 Now internal.
22811 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22812 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22813
22814 * editfns.c (Fformat): Remove unreachable code.
22815
22816 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22817
22818 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22819 change. (Bug#8496)
22820
22821 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22822
22823 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22824 when at ZV. (Bug#8487)
22825
22826 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22827
22828 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22829 (Bug#8437)
22830 * keyboard.c (parse_tool_bar_item): Likewise.
22831 * sound.c (sound_cleanup, alsa_close): Likewise.
22832 * termcap.c (tgetent): Likewise.
22833 * xfns.c (x_default_font_parameter): Likewise.
22834 * xsettings.c (read_and_apply_settings): Likewise.
22835
22836 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22837 (overrun_check_free): Protoize.
22838
22839 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22840
22841 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22842 since callers should never pass a negative size.
22843 Change the signature to match that of plain 'read' and 'write'; see
22844 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22845 * lisp.h: Update prototypes of emacs_write and emacs_read.
22846
22847 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22848
22849 * xdisp.c (redisplay_window): Don't try to determine the character
22850 position of the scroll margin if the window start point w->startp
22851 is outside the buffer's accessible region. (Bug#8468)
22852
22853 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22854
22855 Fix write-region and its subroutines for buffers > 2GB.
22856 * fileio.c (a_write, e_write): Modify declaration of arguments and
22857 local variables to support buffers larger than 2GB.
22858 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22859
22860 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22861 argument, local variables, and return value.
22862
22863 * lisp.h: Update prototypes of emacs_write and emacs_read.
22864
22865 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22866
22867 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22868
22869 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22870
22871 Fix more problems found by GCC 4.6.0's static checks.
22872
22873 * xdisp.c (vmessage): Use a better test for character truncation.
22874
22875 * charset.c (load_charset_map): <, not <=, for optimization,
22876 and to avoid potential problems with integer overflow.
22877 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22878 * casetab.c (set_identity, shuffle): Likewise.
22879 * editfns.c (Fformat): Likewise.
22880 * syntax.c (skip_chars): Likewise.
22881
22882 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22883 This also lets GCC 4.6.0 generate slightly better loop code.
22884
22885 * callint.c (Fcall_interactively): <, not <=, for optimization.
22886 (Fcall_interactively): Count the number of arguments produced,
22887 not the number of arguments given. This is simpler and lets GCC
22888 4.6.0 generate slightly better code.
22889
22890 * ftfont.c: Distingish more carefully between FcChar8 and char.
22891 The previous code passed unsigned char * to a functions like
22892 strlen and xstrcasecmp that expect char *, which does not
22893 conform to the C standard.
22894 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22895 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22896 char * when the C standard requires it.
22897
22898 * keyboard.c (read_char): Remove unused var.
22899
22900 * eval.c: Port to Windows vsnprintf (Bug#8435).
22901 Include <limits.h>.
22902 (SIZE_MAX): Define if the headers do not.
22903 (verror): Do not give up if vsnprintf returns a negative count.
22904 Instead, grow the buffer. This ports to Windows vsnprintf, which
22905 does not conform to C99. Problem reported by Eli Zaretskii.
22906 Also, simplify the allocation scheme, by avoiding the need for
22907 calling realloc, and removing the ALLOCATED variable.
22908
22909 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22910
22911 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22912 But keep the doprint source code for now, as we might revamp it
22913 and use it again (Bug#8435).
22914 * lisp.h (doprnt): Remove.
22915 * Makefile.in (base_obj): Remove doprnt.o.
22916 * deps.mk (doprnt.o): Remove.
22917
22918 error: Print 32- and 64-bit integers portably (Bug#8435).
22919 Without this change, on typical 64-bit hosts error ("...%d...", N)
22920 was used to print both 32- and 64-bit integers N, which relied on
22921 undefined behavior.
22922 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22923 * lisp.h (error, verror): Mark as printf-like functions.
22924 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22925 Report overflow in size calculations when allocating printf buffer.
22926 Do not truncate output string at its first null byte.
22927 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22928 Truncate the output at a character boundary, since vsnprintf does not
22929 do that.
22930 * charset.c (check_iso_charset_parameter): Convert internal
22931 character to string before calling 'error', since %c now has the
22932 printf meaning.
22933 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22934 overflow when computing char to be passed to 'error'. Do not
22935 pass Lisp_Object to 'error'; pass the integer instead.
22936 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22937 formatted with plain %d.
22938
22939 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22940
22941 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22942
22943 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22944
22945 * xterm.c (x_catch_errors): Remove duplicate declaration.
22946
22947 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22948
22949 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22950
22951 2011-04-10 Jim Meyering <meyering@redhat.com>
22952
22953 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22954 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22955 return ssize_t not "int", and use size_t as the buffer length.
22956 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22957 * gnutls.h: Update declarations.
22958 * process.c (read_process_output): Use ssize_t, to match.
22959 (send_process): Likewise.
22960
22961 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22962
22963 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22964
22965 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22966
22967 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22968 Use unsigned char, to match FcChar8 type definition.
22969
22970 * xterm.c (handle_one_xevent):
22971 * xmenu.c (create_and_show_popup_menu):
22972 * xselect.c (x_decline_selection_request)
22973 (x_reply_selection_request): Avoid type-punned deref of X events.
22974
22975 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22976
22977 Fix some uses of `int' instead of EMACS_INT.
22978 * search.c (string_match_1, fast_string_match)
22979 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22980 (scan_buffer, find_next_newline_no_quit)
22981 (find_before_next_newline, search_command, Freplace_match)
22982 (Fmatch_data): Make some `int' variables be EMACS_INT.
22983
22984 * xdisp.c (display_count_lines): 3rd argument and return value now
22985 EMACS_INT. All callers changed.
22986 (pint2hrstr): Last argument is now EMACS_INT.
22987
22988 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22989 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22990 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22991 (decode_coding_utf_16, decode_coding_emacs_mule)
22992 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22993 (decode_coding_ccl, decode_coding_charset)
22994 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22995 (decode_coding_iso_2022, decode_coding_emacs_mule)
22996 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22997 <char_offset, last_offset>: Declare EMACS_INT.
22998 (encode_coding_utf_8, encode_coding_utf_16)
22999 (encode_coding_emacs_mule, encode_invocation_designation)
23000 (encode_designation_at_bol, encode_coding_iso_2022)
23001 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
23002 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
23003 Declare EMACS_INT.
23004 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
23005 (encode_invocation_designation): Last argument P_NCHARS is now
23006 EMACS_INT.
23007 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
23008 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23009
23010 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23011 All users changed.
23012
23013 * ccl.c (Fccl_execute_on_string): Declare some variables
23014 EMACS_INT.
23015
23016 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23017
23018 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23019
23020 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23021
23022 * process.c (Fformat_network_address): Doc fix.
23023
23024 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23025
23026 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23027
23028 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
23029
23030 * keyboard.c (read_char): Call Lisp function help-form-show,
23031 instead of using internal_with_output_to_temp_buffer.
23032 (Qhelp_form_show): New var.
23033 (syms_of_keyboard): Use DEFSYM macro.
23034
23035 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23036
23037 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23038
23039 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
23040
23041 * process.c (Flist_processes): Remove to Lisp.
23042 (list_processes_1): Delete.
23043
23044 2011-04-06 Eli Zaretskii <eliz@gnu.org>
23045
23046 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23047
23048 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23049
23050 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23051
23052 Fix more problems found by GCC 4.6.0's static checks.
23053
23054 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23055
23056 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23057
23058 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23059
23060 * xdisp.c (vmessage): Mark as a printf-like function.
23061
23062 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23063
23064 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23065
23066 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23067 printf-like functions.
23068 (tiff_load): Add casts to remove these marks before passing them
23069 to system-supplied API.
23070
23071 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23072
23073 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23074 This avoids several warnings with gcc -Wstrict-overflow.
23075 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23076 directly, rather than having caller test rule sign. This avoids
23077 some unnecessary tests.
23078 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23079 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23080 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23081
23082 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23083 (xfont_open): Avoid unnecessary tests.
23084
23085 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23086
23087 * composite.h, composite.c (composition_gstring_put_cache):
23088 Use EMACS_INT, not int, for length.
23089
23090 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23091 breaking out part of COMPOSITION_DECODE_RULE.
23092 (COMPOSITION_DECODE_RULE): Use it.
23093 * composite.c (get_composition_id): Remove unused local vars,
23094 by using the new macro.
23095
23096 * textprop.c (set_text_properties_1): Change while to do-while,
23097 since the condition is always true at first.
23098
23099 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23100 (interval_deletion_adjustment): Return unsigned value.
23101 All uses changed.
23102
23103 * process.c (list_processes_1, create_pty, read_process_output):
23104 (exec_sentinel): Remove vars that were set but not used.
23105 (create_pty): Remove unnecessary "volatile"s.
23106 (Fnetwork_interface_info): Avoid possibility of int overflow.
23107 (read_process_output): Do adaptive read buffering even if carryover.
23108 (read_process_output): Simplify nbytes computation if buffered.
23109
23110 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23111
23112 * syntax.c (scan_words): Remove var that was set but not used.
23113 (update_syntax_table): Use unsigned instead of int.
23114
23115 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23116 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23117 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23118
23119 * print.c (print_error_message): Avoid int overflow.
23120
23121 * font.c (font_list_entities): Redo for clarity,
23122 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23123
23124 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23125 (font_score): Avoid potential overflow in diff calculation.
23126
23127 * fns.c (substring_both): Remove var that is set but not used.
23128 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23129
23130 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23131
23132 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23133 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23134 can always succeed if overflow has undefined behavior.
23135
23136 * search.c (boyer_moore, wordify): Remove vars set but not used.
23137 (wordify): Omit three unnecessary tests.
23138
23139 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23140 All callers changed. This avoids the need for an unused var.
23141
23142 * casefiddle.c (casify_region): Remove var that is set but not used.
23143
23144 * dired.c (file_name_completion): Remove var that is set but not used.
23145
23146 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23147
23148 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23149 (Finsert_file_contents): Remove unnecessary code checking fd.
23150
23151 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23152 Check for integer overflow on size calculations.
23153
23154 * buffer.c (Fprevious_overlay_change): Remove var that is set
23155 but not used.
23156
23157 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23158 Remove vars that are set but not used.
23159 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23160 (timer_check_2): Mark vars as initialized.
23161
23162 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23163
23164 * image.c (lookup_image): Remove var that is set but not used.
23165 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23166
23167 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23168 that are set but not used.
23169
23170 * xfns.c (make_invisible_cursor): Don't return garbage
23171 if XCreateBitmapFromData fails (Bug#8410).
23172
23173 * xselect.c (x_get_local_selection, x_handle_property_notify):
23174 Remove vars that are set but not used.
23175
23176 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23177 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23178
23179 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23180 Remove var that is set but not used.
23181 (scroll_bar_windows_size): Now size_t, not int.
23182 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23183 Check for overflow.
23184
23185 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23186 (map_tty_color) [!defined MSDOS]: Likewise.
23187
23188 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23189
23190 * coding.c: Remove vars that are set but not used.
23191 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23192 All callers changed.
23193 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23194 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23195 (decode_coding_charset): Remove vars that are set but not used.
23196
23197 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23198 that is set but not used.
23199
23200 * print.c (print_object): Remove var that is set but not used.
23201
23202 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23203 The gnulib version avoids calling malloc in the usual case,
23204 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23205 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23206 * filelock.c (current_lock_owner): Likewise.
23207 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23208 * sysdep.c: Include allocator.h, careadlinkat.h.
23209 (emacs_no_realloc_allocator): New static constant.
23210 (emacs_readlink): New function.
23211 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23212 ../lib/careadlinkat.h.
23213
23214 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23215
23216 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23217 first non-nil return value).
23218
23219 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23220
23221 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23222 if not defined (Bug#8403).
23223
23224 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23225
23226 * xdisp.c (display_count_lines): Remove parameter `start',
23227 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23228 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23229 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23230 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23231 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23232 and thereabouts. All callers changed.
23233 (get_per_char_metric): Remove parameter `f', unused since
23234 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23235
23236 2011-04-02 Jim Meyering <meyering@redhat.com>
23237
23238 do not dereference NULL upon failed strdup
23239 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23240 (ns_get_family): Likewise.
23241
23242 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23243
23244 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23245
23246 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23247
23248 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23249 later (Bug#8403).
23250
23251 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23252
23253 Add lexical binding.
23254
23255 * window.c (Ftemp_output_buffer_show): New fun.
23256 (Fsave_window_excursion):
23257 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23258
23259 * lread.c (lisp_file_lexically_bound_p): New function.
23260 (Fload): Bind Qlexical_binding.
23261 (readevalloop): Remove `evalfun' arg.
23262 Bind Qinternal_interpreter_environment.
23263 (Feval_buffer): Bind Qlexical_binding.
23264 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23265 Mark as dynamic.
23266 (syms_of_lread): Declare `lexical-binding'.
23267
23268 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23269
23270 * keyboard.c (eval_dyn): New fun.
23271 (menu_item_eval_property): Use it.
23272
23273 * image.c (parse_image_spec): Use Ffunctionp.
23274
23275 * fns.c (concat, mapcar1): Accept byte-code-functions.
23276
23277 * eval.c (Fsetq): Handle lexical vars.
23278 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23279 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23280 (FletX, Flet): Obey lexical binding.
23281 (Fcommandp): Handle closures.
23282 (Feval): New `lexical' arg.
23283 (eval_sub): New function extracted from Feval. Use it almost
23284 everywhere where Feval was used. Look up vars in lexical env.
23285 Handle closures.
23286 (Ffunctionp): Move from subr.el.
23287 (Ffuncall): Handle closures.
23288 (apply_lambda): Remove `eval_flags'.
23289 (funcall_lambda): Handle closures and new byte-code-functions.
23290 (Fspecial_variable_p): New function.
23291 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23292 but without exporting it to Lisp.
23293
23294 * doc.c (Fdocumentation, store_function_docstring):
23295 * data.c (Finteractive_form): Handle closures.
23296
23297 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23298 interactive spec.
23299
23300 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23301 New byte-codes.
23302 (exec_byte_code): New function extracted from Fbyte_code to handle new
23303 calling convention for byte-code-functions. Add new byte-codes.
23304
23305 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23306
23307 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23308
23309 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23310
23311 * xdisp.c (redisplay_internal): Fix prototype.
23312
23313 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23314
23315 * xdisp.c (SCROLL_LIMIT): New macro.
23316 (try_scrolling): Use it when setting scroll_limit.
23317 Limit scrolling to 100 screen lines.
23318 (redisplay_window): Even when falling back on "recentering",
23319 position point in the window according to scroll-conservatively,
23320 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23321
23322 (try_scrolling): When point is above the window, allow searching
23323 as far as scroll_max, or one screenful, to compute vertical
23324 distance from PT to the scroll margin position. This prevents
23325 try_scrolling from unnecessarily failing when
23326 scroll-conservatively is set to a value slightly larger than the
23327 window height. Clean up the case of PT below the margin at bottom
23328 of window: scroll_max can no longer be INT_MAX. When aggressive
23329 scrolling is in use, don't let point enter the opposite scroll
23330 margin as result of the scroll.
23331 (syms_of_xdisp) <scroll-conservatively>: Document the
23332 threshold of 100 lines for never-recentering scrolling.
23333
23334 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23335
23336 * dispextern.h (move_it_by_lines):
23337 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23338 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23339 (message_log_check_duplicate): Remove parameters `prev_bol' and
23340 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23341 (redisplay_internal): Remove parameter `preserve_echo_area',
23342 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23343
23344 * indent.c (Fvertical_motion):
23345 * window.c (window_scroll_pixel_based, Frecenter):
23346 Don't pass `need_y_p' to `move_it_by_lines'.
23347
23348 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23349
23350 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23351 steal a few bits to be more compact.
23352 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23353 Remove unneeded casts.
23354
23355 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23356
23357 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23358
23359 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23360 binding" message (bug#7967).
23361
23362 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23363
23364 Fix more problems found by GCC 4.6.0's static checks.
23365
23366 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23367 Remove unused local var.
23368
23369 * editfns.c (Fmessage_box): Remove unused local var.
23370
23371 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23372 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23373 Omit unused local vars.
23374 * window.c (shrink_windows): Omit unused local var.
23375 * menu.c (digest_single_submenu): Omit unused local var.
23376 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23377 Omit unused local var.
23378
23379 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23380 Don't assume string length fits in int.
23381 (keyremap_step, read_key_sequence): Use size_t for sizes.
23382 (read_key_sequence): Don't check last_real_key_start redundantly.
23383
23384 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23385 instead of alloca (Bug#8344).
23386
23387 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23388 (Fbacktrace_frame): Don't assume nframes fits in int.
23389
23390 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23391
23392 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23393 concerns.
23394
23395 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23396
23397 * cm.c (calccost): Turn while-do into do-while, for clarity.
23398
23399 * keyboard.c (syms_of_keyboard): Use the same style as later
23400 in this function when indexing through an array. This also
23401 works around GCC bug 48267.
23402
23403 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23404
23405 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23406
23407 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23408 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23409
23410 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23411 This avoids undefined behavior on integer overflow, and is a bit
23412 more convenient anyway since it is compared to a size_t variable.
23413
23414 Variadic C functions now count arguments with size_t, not int.
23415 This avoids an unnecessary limitation on 64-bit machines, which
23416 caused (substring ...) to crash on large vectors (Bug#8344).
23417 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23418 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23419 All variadic functions and their callers changed accordingly.
23420 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23421 * data.c (arith_driver, float_arith_driver): Likewise.
23422 * editfns.c (general_insert_function): Likewise.
23423 * eval.c (struct backtrace.nargs, interactive_p)
23424 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23425 (funcall_lambda, mark_backtrace): Likewise.
23426 * fns.c (concat): Likewise.
23427 * frame.c (x_set_frame_parameters): Likewise.
23428 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23429 0 if not found, not -1. All callers changed.
23430
23431 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23432 (stack_copy_size): Now size_t, not int.
23433 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23434
23435 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23436
23437 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23438 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23439 All callers changed.
23440
23441 * lisp.h (multibyte_char_to_unibyte):
23442 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23443 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23444 * character.h (CHAR_TO_BYTE8):
23445 * cmds.c (internal_self_insert):
23446 * editfns.c (general_insert_function):
23447 * keymap.c (push_key_description):
23448 * search.c (Freplace_match):
23449 * xdisp.c (message_dolog, set_message_1): All callers changed.
23450
23451 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23452
23453 * keyboard.c (safe_run_hook_funcall): New function.
23454 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23455 don't set the hook to nil, but remove the offending function instead.
23456 (Qcommand_hook_internal): Remove, unused.
23457 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23458 Vcommand_hook_internal.
23459
23460 * eval.c (enum run_hooks_condition): Remove.
23461 (funcall_nil, funcall_not): New functions.
23462 (run_hook_with_args): Call each function through a `funcall' argument.
23463 Remove `cond' argument, now redundant.
23464 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23465 (Frun_hook_with_args_until_failure): Adjust accordingly.
23466 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23467
23468 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23469
23470 * dispextern.h (string_buffer_position): Remove declaration.
23471
23472 * print.c (strout): Remove parameter `multibyte', unused since
23473 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23474
23475 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23476 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23477 All callers changed.
23478
23479 * w32.c (_wsa_errlist): Use braces for struct initializers.
23480
23481 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23482 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23483 All callers changed.
23484 (string_buffer_position): Likewise. Also, make static (it's never
23485 used outside xdisp.c).
23486 (cursor_row_p): Remove parameter `w', unused since
23487 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23488 (decode_mode_spec): Remove parameter `precision', introduced during
23489 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23490 All callers changed.
23491
23492 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23493
23494 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23495
23496 2011-03-27 Anders Lindgren <andlind@gmail.com>
23497
23498 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23499 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23500 (ns_update_auto_hide_menu_bar): New functions.
23501 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23502 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23503 ns_constrain_all_frames.
23504 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23505 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23506
23507 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23508
23509 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23510
23511 2011-03-27 Glenn Morris <rgm@gnu.org>
23512
23513 * syssignal.h: Replace RETSIGTYPE with void.
23514 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23515 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23516 Replace SIGTYPE with void everywhere.
23517 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23518 * s/template.h (SIGTYPE): Remove commented out definition.
23519
23520 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23521
23522 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23523 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23524
23525 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23526
23527 * w32.c (read_unc_volume): Use parameter `henum', instead of
23528 global variable `wget_enum_handle'.
23529
23530 * keymap.c (describe_vector): Remove parameters `indices' and
23531 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23532 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23533
23534 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23535
23536 * keyboard.c (timer_check): Remove parameter `do_it_now',
23537 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23538 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23539 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23540
23541 * keyboard.c (read_char):
23542 * w32menu.c (w32_menu_display_help):
23543 * xmenu.c (show_help_event, menu_help_callback):
23544 Adjust calls to `show_help_echo'.
23545
23546 * gtkutil.c (xg_maybe_add_timer):
23547 * keyboard.c (readable_events):
23548 * process.c (wait_reading_process_output):
23549 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23550
23551 * insdel.c (adjust_markers_gap_motion):
23552 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23553 (gap_left, gap_right): Don't call it.
23554
23555 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23556
23557 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23558 incurred during fontification.
23559
23560 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23561
23562 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23563 (DEFVAR_PER_BUFFER): Don't pass it.
23564
23565 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23566 (scrolling_window): Don't pass it.
23567
23568 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23569
23570 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23571
23572 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23573 and `suffix'.
23574 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23575 of variables specific to SELinux and computation of `encoded_absname'.
23576
23577 * image.c (XPutPixel): Remove unused variable `height'.
23578
23579 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23580
23581 * unexw32.c (get_section_info): Remove unused variable `section'.
23582
23583 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23584 (system_process_attributes): Remove unused variable `sess'.
23585 (sys_read): Remove unused variable `err'.
23586
23587 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23588 (w32_wnd_proc): Remove unused variable `isdead'.
23589 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23590 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23591 (x_create_tip_frame): Remove unused variable `tem'.
23592
23593 * w32inevt.c (w32_console_read_socket):
23594 Remove unused variable `no_events'.
23595
23596 * w32term.c (x_draw_composite_glyph_string_foreground):
23597 Remove unused variable `width'.
23598
23599 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23600
23601 * w32term.c (x_set_glyph_string_clipping):
23602 Don't pass uninitialized region to CombineRgn.
23603
23604 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23605
23606 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23607 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23608 (Fx_close_connection): Remove unused variable `i'.
23609
23610 * w32font.c (w32font_draw): Return number of glyphs.
23611 (w32font_open_internal): Remove unused variable `i'.
23612 (w32font_driver): Add missing initializer.
23613
23614 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23615 (fill_in_menu): Remove unused variable `items_added'.
23616
23617 * w32term.c (last_mouse_press_frame): Remove static global variable.
23618 (w32_clip_to_row): Remove unused variable `f'.
23619 (x_delete_terminal): Remove unused variable `i'.
23620
23621 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23622 (NOTHING): Remove unused static global variable.
23623 (uniscribe_check_otf): Remove unused variable `table'.
23624 (uniscribe_font_driver): Add missing initializers.
23625
23626 2011-03-23 Julien Danjou <julien@danjou.info>
23627
23628 * term.c (Fsuspend_tty, Fresume_tty):
23629 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23630 * window.c (temp_output_buffer_show):
23631 * insdel.c (signal_before_change):
23632 * frame.c (Fhandle_switch_frame):
23633 * fileio.c (Fdo_auto_save):
23634 * emacs.c (Fkill_emacs):
23635 * editfns.c (save_excursion_restore):
23636 * cmds.c (internal_self_insert):
23637 * callint.c (Fcall_interactively):
23638 * buffer.c (Fkill_all_local_variables):
23639 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23640 Use Frun_hooks.
23641 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23642 unconditionally since it does the check itself.
23643
23644 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23645
23646 Fix more problems found by GCC 4.5.2's static checks.
23647
23648 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23649 the first time through the loop, since we know p0 < p1 then.
23650 This also avoids a gcc -Wstrict-overflow warning.
23651
23652 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23653 leading to a memory leak, possible in functions like
23654 load_charset_map_from_file that can allocate an unbounded number
23655 of objects (Bug#8318).
23656
23657 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23658 that could (at least in theory) be that large.
23659
23660 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23661 This is less likely to overflow, and avoids undefined behavior if
23662 overflow does occur. All callers changed. Use strtoul to scan
23663 for the unsigned long integer.
23664 (pint2hrstr): Simplify and tune code slightly.
23665 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23666
23667 * scroll.c (do_scrolling): Work around GCC bug 48228.
23668 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23669
23670 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23671 This also avoids a warning with gcc -Wstrict-overflow.
23672 (validate_x_resource_name): Simplify count usage.
23673 This also avoids a warning with gcc -Wstrict-overflow.
23674
23675 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23676 fail (Bug#8306).
23677
23678 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23679
23680 * process.c (Fmake_network_process): Use socklen_t, not int,
23681 where POSIX says socklen_t is required in portable programs.
23682 This fixes a porting bug on hosts like 64-bit HP-UX, where
23683 socklen_t is wider than int (Bug#8277).
23684 (Fmake_network_process, server_accept_connection):
23685 (wait_reading_process_output, read_process_output):
23686 Likewise.
23687
23688 * process.c: Rename or move locals to avoid shadowing.
23689 (list_processes_1, Fmake_network_process):
23690 (read_process_output_error_handler, exec_sentinel_error_handler):
23691 Rename or move locals.
23692 (Fmake_network_process): Define label "retry_connect" only if needed.
23693 (Fnetwork_interface_info): Fix pointer signedness.
23694 (process_send_signal): Add cast to avoid pointer signedness problem.
23695 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23696 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23697
23698 Make tparam.h and terminfo.c consistent.
23699 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23700 Include tparam.h instead, since it declares them.
23701 * cm.h (PC): Remove extern decl; tparam.h now does this.
23702 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23703 * terminfo.c: Include tparam.h, to check interfaces.
23704 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23705 (tparam): Adjust signature to match interface in tparam.h;
23706 this removes some undefined behavior. Check that outstring and len
23707 are zero, which they always are with Emacs.
23708 * tparam.h (PC, BC, UP): New extern decls.
23709
23710 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23711 (xftfont_open): Rename locals to avoid shadowing.
23712
23713 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23714 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23715 (OTF_TAG_SYM): Omit macro if not needed.
23716 (ftfont_list): Remove unused local.
23717 (get_adstyle_property, ftfont_pattern_entity):
23718 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23719 Rename locals to avoid shadowing.
23720
23721 * xfont.c (xfont_list_family): Mark var as initialized.
23722
23723 * xml.c (make_dom): Now static.
23724
23725 * composite.c (composition_compute_stop_pos): Rename local to
23726 avoid shadowing.
23727 (composition_reseat_it): Remove unused locals.
23728 (find_automatic_composition, composition_adjust_point): Likewise.
23729 (composition_update_it): Mark var as initialized.
23730 (find_automatic_composition): Mark vars as initialized,
23731 with a FIXME (Bug#8290).
23732
23733 character.h: Rename locals to avoid shadowing.
23734 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23735 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23736 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23737 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23738 to avoid shadowing.
23739
23740 * textprop.c (property_change_between_p): Remove; unused.
23741
23742 * intervals.c (interval_start_pos): Now static.
23743
23744 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23745
23746 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23747 Rename locals to avoid shadowing.
23748
23749 * sound.c (wav_play, au_play, Fplay_sound_internal):
23750 Fix pointer signedness.
23751 (alsa_choose_format): Remove unused local var.
23752 (wav_play): Initialize a variable to 0, to prevent undefined
23753 behavior (Bug#8278).
23754
23755 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23756
23757 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23758
23759 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23760 clobbering (Bug#8298).
23761 * sysdep.c (sys_subshell): Likewise.
23762 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23763
23764 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23765 This should get cleaned up, so that child_setup has the
23766 same signature on all platforms.
23767
23768 * callproc.c (call_process_cleanup): Now static.
23769 (relocate_fd): Rename locals to avoid shadowing.
23770
23771 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23772
23773 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23774 not to be necessary, and produces flickering.
23775
23776 2011-03-20 Glenn Morris <rgm@gnu.org>
23777
23778 * config.in: Remove file.
23779
23780 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23781
23782 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23783 are now in src/globals.h.
23784 (syms_of_minibuf): Remove spurious & from previous change.
23785
23786 2011-03-20 Leo Liu <sdl.web@gmail.com>
23787
23788 * minibuf.c (completing-read-function): New variable.
23789 (completing-read-default): Rename from completing-read.
23790 (completing-read): Call completing-read-function.
23791
23792 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23793
23794 * xfaces.c (Fx_load_color_file):
23795 Read color file from absolute filename (bug#8250).
23796
23797 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23798
23799 * makefile.w32-in: Update dependencies.
23800
23801 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23802
23803 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23804
23805 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23806
23807 Fix more problems found by GCC 4.5.2's static checks.
23808
23809 * process.c (make_serial_process_unwind, send_process_trap):
23810 (sigchld_handler): Now static.
23811
23812 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23813 That way, the code declares only the vars that it needs.
23814 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23815 * s/cygwin.h (PTY_ITERATION): Likewise.
23816 * s/darwin.h (PTY_ITERATION): Likewise.
23817 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23818
23819 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23820 * process.c (allocate_pty): Don't declare stb unless it's needed.
23821
23822 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23823 (CONSTANTLIM): Remove; unused.
23824 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23825 Define only if needed.
23826
23827 * unexelf.c (unexec): Name an expression,
23828 to avoid gcc -Wbad-function-cast warning.
23829 Use a different way to cause a compilation error if anyone uses
23830 n rather than nn, a way that does not involve shadowing.
23831 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23832
23833 * deps.mk (unexalpha.o): Remove; unused.
23834
23835 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23836 * unexec.h: New file.
23837 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23838 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23839 Depend on unexec.h.
23840 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23841 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23842 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23843 Change as necessary to match prototype in unexec.h.
23844
23845 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23846 shadowing.
23847 (back_comment, skip_chars): Mark vars as initialized.
23848
23849 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23850 Rename locals to avoid shadowing.
23851
23852 * lread.c (read1): Rewrite so as not to use empty "else".
23853 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23854
23855 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23856
23857 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23858 warning when compiling print.c.
23859
23860 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23861 instead of using an uninitialized var.
23862 (font_sort_entities): Mark var as initialized.
23863
23864 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23865
23866 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23867 pointers to constants.
23868 (font_parse_fcname): Remove unused vars.
23869 (font_delete_unmatched): Now static.
23870 (font_get_spec): Remove; unused.
23871 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23872 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23873 Rename or move locals to avoid shadowing.
23874
23875 * fns.c (require_nesting_list, require_unwind): Now static.
23876 (Ffillarray): Rename locals to avoid shadowing.
23877
23878 * floatfns.c (domain_error2): Define only if needed.
23879 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23880
23881 * alloc.c (mark_backtrace): Move decl from here ...
23882 * lisp.h: ... to here, so that it can be checked.
23883
23884 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23885 (Fdefvar): Rewrite so as not to use empty "else".
23886 (lisp_indirect_variable): Name an expression,
23887 to avoid gcc -Wbad-function-cast warning.
23888 (Fdefvar): Rename locals to avoid shadowing.
23889
23890 * callint.c (quotify_arg, quotify_args): Now static.
23891 (Fcall_interactively): Rename locals to avoid shadowing.
23892 Use const pointer when appropriate.
23893
23894 * lisp.h (get_system_name, get_operating_system_release):
23895 Move decls here, to check interfaces.
23896 * process.c (get_operating_system_release): Move decl to lisp.h.
23897 * xrdb.c (get_system_name): Likewise.
23898 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23899 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23900 some of which prompt warnings from gcc -Wbad-function-cast.
23901 (Fformat_time_string, Fencode_time, Finsert_char):
23902 (Ftranslate_region_internal, Fformat):
23903 Rename or remove local vars to avoid shadowing.
23904 (Ftranslate_region_internal): Mark var as initialized.
23905
23906 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23907 avoid shadowing.
23908
23909 * lisp.h (eassert): Check that the argument compiles, even if
23910 ENABLE_CHECKING is not defined.
23911
23912 * data.c (Findirect_variable): Name an expression, to avoid
23913 gcc -Wbad-function-cast warning.
23914 (default_value, arithcompare, arith_driver, arith_error): Now static.
23915 (store_symval_forwarding): Rename local to avoid shadowing.
23916 (Fmake_variable_buffer_local, Fmake_local_variable):
23917 Mark variables as initialized.
23918 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23919
23920 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23921 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23922 Rename locals to avoid shadowing.
23923 (mark_stack): Move local variables into the #ifdef region where
23924 they're used.
23925 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23926 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23927 needed otherwise.
23928 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23929 (GC_STRING_CHARS): Remove; not used.
23930 (Fmemory_limit): Cast sbrk's returned value to char *.
23931
23932 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23933 avoids undefined behavior in theory.
23934
23935 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23936
23937 Use functions, not macros, for up- and down-casing (Bug#8254).
23938 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23939 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23940 to use the following functions instead of these macros.
23941 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23942 EMACS_INT, since callers assume the returned value fits in int.
23943 (upcase1): Likewise, for UPCASE_TABLE.
23944 (uppercasep, lowercasep, upcase): New static inline functions.
23945 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23946 the race-condition problem in the old DOWNCASE.
23947
23948 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23949 Rename locals to avoid shadowing.
23950 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23951 (regex_compile, re_search_2, re_match_2_internal):
23952 Remove unused local vars.
23953 (FREE_VAR): Rewrite so as not to use empty "else",
23954 which gcc can warn about.
23955 (regex_compile, re_match_2_internal): Mark locals as initialized.
23956 (RETALLOC_IF): Define only if needed.
23957 (WORDCHAR_P): Likewise. This one is never needed, but is used
23958 only in a comment talking about a compiler bug, so put inside
23959 the #if 0 of that comment.
23960 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23961 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23962 Remove; unused.
23963
23964 * search.c (boyer_moore): Rename locals to avoid shadowing.
23965 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23966 (PREV_CHAR_BOUNDARY): Likewise.
23967
23968 * search.c (simple_search): Remove unused var.
23969
23970 * dired.c (compile_pattern): Move decl from here ...
23971 * lisp.h: ... to here, so that it can be checked.
23972 (struct re_registers): New forward decl.
23973
23974 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23975
23976 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23977 All uses changed.
23978 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23979 Rename locals to avoid shadowing.
23980 (Fvertical_motion): Mark locals as initialized.
23981
23982 * casefiddle.c (casify_object, casify_region): Now static.
23983 (casify_region): Mark local as initialized.
23984
23985 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23986
23987 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23988 New macros, so that the caller can use some names other than
23989 gcpro1, gcpro2, etc.
23990 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23991 of the new macros.
23992 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23993 argument, for consistency with GCPRO2_VAR, etc: it is now the
23994 prefix of the variable, not the variable itself. All uses
23995 changed.
23996 * dired.c (directory_files_internal, file_name_completion):
23997 Rename locals to avoid shadowing.
23998
23999 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
24000 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
24001 dired.c's scmp function, had undefined behavior.
24002 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24003 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
24004 * buffer.h: ... to here, because these macros use current_buffer,
24005 and the new implementation with inline functions needs to have
24006 current_buffer in scope now, rather than later when the macros
24007 are used.
24008 (downcase, upcase1): New static inline functions.
24009 (DOWNCASE, UPCASE1): Reimplement using these functions.
24010 This avoids undefined behavior in expressions like
24011 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24012 from race conditions in accessing the global variables
24013 case_temp1 and case_temp2.
24014 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24015 * lisp.h (case_temp1, case_temp2): Remove their decls.
24016 * character.h (ASCII_CHAR_P): Move from here ...
24017 * lisp.h: ... to here, so that the inline functions mentioned
24018 above can use them.
24019
24020 * dired.c (directory_files_internal_unwind): Now static.
24021
24022 * fileio.c (file_name_as_directory, directory_file_name):
24023 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24024 Now static.
24025 (file_name_as_directory): Use const pointers when appropriate.
24026 (Fexpand_file_name): Likewise. In particular, newdir might
24027 point at constant storage, so make it a const pointer.
24028 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24029 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24030 signedness issues.
24031 (Fset_file_times, Finsert_file_contents, auto_save_error):
24032 Rename locals to avoid shadowing.
24033
24034 * minibuf.c (choose_minibuf_frame_1): Now static.
24035 (Ftry_completion, Fall_completions): Rename or remove locals
24036 to avoid shadowing.
24037
24038 * marker.c (bytepos_to_charpos): Remove; unused.
24039
24040 * lisp.h (verify_bytepos, count_markers): New decls,
24041 so that gcc does not warn that these functions aren't declared.
24042
24043 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24044 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24045 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24046 (copy_text): Remove unused local var.
24047
24048 * filelock.c (within_one_second): Now static.
24049 (lock_file_1): Rename local to avoid shadowing.
24050
24051 * buffer.c (fix_overlays_before): Mark locals as initialized.
24052 (fix_start_end_in_overlays): Likewise. This function should be
24053 simplified by using pointers-to-pointers, but that's a different
24054 matter.
24055 (switch_to_buffer_1): Now static.
24056 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24057 (report_overlay_modification): Rename locals to avoid shadowing.
24058
24059 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24060 Fix pointer signedness issue.
24061 (sys_subshell): Mark local as volatile if checking for lint,
24062 to suppress a gcc -Wclobbered warning that does not seem to be right.
24063 (MAXPATHLEN): Define only if needed.
24064
24065 * process.c (serial_open, serial_configure): Move decls from here ...
24066 * systty.h: ... to here, so that they can be checked.
24067
24068 * fns.c (get_random, seed_random): Move extern decls from here ...
24069 * lisp.h: ... to here, so that they can be checked.
24070
24071 * sysdep.c (reset_io): Now static.
24072 (wait_for_termination_signal): Remove; unused.
24073
24074 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24075 (copy_keymap_item, append_key, push_text_char_description):
24076 Now static.
24077 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24078 (DENSE_TABLE_SIZE): Remove; unused.
24079 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24080 (describe_map_tree):
24081 Rename locals to avoid shadowing.
24082
24083 * keyboard.c: Declare functions static if they are not used elsewhere.
24084 (echo_char, echo_dash, cmd_error, top_level_2):
24085 (poll_for_input, handle_async_input): Now static.
24086 (read_char, kbd_buffer_get_event, make_lispy_position):
24087 (make_lispy_event, make_lispy_movement, apply_modifiers):
24088 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24089 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24090 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24091 (read_key_sequence, read_char): Mark locals as initialized.
24092 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24093
24094 * keyboard.h (make_ctrl_char): New decl.
24095 (mark_kboards): Move decl here ...
24096 * alloc.c (mark_kboards): ... from here.
24097
24098 * lisp.h (force_auto_save_soon): New decl.
24099
24100 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24101 (DEFINE_DUMMY_FUNCTION): New macro.
24102 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24103 Use it.
24104 (main): Add casts to avoid warnings
24105 if GCC considers string literals to be constants.
24106
24107 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24108
24109 * dbusbind.c: Pointer signedness fixes.
24110 (xd_signature, xd_append_arg, xd_initialize):
24111 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24112 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24113 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24114 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24115
24116 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24117 if GCC considers string literals to be constants.
24118 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24119
24120 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24121
24122 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24123 (print_preprocess, print_object): New macro to fix last change.
24124
24125 * print.c (print_preprocess): Don't forget font objects.
24126
24127 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
24128
24129 * emacs.c (USAGE3): Doc fixes.
24130
24131 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24132
24133 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24134 structure.
24135
24136 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
24137
24138 * lisp.h (VWindow_system, Qfile_name_history):
24139 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24140 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24141 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24142
24143 * w32select.c: Don't #include "keyboard.h".
24144 (run_protected): Add extern declaration for waiting_for_input.
24145
24146 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24147 * w32console.c (detect_input_pending, read_input_pending)
24148 (encode_terminal_code):
24149 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24150 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24151 (w32_system_caret_y, Qfile_name_history):
24152 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24153 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24154 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24155 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24156 * w32proc.c (Qlocal, report_file_error):
24157 * w32term.c (Vwindow_system, updating_frame):
24158 * w32uniscribe.c (initialized, uniscribe_font_driver):
24159 Remove unneeded extern declarations.
24160
24161 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
24162
24163 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24164
24165 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24166
24167 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24168 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24169 These macros can no longer be used for assignment.
24170
24171 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24172 Assign struct members directly, instead of using BUF_BEGV etc.
24173 (record_buffer_markers, fetch_buffer_markers): New functions for
24174 recording and fetching special buffer markers.
24175 (set_buffer_internal_1, set_buffer_temp): Use them.
24176
24177 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24178
24179 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24180
24181 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24182 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24183
24184 * xdisp.c (hscroll_window_tree):
24185 (reconsider_clip_changes): Use PT instead of BUF_PT.
24186
24187 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24188
24189 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24190 $(EMACS_ROOT)/lib/intprops.h.
24191
24192 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24193
24194 Fix more problems found by GCC 4.5.2's static checks.
24195
24196 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24197 to unsigned char * to avoid compiler diagnostic.
24198 (xg_free_frame_widgets): Make it clear that a local variable is
24199 needed only if USE_GTK_TOOLTIP.
24200 (gdk_window_get_screen): Make it clear that this macro is needed
24201 only if USE_GTK_TOOLTIP.
24202 (int_gtk_range_get_value): New function, which avoids a diagnostic
24203 from gcc -Wbad-function-cast.
24204 (xg_set_toolkit_scroll_bar_thumb): Use it.
24205 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24206 diagnostic from gcc -Wbad-function-cast.
24207 (get_utf8_string, xg_get_file_with_chooser):
24208 Rename locals to avoid shadowing.
24209 (create_dialog): Move locals to avoid shadowing.
24210
24211 * xgselect.c (xg_select): Remove unused var.
24212
24213 * image.c (four_corners_best): Mark locals as initialized.
24214 (gif_load): Initialize transparent_p to zero (Bug#8238).
24215 Mark another local as initialized.
24216 (my_png_error, my_error_exit): Mark with NO_RETURN.
24217
24218 * image.c (clear_image_cache): Now static.
24219 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24220 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24221 (x_edge_detection): Remove unnecessary cast that
24222 gcc -Wbad-function-cast diagnoses.
24223 (gif_load): Fix pointer signedness.
24224 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24225 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24226
24227 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24228
24229 Improve quality of tests for time stamp overflow.
24230 For example, without this patch (encode-time 0 0 0 1 1
24231 1152921504606846976) returns the obviously-bogus value (-948597
24232 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24233 reports time overflow. See
24234 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24235 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24236 * editfns.c: Include limits.h and intprops.h.
24237 (TIME_T_MIN, TIME_T_MAX): New macros.
24238 (time_overflow): Move earlier, to before first use.
24239 (hi_time, lo_time): New functions, for an accurate test for
24240 out-of-range times.
24241 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24242 (Fget_internal_run_time): Don't assume time_t fits in int.
24243 (make_time): Use list2 instead of Fcons twice.
24244 (Fdecode_time): More accurate test for out-of-range times.
24245 (check_tm_member): New function.
24246 (Fencode_time): Use it, to test for out-of-range times.
24247 (lisp_time_argument): Don't rely on undefined left-shift and
24248 right-shift behavior when checking for time stamp overflow.
24249
24250 * editfns.c (time_overflow): New function, refactoring common code.
24251 (Fformat_time_string, Fdecode_time, Fencode_time):
24252 (Fcurrent_time_string): Use it.
24253
24254 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24255 * dired.c (make_time): Move to ...
24256 * editfns.c (make_time): ... here.
24257 * systime.h: Note the move.
24258
24259 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24260
24261 * fringe.c (update_window_fringes): Remove unused variables.
24262
24263 * unexmacosx.c (copy_data_segment): Also copy __got section.
24264 (Bug#8223)
24265
24266 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24267
24268 * termcap.c [MSDOS]: Include "msdos.h".
24269 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24270 Constify `char *' arguments and their references according to
24271 prototypes in tparam.h.
24272
24273 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24274
24275 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24276 Adapt all references accordingly.
24277
24278 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24279
24280 2011-03-11 Tom Tromey <tromey@redhat.com>
24281
24282 * buffer.c (syms_of_buffer): Remove obsolete comment.
24283
24284 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24285
24286 * termhooks.h (encode_terminal_code): Declare prototype.
24287
24288 * msdos.c (encode_terminal_code): Don't declare prototype.
24289
24290 * term.c (encode_terminal_code): Now external again, used by
24291 w32console.c and msdos.c.
24292
24293 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24294 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24295
24296 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24297
24298 Fix some minor problems found by GCC 4.5.2's static checks.
24299
24300 * fringe.c (update_window_fringes): Mark locals as initialized
24301 (Bug#8227).
24302 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24303
24304 * alloc.c (mark_fringe_data): Move decl from here ...
24305 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24306 to check its interface.
24307 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24308
24309 * fontset.c (free_realized_fontset): Now static.
24310 (Fset_fontset_font): Rename local to avoid shadowing.
24311 (fontset_font): Mark local as initialized.
24312 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24313
24314 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24315
24316 * xselect.c (x_disown_buffer_selections): Remove; not used.
24317 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24318 (x_own_selection, Fx_disown_selection_internal): Rename locals
24319 to avoid shadowing.
24320 (x_handle_dnd_message): Remove local to avoid shadowing.
24321
24322 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24323 so that the caller can use some name other than gcpro1.
24324 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24325 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24326 (Fx_backspace_delete_keys_p):
24327 Use them to avoid shadowing, and rename vars to avoid shadowing.
24328 (x_decode_color, x_set_name, x_window): Now static.
24329 (Fx_create_frame): Add braces to silence GCC warning.
24330 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24331 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24332 Remove unused locals.
24333 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24334 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24335 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24336 macros.
24337
24338 * xterm.h (x_mouse_leave): New decl.
24339
24340 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24341 Remove unused functions.
24342 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24343 (x_calc_absolute_position): Now static.
24344 (XTread_socket): Don't define label "out" unless it's used.
24345 Don't declare local "event" unless it's used.
24346 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24347 unless they are used.
24348 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24349 (x_fatal_error_signal): Remove; not used.
24350 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24351 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24352 (x_error_catcher, x_connection_closed, x_error_handler):
24353 (x_error_quitter, xembed_send_message, x_iconify_frame):
24354 (my_log_handler): Rename locals to avoid shadowing.
24355 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24356 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24357
24358 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24359 Rename or move locals to avoid shadowing.
24360 (tty_defined_color, merge_face_heights): Now static.
24361 (free_realized_faces_for_fontset): Remove; not used.
24362 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24363 does not deduce is never used uninitialized.
24364 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24365 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24366
24367 * terminal.c (store_terminal_param): Now static.
24368
24369 * xmenu.c (menu_highlight_callback): Now static.
24370 (set_frame_menubar): Remove unused local.
24371 (xmenu_show): Rename parameter to avoid shadowing.
24372 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24373 since they might point to immutable storage.
24374 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24375 since it's unused otherwise.
24376
24377 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24378 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24379 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24380 avoids a gcc -Wuninitialized diagnostic.
24381 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24382 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24383 does not deduce are never used uninitialized.
24384
24385 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24386
24387 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24388 * window.c (window_loop, size_window):
24389 (run_window_configuration_change_hook, enlarge_window): Likewise.
24390
24391 * window.c (display_buffer): Now static.
24392 (size_window): Mark variables that gcc -Wuninitialized
24393 does not deduce are never used uninitialized.
24394 * window.h (check_all_windows): New decl, to forestall
24395 gcc -Wmissing-prototypes diagnostic.
24396 * dispextern.h (bidi_dump_cached_states): Likewise.
24397
24398 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24399 shadowing.
24400 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24401 Include <limits.h>.
24402 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24403 and to avoid gcc -Wuninitialized warning.
24404 (load_charset_map): Mark variables that gcc -Wuninitialized
24405 does not deduce are never used uninitialized.
24406 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24407
24408 * coding.c (coding_set_source, coding_set_destination):
24409 Use "else { /* comment */ }" rather than "else /* comment */;"
24410 for clarity, and to avoid gcc -Wempty-body warning.
24411 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24412 a block, when the outer 'i' will do.
24413 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24414 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24415 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24416 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24417 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24418 Rename locals to avoid shadowing.
24419 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24420 * coding.c (emacs_mule_char, encode_invocation_designation):
24421 Now static, since they're not used elsewhere.
24422 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24423 (decode_coding_object, encode_coding_object, detect_coding_system):
24424 (decode_coding_emacs_mule): Mark variables that gcc
24425 -Wuninitialized does not deduce are never used uninitialized.
24426 (detect_coding_iso_2022): Initialize a local variable that might
24427 be used uninitialized. Leave a FIXME because it's not clear that
24428 this initialization is needed. (Bug#8211)
24429 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24430 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24431 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24432 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24433 Remove unused macros.
24434
24435 * category.c (hash_get_category_set): Remove unused local var.
24436 (copy_category_table): Now static, since it's not used elsewhere.
24437 * character.c (string_count_byte8): Likewise.
24438
24439 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24440 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24441
24442 * chartab.c (copy_sub_char_table): Now static, since it's not used
24443 elsewhere.
24444 (sub_char_table_ref_and_range, char_table_ref_and_range):
24445 Rename locals to avoid shadowing.
24446 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24447
24448 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24449 (BIDI_BOB): Remove unused macro.
24450
24451 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24452 deduce are never used uninitialized.
24453 * term.c (encode_terminal_code): Likewise.
24454
24455 * term.c (encode_terminal_code): Now static. Remove unused local.
24456
24457 * tparam.h: New file.
24458 * term.c, tparam.h: Include it.
24459 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24460 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24461 Move these decls to tparam.h, and make them agree with what
24462 is actually in tparam.c. The previous trick of using incompatible
24463 decls in different modules does not conform to the C standard.
24464 All callers of tparam changed to use tparam's actual API.
24465 * tparam.c (tparam1, tparam, tgoto):
24466 Use const pointers where appropriate.
24467
24468 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24469 * cm.h (struct cm): Likewise.
24470 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24471 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24472 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24473 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24474 (turn_on_face, init_tty): Likewise.
24475 * termchar.h (struct tty_display_info): Likewise.
24476
24477 * term.c (term_mouse_position): Rename local to avoid shadowing.
24478
24479 * alloc.c (mark_ttys): Move decl from here ...
24480 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24481
24482 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24483
24484 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24485
24486 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24487
24488 * search.c (compile_pattern_1): Remove argument regp, unused since
24489 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24490 (compile_pattern): Don't pass it.
24491
24492 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24493
24494 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24495 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24496 for ! HAVE_GTK3.
24497 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24498
24499 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24500
24501 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24502 gdk_window_get_screen, gdk_window_get_geometry,
24503 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24504 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24505 (xg_get_pixbuf_from_pixmap): New function.
24506 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24507 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24508 Call xg_get_pixbuf_from_pixmap instead of
24509 gdk_pixbuf_get_from_drawable.
24510 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24511 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24512 (xg_check_special_colors): Use GtkStyleContext and its functions
24513 for HAVE_GTK3.
24514 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24515 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24516 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24517 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24518 Call gtk_widget_get_preferred_size.
24519 (xg_frame_resized): gdk_window_get_geometry only takes 5
24520 parameters.
24521 (xg_win_to_widget, xg_event_is_for_menubar):
24522 Call gdk_x11_window_lookup_for_display.
24523 (xg_set_widget_bg): New function.
24524 (delete_cb): New function.
24525 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24526 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24527 (xg_set_background_color): Call xg_set_widget_bg.
24528 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24529 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24530 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24531 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24532 if ! HAVE_GTK3.
24533 (update_frame_tool_bar): Call gtk_widget_hide.
24534 (xg_initialize): Use GDK_KEY_g.
24535
24536 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24537 if ! HAVE_GTK3
24538 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24539
24540 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24541 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24542 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24543
24544 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24545
24546 * w32xfns.c (select_palette): Check success of RealizePalette against
24547 GDI_ERROR, not zero.
24548
24549 See ChangeLog.11 for earlier changes.
24550
24551 ;; Local Variables:
24552 ;; coding: utf-8
24553 ;; End:
24554
24555 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24556
24557 This file is part of GNU Emacs.
24558
24559 GNU Emacs is free software: you can redistribute it and/or modify
24560 it under the terms of the GNU General Public License as published by
24561 the Free Software Foundation, either version 3 of the License, or
24562 (at your option) any later version.
24563
24564 GNU Emacs is distributed in the hope that it will be useful,
24565 but WITHOUT ANY WARRANTY; without even the implied warranty of
24566 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24567 GNU General Public License for more details.
24568
24569 You should have received a copy of the GNU General Public License
24570 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.