Fix minor problems found by static checking.
[bpt/emacs.git] / src / ChangeLog
1 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix minor problems found by static checking.
4 * data.c (pure_write_error):
5 Use xsignal2, not Fsignal, as Fsignal might return.
6 * eval.c (set_backtrace_debug_on_exit): Now static.
7 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
8 No longer inline. EXTERN_INLINE is needed only for functions
9 defined in .h files. Reindent function header as per GNU style.
10 (backtrace_p, backtrace_top, backtrace_next):
11 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
12 compiler or linker. Add extern decls to pacify gcc -Wall.
13 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
14 Now static.
15 * frame.c (free_monitors): Define only on platforms that need it.
16 * nsterm.m (ns_term_init):
17 * process.c (catch_child_signal):
18 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
19 defined on all porting targets these days.
20 * process.c, process.h (catch_child_signal):
21 Make it extern only if NS_IMPL_GNUSTEP is defined.
22
23 2013-06-03 Eli Zaretskii <eliz@gnu.org>
24
25 * w32.c (gettimeofday): Make the signature identical to prototype
26 in nt/inc/sys/time.h.
27
28 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
31 .gdbinit.
32
33 * keyboard.c (safe_run_hooks_error): Improve error message.
34
35 * data.c (pure_write_error): Add `object' argument.
36 * puresize.h (CHECK_IMPURE): Use it.
37
38 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
39
40 * Makefile.in (NOTIFY_OBJ): New variable.
41 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
42
43 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
44 Call syms_of_gfilenotify.
45
46 * gfilenotify.c: New file.
47
48 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
49 and Qfile_w32notify.
50 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
51 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
52
53 * lisp.h: Declare syms_of_gfilenotify.
54
55 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
56
57 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
58
59 Merge the specpdl and backtrace stacks. Make the structure of the
60 specpdl entries more obvious via a tagged union of structs.
61 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
62 (enum specbind_tag): New enum.
63 (struct specbinding): Make it a tagged union of structs.
64 Add a case for backtrace records.
65 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
66 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
67 (backtrace_debug_on_exit): New accessors.
68 (struct backtrace): Remove.
69 (struct catchtag): Remove backlist field.
70 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
71 Move to eval.c.
72 (Flocal_variable_p): Speed up the common case where the binding is
73 already loaded.
74 * eval.c (backtrace_list): Remove.
75 (set_specpdl_symbol, set_specpdl_old_value): Remove.
76 (set_backtrace_args, set_backtrace_nargs)
77 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
78 (backtrace_next): New functions.
79 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
80 (unwind_to_catch, internal_lisp_condition_case)
81 (internal_condition_case, internal_condition_case_1)
82 (internal_condition_case_2, internal_condition_case_n): Don't bother
83 with backtrace_list any more.
84 (Fsignal): Adjust to new backtrace format.
85 (grow_specpdl): Move up.
86 (record_in_backtrace): New function.
87 (eval_sub, Ffuncall): Use it.
88 (apply_lambda): Adjust to new backtrace format.
89 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
90 data.c.
91 (specbind): Adjust to new specpdl format. Simplify.
92 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
93 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
94 backtrace format.
95 (mark_backtrace): Remove.
96 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
97 * xdisp.c (redisplay_internal): Use record_in_backtrace.
98 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
99 Use mark_specpdl.
100 * profiler.c (record_backtrace): Use get_backtrace.
101 (handle_profiler_signal): Use backtrace_top_function.
102 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
103 accessor functions.
104
105 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
106
107 * process.h (catch_child_signal): Declare.
108
109 * process.c (catch_child_signal): New function.
110 (init_process_emacs): Call it.
111
112 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
113 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
114 NS_IMPL_COCOA.
115 (x_set_cursor_type): Remove declaration.
116 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
117 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
118 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
119 (ns_get_color): Use F suffix on float.
120 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
121 (ns_get_rgb_color): Remove.
122 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
123 (note_mouse_movement): x and y are CGFloat.
124 (ns_draw_fringe_bitmap): Remove unused rowY.
125 Change #if to COCOA && >= 10_6.
126 (ns_draw_window_cursor): Remove unused overspill.
127 (ns_draw_underwave): width and x are EamcsCGFloat.
128 (ns_draw_box): thickness is CGFloat.
129 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
130 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
131 if not in main thread.
132 (ns_get_pending_menu_title, ns_check_menu_open)
133 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
134 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
135 (sendFromMainThread:): New method.
136 (changeFont:): size is CGFloat.
137 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
138 Disable warning about permanent text.
139 (characterIndexForPoint:): Adjust return type depending on GNUStep
140 version.
141 (mouseDown:): delta is CGFloat.
142 (updateFrameSize): Remove unised variable f.
143 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
144 Cast float to EmacsCGFloat.
145 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
146 also to -1 when restoring.
147 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
148 inside NS_IMPL_COCOA.
149 (toggleFullScreen:): Put call to toggleFullScreen inside
150 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
151 (setPosition:portion:whole:): por is CGFloat.
152 (getMouseMotionPart:window:x:y:): Add F suffix to float.
153 (mouseDown:): Use CGFloat.
154 (mouseDragged:): Remove unised variable edge.
155 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
156
157 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
158 of CGFloat differs.
159 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
160 when NS_IMPL_GNUSTEP.
161 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
162 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
163 (EmacsToolbar): Add clearAll. Add tag argument to
164 addDisplayItemWithImage.
165 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
166
167 * nsselect.m (ns_get_local_selection): Remove unused variable type.
168
169 * nsmenu.m (ns_update_menubar): Make static.
170 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
171 (fillWithWidgetValue:): Add cast to SEL for setAction.
172 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
173 (update_frame_tool_bar): Update code for GNUStep.
174 (clearAll): New method.
175 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
176 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
177 identifierToItem setObject and activeIdentifiers addObject before
178 call to insertItemWithItemIdentifier.
179 (validateVisibleItems): Fix indentation.
180 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
181 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
182 UtilityWindow to aStyle, remove call to setStyleMask.
183
184 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
185
186 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
187 (ns_charset_covers, ns_get_covering_families, nsfont_open):
188 Use F suffix on floats.
189 (ns_char_width): Returns CGFloat.
190 (ns_ascii_average_width): w is CGFloat instead of float.
191 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
192 DPSxshow.
193 (ns_glyph_metrics): CGFloat instead of float.
194
195 * nsfns.m (x_set_foreground_color, x_set_background_color): Use
196 EmacsCGFloat.
197 (ns_implicitly_set_icon_type, Fx_create_frame): Make static, remove
198 unused variables.
199 (Fns_read_file_name): Keep track if panel is for save. Use
200 ns_filename_from_panel/ns_directory_from_panel.
201 (Fns_list_services): delegate only used for COCOA.
202 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep. Just
203 return the input if GNUStep.
204 (x_screen_planes): Remove.
205 (Fxw_color_values): Use EmacsCGFloat
206 (Fns_display_monitor_attributes_list): Only get screen number for
207 Cocoa.
208 (getDirectory, getFilename): Removed from EmacsOpenPanel and
209 EmacsSavePanel.
210 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
211 ns_directory_from_panel.
212
213 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
214
215 * process.c (handle_child_signal): Also use WCONTINUED.
216 This is so that list-processes doesn't mistakenly list the process
217 as stopped, when the process has actually been continued and is
218 now running.
219
220 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
221
222 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
223 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
224 not already configured.
225
226 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
227
228 2013-05-29 Eli Zaretskii <eliz@gnu.org>
229
230 * Makefile.in (mostlyclean): Remove *.res files.
231
232 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
233
234 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
235 a buffer (bug#8447).
236
237 2013-05-27 Eli Zaretskii <eliz@gnu.org>
238
239 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
240 display vector, and we backtrack, handle the case that the
241 previous character position is also displayed from a display
242 vector or covered by a display string or image. (Bug#14476)
243
244 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
245
246 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
247 (struct MonitorInfo, free_monitors): Remove.
248 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
249 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
250 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
251 Qframes, Qsource.
252
253 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
254 (struct MonitorInfo, free_monitors): Remove.
255 (ns_screen_name): Make static.
256 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
257 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
258 Qframes, Qsource.
259
260 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
261 (struct MonitorInfo): New struct.
262 (free_monitors, make_monitor_attribute_list): Declare.
263
264 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
265 New Lisp_Object:s.
266 (free_monitors, make_monitor_attribute_list): New functions.
267 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
268 Qsource.
269
270 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
271
272 * callproc.c (call_process): Refine the doc string. (Bug#14045)
273
274 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
275
276 * keyboard.c: Apply keyboard decoding only to events that come directly
277 from the tty, not from unread-command-events (bug#14368).
278 (read_event_from_main_queue): New function, extracted from read_char).
279 (read_decoded_char): Remove.
280 (read_decoded_event_from_main_queue): New function to replace it.
281 (read_char): Use it.
282 (read_key_sequence): Use read_char rather than read_decoded_char.
283
284 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
285
286 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
287
288 * casetab.c (init_casetab_once): Fix last change (bug#14424).
289
290 2013-05-22 Kenichi Handa <handa@gnu.org>
291
292 The following changes are to fix the setting of
293 buffer-file-coding-system on, for instance, C-x RET c unix RET
294 _FILE_OF_DOS_EOL_TYPE_ RET.
295
296 * coding.h (struct coding_system): New member detected_utf8_chars.
297
298 * coding.c (detect_coding_utf_8): Count characters and check EOL
299 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
300 BOM is there.
301 (setup_coding_system): Do not initialize coding->head_ascii.
302 (check_ascii): Do not set coding->eol_seen but update it. Do not
303 call adjust_coding_eol_type here.
304 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
305 If the eol-type of CODING is already specified, adjust the eol type
306 of the found coding-system.
307 (decode_coding_gap): Cancel previous change. Utilize the
308 character numbers counted by detect_coding_utf_8. Fix detection
309 of BOM for utf-8.
310
311 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
312
313 * search.c (looking_at_1): Only set last_thing_searched if the match
314 changed the match-data (bug#14281).
315
316 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
317
318 * xdisp.c (reseat_at_previous_visible_line_start):
319 Already declared in dispextern.h, so remove it here.
320 (move_it_vertically_backward): Likewise.
321
322 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
323
324 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
325 (Fx_display_pixel_width, Fx_display_pixel_height)
326 (Fx_display_mm_width, Fx_display_mm_height):
327 Mention `display-monitor-attributes-list' in docstrings.
328
329 * nsfns.m (ns_get_screen): Remove function. All uses removed.
330 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
331 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
332 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
333 (Fx_display_backing_store, Fx_display_visual_class)
334 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
335 (Fx_display_grayscale_p, Fx_display_pixel_width)
336 (Fx_display_pixel_height, Fx_display_planes)
337 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
338 (Fx_display_screens): Don't confuse X11 screens with NS screens.
339 (Fx_display_mm_width, Fx_display_mm_height)
340 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
341 height for all physical monitors as in X11.
342
343 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
344 Return pixel width or height for all physical monitors as in X11.
345
346 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
347
348 Port --enable-gcc-warnings to clang.
349 * bytecode.c (exec_byte_code):
350 * regex.c:
351 Redo diagnostic pragmas to pacify clang, too.
352 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
353 * editfns.c (Fencode_time):
354 * fileio.c (file_accessible_directory_p):
355 * font.c (font_unparse_xlfd):
356 Use '&"string"[index]' instead of '"string" + (index)'.
357 * undo.c (user_error): Remove; unused.
358
359 2013-05-16 Eli Zaretskii <eliz@gnu.org>
360
361 * insdel.c (insert_1_both): Document the arguments, instead of
362 referring to insert_1, which no longer exists.
363
364 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
365 some window, increment windows_or_buffers_changed, so that
366 *Messages* display in that window is updated. (Bug#14408)
367
368 * w32.c: Include epaths.h.
369 (init_environment): Use cmdproxy.exe without leading directories.
370 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
371 case.
372 (gettimeofday): Adjust signature and return value to Posix
373 expectations.
374
375 * unexw32.c (open_output_file): Delete the existing emacs.exe
376 before creating it, to break the hard link to the versioned
377 executable.
378
379 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
380 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
381 (FIRSTFILE_OBJ): New variables.
382 (W32_RES): Rename to EMACSRES. All users changed.
383 (base_obj): Use $(CM_OBJ).
384 (ALLOBJS): Use $(FIRSTFILE_OBJ).
385 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
386 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
387 $(W32_RES_LINK) before $(LIBES).
388 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
389
390 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
391
392 * makefile.w32-in (DOC): Use just "DOC".
393
394 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
395
396 * process.c: Export default filters and sentinels to Elisp.
397 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
398 New constants.
399 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
400 (Fset_process_sentinel, Fformat_network_address):
401 Default to them instead of nil.
402 (server_accept_connection): Sentinels can't be nil any more.
403 (read_and_dispose_of_process_output): New function, extracted from
404 read_process_output.
405 (read_process_output): Use it; filters can't be nil.
406 (Finternal_default_process_filter): New function, extracted from
407 read_process_output.
408 (exec_sentinel_unwind): Remove function.
409 (exec_sentinel): Don't zilch sentinel while running.
410 (status_notify): Sentinels can't be nil.
411 (Finternal_default_process_sentinel): New function extracted from
412 status_notify.
413 (setup_process_coding_systems): Default filter is not nil any more.
414 (syms_of_process): Export new Elisp functions and initialize
415 new constants.
416 * lisp.h (make_lisp_proc): New function.
417
418 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
419
420 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
421
422 2013-05-14 Eli Zaretskii <eliz@gnu.org>
423
424 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
425 unless we know that the window w is a leaf window.
426 Another attempt at solving bug#14062.
427
428 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
429
430 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
431 fdesc (Bug#14375).
432
433 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
434
435 * image.c (gif_load): Check that subimages fit (Bug#14345).
436
437 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
438
439 * lread.c (skip_dyn_eof): New function.
440 (read1): Use it to skip the end of a file in response to #@00.
441
442 * doc.c (get_doc_string): Slightly relax the sanity checking.
443
444 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
445
446 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
447 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
448 (MonitorInfo): New struct.
449 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
450 (Fns_display_monitor_attributes_list): New functions.
451 (display-usable-bounds): Remove.
452 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
453 Qsource.
454
455 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
456
457 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
458 (GTK_CHECK_VERSION): New macro, if not already defined.
459 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
460 replaced by GTK_CHECK_VERSION.
461
462 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
463
464 * xterm.h (GTK_PREREQ): New macro.
465 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
466 to use this macro instead, for consistency and clarity.
467
468 2013-05-08 Eli Zaretskii <eliz@gnu.org>
469
470 * xdisp.c (row_for_charpos_p): New function, with code of
471 cursor_row_p, but accepts an additional argument CHARPOS instead
472 of using a hardcoded PT.
473 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
474 (row_containing_pos): Call row_for_charpos_p instead of partially
475 doing the same. Fixes cursor positioning under longlines-mode
476 when longlines-show-effect includes more than one newline, when
477 moving the cursor vertically up.
478
479 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
480
481 * makefile.w32-in (ACL_H): New macro.
482 ($(BLD)/fileio.$(O)): Update dependencies.
483
484 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
485
486 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
487 * Makefile.in (LIB_ACL): New macro.
488 (LIBACL_LIBS): Remove.
489 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
490 * fileio.c: Include <acl.h>.
491 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
492 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
493 !acl_errno_valid.
494 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
495 it ourselves.
496
497 * unexelf.c: Don't assume ElfW (Half) fits in int.
498 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
499 when dealing with ElfW (Half) values, since they can exceed 2**31
500 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
501 (entry_address): Omit unused NUM arg. All uses changed.
502
503 2013-05-07 Juri Linkov <juri@jurta.org>
504
505 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
506 to the string converted from number with `Fnumber_to_string'.
507 (Bug#14254)
508
509 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
510
511 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
512 This fixes a problem introduced by my previous change.
513
514 2013-05-07 Glenn Morris <rgm@gnu.org>
515
516 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
517
518 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
519
520 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
521
522 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
523
524 Static checking by GCC 4.8.0.
525 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
526 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
527 (x_get_monitor_attributes_fallback)
528 (x_get_monitor_attributes_xinerama)
529 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
530 Define only if USE_GTK.
531 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
532 (x_get_monitor_attributes_fallback): Omit unused locals.
533 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
534 Use double, not float, to avoid mixed-mode floating point arithmetic.
535
536 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
537 Jan Djärv <jan.h.d@swipnet.se>
538
539 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
540 (XINERAMA_CFLAGS): New macros.
541 (ALL_CFLAGS, LIBES): Use them.
542
543 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
544 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
545 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
546 (syms_of_xfns): DEFSYM them.
547 (struct MonitorInfo): New struct.
548 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
549 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
550 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
551 (x_get_monitor_attributes_xinerama): New functions.
552 (Fx_display_monitor_attributes_list): New primitive.
553 (syms_of_xfns): Defsubr it.
554
555 * xterm.h (x_display_info): Add Xatom_net_workarea and
556 Xatom_net_current_desktop.
557
558 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
559 and dpyinfo->Xatom_net_current_desktop.
560
561 2013-05-06 Eli Zaretskii <eliz@gnu.org>
562
563 * xdisp.c (pos_visible_p): Use the special code for finding the
564 beginning of a display property or overlay for any "replacing"
565 display property, not just for display strings. This solves
566 incorrect reporting of position by posn-at-point. (Bug#14241)
567
568 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
569
570 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
571 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
572 Verify that ElfW (Half) fits in int.
573 (fatal): Use same signature as lisp.h.
574 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
575 configure and build with -DUNEXELF_DEBUG without worrying about
576 other modules that use DEBUG.
577 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
578 possibly-wide integers now uses it instead of plain fprintf.
579 (entry_address): New function, which avoids problems with 32-bit
580 overflow on 64-bit hosts.
581 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
582 (round_up): Don't assume the remainder fits in int.
583 (find_section): Use bool for boolean. Simplify debug code.
584 (unexec): Don't assume file sizes fit in int or size_t.
585 Omit unnecessary trailing newline in 'fatal' format.
586 Use strerror rather than outputting decimal error number.
587 Remove unused code when emacs is not defined;
588 this file relies on Emacs now.
589 Don't assume e_phnum and e_shnum are positive.
590
591 * regex.c: Fix problems when DEBUG is defined.
592 (extract_number, extract_number_and_incr): Define regardless of
593 whether DEBUG is defined; that's simpler and makes the code less
594 likely to go stale in the normal case when DEBUG is not defined.
595 Return int rather than taking an int * arg. All callers changed.
596 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
597 Remove, replacing with ...
598 (DEBUG_PRINT): New macro. All callers changed.
599 (DEBUG_COMPILES_ARGUMENTS): New macro.
600 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
601 (print_compiled_pattern, print_double_string) [DEBUG]:
602 Use prototype rather than old-style definition.
603 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
604 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
605 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
606 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
607 Don't assume ptrdiff_t, size_t, and long are the same width as int.
608 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
609 This matters only when DEBUG is defined.
610
611 2013-05-05 Eli Zaretskii <eliz@gnu.org>
612
613 * xdisp.c (set_iterator_to_next): Set the
614 ignore_overlay_strings_at_pos_p flag only if we are _really_
615 iterating over an overlay string, as indicated by the
616 current.overlay_string_index member. (Bug#14306)
617
618 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
619
620 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
621 to where it is used, to avoid autorelease issues (Bug#14050).
622
623 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
624
625 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
626 * fileio.c (syms_of_fileio): Implement this.
627 * filelock.c (create_lock_file): If symbolic links don't work, so
628 we use a regular file as a lock file, do not fsync the lock file;
629 it's not needed.
630
631 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
632
633 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
634 (syms_of_minibuf): Adjust accodingly.
635 * lread.c (Fread):
636 * callint.c (Fcall_interactively): Adjust calls accordingly.
637
638 2013-05-04 Eli Zaretskii <eliz@gnu.org>
639
640 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
641 w->contents is a buffer before computing everything else.
642 Use parentheses to disambiguate last part of the condition.
643
644 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
645 assertion violations. (Bug#14062)
646
647 2013-05-01 David Reitter <david.reitter@gmail.com>
648
649 * nsfns.m (ns_tooltip): Initialize.
650
651 2013-04-28 Eli Zaretskii <eliz@gnu.org>
652
653 * coding.c (decode_coding_gap): Don't remove the character before
654 a newline unless it's a CR character. (Bug#14287)
655
656 2013-04-28 Dan Nicolaescu <dann@gnu.org>
657
658 * dispextern.h (struct face): Move enum face_underline_type
659 earlier so that bitfields can be in the same word.
660
661 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
662
663 * nsfns.m (handlePanelKeys): New function.
664 (EmacsOpenPanel:performKeyEquivalent:)
665 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
666 arrows/function/control and copy/paste keys (Bug#14296).
667
668 2013-04-27 Juri Linkov <juri@jurta.org>
669
670 * callint.c (Fcall_interactively): Call `Qread_number' for
671 interactive code letter `n' instead of using duplicate code.
672 (Bug#14254)
673
674 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
675
676 * systime.h (make_timeval): Declare as 'const'.
677
678 2013-04-27 Kenichi Handa <handa@gnu.org>
679
680 * font.c (font_open_entity): Always open a font of manageable
681 size.
682
683 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
684
685 Port better to AIX (Bug#14258).
686 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
687 to pacify AIX xlc.
688
689 2013-04-24 Kenichi Handa <handa@gnu.org>
690
691 * coding.c (decode_coding_iso_2022): When an invalid escape
692 sequence is encountered, reset the invocation and designation
693 status to the safest one.
694
695 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
696
697 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
698 Without this fix, "make distclean" leaves stamp-h1 behind.
699
700 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
701
702 * w32fns.c (w32_fullscreen_rect): New function to compute the
703 window rectangle for the given fullscreen mode.
704 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
705 longer tunes the window size. This keeps the window's edges flush
706 with the screen and allows the taskbar to hide itself in fullboth.
707
708 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
709 window decorations and uses the entire screen.
710
711 * w32term.h (w32_fullscreen_rect) Add prototype.
712 (struct w32_output): Replace normal_width, normal_height,
713 normal_top, and normal_left members with a single normal_placement
714 struct.
715 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
716 Remove macros.
717 (FRAME_NORMAL_PLACEMENT): New macro.
718
719 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
720
721 * minibuf.c (Ftest_completion): Silence compiler warning.
722
723 2013-04-15 Eli Zaretskii <eliz@gnu.org>
724
725 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
726 bug#14062.
727
728 * frame.h (WINDOW_FRAME): Protect macro and its argument with
729 parentheses.
730
731 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
732 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
733 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
734 parentheses where appropriate.
735
736 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
737
738 * keyboard.c (timer_start_idle): Remove no-longer-used local.
739
740 2013-04-14 Eli Zaretskii <eliz@gnu.org>
741
742 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
743 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
744 Mention in the doc string that setting these variables takes
745 effect only after a call to set-window-buffer. (Bug#14200)
746
747 2013-04-13 Eli Zaretskii <eliz@gnu.org>
748
749 * indent.c (Fvertical_motion): Don't consider display strings on
750 overlay strings as display strings on the buffer position we
751 started from. This prevents vertical cursor motion from jumping
752 more than one line when there's an overlay string with a display
753 property at end of line.
754 Reported by Karl Chen <Karl.Chen@quarl.org> in
755 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
756
757 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
758
759 * window.c (select_window): `record_buffer' even if window is
760 already selected (bug#14191).
761
762 2013-04-11 Eli Zaretskii <eliz@gnu.org>
763
764 * window.c (Fwindow_end): Test more flags, including the buffer's
765 last_overlay_modified flag, to determine whether the window's
766 display is really up-to-date. Prevents the function from
767 returning a stale value. (Bug#14170)
768 (Fwindow_line_height): Fix the test for up-to-date-ness of the
769 current matrix.
770
771 2013-04-10 Eli Zaretskii <eliz@gnu.org>
772
773 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
774 garbaged only if it is not already the top frame on its TTY.
775 This prevents flickering due to constant redrawing of TTY frames when
776 there are GUI frames open in the same session. (Bug#13864)
777
778 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
779
780 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
781 of marking the idle timers directly.
782
783 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
784
785 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
786 tables (bug#14054).
787
788 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
789
790 * window.c (select_window): Don't record_buffer while the invariant is
791 temporarily broken (bug#14161).
792
793 * fns.c (Fdelq): Don't assume !NILP => CONSP.
794
795 2013-04-07 Eli Zaretskii <eliz@gnu.org>
796
797 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
798
799 2013-04-07 Romain Francoise <romain@orebokech.com>
800
801 Ignore additional platform-specific ACL errors (Bug#13702).
802 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
803 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
804
805 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
806
807 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
808 f->output_data.ns.
809
810 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
811
812 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
813 This bug was introduced by my 2013-02-25 change that simplified
814 data_start configuration. Without this change, on GNU/Linux
815 an Emacs configured with --enable-profiling fails immediately
816 due to a profiler signal.
817 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
818 with these flags. On platforms where special flags are needed
819 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
820 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
821 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
822
823 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
824
825 Get rid of some platform-specific functions examining window
826 system and its capabilities. This is a partial rework of the
827 2013-04-05 change.
828 * lisp.h (have_menus_p): Remove prototype. This function is
829 replaced with platform-independent window_system_available.
830 (check_window_system): Move to...
831 * frame.h (decode_window_system_frame, window_system_available):
832 ...here, add new prototypes.
833 * frame.c (window_system_available, decode_window_system_frame):
834 New functions.
835 (check_window_system): Platform-independent now.
836 * xterm.h (x_in_use): Remove declaration.
837 (check_x_frame):
838 * w32term.h (check_x_frame):
839 * nsterm.h (check_x_frame): Remove prototypes. This function
840 is replaced with platform-independent decode_window_system_frame.
841 * msdos.c (have_menus_p): Remove.
842 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
843 Remove platform-specific functions. Use check_window_system,
844 decode_window_system_frame and check_ns_display_info where
845 appropriate. Minor style and comment tweaks.
846 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
847 (check_x_frame): Likewise.
848 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
849 Likewise.
850 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
851 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
852 * xmenu.c, xselect.c: All related users changed.
853
854 2013-04-03 Kenichi Handa <handa@gnu.org>
855
856 The following changes is to optimize the code for reading UTF-8
857 files.
858
859 * coding.c (check_ascii): Rename from detect_ascii. Return value
860 changed. Check EOL format. Do not call adjust_coding_eol_type
861 here.
862 (check_utf_8): New function.
863 (adjust_coding_eol_type): Do nothing if already adjusted.
864 (detect_coding): Compare the return value of check_ascii with
865 coding->src_bytes. Call adjust_coding_eol_type if necessary.
866 (decode_coding_gap): Optimize for valid UTF-8.
867
868 2013-03-21 Kenichi Handa <handa@gnu.org>
869
870 * coding.c (syms_of_coding): Cancel previous change.
871
872 * insdel.c (insert_from_gap): Fix previous change.
873
874 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
875
876 Consistently use platform-specific function to detect window system.
877 * lisp.h (check_window_system): New prototype. This function is
878 going to replace check_x, check_w32 and check_ns.
879 (have_menus_p): Mention msdos.c in comment.
880 * fontset.c (check_window_system_func): Remove. Adjust all users.
881 * fontset.h (check_window_system_func): Remove prototype.
882 * nsterm.h (check_ns):
883 * xterm.h (check_x):
884 * w32term.h (check_w32): Likewise.
885 * menu.c (Fx_popup_menu): Use check_window_system.
886 * msdos.c (check_window_system): Define for MS-DOS.
887 * nsfns.m (check_window_system): Define for NS. Adjust all users.
888 * w32fns.c (check_window_system): Likewise for MS-Windows.
889 * xfns.c (check_window_system): Likewise for X.
890 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
891 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
892
893 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
894
895 Prefer < to > in range checks such as 0 <= i && i < N.
896 This makes it easier to visualize quantities on a number line.
897 This patch doesn't apply to all such range checks,
898 only to the range checks affected by the 2013-03-24 change.
899 This patch reverts most of the 2013-03-24 change.
900 * alloc.c (xpalloc, Fgarbage_collect):
901 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
902 * character.c (string_escape_byte8):
903 * charset.c (read_hex):
904 * data.c (cons_to_unsigned):
905 * dispnew.c (update_frame_1):
906 * doc.c (Fsubstitute_command_keys):
907 * doprnt.c (doprnt):
908 * editfns.c (hi_time, decode_time_components):
909 * fileio.c (file_offset):
910 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
911 * font.c (font_intern_prop):
912 * frame.c (x_set_alpha):
913 * gtkutil.c (get_utf8_string):
914 * indent.c (check_display_width):
915 * keymap.c (Fkey_description):
916 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
917 * lread.c (read1):
918 * minibuf.c (read_minibuf_noninteractive):
919 * process.c (wait_reading_process_output):
920 * search.c (Freplace_match):
921 * window.c (get_phys_cursor_glyph):
922 * xdisp.c (redisplay_internal):
923 * xsmfns.c (smc_save_yourself_CB):
924 Prefer < to > for range checks.
925 * dispnew.c (sit_for): Don't mishandle NaNs.
926 This fixes a bug introduced in the 2013-03-24 change.
927 * editfns.c (decode_time_components): Don't hoist comparison.
928 This fixes another bug introduced in the 2013-03-24 change.
929
930 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
931
932 * frame.h (struct frame): Drop scroll_bottom_vpos
933 member becaue all real users are dead long ago.
934 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
935 * xdisp.c (redisplay_internal): Adjust user.
936
937 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
938
939 * nsmenu.m (showAtX:Y:for:): setLevel to
940 NSPopUpMenuWindowLevel (Bug#13998).
941
942 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
943
944 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
945 (ns_check_pending_open_menu): Declare.
946
947 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
948 (x_activate_menubar): Update the menu with title that matches
949 ns_get_pending_menu_title, and call
950 ns_check_pending_openmenu (Bug#12698).
951 (menuWillOpen:): New method.
952 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
953
954 * nsterm.m (menu_will_open_state, menu_mouse_point)
955 (menu_pending_title): New varaibles.
956 (ns_get_pending_menu_title, ns_check_menu_open)
957 (ns_check_pending_open_menu): New functions.
958
959 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
960
961 * indent.c (current_column_bol_cache): Remove leftover which is not
962 used in Fmove_to_column any more.
963 (current_column, scan_for_column): Adjust users.
964 * keyboard.c (last_point_position_buffer, last_point_position_window):
965 Remove leftovers which are not used for recording undo any more.
966 (command_loop_1, syms_of_keyboard): Adjust users.
967 * xdisp.c (last_max_ascent): Remove leftover which is not used in
968 redisplay_window any more.
969 (move_it_to): Adjust user.
970
971 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
972
973 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
974 Update dependencies.
975
976 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
977
978 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
979 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
980 forward references.
981
982 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
983
984 * window.h (struct window): Replace hchild, vchild and buffer slots
985 with the only contents slot. This is possible because each valid
986 window may have either the child window (in vertical or horizontal
987 combination) or buffer to display (for the leaf window). Using that,
988 a lof of operations to traverse and/or change window hierarchies may
989 be simplified. New member horizontal is used to distinguish between
990 horizontal and vertical combinations of internal windows.
991 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
992 (WINDOW_VERTICAL_COMBINATION_P): New macros.
993 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
994 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
995 Use contents slot, not buffer, where appropriate.
996 (wset_combination): New function.
997 (wset_buffer): Add eassert.
998 (Fframe_first_window): Simplify the loop reaching first window.
999 (Fwindow_buffer): Use WINDOW_LEAF_P.
1000 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1001 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1002 (unshow_buffer): Convert initial debugging check to eassert.
1003 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1004 (make_parent_window, window_resize_check, window_resize_apply)
1005 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1006 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1007 Adjust to match struct window changes.
1008 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1009 (mark_window_cursors_off, count_windows, get_leaf_windows)
1010 (foreach_window_1): Simplify the loop.
1011 * alloc.c (mark_object): Do not check for the leaf window because
1012 internal windows has no glyph matrices anyway.
1013 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1014 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1015 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1016 (build_frame_matrix_from_window_tree, mirror_make_current)
1017 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1018 (update_window_tree, set_window_update_flags): Simplify the loop.
1019 (sync_window_with_frame_matrix_rows): Enforce live window.
1020 Use contents slot, not buffer, where appropriate.
1021 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1022 and WINDOW_HORIZONTAL_COMBINATION_P.
1023 (make_frame_visible_1): Simplify the loop.
1024 Use contents slot, not buffer, where appropriate.
1025 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1026 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1027 (expose_window_tree): Likewise.
1028 Use contents slot, not buffer, where appropriate.
1029 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1030 to avoid deleted windows. Use contents slot instead of buffer.
1031 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1032 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1033 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1034 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1035
1036 2013-03-28 Eli Zaretskii <eliz@gnu.org>
1037
1038 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1039 identify the reasons for assertion violations in bug#14062 and
1040 similar ones.
1041 (Fx_show_tip): Fix compilation error under
1042 "--enable-check-lisp-object-type". (Bug#14073)
1043
1044 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1045 Reported by <rzl24ozi@gmail.com>.
1046
1047 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1048
1049 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1050 start marker...
1051 (unwind_with_echo_area_buffer): ...to restore it here.
1052 This is needed to ensure that...
1053 (redisplay_window): ...both window markers are valid here,
1054 which is verified by eassert.
1055 * editfns.c (save_excursion_save): Do not assume that
1056 selected_window always displays the buffer.
1057 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1058 Fix comment.
1059
1060 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1061
1062 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1063 the upcase table.
1064
1065 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1066
1067 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1068
1069 2013-03-27 Eli Zaretskii <eliz@gnu.org>
1070
1071 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1072 since MinGW's w32api headers do. This avoids compiler warnings.
1073
1074 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1075 if already defined.
1076
1077 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1078
1079 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1080
1081 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1082
1083 * gtkutil.c (style_changed_cb): Check if frame is live and an
1084 X frame (Bug#14038).
1085
1086 2013-03-26 Eli Zaretskii <eliz@gnu.org>
1087
1088 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1089 Define only for _WIN32_WINNT less than 0x0500.
1090 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1091 MinGW64.
1092 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1093 see its own definitions of 'struct timeval' and 'struct timezone'.
1094
1095 Fix incompatibilities between MinGW.org and MinGW64 headers.
1096 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1097
1098 * w32.c (REPARSE_DATA_BUFFER): Guard with
1099 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1100
1101 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1102
1103 * xterm.c: Include X11/XKBlib.h
1104 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1105
1106 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1107
1108 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1109 written backwards.
1110 * blockinput.h (input_blocked_p): Likewise.
1111 * bytecode.c (exec_byte_code): Likewise.
1112 * callproc.c (call_process_kill, call_process_cleanup)
1113 (Fcall_process): Likewise.
1114 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1115 (Fccl_execute_on_string): Likewise.
1116 * character.c (string_escape_byte8): Likewise.
1117 * charset.c (read_hex): Likewise.
1118 * cm.c (calccost): Likewise.
1119 * data.c (cons_to_unsigned): Likewise.
1120 * dired.c (directory_files_internal, file_name_completion):
1121 Likewise.
1122 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1123 (sit_for): Likewise.
1124 * doc.c (Fsubstitute_command_keys): Likewise.
1125 * doprnt.c (doprnt): Likewise.
1126 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1127 * emacsgtkfixed.c: Likewise.
1128 * fileio.c (file_offset, Fwrite_region): Likewise.
1129 * floatfns.c (Fexpt, fmod_float): Likewise.
1130 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1131 Likewise.
1132 * font.c (font_intern_prop): Likewise.
1133 * frame.c (x_set_alpha): Likewise.
1134 * gtkutil.c (get_utf8_string): Likewise.
1135 * indent.c (check_display_width): Likewise.
1136 * intervals.c (create_root_interval, rotate_right, rotate_left)
1137 (split_interval_right, split_interval_left)
1138 (adjust_intervals_for_insertion, delete_node)
1139 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1140 (merge_interval_right, merge_interval_left, copy_intervals)
1141 (set_intervals_multibyte_1): Likewise.
1142 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1143 * keymap.c (Fkey_description): Likewise.
1144 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1145 * lread.c (openp, read_integer, read1, string_to_number):
1146 Likewise.
1147 * menu.c (ensure_menu_items): Likewise.
1148 * minibuf.c (read_minibuf_noninteractive): Likewise.
1149 * print.c (printchar, strout): Likewise.
1150 * process.c (create_process, Faccept_process_output)
1151 (wait_reading_process_output, read_process_output, send_process)
1152 (wait_reading_process_output): Likewise.
1153 * profiler.c (make_log, handle_profiler_signal): Likewise.
1154 * regex.c (re_exec): Likewise.
1155 * regex.h: Likewise.
1156 * search.c (looking_at_1, Freplace_match): Likewise.
1157 * sysdep.c (get_child_status, procfs_ttyname)
1158 (procfs_get_total_memory): Likewise.
1159 * systime.h (EMACS_TIME_VALID_P): Likewise.
1160 * term.c (dissociate_if_controlling_tty): Likewise.
1161 * window.c (get_phys_cursor_glyph): Likewise.
1162 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1163 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1164 Likewise.
1165 * xfns.c (Fx_window_property): Likewise.
1166 * xmenu.c (set_frame_menubar): Likewise.
1167 * xselect.c (x_get_window_property, x_handle_dnd_message):
1168 Likewise.
1169 * xsmfns.c (smc_save_yourself_CB): Likewise.
1170 * xterm.c (x_scroll_bar_set_handle): Likewise.
1171
1172 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1173
1174 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1175 to be optional or nil. Adjust comment and convert it to docstring.
1176 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1177 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1178
1179 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1180
1181 Static checking by GCC 4.8-20130319.
1182 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1183 * process.c (Fset_process_datagram_address)
1184 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1185 * xdisp.c (get_char_face_and_encoding):
1186 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1187 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1188 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1189
1190 2013-03-24 Ken Brown <kbrown@cornell.edu>
1191
1192 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1193 fix compilation on 64-bit Cygwin, where underscores are not
1194 automatically prepended.
1195
1196 * w32term.c (w32_initialize): Silence compiler warning.
1197
1198 2013-03-23 Eli Zaretskii <eliz@gnu.org>
1199
1200 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1201 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
1202 variables, to save and restore frame dimensions.
1203 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1204 after returning from a 'fullscreen' configuration.
1205 use SendMessage instead of PostMessage to send the SC_RESTORE message,
1206 to avoid races between the main thread and the input thread.
1207
1208 * w32term.h (struct w32_output): New members normal_width,
1209 normal_height, normal_top, normal_left, and prev_fsmode.
1210 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1211 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1212 members of a frame.
1213
1214 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1215 'fullscreen' parameter. Always record previous width and height
1216 of the frame, except when switching out of maximized modes, so
1217 that they could be restored correctly, instead of resetting to the
1218 default frame dimensions. Send SC_RESTORE command to the frame,
1219 unless we are going to send SC_MAXIMIZE, to restore the frame
1220 resize hints in the mouse pointer shown by the window manager.
1221 (Bug#14032)
1222
1223 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1224
1225 * lisp.h (get_frame_param): Adjust conditions for prototype
1226 declaration.
1227
1228 2013-03-22 Ken Brown <kbrown@cornell.edu>
1229
1230 * unexcw.c: Drop unneeded inclusion of w32common.h.
1231 (report_sheap_usage): Declare.
1232 (read_exe_header): Add magic numbers for x86_64.
1233 (fixup_executable): Fix printf format specifier for unsigned long
1234 argument.
1235
1236 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1237
1238 * frame.h (struct frame): Put menu_bar_window under #ifdef
1239 because this member is not needed when X toolkit is in use.
1240 (fset_menu_bar_window):
1241 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1242 (free_glyphs, update_frame):
1243 * xdisp.c (expose_frame): Likewise.
1244 (display_menu_bar): Likewise. Remove redundant eassert.
1245 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1246 toolkit is in use.
1247
1248 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1249
1250 Use functions and constants to manipulate Lisp_Save_Value objects.
1251 This replaces code that used macros and strings and token-pasting.
1252 The change makes the C source a bit easier to follow,
1253 and shrinks the Emacs executable a bit.
1254 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1255 (make_save_value): Change 1st arg from string to enum. All callers
1256 changed.
1257 (INTX): Remove.
1258 (mark_object): Use if, not #if, for GC_MARK_STACK.
1259 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1260 (XSAVE_OBJECT): Now functions, not macros.
1261 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1262 the constant was never used.
1263 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1264 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1265 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1266 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1267 New constants.
1268 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1269 type3 with a single member save_type. All uses changed.
1270 (save_type, set_save_pointer, set_save_integer): New functions.
1271 * print.c (PRINTX): Remove.
1272
1273 * alloc.c: Remove redundant static declarations.
1274
1275 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1276
1277 * window.h (struct window): Convert left_col, top_line, total_lines
1278 and total_cols from Lisp_Objects to integers. Adjust comments.
1279 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1280 Remove.
1281 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1282 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1283 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1284 Adjust users where appropriate.
1285
1286 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1287
1288 * frame.h (struct frame): Drop resx and resy because the same data is
1289 available from window system-specific output context. Adjust users.
1290 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1291 New functions to provide defaults when no window system available.
1292 (FRAME_RES_X, FRAME_RES_Y): New macros.
1293 (NUMVAL): Move from xdisp.c.
1294 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1295 (Ffont_face_attributes, Fopen_font):
1296 * image.c (gs_load):
1297 * w32font.c (fill_in_logfont):
1298 * xdisp.c (calc_pixel_width_or_height):
1299 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1300 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1301
1302 2013-03-20 Kenichi Handa <handa@gnu.org>
1303
1304 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1305 to 1 (temporary workaround until a bug related to ASCII
1306 optimization is fixed).
1307
1308 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1309
1310 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1311 Signal error if window is not internal. Adjust docstring.
1312 (delete_all_child_windows): Use combination_limit to save the buffer.
1313 (Fset_window_configuration): Adjust accordingly.
1314 * print.c (syms_of_print): Initialize debugging output not here...
1315 (init_print_once): ...but in a new function here.
1316 * lisp.h (init_print_once): Add prototype.
1317 * emacs.c (main): Add call to init_print_once. Adjust comments.
1318
1319 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1320
1321 * window.c (window_resize_check, window_resize_apply)
1322 (window_from_coordinates, recombine_windows, set_window_buffer)
1323 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1324 (Fsplit_window_internal, Fdelete_window_internal)
1325 (freeze_window_starts): Use bool for booleans.
1326 * window.h (window_frame_coordinates, resize_frame_windows)
1327 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1328
1329 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1330
1331 * dispnew.c (bitch_at_user): Use `user-error'.
1332
1333 2013-03-17 Ken Brown <kbrown@cornell.edu>
1334
1335 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1336 as return type of image_background. (Bug#13981)
1337 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1338
1339 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1340
1341 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1342 (ns_select): Don't return with result uninitialized.
1343
1344 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1345 and getDirectory.
1346
1347 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1348 New functions.
1349 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1350 directories. If filename is nil, get directory name (Bug#13932).
1351 Use getFilename and getDirectory.
1352 (getFilename, getDirectory): New methods for EmacsSavePanel and
1353 EmacsOpenPanel.
1354 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1355
1356 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1357
1358 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1359
1360 2013-03-15 Kenichi Handa <handa@gnu.org>
1361
1362 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1363 (adjust_after_replace): Make it back to static. Delete the third
1364 arg text_at_gap_tail. Cancel the code for handling it.
1365
1366 * coding.h (struct coding_system): New member eol_seen.
1367
1368 * coding.c (detect_ascii): New function.
1369 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1370 when the source bytes are actually scanned. On detecting for
1371 coding_category_utf_8_auto, call detect_ascii instead of scanning
1372 source bytes directly.
1373 (produce_chars): Call insert_from_gap with the new arg 0.
1374 (encode_coding): Likewise.
1375 (decode_coding_gap): Control ASCII optimization by the variable
1376 disable_ascii_optimization instead of #ifndef .. #endif.
1377 Deccode EOL format according to coding->eol_seen.
1378 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1379 variable.
1380
1381 * lisp.h (adjust_after_replace): Cancel externing it.
1382 (insert_from_gap): Adjust prototype.
1383
1384 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1385
1386 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1387 FULLSCREEN_MAXIMIZED. (Bug#13935)
1388
1389 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1390
1391 * region-cache.c (find_cache_boundary, move_cache_gap)
1392 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1393 Simplify debugging check and convert to eassert. Adjust comment.
1394 (pp_cache): Put under ENABLE_CHECKING.
1395
1396 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1397
1398 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1399 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1400 and WM_ACTIVATEAPP.
1401 (w32fullscreen_hook): If the frame is visible, reset
1402 f->want_fullscreen flag after changing the frame size. If the
1403 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1404 (Bug#13953)
1405
1406 2013-03-13 Daniel Colascione <dancol@dancol.org>
1407
1408 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1409 too so that these builds can use Cygwin's file conversion
1410 functions. (We've been building and linking cygw32.o all along
1411 and just not using it.)
1412
1413 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1414
1415 File synchronization fixes (Bug#13944).
1416 * Makefile.in (LIB_FDATASYNC): New macro.
1417 (LIBES): Use it.
1418 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1419 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1420 Don't worry about HAVE_FSYNC, since a substitute fsync is
1421 available if the system lacks one.
1422 (Fwrite_regin): Retry fsync if interrupted.
1423
1424 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1425
1426 * w32term.c (w32_read_socket): If the Emacs frame is being
1427 activated, call w32fullscreen_hook, to make sure the new frame
1428 dimensions are in effect. (Bug#13937)
1429
1430 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1431
1432 * xdisp.c (init_iterator): Simplify because both character and byte
1433 positions are either specified or -1. Add eassert. Adjust comment.
1434 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1435 character and byte positions can be obtained from marker.
1436
1437 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1438
1439 Static checking by Sun C 5.12.
1440 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1441 * bytecode.c (exec_byte_code):
1442 * dispnew.c (init_display):
1443 * eval.c (error):
1444 * fileio.c (Fsubstitute_in_file_name):
1445 * keyboard.c (Fevent_convert_list):
1446 * keymap.c (Fsingle_key_description):
1447 * term.c (maybe_fatal, fatal):
1448 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1449 * xsmfns.c (Fhandle_save_session):
1450 Omit unreachable code.
1451 * keymap.c (map_keymap_char_table_item): Cast void * to
1452 a function pointer type; the C Standard requires this.
1453
1454 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1455 Include <sys/param.h> unconditionally, as that works elsewhere and
1456 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1457 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1458 and FreeBSD now.
1459
1460 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1461
1462 * insdel.c (adjust_after_replace): Use bool for boolean.
1463
1464 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1465
1466 * keyboard.c: Move keyboard decoding to read_key_sequence.
1467 (decode_keyboard_code): Remove.
1468 (tty_read_avail_input): Don't try to decode input.
1469 (read_decoded_char): New function.
1470 (read_key_sequence): Use it.
1471
1472 2013-03-10 Daniel Colascione <dancol@dancol.org>
1473
1474 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1475 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1476 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1477 w32fns.c.
1478
1479 * w32term.c (construct_drag_n_drop): Use the above macros to make
1480 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1481
1482 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1483 properly display non-ASCII frame titles in cygw32 builds.
1484
1485 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1486 call ShellExecute in cygw32 builds.
1487
1488 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1489 common file dialog code.
1490
1491 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1492 can just use du like other systems.
1493
1494 * coding.c (from_unicode_buffer): Declare.
1495 * coding.c (from_unicode_buffer): Implement.
1496
1497 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1498
1499 * lread.c: Minor cleanup.
1500 (FROM_FILE_P): New macro.
1501 (skip_dyn_bytes, unreadchar, read1): Use it.
1502 (read_list): Consolidate duplicated code.
1503
1504 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1505
1506 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1507
1508 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1509 (redisplay_internal, set_cursor_from_row, try_window)
1510 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1511 (display_line, notice_overwritten_cursor)
1512 (mouse_face_from_buffer_pos, note_mouse_highlight):
1513 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1514 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1515 (mouse_face_from_string_pos, fast_find_string_pos):
1516 Use MATRIX_ROW_VPOS.
1517
1518 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1519
1520 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1521
1522 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1523 MATRIX_MODE_LINE_ROW.
1524
1525 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1526
1527 2013-03-10 handa <handa@gnu.org>
1528
1529 * lisp.h (adjust_after_replace): Extern it.
1530
1531 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1532 case of detection for coding_category_utf_8_auto.
1533 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1534 Skip decoding if all bytes are ASCII.
1535
1536 * insdel.c (adjust_after_replace): Make it public. New arg
1537 text_at_gap_tail.
1538 (adjust_after_insert): Call adjust_after_replace with the new arg
1539 value 0.
1540
1541 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1542
1543 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1544 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1545 from Elisp via unread-command-events.
1546
1547 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1548 functions to mean "no change".
1549
1550 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1551
1552 region-cache.c, scroll.c, search.c: Use bool for booleans.
1553 * lisp.h (compile_pattern):
1554 * scroll.c (do_scrolling, do_direct_scrolling):
1555 * search.c (struct regexp_cache, compile_pattern_1)
1556 (compile_pattern, string_match_1, search_command)
1557 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1558 (search_regs_saved, Fregexp_quote):
1559 Use bool for boolean.
1560 * region-cache.c (region_cache_forward, region_cache_backward):
1561 Fix comments to match code: these functions return int, not boolean.
1562
1563 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1564
1565 * search.c (find_newline): Accept start and end byte positions
1566 as arguments and allow -1 if not known.
1567 (find_newline_no_quit): Likewise for start position.
1568 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1569 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1570 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1571 * editfns.c (Fconstrain_to_field): Break long line.
1572 Adjust call to find_newline.
1573 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1574 Use DEC_BOTH to start next search from the previous buffer
1575 position, where appropriate.
1576 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1577 (get_visually_first_element, move_it_vertically_backward): Likewise.
1578 Obtain byte position from the display iterator, where appropriate.
1579
1580 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1581
1582 print.c, process.c: Use bool for booleans.
1583 * lisp.h (wait_reading_process_output):
1584 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1585 (strout, debug_output_compilation_hack, float_to_string, print)
1586 (print_object):
1587 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1588 (decode_status, status_message, create_process, create_pty)
1589 (Fmake_network_process, Fnetwork_interface_info)
1590 (wait_reading_process_output, read_process_output)
1591 (write_queue_push, write_queue_pop, process_send_signal)
1592 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1593 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1594 Use bool for booleans.
1595 * process.c (Fnetwork_interface_list): Remove unused local.
1596 (connect_counter): Now EMACS_INT, not int.
1597
1598 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1599
1600 * bidi.c (bidi_fetch_char): Swap first and second arguments
1601 to match other functions accepting character and byte positions.
1602 Adjust comment.
1603 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1604 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1605 when you need just to move to the previous buffer position.
1606 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1607
1608 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1609
1610 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1611
1612 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1613
1614 Avoid character to byte conversions in motion subroutines.
1615 * indent.h (compute_motion, vmotion): Add byte position argument.
1616 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1617 Add eassert.
1618 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1619 Use list5 for return value.
1620 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1621 Adjust comments, style and calls to compute_motion.
1622 (Fvertical_motion): Adjust call to vmotion.
1623 * window.c (Fdelete_other_windows_internal): Record window start
1624 byte position and adjust call to vmotion.
1625 (window_scroll_line_based): Likewise with call to compute_motion.
1626 Use SET_PT_BOTH.
1627 (Frecenter): Adjust calls to vmotion.
1628
1629 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1630
1631 * lisp.h (list2i, list3i): New functions.
1632 (list4i): Move from window.c and make LISP_INLINE.
1633 * editfns.c (make_lisp_time):
1634 * fns.c (Flocale_info):
1635 * keyboard.c (parse_modifiers):
1636 * xterm.c (x_ewmh_activate_frame): Use list2i.
1637 * instel.c (signal_after_change):
1638 * nsfns.m (Fx_server_version, Fxw_color_values):
1639 * w32fns.c (Fxw_color_values, Fx_server_version):
1640 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1641 * fileio.c (Fvisited_file_modtime):
1642 * nsfns.m (Fns_display_usable_bounds):
1643 * w32.c (ltime): Use list4i.
1644
1645 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1646
1647 * search.c (find_newline_no_quit): Rename from find_next_newline.
1648 Add commentary.
1649
1650 * lisp.h (find_newline_no_quit): Rename prototype.
1651
1652 * xdisp.c (back_to_previous_line_start)
1653 (forward_to_next_line_start, get_visually_first_element)
1654 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1655 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1656 * bidi.c (bidi_find_paragraph_start): Callers of
1657 find_newline_no_quit changed.
1658
1659 * msdos.c: Change encoding to cp850. (Bug#13879)
1660 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1661
1662 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1663
1664 Coding system support cleanup and minor refactoring.
1665 * coding.h (enum coding_result_code): Remove
1666 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1667 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1668 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1669 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1670 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1671 (decode_coding_region, encode_coding_region, decode_coding_string):
1672 Remove unused compatibility macros.
1673 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1674 (record_conversion_result): Adjust user.
1675 (syms_of_coding): Likewise.
1676 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1677 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1678 (decode_coding_object): Simplify since xrealloc never returns NULL.
1679 Add eassert.
1680
1681 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1682
1683 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1684 * sysdep.c (list_system_processes)
1685 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1686 Make it a stub in this case; otherwise the build might fail,
1687 and this code hasn't been tested on such hosts anyway.
1688 Problem reported by Nelson H. F. Beebe in
1689 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1690 and analyzed by Jérémie Courrèges-Anglas in
1691 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1692
1693 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1694
1695 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1696 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1697 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1698 * bidi.c (bidi_find_paragraph_start): Likewise.
1699 * indent.c (vmotion): Likewise.
1700
1701 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1702
1703 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1704 * filelock.c: Include <c-ctype.h>.
1705 (MAX_LFINFO): New top-level constant.
1706 (lock_info_type): Remove members pid, boot_time. Add members at,
1707 dot, colon. Change user member to be the entire buffer, not a
1708 pointer. This allows us to handle the case where a foreign
1709 pid or boot time exceeds the local range. All uses changed.
1710 (LINKS_MIGHT_NOT_WORK): New constant.
1711 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1712 (defined_WINDOWSNT): Remove.
1713 (MAKE_LOCK_NAME, file_in_lock_file_name):
1714 Always use .#FILE (not .#-FILE) for the file lock,
1715 even if it is a regular file.
1716 (rename_lock_file): New function.
1717 (create_lock_file): Use it.
1718 (create_lock_file, read_lock_data):
1719 Prefer a symbolic link for the lock file, falling back on a
1720 regular file if symlinks don't work. Do not try to create
1721 symlinks on MS-Windows, due to security hassles. Stick with
1722 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1723 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1724 host may be using a Windowsish file system, and cannot use
1725 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1726 doesn't work. Don't fail merely because of a symlink-contents
1727 length limit in the current file system; fall back on regular
1728 files. Increase the symlink contents length limit to 8 KiB, this
1729 should be big enough for any real use and doesn't crunch the
1730 stack.
1731 (create_lock_file, lock_file_1, read_lock_data):
1732 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1733 (lock_file_1): Return error number, not bool. All callers changed.
1734 (ELOOP): New macro, if not already defined.
1735 (read_lock_data): Return size of lock file contents, not Lisp object.
1736 All callers changed. Handle a race condition if some other process
1737 replaces a regular-file lock with a symlink lock or vice versa,
1738 while we're trying to read the lock.
1739 (current_lock_owner): Parse contents more carefully, to help avoid
1740 confusing a regular-file lock with some other application's use
1741 of the file. Check for lock file contents being too long, or
1742 not parsing correctly.
1743 (current_lock_owner, lock_file):
1744 Allow foreign pid and boot times that exceed the local range.
1745 (current_lock_owner, lock_if_free, lock_file):
1746 Simplify allocation of lock file contents.
1747 * w32.c (sys_rename_replace): New function, containing most of
1748 the contents of the old sys_rename.
1749 (sys_rename): Use it.
1750 (fchmod): New dummy function.
1751 * w32.h (sys_rename_replace, fchmod): New decls.
1752
1753 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1754
1755 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1756 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1757 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1758 <dmantipov@yandex.ru>.
1759
1760 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1761
1762 * composite.c (get_composition_id, fill_gstring_header):
1763 Use make_uninit_vector where appropriate.
1764 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1765 * xselect.c (clean_local_selection_data): Likewise.
1766
1767 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1768
1769 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1770 * image.c (imagemagick_load_image): Calculate height and width
1771 after flattening the image, not before.
1772
1773 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1774
1775 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1776 * ftfont.c (ftfont_shape_by_flt): Likewise.
1777 * w32uniscribe.c (uniscribe_shape): Likewise.
1778
1779 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1780
1781 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1782 The old approach, which fell back on DIR/.#FILE.0 through
1783 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1784 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1785 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1786 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1787 because the locking mechanism was never reliable in that case).
1788 This patch fixes this and other bugs discovered by a code
1789 inspection that was prompted by
1790 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1791 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1792 to avoid interoperability problems between the MS-Windows and
1793 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1794 instances of Emacs now ignore each others' locks.
1795 * filelock.c (defined_WINDOWSNT): New constant.
1796 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1797 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1798 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1799 regular files on MS-Windows hosts.
1800 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1801 Use SAFE_ALLOCA to avoid problems with long file names.
1802 (MAX_LFINFO): Now a local constant, not a global macro.
1803 (IS_LOCK_FILE): Remove.
1804 (lock_file_1): Don't inspect errno if symlink call succeeds;
1805 that's not portable.
1806 (lock_file): Document that this function can return if lock
1807 creation fails.
1808 (lock_file): Don't access freed storage.
1809
1810 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1811
1812 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1813
1814 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 * textprop.c: Use bool for booleans.
1817 (validate_interval_range, Fadd_text_properties)
1818 (Fremove_text_properties): Prefer bool to int when either works.
1819
1820 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1821
1822 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1823 If the interval tree changes as a side effect of calling
1824 modify_region, re-do processing starting from the call to
1825 validate_interval_range. (Bug#13743)
1826
1827 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1828
1829 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1830 (Bug#13546).
1831
1832 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1833
1834 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1835 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1836 access to the lock file until it is written and closed.
1837 (Bug#13807)
1838
1839 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 * callint.c (Qcall_interactively):
1842 * macros.c (Qexecute_kbd_macro):
1843 Now static.
1844
1845 2013-02-26 Bastien Guerry <bzg@gnu.org>
1846
1847 * window.c (Frecenter): Tiny docstring enhancement.
1848
1849 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1850
1851 Minor textprop integer cleanup.
1852 * intervals.h, textprop.c (add_text_properties_from_list):
1853 Return void, not int, since nobody uses the return value.
1854 * textprop.c (validate_plist, add_properties, remove_properties)
1855 (Fadd_text_properties):
1856 Don't assume list length fits in int.
1857 (interval_has_all_properties, interval_has_some_properties)
1858 (interval_has_some_properties_list, add_properties, remove_properties)
1859 (Fadd_text_properties, Fremove_text_properties)
1860 (Fremove_list_of_text_properties, text_property_stickiness):
1861 Use bool for booleans.
1862 (Fadd_text_properties, Fremove_text_properties):
1863 (Fremove_list_of_text_properties):
1864 Reindent do-while as per GNU style.
1865
1866 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1867
1868 Implement CLASH_DETECTION for MS-Windows.
1869
1870 * filelock.c [WINDOWSNT]: Include w32.h.
1871 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1872 function of that name. Up-case the macro arguments.
1873 (IS_LOCK_FILE): New macro.
1874 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1875 (create_lock_file): New function, with body extracted from
1876 lock_file_1.
1877 [WINDOWSNT]: Implement lock files by writing a regular file with
1878 the lock information as its contents.
1879 (read_lock_data): New function, on Posix platforms just calls
1880 emacs_readlinkat.
1881 [WINDOWSNT]: Read the lock info from the file.
1882 (current_lock_owner): Call read_lock_data instead of calling
1883 emacs_readlinkat directly.
1884 (lock_file) [WINDOWSNT]: Run the file name through
1885 dostounix_filename.
1886
1887 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1888 just check if the process by that PID exists.
1889
1890 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1891 also present, as doing so will fail to error out if the file
1892 already exists.
1893
1894 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1895
1896 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1897 (Fremove_list_of_text_properties): Skip all of the intervals in
1898 the region between START and END that already have resp. don't
1899 have the requested properties, not just the first one.
1900 Add assertions that the loop afterwards always modifies the
1901 properties. (Bug#13743)
1902
1903 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1904
1905 * callint.c (Fcall_interactively): Use the right lexical environment
1906 for `interactive' specs (bug#13811).
1907 * eval.c (Feval): Accept a lexical environment.
1908
1909 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 Simplify data_start configuration (Bug#13783).
1912 This is a followon simplification to the fix for Bug#13650.
1913 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1914 (START_FILES): Remove. All uses removed.
1915 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1916 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1917 (buildobj.h): Use it.
1918 ($(ALLOBJS)): Depend on globals.h.
1919 (temacs$(EXEEXT)): Use $(ALLOBJS).
1920 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1921 * deps.mk (vm-limit.o):
1922 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1923 Do not depend on mem-limits.h.
1924 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1925 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1926 [__GNUC__ && !ORDINARY_LINK]: Remove.
1927 * mem-limits.h, pre-crt0.c: Remove.
1928 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1929 * unexcoff.c (etext): New decl.
1930 (make_hdr): Use DATA_START instead of start_of_data.
1931 * vm-limit.c: Move most of mem-limits.h's contents here.
1932 (data_start): New decl. It's OK if this is approximate,
1933 so simplify-away some unnecessary exactness.
1934 (POINTER): Remove; all uses removed.
1935 (data_space_start): Now char *, to avoid casts.
1936 (exceeds_lisp_ptr): New function, replacing the old
1937 EXCEEDS_LISP_PTR macro. All uses changed.
1938 (check_memory_limits): Simplify and remove casts.
1939 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1940 (memory_warnings): Use data_start instead of start_of_data.
1941
1942 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1943
1944 * xdisp.c (set_message): Only check for debug-on-message if STRING
1945 is a string. (Bug#13797)
1946
1947 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1948
1949 Fix regression introduced by July 10 filelock.c patch.
1950 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1951 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1952 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1953 and diagnosed by Andreas Schwab in
1954 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1955
1956 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1957
1958 Assume C89 or better.
1959 * ralloc.c (SIZE, POINTER, NIL):
1960 * vm-limit.c (POINTER):
1961 Remove, replacing all uses with C89 equivalents. These old
1962 symbols were present only for porting to pre-C89 platforms.
1963
1964 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1965
1966 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1967 This avoids warning messages reported as part of Bug#13546.
1968
1969 2013-02-21 Ken Brown <kbrown@cornell.edu>
1970
1971 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1972
1973 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1974
1975 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1976
1977 * keyboard.c (Qcommand_execute): New var.
1978 (command_loop_1, read_char): Use it.
1979 (Fcommand_execute): Remove, replace by an Elisp implementation.
1980 (syms_of_keyboard): Adjust accordingly.
1981
1982 2013-02-19 Daniel Colascione <dancol@dancol.org>
1983
1984 * sheap.c (report_sheap_usage): Use message, not message1, so
1985 that we don't try to create a buffer while we're in the middle
1986 of dumping Emacs. Explain why.
1987
1988 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1989
1990 * search.c (find_newline): Return byte position in bytepos.
1991 Adjust comment.
1992 (find_next_newline_no_quit, find_before_next_newline):
1993 Add bytepos argument.
1994 * lisp.h (find_newline, find_next_newline_no_quit)
1995 (find_before_next_newline): Adjust prototypes.
1996 * bidi.c (bidi_find_paragraph_start):
1997 * editfns.c (Fconstrain_to_field, Fline_end_position):
1998 * indent.c (compute_motion, vmotion):
1999 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2000 (get_visually_first_element, move_it_vertically_backward):
2001 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2002
2003 2013-02-19 Eli Zaretskii <eliz@gnu.org>
2004
2005 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2006 resources were not orderly released.
2007
2008 2013-02-17 Eli Zaretskii <eliz@gnu.org>
2009
2010 * xdisp.c (x_draw_vertical_border): For a window that is neither
2011 the leftmost nor the rightmost, redraw both the left and the right
2012 vertical borders. (Bug#13723)
2013
2014 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2015
2016 * xml.c (init_libxml2_functions):
2017 * sound.c (sound_warning):
2018 * sheap.c (report_sheap_usage):
2019 * process.c (wait_reading_process_output):
2020 * msdos.c (XMenuActivate):
2021 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2022 * keyboard.c (top_level_1):
2023 * editfns.c (Fmessage, Fmessage_box):
2024 * callint.c (Fcall_interactively):
2025 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2026
2027 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2028
2029 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2030 * frame.c (syms_of_frame): ... to here.
2031
2032 2013-02-16 Eli Zaretskii <eliz@gnu.org>
2033
2034 * w32.c (sys_chown): Remove unused function.
2035
2036 * w32term.c <input_signal_count>: Declare 'volatile'
2037 unconditionally. (Bug#9066)
2038
2039 * w32.c (set_errno): Reset h_errno and don't set it to any other
2040 value. Set errno instead.
2041 (check_errno): Reset h_errno.
2042 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2043 (sys_gethostname, sys_getservbyname, sys_getpeername)
2044 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2045 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2046 h_errno.
2047 (sys_gethostbyname): Set h_errno only errors detected.
2048
2049 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2052
2053 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2054
2055 * keyboard.c (read_char): Fix calculation of auto-save time out
2056 when auto-save-timeout is less than 4. (Bug#13720)
2057
2058 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2059 time. Improve diagnostics in DebPrint. (Bug#13546)
2060
2061 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2062 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2063 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2064 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2065 make sure errno is set to an appropriate value. (Bug#13546)
2066 (socket_to_fd): Add assertion against indexing fd_info[] with a
2067 value that is out of bounds.
2068 (sys_accept): If fd is negative, do not set up the child_process
2069 structure for reading.
2070
2071 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2072
2073 * composite.c (fill_gstring_header): Remove useless prototype.
2074 Break long line.
2075 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2076 * print.c (PRINTDECLARE, print_object):
2077 * search.c (compile_pattern, fast_looking_at, search_buffer):
2078 (simple_search, boyer_moore, Freplace_match):
2079 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2080 (get_overlay_arrow_glyph_row, display_mode_element):
2081 (decode_mode_spec_coding, message3):
2082 * xfaces.c (face_at_string_position): Use bool for booleans.
2083 Adjust comments.
2084
2085 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2086
2087 Fix AIX port (Bug#13650).
2088 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2089 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2090 was #undeffed earlier, so it cannot be used as a macro here.
2091 Use the constant and not the macro.
2092
2093 2013-02-15 Eli Zaretskii <eliz@gnu.org>
2094
2095 * w32proc.c (new_child): If no vacant slots are found in
2096 child_procs[], make another pass looking for slots whose process
2097 has exited or died. (Bug#13546)
2098
2099 * w32.c (sys_pipe): When failing due to file descriptors above
2100 MAXDESC, set errno to EMFILE.
2101 (_sys_read_ahead): Update cp->status when failing to read serial
2102 communications input, so that the status doesn't stay at
2103 STATUS_READ_IN_PROGRESS. (Bug#13546)
2104
2105 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2106
2107 * gtkutil.c (tb_size_cb): New function.
2108 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2109
2110 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2111
2112 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2113 an event.
2114
2115 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2116
2117 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2118
2119 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 * font.c (font_range): Add pos_byte argument. Adjust comment
2122 and break long line.
2123 * font.h (font_range): Adjust prototype.
2124 * composite.c (autocmp_chars): Pass byte position to font_range.
2125 Break long line. Remove useless prototype and format comment.
2126
2127 2013-02-13 Glenn Morris <rgm@gnu.org>
2128
2129 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2130
2131 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2132
2133 Improve AIX port some more (Bug#13650).
2134 With this, it should be as good as it was in 23.3, though it's
2135 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2136 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2137 * unexaix.c (start_of_text): Remove.
2138 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2139 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2140 (orig_load_scnptr, orig_data_scnptr):
2141 Now off_t, not long, since they are file offsets.
2142 (make_hdr): Use _data, not start_of_data ().
2143 This is the key part of the fix.
2144 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2145 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2146
2147 * pre-crt0.c (data_start): Initialize to 1.
2148 This ports to compilers that optimize the external declaration
2149 'int x = 0;' as if it were 'int x;' to shrink the executable.
2150
2151 Improve AIX port (Bug#13650).
2152 This doesn't fix the bug, but it makes progress: Emacs builds now.
2153 * unexaix.c: Include inttypes.h, stdarg.h.
2154 (report_error, report_error_1): Mark as _Noreturn.
2155 (report_error): Don't report the wrong errno.
2156 (report_error_1): Now varargs. All callers changed.
2157 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2158 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2159 (write_ptr): Use %p to print address rather than %lx and a cast
2160 to unsigned long. Grow buffer a bit, to be safer.
2161
2162 2013-02-13 Eli Zaretskii <eliz@gnu.org>
2163
2164 * bidi.c (bidi_resolve_neutral): After finding the next
2165 non-neutral character, accept NEUTRAL_ON type as well, because
2166 directional control characters, such as LRE and RLE, have their
2167 type converted to that by bidi_resolve_weak. This avoids aborts
2168 when LRE/RLE follows a run of neutrals.
2169 (bidi_move_to_visually_next): Assert that return value of
2170 bidi_peek_at_next_level is non-negative. Negative values will
2171 cause an infloop.
2172
2173 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2174
2175 Minor getenv-related fixes.
2176 * callproc.c (Fcall_process_region) [!DOS_NT]:
2177 Avoid unnecessary duplicate call to getenv.
2178 * callproc.c (init_callproc):
2179 * dispnew.c (init_display):
2180 * sysdep.c (sys_subshell):
2181 Omit unnecessary cast of getenv or egetenv.
2182
2183 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
2184
2185 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2186 Update dependencies.
2187
2188 2013-02-12 Eli Zaretskii <eliz@gnu.org>
2189
2190 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2191 marker's position.
2192 (display_line): Set w->region_showing to the value of
2193 it->region_beg_charpos, not to -1. This fixes redisplay
2194 optimization when cursor is moved up after M->. (Bug#13623)
2195 (Bug#13626)
2196 (try_scrolling): Scroll text up more if point is too close to ZV
2197 and inside the scroll margin. This makes sure point is moved
2198 outside the scroll margin in these cases.
2199
2200 * window.h (struct window): region_showing can no longer be
2201 negative.
2202
2203 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2204
2205 Tune by using memchr and memrchr.
2206 * doc.c (Fsnarf_documentation):
2207 * fileio.c (Fsubstitute_in_file_name):
2208 * search.c (find_newline, scan_newline):
2209 * xdisp.c (pos_visible_p, display_count_lines):
2210 Use memchr and memrchr rather than scanning byte-by-byte.
2211 * search.c (find_newline): Rename from scan_buffer.
2212 Omit first arg TARGET, as it's always '\n'. All callers changed.
2213
2214 Clean up read_key_sequence a tiny bit more.
2215 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2216 (read_key_sequence): Remove unused locals.
2217
2218 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2219
2220 Clean up read_key_sequence a bit; reread active keymaps after first event.
2221 * keyboard.c (read_char, read_char_x_menu_prompt)
2222 (read_char_minibuf_menu_prompt):
2223 Replace nmaps+maps with a single `map' arg.
2224 (follow_key): Operate on a single map.
2225 (active_maps): New function.
2226 (test_undefined): Also return true for nil bindings.
2227 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2228 a single (composed) keymap. Remember `first_event' to choose the right
2229 set of active keymaps. Recompute the set of keymaps after receiving
2230 the first event. Remove GOBBLE_FIRST_EVENT.
2231 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2232 * keyboard.h (read_char): Update declaration.
2233 * lread.c (read_filtered_event): Adjust call to read_char.
2234
2235 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2236
2237 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2238 Don't use the limitation on backwards movement when lines are truncated
2239 in the window. (Bug#13675)
2240
2241 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2242
2243 * marker.c (set_marker_internal): If desired position is passed
2244 as a marker, avoid call to buf_charpos_to_bytepos.
2245 * window.c (Fset_window_point): Omit redundant type checking.
2246 (Fset_window_start): Likewise. Format comment.
2247 (window_scroll_pixel_based): Use set_marker_restricted_both
2248 with character and byte positions obtained from an iterator.
2249 (Fset_window_configuration): Use set_marker_restricted_both.
2250 * xdisp.c (message_dolog): Likewise.
2251
2252 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2253
2254 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2255 When text lines are longer than window's screen lines, don't move back
2256 too far. This speeds up some redisplay operations. (Bug#13675)
2257
2258 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2259
2260 * syntax.c (scan_sexps_forward): Fix byte position calculation
2261 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2262
2263 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2264
2265 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2266 that was not needed.
2267
2268 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2269
2270 Minor hashing refactoring.
2271 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2272 (sxhash_float): Return EMACS_UINT, for consistency with the other
2273 hash functions.
2274 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2275 non-static inline function and therefore can't use static vars.
2276 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2277 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2278 with the other hash functions.
2279
2280 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2281
2282 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2283 XXXXXX part of the temporary file pattern is not downcased even
2284 when w32-downcase-file-names is non-nil. (Bug#13661)
2285
2286 * xdisp.c (decode_mode_spec): Remove handling of %t.
2287
2288 * msdos.c (careadlinkatcwd): Remove.
2289
2290 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2291
2292 * lread.c (skip_dyn_bytes): New function (bug#12598).
2293 (read1): Use it. Use getc instead of READCHAR to read bytes.
2294 (load_each_byte): Remove. Update users.
2295
2296 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2297
2298 * search.c (scan_buffer): Calculate end byte position just once.
2299 (scan_newline): Do not recalculate start_byte.
2300 (search_command): Use eassert.
2301 * syntax.c (struct lisp_parse_state): New member location_byte.
2302 (scan_sexps_forward): Record from_byte and avoid redundant
2303 character to byte position calculation ...
2304 (Fparse_partial_sexp): ... here. Break too long line.
2305
2306 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2307
2308 * lisp.h (make_uninit_vector): New function.
2309 * alloc.c (Fvector, Fmake_byte_code):
2310 * ccl.c (Fregister_ccl_program):
2311 * charset.c (Fdefine_charset_internal, define_charset_internal):
2312 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2313 * composite.c (syms_of_composite):
2314 * font.c (Fquery_font, Ffont_info, syms_of_font):
2315 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2316 * ftfont.c (ftfont_shape_by_flt):
2317 * indent.c (recompute_width_table):
2318 * nsselect.m (clean_local_selection_data):
2319 * syntax.c (init_syntax_once):
2320 * w32unsubscribe.c (uniscribe_shape):
2321 * window.c (Fcurrent_window_configuration):
2322 * xfaces.c (Fx_family_fonts):
2323 * xselect.c (selection_data_to_lisp_data): Use it.
2324
2325 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2326
2327 * coding.c (Fdefine_coding_system_internal): Use AREF where
2328 argument is known to be a vector.
2329 * fns.c (Flocale_info): Likewise for ASET.
2330 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2331 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2332
2333 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2334
2335 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2336 height.
2337
2338 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2339 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2340 updateCollectionBehaviour.
2341
2342 * nsterm.m (NEW_STYLE_FS): Remove.
2343 (ns_last_use_native_fullscreen): New variable.
2344 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2345 (x_set_window_size): Do not take title bar and tool bar into account
2346 if isFullscreen returns YES.
2347 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2348 (check_native_fs): New function.
2349 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2350 (ns_term_init): Remove NEW_STYLE_FS.
2351 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2352 and tool bar if isFullscreen returns NO.
2353 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2354 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2355 with HAVE_NATIVE_FS.
2356 (window:willUseFullScreenPresentationOptions:): New method.
2357 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2358 Hide toolbar if not enabled (Bug#13444).
2359 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2360 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2361 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2362 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2363 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2364 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2365 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2366 (syms_of_nsterm): Add ns-use-native-fullscreen.
2367
2368 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2369
2370 * fileio.c (Qchoose_write_coding_system): Now static.
2371
2372 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2373
2374 * xdisp.c (window_buffer_changed): region_showing can be negative,
2375 which still means region is being displayed.
2376 (redisplay_internal): Resurrect code that forced redisplay of the
2377 whole window when showing region and the mark has changed.
2378 Record the new mark position to allow redisplay optimizations.
2379 (display_line): If it->region_beg_charpos is non-zero, set the
2380 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2381
2382 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2383 not bitfield of 1 bit.
2384
2385 2013-02-03 Daniel Colascione <dancol@dancol.org>
2386
2387 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2388 daemon mode works on cygw32 when Emacs is installed and not just
2389 during development.
2390
2391 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2392
2393 Avoid file time stamp bug on MS-Windows (Bug#13149).
2394 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2395 as FAT32 doesn't update time stamps when truncating them.
2396 Also, check that a file time stamp is not a multiple of 100 ns;
2397 this should catch all instances of the problem on MS-Windows,
2398 as its native file system resolution is 100 ns or worse, and
2399 checking for a non-multiple of 100 ns should impose only a small
2400 overhead on systems with ns resolution.
2401
2402 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2403
2404 Avoid encoding file names on MS-Windows when they need to be run
2405 through dostounix_filename.
2406 * w32.c (normalize_filename): Accept an additional argument
2407 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2408 downcase it even if w32-downcase-file-names is non-nil.
2409 (dostounix_filename): Accept an additional argument MULTIBYTE and
2410 pass it to normalize_filename.
2411 (emacs_root_dir): Adjust.
2412
2413 * msdos.h (dostounix_filename): Adjust prototype.
2414
2415 * w32.h (dostounix_filename): Adjust prototype.
2416
2417 * msdos.c (dostounix_filename): Accept an additional argument and
2418 ignore it.
2419 (init_environment): Adjust callers of dostounix_filename.
2420
2421 * fileio.c (Ffile_name_directory, file_name_as_directory)
2422 (directory_file_name, Fexpand_file_name)
2423 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2424 dostounix_filename.
2425 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2426 non-nil.
2427 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2428 variables, as egetenv is case-insensitive for DOS_NT.
2429
2430 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2431 with an encoded file name.
2432
2433 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2434 Adjust calls to dostounix_filename.
2435
2436 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2437
2438 * unexw32.c (unexec): Adjust call to dostounix_filename.
2439
2440 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2441
2442 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2443 dostounix_filename.
2444
2445 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2446 dostounix_filename.
2447
2448 * callproc.c (Fcall_process): Make sure program name in PATH and
2449 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2450 is passed to exec/spawnve, which fails unless the file-name
2451 encoding is UTF-8.
2452
2453 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2454 even if w32-quote-process-args is nil.
2455
2456 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2457
2458 Fix timestamp bug when write-region appends nothing (Bug#13149).
2459 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2460 the file's time stamp doesn't change if Emacs happens to write nothing
2461 to the file, and on a buggy file system this could cause Emacs to
2462 incorrectly infer that the file system doesn't have the bug.
2463 Avoid this problem by inhibiting the inference in this case.
2464
2465 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2466
2467 * window.h (struct window): Convert base_line_number, base_line_pos
2468 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2469 Convert region_showing member from Lisp_Object to bitfield.
2470 Remove sequence_number member. Adjust comments.
2471 * window.c (sequence_number): Remove.
2472 (make_window): Initialize column_number_displayed.
2473 * print.c (print_object): Follow the printed representation of
2474 frames and print window pointer to distinguish between windows.
2475 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2476 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2477 (wset_column_number_displayed, wset_region_showing): Remove.
2478 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2479 (try_scrolling, try_cursor_movement, redisplay_window)
2480 (try_window_reusing_current_matrix, try_window_id, display_line)
2481 (display_mode_lines, decode_mode_spec): Adjust users.
2482 * .gdbinit (pwinx): Do not print sequence_number.
2483
2484 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2485
2486 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2487 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2488 * dired.c: Include <fcntl.h>.
2489 (open_directory): New function, which uses open and fdopendir
2490 rather than opendir. DOS_NT platforms still use opendir, though.
2491 (directory_files_internal, file_name_completion): Use it.
2492 (file_attributes): New function, with most of the old Ffile_attributes.
2493 (directory_files_internal, Ffile_attributes): Use it.
2494 (file_attributes, file_name_completion_stat): First arg is now fd,
2495 not dir name. All uses changed. Use fstatat rather than lstat +
2496 stat.
2497 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2498 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2499 (emacs_readlinkat): New function, with much of the old
2500 Ffile_symlink_p, but with an fd argument for speed.
2501 It uses readlinkat rather than careadlinkatcwd, so that it
2502 need not assume the working directory.
2503 (Ffile_symlink_p): Use it.
2504 * filelock.c (current_lock_owner): Use emacs_readlinkat
2505 rather than emacs_readlink.
2506 * lisp.h (emacs_readlinkat): New decl.
2507 (READLINK_BUFSIZE, emacs_readlink): Remove.
2508 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2509 (emacs_norealloc_allocator, emacs_readlink): Remove.
2510 This stuff is moved to fileio.c.
2511 * w32.c (fstatat, readlinkat): New functions.
2512 (careadlinkat): Don't check that fd == AT_FDCWD.
2513 (careadlinkatcwd): Remove; no longer needed.
2514
2515 2013-01-31 Glenn Morris <rgm@gnu.org>
2516
2517 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2518 (Fwrite_region): Update for new choose_write_coding_system args.
2519 Move the last piece of choose_write_coding_system here. (Bug#13522)
2520 (syms_of_fileio): Add choose-write-coding-system.
2521
2522 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2523
2524 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2525 (sys_close): Zero out the flags for the file descriptor before
2526 closing it. (Bug#13546)
2527
2528 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2529 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2530 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2531 DBCS. (Bug#13553)
2532
2533 * w32.c (w32_get_long_filename, init_environment, readlink):
2534 Support file names encoded in DBCS codepages.
2535 (readlink): Use the current file-name-coding-system, not the ANSI
2536 codepage, to decode and handle targets of symlinks.
2537
2538 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2539
2540 * w32.c (opendir): Now accepts a 'const char *'.
2541
2542 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2543
2544 Remove obsolete redisplay code. See the discussion at
2545 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2546 * dispnew.c (preemption_period, preemption_next_check): Remove.
2547 (Vredisplay_preemption_period): Likewise.
2548 (update_frame, update_single_window, update_window, update_frame_1):
2549 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2550 used, following the 2012-06-22 change.
2551
2552 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2553
2554 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2555
2556 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2557
2558 * font.c (num_fonts): Remove the leftover from old
2559 debugging code. Adjust comment style here and there.
2560 * insdel.c (insert_1): Remove.
2561 * lisp.h (insert_1): Remove prototype.
2562 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2563
2564 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2565
2566 * w32.c (max_filename_mbslen): New function.
2567 (normalize_filename, readdir): Use it to detect locales where ANSI
2568 encoding of file names uses a double-byte character set (DBCS).
2569 If a DBCS encoding is used, advance by characters using
2570 CharNextExA, instead of incrementing a 'char *' pointer.
2571 Use _mbslwr instead of _strlwr. (Bug#13515)
2572
2573 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2574 request of memory reservation to 1.7GB. (Bug#13065)
2575
2576 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2577
2578 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2579 at check_extra_latin label. (Bug#13505)
2580
2581 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2582
2583 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2584 Avoid redundant calls to strlen.
2585
2586 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 Drop async_visible and async_iconified fields of struct frame.
2589 This is possible because async input is gone; for details, see
2590 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2591 * frame.h (struct frame): Remove async_visible and async_iconified
2592 members, convert garbaged to unsigned bitfield. Adjust comments.
2593 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2594 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2595 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2596 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2597 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2598 * w32term.c: Ditto.
2599 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2600 properly. Likewise for obscured.
2601 * xterm.c: Ditto.
2602 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2603 properly.
2604 * nsterm.m: Ditto.
2605 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2606
2607 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2608
2609 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2610 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2611
2612 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2613
2614 * xdisp.c (message2, message2_nolog): Remove functions.
2615 (message3, message3_nolog): Extract nbytes and multibyteness directly
2616 from the string. Change all callers.
2617 (message3_nolog): Don't set message_enable_multibyte since set_message
2618 will reset it anyway.
2619 (message1, message1_nolog): Use message3.
2620 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2621 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2622 (set_message): Drop all but the second arg, which has to be a string.
2623 (set_message_1): Simplify now that we know that a1 is NULL and the
2624 second arg is a string.
2625 * frame.h (struct frame): Remove `message_buf' field.
2626 Use glyphs_initialized_p instead.
2627 (FRAME_MESSAGE_BUF): Remove macro.
2628 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2629 * lisp.h (message2, message2_nolog): Remove declarations.
2630 (message3, message3_nolog): Update declarations.
2631 * keyboard.c (read_char_minibuf_menu_text)
2632 (read_char_minibuf_menu_width): Remove vars.
2633 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2634 to correctly handle multibyte strings.
2635 * frame.c (delete_frame): Don't free message_buf any more.
2636 * editfns.c (message_text, message_length): Remove vars.
2637 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2638 * fileio.c (auto_save_error): Use message3 instead of message2.
2639 * dispnew.c (adjust_frame_message_buffer): Remove function.
2640
2641 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2642
2643 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2644 real estate used for the tool bar and the menu bar.
2645
2646 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2647
2648 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2649 hidden buffer is prepared to modification (Bug#13164).
2650
2651 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 * window.h (struct window): Change window_end_valid member from
2654 Lisp_Object to a bitfield. Adjust comments.
2655 (wset_window_end_valid): Remove.
2656 * window.c (adjust_window_count): Clear window_end_valid.
2657 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2658 (Fwindow_line_height, set_window_buffer, Frecenter)
2659 (Fsplit_window_internal, Fdelete_other_windows_internal)
2660 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2661 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2662 * xdisp.c (check_window_end, reconsider_clip_changes)
2663 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2664 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2665 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2666
2667 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2668
2669 * xdisp.c (mark_window_display_accurate): Simplify the loop
2670 assuming that the only one of vchild, hchild or buffer window
2671 slots is non-nil. Call mark_window_display_accurate_1 for
2672 the leaf windows only.
2673 (mark_window_display_accurate_1): Always assume leaf window.
2674 Adjust comment.
2675
2676 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 * emacs.c (Qkill_emacs_hook): Now static.
2679
2680 * fileio.c (Finsert_file_contents): Simplify.
2681 Remove unnecessary assignments and tests.
2682
2683 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2684
2685 * w32.c (acl_set_file): Don't test for errors unless
2686 set_file_security returns FALSE. Avoids spurious errors when
2687 saving files.
2688
2689 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2690
2691 * fileio.c (Finsert_file_contents): Revert code introduced at
2692 2013-01-18 in favor of the simpler and generally better fix.
2693 Save stack space by removing 'buffer' and reusing 'read_buf'
2694 where appropriate.
2695
2696 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 * lisp.h (eabs): Define unconditionally (Bug#13419).
2699 The old "#if !defined (eabs)" was an unnecessary revenant of back
2700 when this macro was called "abs". Document 'eabs' better.
2701
2702 2013-01-19 Glenn Morris <rgm@gnu.org>
2703
2704 * fns.c (Frandom): Doc fix.
2705
2706 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2707
2708 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2709 segfault when there are lots of overlays.
2710
2711 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2712 when there are lots of overlays.
2713 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2714 for the details and a way to reproduce.
2715
2716 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2717
2718 * fileio.c: Use O_APPEND to append.
2719 This corresponds better to the natural interpretation of "append",
2720 and avoids the need to open the output file twice, or to invoke
2721 lseek when APPEND is neither nil nor a number.
2722 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2723 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2724 file possibly twice, and lseeking to its end; this avoids the
2725 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2726 at the same time: the combination is never needed and apparently
2727 it doesn't work with DOS_NT.
2728
2729 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2730 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2731
2732 Allow floating-point file offsets.
2733 Problem reported by Vitalie Spinu in
2734 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2735 * fileio.c (emacs_lseek): Remove.
2736 (file_offset): New function.
2737 (Finsert_file_contents, Fwrite_region): Use it.
2738
2739 2013-01-19 Chong Yidong <cyd@gnu.org>
2740
2741 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2742 aborting on Fsignal (Bug#13289).
2743
2744 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2745
2746 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2747 set_file_security as failure due to insufficient privileges.
2748 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2749 (fstat): Return owner and group like 'stat' and 'lstat' do.
2750
2751 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2752
2753 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2754 The bug was observed on Ubuntu operating inside a virtual machine,
2755 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2756 The workaround introduces a race condition on non-buggy hosts,
2757 but it's an unlikely race and anyway there's a nearly identical
2758 nearby race that can't be fixed.
2759 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2760 New static vars.
2761 (Fwrite_region): Test for file system time stamp bug.
2762 (init_fileio): New function.
2763 * lisp.h (init_fileio): Declare it.
2764 * emacs.c (main): Call it.
2765
2766 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2767 and make it more consistent with other stat-failure diagnostics.
2768
2769 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2770
2771 Fix crash when inserting data from non-regular files.
2772 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2773 for the error description produced by valgrind.
2774 * fileio.c (read_non_regular): Rename to read_contents.
2775 Free Lisp_Save_Value object used to pass parameters.
2776 (read_non_regular_quit): Rename to read_contents_quit.
2777 (Finsert_file_contents): Redesign internal file reading loop to adjust
2778 gap and end positions after each read and so help make_gap to work
2779 properly. Do not signal an I/O error too early and so do not leave
2780 not yet decoded characters in a buffer, which was the reason of
2781 redisplay crash. Use list2 to build return value. Adjust comments.
2782
2783 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 Close a race when statting and reading files (Bug#13149).
2786 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2787 This avoids a race if the file is renamed between stat and open.
2788 This race is not the problem originally noted in Bug#13149;
2789 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2790
2791 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2792
2793 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2794 objects, related functions and macros.
2795 (make_save_value): Adjust prototype.
2796 (make_save_pointer): New prototype.
2797 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2798 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2799 * alloc.c (format_save_value): Rename to make_save_value.
2800 (make_save_pointer): New function.
2801 (record_xmalloc): Use make_save_pointer.
2802 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2803 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2804 Change users of make_save_value to make_save_pointer.
2805 Likewise for format_save_value and make_save_value.
2806
2807 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2808
2809 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2810 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2811 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2812 debugging stubs.
2813
2814 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2815
2816 * alloc.c (free_save_value): Now static.
2817
2818 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2819
2820 * keymap.c (map_keymap_internal): Use format_save_value.
2821 (map_keymap_char_table_item): Adjust accordingly.
2822 * fileio.c (non_regular_fd, non_regular_inserted)
2823 (non_regular_nbytes): Remove.
2824 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2825 Use format_save_value to pass parameters to read_non_regular.
2826 (read_non_regular): Use XSAVE_ macros to extract parameters.
2827 Adjust comment.
2828 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2829 format_save_value.
2830 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2831
2832 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2833
2834 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2835 extraction from any Lisp_Save_Value slot. Add type checking.
2836 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2837 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2838 * xselect.c: All users changed.
2839
2840 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2841
2842 Some convenient bits to deal with Lisp_Save_Values.
2843 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2844 (allocate_misc): Remove prototype.
2845 (format_save_value): New prototype.
2846 * alloc.c (allocate_misc): Revert back to static.
2847 (format_save_value): New function to build Lisp_Save_Value
2848 object with the specified internal structure.
2849 (make_save_value): Reimplement using format_save_value.
2850 * editfns.c (save_excursion_save): Use format_save_value.
2851 (save_excursion_restore): Use XSAVE_OBJECT.
2852
2853 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2854
2855 Avoid needless casts with XSAVE_POINTER.
2856 * alloc.c (mark_object) [GC_MARK_STACK]:
2857 * dired.c (directory_files_internal_unwind):
2858 * fileio.c (do_auto_save_unwind):
2859 * gtkutil.c (pop_down_dialog):
2860 * keymap.c (map_keymap_char_table_item):
2861 * lread.c (load_unwind):
2862 * nsmenu.m (pop_down_menu):
2863 * print.c (print_object) [GC_MARK_STACK]:
2864 * xfns.c (clean_up_file_dialog):
2865 * xmenu.c (cleanup_widget_value_tree):
2866 Omit casts between XSAVE_POINTER and a pointer type.
2867
2868 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2871 * eval.c (eval_sub): Protect `form' from being GCed before its
2872 car and cdr becomes protected with the backtrace entry.
2873
2874 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2875
2876 Make Lisp_Save_Value more versatile storage for up to four objects.
2877 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2878 (struct Lisp_Save_Value): New layout. Adjust comments.
2879 (XSAVE_POINTER): New macro.
2880 (XSAVE_INTEGER): Likewise.
2881 (allocate_misc): Add prototype.
2882 (free_misc): Likewise.
2883 * alloc.c (allocate_misc): Now global.
2884 (free_misc): Likewise. Adjust comment.
2885 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2886 (free_save_value): Likewise.
2887 (mark_object): Likewise.
2888 * editfns.c (save_excursion_save): Pack everything within
2889 Lisp_Save_Value and so avoid xmalloc.
2890 (save_excursion_restore): Adjust to match new layout. Use free_misc
2891 because we do not allocate extra memory any more. Add eassert.
2892 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2893 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2894 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2895 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2896 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2897
2898 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2899
2900 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2901 (nsfont_draw): Remove disabling of LCD smoothing.
2902 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2903 Bug#11484 with LCD smoothing on.
2904
2905 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2906
2907 Fix SIGDANGER handlers, for AIX (Bug#13408).
2908 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2909 Move handlers here from emacs.c; they were out of place.
2910
2911 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2912
2913 * xterm.c (syms_of_xterm): Adjust documentation for
2914 scroll-bar-adjust-thumb-portion.
2915
2916 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2917
2918 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2919 determine whether scroll bar thumb size should be adjusted or
2920 not. Use variable for MOTIF.
2921
2922 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2923 GTK.
2924
2925 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2926
2927 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2928 event is generated.
2929 (doCommandBySelector:): Set processingCompose to NO.
2930
2931 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2932 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2933 (nsfont_list_family): Add block/unblock_input calls.
2934 (nsfont_open): Move block_input earlier. Add unblock_input before early
2935 return.
2936 (nsfont_draw): Add block/unblock_input calls.
2937
2938 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2939
2940 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2941 for old_charpos and old_bytepos.
2942
2943 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2946 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2947 Clear tzvalbuf_in_environ if this workaround is in effect.
2948 Problem and fix reported by Kazuhiro Ito.
2949
2950 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2951
2952 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2953 Fix ambiguous doc string cross-reference(s).
2954
2955 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2956 doc string cross-reference(s).
2957
2958 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2959 string cross-reference(s).
2960
2961 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2962
2963 Avoid unnecessary byte position calculation for the gap movement.
2964 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2965 anyway, all of them should use move_gap_both instead.
2966 * lisp.h (move_gap): Remove prototype.
2967 * insdel.c (move_gap): Remove.
2968 (move_gap_both): Add eassert.
2969 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2970 * xml.c (parse_region): Likewise.
2971
2972 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2973
2974 emacsclient -t should not suspend Emacs server (Bug#13387)
2975 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2976 New functions.
2977 * term.c (init_tty): Use them instead of rolling our own code.
2978 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2979 switches from 'signal' to 'pthread_sigmask', which is safer in
2980 multithreaded applications.
2981 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2982 which has already arranged for that.
2983 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2984 This is the main part of the bug fix.
2985
2986 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2987
2988 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2989 x_last_font_name (Bug#13403).
2990
2991 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2992
2993 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2994 the type of per-buffer values where appropriate.
2995 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2996 predicate, which is how it's really used now. Adjust comment.
2997 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2998 * buffer.c (buffer_slot_type_mismatch): Remove.
2999 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3000 predicate. Adjust comment.
3001 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3002 fill-column, left-margin, tab-width, buffer-saved-size,
3003 left-margin-width, right-margin-width, left-fringe-width,
3004 right-fringe-width, scroll-bar-width and buffer-display-count.
3005 Use Qstringp for default-directory, buffer-file-name,
3006 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3007 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3008 line-spacing.
3009 * data.c (store_symval_forwarding): Adjust to call the predicate.
3010
3011 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
3012
3013 * w32.c (get_name_and_id, acl_set_file):
3014 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3015
3016 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 * lisp.h (make_gap_1): New prototype.
3019 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3020 gap size values.
3021 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3022 naming convention.
3023 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3024 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3025 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3026 (make_gap_1): New function to adjust the gap of any buffer.
3027 * coding.c (coding_alloc_by_making_gap): Use it.
3028 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3029 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3030
3031 2013-01-08 Juri Linkov <juri@jurta.org>
3032
3033 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3034 of (supports :underline (:style wave)). (Bug#13000)
3035
3036 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3037
3038 * undo.c (Fprimitive_undo): Move to simple.el.
3039 (syms_of_undo): Remove declarations for Sprimitive_undo.
3040
3041 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3042
3043 * keyboard.c (echo_add_key): Rename from echo_add_char.
3044
3045 2013-01-06 Chong Yidong <cyd@gnu.org>
3046
3047 * keyboard.c (echo_add_char): New function, factored out from
3048 echo_char. Don't add a space if the previous echo string was
3049 empty (Bug#13255).
3050 (echo_char): Use it.
3051 (read_key_sequence): When echoing mock input, ensure that the
3052 trailing dash is properly added.
3053
3054 2013-01-05 Eli Zaretskii <eliz@gnu.org>
3055
3056 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3057 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3058 digits for buffer positions, before misalignment starts.
3059 Display "0" for integer "object" field.
3060 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3061 Display the newline glyph more unambiguously.
3062
3063 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3064
3065 * nsterm.m (ns_draw_underwave):
3066 * w32term.c (w32_draw_underwave):
3067 * xterm.c (x_draw_underwave): Make underwave look more triangular
3068 and also degrade gracefully for small fonts. (Bug#13000)
3069
3070 * nsterm.m (ns_draw_text_decoration):
3071 * w32term.c (x_draw_glyph_string):
3072 * xterm.c (x_draw_glyph_string): Don't use previous underline
3073 thickness and position if previous underline type is underwave.
3074
3075 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3076
3077 * fileio.c (Ffile_acl): Undocument return format.
3078
3079 2013-01-02 Glenn Morris <rgm@gnu.org>
3080
3081 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3082
3083 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3084
3085 Simplify via eabs.
3086 * dired.c (file_name_completion):
3087 * doc.c (get_doc_string):
3088 * floatfns.c (round2):
3089 * font.c (font_score, font_delete_unmatched):
3090 * fringe.c (compute_fringe_widths):
3091 * lread.c (read_list):
3092 * minibuf.c (Ftry_completion):
3093 * term.c (tty_ins_del_lines):
3094 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3095 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3096
3097 2012-12-31 Eli Zaretskii <eliz@gnu.org>
3098
3099 * w32.c (unsetenv): Set up the string passed to _putenv
3100 correctly.
3101 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3102 for the bug this caused.
3103
3104 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 * coding.c (Qmac): Now static.
3107
3108 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3109
3110 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3111 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3112 handlebox_widget. Set toolbar_in_hbox to false/true, set
3113 toolbar_is_packed to true.
3114 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3115 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3116 Show all on TOOLBAR_TOP_WIDGET.
3117 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3118 by TOOLBAR_TOP_WIDGET.
3119 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3120 Check toolbar_is_packed.
3121 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3122 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3123 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3124 false.
3125 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3126 (xg_update_menubar): Update title only if
3127 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3128 (xg_update_submenu): Skip tearoff only if
3129 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3130 (xg_initialize): Initialize xg_detached_menus only if
3131 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3132
3133 * xterm.h (struct x_output): Surround handlebox_widget with
3134 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3135 toolbar_in_hbox is bool.
3136
3137 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3138
3139 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3140 (LIBS_GNUSTEP): Define.
3141 (LIBES): Add $(LIBS_GNUSTEP).
3142 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3143
3144 2012-12-30 Eli Zaretskii <eliz@gnu.org>
3145
3146 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3147 continuation glyph on a TTY with an indication of an empty line.
3148 (Bug#13277)
3149
3150 2012-12-29 Eli Zaretskii <eliz@gnu.org>
3151
3152 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3153 file's SELinux context or ACLs successfully set, nil otherwise.
3154 (Bug#13298)
3155 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3156
3157 * w32proc.c (reader_thread): Avoid passing NULL handles to
3158 SetEvent and WaitForSingleObject.
3159
3160 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3161
3162 Port EXTERNALLY_VISIBLE to Clang 3.2.
3163 * conf_post.h (__has_attribute): New macro.
3164 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3165
3166 2012-12-27 Glenn Morris <rgm@gnu.org>
3167
3168 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3169 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3170
3171 2012-12-27 Eli Zaretskii <eliz@gnu.org>
3172
3173 * fileio.c (file_name_as_directory, directory_file_name):
3174 Accept an additional argument MULTIBYTE to indicate whether the input C
3175 came from a multibyte or a unibyte Lisp string; all callers
3176 adjusted. Don't assume the input string is always multibyte.
3177 (Bug#13262)
3178 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3179 don't ENCODE_FILE them, and return a unibyte string if the input
3180 was unibyte.
3181 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3182 don't assume the input strings will always be multibyte. If the
3183 input strings are multibyte, decode strings obtained from C
3184 library functions.
3185
3186 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3187
3188 * lisp.h (toplevel): Add two notices to the comment about
3189 defining a new Lisp data type.
3190 * print.c (print_object): If Lisp_Save_Value object's pointer
3191 is the address of a memory area containing Lisp_Objects, try
3192 to print them.
3193 * alloc.c (valid_lisp_object_p): Adjust comment.
3194
3195 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3196
3197 * keyboard.c (record_asynch_buffer_change): Initialize an event
3198 only if it's really needed.
3199 * frame.h (enum output_method): Remove output_mac member since
3200 it's a leftover from the deleted code.
3201 * frame.c (Fframep): Adjust user here ...
3202 * terminal.c (Fterminal_live_p): ... and here.
3203 * coding.c (Qmac): Now here because it's only used to denote
3204 end-of-line encoding type.
3205 (syms_of_coding): DEFSYM it.
3206 * frame.h (Qmac): Remove duplicated declaration.
3207
3208 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 * window.c (select_window_1): Now static, since it's used only here.
3211
3212 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3213
3214 * window.c (window_body_cols): Subtract display margins from the
3215 window body width on TTYs as well. See
3216 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3217 for the original report.
3218
3219 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3220
3221 * xdisp.c (redisplay_window): Remove inner local variable
3222 because the outer shadowed one has the same meaning.
3223 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3224 set but never used.
3225 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3226 (xg_create_tool_bar): Adjust users.
3227
3228 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3229
3230 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3231 * buffer.c (Fget_buffer_create): Use it to set compact field of
3232 struct buffer_text to avoid accessing an uninitialized value
3233 when compact_buffer is called for the first time.
3234 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3235 (Fset_buffer_modified_p): Use buffer_window_count to check
3236 whether the buffer is displayed in some window.
3237 * xdisp.c (message_dolog): Likewise.
3238
3239 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3240
3241 * w32.c (acl_set_file): If setting the file security descriptor
3242 fails, and the new DACL is identical to the existing one, silently
3243 return success. This fixes problems for users backing up their
3244 own files without having the necessary privileges for setting
3245 security descriptors.
3246
3247 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3248 values.
3249 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3250 after WaitForSingleObject returns normally. This expedites reader
3251 thread shutdown when delete_child triggers it.
3252 (reap_subprocess): More accurate commentary for why we call
3253 delete_child only when cp->fd is negative.
3254
3255 * w32.c (sys_close): Do not call delete_child on a subprocess
3256 whose handle is not yet closed. Instead, set its file descriptor
3257 to a negative value, so that reap_subprocess will call
3258 delete_child on that subprocess when its SIGCHLD arrives.
3259 This avoids closing handles used for communications between sys_select
3260 and reader_thread, which doesn't give sys_select a chance to
3261 notice that the process exited and invoke the SIGCHLD handler for
3262 it.
3263
3264 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3265
3266 * nsfns.m (Fns_do_applescript): Run event loop until script has
3267 been executed (Bug#12969).
3268 (ns_run_ascript): Chech as_script for nil, set to nil after
3269 executing script.
3270
3271 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3272
3273 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3274
3275 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3276
3277 * w32term.c (w32fullscreen_hook): New function.
3278 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3279
3280 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3281
3282 * fileio.c (Finsert_file_contents): Doc fix.
3283
3284 * w32proc.c (new_child, delete_child, find_child_pid): For a
3285 subprocess, consider its slot being in use as long as its process
3286 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3287 slot when a new process is started immediately after killing
3288 another one, without waiting enough time for the first process to
3289 be reaped and resources allocated for it be orderly freed.
3290 (Bug#13086)
3291 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3292
3293 2012-12-21 Chong Yidong <cyd@gnu.org>
3294
3295 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3296
3297 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3298
3299 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3300
3301 * w32.c (get_name_and_id): Always pass NULL as the first argument
3302 of lookup_account_sid. Avoids crashes with UNC file names that
3303 refer to DFS domains, not to specific machine names. (Bug#12621)
3304 Remove now unused argument FNAME; all callers changed.
3305 (get_file_owner_and_group): Remove now unused argument FNAME; all
3306 callers changed.
3307
3308 2012-12-21 Chong Yidong <cyd@gnu.org>
3309
3310 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3311 error for invalid chars, don't check for a nil return value.
3312
3313 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3314
3315 Avoid calls to CHAR_TO_BYTE if byte position is known.
3316 * editfns.c (make_buffer_string_both): Use move_gap_both.
3317 (Fbuffer_string): Use make_buffer_string_both.
3318 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3319 Adjust comment.
3320 (buf_bytepos_to_charpos): Likewise.
3321 (charpos_to_bytepos): Remove.
3322 * fileio.c (Finsert_file_contents): Use move_gap_both.
3323 * search.c (Freplace_match): Likewise.
3324 * process.c (process_send_region): Likewise. Use convenient
3325 names for byte positions.
3326 * lisp.h (charpos_to_bytepos): Remove prototype.
3327 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3328 * insdel.c (move_gap): Likewise.
3329
3330 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3331
3332 * xdisp.c (redisplay_internal): Remove now-unused local.
3333
3334 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3335
3336 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3337 (redisplay_internal): Don't bother selecting the frame to get the
3338 proper value of frame-local variables (bug#13225).
3339
3340 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3341
3342 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3343 Rename 4th argument since it may be buffer or string. Adjust comment.
3344 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3345
3346 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3347
3348 * coding.c (Fdetect_coding_region): Do not check start and end with
3349 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3350 (code_convert_region): Likewise.
3351
3352 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3353
3354 * w32.c (acl_get_file, acl_set_file): Run the file name through
3355 map_w32_filename, and resolve any symlinks in the file name, like
3356 Posix platforms do.
3357 (acl_set_file): Call revert_to_self, if any privileges were
3358 enabled.
3359
3360 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3361
3362 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3363 ($(BLD)/w32.$(O)): Update dependencies.
3364
3365 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3366
3367 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3368 propagate redisplay's scrolling (if any) to the right window.
3369 (redisplay_internal): Use ensure_selected_frame.
3370 (display_mode_lines): Complete last fix.
3371 * window.c (select_window_1): New func, extracted from select_window.
3372 (select_window): Use it.
3373 * window.h (select_window_1): Declare.
3374
3375 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3376
3377 Emulate Posix ACL APIs on MS-Windows.
3378 * w32.c: Include sddl.h and sys/acl.h.
3379 (SDDL_REVISION_1): Define if not already defined.
3380 (g_b_init_get_security_descriptor_dacl)
3381 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3382 (g_b_init_is_valid_security_descriptor)
3383 (g_b_init_set_file_security): New static flags.
3384 (globals_of_w32): Initialize them to zero.
3385 (SetFileSecurity_Name): New string constant.
3386 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3387 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3388 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3389 (IsValidSecurityDescriptor_Proc): New typedefs.
3390 (get_file_security, get_security_descriptor_owner)
3391 (get_security_descriptor_group): Set errno to ENOTSUP.
3392 (set_file_security, get_security_descriptor_dacl)
3393 (is_valid_security_descriptor, convert_sd_to_sddl)
3394 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3395 (acl_free, acl_get_file, acl_set_file): New functions.
3396
3397 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3398
3399 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3402 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3403 for some of that bug's symptoms can now cause Emacs to abort.
3404 Remove the workaround.
3405 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3406 The bug that caused SIGCHLD to get lost has been fixed, and the
3407 workaround for it can now cause Emacs to abort.
3408
3409 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3412 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3413 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3414
3415 2012-12-16 Romain Francoise <romain@orebokech.com>
3416
3417 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3418 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3419 and copy ACL entries of file in addition to SELinux context if set.
3420 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3421
3422 * Makefile.in (LIBACL_LIBS): New macro.
3423 (LIBES): Use it.
3424
3425 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3426
3427 * fileio.c (internal_delete_file): Use bool for boolean.
3428
3429 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3430
3431 Fix bug #13079 on MS-Windows with temp files not being deleted.
3432 * w32.h (_child_process): New members input_file and
3433 pending_deletion.
3434 (register_child): First argument is now pid_t.
3435 (record_infile, record_pending_deletion): New prototypes.
3436
3437 * w32proc.c (new_child): Initialize input_file and
3438 pending_deletion members of the child.
3439 (delete_child): Delete the child's temporary input file, if any,
3440 that is pending deletion.
3441 (register_child): First argument is now pid_t.
3442 (record_infile, record_pending_deletion): New functions.
3443 (reap_subprocess): Fix a typo in DebPrint string.
3444 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3445
3446 * fileio.c (internal_delete_file): Return an int again: non-zero
3447 if delete-file succeeds, zero otherwise.
3448
3449 * lisp.h (internal_delete_file): Adjust prototype.
3450
3451 * callproc.c (Fcall_process): Don't overwrite infile with result
3452 of DECODE_FILE.
3453 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3454 asynchronous subprocess, record the name of the input file name,
3455 if any.
3456 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3457 delete the file, record it as pending deletion when the subprocess
3458 exits.
3459
3460 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3461
3462 * editfns.c [HAVE_PWD_H]: Include grp.h.
3463
3464 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3465
3466 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 Fix permissions bugs with setgid directories etc. (Bug#13125)
3469 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3470 to mark it as a placeholder. The old value was often wrong.
3471 The only user of this attribute has been changed to use
3472 file-ownership-preserved-p instead, with its new group arg.
3473 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3474
3475 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3476
3477 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3478 Keep selected_window and selected_frame in sync.
3479
3480 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3481
3482 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3483 try to get accurate owner and group information from NT file
3484 security APIs. This is to make most callers of 'stat' and
3485 'lstat', which don't need that information, much faster.
3486
3487 * dired.c (Ffile_attributes) [WINDOWSNT]:
3488 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3489 owner and group information from 'lstat'.
3490
3491 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3492
3493 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3494 as that confuses set-auto-coding, so insist on the head-read
3495 returning the full 1024 bytes. Let lseek compute the tail offset;
3496 less work for us. Do not ignore I/O errors when reading the tail.
3497
3498 * xdisp.c: Minor style fixes.
3499 (init_iterator): Hoist assignment out of if-expression.
3500 (markpos_of_region): Callers now test for sign, not for -1.
3501
3502 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3503
3504 Minor redisplay optimization when the region length is zero.
3505 * xdisp.c (markpos_of_region): New function.
3506 (init_iterator): Do not highlight the region of zero length.
3507 (redisplay_window): Check whether the region is of non-zero length.
3508 (try_cursor_movement): Allow if the region length is zero.
3509 (try_window_reusing_current_matrix, try_window_id): Likewise.
3510
3511 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3512
3513 * search.c (search_buffer): Check the inverse translations of each
3514 character in pattern when the buffer being searched is unibyte.
3515 (Bug#13084)
3516
3517 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3520 files, fixing a regression from 24.2.
3521 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3522
3523 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3524
3525 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3526 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3527 Remove unnecessary S_ISLNK test, as (contra the comments) this
3528 function can't copy symlinks. Improve quality of error message
3529 when attempting to copy files that are neither regular files nor
3530 directories.
3531
3532 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3535 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3536 * window.c (Frecenter):
3537 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3538 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3539
3540 2012-12-12 Daniel Colascione <dancol@dancol.org>
3541
3542 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3543 the dumped Emacs is not a sparse file, greatly improving Cygwin
3544 "make bootstrap" performance.
3545
3546 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3547
3548 * inotify.c (inotify_callback): Generate an Emacs event for every
3549 incoming inotify event.
3550
3551 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3552
3553 * xdisp.c (handle_face_prop): Fix logic of computing
3554 it->start_of_box_run_p.
3555 (append_space_for_newline): If the glyph row is R2L, reset the
3556 iterator's end_of_box_run_p flag before prepending the space glyph.
3557 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3558 iterator's start_of_box_run_p flag before prepending the stretch.
3559 (append_glyph, produce_image_glyph, append_composite_glyph)
3560 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3561 left_box_line_p and right_box_line_p flags of the glyph for R2L
3562 glyph rows. (Bug#13011)
3563
3564 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3565
3566 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3567 if changed buffer is not shown in a window.
3568 * insdel.c (prepare_to_modify_buffer): Likewise.
3569 * window.c (replace_buffer_in_windows_safely): Do nothing
3570 if buffer is not shown in a window.
3571 (Fforce_window_update): Likewise if string or buffer argument
3572 is passed.
3573
3574 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3575
3576 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3577 encoded_file_name, which is what it is.
3578
3579 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3580
3581 Consistently use marker_position and marker_byte_position.
3582 * fringe.c (Ffringe_bitmaps_at_pos):
3583 * indent.c (Fvertical_motion):
3584 * insdel.c (prepare_to_modify_buffer):
3585 * keyboard.c (make_lispy_position):
3586 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3587 (window_scroll_pixel_based, displayed_window_lines)
3588 (Fset_window_configuration):
3589 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3590 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3591 Replace direct access to marker fields with calls
3592 to marker_position and/or marker_byte_position.
3593
3594 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3595
3596 * makefile.w32-in (SIG2STR_H): New macro.
3597 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3598 ($(BLD)/w32notify.$(O)): Update dependencies.
3599
3600 2012-12-10 Daniel Colascione <dancol@dancol.org>
3601
3602 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3603 Windows file notification functionality unless WINDOWSNT.
3604
3605 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3606 declarations.
3607
3608 * w32fns.c (cache_system_info): Initialize the global hinst
3609 variable here so various initialization calls DTRT.
3610
3611 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3612 (hinst): Remove unneeded extern declaration.
3613 (_start): Remove initialization of above variables; remove
3614 initialization of hinst, as cache_system_info now does that.
3615
3616 * emacs.c (main): Call cache_system_info early in startup; we
3617 previously weren't calling it in Cygwin builds.
3618
3619 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3620 Teach the autoconf build system how to compile a Windows resource file
3621 and link it to Emacs.
3622
3623 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3624
3625 Per-buffer window counters.
3626 * buffer.h (struct buffer): New member window_count.
3627 (buffer_window_count): New function.
3628 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3629 Initialize window_count.
3630 (Fkill_buffer): Verify window_count for the buffer being killed.
3631 (modify_overlay): Do not force redisplay if buffer is not shown
3632 in any window.
3633 (init_buffer_once): Initialize window_count for buffer_defaults
3634 and buffer_local_symbols.
3635 * window.h (buffer_shared): Remove declaration.
3636 (wset_buffer): Convert from inline ...
3637 * window.c (wset_buffer): ... to an ordinary function.
3638 (adjust_window_count): New function.
3639 (make_parent_window): Use it.
3640 * xdisp.c (buffer_shared): Remove.
3641 (redisplay_internal, redisplay_window): Adjust users.
3642 (buffer_shared_and_changed): Use per-buffer window counter.
3643
3644 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3645
3646 Support for filesystem notifications on MS-Windows.
3647 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3648 and this is a TTY frame, signal the caller that keyboard input is
3649 available.
3650
3651 * w32xfns.c (drain_message_queue): Now returns an int: an
3652 indication whether any WM_EMACS_FILENOTIFY messages were found in
3653 the queue.
3654
3655 * w32inevt.c (handle_file_notifications): New function.
3656 (w32_console_read_socket): Call it to process file notifications.
3657
3658 * w32console.c (initialize_w32_display): Record the main thread ID
3659 in dwMainThreadId.
3660
3661 * deps.mk (inotify.o): New dependency list.
3662
3663 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3664
3665 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3666 (WM_EMACS_END): Bump value by 1.
3667 (notification_buffer_in_use, file_notifications)
3668 (notifications_size, notifications_desc): Declare.
3669 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3670 Add prototypes.
3671
3672 * w32term.c (lispy_file_action, queue_notifications): New functions.
3673 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3674 <Qrenamed_to>: New symbols.
3675 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3676
3677 * w32notify.c: New file, implements file event notifications for
3678 MS-Windows.
3679
3680 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3681 by posting it to the w32_read_socket queue.
3682
3683 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3684
3685 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3686 (GLOBAL_SOURCES): Add w32notify.c
3687 ($(BLD)/w32notify.$(O)): New set of dependencies.
3688
3689 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3690
3691 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3692 Handle FILE_NOTIFY_EVENT.
3693 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3694 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3695 w32notify-handle-event by default.
3696
3697 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3698 syms_of_w32notify.
3699
3700 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3701
3702 Support for filesystem notifications on GNU/Linux via inotify.
3703 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3704
3705 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3706
3707 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3708 (syms_of_keyboard): DEFSYM it.
3709 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3710 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3711 Qfile_inotify events.
3712 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3713 special-event-map to inotify-handle-event.
3714
3715 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3716
3717 * Makefile.in (base_obj): Add inotify.o.
3718
3719 * inotify.c: New file.
3720
3721 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3722
3723 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3724
3725 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3726
3727 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3728 DWORD_PTR, for compatibility with 64-bit builds.
3729
3730 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3731 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3732 (system_process_attributes): Use SIZE_T rather than DWORD, for
3733 compatibility with 64-bit builds.
3734
3735 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3736
3737 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3738
3739 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3740
3741 * indent.c (Fvertical_motion): If a display string will be
3742 displayed on the left or the right margin, don't consider it as a
3743 factor in cursor positioning. (Bug#13108)
3744
3745 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3746
3747 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3748
3749 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3752 for string length.
3753
3754 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3755
3756 * w32.c (unsetenv): Return 0 if the input string is too long.
3757
3758 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3759
3760 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3761 * alloc.c (xputenv): New function.
3762 * dbusbind.c (Fdbus_init_bus):
3763 * emacs.c (main):
3764 * xterm.c (x_term_init):
3765 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3766 * editfns.c (initial_tz): Move static var decl up.
3767 (tzvalbuf_in_environ): New static var.
3768 (init_editfns): Initialize these two static vars.
3769 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3770 Save old TZ value on stack, if it's small.
3771 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3772 instead, use xputenv+unsetenv to set and restore TZ.
3773 (environbuf): Remove static var. All uses removed.
3774 (Fset_time_zone_rule): Do not save TZ and environ;
3775 no longer needed here.
3776 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3777 Move to inside set_time_zone_rule; they don't need file scope any more.
3778 (set_time_zone_rule): Maintain the TZ=value string separately.
3779 (syms_of_editfns): Don't initialize initial_tz;
3780 init_editfns now does it.
3781 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3782 * lisp.h (xputenv): New decl.
3783
3784 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3785
3786 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3787
3788 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3789
3790 * w32.c (unsetenv, sys_putenv): New functions.
3791
3792 2012-12-08 Chong Yidong <cyd@gnu.org>
3793
3794 * editfns.c (Finsert_char): Make the error message more
3795 informative (Bug#12992).
3796
3797 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3798
3799 Simplify get_lim_data.
3800 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3801 Remove USG and vlimit methods; no longer used these days.
3802 Add #error catchall just in case.
3803
3804 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3805 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3806 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3807 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3808 (deleted_pid_list, Fdelete_process, create_process)
3809 (record_child_status_change, handle_child_signal, deliver_child_signal)
3810 (init_process_emacs, syms_of_process):
3811 Assume SIGCHLD is defined.
3812 (parse_signal): Remove. All uses removed.
3813 (abbr_to_signal): New static function.
3814 (Fsignal_process): Use it to convert signal names to ints.
3815 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3816 kill (getpgrp (), ...).
3817 (emacs_sigaction_init): Assume SIGCHLD is defined.
3818 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3819 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3820 * syssignal.h (EMACS_KILLPG): Remove.
3821 All uses replaced by 'kill' with a negative pid.
3822 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3823 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3824
3825 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3828 This will cause a production Emacs to dump core instead of
3829 infinite-looping.
3830
3831 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3832
3833 * frame.c (make_frame): Do not set window's buffer to t.
3834 * window.c (Fsplit_window_internal): Likewise. Previously it was
3835 used to indicate that the window is being set up. Now we use
3836 set_window_buffer for all new windows, so the condition in ...
3837 (Fset_window_buffer): ... is always true and can be removed.
3838
3839 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3840
3841 Convenient macro to check whether the buffer is hidden.
3842 * buffer.h (BUFFER_HIDDEN_P): New macro.
3843 * frame.c (make_frame): Use it. Adjust comment.
3844 * buffer.c (candidate_buffer): New function.
3845 (Fother_buffer, other_buffer_safely): Use it.
3846
3847 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3848
3849 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3850 if the child process is still running. Instead, exit the wait
3851 loop and return zero. (Bug#13086)
3852
3853 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3854
3855 * frame.h (x_char_width, x_char_height): Remove prototypes.
3856 * w32term.h (x_char_width, x_char_height): Likewise.
3857 * xfns.c (x_char_width, x_char_height): Remove.
3858 * w32fns.c (x_char_width, x_char_height): Likewise.
3859 * nsfns.c (x_char_width, x_char_height): Likewise.
3860 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3861 all window frames.
3862 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3863 * keyboard.c (command_loop_1): Remove prototype.
3864 (command_loop_2, top_level_1): Add static to match prototype.
3865
3866 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3867
3868 Fix a recently-introduced delete-process race condition.
3869 * callproc.c, process.h (record_kill_process):
3870 New function, containing part of the old call_process_kill.
3871 (call_process_kill): Use it.
3872 This does not change call_process_kill's behavior.
3873 * process.c (Fdelete_process): Use record_kill_process to fix a
3874 race condition that could cause Emacs to lose track of a child.
3875
3876 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3877
3878 Avoid code duplication between prev_frame and next_frame.
3879 * frame.c (candidate_frame): New function. Add comment.
3880 (prev_frame, next_frame): Use it. Adjust comment.
3881
3882 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3883
3884 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3885 fails, signal an error instead of continuing with an empty
3886 string. (Bug#13079)
3887 Encode expanded temp file pattern before passing it to mkstemp or
3888 mktemp.
3889
3890 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3891 Encode the file name before passing it to dostounix_filename, in
3892 case it will downcase it (under w32-downcase-file-names).
3893 (Bug#12933)
3894
3895 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3896
3897 Minor call-process cleanups.
3898 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3899 at the same time as other platforms, to simplify analysis.
3900 No need for fd0_volatile since we have synch_process_fd.
3901 Avoid needless emacs_close; arg is always negative.
3902
3903 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3904
3905 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3906 processes.
3907
3908 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3909
3910 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3911 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3912 and mouse_face_hidden members to a bitfields.
3913 * frame.h (struct frame): Remove set-but-not-used space_width member.
3914 (FRAME_SPACE_WIDTH): Remove.
3915 * nsterm.m, w32term.c, xterm.c: Adjust users.
3916 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3917 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3918 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3919 members to a bitfields.
3920
3921 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3922
3923 Don't let call-process be a zombie factory (Bug#12980).
3924 Fixing this bug required some cleanup of the signal-handling code.
3925 As a side effect, this change also fixes a longstanding rare race
3926 condition whereby Emacs could mistakenly kill unrelated processes,
3927 and it fixes a bug where a second C-g does not kill a recalcitrant
3928 synchronous process in GNU/Linux and similar platforms.
3929 The patch should also fix the last vestiges of Bug#9488,
3930 a bug which has mostly been fixed on the trunk by other changes.
3931 * callproc.c, process.h (synch_process_alive, synch_process_death)
3932 (synch_process_termsig, sync_process_retcode):
3933 Remove. All uses removed, to simplify analysis and so that
3934 less consing is done inside critical sections.
3935 * callproc.c (call_process_exited): Remove. All uses replaced
3936 with !synch_process_pid.
3937 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3938 These take the role of what used to be in unwind-protect arg.
3939 All uses changed.
3940 (block_child_signal, unblock_child_signal):
3941 New functions, to avoid races that could kill innocent-victim processes.
3942 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3943 (call_process_kill): Record killed processes as deleted, so that
3944 zombies do not clutter up the system. Do this inside a critical
3945 section, to avoid a race that would allow the clutter.
3946 (call_process_cleanup): Fix code so that the second C-g works again
3947 on common platforms such as GNU/Linux.
3948 (Fcall_process): Create the child process in a critical section,
3949 to fix a race condition. If creating an asynchronous process,
3950 record it as deleted so that zombies do not clutter up the system.
3951 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3952 light of these changes. Omit unnecessary call to emacs_close
3953 before failure, as the unwind-protect code does that.
3954 * callproc.c (call_process_cleanup):
3955 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3956 * process.c (record_deleted_pid): New function, containing
3957 code refactored out of Fdelete_process.
3958 (Fdelete_process): Use it.
3959 (process_status_retrieved): Remove. All callers changed to use
3960 child_status_change.
3961 (record_child_status_change): Remove, folding its contents into ...
3962 (handle_child_signal): ... this signal handler. Now, this
3963 function is purely a handler for SIGCHLD, and is not called after
3964 a synchronous waitpid returns; the synchronous code is moved to
3965 wait_for_termination. There is no need to worry about reaping
3966 more than one child now.
3967 * sysdep.c (get_child_status, child_status_changed): New functions.
3968 (wait_for_termination): Now takes int * status and bool
3969 interruptible arguments, too. Do not record child status change;
3970 that's now the caller's responsibility. All callers changed.
3971 Reimplement in terms of get_child_status.
3972 (wait_for_termination_1, interruptible_wait_for_termination):
3973 Remove. All callers changed to use wait_for_termination.
3974 * syswait.h: Include <stdbool.h>, for bool.
3975 (record_child_status_change, interruptible_wait_for_termination):
3976 Remove decls.
3977 (record_deleted_pid, child_status_changed): New decls.
3978 (wait_for_termination): Adjust to API changes noted above.
3979
3980 * bytecode.c, lisp.h (Qbytecode): Remove.
3981 No longer needed after 2012-11-20 interactive-p changes.
3982
3983 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3984
3985 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3986 the scroll margin, move point outside the margin. (Bug#13055)
3987
3988 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3989
3990 * gtkutil.c (my_log_handler): New function.
3991 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3992
3993 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3994
3995 * lisp.h (modify_region): Rename to...
3996 (modify_region_1): ...new prototype.
3997 * textprop.c (modify_region): Now static. Adjust users.
3998 * insdel.c (modify_region): Rename to...
3999 (modify_region_1): ...new function to work with current buffer.
4000 Adjust comment and users. Use true and false for booleans.
4001
4002 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 * alloc.c (free_save_value): New function.
4005 (safe_alloca_unwind): Use it.
4006 * lisp.h (free_save_value): New prototype.
4007 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4008 Add comment.
4009 (save_excursion_restore): Adjust to match saved data structure.
4010 Use free_save_value to offload some work from GC. Drop obsolete
4011 #if 0 code.
4012
4013 2012-12-03 Chong Yidong <cyd@gnu.org>
4014
4015 * fileio.c (Vauto_save_list_file_name): Doc fix.
4016
4017 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4018
4019 * w32fns.c: Remove prototype of atof.
4020 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4021 builds.
4022 (file_dialog_callback): Make it UINT_PTR.
4023
4024 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4025 with 64-bit builds.
4026
4027 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4028 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4029 defined.
4030
4031 2012-12-03 Glenn Morris <rgm@gnu.org>
4032
4033 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4034
4035 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4036
4037 Fix xpalloc confusion after memory is exhausted.
4038 * alloc.c (xpalloc): Comment fix.
4039 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4040 and signals an error, do not clear charset_table_size, as
4041 charset_table is still valid.
4042 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4043
4044 Use execve to avoid need to munge environ (Bug#13054).
4045 * callproc.c (Fcall_process):
4046 * process.c (create_process):
4047 Don't save and restore environ; no longer needed.
4048 * callproc.c (child_setup):
4049 Use execve, not execvp, to preserve environ.
4050
4051 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4052
4053 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4054
4055 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4056
4057 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4058 display for sliced images (Bug#10500).
4059
4060 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4061
4062 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
4063
4064 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4065 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4066
4067 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4068
4069 * xdisp.c (window_outdated): Remove eassert since it hits
4070 some suspicious corner cases (see Bug#13007 and Bug#13012).
4071 (mode_line_update_needed): New function.
4072 (redisplay_internal, redisplay_window): Use it.
4073 (ensure_selected_frame): New function.
4074 (redisplay_internal, unwind_redisplay): Use it.
4075 (redisplay_internal): Move comment about buffer_shared...
4076 (buffer_shared_and_changed): ...near to its real use.
4077
4078 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 * callproc.c (Fcall_process): Don't misreport vfork failure.
4081
4082 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4083
4084 * callproc.c (Fcall_process): Fix vfork portability problems.
4085 Do not assume that fd[0], count, filefd, and save_environ survive
4086 vfork. Fix bug whereby wrong errno value could be reported for
4087 pipe failure. Some minor cleanups, too, as follows. Move buf and
4088 bufsize to the context where they're needed. Change new_argv to
4089 be of type char **, as this is more convenient and avoids casts.
4090 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4091 Now local constants, not macros.
4092
4093 2012-11-18 Kenichi Handa <handa@gnu.org>
4094
4095 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4096 for the variable "f".
4097
4098 2012-11-13 Kenichi Handa <handa@gnu.org>
4099
4100 * font.c (font_unparse_xlfd): Exclude special characters from the
4101 generating XLFD name.
4102
4103 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4104
4105 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4106 * dired.c (stat_uname, stat_gname):
4107 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4108
4109 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4110 * dired.c (directory_files_internal, file_name_completion):
4111 Assume EAGAIN and EINTR are defined.
4112
4113 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4114 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4115 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4116 * lread.c (readbyte_from_file): Assume EINTR is defined.
4117 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4118 Assume EIO and EAGAIN are defined.
4119 * unexcoff.c (write_segment): Assume EFAULT is defined.
4120
4121 2012-11-27 Eli Zaretskii <eliz@gnu.org>
4122
4123 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4124 (Bug#11964)
4125
4126 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4127 highlighting on the frame was cleared. Prevents assertion
4128 violations when repeatedly clicking on the "Top" link of the
4129 "bread-crumbs" in Info buffers.
4130
4131 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4132
4133 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4134
4135 2012-11-24 Ken Brown <kbrown@cornell.edu>
4136
4137 * keyboard.c (HAVE_MOUSE):
4138 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4139 were always defined.
4140
4141 2012-11-24 Eli Zaretskii <eliz@gnu.org>
4142
4143 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4144 between bpos_covered and bpos_max. This fixes cursor display when
4145 several display strings follow each other.
4146
4147 * .gdbinit (pgx): If the glyph's object is a string, display the
4148 pointer to string data, rather than the value of the string object
4149 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4150
4151 * indent.c (Fvertical_motion): If the starting position is covered
4152 by a display string, return to one position before that, to avoid
4153 overshooting it inside move_it_to. (Bug#12930)
4154
4155 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4156
4157 * frame.h (struct frame): Remove display_preempted member
4158 since all users are dead long ago.
4159 * nsterm.h (struct x_output): Use the only dummy member.
4160 * w32menu.c (pending_menu_activation): Remove since not
4161 really used.
4162 (set_frame_menubar): Adjust user.
4163 * w32term.h (struct x_output): Drop outdated #if 0 code.
4164 (struct w32_output): Use bitfields for explicit_parent,
4165 asked_for_visible and menubar_active members.
4166 Drop unused pending_menu_activation member.
4167 * xterm.h (struct x_output): Drop outdated #if 0 code.
4168 Use bitfields for explicit_parent, asked_for_visible,
4169 has_been_visible and net_wm_state_hidden_seen members.
4170
4171 2012-11-23 Eli Zaretskii <eliz@gnu.org>
4172
4173 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4174 of a literal "/". (Bug#12955)
4175 (gl-stamp): Invoke fc.exe directly, not through cmd.
4176
4177 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4178
4179 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4180 * dired.c: Assume HAVE_DIRENT_H.
4181 (NAMLEN): Remove, replacing with ...
4182 (dirent_namelen): New function. All uses changed. Use the GNU macro
4183 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4184 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4185 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4186 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4187 $(NT_INC)/dirent.h.
4188 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4189 * ndir.h: Rename to ../nt/inc/dirent.h.
4190 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4191 Do not include <dirent.h>; no longer needed.
4192 * w32.c: Include <dirent.h> rather than "ndir.h".
4193
4194 2012-11-23 Chong Yidong <cyd@gnu.org>
4195
4196 * xftfont.c (xftfont_open): Remove duplicate assignment.
4197
4198 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4199
4200 * alloc.c (Fgarbage_collect): Unblock input after clearing
4201 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4202 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4203 * msdos.c (IT_frame_up_to_date): Use it here...
4204 * w32term.c (w32_frame_up_to_date): ...here...
4205 * xterm.c (XTframe_up_to_date): ...and here...
4206 * nsterm.m (ns_frame_up_to_date): ...but not here.
4207 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4208 Adjust users.
4209 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4210 Do not check whether GC is in progress.
4211
4212 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4213
4214 * xdisp.c (window_buffer_changed): New function.
4215 (update_menu_bar, update_tool_bar): Use it to
4216 simplify large 'if' statements.
4217 (redisplay_internal): Generalize commonly used
4218 'tail' and 'frame' local variables.
4219
4220 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4221
4222 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4223 with Windows system header.
4224
4225 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4226
4227 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4228 * alloc.c: Assume unistd.h exists.
4229 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4230 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4231 (getwd) [USG]: Remove; no longer needed.
4232 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4233 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4234 * w32.h (getcwd): Remove decl.
4235
4236 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4237
4238 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4239 Make it set selected_window as well.
4240 (update_tool_bar): Use it.
4241
4242 2012-11-21 Ken Brown <kbrown@cornell.edu>
4243
4244 * emacs.c (main): Set the G_SLICE environment variable for all
4245 Cygwin builds, not just GTK builds. See
4246 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4247
4248 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4249
4250 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4251 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4252 Define for the MSVC compiler.
4253
4254 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4255
4256 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4257 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4258 dostounix_filename. Prevents crashes down the road, because
4259 dostounix_filename assumes it gets a unibyte string.
4260 Reported by Michel de Ruiter <michel@sentient.nl>, see
4261 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4262
4263 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4264
4265 Conflate Qnil and Qunbound for `symbol-function'.
4266 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4267 * lread.c (init_obarray): Set `function' fields to Qnil.
4268 * eval.c (Fcommandp): Ignore Qunbound.
4269 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4270 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4271 Test NILP rather than Qunbound.
4272 (Ffmakunbound): Set to Qnil.
4273 (Fsymbol_function): Never signal an error.
4274 (Finteractive_form): Ignore Qunbound.
4275
4276 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4277
4278 * eval.c (interactive_p): Remove no-longer-used decl.
4279
4280 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 * xdisp.c (buffer_shared): Adjust comment.
4283 (buffer_shared_and_changed): New function.
4284 (prepare_menu_bars, redisplay_internal): Use it to
4285 decide whether all windows or frames should be updated.
4286 (window_outdated): New function.
4287 (text_outside_line_unchanged_p, redisplay_window): Use it.
4288 (redisplay_internal): Likewise. Fix indentation.
4289
4290 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4291
4292 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4293 (syms_of_eval): Remove corresponding defsubr.
4294 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4295
4296 2012-11-19 Daniel Colascione <dancol@dancol.org>
4297
4298 * w32fns.c (Fx_file_dialog):
4299 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4300 cygwin_convert_file_name*.
4301
4302 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4303 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4304
4305 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4308
4309 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4310
4311 * w32select.c: Include w32common.h before w32term.h, so that
4312 windows.h gets included before w32term.h uses some of its
4313 features, see below.
4314
4315 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4316 New typedefs.
4317 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4318 New prototypes.
4319 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4320
4321 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4322
4323 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4324 (ns_select): Return at once if events are held (Bug#12834).
4325
4326 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4327
4328 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4329 Needed following 2012-10-20 change. (Bug#12902)
4330
4331 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4332
4333 * w32proc.c (waitpid): Remove unused label get_result.
4334
4335 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4336
4337 * makefile.w32-in (SYSWAIT_H): New macro.
4338 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4339 ($(BLD)/sysdep.$(O)): Update dependencies.
4340
4341 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4342
4343 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4344 * callproc.c (relocate_fd): Assume F_DUPFD.
4345 * emacs.c, term.c (O_RDWR): Remove.
4346 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4347 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4348 * nsterm.m: Assume <fcntl.h> exists.
4349 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4350 (create_pty, Fmake_network_process, server_accept_connection)
4351 (wait_reading_process_output, init_process_emacs):
4352 Assume O_NONBLOCK.
4353 (wait_reading_process_output): Put in a special case for WINDOWSNT
4354 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4355 It's not clear this is needed, but it's a more-conservative change.
4356 (create_process): Assume FD_CLOEXEC.
4357 (create_process, create_pty): Assume O_NOCTTY.
4358 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4359 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4360 Omit if not DOS_NT, since F_GETFL is not defined there.
4361 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4362 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4363 (O_NOCTTY): Remove.
4364 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4365 lack it, since gnulib guarantees this.
4366 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4367
4368 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4369
4370 * w32.c (faccessat): Pretend that directories have the execute bit
4371 set. Emacs expects that, e.g., in files.el:cd-absolute.
4372
4373 * w32proc.c (create_child): Don't clip the PID of the child
4374 process to fit into an Emacs integer, as this is no longer a
4375 restriction.
4376 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4377 reaping only the process specified by PID argument, if that is
4378 positive. Use PID instead of dead_child to know which process to
4379 reap. Wait for the child to die only if WNOHANG is not in
4380 OPTIONS.
4381 (sys_select): Don't set dead_child.
4382
4383 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4384 as it is no longer needed.
4385
4386 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4387 no longer needed.
4388 (record_child_status_change): Remove the setting of
4389 record_at_most_one_child for the !WNOHANG case.
4390
4391 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 Fix problems in ns port found by static checking.
4394 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4395 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4396 not to process group.
4397 (ns_select): Use emacs_write, not write, as that's more robust
4398 in the presence of signals.
4399 (fd_handler:): Check for read errors.
4400
4401 2012-11-16 Glenn Morris <rgm@gnu.org>
4402
4403 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4404
4405 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4406
4407 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4408
4409 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4410
4411 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4412 use the same value of thread handle.
4413 (start_timer_thread): If the timer thread exited (due to error),
4414 clean up by closing the two handles it used. Duplicate the caller
4415 thread's handle here, so it gets duplicated only once, when
4416 launching the timer thread. Set priority of the timer thread, not
4417 the caller thread.
4418 (getitimer): Don't duplicate the caller thread's handle here.
4419 (Bug#12832)
4420
4421 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4422
4423 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4424 called (Bug#12834).
4425
4426 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4427
4428 Remove no-longer-used pty_max_bytes variable.
4429 * process.c (pty_max_bytes): Remove; unused.
4430 (send_process): Do not set it.
4431
4432 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4433
4434 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4435 Update dependencies.
4436
4437 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4438
4439 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4440 This follows up on the 2012-09-29 patch that removed indirection
4441 for the 'function' field. Reported by Sergey Vinokurov in
4442 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4443
4444 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4445
4446 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4447 different name, as the MS runtime does not have such a function,
4448 and probably never will.) All callers changed. Ignore DIRFD
4449 value if PATH is an absolute file name, to match Posix spec
4450 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4451 symlinks.
4452
4453 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4454
4455 * xdisp.c (echo_area_display, redisplay_internal):
4456 Omit redundant check whether frame_garbaged is set.
4457
4458 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4459
4460 Use faccessat, not access, when checking file permissions (Bug#12632).
4461 This fixes a bug that has been present in Emacs since its creation.
4462 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4463 which must set some sort of record. (Torek's bug report was against
4464 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4465 same common flaw.) See Torek's Usenet posting
4466 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4467 Posted: Fri Apr 8 14:18:56 1983.
4468 * Makefile.in (LIB_EACCESS): New macro.
4469 (LIBES): Use it.
4470 * callproc.c (init_callproc):
4471 * charset.c (init_charset):
4472 * fileio.c (check_existing, check_executable, check_writable)
4473 (Ffile_readable_p):
4474 * lread.c (openp, load_path_check):
4475 * process.c (allocate_pty):
4476 * xrdb.c (file_p):
4477 Use effective UID when checking permissions, not real UID.
4478 * callproc.c (init_callproc):
4479 * charset.c (init_charset):
4480 * lread.c (load_path_check, init_lread):
4481 Test whether directories are accessible, not merely whether they exist.
4482 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4483 * fileio.c (check_existing, check_executable, check_writable)
4484 (Ffile_readable_p):
4485 Use symbolic names instead of integers for the flags, as they're
4486 portable now.
4487 (check_writable): New arg AMODE. All uses changed.
4488 Set errno on failure.
4489 (Ffile_readable_p): Use faccessat, not stat + open + close.
4490 (Ffile_writable_p): No need to call check_existing + check_writable.
4491 Just call check_writable and then look at errno. This saves a syscall.
4492 dir should never be nil; replace an unnecessary runtime check
4493 with an eassert. When checking the parent directory of a nonexistent
4494 file, check that the directory is searchable as well as writable, as
4495 we can't create files in unsearchable directories.
4496 (file_directory_p): New function, which uses 'stat' on most platforms
4497 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4498 (Ffile_directory_p, Fset_file_times): Use it.
4499 (file_accessible_directory_p): New function, which uses a single
4500 syscall for efficiency.
4501 (Ffile_accessible_directory_p): Use it.
4502 * xrdb.c (file_p): Use file_directory_p.
4503 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4504 * lread.c (openp): When opening a file, use fstat rather than
4505 stat, as that avoids a permissions race. When not opening a file,
4506 use file_directory_p rather than stat.
4507 (dir_warning): First arg is now a usage string, not a format.
4508 Use errno. All uses changed.
4509 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4510 that merely introduced a race.
4511 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4512 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4513 and similarly for the other O_* flags.
4514 * w32.c (sys_faccessat): Rename from sys_access and switch to
4515 faccessat's API. All uses changed.
4516 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4517 (magic_db): Rename from magic_file_p.
4518 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4519 char *, so that we don't have to test for file existence
4520 separately from opening the file for reading. This removes a race
4521 fixes a permission-checking problem, and simplifies the code.
4522 All uses changed.
4523 (file_p): Remove; no longer needed.
4524
4525 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Omit glyphs initialization at startup.
4528 * dispnew.c (glyphs_initialized_initially_p): Remove.
4529 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4530 (Fredraw_frame): Move actual code from here...
4531 (redraw_frame): ...to here. Add eassert. Adjust comment.
4532 (Fredraw_display): Use redraw_frame.
4533 * xdisp.c (clear_garbaged_frames): Likewise.
4534
4535 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4536
4537 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4538 passed to pint2str and pint2hrstr to be at most the size of the
4539 frame's decode_mode_spec_buffer. This avoids crashes with very
4540 large values of FIELD_WIDTH argument to decode_mode_spec.
4541 (Bug#12867)
4542
4543 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4544
4545 Fix a race with verify-visited-file-modtime (Bug#12863).
4546 Since at least 1991 Emacs has ignored an mtime difference of no
4547 more than one second, but my guess is that this was to work around
4548 file system bugs that were fixed long ago. Since the race is
4549 causing problems now, let's remove that code.
4550 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4551 whose time stamp is off by no more than a second. Insist that the
4552 file time stamps match exactly.
4553
4554 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4555
4556 * frame.h (struct frame): Convert external_tool_bar member to
4557 1-bit unsigned bitfield.
4558 * termhooks.h (struct terminal): Remove mouse_moved member since
4559 all users are long dead. Adjust comment on mouse_position_hook.
4560
4561 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4562
4563 Simplify by using FOR_EACH_FRAME here and there.
4564 * frame.c (next_frame, prev_frame, other_visible_frames)
4565 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4566 * w32term.c (x_window_to_scroll_bar): Likewise.
4567 * window.c (window_list): Likewise.
4568 * xdisp.c (x_consider_frame_title): Likewise.
4569 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4570 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4571 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4572 * xmenu.c (menubar_id_to_frame): Likewise.
4573 * xselect.c (frame_for_x_selection): Likewise.
4574 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4575 (x_window_to_menu_bar): Likewise.
4576 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4577
4578 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4579
4580 * data.c (Qdefalias_fset_function): Now static.
4581
4582 Another tweak to vectorlike_header change.
4583 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4584 Remove, and replace all uses with ...
4585 (next_in_free_list, set_next_in_free_list):
4586 New functions, which respect C's aliasing rules better.
4587
4588 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4589
4590 * window.c (list4i): Rename from 'quad'. All uses changed.
4591 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4592
4593 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4594
4595 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4596 warning about mixing declarations and code in ISO C90.
4597
4598 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4599
4600 * window.c (Fsplit_window_internal): Set combination limit of
4601 new parent window to t iff Vwindow_combination_limit is t;
4602 fixing a regression introduced with the change from 2012-09-22.
4603 (Fset_window_combination_limit): Fix doc-string.
4604
4605 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4606
4607 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4608 amount when the scroll margins are too large. When scrolling
4609 backwards in the buffer, give up if cannot reach point or the
4610 scroll margin within a reasonable number of screen lines.
4611 Fixes point position in window under scroll-up/down-aggressively when
4612 point is positioned many lines beyond the window top/bottom.
4613 (Bug#12811)
4614
4615 * ralloc.c (relinquish): If real_morecore fails to return memory
4616 to the system, don't crash; instead, leave the last heap
4617 unchanged and return. (Bug#12774)
4618
4619 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4620
4621 * lisp.h (AUTOLOADP): New macro.
4622 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4623 * data.c (Ffset): Remove special ad-advice-info handling.
4624 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4625 (Fsubr_arity): CSE.
4626 (Finteractive_form): Simplify.
4627 (Fquo): Don't insist on having at least 2 arguments.
4628 (Qdefalias_fset_function): New var.
4629
4630 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4631
4632 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4633
4634 * nsfont.m (Qcondensed, Qexpanded): New variables.
4635 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4636 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4637
4638 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4639
4640 Fix recently introduced crash on MS-Windows (Bug#12839).
4641 * w32term.h (struct scroll_bar): Use convenient header.
4642 (SCROLL_BAR_VEC_SIZE): Remove.
4643 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4644
4645 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4646
4647 Tweak last vectorlike_header change.
4648 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4649 vectorlike object on the free list. This is introduced to avoid
4650 some (but not all) pointer casting and aliasing problems, see
4651 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4652 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4653 objects.
4654 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4655
4656 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4657
4658 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4659 been removed, so remove them here also.
4660
4661 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4662
4663 * doc.c (Fdocumentation): Handle new property
4664 dynamic-docstring-function to replace the old ad-advice-info.
4665
4666 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4667
4668 * fns.c (Qeql, hashtest_eq): Now static.
4669
4670 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4671
4672 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4673 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4674 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4675 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4676
4677 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 Use same hash function for hashfn_profiler as for hash_string etc.
4680 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4681 * lisp.h (sxhash_combine): New inline function, with the contents
4682 of the old SXHASH_COMBINE.
4683 * profiler.c (hashfn_profiler): Use it, instead of having a
4684 special hash function containing a comparison that always yields 1.
4685
4686 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4687
4688 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4689 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4690 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4691 Remove unused vars.
4692
4693 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4694
4695 * image.c (xpm_make_color_table_h): Fix compiler error because
4696 make_hash_table changed.
4697
4698 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4699
4700 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4701
4702 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4703
4704 Use ad-hoc comparison function for the profiler's hash-tables.
4705 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4706 (make_log): Use them.
4707 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4708 call Fequal any more.
4709 (Ffunction_equal): New function.
4710 (cmpfn_profiler, hashfn_profiler): New functions.
4711 (syms_of_profiler): Initialize them.
4712 * lisp.h (struct hash_table_test): New struct.
4713 (struct Lisp_Hash_Table): Use it.
4714 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4715 * fns.c (make_hash_table): Take a struct to describe the test.
4716 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4717 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4718 (hash_lookup, hash_remove_from_table): Move assertion checking of
4719 hashfn result here. Check hash-equality before calling cmpfn.
4720 (Fmake_hash_table): Adjust call to make_hash_table.
4721 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4722 (syms_of_fns): Initialize them.
4723 * emacs.c (main): Move syms_of_fns earlier.
4724 * xterm.c (syms_of_xterm):
4725 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4726 * print.c (print_object): Adjust to new hash-table struct.
4727 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4728
4729 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4730
4731 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4732 value of w32-scroll-lock-modifier is neither nil nor one of the
4733 known key modifiers. (Bug#12806)
4734
4735 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4736
4737 Shrink struct vectorlike_header to the only size field.
4738 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4739 Adjust comment.
4740 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4741 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4742 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4743 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4744 information from the vector header. Adjust comment.
4745 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4746 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4747 layout.
4748 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4749 (struct vectorlike_header): Remove next member. Adjust comment.
4750 (struct Lisp_Subr): Add convenient header. Adjust comment.
4751 (allocate_pseudovector): Adjust prototype.
4752 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4753 (sweep_string, lisp_malloc): Remove useless prototypes.
4754 (enum mem_type): Adjust comment.
4755 (NEXT_IN_FREE_LIST): New macro.
4756 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4757 (Fmake_bool_vector): Likewise.
4758 (struct large_vector): New type to represent allocation unit for
4759 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4760 (large_vectors): Change type to struct large_vector.
4761 (allocate_vector_from_block): Simplify.
4762 (PSEUDOVECTOR_NBYTES): Replace with...
4763 (vector_nbytes): ...new function. Adjust users.
4764 (sweep_vectors): Adjust processing of large vectors.
4765 (allocate_vectorlike): Likewise.
4766 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4767 Add easserts. Adjust XSETPVECTYPESIZE usage.
4768 (allocate_buffer): Use BUFFER_PVEC_INIT.
4769 (live_vector_p): Adjust to match large vector.
4770 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4771 * buffer.h (struct buffer): Add next member.
4772 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4773 New macros.
4774 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4775 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4776 (copy_hash_table): Adjust to match vector header change.
4777 * lread.c (defsubr): Use XSETPVECTYPE.
4778 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4779 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4780 (xvecsize): New command.
4781
4782 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 * keyboard.c (event_to_kboard): Do not dereference
4785 frame_or_window field of SELECTION_REQUEST_EVENT
4786 and SELECTION_CLEAR_EVENT events (Bug#12814).
4787 * xterm.h (struct selection_input_event): Adjust comment.
4788
4789 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4790
4791 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4792 such as Scroll Lock, if the respective keys are treated as
4793 function keys, not as modifiers. This avoids destroying non-ASCII
4794 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4795
4796 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4797
4798 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4799
4800 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 Restore some duplicate definitions (Bug#12814).
4803 This undoes part of the 2012-11-03 changes. Some people build
4804 with plain -g rather than with -g3, and they need the duplicate
4805 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4806 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4807 Define as macros, as well as as enums or as constants.
4808
4809 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4810
4811 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4812 to keypad keys (Bug#12816).
4813
4814 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 Minor adjustments of recently-changed frame functions.
4817 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4818 known to be a frame (we're in the FRAMEP branch).
4819 * lisp.h (Qframep): Remove decl. frame.h declares this.
4820 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4821 since they're meant for Lisp fixnum values.
4822
4823 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4824
4825 * window.c (Fwindow_combination_limit): Revert to the only
4826 required argument and adjust docstring as suggested in
4827 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4828 by Martin Rudalics <rudalics@gmx.at>.
4829
4830 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4831
4832 Widely used frame validity and checking functions.
4833 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4834 * frame.c (decode_live_frame, decode_any_frame): New functions.
4835 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4836 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4837 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4838 (Fframe_pointer_visible_p): Use decode_any_frame.
4839 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4840 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4841 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4842 (Fframe_focus): Likewise. Allow zero number of arguments.
4843 Adjust docstring.
4844 (frame_buffer_list, frame_buffer_predicate): Remove.
4845 * lisp.h (frame_buffer_predicate): Remove prototype.
4846 * buffer.c (Fother_buffer): Use decode_any_frame.
4847 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4848 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4849 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4850 (Fclose_font, Ffont_info): Use decode_live_frame.
4851 * fontset.c (check_fontset_name): Likewise.
4852 * terminal.c (Fframe_terminal): Likewise.
4853 * w32fns.c (check_x_frame): Likewise.
4854 * window.c (Fminibuffer_window, Fwindow_at)
4855 (Fcurrent_window_configuration): Likewise.
4856 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4857 Likewise. Allow zero number of arguments. Adjust docstring.
4858 * dispnew.c (Fredraw_frame): Likewise.
4859 * xfaces.c (frame_or_selected_frame): Remove.
4860 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4861 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4862 (Fframe_face_alist): Use decode_live_frame.
4863 * xfns.c (check_x_frame): Likewise.
4864
4865 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 * window.c (quad): New function.
4868 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4869 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4870 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4871 (Fwindow_line_height): Use it.
4872 (Fwindow_fringes): Use list3.
4873 (Fwindow_scroll_bars): Use list4.
4874 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4875 (Fwindow_combination_limit): Allow zero number of arguments.
4876
4877 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4878
4879 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4880
4881 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4882 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4883 file descriptor 2 for standard error. (Bug#12805)
4884
4885 2012-11-05 Chong Yidong <cyd@gnu.org>
4886
4887 * process.c (wait_reading_process_output): Revert previous change.
4888
4889 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4892 This removes code that has been obsolete since around 1990.
4893 * callproc.c (Fcall_process):
4894 * emacs.c (main):
4895 * process.c (create_process):
4896 * term.c (dissociate_if_controlling_tty):
4897 Assume setsid exists.
4898 * callproc.c (child_setup): Assume setpgid exists and behaves as
4899 per POSIX.1-1988 or later.
4900 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4901 * emacs.c (shut_down_emacs):
4902 * sysdep.c (sys_suspend, init_foreground_group):
4903 Assume getpgrp behaves as per POSIX.1-1998 or later.
4904 * msdos.c (setpgrp): Remove.
4905 (tcgetpgrp, setpgid, setsid): New functions.
4906 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4907 * term.c (no_controlling_tty): Remove; unused.
4908 * w32proc.c (setpgrp): Remove.
4909 (setsid, tcgetpgrp): New functions.
4910
4911 Simplify by assuming __fpending.
4912 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4913 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4914 Do not assume that __fpending's result fits in int.
4915
4916 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4917
4918 Remove EMACS_OUTQSIZE+sleep hack.
4919 * dispnew.c (update_frame_1): Remove hack for terminals slower
4920 than 2400 bps, which throttled Emacs by having it sleep.
4921 This code hasn't worked since at least 2007, when the multi-tty stuff
4922 was added, and anyway those old terminals are long dead.
4923 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4924 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4925
4926 Fix data-loss with --version (Bug#9574).
4927 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4928 as we can't assume that emacs_strerror is initialized, and strerror
4929 is good enough here.
4930 (main): Invoke atexit earlier, to catch earlier instances of
4931 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4932
4933 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4934
4935 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4936 (keyDown): Remap keypad keys to X11 virtual key codes.
4937
4938 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4939
4940 Fix data-loss with --batch (Bug#9574).
4941 * emacs.c: Include <close-stream.h>.
4942 (close_output_streams): New function.
4943 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4944 and handles errors appropriately.
4945 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4946 does that now.
4947
4948 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4949 The symptom is a diagnostic "GLib-WARNING **: In call to
4950 g_spawn_sync(), exit status of a child process was requested but
4951 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4952 waitpid(), so exit status can't be returned." The diagnostic
4953 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4954 The real bug is a race condition between Emacs and glib: Emacs
4955 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4956 so that glib can't find it. Work around the bug by invoking
4957 waitpid only on subprocesses that Emacs itself creates.
4958 * process.c (create_process, record_child_status_change):
4959 Don't use special value -1 in pid field, as the caller now must
4960 know the pid rather than having the callee infer it.
4961 The inference was sometimes incorrect anyway, due to another race.
4962 (create_process): Set new 'alive' member if child is created.
4963 (process_status_retrieved): New function.
4964 (record_child_status_change): Use it.
4965 Accept negative 1st argument, which means to wait for the
4966 processes that Emacs already knows about. Move special-case code
4967 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4968 processes that have already been waited for, by testing and
4969 clearing new 'alive' member.
4970 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4971 now does this internally.
4972 (handle_child_signal): Let record_child_status_change do all
4973 the work, since we do not want to reap all exited child processes,
4974 only the child processes that Emacs itself created.
4975 * process.h (Lisp_Process): New boolean member 'alive'.
4976
4977 Omit duplicate definitions no longer needed with gcc -g3.
4978 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4979 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4980 Define only as macros. There's no longer any need to also define
4981 these symbols as enums or as constants, since we now assume
4982 gcc -g3 when debugging.
4983
4984 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4985
4986 * lisp.mk: Adjust comments to the fact that term/internal is now
4987 loaded from loadup.el.
4988
4989 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4990 (msdos_fatal_signal): New function.
4991 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4992 its argument list.
4993
4994 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4995 for GCC versions before 4.
4996 (emacs_raise): Define to call msdos_fatal_signal.
4997
4998 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4999 iterator when starting in the middle of a display or overlay
5000 string. (Bug#12745)
5001
5002 2012-11-03 Chong Yidong <cyd@gnu.org>
5003
5004 * process.c (wait_reading_process_output): Clean up the last
5005 change.
5006
5007 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5008
5009 * process.c (wait_reading_process_output): Avoid a race condition
5010 with SIGIO delivery (Bug#11536).
5011
5012 2012-11-03 Chong Yidong <cyd@gnu.org>
5013
5014 * buffer.c (cursor_type): Untabify docstring.
5015
5016 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5017
5018 * frame.h (struct frame): Drop can_have_scroll_bars member
5019 which is meaningless for a long time. Adjust comments.
5020 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5021 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5022
5023 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5024
5025 * window.c (decode_next_window_args): Update window arg after
5026 calling decode_live_window and so fix crash reported at
5027 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5028 by Juanma Barranquero <lekktu@gmail.com>.
5029 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5030 * font.c (Ffont_at): Likewise.
5031
5032 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5033
5034 * widget.c (resize_cb): New function.
5035 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5036 (EmacsFrameResize): Check if all is up to date before changing frame
5037 size.
5038
5039 2012-11-02 Eli Zaretskii <eliz@gnu.org>
5040
5041 Implement backtrace output for fatal errors on MS-Windows.
5042 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5043 (BACKTRACE_LIMIT_MAX): New macro.
5044 (w32_backtrace): New function.
5045 (emacs_abort): Use w32_backtrace when the user chooses not to
5046 attach a debugger. Update the text of the abort dialog.
5047
5048 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5049
5050 Window-related stuff cleanup here and there.
5051 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5052 Use decode_any_window.
5053 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5054 * xdisp.c (Fformat_mode_line): Likewise.
5055 * font.c (Ffont_at): Use decode_live_window.
5056 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5057 * window.c (decode_next_window_args): Likewise.
5058 (decode_any_window): Remove static.
5059 * window.h (decode_any_window): Add prototype.
5060 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5061 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5062 respectively.
5063
5064 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5065
5066 Remove pad from struct input_event.
5067 * termhooks.h (struct input_event): Remove padding field.
5068 Adjust comment.
5069 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5070 member is never cons for a long time. Adjust comment.
5071 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5072 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5073 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5074 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5075
5076 2012-11-01 Eli Zaretskii <eliz@gnu.org>
5077
5078 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5079
5080 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5081
5082 Fix crash when using Emacs as commit editor for git (Bug#12697).
5083 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5084 and it is configured in conf_post.h.
5085 (Fcall_process): Don't invoke both setsid and setpgid; the former
5086 is enough, if it exists.
5087 * callproc.c (Fcall_process, child_setup):
5088 * process.c (create_process): Use setpgid.
5089 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5090 for the real thing.
5091 * dispnew.c (init_display): Initialize the foreground group
5092 if we are running a tty display.
5093 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5094 * lisp.h (init_foreground_group): New decl.
5095 * sysdep.c (inherited_pgroup): New static var.
5096 (init_foreground_group, tcsetpgrp_without_stopping)
5097 (narrow_foreground_group, widen_foreground_group): New functions.
5098 (init_sys_modes): Narrow foreground group.
5099 (reset_sys_modes): Widen foreground group.
5100
5101 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
5102
5103 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5104
5105 2012-10-31 Martin Rudalics <rudalics@gmx.at>
5106
5107 * minibuf.c (read_minibuf): Restore current buffer since
5108 choose_minibuf_frame calling Fset_frame_selected_window may
5109 change it (Bug#12766).
5110
5111 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5112
5113 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5114
5115 2012-10-30 Kenichi Handa <handa@gnu.org>
5116
5117 * font.c (Ffont_at): If WINDOW is specified and it is not
5118 displaying the current buffer, signal an error.
5119
5120 2012-10-29 Daniel Colascione <dancol@dancol.org>
5121
5122 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5123 In preparation for fixing bug#12739, move these functions from
5124 here...
5125
5126 * coding.h, coding.c: ... to here, and compile them only when
5127 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5128 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5129
5130 2012-10-28 Eli Zaretskii <eliz@gnu.org>
5131
5132 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5133 (timer_loop, getitimer, setitimer): Use it instead of
5134 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5135 'clock'.
5136 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5137 literal 10000.
5138
5139 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5140
5141 * nsterm.m (NO_APPDEFINED_DATA): New define.
5142 (last_appdefined_event_data): New variable
5143 (last_appdefined_event): Remove.
5144 (ns_select): Initialize t from last_appdefined_event_data instead
5145 of [last_appdefined_event data1].
5146 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5147 remove last_appdefined_event (Bug#12698).
5148
5149 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5150
5151 * frame.c (x_set_font): Catch internal error.
5152
5153 2012-10-27 Eli Zaretskii <eliz@gnu.org>
5154
5155 Avoid overflow in w32 implementation of interval timers.
5156 When possible, for ITIMER_PROF count only times the main thread
5157 actually executes.
5158 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5159 'volatile ULONGLONG' types. All the other data which was
5160 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5161 (GetThreadTimes_Proc): New typedef.
5162 (w32_get_timer_time): New function, returns a suitable time value
5163 for the timer.
5164 (timer_loop): Enter critical section when accessing ULONGLONG
5165 values of the itimer_data struct, as these accesses are no longer
5166 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5167 Remove unused variable.
5168 (init_timers): Initialize s_pfn_Get_Thread_Times.
5169 (start_timer_thread): Don't assign itimer->caller_thread here.
5170 (getitimer): Assign itimer->caller_thread here.
5171 (setitimer): Always call getitimer to get the value of ticks_now.
5172 (sys_spawnve): Avoid compiler warning about format mismatch.
5173
5174 2012-10-26 Eli Zaretskii <eliz@gnu.org>
5175
5176 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5177 mouse movement events if the menu bar is active. This avoids
5178 producing a busy "hour-glass" cursor by Windows if the mouse
5179 pointer is positioned over a tooltip shown for some menu item.
5180
5181 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5182
5183 Don't assume process IDs fit in int.
5184 * emacs.c (shut_down_emacs) [!DOS_NT]:
5185 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5186 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5187 Use pid_t, not int, to store process IDs, as 'int'
5188 is not wide enough on a few platforms (e.g., AIX and IRIX).
5189
5190 2012-10-23 Kenichi Handa <handa@gnu.org>
5191
5192 The following change is to make face-font-rescale-alist work
5193 correctly for non-ASCII fonts.
5194
5195 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5196 (font_open_for_lface): Handle Vface_font_rescale_alist.
5197
5198 2012-10-23 Chong Yidong <cyd@gnu.org>
5199
5200 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5201
5202 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5203
5204 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5205 for screen font.
5206 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5207
5208 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5209 event (Bug#12681).
5210
5211 2012-10-21 Glenn Morris <rgm@gnu.org>
5212
5213 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5214
5215 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5216
5217 Port to OpenBSD 5.1.
5218 * frame.c (Fmouse_position, Fmouse_pixel_position):
5219 * xdisp.c (produce_stretch_glyph):
5220 Declare local vars only when they're needed.
5221 This is clearer and avoids a warning on OpenBSD about unused vars.
5222 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5223 This is safer, and avoids OpenBSD warnings about unused vars.
5224 * keyboard.c (record_menu_key): Remove unnecessary decl.
5225 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5226 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5227 as our definition clashes with OpenBSD's.
5228 * xfaces.c (load_face_colors, check_lface_attrs)
5229 (get_lface_attributes_no_remap, get_lface_attributes)
5230 (lface_fully_specified_p, x_supports_face_attributes_p)
5231 (tty_supports_face_attributes_p, face_fontset, realize_face)
5232 (realize_x_face, realize_tty_face):
5233 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5234 merely Lisp_Object *. This is more informative and avoids
5235 a warning on OpenBSD about accessing beyond an object's size.
5236
5237 2012-10-20 Chong Yidong <cyd@gnu.org>
5238
5239 * lread.c (Fload): Doc fix (Bug#12592).
5240
5241 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5242
5243 * font.c (Ffont_at): Fix previous change.
5244
5245 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5246
5247 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5248 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5249 for the reasons.
5250
5251 * alloc.c (NSTATICS): Decrease to 0x800.
5252
5253 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5254
5255 * fns.c (Fnreverse): Include the problem element when signaling an
5256 error (bug#12677).
5257
5258 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5259
5260 * nsterm.m (ns_select): Check writefds before call to
5261 FD_ISSET (Bug#12668).
5262
5263 2012-10-18 Daniel Colascione <dancol@dancol.org>
5264
5265 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5266 (staticpro): If we run out of staticpro slots, die with an
5267 informative error instead of just calling emacs_abort.
5268
5269 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5270
5271 Fix two flaws reported by Dmitry Antipov.
5272 * window.c (Ftemp_output_buffer_show): Remove.
5273 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5274 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5275
5276 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5277
5278 * makefile.w32-in ($(BLD)/w32.$(O)):
5279 ($(BLD)/vm-limit.$(O)):
5280 ($(BLD)/term.$(O)):
5281 ($(BLD)/unexw32.$(O)):
5282 ($(BLD)/fileio.$(O)):
5283 ($(BLD)/dispnew.$(O)): Update dependencies.
5284
5285 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5286 Add prototypes.
5287
5288 * w32proc.c: Include ctype.h.
5289
5290 * w32.h (init_environment, check_windows_init_file)
5291 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5292 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5293 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5294 (sys_link): Add prototypes.
5295
5296 * w32.c: Include w32select.h.
5297 (sys_access, e_malloc, sys_select): Add prototypes.
5298 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5299
5300 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5301
5302 * unexw32.c: Include lisp.h and w32.h.
5303
5304 * term.c [WINDOWSNT]: Include w32term.h.
5305
5306 * process.c [WINDOWSNT]: Add prototype of sys_select.
5307
5308 * fileio.c [WINDOWSNT]: Include w32.h.
5309
5310 * dispnew.c [WINDOWSNT]: Include w32.h.
5311
5312 * cygw32.c (Fcygwin_convert_path_to_windows)
5313 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5314 Lisp_Object values. (Bug#12661)
5315
5316 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5317 to Lisp_Object. (Bug#12661)
5318
5319 2012-10-17 Kenichi Handa <handa@gnu.org>
5320
5321 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5322 invalidate.
5323
5324 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5325
5326 * buffer.c (Fkill_buffer): When unchaining the marker,
5327 reset its buffer pointer to NULL (Bug#12652).
5328
5329 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5330
5331 Do not verify indirection counters of killed buffers (Bug#12579).
5332 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5333 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5334
5335 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5336
5337 * alloc.c (Fmake_byte_code): Fix typo in comment.
5338 * print.c (print_interval): Define as static to match prototype.
5339 * indent.c (disptab_matches_widthtab, recompute_width_table):
5340 Convert to eassert.
5341
5342 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 * editfns.c (get_system_name): Remove.
5345 * lisp.h (get_system_name): Remove prototype.
5346 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5347 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5348
5349 2012-10-15 Daniel Colascione <dancol@dancol.org>
5350
5351 * dbusbind.c: Add comment explaining reason for previous change.
5352
5353 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5354
5355 * window.c (Fwindow_end): Rewrite check whether cached position
5356 can be used (Bug#12600).
5357 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5358 Set windows_or_buffers_changed.
5359
5360 2012-10-15 Daniel Colascione <dancol@dancol.org>
5361
5362 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5363 enabled by undefining the symbol "interface", which the platform
5364 headers define to something incompatible.
5365
5366 2012-10-14 Daniel Colascione <dancol@dancol.org>
5367
5368 * image.c (init_tiff_functions, init_imagemagick_functions)
5369 (init_svg_functions): Fix cygw32 build break by using these
5370 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5371
5372 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5373
5374 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5375
5376 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5377
5378 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5379
5380 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5381
5382 * coding.c (detect_coding): Set coding->id before calling
5383 this->detector.
5384
5385 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5386
5387 * fileio.c: Formatting fixes.
5388
5389 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5390
5391 Fix some stat-related races.
5392 * fileio.c (Fwrite_region): Avoid race condition if a file is
5393 removed or renamed by some other process immediately after Emacs
5394 writes it but before Emacs stats it. Do not assume that stat (or
5395 fstat) succeeds.
5396 * image.c (slurp_file): Resolve the file name with fopen + fstat
5397 rather than stat + fopen.
5398 (pbm_read_file) [0]: Remove unused code with stat race.
5399 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5400 Remove ineffective code with stat race.
5401
5402 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5403
5404 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5405
5406 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5407
5408 * nsterm.m (hold_event_q): New static variable.
5409 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5410 ! q_event_ptr.
5411 (hold_event): New function.
5412 (ns_read_socket): If hold_event_q have events, store them and
5413 return (Bug#12384).
5414 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5415 is zero (Bug#12384).
5416
5417 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5418
5419 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5420
5421 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5422
5423 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5424
5425 * fileio.c (check_existing): New function.
5426 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5427 instead of calling 'stat', when what's needed is to check whether
5428 a file exists. This avoids expensive system calls on MS-Windows.
5429 (Bug#12587)
5430
5431 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5432
5433 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5434 determine whether a file exists and is not a directory.
5435
5436 * lisp.h (check_existing): Add prototype.
5437
5438 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5439
5440 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5441
5442 2012-10-12 Glenn Morris <rgm@gnu.org>
5443
5444 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5445
5446 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5447
5448 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5449
5450 * eval.c (Fautoload): Remember previous autoload status in load-history.
5451
5452 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5453
5454 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5455 * lread.c (load_each_byte, new_backquote_flag, readchar)
5456 (read_filtered_event, lisp_file_lexically_bound_p)
5457 (safe_to_load_version, Fload, complete_filename_p, openp)
5458 (build_load_history, readevalloop, read_escape, read1)
5459 (string_to_number, read_vector, read_list):
5460 * macros.c (Fstart_kbd_macro):
5461 * marker.c (CONSIDER):
5462 * menu.c (parse_single_submenu, digest_single_submenu)
5463 (find_and_return_menu_selection, Fx_popup_menu):
5464 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5465 (Ftry_completion):
5466 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5467 (ns_menu_show):
5468 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5469 (xmenu_show, xdialog_show):
5470 Use bool for booleans.
5471 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5472 as it's not a predicate. All uses changed. Omit unnecessary
5473 buffer termination.
5474
5475 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5478 (save_excursion_restore): Do not restore mark if it was not saved.
5479
5480 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5481
5482 * marker.c (cached_modiff): EMACS_INT, not int.
5483
5484 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5485 instead of having a wrong decl.
5486 * nsmenu.m (waiting_for_input): Remove wrong decl.
5487
5488 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5489
5490 keyboard.c, keymap.c: Use bool for booleans.
5491 * dispnew.c (sit_for): Distinguish between 3-way display_option
5492 and boolean do_display.
5493 * keyboard.c (single_kboard, this_command_key_count_reset)
5494 (waiting_for_input, echoing, immediate_quit, input_pending)
5495 (interrupt_input, interrupts_deferred, pop_kboard)
5496 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5497 (command_loop_1, adjust_point_for_property)
5498 (safe_run_hooks_error, input_polling_used, read_char):
5499 (help_char_p, readable_events, kbd_buffer_events_waiting)
5500 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5501 (lucid_event_type_list_p, get_input_pending):
5502 (gobble_input, menu_separator_name_p, menu_bar_item)
5503 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5504 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5505 (keyremap_step, test_undefined, read_key_sequence)
5506 (detect_input_pending, detect_input_pending_ignore_squeezables)
5507 (detect_input_pending_run_timers, requeued_events_pending_p)
5508 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5509 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5510 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5511 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5512 (accessible_keymaps_1, Fkey_description, push_key_description):
5513 (shadow_lookup, struct where_is_internal_data)
5514 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5515 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5516 (describe_map, describe_vector):
5517 * menu.c (single_menu_item):
5518 * nsmenu.m (ns_update_menubar):
5519 * process.c (wait_reading_process_output):
5520 * search.c (scan_buffer, scan_newline):
5521 Use bool for boolean.
5522 * keyboard.c (timers_run, swallow_events)
5523 (detect_input_pending_run_timers):
5524 * process.c (wait_reading_process_output):
5525 Use unsigned for counter where wraparound-on-overflow is desired,
5526 since unsigned is guaranteed to have that behavior and signed is not.
5527 (read_char): Use ptrdiff_t for string length.
5528 (get_input_pending): Remove first argument, since it was always
5529 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5530 and behave as if it had that value. Return new value of
5531 input_pending. All callers changed.
5532 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5533 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5534 a string length.
5535 * keymap.c (push_key_description): Omit last arg, which was always 1.
5536 All callers changed.
5537
5538 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5539
5540 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5541
5542 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5543 ($(BLD)/term.$(O)): Update dependencies.
5544
5545 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5546
5547 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5548 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5549 initializer for PVEC_NORMAL_VECTOR.
5550
5551 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5552
5553 Clean out old termopts cruft.
5554 * termopts.h (flow_control, meta_key): Remove unused decls.
5555 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5556 Don't include termopts.h.
5557
5558 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5559
5560 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5561
5562 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5563
5564 * commands.h (immediate_quit): Remove duplicate decl.
5565
5566 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5567
5568 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5569 caching.
5570 (nsfont_open): Remove setting of Vfonts_in_cache.
5571 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5572
5573 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5574
5575 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5576 match what GetLastError returns. Explain why the function is
5577 needed.
5578
5579 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5580 'is_tooltip_frame', to avoid confusion with its global namesake.
5581
5582 2012-10-08 Daniel Colascione <dancol@dancol.org>
5583
5584 * xdisp.c (start_hourglass): Call w32_note_current_window when
5585 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5586 build that caused Emacs to display the hourglass cursor forever.
5587
5588 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5589 which is broken under remote desktop, calculate the number of
5590 colors available for a display based on the display's number of
5591 planes and number of bits per pixel per plane. (bug#10397).
5592
5593 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5594
5595 * nsfont.m (Vfonts_in_cache): New variable.
5596 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5597 are used. Add cached fonts to Vfonts_in_cache.
5598 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5599
5600 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5601
5602 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5603 in nt/config.nt.
5604 (FONT_H): Define after FRAME_H.
5605 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5606 Update dependencies.
5607
5608 * w32term.c: Remove leftover declaration of keyboard_codepage.
5609
5610 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5611
5612 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5613 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5614 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5615 (GLOBAL_SOURCES): Add cygw32.c.
5616 ($(BLD)/unexw32.$(O)):
5617 ($(BLD)/w32.$(O)):
5618 ($(BLD)/w32console.$(O)):
5619 ($(BLD)/w32fns.$(O)):
5620 ($(BLD)/w32heap.$(O)):
5621 ($(BLD)/w32menu.$(O)):
5622 ($(BLD)/w32proc.$(O)): Add w32common.h.
5623
5624 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5625 'const char *'.
5626 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5627
5628 2012-10-08 Daniel Colascione <dancol@dancol.org>
5629
5630 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5631 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5632 accidental message numbering hole. Change other messages to
5633 match.
5634
5635 * w32select.h (HAVE_W32SELECT): Remove.
5636
5637 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5638 w32common.h instead of w32heap.h.
5639
5640 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5641 (get_allocation_unit, get_processor_type, get_w32_major_version)
5642 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5643 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5644 (OS_NT, os_subtype, cache_system_info): Move declarations to
5645 w32common.
5646
5647 * w32heap.c: Include w32common.h.
5648 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5649 (w32_minor_version, w32_build_number, w32_subtype):
5650 Remove duplicate definitions.
5651
5652 * w32fns.c: Include w32common.h; include w32heap.h only in
5653 WINDOWSNT.
5654
5655 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5656 Use `report_file_error' instead of `error' in order to better
5657 inform users of what went wrong. Increase NTGUI_UNICODE file
5658 dialog box file name length to 32k, the maximum allowed by the NT
5659 kernel.
5660
5661 * w32common.h: New file.
5662 (ROUND_UP, ROUND_DOWN, get_page_size)
5663 (get_allocation_unit, get_processor_type, get_w32_major_version)
5664 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5665 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5666 (OS_NT, os_subtype, cache_system_info): Move here.
5667
5668 * unexw32.c, unexcw.c: Include w32common.h.
5669
5670 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5671 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5672 to call syms_of_w32select.
5673
5674 * cygw32.h: Remove obsolete EXFUN declarations.
5675
5676 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5677
5678 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5679 of w32inevt.o from SOME_MACHINE_OBJECTS.
5680
5681 2012-10-08 Daniel Colascione <dancol@dancol.org>
5682
5683 * image.c: Permanent fix for JPEG compilation issue --- limit
5684 jpeglib `boolean' redefinition to Cygwin builds.
5685
5686 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5687
5688 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5689
5690 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5691 Cygwin.
5692
5693 2012-10-08 Daniel Colascione <dancol@dancol.org>
5694
5695 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5696 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5697 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5698 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5699 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5700 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5701 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5702 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5703 now a supported configuration.
5704
5705 * Makefile.in: consolidate image variables into LIBIMAGE; add
5706 W32_OBJ and W32_LIBS. Compile new files.
5707
5708 * conf_post.h:
5709 (_DebPrint) declare tracing facility for W32 debugging. We need
5710 to unify tracing later.
5711
5712 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5713 unconditional use of W32 Unicode functions. Cygwin runs only on
5714 100% Unicode operating systems.
5715
5716 * cygw32.c: New file. Define Cygwin-specific facilities.
5717 (Fcygwin_convert_path_to_windows)
5718 (Fcygwin_convert_path_from_windows): New user functions for
5719 accessing Cygwin path-munging routines.
5720
5721 * cygw32.h: New file.
5722 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5723 UTF-16LE strings temporarily inside non-Lisp-visible string
5724 objects.
5725
5726 (w32_strerror): Just what it says on the tin.
5727
5728 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5729 also run for Cygwin; both systems have the same problem with using
5730 GUI facilities in a forked child. Also call syms_of_cygw32,
5731 syms_of_w32select in correct places.
5732
5733 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5734 needs fork-then-exec for daemon launching.
5735
5736 * font.h: Include frame.h.
5737
5738 * image.c: Use the image library cache machinery only when we're
5739 compiling for native WINDOWSNT; Cygwin can use shared libraries
5740 like any other Unixlike system.
5741
5742 * keyboard.c: Clarify a comment regarding the input loop.
5743
5744 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5745 functions directly instead of trying to detect at runtime that our
5746 host operating system supports them. We make this change for two
5747 reasons: Cygwin lacks support for the multibyte character
5748 conversion functions used by the legacy menu code, and Cygwin
5749 never needs to rely on non-Unicode APIs.
5750
5751 * unexw32.c (hinst): Declare extern.
5752
5753 * w32.c: Change header order;
5754 (w32_strerror): Move to w32fns.c because we need it for
5755 non-WINDOWSNT builds.
5756
5757 * w32.h: Add #error macro to make sure we don't include w32.h for
5758 Cygwin builds. Remove w32select declarations.
5759
5760 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5761 w32fns.c. w32console.c is WINDOWSNT-only.
5762
5763 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5764 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5765 POSIXy alternative.
5766 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5767 (w32_major_version, w32_minor_version, w32_build_number)
5768 (os_subtype, sound_type): Define here
5769 (w32_defined_color): Make color parameter const for consistency
5770 with other _defined_color functions.
5771 (w32_createwindow): Unconditionally call w32_init_class instead of
5772 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5773 through the code is complex and unnecessary because class
5774 registration is practically free.
5775 (w32_name_of_message): New EMACSDEBUG-only function.
5776 (Fset_message_beep): Move here
5777 (Fx_open_connection): Require that the display name for Windows be
5778 "w32" for consistency, emacsclient disambiguation, and maybe, one
5779 day, multi-window-system support.
5780 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5781 Cygwin files for W32 GUI facilities, since these clearly don't
5782 expect Cygwin names.
5783 (_DebPrint): Define.
5784 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5785 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5786 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5787 (w32_last_error): Remove.
5788
5789 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5790
5791 * w32heap.c (syspage_mask): Declare here.
5792 (cache_system_info): Remove.
5793
5794 * w32inevt.c (faked_key): Define globally, not statically.
5795 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5796 (w32_console_toggle_lock_key): Move to w32fns.c.
5797
5798 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5799
5800 * w32proc.c (_DebPrint): Move to w32fns.c.
5801 * w32select.c: Include string.h, stdio.h for Cygwin.
5802 * w32select.h: New File.
5803
5804 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5805 get_osfhandle.
5806 (w32_message_fd): New variable. Under Cygwin, holds the file
5807 descriptor the system used to tell us about pending thread
5808 messages.
5809
5810 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5811 that prevented compilation under non-WINDOWSNT systems.
5812
5813 (w32_initialize): Open /dev/windows and assign it to
5814 w32_message_fd. Provide w32 feature.
5815
5816 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5817 (WM_EMACS_INPUT_READY): add.
5818 (prepend_msg, w32_message_fd): Declare globally.
5819
5820 * w32xfns.c:
5821 (keyboard_handle): Use only when WINDOWSNT.
5822 (notify_msg_ready): New function. Posts a message to the main
5823 thread's message queue under CYGWIN, which wakes up the main
5824 thread from select(2) by making the /dev/windows file descriptor
5825 ready. Under WINDOWSNT, it sets an event the same way the old
5826 code did.
5827
5828 (post, prepend_msg): Actually call notify_msg_ready instead of
5829 setting the input event directly.
5830
5831 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5832
5833 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5834 but it still has blocs in it, don't return it to the system,
5835 instead of aborting. (Bug#12402)
5836
5837 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5838
5839 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5840
5841 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5842 MAC_OS_X_VERSION_10_6.
5843 (syms_of_nsterm): Remove comment about Panther and above for
5844 ns-antialias-text.
5845 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5846 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5847 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5848
5849 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5850 MAC_OS_X_VERSION_10_4.
5851
5852 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5853 MAC_OS_X_VERSION_10_2.
5854
5855 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5856
5857 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5858 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5859
5860 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5861 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5862 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5863 Remove ns_in_resize check.
5864 (ns_clear_frame_area): Remove resize handle code.
5865
5866 * nsfns.m (ns_in_resize): Remove.
5867 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5868 Remove ns_in_resize check.
5869
5870 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5871
5872 Improve sys_siglist detection.
5873 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5874 defined as a macro, as is done in Solaris.
5875 (sys_siglist_entries): New macro.
5876 (save_strsignal): Use it.
5877 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5878 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5879
5880 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5881
5882 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5883 fullscreen/Fullscreen.
5884
5885 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5886 tobar_height is new.
5887
5888 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5889 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5890 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5891 (windowDidResize:): Check for correct window if old style fullscreen.
5892 Capitalize word in comment. Remove incorrect comment.
5893 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5894 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5895 error in drawing background.
5896 (toggleFullScreen:): Remove comment. Rearrange calls.
5897 Set toolbar values to zero, save old height in tobar_height.
5898 Restore tool bar height when leaving fullscreen.
5899 (canBecomeMainWindow): New function.
5900
5901 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5904
5905 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5906
5907 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5908
5909 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5910 that time stamps of directories could also be changed.
5911 Don't request the too broad GENERIC_WRITE, only the more restrictive
5912 FILE_WRITE_ATTRIBUTES access rights.
5913
5914 * fileio.c (Fset_file_times): Special-case ignoring errors for
5915 directories only on MSDOS, not on MS-Windows.
5916
5917 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5918
5919 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5920
5921 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5922
5923 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5924 see whether CreateFile failed.
5925
5926 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5927
5928 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5929 to avoid similar races.
5930 * keyboard.c (pending_signals): Now bool, not int.
5931
5932 Port timers to OpenBSD, plus check for timer failures.
5933 OpenBSD problem reported by Han Boetes.
5934 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5935 and/or setitimer.
5936 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5937 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5938 like OpenBSD, which has timer_settime but does not declare it.
5939 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5940 whether to use itimerspec-related primitives. All uses of
5941 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5942
5943 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5944
5945 * profiler.c (handle_profiler_signal): Fix a malloc race
5946 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5947
5948 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5949
5950 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5951
5952 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5953
5954 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5955 consistent with the change in return value of 'safe_strsignal'.
5956
5957 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5958
5959 Prefer plain 'static' to 'static inline' (Bug#12541).
5960 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5961 (bidi_set_sor_type, bidi_push_embedding_level)
5962 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5963 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5964 (bidi_cache_search, bidi_cache_ensure_space)
5965 (bidi_cache_iterator_state, bidi_cache_find)
5966 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5967 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5968 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5969 Now 'static', not 'static inline'.
5970
5971 Count overruns when profiling; change units to ns.
5972 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5973 Give extra weight to samples after overruns, to attempt to count
5974 the time more accurately.
5975 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5976 the underlying primitives nominally do ns.
5977 (Fprofiler_cpu_start): Document the change. Mention that
5978 the sampling intervals are only approximate.
5979
5980 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5981
5982 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5983
5984 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5985 case for the special 0 coding-system.
5986
5987 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5988 (Fmake_overlay): Remove redundant tests.
5989 (fix_start_end_in_overlays): Remove redundant recentering.
5990
5991 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5992
5993 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5994 Update dependencies.
5995
5996 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 Fix a malloc race condition involving strsignal.
5999 A signal can arrive in the middle of a malloc, and Emacs's signal
6000 handler can invoke strsignal, which can invoke malloc, which is
6001 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6002 Fix it by altering the signal handler so that it does not invoke
6003 strsignal.
6004 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6005 * process.c (status_message): Use const pointer, in case strsignal
6006 is #defined to safe_strsignal.
6007 * sysdep.c (sys_siglist, init_signals): Always define and
6008 initialize a substitute sys_siglist if the system does not define
6009 one, even if HAVE_STRSIGNAL.
6010 (safe_strsignal): Rename from strsignal. Always define,
6011 using sys_siglist. Return a const pointer.
6012 * syssignal.h (safe_strsignal): New decl.
6013 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6014
6015 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6016
6017 * w32proc.c (timer_loop): Fix code that waits for timer
6018 expiration, to avoid high CPU usage.
6019
6020 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6021
6022 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6023 (sweep_weak_table): Remove redundant prototypes.
6024
6025 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6026
6027 * emacs.c: Move the inclusion of TERM_HEADER after including
6028 windows.h on WINDOWSNT. This avoids compilation problems with
6029 MSVC.
6030
6031 2012-10-01 Eli Zaretskii <eliz@gnu.org>
6032
6033 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6034 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6035 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6036 as the previous version used 'void *'.
6037
6038 * ralloc.c (ROUNDUP): Fix last change.
6039 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6040 'size_t'.
6041
6042 * w32proc.c <disable_itimers>: New static flag.
6043 (init_timers): Initialize it to zero, after creating the critical
6044 sections used by the timer threads.
6045 (term_timers): Set to 1 before deleting the critical sections.
6046 (getitimer, setitimer): If disable_itimers is non-zero, return an
6047 error indication without doing anything. Reported by Fabrice
6048 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6049 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6050 return results.
6051 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6052 support timers.
6053
6054 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6055 term_ntproc after all the other bookkeeping, to get timers working
6056 as long as possible.
6057
6058 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6059
6060 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6061 Suggested by Juri Linkov in
6062 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6063
6064 Prefer plain 'static' to 'static inline' (Bug#12541).
6065 With static functions, modern compilers inline pretty well by
6066 themselves; advice from programmers often hurts as much as it helps.
6067 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6068 this change shrinks the text size of the Emacs executable by 1.1%
6069 without affecting CPU significantly in my benchmark.
6070 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6071 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6072 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6073 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6074 (bset_auto_fill_function, bset_auto_save_file_format)
6075 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6076 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6077 (bset_cache_long_line_scans, bset_case_fold_search)
6078 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6079 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6080 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6081 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6082 (bset_header_line_format, bset_indicate_buffer_boundaries)
6083 (bset_indicate_empty_lines, bset_invisibility_spec)
6084 (bset_left_fringe_width, bset_major_mode, bset_mark)
6085 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6086 (bset_name, bset_overwrite_mode, bset_pt_marker)
6087 (bset_right_fringe_width, bset_save_length)
6088 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6089 (bset_scroll_up_aggressively, bset_selective_display)
6090 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6091 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6092 (set_buffer_overlays_after):
6093 * category.c (bset_category_table):
6094 * charset.c (read_hex):
6095 * coding.c (produce_composition, produce_charset)
6096 (handle_composition_annotation, handle_charset_annotation)
6097 (char_encodable_p):
6098 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6099 (assign_row, set_frame_matrix_frame, make_current)
6100 (add_row_entry):
6101 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6102 * fns.c (maybe_resize_hash_table):
6103 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6104 * gmalloc.c (register_heapinfo):
6105 * image.c (lookup_image_type):
6106 * intervals.c (set_interval_object, set_interval_left)
6107 (set_interval_right, copy_interval_parent, rotate_right)
6108 (rotate_left, balance_possible_root_interval):
6109 * keyboard.c (kset_echo_string, kset_kbd_queue)
6110 (kset_keyboard_translate_table, kset_last_prefix_arg)
6111 (kset_last_repeatable_command, kset_local_function_key_map)
6112 (kset_overriding_terminal_local_map, kset_real_last_command)
6113 (kset_system_key_syms, clear_event, set_prop):
6114 * lread.c (digit_to_number):
6115 * marker.c (attach_marker, live_buffer, set_marker_internal):
6116 * nsterm.m (ns_compute_glyph_string_overhangs):
6117 * process.c (pset_buffer, pset_command)
6118 (pset_decode_coding_system, pset_decoding_buf)
6119 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6120 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6121 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6122 * syntax.c (bset_syntax_table, dec_bytepos):
6123 * terminal.c (tset_param_alist):
6124 * textprop.c (interval_has_some_properties)
6125 (interval_has_some_properties_list):
6126 * window.c (wset_combination_limit, wset_dedicated)
6127 (wset_display_table, wset_hchild, wset_left_fringe_width)
6128 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6129 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6130 (wset_right_fringe_width, wset_right_margin_cols)
6131 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6132 (wset_vertical_scroll_bar_type, wset_window_parameters):
6133 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6134 (wset_column_number_displayed, wset_region_showing)
6135 (window_box_edges, run_window_scroll_functions)
6136 (append_glyph_string_lists, prepend_glyph_string_lists)
6137 (append_glyph_string, set_glyph_string_background_width)
6138 (append_glyph, append_composite_glyph)
6139 (take_vertical_position_into_account):
6140 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6141 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6142 (lface_hash, lface_same_font_attributes_p, lookup_face):
6143 * xml.c (libxml2_loaded_p):
6144 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6145 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6146 Now 'static', not 'static inline'.
6147
6148 * bidi.c: Tune.
6149 (bidi_copy_it): Do the whole copy with a single memcpy.
6150 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6151
6152 Revert the FOLLOW-SYMLINKS change for file-attributes.
6153 Doing it right would require several changes to Tramp, and there's
6154 not enough time to get that tested before the freeze today.
6155 * dired.c (directory_files_internal, Ffile_attributes):
6156 Undo last change.
6157
6158 * frame.c (x_report_frame_params): Port better to wider ints.
6159 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6160 or that pointers can be printed in 15 decimal digits.
6161 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6162
6163 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6164
6165 Support x64 build on MS-Windows.
6166 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6167 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6168 compatibility with x64.
6169 (x_get_focus_frame): Add prototype.
6170
6171 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6172 defining an XRectangle structure.
6173
6174 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6175 arithmetics for compatibility with x64.
6176
6177 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6178 compatibility with x64.
6179
6180 * w32heap.h: Adjust prototypes and declarations.
6181
6182 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6183 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6184 DWORD, long, and unsigned long, for compatibility with x64.
6185 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6186 (sbrk): Argument is now of type ptrdiff_t.
6187
6188 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6189 less than 0x0500.
6190 (w32_msg_pump): Use WPARAM type for 'result'.
6191
6192 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6193 architecture.
6194 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6195 compatibility with x64.
6196
6197 * vm-limit.c (lim_data): Now size_t.
6198 (check_memory_limits): Adjust prototypes of real_morecore and
6199 __morecore to receive argument of type ptrdiff_t. Use size_t for
6200 five_percent and data_size.
6201
6202 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6203 variables, for compatibility with x64.
6204 (rva_to_section, offset_to_section, relocate_offset)
6205 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6206 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6207 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6208 for compatibility with x64.
6209
6210 * sysdep.c (STDERR_FILENO): Define if not already defined.
6211
6212 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6213 (__morecore): Argument type is now ptrdiff_t.
6214 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6215 (relinquish): Use ptrdiff_t type for 'excess'.
6216 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6217
6218 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6219 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6220 instead of a literal number.
6221
6222 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6223 (min): Define only if not already defined.
6224
6225 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6226 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6227 hosts.
6228
6229 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6230 'bitmaps' is a pointer.
6231
6232 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6233
6234 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6235
6236 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6237
6238 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6239 * dired.c (directory_files_internal, Ffile_attributes):
6240 New arg follow_symlinks. All uses changed.
6241
6242 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6243
6244 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6245
6246 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6247
6248 Support atimers and CPU profiler via profile.c on MS-Windows.
6249 * w32proc.c (sig_mask, crit_sig): New static variables.
6250 (sys_signal): Support SIGALRM and SIGPROF.
6251 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6252 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6253 sigfillset, and sigprocmask are no longer no-ops.
6254 (sigismember): New function.
6255 (struct itimer_data): New definition.
6256 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6257 (crit_prof): New static variables.
6258 (MAX_SINGLE_SLEEP): New definition.
6259 (timer_loop, stop_timer_thread, term_timers, init_timers)
6260 (start_timer_thread, getitimer, setitimer): New functions.
6261 (alarm): No longer a no-op, calls setitimer.
6262
6263 * w32.c (term_ntproc): Call term_timers.
6264 (init_ntproc): Make sure all signals are unblocked at startup, to
6265 erase any traces of dumping. Call init_timers.
6266
6267 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6268 Windows-specific code to display the hourglass mouse pointer is no
6269 longer used.
6270 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6271 to hourglass timer expiration.
6272 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6273 Remove, no longer used.
6274 (w32_note_current_window, show_hourglass, hide_hourglass):
6275 New functions, in support of hourglass cursor display similar to other
6276 window systems.
6277 (syms_of_w32fns): Don't initialize hourglass_timer.
6278
6279 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6280 WINDOWSNT as well.
6281 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6282
6283 * w32.h (init_timers, term_timers): Add prototypes.
6284
6285 2012-09-30 Kenichi Handa <handa@gnu.org>
6286
6287 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6288 to the buffer relocation which may be caused by ccl_driver.
6289
6290 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6291
6292 * xfns.c (Fx_file_dialog): Update comment.
6293
6294 * w32fns.c (Fx_file_dialog): Update comment.
6295
6296 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6297 Initialize panel name field if OSX >= 10.6.
6298
6299 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6300
6301 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6302
6303 * nsterm.m (NEW_STYLE_FS): New define.
6304 (ns_fullscreen_hook, windowWillEnterFullScreen)
6305 (windowDidEnterFullScreen, windowWillExitFullScreen)
6306 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6307 (setFSValue): New functions.
6308 (EmacsFSWindow): New implementation.
6309 (canBecomeKeyWindow): New function for EmacsFSWindow.
6310 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6311 (dealloc): Release nonfs_window if in fullscreen.
6312 (updateFrameSize:): Call windowDidMove to update top/left.
6313 (windowWillResize:toSize:): Check if frame is still maximized.
6314 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6315 next_maximized, maximized_width, maximized_height and nonfs_window.
6316 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6317 tbar_height.
6318 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6319 fullscreen. Set maximized_width/height. Act on next_maximized.
6320
6321 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6322 (EmacsView): Add variables for fullscreen.
6323 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6324 (EmacsFSWindow): New interface for fullscreen.
6325
6326 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6327
6328 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6329
6330 2012-09-30 Chong Yidong <cyd@gnu.org>
6331
6332 * fns.c (Frandom): Doc fix.
6333
6334 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6335
6336 * window.c (Vwindow_combination_limit): New default value.
6337 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6338
6339 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6342 Suggested by Eli Zaretskii in
6343 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6344
6345 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6346
6347 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6348 HAVE_TIMER_SETTIME is defined.
6349
6350 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 Profiler improvements: more-accurate timers, overflow checks.
6353 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6354 signal.h, setjmp.h. Include systime.h instead.
6355 (saturated_add): New function.
6356 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6357 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6358 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6359 New static vars.
6360 (enum profiler_cpu_running): New enum.
6361 (profiler_cpu_running): Now of that enum type, not bool.
6362 All uses changed to store the new value.
6363 (handle_profiler_signal): Rename from sigprof_handler_1,
6364 for consistency with other handlers. Do not check whether
6365 cpu_log is a hash-table if garbage collecting, since it
6366 doesn't matter in that case.
6367 (deliver_profiler_signal): Rename from sigprof_handler,
6368 for consistency with other handlers.
6369 (setup_cpu_timer): New function, with much of what used to be in
6370 Fprofiler_cpu_start. Check for out-of-range argument.
6371 Prefer timer_settime if available, and prefer
6372 thread cputime clocks, then process cputime clocks, then
6373 monotonic clocks, to the old realtime clock. Use make_timeval
6374 to round more-correctly when falling back to setitimer.
6375 (Fprofiler_cpu_start): Use it.
6376 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6377 Don't assume that passing NULL as the 2nd argument of setitimer
6378 is the same as passing a pointer to all-zero storage.
6379 Ignore SIGPROF afterwards.
6380 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6381 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6382 non-fatal signal handlers. Ignore SIGPROF on startup.
6383 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6384 in profiler.c, since sysdep.c now uses it.
6385
6386 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6387 Suggested by Eli Zaretskii in
6388 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6389
6390 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6391
6392 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6393
6394 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6395
6396 * lisp.h (struct backtrace): Remove indirection for `function' field.
6397 * xdisp.c (redisplay_internal):
6398 * profiler.c (record_backtrace, sigprof_handler_1):
6399 * alloc.c (Fgarbage_collect):
6400 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6401 (Fbacktrace_frame): Adjust accordingly.
6402
6403 2012-09-28 Glenn Morris <rgm@gnu.org>
6404
6405 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6406 (Frun_hook_with_args_until_failure): Doc fixes.
6407
6408 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6409
6410 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6411 Qautomatic_redisplay and change the symbol name. All users changed.
6412
6413 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6414
6415 * profiler.c (sigprof_handler): Fix race condition.
6416
6417 2012-09-28 Glenn Morris <rgm@gnu.org>
6418
6419 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6420
6421 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6422
6423 Check more robustly for timer_settime.
6424 * Makefile.in (LIB_TIMER_TIME): New macro.
6425 (LIBES): Add it.
6426 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6427 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6428 call timer_settime.
6429
6430 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6431
6432 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6433
6434 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6435
6436 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6437
6438 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6439
6440 * character.h (MAYBE_UNIFY_CHAR): Remove.
6441 * charset.c, charset.h (maybe_unify_char): Now static.
6442 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6443 Since this stuff is now private to charset.c, there's no need for
6444 a public macro and no need to inline by hand.
6445
6446 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6447 Stefan Monnier <monnier@iro.umontreal.ca>
6448 Juanma Barranquero <lekktu@gmail.com>
6449
6450 * profiler.c: New file.
6451 * Makefile.in (base_obj): Add profiler.o.
6452 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6453 ($(BLD)/profiler.$(O)): New target.
6454 * emacs.c (main): Call syms_of_profiler.
6455 * alloc.c (Qautomatic_gc): New constant.
6456 (MALLOC_PROBE): New macro.
6457 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6458 (total_bytes_of_live_objects): New function.
6459 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6460 Call malloc_probe for the memory profiler.
6461 (syms_of_alloc): Define Qautomatic_gc.
6462 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6463 race condition.
6464 (struct backtrace): Move definition...
6465 * lisp.h (struct backtrace): ..here.
6466 (Qautomatic_gc, profiler_memory_running): Declare vars.
6467 (malloc_probe, syms_of_profiler): Declare functions.
6468 * xdisp.c (Qautomatic_redisplay): New constant.
6469 (redisplay_internal): Record itself in backtrace_list.
6470 (syms_of_xdisp): Define Qautomatic_redisplay.
6471
6472 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6473 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6474
6475 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6476
6477 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 Prefer POSIX timers if available.
6480 They avoid a race if the timer is too close to the current time.
6481 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6482 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6483 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6484
6485 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6486
6487 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6488 CHAR_STRING_ADVANCE.
6489 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6490 STRING_CHAR_ADVANCE.
6491
6492 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6493
6494 Move Vlibrary_cache to emacs.c and reset before dumping.
6495
6496 * lisp.h (reset_image_types): Declare.
6497 [WINDOWSNT] (Vlibrary_cache): Declare.
6498
6499 * image.c (reset_image_types): New function.
6500
6501 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6502 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6503 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6504
6505 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6506 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6507
6508 * w32.h (Vlibrary_cache): Do not declare.
6509
6510 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6511
6512 * w32proc.c (sys_signal): Handle all signals defined by the
6513 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6514 handlers for signals supported by Windows. Don't override
6515 term_ntproc as the handler for SIGABRT.
6516 (sigaction): Rewrite to call sys_signal instead of duplicating its
6517 code.
6518 (sys_kill): Improve commentary.
6519
6520 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6521 consistency with a signature of a signal handler. All callers
6522 changed.
6523 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6524 install term_ntproc as a signal handler for SIGABRT, as that
6525 should be done by the dumped Emacs.
6526
6527 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6528
6529 * w32select.c (term_w32select): Protect against repeated
6530 invocation by setting clipboard_owner to NULL after calling
6531 DestroyWindow.
6532
6533 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6534 and term_ntproc to their modified signatures.
6535
6536 * character.c (char_string, string_char): Remove calls to
6537 MAYBE_UNIFY_CHAR. See the discussion starting at
6538 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6539 for the details.
6540
6541 2012-09-25 Chong Yidong <cyd@gnu.org>
6542
6543 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6544
6545 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6546
6547 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6548 when encountering an unknown bytecode.
6549
6550 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6551
6552 image.c, indent.c: Use bool for booleans.
6553 * dispextern.h (struct image_type): Members valid_p, load, init
6554 now return bool, not int. All uses changed.
6555 * image.c: Omit unnecessary static decls.
6556 (x_create_bitmap_mask, x_build_heuristic_mask):
6557 Return void, not int, since callers don't care about the return value.
6558 (x_create_bitmap_mask, define_image_type, valid_image_p)
6559 (struct image_keyword, parse_image_spec, image_spec_value)
6560 (check_image_size, image_background)
6561 (image_background_transparent, x_clear_image_1)
6562 (postprocess_image, lookup_image, x_check_image_size)
6563 (x_create_x_image_and_pixmap, xbm_image_p)
6564 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6565 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6566 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6567 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6568 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6569 (png_image_p, init_png_functions, png_load_body, png_load)
6570 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6571 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6572 (init_gif_functions, gif_load, imagemagick_image_p)
6573 (imagemagick_load_image, imagemagick_load, svg_image_p)
6574 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6575 (gs_load):
6576 * nsimage.m (ns_load_image):
6577 * nsterm.m (ns_defined_color):
6578 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6579 * xfns.c (x_defined_color):
6580 * xterm.c (x_alloc_lighter_color_for_widget)
6581 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6582 (x_alloc_lighter_color):
6583 * indent.c (disptab_matches_widthtab, current_column)
6584 (scan_for_column, string_display_width, indented_beyond_p)
6585 (compute_motion, vmotion, Fvertical_motion):
6586 Use bool for booleans.
6587
6588 2012-09-24 Chong Yidong <cyd@gnu.org>
6589
6590 * chartab.c (Fset_char_table_default): Obsolete function removed.
6591
6592 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 Move pid_t related decls out of lisp.h.
6595 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6596 (interruptible_wait_for_termination):
6597 Move these decls from lisp.h to syswait.h, since they use pid_t.
6598 Needed on FreeBSD; see Herbert J. Skuhra in
6599 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6600 * callproc.c: Include syswait.h.
6601
6602 gnutls.c, gtkutil.c: Use bool for boolean.
6603 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6604 (emacs_gnutls_handle_error):
6605 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6606 (xg_hide_tooltip, xg_create_frame_widgets)
6607 (create_dialog, xg_uses_old_file_dialog)
6608 (xg_get_file_with_chooser, xg_get_file_with_selection)
6609 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6610 (xg_item_label_same_p, xg_update_menubar)
6611 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6612 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6613 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6614 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6615 (update_frame_tool_bar, free_frame_tool_bar):
6616 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6617 * nsmenu.m (ns_update_menubar):
6618 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6619 * xfns.c (Fx_show_tip) [USE_GTK]:
6620 Use bool for boolean.
6621 * gtkutil.c (xg_update_frame_menubar):
6622 * xmenu.c (update_frame_menubar):
6623 Return void, not int, since caller ignores return value.
6624 * gtkutil.c (xg_change_toolbar_position):
6625 Return void, not 1.
6626
6627 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6628
6629 * makefile.w32-in (BLOCKINPUT_H): Remove.
6630 (SYSSIGNAL_H): New macro.
6631 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6632 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6633 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6634 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6635 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6636 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6637 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6638 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6639 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6640 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6641 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6642 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6643 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6644 ($(BLD)/w32xfns.$(O)): Update dependencies.
6645
6646 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6647
6648 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6649 fatal_error_backtrace.
6650
6651 * w32proc.c (sys_kill): Undo last change: don't do anything when
6652 invoked to deliver SIGABRT to our own process. This is now
6653 handled by emacs_raise.
6654
6655 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6656
6657 * w32term.c (w32_read_socket): Remove leftover reference to
6658 interrupt_input_pending.
6659
6660 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6661
6662 Do not use SA_NODEFER.
6663 Problem reported by Dani Moncayo in
6664 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6665 * alloc.c (die):
6666 * sysdep.c (emacs_abort): Do not reset signal handler.
6667 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6668 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6669 wanted even on POSIXish hosts, and it doesn't work on Windows.
6670
6671 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6672
6673 * xterm.c (x_term_init): Call fixup_locale before and after calling
6674 gtk_init (Bug#12392).
6675
6676 2012-09-23 Chong Yidong <cyd@gnu.org>
6677
6678 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6679 Vdynamic_library_alist.
6680
6681 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6682 (Fgnutls_available_p): Caller changed.
6683
6684 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6685 (Flibxml_parse_xml_region): Likewise.
6686
6687 * dispextern.h (struct image_type): Remove arg from init function.
6688
6689 * image.c (Finit_image_library, lookup_image_type)
6690 (define_image_type): Remove now-unneeded second arg.
6691 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6692 (init_tiff_functions, init_gif_functions, init_svg_functions):
6693 Arglist and w32_delayed_load calling convention changed.
6694 (gs_type): Remove init_gs_functions; there is no such function.
6695 (valid_image_p, make_image): Fix caller to lookup_image_type.
6696
6697 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 Simplify and avoid signal-handling races (Bug#12471).
6700 * alloc.c (die):
6701 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6702 Avoid recursive loop if there's a fatal error in the function itself.
6703 * atimer.c (pending_atimers):
6704 * blockinput.h: Don't include "atimer.h"; no longer needed.
6705 (interrupt_input_pending): Remove. All uses removed.
6706 pending_signals now counts both atimers and ordinary interrupts.
6707 This is less racy than having three separate pending-signal flags.
6708 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6709 (input_blocked_p):
6710 Rename from their upper-case counterparts BLOCK_INPUT,
6711 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6712 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6713 This makes it easier to access volatile variables more accurately.
6714 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6715 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6716 that's more reliable if the code is buggy and sets
6717 interrupt_input_blocked to a negative value. All uses changed.
6718 * atimer.c (deliver_alarm_signal):
6719 Remove. No need to deliver this to the parent; any thread can
6720 handle this signal now. All uses replaced by underlying handler.
6721 * atimer.c (turn_on_atimers):
6722 * dispnew.c (handle_window_change_signal):
6723 * emacs.c (handle_danger_signal):
6724 * keyboard.c (kbd_buffer_get_event):
6725 Don't reestablish signal handler; not needed with sigaction.
6726 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6727 (UNBLOCK_INPUT_TO):
6728 Rework to avoid unnecessary accesses to volatile variables.
6729 (UNBLOCK_INPUT_TO): Now a function.
6730 (totally_unblock_input, unblock_input): New decls.
6731 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6732 (init_data): Remove. Necessary stuff now done in init_signal.
6733 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6734 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6735 (fatal_error_code): Remove; no longer needed.
6736 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6737 it doesn't always backtrace. All uses changed. No need to reset
6738 signal to default, since sigaction and/or die does that for us now.
6739 Use emacs_raise (FOO), not kill (getpid (), FOO).
6740 (main): Check more-accurately whether we're dumping.
6741 Move fatal-error setup to sysdep.c
6742 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6743 * gtkutil.c (xg_get_file_name, xg_get_font):
6744 Remove no-longer-needed signal-mask manipulation.
6745 * keyboard.c, process.c (POLL_FOR_INPUT):
6746 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6747 * keyboard.c (read_avail_input): Remove.
6748 All uses replaced by gobble_input.
6749 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6750 (kbd_buffer_store_event_hold, gobble_input):
6751 (record_asynch_buffer_change) [USABLE_SIGIO]:
6752 (store_user_signal_events):
6753 No need to mess with signal mask.
6754 (gobble_input): If blocking input and there are terminals, simply
6755 set pending_signals to 1 and return. All hooks changed to not
6756 worry about whether input is blocked.
6757 (process_pending_signals): Clear pending_signals before processing
6758 them, in case a signal comes in while we're processing.
6759 By convention callers now test pending_signals before calling us.
6760 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6761 New functions, to support changes to blockinput.h.
6762 (handle_input_available_signal): Now extern.
6763 (reinvoke_input_signal): Remove. All uses replaced by
6764 handle_async_input.
6765 (quit_count): Now volatile, since a signal handler uses it.
6766 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6767 All callers changed. Block SIGINT only if not already blocked.
6768 Clear sigmask reliably, even if Fsignal returns, which it can.
6769 Omit unnecessary accesses to volatile var.
6770 (quit_throw_to_read_char): No need to restore sigmask.
6771 * keyboard.c (gobble_input, handle_user_signal):
6772 * process.c (wait_reading_process_output):
6773 Call signal-handling code rather than killing ourselves.
6774 * lisp.h: Include <float.h>, for...
6775 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6776 (pending_signals): Now volatile.
6777 (syms_of_data): Now const if IEEE floating point.
6778 (handle_input_available_signal) [USABLE_SIGIO]:
6779 (terminate_due_to_signal, record_child_status_change): New decls.
6780 * process.c (create_process): Avoid disaster if memory is exhausted
6781 while we're processing a vfork, by tightening the critical section
6782 around the vfork.
6783 (send_process_frame, process_sent_to, handle_pipe_signal)
6784 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6785 ignores SIGPIPE.
6786 (send_process): No need for setjmp/longjmp any more, since the
6787 SIGPIPE stuff is now gone. Instead, report an error if errno
6788 is EPIPE.
6789 (record_child_status_change): Now extern. PID and W are now args.
6790 Return void, not bool. All callers changed.
6791 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6792 Remove. All uses removed. This bug should be fixed now in a
6793 different way.
6794 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6795 and record the child status change directly. This avoids the
6796 need to futz with the signal mask.
6797 (process_fatal_action): Move here from emacs.c.
6798 (emacs_sigaction_flags): New function, containing
6799 much of what used to be in emacs_sigaction_init.
6800 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6801 caught by emacs, to make races less likely.
6802 (deliver_process_signal): Rename from handle_on_main_thread.
6803 All uses changed.
6804 (BACKTRACE_LIMIT_MAX): Now at top level.
6805 (thread_backtrace_buffer, threadback_backtrace_pointers):
6806 New static vars.
6807 (deliver_thread_signal, deliver_fatal_thread_signal):
6808 New functions, for more-accurate delivery of thread-specific signals.
6809 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6810 (deliver_arith_signal): Handle in this thread, not
6811 in the main thread, since it's triggered by this thread.
6812 (maybe_fatal_sig): New function.
6813 (init_signals): New arg DUMPING so that we can be more accurate
6814 about whether we're dumping. Caller changed.
6815 Treat thread-specific signals differently from process-general signals.
6816 Block all signals while handling fatal error; that's safer.
6817 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6818 on IEEE hosts.
6819 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6820 Ignore SIGPIPE unless batch.
6821 (emacs_backtrace): Output backtrace for the appropriate thread,
6822 which is not necessarily the main thread.
6823 * syssignal.h: Include <stdbool.h>.
6824 (emacs_raise): New macro.
6825 * xterm.c (x_connection_signal): Remove; no longer needed
6826 now that we use sigaction.
6827 (x_connection_closed): No need to mess with sigmask now.
6828 (x_initialize): No need to reset SIGPIPE handler here, since
6829 init_signals does this for us now.
6830
6831 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6832
6833 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6834 background rect may be larger (Bug#12245).
6835
6836 2012-09-23 Chong Yidong <cyd@gnu.org>
6837
6838 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6839
6840 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6841
6842 * .gdbinit: Just stop at fatal_error_backtrace.
6843 See Stefan Monnier's request in
6844 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6845 Remove no-longer-used query of system type.
6846
6847 2012-09-22 Chong Yidong <cyd@gnu.org>
6848
6849 * search.c (Freplace_match): Doc fix (Bug#12325).
6850
6851 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6852
6853 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6854 (Fline_end_position): Doc fix.
6855
6856 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6857
6858 2012-09-22 Chong Yidong <cyd@gnu.org>
6859
6860 * dispextern.h (struct image_type): Add new slot, storing a type
6861 initialization function.
6862
6863 * image.c (define_image_type): Call the image initializer function
6864 if it is defined. Arguments and return value changed.
6865 (valid_image_p, make_image): Callers changed.
6866 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6867 (gif_type, imagemagick_type, svg_type, gs_type):
6868 Add initialization functions.
6869 (Finit_image_library): Call lookup_image_type.
6870 (CHECK_LIB_AVAILABLE): Macro deleted.
6871 (lookup_image_type): Call define_image_type here, rather than via
6872 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6873 (syms_of_image): Move define_image_type calls for xbm_type and
6874 pbm_type to lookup_image_type.
6875
6876 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6877
6878 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6879 'idle_timers' from here ...
6880 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6881 lists, to avoid infloops when the timer does something stupid,
6882 like reinvoke itself with the same or smaller time-out.
6883 (Bug#12447)
6884
6885 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6886
6887 * window.c (Fsplit_window_internal): Handle only Qt value of
6888 Vwindow_combination_limit separately.
6889 (Qtemp_buffer_resize): New symbol.
6890 (Vwindow_combination_limit): New default value.
6891 Rewrite doc-string.
6892
6893 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6894
6895 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6896 the new overlay string. (Bug#10159)
6897
6898 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6899
6900 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6901 or that fprintf is async-signal-safe. POSIX doesn't require
6902 either assumption.
6903
6904 2012-09-22 Chong Yidong <cyd@gnu.org>
6905
6906 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6907 (Bug#8207).
6908
6909 2012-09-22 Kenichi Handa <handa@gnu.org>
6910
6911 * composite.c (composition_reseat_it): Handle the case that a
6912 grapheme cluster is not covered by a single font (Bug#12352).
6913
6914 2012-09-21 Chong Yidong <cyd@gnu.org>
6915
6916 * image.c (define_image_type): Avoid adding duplicate types to
6917 image_types (Bug#12463). Suggested by Jörg Walter.
6918
6919 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6920
6921 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6922 (print_load_command_name): Add case LC_DATA_IN_CODE.
6923 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6924
6925 2012-09-21 Glenn Morris <rgm@gnu.org>
6926
6927 * eval.c (Frun_hook_with_args_until_success)
6928 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6929
6930 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6931
6932 * fileio.c (Ffile_selinux_context): Only call freecon when
6933 lgetfilecon succeeded.
6934 (Fset_file_selinux_context): Likewise. (Bug#12444)
6935
6936 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6937
6938 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6939 reordering, locate the cursor by calling set_cursor_from_row; if
6940 that fails, clear the desired glyph matrix before returning a
6941 failure indication to the caller. Fixes leaving garbled display
6942 when fast scrolling with a down-key. (Bug#12403)
6943 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6944 scrolling through multibyte text.
6945
6946 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6947
6948 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6949 calling mark_vectorlike since that's the one that marks the window.
6950 (mark_discard_killed_buffers): Mark the final cdr.
6951 * window.h (struct window): Move prev/next_buffers to the
6952 non-standard fields.
6953 * window.c (make_window): Initialize prev/next_buffers manually.
6954
6955 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 Omit unused arg EXPECTED from socket hooks.
6958 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6959 * nsterm.m (ns_term_init):
6960 * termhooks.h (struct terminal.read_socket_hook):
6961 * w32inevt.c (w32_console_read_socket):
6962 * w32term.c (w32_read_socket):
6963 * xterm.c (XTread_socket):
6964 Omit unused arg EXPECTED. All callers changed.
6965 (store_user_signal_events): Return void, not int, since callers no
6966 longer care about the return value. All uses changed.
6967
6968 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6969
6970 * w32gui.h (XParseGeometry): Do not declare.
6971
6972 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6973
6974 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6975 Ignore 'expected'. See Eli Zaretskii in
6976 <http://bugs.gnu.org/12471#8> (last line).
6977
6978 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6979 (XParseGeometry): Now static. Substitute extremal values for
6980 values that are out of range.
6981
6982 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6983
6984 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6985
6986 * nsfns.m (XParseGeometry): Remove.
6987 (Fx_create_frame): Call x_set_offset to correctly interpret
6988 top_pos in geometry.
6989
6990 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6991 (Fx_parse_geometry): If there is a space in string, call
6992 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6993
6994 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6995
6996 * search.c (scan_buffer): Use character positions in calls to
6997 region_cache_forward and region_cache_backward, not byte
6998 positions. (Bug#12196)
6999
7000 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7001 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7002
7003 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7004 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7005 emacs_blocked_malloc, now deleted.
7006
7007 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7010 The workaround was for improving performance on Solaris 2.4, but
7011 is getting in the way now. Emacs will still work if someone is
7012 still running Solaris 2.4 in a museum somewhere; Sun dropped
7013 support for Solaris 2.4 in 2003.
7014 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7015 * process.c (create_process) [HAVE_WORKING_VFORK]:
7016 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7017 since Emacs no longer uses vfork on that platform.
7018
7019 2012-09-17 Glenn Morris <rgm@gnu.org>
7020
7021 * emacs.c: Use COPYRIGHT.
7022
7023 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 Remove configure's --without-sync-input option (Bug#12450).
7026 When auditing signal-handling in preparation for cleaning it up,
7027 I found that SYNC_INPUT has race conditions and would be a real
7028 pain to fix. Since it's an undocumented and deprecated
7029 configure-time option, now seems like a good time to remove it.
7030 Also see <http://bugs.gnu.org/11080#16>.
7031 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7032 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7033 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7034 (malloc_hysteresis):
7035 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7036 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7037 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7038 (dont_register_blocks, bytes_used_when_reconsidered)
7039 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7040 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7041 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7042 Remove. All uses removed.
7043 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7044 implementation, one that depends on whether the new macro
7045 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7046 is defined.
7047 * atimer.c (run_timers, handle_alarm_signal):
7048 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7049 (handle_async_input, process_pending_signals)
7050 (handle_input_available_signal, init_keyboard):
7051 * nsterm.m (ns_read_socket):
7052 * process.c (wait_reading_process_output):
7053 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7054 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7055 (emacs_write):
7056 * xterm.c (XTread_socket):
7057 Assume SYNC_INPUT.
7058 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7059 * eval.c (handling_signal): Remove. All uses removed.
7060 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7061 All uses replaced with the SYNC_INPUT version.
7062 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7063 Remove decls.
7064 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7065 Now static.
7066
7067 * font.c (Ffont_shape_gstring): Remove unused local.
7068
7069 2012-09-16 Glenn Morris <rgm@gnu.org>
7070
7071 * Makefile.in (clean): No longer run nextstep's clean.
7072
7073 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7074 (ns_frag): Remove.
7075 (ns-app): Move here from ns.mk, and simplify.
7076 (clean): Simplify nextstep entry.
7077 * ns.mk: Remove file.
7078
7079 2012-09-17 Kenichi Handa <handa@gnu.org>
7080
7081 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7082 not covert the last few charactes.
7083
7084 2012-09-16 Kenichi Handa <handa@gnu.org>
7085
7086 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7087 here, but just check the validity of glyphs in the glyph-string.
7088
7089 2012-09-16 Martin Rudalics <rudalics@gmx.at>
7090
7091 * window.c (Fwindow_parameter, Fset_window_parameter):
7092 Accept any window as argument (Bug#12452).
7093
7094 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7095
7096 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7097 to ns_term_init to avoid memory leak.
7098
7099 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7100 explicit retain/release.
7101 (ns_term_init): Only allow one display. Initialize outerpool and
7102 ns_*_types.
7103
7104 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7107 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7108 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7109 the Microsoft problem in a different way, by altering ../nt/config.nt.
7110
7111 2012-09-15 Eli Zaretskii <eliz@gnu.org>
7112
7113 * w32xfns.c:
7114 * w32uniscribe.c:
7115 * w32term.c:
7116 * w32select.c:
7117 * w32reg.c:
7118 * w32proc.c:
7119 * w32menu.c:
7120 * w32inevt.c:
7121 * w32heap.c:
7122 * w32font.c:
7123 * w32fns.c:
7124 * w32console.c:
7125 * w32.c:
7126 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7127 by lisp.h. This completes removal of setjmp.h inclusion
7128 erroneously announced in the previous commit. (Bug#12446)
7129
7130 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7131 more accurate.
7132
7133 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7134 not defined as a macro. The latter happens on MS-Windows.
7135 (Bug#12446)
7136
7137 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7138
7139 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7140 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7141 Some instances of '#include <setjmp.h>' removed, if the
7142 only reason for the instance was because "lisp.h" was included.
7143 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7144 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7145 and _longjmp with the new symbols. Emacs already uses _setjmp if
7146 available, so this change affects only POSIXish hosts that have
7147 sigsetjmp but not _setjmp, such as some versions of Solaris and
7148 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7149 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7150 (png_load_body) [HAVE_PNG]:
7151 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7152 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7153 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7154 since PNG requires jmp_buf. This is the only exception to the
7155 general rule that we now use sys_setjmp and sys_longjmp.
7156 This exception is OK since this code does not change the signal
7157 mask or longjmp out of a signal handler.
7158
7159 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7160
7161 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7162 Include "syssignal.h", for 'main_thread'.
7163
7164 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7165
7166 Avoid out-of-range marker position (Bug#12426).
7167 * insdel.c (replace_range, replace_range_2):
7168 Adjust markers before overlays, as suggested by comments.
7169 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7170 Remove redundant check before calling offset_intervals.
7171
7172 2012-09-14 Martin Rudalics <rudalics@gmx.at>
7173
7174 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7175 current buffer (Bug#12387).
7176
7177 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
7178
7179 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7180
7181 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7182
7183 Use a more backwards-compatible timer format (Bug#12430).
7184 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7185 vector element, not from the 4th, since PSECS is now at the end.
7186 (Fcurrent_idle_time): Doc fix.
7187
7188 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7189
7190 Function to mark objects and remove killed buffers at once.
7191 * alloc.c (discard_killed_buffers): Rename to ...
7192 (mark_discard_killed buffers) ... new name. Add marking
7193 of remaining objects. Fix comment. Adjust users.
7194 (mark_object): Do not touch frame buffer lists here.
7195 * frame.c (delete_frame): Reset frame buffer lists here.
7196
7197 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 Better workaround for GNOME bug when --enable-gcc-warnings.
7200 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7201 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7202 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7203
7204 Simplify SIGIO usage (Bug#12408).
7205 The code that dealt with SIGIO was crufty and confusing, e.g., it
7206 played tricks like "#undef SIGIO" but these tricks were not used
7207 consistently. Simplify mostly by not #undeffing standard symbols,
7208 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7209 or not as we please) rather than "defined SIGIO" (standard symbol
7210 that we probably shouldn't #undef).
7211 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7212 Modules that need it can include it.
7213 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7214 * dispextern.h (ignore_sigio): New decl.
7215 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7216 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7217 * emacs.c (shut_down_emacs):
7218 * keyboard.c (kbd_buffer_store_event_hold):
7219 Use ignore_sigio rather than invoking 'signal' directly.
7220 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7221 for FIONREAD.
7222 (FIONREAD, SIGIO): Do not #undef.
7223 (tty_read_avail_input): Use #error rather than a syntax error.
7224 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7225 for I_PIPE, used by SETUP_SLAVE_PTY.
7226 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7227 * sysdep.c (croak): Remove; no longer needed. This bit of
7228 temporary code, with Fred N. Fish's comment that it's temporary,
7229 has been in Emacs since at least 1992!
7230 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7231 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7232 * syssignal.h (croak): Remove decl.
7233 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7234 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7235 now that we're termios-only.
7236 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7237 * term.c (dissociate_if_controlling_tty): Use #error rather than
7238 a run-time error.
7239
7240 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7241 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7242 to work around GNOME bug 683906.
7243 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7244 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7245 This works around GCC bug 54561.
7246
7247 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7248
7249 More fixes for 'volatile' and setjmp/longjmp.
7250 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7251 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7252 (png_load_body) [HAVE_PNG]:
7253 (jpeg_load_body) [HAVE_JPEG]:
7254 New function, with most of the old parent function's body.
7255 (png_load) [HAVE_PNG]:
7256 (jpeg_load) [HAVE_JPEG]:
7257 Invoke the new function, to avoid longjmp munging our locals.
7258 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7259 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7260 longjmp is passed 2, as the C standard doesn't guarantee this.
7261 Instead, store the failure code into mgr->failure_code.
7262
7263 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7264
7265 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7266 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7267 (syms_of_keyboard): Remove support for unread-command-char.
7268
7269 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7270
7271 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7272 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7273 violation. (Bug#12426)
7274
7275 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7278
7279 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7280
7281 * eval.c: Add `inhibit-debugger'.
7282 (Qinhibit_debugger): New symbol.
7283 (call_debugger): Bind it instead of Qdebug_on_error.
7284 (maybe_call_debugger): Test Vinhibit_debugger.
7285 (syms_of_eval): Define inhibit-debugger.
7286 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7287 (syms_of_xdisp): Remove inhibit-debug-on-message.
7288
7289 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7290
7291 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7292 If a nonvolatile local variable is written before a _longjmp to
7293 the frame containing the variable, and is read after the _longjmp,
7294 the value read is indeterminate. Some local variables of type
7295 'struct handler' and 'struct catchtag' are used in this way, so
7296 mark each of their slots as volatile if the slot can be set before
7297 _longjmp and read afterwards.
7298 * lisp.h (struct handler): var and chosen_clause are now volatile.
7299 (struct catchtag): val, next, and pdlcount are now volatile.
7300
7301 * bidi.c (bidi_push_it, bidi_pop_it):
7302 * fns.c (copy_hash_table):
7303 * image.c (define_image_type):
7304 * keyboard.c (kbd_buffer_store_event_hold):
7305 * process.c (Fprocess_send_eof):
7306 * xfaces.c (x_create_gc) [HAVE_NS]:
7307 * xgselect.c (xg_select):
7308 Prefer assignment to memcpy when either will do.
7309
7310 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7311 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7312 time an item is removed. No need to mark this function 'inline';
7313 the compiler knows better than we do.
7314
7315 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7316
7317 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7318 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7319 to change_frame_size (Bug#12388).
7320 (windowDidResize:): Pass YES to updateFrameSize.
7321
7322 * nsterm.h: Add delay parameter to updateFrameSize.
7323
7324 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7325
7326 Discard killed buffers from deleted window and frame objects.
7327 This reduces an amount of references to killed buffers and
7328 helps GC to reclaim them faster.
7329 * alloc.c (discard_killed_buffers): New function.
7330 (mark_object): Use it for deleted windows and frames.
7331 (mark_object): If symbol's value is set up for a killed buffer
7332 or deleted frame, restore its global binding.
7333 * data.c (swap_in_global_binding): Add GC notice.
7334 (swap_in_symval_forwarding): Use convenient set_blv_where.
7335 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7336 * window.h: ... to here.
7337
7338 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7339
7340 Convenient macro to check whether the buffer is live.
7341 * buffer.h (BUFFER_LIVE_P): New macro.
7342 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7343 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7344
7345 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7346
7347 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7348 composition cases (Bug#12364).
7349
7350 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7351 overhang of succeeding glyphs overlapping box cursor.
7352
7353 * w32term.c (x_draw_glyph_string): Likewise.
7354
7355 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7356
7357 Simplify, document, and port floating-point (Bug#12381).
7358 The porting part of this patch fixes bugs on non-IEEE platforms
7359 with frexp, ldexp, logb.
7360 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7361 Now static.
7362 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7363 support, by removing commented-out code and briefly listing the
7364 C89 functions excluded. The commented-out stuff was confusing
7365 maintenance, e.g., we thought we needed cbrt but it was commented out.
7366 (logb): Remove decl; no longer needed.
7367 (isfinite): New macro, if not already supplied.
7368 (isnan): Don't replace any existing macro.
7369 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7370 are present on all C89 platforms.
7371 (Ffrexp): Do not special-case zero, as frexp does the right thing
7372 for that case.
7373 (Flogb): Do not use logb, as it doesn't have the desired meaning
7374 on hosts that use non-base-2 floating point. Instead, stick with
7375 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7376 frexp, to avoid getting an unspecified result.
7377
7378 * xdisp.c (Qinhibit_debug_on_message): Now static.
7379
7380 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7381
7382 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7383 NSBezierPath (Bug#12131).
7384
7385 2012-09-10 Chong Yidong <cyd@gnu.org>
7386
7387 * fns.c (Fdelq, Fdelete): Doc fix.
7388
7389 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7392 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7393
7394 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7395
7396 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7397 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7398 Use it.
7399
7400 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7401
7402 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7403 left fringe if the window has a left margin. This avoids leaving
7404 traces of the cursor because its leftmost pixel is not drawn over.
7405
7406 * dispnew.c (update_window_line): When the left margin area of a
7407 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7408 that screen line. (Bug#12277)
7409
7410 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7411
7412 Assume C89 or later for math functions (Bug#12381).
7413 This simplifies the code, and makes it a bit smaller and faster,
7414 and (most important) makes it easier to clean up signal handling
7415 since we can stop worring about floating-point exceptions in
7416 library code. That was a problem before C89, but the problem
7417 went away many years ago on all practical Emacs targets.
7418 * data.c, image.c, lread.c, print.c:
7419 Don't include <math.h>; no longer needed.
7420 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7421 might be autoconfigured, as that never happens.
7422 * data.c (fmod):
7423 * doprnt.c (DBL_MAX_10_EXP):
7424 * print.c (DBL_DIG):
7425 Remove. C89 or later always defines these.
7426 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7427 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7428 (arith_error, domain_error, domain_error2):
7429 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7430 no longer needed -- we simply return what C returns. All uses removed.
7431 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7432 the wrapped code.
7433 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7434 Remove. All uses expanded, as these macros are no longer used
7435 more than once and are now more trouble than they're worth.
7436 (Ftan): Use tan, not sin / cos.
7437 (Flogb): Assume C89 frexp.
7438 (fmod_float): Assume C89 fmod.
7439 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7440 (init_floatfns): Remove. All uses removed.
7441
7442 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7443
7444 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7445 compositeToPoint for OSX < 10.6 (Bug#12390).
7446
7447 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7450 This produces more-accurate results.
7451
7452 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7453
7454 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7455 changes (Bug#12088).
7456
7457 2012-09-08 Chong Yidong <cyd@gnu.org>
7458
7459 * syntax.c (Fstring_to_syntax): Doc fix.
7460
7461 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7462
7463 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7464 in the internal border.
7465 (x_set_window_size): Remove static variables and their usage.
7466 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7467 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7468 Remove fringe/internal border adjustment (Bug#11052).
7469 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7470 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7471 (ns_fix_rect_ibw): Remove.
7472 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7473 (ns_dumpglyphs_box_or_relief): Ditto.
7474 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7475 adjustment.
7476 (ns_dumpglyphs_image): Ditto.
7477 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7478 border adjustment.
7479 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7480 their usage. Add fringe_extended_p and its use as in other terms.
7481 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7482 scroll bar was removed.
7483 (updateFrameSize): New function.
7484 (windowDidResize): Move code to updateFrameSize and call it.
7485
7486 * nsterm.h (EmacsView): Add updateFrameSize.
7487
7488 2012-09-07 Chong Yidong <cyd@gnu.org>
7489
7490 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7491
7492 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7493
7494 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7495
7496 More signal-handler cleanup (Bug#12327).
7497 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7498 Problem introduced when merging patches. Noted by Eli Zaretskii in
7499 <http://bugs.gnu.org/12327#67>.
7500 * floatfns.c: Comment fix.
7501 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7502 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7503 and anyway the declaration is harmless even if SIGDANGER is not defined.
7504 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7505 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7506 source files not surprisingly expected syssignal.h to define, or
7507 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7508 Include <sys/ioctl.h>, for FIONREAD.
7509 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7510 This eliminates a problem whereby other files mysteriously had
7511 to include "syssignal.h" before including "systty.h" if they
7512 wanted to use "#ifdef SIGIO".
7513
7514 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7515
7516 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7517
7518 * w32.c (sigemptyset): Empty the set.
7519 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7520
7521 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7522
7523 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7526 (mark_object): Likewise for frame objects.
7527
7528 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * syssignal.h (handle_on_main_thread): Always declare,
7531 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7532 This ports to platforms without HAVE_PTHREAD.
7533
7534 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 Signal-handler cleanup (Bug#12327).
7537 Emacs's signal handlers were written in the old 4.2BSD style with
7538 sigblock and sigmask and so forth, and this led to some
7539 inefficiencies and confusion. Rewrite these to use
7540 pthread_sigmask etc. without copying signal sets around. Also,
7541 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7542 'signal', and instead use functions that do not attempt to take
7543 over the system name space. This patch causes Emacs's text
7544 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7545 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7546 Do not include <signal.h> or "syssignal.h", as these
7547 modules do not use signals.
7548 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7549 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7550 Do not include <signal.h>, as "syssignal.h" does that for us now.
7551 * atimer.c (sigmask_atimers): New function.
7552 (block_atimers, unblock_atimers): New functions,
7553 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7554 All uses replaced.
7555 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7556 no longer needed here.
7557 * emacs.c (main): Inspect existing signal handler with sigaction,
7558 so that there's no need to block and unblock SIGHUP.
7559 * sysdep.c (struct save_signal): New member 'action', replacing
7560 old member 'handler'.
7561 (save_signal_handlers, restore_signal_handlers):
7562 Use sigaction instead of 'signal' to save and restore.
7563 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7564 New function. All users of 'signal' modified to use set_sighandler
7565 if they're writeonly, and to use sys_signal if they're read+write.
7566 (emacs_sigaction_init, forwarded_signal): New functions.
7567 (sys_signal): Remove. All uses replaced by calls to sigaction
7568 and emacs_sigaction_init, or by direct calls to 'signal'.
7569 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7570 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7571 all uses replaced by pthread_sigmask etc. calls.
7572 * syssignal.h: Include <signal.h>.
7573 (emacs_sigaction_init, forwarded_signal): New decls.
7574 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7575 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7576 (sigmask, sys_sigmask): Remove; no longer needed.
7577 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7578 (sigblock, sigunblock, sigfree):
7579 (sigsetmask) [!defined sigsetmask]:
7580 Remove. All uses replaced by pthread_sigmask.
7581 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7582 no longer need to be replaced, and its typical old uses
7583 are now done via emacs_sigaction_init and sigaction.
7584 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7585 (sys_sigdel): Remove; unused.
7586 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7587
7588 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7589
7590 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7591 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7592
7593 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7594
7595 Explicitly mark buffer_defaults and buffer_local_symbols.
7596 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7597 mark_local_symbols here.
7598 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7599 since special buffers aren't marked here any more.
7600 (allocate_buffer): Chain new buffer with all_buffers here...
7601 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7602 not here.
7603 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7604 (syms_of_buffer): Remove staticpro of the above.
7605 (init_buffer_once): Set names for buffer_defaults and
7606 buffer_local_symbols.
7607
7608 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 Use bool for booleans in font-related modules.
7611 * font.c (font_intern_prop, font_style_to_value)
7612 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7613 (generate_otf_features, font_check_otf_features, font_check_otf)
7614 (font_match_p, font_list_entities, font_at):
7615 * fontset.c (fontset_id_valid_p, reorder_font_vector
7616 (fontset_find_font, Fset_fontset_font)
7617 (face_suitable_for_char_p) [0]:
7618 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7619 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7620 (m17n_flt_initialized, ftfont_shape_by_flt):
7621 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7622 * nsfont.m (nsfont_draw):
7623 * w32font.c (w32font_draw):
7624 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7625 Use bool for booleans.
7626 * font.h: Adjust to above API changes.
7627 (struct font, struct font_driver, struct font_driver_list):
7628 Use bool for booleans.
7629 (struct font): Remove useless member encoding_type.
7630 All users removed.
7631 * fontset.c, xftfont.c: Omit unnecessary static decls.
7632
7633 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7634
7635 * alloc.c (mark_object): Revert window marking code
7636 since it's unsafe for the Fset_window_configuration.
7637
7638 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7639
7640 Fix race conditions with signal handlers and errno (Bug#12327).
7641 Be more systematic about preserving errno whenever a signal
7642 handler returns, even if it's not in the main thread. Do this by
7643 renaming signal handlers to distinguish between signal delivery
7644 and signal handling. All uses changed.
7645 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7646 * data.c (deliver_arith_signal): Rename from arith_error.
7647 * dispnew.c (deliver_window_change_signal): Rename from
7648 window_change_signal.
7649 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7650 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7651 * keyboard.c (deliver_input_available_signal): Rename from
7652 input_available_signal.
7653 (deliver_user_signal): Rename from handle_user_signal.
7654 (deliver_interrupt_signal): Rename from interrupt_signal.
7655 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7656 (deliver_child_signal): Rename from sigchld_handler.
7657 * atimer.c (handle_alarm_signal):
7658 * data.c (handle_arith_signal):
7659 * dispnew.c (handle_window_change_signal):
7660 * emacs.c (handle_fatal_signal, handle_danger_signal):
7661 * keyboard.c (handle_input_available_signal):
7662 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7663 * process.c (handle_pipe_signal, handle_child_signal):
7664 New functions, with the actual signal-handling code taken from the
7665 original respective signal handlers, sans the sporadic attempts to
7666 preserve errno, since that's now done by handle_on_main_thread.
7667 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7668 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7669 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7670 Move to sysdep.c.
7671 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7672 Move initialization of main_thread to sysdep.c's init_signals.
7673 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7674 our usage, and simplifies the mainline code.
7675 (record_child_status_change): New static function, as a helper
7676 for handle_child_signal, and with most of the old child handler's
7677 contents.
7678 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7679 (handle_child_signal): Use the above.
7680 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7681 Moved here from emacs.c.
7682 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7683 code moved here from emacs.c's main function.
7684 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7685 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7686 This lets callers save and restore errno properly.
7687
7688 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7689
7690 Remove redundant or unused things here and there.
7691 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7692 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7693 * editfns.c (Fcompare_buffer_substrings): Likewise.
7694 * frame.h (struct terminal, struct font_driver_list):
7695 Remove redundant declarations.
7696 * window.h (Qleft, Qright): Likewise.
7697
7698 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7699
7700 Do not mark objects from deleted buffers, windows and frames.
7701 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7702 (mark_object): Likewise for windows and frames.
7703
7704 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7705
7706 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7707 buffer_defaults and buffer_local_symbols as valid objects.
7708 Return special value to denote them.
7709
7710 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7711
7712 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7713 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7714 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7715 (file_name_absolute_p, Fsubstitute_in_file_name):
7716 (check_executable, check_writable, Ffile_accessible_directory_p)
7717 (Fset_file_selinux_context, Fdefault_file_modes)
7718 (Finsert_file_contents, choose_write_coding_system)
7719 (Fwrite_region, build_annotations, a_write, e_write)
7720 (Fdo_auto_save):
7721 * filelock.c (boot_time_initialized, get_boot_time)
7722 (get_boot_time_1, lock_file_1, within_one_second):
7723 * floatfns.c (in_float):
7724 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7725 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7726 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7727 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7728 * window.c (compare_window_configurations):
7729 Use bool for booleans.
7730 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7731 (Fdefault_file_modes): Now mode_t, not int, for modes.
7732 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7733 (internal_delete_file): Now returns void, not a (boolean) int,
7734 since nobody was looking at the return value.
7735 * lisp.h, window.h: Adjust to above API changes.
7736
7737 * xdisp.c (set_message): Simplify and reindent last change.
7738
7739 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7740
7741 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7742
7743 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7744
7745 * eval.c (call_debugger): Make the function non-static so that we
7746 can call it from set_message.
7747
7748 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7749 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7750
7751 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7752
7753 Give more-useful info on a fatal error (Bug#12328).
7754 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7755 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7756 of doing the work ourselves.
7757 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7758 do most of the work.
7759 (fatal_error_backtrace): New function, taken from the guts
7760 of the old fatal_error_signal, but with a new option to output
7761 a backtrace.
7762 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7763 info about the signal than just its number.
7764 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7765 * sysdep.c: Include <execinfo.h>
7766 (emacs_backtrace): New function, taken partly from the previous
7767 code of the 'die' function.
7768 (emacs_abort): Call fatal_error_backtrace rather than abort.
7769
7770 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7771
7772 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7773 eager (load-time) macro-expansion.
7774 * lisp.mk (lisp): Add macroexp.
7775
7776 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 Simplify redefinition of 'abort' (Bug#12316).
7779 Do not try to redefine the 'abort' function. Instead, redo
7780 the code so that it calls 'emacs_abort' rather than 'abort'.
7781 This removes the need for the NO_ABORT configure-time macro
7782 and makes it easier to change the abort code to do a backtrace.
7783 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7784 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7785 Remove; sysdep.c's emacs_abort now takes its place.
7786 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7787 'abort' changed to use 'emacs_abort'.
7788 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7789 (abort) [!defined abort]: Rename to ...
7790 (emacs_abort): ... new name.
7791 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7792 the place of the old 'abort' in emacs.c.
7793 * w32.c, w32fns.c (abort): Do not #undef.
7794 * w32.c (emacs_abort): Rename from w32_abort.
7795
7796 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7797
7798 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7799 offsets[j].dv, since the y axis of the screen coordinates points
7800 down, while the y axis of the font definition coordinates points
7801 up. This fixes display of Arabic diacritics such as KASRA and
7802 KASRATAN. (Bug#11860)
7803
7804 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7805
7806 Be more systematic about _setjmp vs setjmp.
7807 * alloc.c (test_setjmp, mark_stack):
7808 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7809 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7810 (png_load, my_error_exit, jpeg_load):
7811 * process.c (send_process_trap, send_process):
7812 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7813 The underscored versions are up to 30x faster on some hosts.
7814 Formerly, the code used setjmp+longjmp sometimes and
7815 _setjmp+_longjmp at other times, with no particular reason to
7816 prefer setjmp+longjmp.
7817
7818 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7819
7820 Fix minor problem found by static checking.
7821 * buffer.c (Fdelete_all_overlays): Return nil.
7822
7823 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7824
7825 * buffer.c (Fdelete_all_overlays): New function.
7826
7827 2012-09-03 Chong Yidong <cyd@gnu.org>
7828
7829 * gtkutil.c: Add extern decl for Qxft.
7830
7831 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7832
7833 * emacs.c, eval.c: Use bool for boolean.
7834 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7835 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7836 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7837 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7838 (main, decode_env_path, Fdaemon_initialized):
7839 * eval.c (call_debugger, Finteractive_p, interactive_p):
7840 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7841 (maybe_call_debugger, Fbacktrace):
7842 * process.c (read_process_output, exec_sentinel):
7843 Use bool for booleans.
7844 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7845 All callers changed.
7846 * eval.c (interactive_p): Omit always-true boolean argument
7847 EXCLUDE_SUBRS_P. All callers changed.
7848 * dispextern.h, lisp.h: Reflect above API changes.
7849 * firstfile.c (dummy): Use the address of 'main', whose signature
7850 won't change, instead of the address of 'initialize', whose
7851 signature just changed from int to bool.
7852 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7853 * msdos.c (fatal_error_in_progress): ... from here.
7854 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7855 of incrementing it.
7856 (redisplay_internal, unwind_redisplay): Simply clear
7857 REDISPLAYING_P when unwinding, instead of saving its previous,
7858 always-false value and then restoring it.
7859
7860 Clean up some extern decls.
7861 Mostly, this hoists extern decls out of .c files and into .h files.
7862 That way, we're more likely to catch errors if the interfaces change.
7863 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7864 declare xg_mark_data.
7865 * dispextern.h (x_frame_parm_handlers):
7866 * font.h (Qxft):
7867 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7868 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7869 (Qultra_bold, Qoblique, Qitalic):
7870 Move extern decl here from .c file.
7871 * alloc.c (xg_mark_data) [USE_GTK]:
7872 * doc.c (Qclosure):
7873 * eval.c (Qlexical_binding):
7874 * fns.c (time) [!HAVE_UNISTD_H]:
7875 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7876 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7877 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7878 * lread.c (Qinternal_interpreter_environment):
7879 * minibuf.c (Qbuffer):
7880 * process.c (QCfamily, QCfilter):
7881 * widget.c (free_frame_faces):
7882 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7883 * xfont.c (x_clear_errors):
7884 * xterm.c (x_frame_parm_handlers):
7885 Remove now-redundant extern decls.
7886 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7887 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7888 Now static.
7889 * xfaces.c: Remove unnecessary static decls.
7890 * xterm.c (updating_frame): Remove decl of nonexistent object.
7891
7892 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7893 when building globals.h, as the objects that are not built on
7894 this host are not needed to compile C files on this host.
7895
7896 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7897
7898 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7899
7900 * frame.h: Add missing prototype for x_wm_set_size_hint.
7901
7902 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7905 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7906 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7907 (Fsubstitute_command_keys):
7908 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7909 (save_excursion_save, save_excursion_restore)
7910 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7911 (format_time_string, general_insert_function)
7912 (make_buffer_string, make_buffer_string_both)
7913 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7914 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7915 (copy_text, insert_1, insert_1_both, insert_from_string)
7916 (insert_from_string_before_markers, insert_from_string_1)
7917 (insert_from_buffer, insert_from_buffer_1, replace_range)
7918 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7919 (del_range_2, modify_region):
7920 * intervals.c (intervals_equal, balance_possible_root_interval)
7921 (adjust_intervals_for_insertion, merge_properties_sticky)
7922 (graft_intervals_into_buffer, lookup_char_property)
7923 (adjust_for_invis_intang, set_point_both)
7924 (get_property_and_range, compare_string_intervals)
7925 (set_intervals_multibyte_1, set_intervals_multibyte):
7926 * keyboard.c (decode_timer):
7927 Use bool for boolean.
7928 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7929 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7930
7931 2012-09-02 Chong Yidong <cyd@gnu.org>
7932
7933 * keymap.c (push_key_description): Print M-TAB as C-M-i
7934 (Bug#11758).
7935
7936 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7937
7938 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7939 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7940 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7941 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7942 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7943 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7944 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7945
7946 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7947
7948 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7949 more than one grapheme cluster passed to the shaper: compute the
7950 offset adjustment values separately for each cluster. (Bug#11860)
7951
7952 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7953 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7954 about implicit conversions from integer to pointer.
7955
7956 2012-09-01 Daniel Colascione <dancol@dancol.org>
7957
7958 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7959 system used too early.
7960
7961 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 Better seed support for (random).
7964 * emacs.c (main): Call init_random.
7965 * fns.c (Frandom): Set the seed from a string argument, if given.
7966 Remove long-obsolete Gentzel cruft.
7967 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7968 (init_random): New function.
7969
7970 2012-09-01 Daniel Colascione <dancol@dancol.org>
7971
7972 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7973 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7974 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7975 x_wm_set_size_hint, x_query_colors, x_real_positions,
7976 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7977 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7978 all of which have been moved to common code.
7979
7980 * xfaces.c: Include TERM_HEADER instead of listing all possible
7981 window-system headers.
7982
7983 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7984 to match header.
7985
7986 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7987 directly accessing frame internals.
7988
7989 * w32font.h: Include font.h. Define syms_of_w32font and
7990 globals_of_w32font.
7991
7992 * process.c: Include TERM_HEADER instead of listing all possible
7993 window-system headers.
7994
7995 * nsterm.h: Remove declarations now in frame.h.
7996 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7997
7998 * menu.c: Include TERM_HEADER instead of listing all possible
7999 window-system headers.
8000
8001 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8002 window system.
8003
8004 * keyboard.c: Include TERM_HEADER instead of listing all possible
8005 window-system headers.
8006
8007 * image.c: Include TERM_HEADER instead of listing all possible
8008 window-system headers. Declare Vlibrary_cache when compiling for
8009 Windows.
8010
8011 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8012 window system declarations.
8013
8014 * frame.h: Move common functions here: set_frame_menubar,
8015 x_set_window_size, x_sync, x_get_focus_frame,
8016 x_set_mouse_position, x_set_mouse_pixel_position,
8017 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8018 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8019 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8020 x_activate_menubar, x_real_positions, x_bitmap_icon,
8021 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8022 and x_query_colors.
8023
8024 * frame.c: Include TERM_HEADER instead of listing all possible
8025 window-system headers.
8026
8027 * font.c: Include TERM_HEADER instead of listing all possible
8028 window-system headers.
8029
8030 * emacs.c: Include TERM_HEADER.
8031
8032 * dispnew.c: Include TERM_HEADER instead of listing all possible
8033 window-system headers.
8034
8035 * ccl.h: Include character.h.
8036
8037 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8038 the current window system; include in list of objects to link into
8039 Emacs.
8040
8041 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8042
8043 Remove mark_ttys function and fix tty_display_info initialization.
8044 * lisp.h (mark_ttys): Remove prototype.
8045 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8046 to mark_ttys because all possible values of 'top_frame' slot are
8047 the frames which are reachable from Vframe_list.
8048 * term.c (mark_ttys): Remove.
8049 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8050
8051 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8052
8053 Change struct frame bitfields from unsigned char to unsigned.
8054 * frame.h (struct frame): Change type of 'display_preempted',
8055 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8056 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8057 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8058 bitfields from unsigned char to unsigned.
8059
8060 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8061
8062 Remove unused member of struct x_output and struct w32_output.
8063 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8064 * w32term.h (struct w32_output): Likewise.
8065
8066 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8067
8068 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8069 does not become zero (Bug#12234).
8070
8071 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8074 for GCC 4.7.1 x86-64.
8075
8076 2012-08-30 Glenn Morris <rgm@gnu.org>
8077
8078 * lread.c (init_lread): For out-of-tree builds, only add the
8079 source directory's site-lisp dir to the load-path if it exists,
8080 consistent with in-tree builds. (Bug#12302)
8081
8082 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8083
8084 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8085 button_values to NULL. Call setStykeMask so dialogs get a close button.
8086 (windowShouldClose:): Set window_closed.
8087 (dealloc): New member, free button_values.
8088 (process_dialog:): Make member function. Remove window argument,
8089 replace window with self. Count buttons and allocate and store values
8090 in button_values.
8091 (addButton:value:row:): value is int with the name tag. Call setTag
8092 with tag. Remove return self, declare return value as void.
8093 (addString:row:): Remove return self, declare return value as void.
8094 (addSplit): Remove return self, declare return value as void.
8095 (clicked:): Remove return self, declare return value as void.
8096 Set dialog_return to button_values[seltag]. Code formatting change.
8097 (initFromContents:isQuestion:): Adjust call to process_dialog.
8098 Code formatting change.
8099 (timeout_handler:): Set timer_fired to YES.
8100 (runDialogAt:): Set timer_fired to NO.
8101 Handle click on close button as quit.
8102
8103 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8104 Add window_closed and button_values. Add void as return value for
8105 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8106 Add process_dialog as new member.
8107
8108 2012-08-28 Eli Zaretskii <eliz@gnu.org>
8109
8110 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8111 is not one of the heaps we manage. (Bug#12242)
8112
8113 2012-08-28 Glenn Morris <rgm@gnu.org>
8114
8115 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8116
8117 2012-08-28 Martin Rudalics <rudalics@gmx.at>
8118
8119 * window.c (Fset_window_configuration): Remove handling of
8120 auto-buffer-name window parameter. Install revision of reverted
8121 fix.
8122
8123 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8124
8125 Do not allow to set major mode for a dead buffer.
8126 * buffer.c (Fset_buffer_major_mode): Signal an error
8127 if the buffer is dead.
8128 (Fother_buffer, other_buffer_safely): Remove redundant
8129 nested declaration.
8130
8131 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8132
8133 Always use set_buffer_if_live to restore original buffer at unwind.
8134 * buffer.h (record_unwind_current_buffer): New function.
8135 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8136 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8137 * undo.c, window.c: Adjust users.
8138 * buffer.c (set_buffer_if_live): Fix comment.
8139
8140 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8141
8142 Fix usage of set_buffer_internal.
8143 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8144 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8145 * coding.c (decode_coding): Omit redundant test.
8146 * fileio.c (decide_coding_unwind): Likewise.
8147 * fns.c (secure_hash): Likewise.
8148 * insdel.c (modify_region): Likewise.
8149 * keyboard.c (command_loop_1): Likewise.
8150 * print.c (PRINTFINISH): Likewise.
8151 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8152
8153 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 * dispnew.c: Use bool for boolean.
8156 (frame_garbaged, display_completed, delayed_size_change)
8157 (fonts_changed_p, add_window_display_history)
8158 (add_frame_display_history, verify_row_hash)
8159 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8160 (row_equal_p, realloc_glyph_pool)
8161 (allocate_matrices_for_frame_redisplay)
8162 (showing_window_margins_p)
8163 (adjust_frame_glyphs_for_frame_redisplay)
8164 (build_frame_matrix_from_leaf_window, make_current)
8165 (mirrored_line_dance, mirror_line_dance, update_frame)
8166 (update_window_tree, update_single_window)
8167 (check_current_matrix_flags, update_window, update_text_area)
8168 (update_window_line, set_window_update_flags, scrolling_window)
8169 (update_frame_1, scrolling, buffer_posn_from_coords)
8170 (do_pending_window_change, change_frame_size)
8171 (change_frame_size_1, sit_for):
8172 Use bool for boolean.
8173 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8174 and remove last int (actually boolean) argument, which was always 0.
8175 All callers changed.
8176 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8177 * dispextern.h (struct composition_it): Use bool for boolean.
8178 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8179 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8180 * dired.c (file_name_completion):
8181 Use bool for boolean. (This was missed in an earlier change.)
8182
8183 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8184
8185 * window.c (Fset_window_configuration): Revert first part of
8186 last change.
8187
8188 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8189
8190 * nsterm.h (NSPanel): New class variable dialog_return.
8191
8192 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8193 Initialize dialog_return.
8194 (windowShouldClose:): Use stop instead of stopModalWithCode.
8195 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8196 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8197 event.
8198 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8199 modal loop returns.
8200
8201 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8204 * composite.c (find_composition, composition_gstring_p)
8205 (composition_reseat_it, find_automatic_composition):
8206 * data.c (let_shadows_buffer_binding_p)
8207 (let_shadows_global_binding_p, set_internal, make_blv)
8208 (Fmake_variable_buffer_local, Fmake_local_variable)
8209 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8210 (cons_to_signed, arith_driver):
8211 * dbusbind.c (xd_in_read_queued_messages):
8212 * dired.c (directory_files_internal, file_name_completion):
8213 Use bool for booleans.
8214 * dired.c (file_name_completion):
8215 * process.h (fd_callback):
8216 Omit int (actually boolean) argument. It wasn't being used.
8217 All uses changed.
8218 * composite.h, lisp.h: Reflect above API changes.
8219
8220 * cmds.c, coding.c: Use bool for booleans.
8221 * cmds.c (move_point, Fself_insert_command):
8222 * coding.h (struct composition status, struct coding_system):
8223 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8224 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8225 (emacs_mule_char, decode_coding_emacs_mule)
8226 (encode_coding_emacs_mule, detect_coding_iso_2022)
8227 (decode_coding_iso_2022, encode_invocation_designation)
8228 (encode_designation_at_bol, encode_coding_iso_2022)
8229 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8230 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8231 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8232 (encode_coding_raw_text, detect_coding_charset)
8233 (decode_coding_charset, encode_coding_charset, detect_eol)
8234 (detect_coding, get_translation_table, produce_chars)
8235 (consume_chars, reused_workbuf_in_use)
8236 (make_conversion_work_buffer, code_conversion_save)
8237 (decode_coding_object, encode_coding_object)
8238 (detect_coding_system, char_encodable_p)
8239 (Funencodable_char_position, code_convert_region)
8240 (code_convert_string, code_convert_string_norecord)
8241 (Fset_coding_system_priority):
8242 * fileio.c (Finsert_file_contents):
8243 Use bool for booleans.
8244 * coding.h, lisp.h: Reflect above API changes.
8245 * coding.c: Remove unnecessary static function decls.
8246 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8247 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8248 not a boolean 'int', since callers never look at the return value.
8249 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8250 * coding.h (decoding_buffer_size, encoding_buffer_size)
8251 (emacs_mule_string_char): Remove unused extern decls.
8252 (struct iso_2022_spec, struct coding_system):
8253 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8254 (struct emacs_mule_spec): Remove unused field 'full_support'.
8255 All initializations removed.
8256 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8257
8258 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8259
8260 Fix spare memory change (Bug#12286).
8261 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8262 (valid_lisp_object_p): Likewise.
8263
8264 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8265
8266 * window.c (Fset_window_configuration): Record any window's old
8267 buffer if it's replaced (see Bug#8789). If the new current
8268 buffer doesn't appear in the selected window, go to its old
8269 point (Bug#12208).
8270
8271 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8272
8273 Special MEM_TYPE_SPARE to denote reserved memory.
8274 * alloc.c (enum mem_type): New memory type.
8275 (refill_memory_reserve): Use new type for spare memory.
8276 This prevents live_cons_p and live_string_p from incorrect
8277 detection of uninitialized objects from spare memory as live.
8278
8279 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8280
8281 Spelling fixes.
8282 * Makefile.in (.PHONY): versioclean -> versionclean.
8283
8284 Remove unused external symbols.
8285 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8286 * window.c (Qwindow_valid_p, decode_valid_window):
8287 Now static, not extern.
8288 * data.c (Qinterval): Remove; unused.
8289 (syms_of_data): Do not define 'interval'.
8290 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8291 * window.h (decode_valid_window):
8292 Remove decls.
8293
8294 * character.c, charset.c, chartab.c: Use bool for booleans.
8295 * character.c (lisp_string_width, string_count_byte8)
8296 (string_escape_byte8):
8297 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8298 (load_charset_map_from_file, map_charset_chars)
8299 (Fdefine_charset_internal, define_charset_internal)
8300 (Fdeclare_equiv_charset, find_charsets_in_text)
8301 (Ffind_charset_region, char_charset, Fiso_charset):
8302 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8303 (sub_char_table_set, sub_char_table_set_range)
8304 (char_table_set_range, optimize_sub_char_table)
8305 (map_sub_char_table):
8306 Use bool for boolean.
8307 * character.c (str_to_unibyte): Omit last boolean argument; it was
8308 always 0. All callers changed.
8309 * character.h, charset.h: Adjust to match previous changes.
8310 * character.h (char_printable_p): Remove decl of nonexistent function.
8311 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8312 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8313 are all boolean, so make them single-bit bitfields.
8314
8315 * lisp.h (ASET): Remove attempt to detect side effects.
8316 It was meant to be temporary and it often doesn't work,
8317 because when IDX has side effects the behavior of IDX==IDX
8318 is undefined. See Stefan Monnier in
8319 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8320
8321 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8322
8323 * lisp.h (functionp): New function (extracted from Ffunctionp).
8324 (FUNCTIONP): Use it.
8325 * eval.c (Ffunctionp): Use it.
8326
8327 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8328
8329 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8330 as that's faster and simpler than static storage. Don't bother
8331 with the g_main_context_query overhead if g_main_context_pending
8332 says no events are pending.
8333 (gfds, gfds_size): Remove these static vars.
8334 (xgselect_initialize): Remove; no longer needed.
8335 All uses and decls removed.
8336
8337 * emacs.c (fatal_error_signal_hook): Remove.
8338 All uses removed. This leftover from old code was always 0.
8339
8340 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8341 * casefiddle.c (casify_object, casify_region):
8342 * casetab.c (set_case_table):
8343 * category.c, category.h (word_boundary_p):
8344 * category.h (CHAR_HAS_CATEGORY):
8345 Use bool for booleans, instead of int.
8346
8347 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8348
8349 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8350
8351 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8352
8353 On assertion failure, print backtrace if available.
8354 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8355 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8356 * Makefile.in (LIB_EXECINFO): New macro.
8357 (LIBES): Use it.
8358
8359 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8360 * bytecode.c (exec_byte_code):
8361 * callint.c (check_mark, Fcall_interactively):
8362 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8363 (getenv_internal, sync_process_alive, call_process_exited):
8364 * lisp.h (USE_SAFE_ALLOCA):
8365 Use bool for booleans, instead of int.
8366 * lisp.h, process.h: Adjust prototypes to match above changes.
8367 * callint.c (Fcall_interactively): Don't assume the mark's
8368 offset fits in 'int'.
8369
8370 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 * buffer.c, buffer.h: Use bool for boolean.
8373 * buffer.c (reset_buffer_local_variables)
8374 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8375 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8376 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8377 (overlay_touches_p, overlay_strings, Foverlay_put)
8378 (report_overlay_modification, call_overlay_mod_hooks):
8379 (mmap_enlarge, mmap_set_vars):
8380 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8381 Use bool for booleans, instead of int.
8382 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8383 since the 1-or-0 return value is always ignored anyway.
8384 (mmap_initialized_p):
8385 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8386 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8387
8388 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8389
8390 * bidi.c: Use bool for boolean.
8391 This is a bit more readable, and makes the text segment of bidi.o
8392 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8393 Presumably it's faster too.
8394 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8395 Now bool.
8396 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8397 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8398 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8399 (bidi_explicit_dir_char, bidi_level_of_next_char)
8400 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8401 Use bool for booleans, instead of int.
8402 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8403 (bidi_unshelve_cache): Adjust decls to match code.
8404
8405 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8406
8407 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8408 argument.
8409
8410 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8411
8412 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8413 * atimer.h: Include <stdbool.h>.
8414
8415 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8416
8417 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8418 compile time tests instead of run time tests on systems that do
8419 not use them.
8420 (FRAME_MAC_P): Remove leftover from deleted code.
8421 * frame.c (syms_of_frame): Remove leftover from deleted code.
8422
8423 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8424
8425 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8426
8427 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8428
8429 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8430 Otherwise, the compiler complains about (A?B:C) where B is void
8431 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8432 (fontset_add): Return void, for FONTSET_ADD.
8433
8434 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8435
8436 * alloc.c: Use bool for booleans.
8437 (gc_in_progress, abort_on_gc)
8438 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8439 (dont_register_blocks) [GC_MALLOC_CHECK]:
8440 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8441 (check_string_bytes, make_specified_string, memory_full)
8442 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8443 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8444 (mark_stack, valid_pointer_p, make_pure_string)
8445 (Fgarbage_collect, survives_gc_p, gc_sweep):
8446 Use bool for booleans, instead of int.
8447 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8448 Remove unused local.
8449 * alloc.c (PURE_POINTER_P):
8450 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8451 * editfns.c (Fformat):
8452 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8453 (Fdo_auto_save):
8454 * fns.c (sweep_weak_table):
8455 * lisp.h (suppress_checking, push_message, survives_gc_p)
8456 (make_pure_string, gc_in_progress, abort_on_gc):
8457 * lread.c (readchar, read1):
8458 * print.c (Fprin1_to_string):
8459 * xdisp.c (push_message):
8460 Use bool for booleans affected directly or indirectly by
8461 alloc.c's changes.
8462
8463 Make recently-introduced setters macros.
8464 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8465 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8466 (set_fontset_default, set_fontset_fallback): Rename from their
8467 upper-case counterparts, and make them functions rather than macros.
8468 This is more consistent with the other recently-introduced setters.
8469 These don't need to be inline, since they're local.
8470
8471 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8472
8473 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8474 the loop (Bug#12247).
8475
8476 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 * lisp.h (vcopy): Use memcpy rather than our own loop.
8479 This fixes a performance regression introduced by the recent
8480 addition of vcopy. This means 'vcopy' will need to be modified
8481 for a copying collector, but that's OK. Also, tighten the
8482 checking in the assertion.
8483
8484 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8485
8486 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8487 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8488 non-base glyph for the width of the base character, according to
8489 what x_draw_composite_glyph_string_foreground expects.
8490 Generate WADJUST value according to composition_gstring_width's
8491 expectations, to produce correct width of the composed character.
8492 Reverse the sign of the DU offset produced by ScriptPlace.
8493
8494 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8495
8496 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8497
8498 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8499
8500 Avoid direct writes to contents member of struct Lisp_Vector.
8501 * lisp.h (vcopy): New function to copy data into vector.
8502 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8503 * fns.c (Ffillarray): Use ASET.
8504 * keyboard.c (timer_check_2): Use AREF and ASET.
8505 (append_tool_bar_item, Frecent_keys): Use vcopy.
8506 * lread.c (read_vector): Use ASET.
8507 * msdos.c (Frecent_doskeys): Use vcopy.
8508 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8509 (Finternal_merge_in_global_face): Use ASET and vcopy.
8510 * xfont.c (xfont_list_pattern): Likewise.
8511
8512 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8513
8514 * window.c (Fwindow_point): For the selected window always return
8515 the position of its buffer's point.
8516 (Fset_window_point): For the selected window always go in its
8517 buffer to the specified position.
8518
8519 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8520
8521 Setter macros for fontsets.
8522 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8523 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8524 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8525 Adjust users.
8526
8527 2012-08-20 Glenn Morris <rgm@gnu.org>
8528
8529 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8530 Don't assume that `ln -f' works.
8531
8532 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8533
8534 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8535 and later about non-assignments with no effect. See discussion at
8536 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8537 details.
8538
8539 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8540
8541 Inline setter functions for Lisp_Objects slots of struct specbinding.
8542 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8543 Adjust users.
8544
8545 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8546
8547 * window.c (select_window): Always make selected window's buffer
8548 current.
8549
8550 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8551
8552 Use AREF and ASET for docstrings of category tables.
8553 * category.h (CATEGORY_DOCSTRING): Use AREF.
8554 (SET_CATEGORY_DOCSTRING): Use ASET.
8555 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8556
8557 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8558
8559 Inline setter functions for hash table members.
8560 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8561 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8562 (set_hash_key_and_value, set_hash_index, set_hash_next)
8563 (set_hash_hash): New functions.
8564 * charset.c, fns.c: Adjust users.
8565
8566 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8567
8568 Inline getter and setter functions for per-buffer values.
8569 * buffer.h (per_buffer_default, set_per_buffer_default)
8570 (per_buffer_value, set_per_buffer_value): New functions.
8571 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8572 * buffer.c, data.c: Adjust users.
8573
8574 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8575
8576 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8577
8578 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8579
8580 Rely on <config.h> + <unistd.h> to declare 'environ',
8581 as gnulib does this if the system doesn't.
8582 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8583 Remove declaration. MS-Windows declares it on stdlib.h which is
8584 included by conf_post.h.
8585 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8586 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8587 * vm-limit.c: Include <unistd.h>, for 'environ'.
8588
8589 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8590 (start_of_data): Remove decl; mem-limits.h provides it.
8591
8592 * xdisp.c (handle_invisible_prop): Make it a bit faster
8593 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8594
8595 2012-08-19 Chong Yidong <cyd@gnu.org>
8596
8597 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8598 ends (Bug#3874).
8599
8600 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8601
8602 * .gdbinit: Use call instead of set when calling a function in the
8603 inferior.
8604
8605 * data.c (set_internal): Don't use set_blv_found.
8606 (Fkill_local_variable): Likewise.
8607
8608 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8609
8610 * nsfont.m (ns_ascii_average_width): Ensure the string
8611 ascii_printable is initialized with a null-terminated character
8612 array. Otherwise, it can contain undesired extra characters.
8613
8614 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8615
8616 port new setting code to Sun C 5.8 2005/10/13
8617 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8618 Return void, not Lisp_Object. Otherwise, the compiler
8619 complains about (A?B:C) where B is void and C is Lisp_Object
8620 when compiling CHAR_TABLE_SET, due to the recent change to
8621 the API of sub_char_table_set_contents.
8622
8623 2012-08-18 Chong Yidong <cyd@gnu.org>
8624
8625 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8626 for the string case (Bug#3874).
8627
8628 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8629
8630 * buffer.h (BSET): Remove (Bug#12215).
8631 Replace all uses with calls to new setter functions.
8632 (bset_bidi_paragraph_direction, bset_case_canon_table)
8633 (bset_case_eqv_table, bset_directory, bset_display_count)
8634 (bset_display_time, bset_downcase_table)
8635 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8636 (bset_last_selected_window, bset_local_var_alist)
8637 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8638 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8639 (bset_width_table):
8640 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8641 (bset_auto_fill_function, bset_auto_save_file_format)
8642 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8643 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8644 (bset_cache_long_line_scans, bset_case_fold_search)
8645 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8646 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8647 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8648 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8649 (bset_header_line_format, bset_indicate_buffer_boundaries)
8650 (bset_indicate_empty_lines, bset_invisibility_spec)
8651 (bset_left_fringe_width, bset_major_mode, bset_mark)
8652 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8653 (bset_name, bset_overwrite_mode, bset_pt_marker)
8654 (bset_right_fringe_width, bset_save_length)
8655 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8656 (bset_scroll_up_aggressively, bset_selective_display)
8657 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8658 (bset_word_wrap, bset_zv_marker):
8659 * category.c (bset_category_table):
8660 * syntax.c (bset_syntax_table):
8661 New setter functions.
8662
8663 * process.h (PSET): Remove (Bug#12215).
8664 Replace all uses with calls to new setter functions.
8665 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8666 (PROCESS_INLINE): New macro.
8667 (pset_childp): New setter function.
8668 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8669 * process.c (PROCESS_INLINE):
8670 Define to EXTERN_INLINE, so that the corresponding functions
8671 are compiled into code.
8672 (pset_buffer, pset_command, pset_decode_coding_system)
8673 (pset_decoding_buf, pset_encode_coding_system)
8674 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8675 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8676 (pset_type, pset_write_queue): New setter functions.
8677
8678 * window.h (WSET): Remove (Bug#12215).
8679 Replace all uses with calls to new setter functions.
8680 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8681 (WINDOW_INLINE): New macro.
8682 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8683 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8684 (wset_total_lines, wset_vertical_scroll_bar)
8685 (wset_window_end_pos, wset_window_end_valid)
8686 (wset_window_end_vpos): New setter functions.
8687 * window.c (WINDOW_INLINE):
8688 Define to EXTERN_INLINE, so that the corresponding functions
8689 are compiled into code.
8690 (wset_combination_limit, wset_dedicated, wset_display_table)
8691 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8692 (wset_new_normal, wset_new_total, wset_next_buffers)
8693 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8694 (wset_prev_buffers, wset_right_fringe_width)
8695 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8696 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8697 (wset_window_parameters):
8698 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8699 (wset_column_number_displayed, wset_region_showing):
8700 New setter functions.
8701
8702 * termhooks.h (TSET): Remove (Bug#12215).
8703 Replace all uses with calls to new setter functions.
8704 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8705 (TERMHOOKS_INLINE): New macro.
8706 (tset_charset_list, tset_selection_alist): New setter functions.
8707 * terminal.c (TERMHOOKS_INLINE):
8708 Define to EXTERN_INLINE, so that the corresponding functions
8709 are compiled into code.
8710 (tset_param_alist): New setter function.
8711
8712 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8713
8714 * keyboard.h (KSET): Remove (Bug#12215).
8715 Replace all uses with calls to new setter functions.
8716 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8717 (KEYBOARD_INLINE): New macro.
8718 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8719 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8720 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8721 New setter functions.
8722 * keyboard.c (KEYBOARD_INLINE):
8723 Define to EXTERN_INLINE, so that the corresponding functions
8724 are compiled into code.
8725 (kset_echo_string, kset_kbd_queue)
8726 (kset_keyboard_translate_table, kset_last_prefix_arg)
8727 (kset_last_repeatable_command, kset_local_function_key_map)
8728 (kset_overriding_terminal_local_map, kset_real_last_command)
8729 (kset_system_key_syms): New setter functions.
8730
8731 * frame.h (FSET): Remove (Bug#12215).
8732 Replace all uses with calls to new setter functions.
8733 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8734 (FRAME_INLINE): New macro.
8735 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8736 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8737 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8738 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8739 (fset_param_alist, fset_root_window, fset_scroll_bars)
8740 (fset_selected_window, fset_title, fset_tool_bar_items)
8741 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8742 * frame.c (FRAME_INLINE):
8743 Define to EXTERN_INLINE, so that the corresponding functions
8744 are compiled into code.
8745 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8746
8747 A few more naming-convention fixes for getters and setters.
8748 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8749 and rename from buffer_overlays_set_before.
8750 (set_buffer_overlays_after): Move here from buffer.h, and rename
8751 from buffer_overlays_set_after.
8752 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8753 All uses changed.
8754 (set_buffer_intervals): Rename from buffer_set_intervals.
8755 * intervals.c (set_interval_object): Move here from intervals.h,
8756 and rename from interval_set_object.
8757 (set_interval_left): Move here from intervals.h, and rename from
8758 interval_set_left.
8759 (set_interval_right): Move here from intervals.h, and rename from
8760 interval_set_right.
8761 (copy_interval_parent): Move here from intervals.h, and rename from
8762 interval_copy_parent.
8763 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8764 (set_interval_plist): Rename from interval_set_plist.
8765 Return void, not Lisp_Object, since no caller uses the result.
8766 * lisp.h (string_intervals): Rename from string_get_intervals.
8767 (set_string_intervals): Rename from string_set_intervals.
8768
8769 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8770 (set_char_table_contents): Rename from char_table_set_contents.
8771 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8772 All uses changed. See the end of
8773 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8774
8775 * lisp.h (CSET): Remove (Bug#12215).
8776 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8777 (set_char_table_purpose): New functions,
8778 replacing CSET. All uses changed. For example, replace
8779 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8780 "set_char_table_parent (char_table, parent);".
8781 The old version was confusing because it used the same name
8782 'parent' for two different things.
8783
8784 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8785
8786 Functions to get and set Lisp_Object fields of buffer-local variables.
8787 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8788 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8789 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8790 * data.c, eval.c, frame.c: Adjust users.
8791
8792 2012-08-17 Chong Yidong <cyd@gnu.org>
8793
8794 * xfaces.c (merge_face_vectors): If the target font specfies a
8795 font spec, make the font's attributes take precedence over
8796 directly-specified attributes.
8797 (merge_face_ref): Recognize :font.
8798
8799 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8800
8801 Do not use memcpy for copying intervals.
8802 * intervals.c (reproduce_interval): New function.
8803 (reproduce_tree, reproduce_tree_obj): Use it.
8804 (reproduce_tree_obj): Remove prototype.
8805
8806 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8807
8808 * lisp.h (duration_to_sec_usec): Remove unused decl.
8809
8810 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8811
8812 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8813 to an allocated instance of NSString, not to the class itself.
8814
8815 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8816
8817 * makefile.w32-in (C_CTYPE_H): New macro.
8818 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8819 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8820 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8821
8822 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8823
8824 Use ASCII tests for character types.
8825 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8826 * xfns.c, xterm.c:
8827 Don't include <ctype.h>; was not needed.
8828 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8829 * sysdep.c, xfaces.c:
8830 Include <c-ctype.h> instead of <ctype.h>.
8831 * nsterm.m: Include <c-ctype.h>.
8832 * charset.c (read_hex):
8833 * doc.c (Fsnarf_documentation):
8834 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8835 (DRIVE_LETTER) [DOS_NT]:
8836 (Ffile_name_directory, Fexpand_file_name)
8837 (Fsubstitute_in_file_name):
8838 * font.c (font_parse_xlfd, font_parse_fcname):
8839 * frame.c (x_set_font_backend):
8840 * gtkutil.c (xg_get_font):
8841 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8842 * nsimage.m (hexchar):
8843 * nsterm.m (ns_xlfd_to_fontname):
8844 * sysdep.c (system_process_attributes):
8845 * xfaces.c (hash_string_case_insensitive):
8846 Use C-locale tests instead of locale-specific tests for character
8847 types, since we want the ASCII interpretation here, not the
8848 interpretation suitable for whatever happens to be the current locale.
8849
8850 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8851
8852 Consistently check windows for validity/liveness
8853 (Bug#11984, Bug#12025, Bug#12026).
8854 * lisp.h (CHECK_VALID_WINDOW): New macro.
8855 * window.c (decode_window): Rename to decode_live_window.
8856 (decode_valid_window, Fwindow_valid_p): New functions.
8857 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8858 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8859 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8860 (Fwindow_prev_sibling, Fwindow_combination_limit)
8861 (Fset_window_combination_limit, Fwindow_use_time)
8862 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8863 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8864 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8865 (Fwindow_hscroll, Fset_window_hscroll)
8866 (Fwindow_redisplay_end_trigger)
8867 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8868 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8869 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8870 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8871 (Fwindow_end, Fset_window_point, Fset_window_start)
8872 (Fpos_visible_in_window_p, Fwindow_line_height)
8873 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8874 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8875 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8876 (Fset_window_parameter, Fwindow_display_table)
8877 (Fset_window_display_table, Fdelete_other_windows_internal)
8878 (Fset_window_buffer, Fset_window_new_total)
8879 (Fset_window_new_normal, Fdelete_window_internal)
8880 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8881 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8882 (Fwindow_scroll_bars): Check whether argument window is a valid or
8883 live window. Update doc-strings.
8884 (syms_of_window): New symbol Qwindow_valid_p.
8885 * keyboard.c (Fposn_at_x_y): Check whether argument
8886 frame_or_window denotes a valid window.
8887
8888 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8889
8890 Fix previous char table change.
8891 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8892 * chartab.c (optimize_sub_char_table): Likewise.
8893
8894 2012-08-16 Chong Yidong <cyd@gnu.org>
8895
8896 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8897
8898 * xfont.c (xfont_open):
8899 * xftfont.c (xftfont_open): Set the font's max_width field.
8900
8901 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8902 min_width to space_width and average_width to the average over
8903 printable ASCII characters.
8904 (ns_char_width): Code cleanup.
8905 (ns_ascii_average_width): New utility function.
8906
8907 * font.h (struct font): Update comments.
8908
8909 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8910
8911 Simple interface to set Lisp_Object fields of character tables.
8912 * lisp.h (CSET): New macro.
8913 (char_table_set_extras, char_table_set_contents)
8914 (sub_char_table_set_contents): New function.
8915 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8916 * syntax.c: Adjust users.
8917
8918 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8919
8920 * eval.c (eval_sub): Bind lexical-binding.
8921 * lread.c (Qlexical_binding): Make non-static.
8922
8923 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8924
8925 * nsmenu.m (popupSession): Remove.
8926 (pop_down_menu): Remove endModalSession.
8927 (timeout_handler:): New method.
8928 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8929 Call runModalForWindow. Check timer_fired when it returns.
8930 If not set, cancel timer and break out of loop.
8931 Otherwise loop again, with a new timeout.
8932
8933 * nsterm.m: Include fcntl.h if present.
8934 (fd_entry, t_readfds, inNsSelect): Remove.
8935 (select_writefds, select_valid, select_timeout, selfds)
8936 (select_mutex, apploopnr): Add.
8937 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8938 Otherwise call kbd_buffer_store_event.
8939 (ns_send_appdefined): Remove release of fd_entry.
8940 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8941 Increment and decrement apploopnr.
8942 (ns_select): If no file descriptors, just do a NSTimer.
8943 Otherwise copy read/write masks and start select thread (fd_handler).
8944 Start main loop and wait for application defined event.
8945 Inform select thread to stop selecting after main loop is exited.
8946 (ns_term_init): Create selfds pipe and set non-blocking.
8947 Initialize select_mutex. Start the select thread (fd_handler).
8948 (fd_handler:): Loop forever, wait for info from the main thread
8949 to either start or stop selecting. When select returns, send
8950 and appdefined event.
8951 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8952 If not call kbd_buffer_store_event.
8953
8954 * nsterm.h (EmacsApp): fd_handler takes id argument.
8955 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8956
8957 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8958
8959 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8960
8961 * region-cache.c (move_cache_gap): Update gap_len using the actual
8962 growth of the boundaries array. Do not change cache_len.
8963 (Bug#12196)
8964
8965 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8966
8967 Generalize and cleanup font subsystem checks.
8968 * font.h (FONT_DEBUG, font_assert): Remove.
8969 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8970 Change font_assert to eassert. Use eassert where appropriate.
8971
8972 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8973
8974 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8975
8976 2012-08-15 Chong Yidong <cyd@gnu.org>
8977
8978 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8979 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8980 extract the font descriptor instead of just the font name.
8981 In that case, return a font spec instead of a string.
8982 (x_last_font_name): Move to this file from xfns.c.
8983
8984 * xfns.c (Fx_select_font): The return value can also be a font
8985 spec. Move x_last_font_name management to gtkutil.c.
8986
8987 * xfaces.c: Make font weight and style symbols non-static.
8988
8989 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8990
8991 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8992 (bug#12117).
8993
8994 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8995
8996 * alloc.c (Fgarbage_collect): Use plural form consistently.
8997
8998 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8999
9000 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9001 iteration through the command loop. Fixes a problem whereby mouse
9002 movements are ignored until the first mouse click.
9003
9004 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9005
9006 Use bool, not int, for Lisp booleans.
9007 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9008 makes Emacs a bit smaller and presumably a bit faster.
9009 * lisp.h: Include <stdbool.h>.
9010 (struct Lisp_Boolfwd, defvar_bool):
9011 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9012 * regex.c [!emacs]: Include <stdbool.h>.
9013 (false, true): Remove; <stdbool.h> does this for us now.
9014
9015 2012-08-14 Chong Yidong <cyd@gnu.org>
9016
9017 * character.c (Fcharacterp): Doc fix (Bug#12076).
9018
9019 * data.c (Findirect_variable): Doc fix (Bug#11040).
9020
9021 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9022
9023 * editfns.c (Fformat): Doc fix (Bug#12059).
9024 (Fsave_current_buffer): Doc fix (Bug#11542).
9025
9026 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9027
9028 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9029 (bug#12022).
9030
9031 2012-08-14 Martin Rudalics <rudalics@gmx.at>
9032
9033 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9034 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9035 * minibuf.c (choose_minibuf_frame, read_minibuf):
9036 * w32fns.c (x_create_tip_frame):
9037 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9038 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9039
9040 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9041
9042 * intervals.c (offset_intervals): Remove obsolete comment.
9043
9044 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9045
9046 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9047
9048 2012-08-14 Gergely Risko <gergely@risko.hu>
9049
9050 * coding.c (decode_coding): Record buffer modification before
9051 disabling undo_list (Bug#11773).
9052
9053 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9054
9055 Revert and cleanup some recent overlay changes.
9056 * buffer.h (enum overlay_type): Remove.
9057 (buffer_get_overlays, buffer_set_overlays): Likewise.
9058 (buffer_set_overlays_before, buffer_set_overlays_after):
9059 New function. Adjust users.
9060 (unchain_both): Add eassert.
9061
9062 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9063
9064 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9065
9066 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9067
9068 * gtkutil.c (xg_mark_data): Don't assume C99.
9069
9070 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9071
9072 * gtkutil.c (xg_frame_tb_info): New struct.
9073 (TB_INFO_KEY): New define.
9074 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9075 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9076 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9077 if not present.
9078 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9079 is up to date. Otherwise store new data.
9080 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9081
9082 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9083
9084 Use KSET for write access to Lisp_Object members of struct kboard.
9085 * keyboard.h (KSET): New macro.
9086 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9087 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9088 * xterm.c: Adjust users.
9089
9090 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9091
9092 Use BSET for write access to Lisp_Object members of struct buffer.
9093 * buffer.h (BSET): New macro.
9094 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9095 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9096 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9097 * window.c, xdisp.c, xfns.c: Adjust users.
9098
9099 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9100
9101 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9102
9103 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9104
9105 * nsterm.m (not_in_argv): New function.
9106 (application:openFile, application:openTempFile:):
9107 (application:openFileWithoutUI:, application:openFiles:): Open file
9108 if not_in_argv returns non-zero (bug#12171).
9109
9110 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9111 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9112 Define for Gtk+ versions less than 3.2.
9113 (xg_get_font_name): Use those functions/macros here.
9114 Reported by Frans Oilinki <moilinki@gmail.com>.
9115
9116 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9117
9118 * unexmacosx.c (copy_data_segment): Copy initialized data in
9119 statically linked libraries from input file rather than memory.
9120
9121 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9122 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9123 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9124
9125 2012-08-10 Glenn Morris <rgm@gnu.org>
9126
9127 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9128 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9129
9130 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9131
9132 Fix last change to allow compilation with low optimization levels.
9133 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9134 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9135
9136 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9137
9138 Use common inline syntax in intervals.h.
9139 * intervals.h (INTERVALS_INLINE): New macro.
9140 Change all users from LISP_INLINE.
9141
9142 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9143
9144 Define Qnone once for all platforms.
9145 * frame.c (Qnone): Define here.
9146 (syms_of_frame): DEFSYM it.
9147 * lisp.h (Qnone): New declaration.
9148 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9149 * xfns.c: Remove duplication. Adjust users.
9150
9151 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9152
9153 Remove unused macros from intervals.h.
9154 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9155 * intervals.c: Adjust comment.
9156
9157 2012-08-10 Eli Zaretskii <eliz@gnu.org>
9158
9159 * w32fns.c <w32_unicode_gui>: New static variable.
9160 (globals_of_w32fns): Initialize it according to os_subtype.
9161 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9162 testing os_subtype.
9163
9164 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9165 Eli Zaretskii <eliz@gnu.org>
9166
9167 Fix bug #10299 with Unicode characters sent by customized
9168 keyboards created by MSKLC.
9169 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9170 (w32_init_class): Use it to initialize the Emacs class with either
9171 ANSI or Unicode API calls.
9172 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9173 later.
9174 (w32_wnd_proc): If the character code sent by WM_CHAR or
9175 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9176 original message. Call DefWindowProcW on NT and later.
9177
9178 2012-08-10 Glenn Morris <rgm@gnu.org>
9179
9180 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9181
9182 * lisp.h (DIRECTORY_SEP): Let configure set it.
9183
9184 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9185
9186 Use TSET for write access to Lisp_Object slots of struct terminal.
9187 * termhooks.h (TSET): New macro.
9188 * coding.c, terminal.c, xselect.c: Adjust users.
9189
9190 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9191
9192 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9193 the failing expression, include them in the error message.
9194 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9195 * lisp.h (internal_condition_case_n): Update declaration.
9196
9197 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9198
9199 Inline functions to examine and change buffer overlays.
9200 * buffer.c (unchain_both): New function.
9201 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9202 (buffer_has_overlays): New function.
9203 (enum overlay_type): New enum.
9204 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9205 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9206
9207 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9208
9209 Inline functions to examine and change buffer intervals.
9210 * alloc.c (mark_interval_tree): Remove.
9211 (MARK_INTERVAL_TREE): Simplify.
9212 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9213 * intervals.c (buffer_balance_intervals): New function.
9214 (graft_intervals_into_buffer): Adjust indentation.
9215 (set_intervals_multibyte): Simplify.
9216 * buffer.h (BUF_INTERVALS): Remove.
9217 (buffer_get_intervals, buffer_set_intervals): New function.
9218 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9219 * intervals.c, textprop.c: Adjust users.
9220
9221 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9222
9223 Inline functions to examine and change string intervals.
9224 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9225 (string_get_intervals, string_set_intervals): New function.
9226 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9227 * lread.c, print.c, textprop.c: Adjust users.
9228
9229 2012-08-08 Glenn Morris <rgm@gnu.org>
9230
9231 * lisp.mk (lisp): Remove language/persian.elc.
9232
9233 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9234
9235 Cleanup intervals.
9236 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9237 (NULL_INTERVAL_P): Likewise. Adjust users.
9238 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9239 Adjust comment. Move under #if 0.
9240 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9241 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9242
9243 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9244
9245 Check total length of intervals with eassert.
9246 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9247 * intervals.c: Change all users to eassert.
9248
9249 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9250
9251 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9252 Rename fields to match removal of FGET and WGET and disuse of
9253 INTERNAL_FIELD in Lisp_Cons.
9254
9255 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9256
9257 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9258 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9259 name since all xname users are fixed long time ago. Do not
9260 use INTERNAL_FIELD.
9261 (set_symbol_name, set_symbol_function, set_symbol_plist):
9262 (set_symbol_next, set_overlay_plist): New function.
9263 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9264 (struct Lisp_Overlay): Likewise.
9265 (CVAR, MVAR, SVAR): Remove.
9266 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9267 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9268 * xterm.c: Adjust users.
9269 * .gdbinit: Change to use name field of struct Lisp_Symbol
9270 where appropriate.
9271
9272 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9273
9274 Basic functions to set Lisp_Object and pointer slots of intervals.
9275 * intervals.h (interval_set_parent, interval_set_object):
9276 (interval_set_left, interval_set_right, interval_set_plist):
9277 (interval_copy_parent): New function.
9278 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9279 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9280 Adjust indentation.
9281 (INTERVAL_SIZE): Remove. Adjust users.
9282 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9283
9284 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9285
9286 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9287 * process.h (PGET): Remove.
9288 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9289 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9290
9291 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9292
9293 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9294 * window.h (WGET): Remove.
9295 (struct window): Do not use INTERNAL_FIELD.
9296 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9297 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9298 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9299 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9300 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9301 Adjust users.
9302
9303 2012-08-07 Chong Yidong <cyd@gnu.org>
9304
9305 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9306 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9307 (Fdelete_window_internal): Signal an error if the window is not on
9308 a live frame (Bug#12025).
9309
9310 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9311
9312 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9313 * frame.h (FGET): Remove.
9314 (struct frame): Do not use INTERNAL_FIELD.
9315 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9316 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9317 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9318 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9319
9320 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9321
9322 * w32.c: Silence compiler warnings.
9323 (map_w32_filename): Remove unused variable `is_fat'.
9324 (chase_symlinks): Add parentheses around expression.
9325
9326 2012-08-06 Glenn Morris <rgm@gnu.org>
9327
9328 * sysdep.c: Respect BROKEN_GETWD.
9329
9330 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9331 Let configure handle it.
9332 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9333
9334 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9335
9336 Use GCALIGNMENT where appropriate.
9337 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9338 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9339 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9340
9341 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9342
9343 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9344 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9345
9346 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9347
9348 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9349 that should be sufficient for everyone.
9350
9351 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9352
9353 * keyboard.c (timer_check_2): Add break so timer_check returns next
9354 timeout.
9355
9356 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9357
9358 Fix Windows build errors introduced after converting to WGET and WSET.
9359 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9360 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9361
9362 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9363
9364 * nsterm.m (ns_frame_rehighlight): Use FSET.
9365
9366 * nsmenu.m (ns_update_menubar): Use FSET.
9367
9368 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9369
9370 Separate read and write access to Lisp_Object slots of Lisp_Process.
9371 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9372 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9373
9374 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9375
9376 Separate read and write access to Lisp_Object slots of struct window.
9377 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9378 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9379 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9380 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9381 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9382 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9383 Adjust users.
9384
9385 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9386
9387 Fix Windows build errors introduced after converting to FGET and FSET.
9388 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9389 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9390 (w32_judge_scroll_bars): Change to use FSET.
9391 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9392
9393 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9394
9395 Fix replacement typo.
9396 * window.c (replace_window): Set root_window instead of
9397 selected_window. This fixes a total window subsystem
9398 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9399
9400 2012-08-06 Glenn Morris <rgm@gnu.org>
9401
9402 * lisp.mk (lisp): Add language/persian.elc.
9403
9404 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9405
9406 Separate read and write access to Lisp_Object slots of struct frame.
9407 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9408 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9409 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9410 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9411 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9412
9413 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9414
9415 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9416
9417 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9418
9419 Generalize common compile-time constants.
9420 * lisp.h (header_size, bool_header_size, word_size): Now here.
9421 (struct Lisp_Vector): Add comment.
9422 (struct Lisp_Bool_Vector): Move up to define handy constants.
9423 (VECSIZE, PSEUDOVECSIZE): Simplify.
9424 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9425 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9426 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9427 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9428 * xfont.c, xmenu.c: Use word_size where appropriate.
9429
9430 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9431
9432 * search.c (Freplace_match): Treat \? in the replacement text
9433 literally (Bug#8161).
9434
9435 2012-08-05 Chong Yidong <cyd@gnu.org>
9436
9437 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9438 * frame.c (Vdelete_frame_functions):
9439 * emacs.c (Vkill_emacs_hook): Doc fix.
9440
9441 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9442
9443 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9444 --with-x-toolkit=no builds.
9445 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9446
9447 2012-08-04 Chong Yidong <cyd@gnu.org>
9448
9449 * syntax.c (Fmodify_syntax_entry): Doc fix.
9450
9451 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9452
9453 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9454 * w32.c (init_environment): Change the default values of many
9455 environment variables in dflt_envvars[] to NULL, to avoid pushing
9456 them into environment when they were not already defined.
9457 Remove the code that deletes site-lisp subdirectories from the default
9458 value of EMACSLOADPATH, as it is no longer needed.
9459 (check_windows_init_file): Now external, not static.
9460 Use Vload_path as is, without adding anything, as this function is now
9461 called when Vload_path is already set up.
9462
9463 * w32.h (check_windows_init_file): Add prototype.
9464
9465 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9466 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9467 compatibility with Posix platforms.
9468 (main): Move the call to check_windows_init_file to here from
9469 w32.c.
9470 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9471 any, in the DEFALT argument into the root of the Emacs build or
9472 installation tree, as appropriate.
9473
9474 * callproc.c (init_callproc_1): Call decode_env_path instead of
9475 doing its equivalent by hand.
9476 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9477 the code that sets Vexec_path run on MS-Windows.
9478
9479 * lread.c (init_lread): Add comments to #ifdef's.
9480
9481 * msdos.c (dos_set_window_size, IT_update_begin)
9482 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9483 instead of direct references.
9484
9485 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9486
9487 Export DEFAULT_REHASH_* to GDB.
9488 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9489 Now constants, not macros.
9490
9491 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 Remove unnecessary casts involving pointers.
9494 These casts are no longer needed now that we assume C89 or later,
9495 since they involve casting to or from void *.
9496 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9497 (make_pure_float, make_pure_vector):
9498 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9499 * macros.c (Fstart_kbd_macro):
9500 * menu.c (find_and_return_menu_selection):
9501 * minibuf.c (read_minibuf_noninteractive):
9502 * sysdep.c (closedir):
9503 * xdisp.c (x_produce_glyphs):
9504 * xfaces.c (compare_fonts_by_sort_order):
9505 * xfns.c (x_real_positions, select_visual):
9506 * xselect.c (x_stop_queuing_selection_requests)
9507 (x_get_window_property, x_get_window_property_as_lisp_data):
9508 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9509 Remove unnecessary pointer casts.
9510 * alloc.c (record_xmalloc): New function.
9511 * lisp.h (record_xmalloc): New decl.
9512 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9513 more like a function. This is because the pointer cast is not
9514 needed. All uses changed.
9515 * print.c (print_string, print_error_message): Avoid length recalc.
9516
9517 Improve fix for macroexp crash with debugging (Bug#12118).
9518 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9519 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9520 not supposed to be invoked from the garbage collector.
9521 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9522 (gc_aset): New function, which is like ASET but can be
9523 used in the garbage collector.
9524 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9525 (set_hash_index): Use it instead of ASET.
9526
9527 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9528
9529 Support symlinks on latest versions of MS-Windows.
9530 * w32.c: Include winioctl.h and aclapi.h.
9531 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9532 (revert_to_self): Forward declarations of static functions.
9533 <static BOOL g_b_init_get_security_info>:
9534 <g_b_init_create_symbolic_link>: New static flags.
9535 (globals_of_w32): Initialize them to zero.
9536 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9537 (map_w32_filename): Improve commentary. Simplify switch.
9538 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9539 headers (most versions of MinGW w32api don't).
9540 (get_security_info, create_symbolic_link)
9541 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9542 New functions.
9543 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9544 in the argument file name.
9545 (sys_access): Call unc_volume_file_attributes only if
9546 GetFileAttributes fails with network-related error codes.
9547 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9548 have the required privileges.
9549 (get_file_security_desc_by_name): Rename from
9550 get_file_security_desc.
9551 (stat_worker): New function, with most of the guts of 'stat', and
9552 with addition of handling of symlinks and support for 'lstat'.
9553 If possible, get file's attributes and security information by
9554 handle, not by name. Produce S_IFLNK bit for symlinks, when
9555 called from 'lstat'.
9556 (stat, lstat): New functions, call 'stat_worker'.
9557 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9558 symlinks when the underlying filesystem supports them.
9559
9560 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9561
9562 Fix macroexp crash on Windows with debugging (Bug#12118).
9563 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9564 checking subscripts; problem introduced with the recent
9565 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9566 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9567 since it's used in non-static inline functions now.
9568
9569 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9570 Don't assume buffer size fits in 'int'. Remove unused local.
9571
9572 Use C99-style 'extern inline' if available.
9573 * buffer.h (BUFFER_INLINE):
9574 * category.h (CATEGORY_INLINE):
9575 * character.h (CHARACTER_INLINE):
9576 * charset.h (CHARSET_INLINE):
9577 * composite.h (COMPOSITE_INLINE):
9578 * dispextern.h (DISPEXTERN_INLINE):
9579 * lisp.h (LISP_INLINE):
9580 * systime.h (SYSTIME_INLINE):
9581 New macro, replacing 'static inline' in this header.
9582 * buffer.h, category.h, character.h, charset.h, composite.h:
9583 * dispextern.h, lisp.h, systime.h:
9584 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9585 * alloc.c (LISP_INLINE):
9586 * buffer.c (BUFFER_INLINE):
9587 * category.c (CATEGORY_INLINE):
9588 * character.c (CHARACTER_INLINE):
9589 * charset.c (CHARSET_INLINE):
9590 * composite.c (COMPOSITE_INLINE):
9591 * dispnew.c (DISPEXTERN_INLINE):
9592 * sysdep.c (SYSTIME_INLINE):
9593 Define to EXTERN_INLINE, so that the corresponding functions
9594 are compiled into code.
9595 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9596 (INLINE_HEADER_END): New macros.
9597 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9598 since it's used in non-static inline functions now.
9599 (VALMASK) [!USE_LSB_TAG]: Likewise.
9600
9601 2012-08-02 Glenn Morris <rgm@gnu.org>
9602
9603 * s/: Remove empty directory.
9604
9605 * s/ms-w32.h: Move to ../nt/inc.
9606 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9607 Update for new ms-w32.h location.
9608
9609 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9610
9611 Port to Solaris 8.
9612 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9613
9614 2012-08-02 Glenn Morris <rgm@gnu.org>
9615
9616 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9617 hard-coding the path separator.
9618
9619 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9620
9621 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9622 This how ASET and AREF are supposed to work, and makes
9623 it easier to think about future improvements. See
9624 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9625 * charset.h (set_charset_attr): New function.
9626 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9627 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9628 (aref_addr): New function. All uses of &AREF(...) changed.
9629 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9630 (set_hash_index): New functions. All lvalue-style uses of
9631 HASH_KEY etc. changed.
9632 * keyboard.c (set_prop): New function. All lvalue-style uses
9633 of PROP changed.
9634
9635 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9636
9637 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9638 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9639 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9640 * nsfns.m (ns_set_name_as_filename): Likewise.
9641 * nsmenu.m (ns_update_menubar): Likewise.
9642 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9643
9644 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9645
9646 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9647 Adapt to latest changes in field names of the corresponding Lisp
9648 objects.
9649
9650 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9651
9652 2012-08-01 Glenn Morris <rgm@gnu.org>
9653
9654 * s/msdos.h: Remove file.
9655 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9656 * Makefile.in (S_FILE): Remove.
9657 (config_h): Remove S_FILE.
9658
9659 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9660
9661 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9662 Remove; moved to nt/config.nt.
9663
9664 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9665
9666 Use INTERNAL_FIELD for conses and overlays.
9667 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9668 Remove obsolete comment.
9669 (MVAR): New macro.
9670 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9671 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9672
9673 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9674
9675 Use INTERNAL_FIELD for symbols.
9676 * lisp.h (SVAR): New macro. Adjust users.
9677 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9678 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9679
9680 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9681
9682 Use INTERNAL_FIELD for processes.
9683 * process.h (PVAR): New macro. Adjust style.
9684 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9685 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9686
9687 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9688
9689 Use INTERNAL_FIELD for windows.
9690 * window.h (WVAR): New macro.
9691 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9692 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9693 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9694 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9695 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9696 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9697
9698 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9701
9702 2012-08-01 Glenn Morris <rgm@gnu.org>
9703
9704 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9705 Move to configure.ac.
9706
9707 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9708
9709 * makefile.w32-in (CONFIG_H): Update dependencies.
9710 (CONF_POST_H): New macro.
9711
9712 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9713
9714 2012-07-31 Glenn Morris <rgm@gnu.org>
9715
9716 * Makefile.in (S_FILE): No longer set by configure.
9717
9718 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9719 is available.
9720 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9721
9722 * process.h (NULL_DEVICE):
9723 * emacs.c (SEPCHAR):
9724 * editfns.c (USER_FULL_NAME): Let configure set them.
9725
9726 * s/README, s/template.h: Remove files.
9727
9728 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9729
9730 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9731 Move to configure.ac.
9732
9733 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9734
9735 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9736 resulting renaming of 'struct frame' members.
9737
9738 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9739
9740 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9741 after introduction of FVAR.
9742
9743 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9744
9745 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9746
9747 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9748 instead of compositeToPoint.
9749 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9750
9751 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9752
9753 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9754
9755 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9756 * lisp.h (INTERNAL_FIELD): New macro.
9757 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9758 (BVAR): Change to use INTERNAL_FIELD.
9759 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9760 (KVAR): Change to use INTERNAL_FIELD.
9761 * frame.h (FVAR): New macro.
9762 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9763 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9764 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9765 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9766 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9767
9768 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9769
9770 Miscellaneous fixes for non-default X toolkits.
9771 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9772 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9773 Move under #ifdef USE_LUCID.
9774 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9775 definition and usage to avoid warnings.
9776
9777 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9778
9779 * nsterm.m (openFiles): Fix previous checkin.
9780
9781 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9782
9783 * indent.c (compute_motion): Remove unused local.
9784
9785 2012-07-31 Glenn Morris <rgm@gnu.org>
9786
9787 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9788
9789 * conf_post.h [USG5_4]:
9790 Move remaining contents of s/usg5-4-common.h here.
9791 * s/usg5-4-common.h: Remove file.
9792
9793 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9794 * s/irix6-5.h: Remove file.
9795
9796 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9797 * s/darwin.h: Remove file.
9798
9799 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9800 * s/hpux10-20.h: Remove file, which is now empty.
9801
9802 2012-07-30 Glenn Morris <rgm@gnu.org>
9803
9804 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9805 * Makefile.in (config_h): Add conf_post.h.
9806 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9807
9808 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9809
9810 * nsterm.m (ns_do_open_file): New variable.
9811 (ns_term_init): Set ns_do_open_file to YES after run returns.
9812 (openFile, openTempFile, openFileWithoutUI, openFiles):
9813 Open files only if ns_do_open_file.
9814
9815 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9816
9817 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9818 This no-op macro hasn't been needed for many years.
9819 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9820
9821 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9822 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9823 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9824 gdb_make_enums_visible.
9825 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9826 (DIRECTORY_SEP): Now a constant, not a macro.
9827
9828 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9829
9830 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9831 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9832
9833 * w32term.c <w32_keyboard_codepage>: Renamed from
9834 keyboard_codepage and now external. All users changed.
9835
9836 * w32term.h: Add declaration of w32_keyboard_codepage.
9837
9838 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9839 the codepage to translate keys to Unicode. If this argument is
9840 -1, use the value returned by GetConsoleCP. All callers changed.
9841
9842 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9843
9844 Update .PHONY listings in makefiles.
9845 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9846 bootstrap-clean, distclean, maintainer-clean, versioclean,
9847 extraclean, frc.
9848
9849 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9850 This is a bit clearer. Fix some commentary typos.
9851
9852 2012-07-30 Glenn Morris <rgm@gnu.org>
9853
9854 * s/netbsd.h: Let configure include signal.h if needed.
9855 Remove file, which is now empty.
9856
9857 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9858 Let configure set them.
9859 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9860 No more need to undefine.
9861
9862 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9863
9864 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9865 non-single-byte char when adding meta modifier. (Bug#12090)
9866
9867 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9868
9869 Convert safe_call to use variable number of arguments.
9870 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9871 (safe_call2): Fix comment.
9872 * lisp.h (safe_call): Adjust prototype.
9873 * coding.c (encode_coding_object): Change to use safe_call2.
9874 * xfaces.c (merge_face_heights): Change to use safe_call1.
9875
9876 2012-07-30 Glenn Morris <rgm@gnu.org>
9877
9878 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9879 does that unconditionally. Remove file, which is now empty.
9880
9881 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9882 Remove empty files.
9883
9884 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9885
9886 Export to GDB most of lisp.h's remaining object-like macros.
9887 * lisp.h (min, max): Move earlier, because they're used earlier now.
9888 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9889 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9890 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9891 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9892 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9893 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9894 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9895 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9896 Now constants, for GDB. They need not be macros.
9897 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9898 Now constants, for GDB, as well as macros, for static initializers.
9899 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9900 Move to after the definition of struct Lisp_Char_Table,
9901 since the former now needs that type defined.
9902 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9903 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9904 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9905 New enums, for gdb_make_enums_visible.
9906 (GLYPH_MODE_LINE_FACE): Remove; unused.
9907 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9908 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9909 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9910 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9911 enum maxargs, enum MAX_ALLOCA.
9912 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9913 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9914 no longer needed, now that they are done in lisp.h.
9915
9916 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9917
9918 Cleanup string bytes checking.
9919 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9920 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9921 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9922 (check_sblock, compact_small_strings): Simplify.
9923
9924 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9925
9926 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9927 These macros are confusing and no longer need to be defined, as
9928 the enum values now suffice. All uses replaced with definiens.
9929 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9930
9931 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9932
9933 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9934 ($(BLD)/w32console.$(O)): Update dependencies.
9935
9936 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9937
9938 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9939 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9940 time. Adjust users.
9941 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9942
9943 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9944
9945 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9946 setting sitelisp (Bug#12010).
9947
9948 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9949
9950 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9951
9952 * w32heap.c (cache_system_info):
9953 * w32.c (sys_rename):
9954 * w32proc.c (find_child_console, sys_kill): All users changed.
9955
9956 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9957
9958 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9959
9960 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9961
9962 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9963
9964 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9965
9966 Cleanup statistics calculation in Fgarbage_collect.
9967 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9968 Fix zombies percentage calculation. Simplify elapsed time calculation.
9969
9970 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9971
9972 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9973 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9974 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9975 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9976 (replace_range, replace_range_2, del_range_2): Change to eassert.
9977 * marker.c (byte_char_debug_check): Adjust style.
9978
9979 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9980
9981 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9982 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9983 long-ago-commented-out code that talks about "WIN32".
9984 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9985 All uses changed.
9986
9987 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9988
9989 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9990 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9991 Simplify by using alignof.
9992 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9993 * lisp.h: Include <stdalign.h>.
9994 (GCALIGNMENT): New macro and constant.
9995 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9996 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9997 (stdalign): New macro, if not already defined.
9998
9999 2012-07-28 Eli Zaretskii <eliz@gnu.org>
10000
10001 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10002 * w32inevt.c: Include w32inevt.h.
10003 (w32_read_console_input): New inline function, calls either
10004 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10005 w32_console_unicode_input.
10006 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10007 (w32_kbd_patch_key, key_event): Use the codepage returned by
10008 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10009 (key_event): use uChar.UnicodeChar only if
10010 w32_console_unicode_input is non-zero.
10011
10012 * w32console.c: Include w32heap.h.
10013 <w32_console_unicode_input>: New global variable.
10014 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10015 family of Windows, zero otherwise.
10016
10017 * w32inevt.h: Declare w32_console_unicode_input.
10018
10019 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10020 --without-x. (Bug#11742)
10021
10022 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10023
10024 Adjust GDB to reflect pvec_type changes (Bug#12036).
10025 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10026 2012-07-04 changes to pseudovector representation.
10027 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10028
10029 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
10030
10031 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10032 bus address.
10033 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10034
10035 2012-07-27 Eli Zaretskii <eliz@gnu.org>
10036
10037 * alloc.c (listn): Fix the order the arguments are consed onto the
10038 list.
10039
10040 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10041 enumeration constants, as PURE and HEAP are too general, and clash
10042 with other headers and sources, such as gmalloc.c and the
10043 MS-Windows system headers. All users changed.
10044
10045 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10046
10047 Revert last save_excursion_save and save_excursion_restore changes.
10048 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10049 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10050
10051 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10052
10053 Fix recently-introduced typos in Windows port.
10054 Reported by Martin Rudalics <rudalics@gmx.at>.
10055 * w32.c (init_environment): Replace comma with semicolon.
10056 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10057
10058 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10059
10060 Improve GDB symbol export (Bug#12036).
10061 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10062 arms of an 'if', not using conditional expressions; otherwise GDB
10063 complains about the types in the unevaluated arm when the argument
10064 is an integer literal.
10065 (xgetint): Simplify expression.
10066 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10067 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10068 Zaretskii in <http://bugs.gnu.org/12036#13>.
10069 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10070 needed now that we have gdb_make_enums_visible.
10071 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10072 (enum enum_USE_LSB_TAG):
10073 New enum types, packaging up enums that need to be exported to GDB.
10074
10075 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10076
10077 Utility function to make a list from specified amount of objects.
10078 * lisp.h (enum constype): New datatype.
10079 (listn): New prototype.
10080 * alloc.c (listn): New function.
10081 (Fmemory_use_count, syms_of_alloc): Use it.
10082 * buffer.c (syms_of_buffer): Likewise.
10083 * callint.c (syms_of_callint): Likewise.
10084 * charset.c (define_charset_internal): Likewise.
10085 * coding.c (syms_of_coding): Likewise.
10086 * keymap.c (syms_of_keymap): Likewise.
10087 * search.c (syms_of_search): Likewise.
10088 * syntax.c (syms_of_syntax): Likewise.
10089 * w32.c (init_environment): Likewise.
10090 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10091 * xdisp.c (syms_of_xdisp): Likewise.
10092 * xfns.c (syms_of_xfns): Likewise.
10093
10094 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10095
10096 Fast save_excursion_save and save_excursion_restore.
10097 * lisp.h (struct Lisp_Excursion): New data type.
10098 (PVEC_EXCURSION): New pseudovector type.
10099 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10100 to deal with it. Adjust comments.
10101 (init_marker, attach_marker): New prototype.
10102 (unchain_marker): Adjust prototype.
10103 * marker.c (attach_marker): Change to global.
10104 (init_marker): New function.
10105 * alloc.c (Fmake_marker, build_marker): Use it.
10106 (build_marker): More easserts.
10107 (mark_object): Handle struct Lisp_Excursion.
10108 * editfns.c (save_excursion_save, save_excursion_restore):
10109 Reimplement to use struct Lisp_Excursion. Add comments.
10110
10111 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10112
10113 Fix export of symbols to GDB (Bug#12036).
10114 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10115 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10116 emacs.c, as this is a more-suitable home. Had this been done earlier
10117 the fix for 12036 would have avoided some of the problems noted in
10118 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10119 would have been more obvious.
10120 * emacs.c: Do not include <verify.h>; no longer needed.
10121 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10122 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10123 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10124 Remove; now done in lisp.h.
10125 * lisp.h (PUBLISH_TO_GDB): New macro.
10126 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10127 (DATA_SEG_BITS): Use it.
10128 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10129 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10130 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10131 not be usable in #if. This simplifies things.
10132
10133 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
10134
10135 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10136
10137 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10138
10139 Simplify export of symbols to GDB (Bug#12036).
10140 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10141 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10142 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10143 Adjust to changes in lisp.h and emacs.c, by using
10144 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10145 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10146 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10147 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10148 instead of gdb_valbits.
10149 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10150 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10151 instead of gdb_array_mark_flag.
10152 (xboolvector): Get size from $->size, not $->header.size.
10153 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10154 (xreload, hook-run, hookpost-run): Remove.
10155 * emacs.c: Include <verify.h>.
10156 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10157 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10158 Remove.
10159 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10160 (gdb_USE_LSB_TAG): New enum constants.
10161 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10162 Also define these as enum constants, so they're visible to GDB.
10163 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10164 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10165 as constants, so they're visible to GDB.
10166 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10167 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10168 Now enum constants, not macros, so they're visible to GDB.
10169 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10170 more convenient now. All uses changed.
10171 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10172 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10173
10174 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10175
10176 Explicitly free restriction data that are not needed anymore.
10177 * editfns.c (save_restriction_restore): Free restriction data.
10178
10179 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10180
10181 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10182 add argument, tune behavior, and adjust all callers.
10183
10184 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10185
10186 Use typedef for EMACS_INT, EMACS_UINT.
10187 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10188 than macros. This simplifies debugging in the usual case, since
10189 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10190 and it allows expressions involving EMACS_INT casts.
10191 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10192
10193 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10194
10195 * nsterm.m (ns_read_socket): Return early if there is a modal
10196 window (Bug#12043).
10197
10198 2012-07-25 Martin Rudalics <rudalics@gmx.at>
10199
10200 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10201 that FOCUS-FRAME can be omitted.
10202
10203 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10204
10205 Adjust buffer text indirection counters at the end of Fkill_buffer.
10206 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10207 buffer is definitely dead. This should really fix an issue reported
10208 by Christoph Scholtes again. (Bug#12007).
10209 (init_buffer_once): Initialize indirection counters of
10210 buffer_defaults and buffer_local_symbols (for sanity and safety).
10211
10212 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10213
10214 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10215 and continuation glyphs on tooltip frames, leave them at zero.
10216 Avoids continued lines in tooltips. (Bug#11832)
10217
10218 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10219
10220 Simplify copy_overlay.
10221 * buffer.c (copy_overlay): Simplify. Use build_marker.
10222 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10223
10224 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10225
10226 * print.c (print_object): Don't crash when a frame's name is nil
10227 or invalid. (Bug#12025)
10228
10229 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10230 it signals an error when a tooltip frame is being created.
10231
10232 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10233
10234 Cleanup miscellaneous objects allocation and initialization.
10235 * alloc.c (allocate_misc): Change to static. Add argument to
10236 specify the subtype. Adjust comment and users.
10237 (build_overlay): New function.
10238 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10239 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10240 (allocate_misc): Remove prototype.
10241 (build_overlay): Add prototype.
10242
10243 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10244
10245 Swap buffer text indirection counters in Fbuffer_swap_text.
10246 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10247 This avoids crash reported by Christoph Scholtes at
10248 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10249
10250 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10251
10252 * nsmenu.m (Popdown_data): New struct.
10253 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10254 free Popdown_data.
10255 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10256 (initWithContentRect): Make imgView and contentView non-static
10257 and autorelease them. Also autorelease img and matrix (Bug#12005).
10258 (dealloc): Remove (Bug#12005).
10259
10260 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10261
10262 Adjust consing_since_gc when objects are explicitly freed.
10263 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10264 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10265 (free_cons, free_misc): Subtract object size from consing_since_gc.
10266
10267 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10268
10269 Simplify and cleanup markers positioning code.
10270 * marker.c (attach_marker): More useful eassert.
10271 (live_buffer, set_marker_internal): New function.
10272 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10273 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10274
10275 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10276
10277 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10278 as it's limited by the amount of memory, not by INT_MAX.
10279
10280 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10281
10282 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10283 in special-event-map. See the discussion at
10284 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10285 for the reasons.
10286
10287 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10288 info.dwItemData. Fixes crashes on 64-bit Windows.
10289 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10290
10291 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10292
10293 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10294 (conversationIdentifier): Return value is NSInteger.
10295 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10296
10297 2012-07-21 Chong Yidong <cyd@gnu.org>
10298
10299 * window.c (decode_any_window): Signal an error if the window is
10300 on a dead frame (Bug#11984).
10301
10302 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10303
10304 Add indirection counting to speed up Fkill_buffer.
10305 * buffer.h (struct buffer): New member.
10306 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10307 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10308 base buffer indirection counter.
10309 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10310 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10311 through buffer list if indirection counter is 0.
10312
10313 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10314
10315 Extend the value returned by Fgarbage_collect with heap statistics.
10316 * alloc.c (Qheap): New symbol.
10317 (syms_of_alloc): DEFSYM it.
10318 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10319 (Fmemory_free): Remove.
10320 (syms_of_alloc): Don't defsubr it.
10321 * buffer.c (Fcompact_buffer): Remove.
10322 (syms_of_buffer): Don't defsubr it.
10323
10324 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10325
10326 Make maybe_gc inline.
10327 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10328 * lisp.h (consing_since_gc, gc_relative_threshold)
10329 (memory_full_cons_threshold): Revert declaration.
10330 (maybe_gc): Remove prototype, define as inline.
10331 * alloc.c: Remove old commented-out code.
10332 (consing_since_gc, gc_relative_threshold)
10333 (memory_full_cons_threshold): Revert to global.
10334 (maybe_gc): Remove.
10335
10336 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10337
10338 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10339 * lisp.h (build_unibyte_string): New function.
10340 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10341 * sysdep.c, w32fns.c, xfns.c: Use it.
10342 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10343 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10344 Adjust users accordingly.
10345 * font.h (font_open_by_name): Adjust prototype.
10346
10347 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10348
10349 Cleanup calls to Fgarbage_collect.
10350 * lisp.h (maybe_gc): New prototype.
10351 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10352 Remove declarations.
10353 * alloc.c (maybe_gc): New function.
10354 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10355 Make them static.
10356 * bytecode.c (MAYBE_GC): Use maybe_gc.
10357 * eval.c (eval_sub, Ffuncall): Likewise.
10358 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10359 to avoid dependency from auto-save feature.
10360
10361 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10362
10363 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10364 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10365 'for_each_per_buffer_object_at'.
10366 All uses changed. It's better to use upper-case for macros that
10367 cannot be implemented as functions, to give the reader a clue
10368 that they're special.
10369
10370 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10371
10372 * alloc.c (Fgarbage_collect): Tweak docstring.
10373
10374 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10375
10376 Tweak the value returned from Fgarbage_collect again.
10377 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10378 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10379 Adjust documentation.
10380 (total_vector_bytes): Rename to total_vector_slots, adjust
10381 accounting.
10382 (total_free_vector_bytes): Rename to total_free_vector_slots,
10383 adjust accounting.
10384 (Qstring_bytes, Qvector_slots): New symbols.
10385 (syms_of_alloc): DEFSYM them.
10386
10387 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10388
10389 Buffer compaction primitive which may be used from Lisp.
10390 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10391 (syms_of_buffer): Register Fcompact_buffer.
10392 * alloc.c (Fgarbage_collect): Use compact_buffer.
10393 * buffer.h (compact_buffer): New prototype.
10394 (struct buffer_text): New member.
10395
10396 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10397
10398 New macro to iterate over all buffers, miscellaneous cleanups.
10399 * lisp.h (all_buffers): Remove declaration.
10400 * buffer.h (all_buffers): Add declaration, with comment.
10401 (for_each_buffer): New macro.
10402 * alloc.c (Fgarbage_collect, mark_object): Use it.
10403 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10404 (init_buffer): Likewise.
10405 * data.c (Fset_default): Likewise.
10406 * coding.c (code_conversion_restore): Remove redundant check
10407 for dead buffer.
10408 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10409
10410 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10411
10412 Fix bug that created negative-length intervals.
10413 * intervals.c (merge_interval_right, merge_interval_left):
10414 Do not zero out this interval if it is absorbed by its children,
10415 as this interval's total length doesn't change in that case. See
10416 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10417
10418 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10419
10420 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10421 when invoking (make-bool-vector N t) and N is a positive
10422 multiple of 8 -- the last 8 bits were mistakenly cleared.
10423
10424 Remove some struct layout assumptions in bool vectors.
10425 * alloc.c (bool_header_size): New constant.
10426 (header_size, word_size): Move earlier, as they're now used earlier.
10427 Use 'word_size' in a few more places, where it's appropriate.
10428 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10429 padding before the data member of a bool vector.
10430 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10431 than doing the check by hand with an abort ().
10432
10433 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10434
10435 * eval.c (Fdefvar): Don't check constants since we only set the var if
10436 it's not yet defined anyway (bug#11904).
10437
10438 * lisp.h (last_undo_boundary): Declare new var.
10439 * keyboard.c (command_loop_1): Set it.
10440 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10441 were auto-added by the command loop (bug#11774).
10442
10443 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10444
10445 * w32font.c (Qsymbol): Remove local definition.
10446 (syms_of_w32font): Don't DEFSYM it.
10447
10448 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10449
10450 Fix sweep_vectors to handle large bool vectors correctly.
10451 * alloc.c (sweep_vectors): Account total_vector_bytes for
10452 bool vectors larger than VBLOCK_BYTES_MAX.
10453
10454 2012-07-18 Chong Yidong <cyd@gnu.org>
10455
10456 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10457 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10458
10459 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10460
10461 Return more descriptive data from Fgarbage_collect.
10462 Suggested by Stefan Monnier in
10463 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10464 * alloc.c (bounded_number): New function.
10465 (total_buffers, total_vectors): New variable.
10466 (total_string_size): Rename to total_string_bytes, adjust users.
10467 (total_vector_size): Rename to total_vector_bytes, adjust users.
10468 (sweep_vectors): Account total_vectors and total_vector_bytes.
10469 (Fgarbage_collect): New return value. Adjust documentation.
10470 (gc_sweep): Account total_buffers.
10471 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10472 (VECTOR_SIZE): Remove.
10473 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10474 (Qinterval, Qmisc): New symbols.
10475 (syms_of_data): Initialize them.
10476 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10477 (Qcons, Qbuffer): New declarations.
10478
10479 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10480
10481 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10482 Round up, not down. Improve doc.
10483
10484 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10485
10486 Restore old code in allocate_string_data to avoid Faset breakage.
10487 Reported by Julien Danjou <julien@danjou.info> in
10488 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10489 * alloc.c (allocate_string_data): Restore old code with minor
10490 adjustments, fix comment to explain this subtle issue.
10491
10492 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10493
10494 Remove FILE_SYSTEM_CASE.
10495 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10496
10497 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10498 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10499 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10500 call-process-region passes it through expand-file-name.
10501
10502 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10503
10504 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10505
10506 Fix crash when creating indirect buffer (Bug#11917)
10507 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10508 Don't handle unbound variables specially if non-zero.
10509 (Fbuffer_local_variables): Pass zero.
10510 (clone_per_buffer_values): Pass non-zero.
10511
10512 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10513
10514 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10515 to make the loop interruptible.
10516
10517 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10518
10519 * gnutls.c (emacs_gnutls_handshake): Only retry if
10520 GNUTLS_E_INTERRUPTED.
10521
10522 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10523
10524 Cleanup and convert miscellaneous checks to eassert.
10525 * alloc.c (mark_interval): Fix comment, partially rephrase
10526 old comment from intervals.h (see below).
10527 * intervals.c (find_interval, adjust_intervals_for_insertion)
10528 (delete_interval, adjust_intervals_for_deletion)
10529 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10530 Convert to eassert.
10531 (adjust_intervals_for_insertion, make_new_interval):
10532 Remove obsolete and unused code.
10533 * intervals.h (struct interval): Remove obsolete comment.
10534 * textprotp.c (erase_properties): Remove unused code.
10535 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10536 (Fremove_list_of_text_properties): Convert to eassert.
10537
10538 2012-07-17 Chong Yidong <cyd@gnu.org>
10539
10540 * editfns.c (Finsert_char): Doc fix.
10541
10542 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10543
10544 Fix previous change to make Fmemory_free always accurate.
10545 * alloc.c (make_interval): Update total_free_intervals.
10546 (make_float): Likewise for total_free_floats.
10547 (free_cons, Fcons): Likewise for total_free_conses.
10548 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10549 Likewise for total_free_vector_bytes.
10550 (Fmake_symbol): Likewise for total_free_symbols.
10551 (bytes_free): Remove.
10552
10553 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10554
10555 Simple free memory accounting feature.
10556 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10557 (sweep_vectors): Accumulate size of free vectors.
10558 (Fgarbage_collect): Setup bytes_free.
10559 (Fmemory_free): New function.
10560 (syms_of_alloc): Register it.
10561
10562 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10563
10564 Cleanup overlays checking.
10565 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10566 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10567 eassert and OVERLAYP.
10568 (sort_overlays): Change to use OVERLAYP.
10569
10570 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10571
10572 * editfns.c (Finsert_char): Make it interactive, and make the
10573 second arg optional. Copy interactive spec and docstring from
10574 ucs-insert.
10575
10576 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10577
10578 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10579 Unlike the other wrapped functions, fabs has an unspecified
10580 effect on errno.
10581
10582 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10583
10584 * nsterm.m (keyDown): Interpret flags without left/right bits
10585 as the left key (Bug#11670).
10586
10587 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10588
10589 Remove empty and useless init functions.
10590 * lisp.h (init_character_once, init_fns, init_image)
10591 (init_filelock, init_sound): Remove prototype.
10592 * character.c (init_character_once): Remove.
10593 * filelock.c (init_filelock): Likewise.
10594 * fns.c (init_fns): Likewise.
10595 * image.c (init_image): Likewise.
10596 * sound.c (init_sound): Likewise.
10597 * emacs.c (main): Adjust accordingly.
10598
10599 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10600
10601 * gtkutil.h: Tiny cleanups.
10602 (use_old_gtk_file_dialog): Remove useless declaration.
10603 (xg_uses_old_file_dialog): Add suggested const attribute.
10604
10605 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10606
10607 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10608 (bidi_paragraph_init): Use it to limit search forward for a strong
10609 directional character in abnormally large paragraphs full of
10610 neutral or weak characters. (Bug#11943)
10611
10612 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10613
10614 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10615 the toolbar (Bug#9451).
10616 (xg_make_tool_item): Give the widget event box a transparent
10617 background.
10618
10619 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10620
10621 Cleanup basic allocation variables and functions.
10622 * alloc.c (ignore_warnings, init_intervals, init_float)
10623 (init_cons, init_symbol, init_marker): Remove.
10624 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10625 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10626 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10627 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10628 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10629 (staticidx, init_alloc_once, init_strings, free_ablock):
10630 Remove redundant initialization.
10631 * fns.c (init_weak_hash_tables): Remove.
10632 * lisp.h (init_weak_hash_tables): Remove prototype.
10633
10634 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10635
10636 Use zero_vector where appropriate.
10637 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10638 accordingly.
10639 * lisp.h (zero_vector): New declaration.
10640 * font.c (null_vector): Remove.
10641 (syms_of_font): Remove initialization and staticpro.
10642 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10643 * keymap.c (Faccessible_keymaps): Likewise.
10644
10645 2012-07-15 Leo Liu <sdl.web@gmail.com>
10646
10647 * fringe.c: Fix typo in comments.
10648
10649 2012-07-14 Leo Liu <sdl.web@gmail.com>
10650
10651 * fringe.c: Add a new bitmap exclamation-mark.
10652
10653 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10654
10655 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10656
10657 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10658 (HAVE_MENUS): Don't define, defined by editing config.in with
10659 msdos/sed2v2.inp.
10660 (GMALLOC_INHIBIT_VALLOC): Don't define.
10661 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10662
10663 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10664
10665 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10666
10667 2012-07-14 Glenn Morris <rgm@gnu.org>
10668
10669 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10670 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10671 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10672
10673 2012-07-13 Glenn Morris <rgm@gnu.org>
10674
10675 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10676
10677 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10678 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10679
10680 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10681
10682 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10683 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10684 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10685 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10686 where appropriate.
10687 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10688 as boolean expression.
10689 (x_set_window_size): Remove unused variable toolbar.
10690 (ns_get_color_default, ns_mod_to_lisp): Remove.
10691 (ns_mouse_position): Remove unused variables xchar and ychar.
10692 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10693 (ns_set_vertical_scroll_bar): Remove unused variable count.
10694 (ns_delete_terminal): Remove unused variable i.
10695 (ns_term_init): Remove unused variables r, g and b.
10696 (mouseDown): Remove unused variable window.
10697 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10698 (initFrameFromEmacs): Remove unused variable vbextra.
10699 (mouseEntered): Remove unused variables p and dpyinfo.
10700 (mouseExited): Remove unused variables p and r.
10701 (ns_define_frame_cursor, ns_clear_frame_area)
10702 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10703 (menuDown): Assign [sender tag] to variable and cast the variable.
10704
10705 * nsterm.h (menuDown): Add id as type to argument sender.
10706 (ns_display_info_for_name): Add Lisp_Object argument.
10707 (ns_term_init): Add Lisp_Object argument.
10708 (ns_map_event_to_object): Add void argument.
10709 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10710 prototype with arguments and only declare if __OBJC__.
10711 (nxatoms_of_nsselect): Add void argument.
10712 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10713 (ns_alloc_autorelease_pool): Add void argument.
10714 (ns_release_autorelease_pool): Add void* argument.
10715 (ns_get_defaults_value): Add const char* argument.
10716
10717 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10718 (initFromContents): Use SSDATA where appropriate.
10719 (ns_update_menubar): Add braces to ambigous if-else.
10720 (initWithTitle): Put () around assignment in if statement.
10721 (ns_menu_show): Remove unused variables window and keymap.
10722 (update_frame_tool_bar): Remove unused variable selected_p.
10723 (initWithContentRect): Remove unused variable this_cmd_name.
10724
10725 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10726 appropriate.
10727 (setXBMColor): Remove unused variable len.
10728 (setPixmapData): Put () around assignment in loop statement.
10729
10730 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10731 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10732 where appropriate.
10733 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10734 around assignment in loop statement.
10735 (nsfont_open): Remove unused variable i.
10736 (nsfont_open): Remove unused variable len.
10737 (nsfont_draw): Remove unused variable cs.
10738
10739 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10740 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10741 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10742 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10743 (Fns_font_name, Fns_perform_service)
10744 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10745 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10746 (ns_set_name): Remove unused variable view.
10747 (x_set_menu_bar_lines): Remove unused variable olines.
10748 (x_set_tool_bar_lines): Remove unused variable root_window.
10749 (Fns_list_colors): Put () around assignment in while statement.
10750 (Fns_perform_service): Remove unused variable len.
10751 (Fns_display_usable_bounds): Remove unused variable top.
10752 (syms_of_nsfns): Remove unused variable i.
10753
10754 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10755 memcpy (Bug#11907).
10756
10757 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10758
10759 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10760 and free it with DestroyExceptionInfo (Bug#11558).
10761
10762 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10763
10764 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10765 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10766 Set here, not in nt/config.nt.
10767
10768 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10769
10770 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10771 cursor overflow into the last glyph on display line when the right
10772 fringe is off. (Bug#11832)
10773
10774 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10775
10776 * xdisp.c (produce_special_glyphs): Now static.
10777 * dispextern.h (produce_special_glyphs): Remove decl.
10778
10779 2012-07-13 Glenn Morris <rgm@gnu.org>
10780
10781 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10782 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10783
10784 * s/usg5-4-common.h (USG, USG5):
10785 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10786 * s/sol2-6.h (SOLARIS2):
10787 * s/irix6-5.h (IRIX6_5):
10788 * s/hpux10-20.h (USG, USG5, HPUX):
10789 * s/gnu-linux.h (USG, GNU_LINUX):
10790 * s/freebsd.h (BSD_SYSTEM):
10791 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10792 * s/cygwin.h (CYGWIN):
10793 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10794 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10795
10796 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10797
10798 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10799
10800 2012-07-13 Glenn Morris <rgm@gnu.org>
10801
10802 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10803
10804 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10805
10806 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10807 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10808
10809 2012-07-12 Glenn Morris <rgm@gnu.org>
10810
10811 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10812
10813 * process.c (init_process_emacs): Rename from init_process.
10814 The old name is also the name of a Mach system call.
10815 * lisp.h, emacs.c: Update for this name change.
10816 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10817 longer needed.
10818
10819 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10820
10821 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10822 memmove call that removes glyphs covered by the left truncation
10823 glyph. Improve commentary.
10824 (display_line): Fix display of continuation glyphs on GUI frames
10825 when the right fringe is turned off and variable-size fonts are
10826 used in the window. Move the code that appends a stretch glyph to
10827 produce_special_glyphs, so that it could be used for truncation
10828 and continuation glyphs alike.
10829 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10830 glyph of a suitably computed width, to align the special glyphs at
10831 the window margin. Code moved from display_line. (Bug#11832)
10832
10833 2012-07-12 Glenn Morris <rgm@gnu.org>
10834
10835 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10836
10837 * s/gnu-linux.h, s/hpux10-20.h:
10838 Do not unconditionally define HAVE_XRMSETDATABASE.
10839
10840 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10841
10842 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 Fix typos that broke OS X build.
10845 Reported by Randal L. Schwartz in
10846 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10847 * nsterm.m (ns_timeout): Add missing local decl.
10848 (ns_get_color): snprintf -> sprintf, to fix typo.
10849
10850 2012-07-12 Glenn Morris <rgm@gnu.org>
10851
10852 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10853 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10854 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10855 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10856
10857 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10858 Move PTY_OPEN to configure.
10859
10860 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10861 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10862 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10863
10864 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10865
10866 Use empty_unibyte_string where applicable.
10867 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10868 * lread.c (read1): Likewise.
10869 * xsettings.c (syms_of_xsettings): Likewise.
10870
10871 2012-07-12 Glenn Morris <rgm@gnu.org>
10872
10873 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10874 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10875 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10876 * s/hpux10-20.h (RUN_TIME_REMAP):
10877 * s/bsd-common.h (TABDLY): Move to configure.
10878
10879 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10880
10881 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10882
10883 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10884 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10885
10886 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10887
10888 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10889 * s/template.h: Move NARROWPROTO to configure.
10890
10891 2012-07-11 Glenn Morris <rgm@gnu.org>
10892
10893 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10894 unused since 2011-01-17 change to systty.h.
10895
10896 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10897 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10898 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10899
10900 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10901
10902 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10903
10904 2012-07-11 Glenn Morris <rgm@gnu.org>
10905
10906 * s/darwin.h, s/gnu-linux.h, s/template.h:
10907 Move INTERRUPT_INPUT to configure.
10908
10909 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10910
10911 Minor adjustments to interning code.
10912 * lisp.h (intern, intern_c_string): Redefine as static inline
10913 wrappers for intern_1 and intern_c_string_1, respectively.
10914 (intern_1, intern_c_string_1): Rename prototypes.
10915 * lread.c (intern_1, intern_c_string_1, oblookup):
10916 Simplify Vobarray checking.
10917 * font.c (font_intern_prop): Likewise. Adjust comment.
10918 * w32font.c (intern_font_name): Likewise.
10919
10920 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10921
10922 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10923
10924 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10925 of Fcar/Fcdr if possible.
10926 * font.c (check_otf_features): Likewise.
10927 * fontset.c (Fnew_fontset): Likewise.
10928 * gnutls.c (Fgnutls_boot): Likewise.
10929 * minibuf.c (read_minibuf): Likewise.
10930 * msdos.c (IT_set_frame_parameters): Likewise.
10931 * xmenu.c (Fx_popup_dialog): Likewise.
10932 * w32menu.c (Fx_popup_dialog): Likewise.
10933
10934 2012-07-11 Glenn Morris <rgm@gnu.org>
10935
10936 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10937 since nothing has defined it on these platforms.
10938
10939 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10940 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10941
10942 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10943 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10944 Move CLASH_DETECTION to configure.
10945
10946 * s/gnu.h: Remove file, which is now empty.
10947
10948 * s/gnu.h, s/gnu-linux.h:
10949 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10950
10951 2012-07-11 John Wiegley <johnw@newartisans.com>
10952
10953 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10954 function attribute, so we only use it if it exists in the
10955 compiler.
10956
10957 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10958
10959 Avoid call to strlen in fast_c_string_match_ignore_case.
10960 * search.c (fast_c_string_match_ignore_case): Change to use
10961 length argument. Adjust users accordingly.
10962 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10963
10964 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10965
10966 Assume mkdir, rmdir.
10967 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10968 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10969
10970 Assume rename.
10971 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10972
10973 Assume perror.
10974 * s/hpux10-20.h (HAVE_PERROR): Remove.
10975 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10976 Remove dummy definition, as this problem was obsolete long ago.
10977
10978 Assume strerror.
10979 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10980
10981 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10982
10983 Avoid calls to strlen in font processing functions.
10984 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10985 (font_open_by_name): Change to use length argument.
10986 Adjust users accordingly.
10987 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10988 Adjust prototypes.
10989 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10990 Change to return ptrdiff_t.
10991 (xfont_list_pattern, xfont_match): Use length returned by
10992 xfont_decode_coding_xlfd.
10993 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10994
10995 2012-07-11 Glenn Morris <rgm@gnu.org>
10996
10997 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10998 Move DONT_REOPEN_PTY to configure.
10999
11000 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11001 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11002
11003 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11004
11005 Remove "#define unix" that is no longer needed (Bug#11905).
11006 * s/aix4-2.h (unix): Remove; no longer needed.
11007
11008 EMACS_TIME simplification (Bug#11875).
11009 This replaces macros (which typically do not work in GDB)
11010 with functions, typedefs and enums, making the code easier to debug.
11011 The functional style also makes code easier to read and maintain.
11012 * systime.h: Include <sys/time.h> on all hosts, not just if
11013 WINDOWSNT, since 'struct timeval' is needed in general.
11014 (EMACS_TIME): Now a typedef, not a macro.
11015 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11016 not macros.
11017 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11018 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11019 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11020 (EMACS_TIME_LE): Now functions, not macros.
11021 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11022 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11023 which are not functions. All uses rewritten to use:
11024 (make_emacs_time): New function.
11025 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11026 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11027 not functions. All uses rewritten to use the following, respectively:
11028 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11029 (add_emacs_time, sub_emacs_time): New functions.
11030 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11031 * fileio.c (Fcopy_file):
11032 * xterm.c (XTflash): Get the current time closer to when it's used.
11033 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11034
11035 * bytecode.c (targets): Suppress -Woverride-init warnings.
11036
11037 Simplify by avoiding confusing use of strncpy etc.
11038 * doc.c (Fsnarf_documentation):
11039 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11040 * frame.c (Fmake_terminal_frame):
11041 * gtkutil.c (get_utf8_string):
11042 * lread.c (openp):
11043 * nsmenu.m (ns_update_menubar):
11044 * regex.c (regerror):
11045 Prefer memcpy to strncpy and strncat when either will do.
11046 * fileio.c (Fsubstitute_in_file_name):
11047 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11048 (menu_separator_name_p):
11049 * nsmenu.m (ns_update_menubar):
11050 Prefer memcmp to strncmp when either will do.
11051 * nsterm.m: Include <ftoastr.h>.
11052 (ns_get_color):
11053 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11054 Prefer snprintf to strncpy.
11055 * nsterm.m (ns_term_init):
11056 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11057 * nsterm.m (ns_term_init):
11058 Avoid the need for strncpy, by using build_string or
11059 make_unibyte_string directly. Use dtoastr, not snprintf.
11060 * process.c (Fmake_network_process): Diagnose service names that
11061 are too long, rather than silently truncating them or creating
11062 non-null-terminated names.
11063 (Fnetwork_interface_info): Likewise, for interface names.
11064 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11065 Prefer sprintf to strncat.
11066 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11067 Prefer vsnprintf to vsprintf + strncpy.
11068
11069 2012-07-10 Glenn Morris <rgm@gnu.org>
11070
11071 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11072 Clarify fallback case.
11073
11074 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11075
11076 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11077 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11078 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11079 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11080 where argument type is known to be a Lisp_Cons.
11081
11082 2012-07-10 Tom Tromey <tromey@redhat.com>
11083
11084 * bytecode.c (BYTE_CODE_THREADED): New macro.
11085 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11086 (enum byte_code_op): New type.
11087 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11088 (exec_byte_code): Use them. Use token threading when applicable.
11089
11090 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11091
11092 Optimize pure C strings initialization.
11093 * lisp.h (make_pure_string): Fix prototype.
11094 (build_pure_c_string): New function, defined as static inline. This
11095 provides a better opportunity to optimize away calls to strlen when
11096 the function is called with compile-time constant argument.
11097 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11098 argument, adjust users accordingly. Use build_pure_c_string where
11099 appropriate.
11100 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11101 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11102 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11103
11104 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11105
11106 Avoid calls to strlen in miscellaneous functions.
11107 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11108 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11109 * lread.c (openp): Likewise.
11110
11111 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11112
11113 Avoid calls to strlen in path processing functions.
11114 * fileio.c (file_name_as_directory): Add comment. Change to add
11115 srclen argument and return the length of result. Adjust users
11116 accordingly.
11117 (directory_file_name): Fix comment. Change to add srclen argument,
11118 swap 1st and 2nd arguments to obey the common convention.
11119 Adjust users accordingly.
11120 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11121
11122 2012-07-10 Glenn Morris <rgm@gnu.org>
11123
11124 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11125 Move PENDING_OUTPUT_COUNT definition to configure.
11126
11127 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11128 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11129 * s/gnu.h (DATA_START): Move definitions to configure.
11130
11131 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11132 We include usg5-4-common.h, which defines them both.
11133
11134 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11135 O_RDONLY already includes it).
11136
11137 Stop ns builds setting the EMACSLOADPATH environment variable.
11138 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11139 Now it does not set EMACSLOADPATH, just returns the load-path string.
11140 * nsterm.h: Update accordingly.
11141 * lread.c [HAVE_NS]: Include nsterm.h.
11142 (init_lread) [HAVE_NS]: Use ns_load_path.
11143 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11144
11145 2012-07-09 Glenn Morris <rgm@gnu.org>
11146
11147 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11148 since the included bsd-common.h does so.
11149
11150 Stop ns builds setting the EMACSPATH environment variable.
11151 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11152 (ns_init_paths): Do not set EMACSPATH.
11153 * nsterm.h (ns_exec_path): Add it.
11154 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11155 Use ns_exec_path.
11156
11157 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11158
11159 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11160
11161 * process.c (wait_reading_process_output): 'waitchannels' was unset
11162 when read_kbd || !NILP (wait_for_cell); fix this.
11163
11164 Add GCC-style 'const' attribute to functions that can use it.
11165 * character.h (char_resolve_modifier_mask):
11166 * keyboard.h (make_ctrl_char):
11167 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11168 (init_character_once, next_almost_prime, init_fns, init_image)
11169 (flush_pending_output, init_sound):
11170 * mem-limits.h (start_of_data):
11171 * menu.h (finish_menu_items):
11172 Add ATTRIBUTE_CONST.
11173 * emacs.c (DEFINE_DUMMY_FUNCTION):
11174 Declare the dummy function with ATTRIBUTE_CONST.
11175 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11176 Add decls with ATTRIBUTE_CONST.
11177
11178 Minor improvements to make_formatted_string.
11179 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11180 where int is good enough, as vsprintf returns an int.
11181 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11182
11183 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11184
11185 Use make_formatted_string to avoid double length calculation.
11186 * lisp.h (make_formatted_string): New prototype.
11187 * alloc.c (make_formatted_string): New function.
11188 * buffer.c (Fgenerate_new_buffer_name): Use it.
11189 * dbusbind.c (syms_of_dbusbind): Likewise.
11190 * editfns.c (Fcurrent_time_zone): Likewise.
11191 * filelock.c (get_boot_time): Likewise.
11192 * frame.c (make_terminal_frame, set_term_frame_name)
11193 (x_report_frame_params): Likewise.
11194 * image.c (gs_load): Likewise.
11195 * minibuf.c (get_minibuffer): Likewise.
11196 * msdos.c (dos_set_window_size): Likewise.
11197 * process.c (make_process): Likewise.
11198 * xdisp.c (ensure_echo_area_buffers): Likewise.
11199 * xsettings.c (apply_xft_settings): Likewise.
11200
11201 2012-07-09 Glenn Morris <rgm@gnu.org>
11202
11203 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11204 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11205 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11206 * nsterm.h (ns_etc_directory): Add it.
11207 * callproc.c [HAVE_NS]: Include nsterm.h.
11208 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11209
11210 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11211
11212 Move marker debugging code under MARKER_DEBUG.
11213 * marker.c (MARKER_DEBUG): Move marker debugging code under
11214 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11215 for bootstrap with --enable-checking (~3x slowdown reported
11216 by Juanma Barranquero <lekktu@gmail.com>).
11217 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11218
11219 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11220
11221 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11222 See <http://bugs.gnu.org/11825#29>.
11223
11224 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11225
11226 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11227 has no font, use the frame's font. (Bug#11813)
11228 (display_line): Add commentary about displaying truncation glyphs
11229 on GUI frames.
11230 (produce_special_glyphs): Move here from term.c.
11231
11232 * term.c (produce_special_glyphs): Move to xdisp.c.
11233
11234 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11235 section.
11236
11237 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11238
11239 * xdisp.c (display_line): Avoid warning about implicit declaration
11240 of FRAME_FONT.
11241
11242 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11243
11244 * lisp.h: Remove empty conditional.
11245
11246 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11247
11248 * lread.c (load_path_check): Now static.
11249
11250 Fix some minor --with-ns problems found by static checking.
11251 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11252 (x_set_font) [!HAVE_X_WINDOWS]:
11253 * image.c (xpm_load_image) [HAVE_NS]:
11254 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11255 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11256 Remove unused local.
11257 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11258 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11259 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11260 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11261 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11262 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11263 Fix pointer signedness problem.
11264 * xfaces.c (FRAME_X_FONT_TABLE):
11265 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11266
11267 2012-07-07 Glenn Morris <rgm@gnu.org>
11268
11269 * lread.c (load_path_check): New function, split from init_lread.
11270 (init_lread): Reorganize. Motivation:
11271 If EMACSLOADPATH is set, check/warn about that rather than the
11272 defaults, which we are not going to use. Hence we can remove
11273 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11274 Don't warn if site-lisp directories are missing.
11275 If not installed, start from a blank load-path, since
11276 PATH_LOADSEARCH refers to the eventual installation directories.
11277
11278 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11279
11280 Support truncation and continuation glyphs on GUI frames, when
11281 fringes are disabled. (Bug#11832)
11282 * xdisp.c (init_iterator): Get dimensions of truncation and
11283 continuation glyphs even if on GUI frames.
11284 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11285 or both, are absent.
11286 (start_display, move_it_in_display_line_to): Handle the case of a
11287 GUI frame without a fringe to display continuation or truncation
11288 glyphs.
11289 (insert_left_trunc_glyphs): Support GUI frames: make sure
11290 truncation glyphs overwrite enough glyphs from the current line to
11291 have sufficient space in pixels.
11292 (display_line): Support truncation and continuation glyphs on GUI
11293 frames. If some spare pixels are left on the line after inserting
11294 the truncation glyphs, fill that space with a stretch glyph of a
11295 suitably computed width.
11296
11297 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11298 produce_glyphs, to support GUI sessions.
11299
11300 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11301
11302 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11303
11304 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11305
11306 Do not require float-time's arg to fit in time_t (Bug#11825).
11307 This works better on hosts where time_t is unsigned, and where
11308 float-time is applied to the (negative) difference between two times.
11309 * editfns.c (decode_time_components): Last arg is now double *,
11310 not int *, and means to store all the result as a double, without
11311 worrying about whether the seconds part fits in time_t.
11312 All callers changed.
11313 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11314 All callers changed.
11315 (Ffloat_time): Do not fail merely because the specified time falls
11316 outside of time_t range.
11317
11318 2012-07-07 Glenn Morris <rgm@gnu.org>
11319
11320 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11321 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11322 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11323
11324 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11325
11326 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11327 Update dependencies.
11328
11329 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11330
11331 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11332
11333 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11334 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11335 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11336 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11337 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11338 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11339
11340 * xfont.c (compare_font_names): Redo to omit the need for casts.
11341
11342 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11343
11344 * xfns.c (Fx_change_window_property): Doc fix.
11345 * w32fns.c (Fx_change_window_property): Doc fix.
11346
11347 * w32fns.c (Fx_window_property): Accept the same arguments as the
11348 X Windows version. Doc fix.
11349 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11350
11351 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11352 Eli Zaretskii <eliz@gnu.org>
11353
11354 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11355 Windows-specific code from nt/config.nt moved here.
11356 Obsolete settings removed.
11357
11358 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11359
11360 * process.c: Avoid unnecessary calls to gettime.
11361 (wait_reading_process_output): Don't get the time of day
11362 when gobbling data immediately and not waiting, as there's no need
11363 for it in that case. This removes a FIXME.
11364
11365 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11366
11367 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11368 is defined (Bug#11768).
11369
11370 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11371
11372 Fix marker debugging code.
11373 * marker.c (byte_char_debug_check): Do not perform the check
11374 if buffer is not multibyte.
11375 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11376 Call byte_char_debug_check with correct arguments.
11377
11378 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11379
11380 Compile marker debugging code only if ENABLE_CHECKING is defined.
11381 * marker.c (byte_char_debug_check, count_markers):
11382 Use only if ENABLE_CHECKING is defined.
11383 (byte_debug_flag): Remove.
11384 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11385 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11386
11387 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11388
11389 Avoid code repetition in marker-related functions.
11390 * marker.c (attach_marker): New function.
11391 (Fset_marker, set_marker_restricted, set_marker_both)
11392 (set_marker_restricted_both): Use it.
11393 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11394 Consistently rename charno to charpos.
11395 (marker_position): Add eassert.
11396 (marker_byte_position): Convert to eassert.
11397
11398 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11399
11400 Simplify list operations in unchain_overlay and unchain_marker.
11401 * buffer.c (unchain_overlay): Simplify. Add comment.
11402 * marker.c (unchain_marker): Simplify. Fix comments.
11403
11404 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11405
11406 Introduce fast path for the widely used marker operation.
11407 * alloc.c (build_marker): New function.
11408 * lisp.h (build_marker): New prototype.
11409 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11410 * composite.c (autocmp_chars): Likewise.
11411 * editfns.c (buildmark): Remove.
11412 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11413 (save_restriction_save): Use build_marker.
11414 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11415 * window.c (save_window_save): Likewise.
11416
11417 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11418
11419 Do not use Fdelete_overlay in delete_all_overlays
11420 to avoid redundant calls to unchain_overlay.
11421 * buffer.c (drop_overlay): New function.
11422 (delete_all_overlays, Fdelete_overlay): Use it.
11423 * minibuf.c (get_minibuffer): Fix comment.
11424
11425 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11426
11427 Port to OpenBSD 5.1 amd64.
11428 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11429 This is needed for OpenBSD, and should be harmless on all BSD systems.
11430 Also, include <sys/sysctl.h>, as it should be available on all
11431 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11432 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11433 use p_pid member, not kp_proc.pid.
11434
11435 2012-07-06 Glenn Morris <rgm@gnu.org>
11436
11437 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11438
11439 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11440
11441 More xmalloc and related cleanup.
11442 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11443 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11444 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11445 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11446 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11447 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11448 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11449 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11450 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11451 * xterm.c:
11452 Omit needless casts involving void * pointers and allocation.
11453 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11454 as the former is more robust if P's type is changed.
11455 Prefer xzalloc to xmalloc + memset 0.
11456 Simplify malloc-or-realloc to realloc.
11457 Don't worry about xmalloc returning a null pointer.
11458 Prefer xstrdup to xmalloc + strcpy.
11459 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11460 growing it.
11461 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11462 alloca of a constant.
11463
11464 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11465
11466 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11467 hscroll is larger than the line width. Fixes long and futile
11468 looping inside extend_face_to_end_of_line (on a TTY) producing
11469 glyphs that are not needed and thrown away.
11470
11471 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11472
11473 * marker.c (set_marker_restricted_both): Simplify by using
11474 clip_to_bounds.
11475
11476 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11477
11478 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11479
11480 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11481
11482 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11483 not defined (Bug#11768).
11484 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11485 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11486 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11487 followed by gtk_box_set_homogeneous (Bug#11768).
11488 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11489 (update_theme_scrollbar_width, xg_create_scroll_bar):
11490 Use gtk_scrollbar_new (Bug#11768).
11491 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11492 (is_box_type): New function (Bug#11768).
11493 (xg_tool_item_stale_p): Call is_box_type.
11494 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11495 with default display (Bug#11768).
11496
11497 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11498
11499 * xdisp.c (window_hscroll_limited): New function.
11500 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11501 coordinates when window's hscroll is set to insanely large
11502 values. (Bug#11857)
11503
11504 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11505
11506 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11507 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11508
11509 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11510
11511 Cleanup xmalloc.
11512 * lisp.h (xzalloc): New prototype. Omit needless casts.
11513 * alloc.c (xzalloc): New function. Omit needless casts.
11514 * charset.c: Omit needless casts. Convert all calls to
11515 xmalloc with following memset to xzalloc.
11516 * dispnew.c: Likewise.
11517 * fringe.c: Likewise.
11518 * image.c: Likewise.
11519 * sound.c: Likewise.
11520 * term.c: Likewise.
11521 * w32fns.c: Likewise.
11522 * w32font.c: Likewise.
11523 * w32term.c: Likewise.
11524 * xfaces.c: Likewise.
11525 * xfns.c: Likewise.
11526 * xterm.c: Likewise.
11527 * atimer.c: Omit needless casts.
11528 * buffer.c: Likewise.
11529 * callproc.c: Likewise.
11530 * ccl.c: Likewise.
11531 * coding.c: Likewise.
11532 * composite.c: Likewise.
11533 * doc.c: Likewise.
11534 * doprnt.c: Likewise.
11535 * editfns.c: Likewise.
11536 * emacs.c: Likewise.
11537 * eval.c: Likewise.
11538 * filelock.c: Likewise.
11539 * fns.c: Likewise.
11540 * gtkutil.c: Likewise.
11541 * keyboard.c: Likewise.
11542 * lisp.h: Likewise.
11543 * lread.c: Likewise.
11544 * minibuf.c: Likewise.
11545 * msdos.c: Likewise.
11546 * print.c: Likewise.
11547 * process.c: Likewise.
11548 * region-cache.c: Likewise.
11549 * search.c: Likewise.
11550 * sysdep.c: Likewise.
11551 * termcap.c: Likewise.
11552 * terminal.c: Likewise.
11553 * tparam.c: Likewise.
11554 * w16select.c: Likewise.
11555 * w32.c: Likewise.
11556 * w32reg.c: Likewise.
11557 * w32select.c: Likewise.
11558 * w32uniscribe.c: Likewise.
11559 * widget.c: Likewise.
11560 * xdisp.c: Likewise.
11561 * xmenu.c: Likewise.
11562 * xrdb.c: Likewise.
11563 * xselect.c: Likewise.
11564
11565 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11566
11567 * fileio.c (time_error_value): Check the right error number.
11568 Problem reported by Troels Nielsen in
11569 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11570
11571 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11574 This should be fixed in a better way; see Eli Zaretskii in
11575 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11576 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11577
11578 * fileio.c (time_error_value): Rename from special_mtime.
11579 The old name's problems were noted by Eli Zaretskii in
11580 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11581
11582 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11583 This variable's comment says Emacs needs at least one GDB-visible
11584 symbol of type enum pvec_type, to work around GDB problems.
11585 The symbol's value doesn't matter.
11586
11587 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11588 that causes compilation to fail on pre-C99 compilers.
11589
11590 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11591
11592 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11593 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11594
11595 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11596
11597 * buffer.c (init_buffer_once): Fix initialization of
11598 headers for buffer_defaults and buffer_local_symbols.
11599 Reported by Juanma Barranquero <lekktu@gmail.com>.
11600
11601 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11602
11603 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11604 * lisp.h (enum pvec_type): Use fewer bits.
11605 (PSEUDOVECTOR_SIZE_BITS): New constant.
11606 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11607 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11608 change in pvec_type.
11609 (PSEUDOVECTOR_TYPEP): New macro.
11610 (TYPED_PSEUDOVECTORP): Use it.
11611 * fns.c (internal_equal): Adapt code to extract pvectype.
11612 * emacs.c (gdb_pvec_type): Update type.
11613 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11614 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11615 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11616 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11617 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11618 abusing vector->header.next.nbytes.
11619 (live_vector_p): Use PVEC_TYPE.
11620 (mark_object): Adapt code to extract pvectype. Use switch.
11621
11622 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11623
11624 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11625 Tighten new eassert a bit.
11626
11627 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11628
11629 Fix compilation with --enable-gcc-warnings and -O1
11630 optimization level.
11631 * doprnt.c (doprnt): Change type of tem to int, initialize
11632 to avoid compiler warning. Add eassert.
11633 * search.c (simple_search): Initialize match_byte to avoid
11634 compiler warning. Add eassert.
11635
11636 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11637
11638 Avoid weird behavior with large horizontal scrolls.
11639 Without this change, for example, large hscroll values would
11640 mess up Emacs's display on Fedora 15 x86, presumably due to
11641 overflows in int calculations in the display code.
11642 Also, if buffers had long lines, Emacs would freeze.
11643 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11644 (set_window_hscroll): New function, containing the old guts of
11645 Fset_window_hscroll. Return the clipped value.
11646 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11647 This avoids the need to check against PTRDIFF_MAX.
11648
11649 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11650
11651 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11652
11653 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11654
11655 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11656
11657 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11658 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11659 since GCC 4.4.6 issues a bogus warning for them.
11660
11661 Fix bugs in file timestamp newness comparisons.
11662 * fileio.c (Ffile_newer_than_file_p):
11663 * lread.c (Fload): Use full timestamp resolution of files,
11664 not just the 1-second resolution, so that files that are only
11665 slightly newer still count as newer.
11666 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11667 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11668
11669 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11670
11671 * fileio.c: Improve handling of file time marker. (Bug#11852)
11672 (special_mtime): New function.
11673 (Finsert_file_contents, Fverify_visited_file_modtime):
11674 Use it to set special mtime values consistently.
11675
11676 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11677
11678 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11679 marker for non-existing file. (Bug#11852)
11680
11681 2012-07-03 Glenn Morris <rgm@gnu.org>
11682
11683 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11684 and did not make it into globals.h).
11685
11686 2012-07-03 Tom Tromey <tromey@redhat.com>
11687
11688 * window.c (Fset_window_margins, Fset_window_fringes)
11689 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11690 * textprop.c (Fprevious_property_change): No longer static.
11691 * syntax.c (Fsyntax_table_p): No longer static.
11692 * process.c (Fget_process, Fprocess_datagram_address): No longer
11693 static.
11694 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11695 * keyboard.c (Fcommand_execute): No longer static.
11696 Remove EXFUN.
11697 * insdel.c (Fcombine_after_change_execute): No longer static.
11698 * image.c (Finit_image_library): No longer static.
11699 * fileio.c (Fmake_symbolic_link): No longer static.
11700 * eval.c (Ffetch_bytecode): No longer static.
11701 * editfns.c (Fuser_full_name): No longer static.
11702 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11703 No longer static.
11704 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11705 static.
11706 * dired.c (Ffile_attributes): No longer static.
11707 * composite.c (Fcomposition_get_gstring): No longer static.
11708 * callproc.c (Fgetenv_internal): No longer static.
11709
11710 * ccl.h: Remove EXFUNs.
11711 * buffer.h: Remove EXFUNs.
11712 * dispextern.h: Remove EXFUNs.
11713 * intervals.h: Remove EXFUNs.
11714 * fontset.h: Remove EXFUN.
11715 * font.h: Remove EXFUNs.
11716 * dosfns.c (system_process_attributes): Remove EXFUN.
11717 * keymap.h: Remove EXFUNs.
11718 * lisp.h: Remove EXFUNs.
11719 * w32term.h: Remove EXFUNs.
11720 * window.h: Remove EXFUNs.
11721 * xsettings.h: Remove EXFUN.
11722 * xterm.h: Remove EXFUN.
11723
11724 2012-07-03 Glenn Morris <rgm@gnu.org>
11725
11726 * lisp.h (Frandom): Make it visible to C.
11727 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11728 buffer for invisible buffers. (Bug#1229)
11729
11730 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11731
11732 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11733 values which aren't power of 2.
11734 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11735 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11736 accordingly.
11737
11738 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11739
11740 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11741
11742 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11743
11744 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11745
11746 * alloc.c (allocate_vector_block): Remove redundant
11747 calls to mallopt if DOUG_LEA_MALLOC is defined.
11748 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11749 avoid calls to mallopt if zero_vector is returned.
11750
11751 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11752
11753 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11754 is enabled, avoid dereferencing NULL current_sblock if
11755 running undumped.
11756
11757 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11758
11759 Cleanup basic buffer management.
11760 * buffer.h (struct buffer): Change layout to use generic vector
11761 marking code. Fix some comments. Change type of 'clip_changed'
11762 to bitfield. Remove unused #ifndef old.
11763 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11764 (GET_OVERLAYS_AT): Fix indentation.
11765 (for_each_per_buffer_object_at): New macro.
11766 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11767 (Fbuffer_local_variables): Use it.
11768 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11769 * alloc.c (allocate_buffer): Adjust to match new layout of
11770 struct buffer. Fix comment.
11771 (mark_overlay): New function.
11772 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11773 Lisp area of struct buffer.
11774 (mark_object): Use it. Adjust marking of misc objects
11775 and related comments.
11776
11777 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11778
11779 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11780 wrapper that is not needed because the wrapped code is a no-op (zero
11781 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11782 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11783
11784 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11785
11786 * alloc.c (mark_buffer): Simplify. Remove prototype.
11787 (mark_object): Add comment. Reorganize marking of vector-like
11788 objects. Use CHECK_LIVE for all vector-like objects except buffers
11789 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11790 Avoid redundant calls to mark_vectorlike for bool vectors.
11791
11792 2012-06-30 Glenn Morris <rgm@gnu.org>
11793
11794 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11795
11796 * epaths.in (PATH_SITELOADSEARCH): New.
11797 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11798 This is rather than relying on --enable-locallisppath elements
11799 having "site-lisp" in their names. (Bug#10208#25, 11658)
11800
11801 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11802
11803 * w32proc.c (sys_select): Accept and ignore one more argument.
11804
11805 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11806
11807 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11808 (pselect) [!MS_DOS]: Redirect to sys_select.
11809
11810 * sysdep.c: Don't include dos.h and dosfns.h.
11811
11812 * process.c (sys_select):
11813 * msdos.c (sys_select): Accept one more argument and ignore it.
11814
11815 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11816 adapt data types and code to that.
11817
11818 * dosfns.c:
11819 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11820 which clashes with the gnulib function of the same name.
11821
11822 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11823
11824 * font.c (font_style_to_value, font_style_symbolic)
11825 (font_prop_validate_style): Add type checks for values in
11826 font_style_table.
11827
11828 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11829 argument.
11830 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11831 uses.
11832
11833 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11834
11835 * xdisp.c (try_window_id): Undo last change.
11836
11837 * w32.c (getwd): Adjust commentary about startup_dir.
11838 (init_environment): Always call sys_access, even in non-MSVC
11839 builds. Don't chdir to the directory of the Emacs executable.
11840 This undoes code from 1997 which was justified by the need to
11841 "avoid conflicts when removing and renaming directories". But its
11842 downside was that every relative file name was being interpreted
11843 relative to the directory of the Emacs executable, which can never
11844 be TRT. In particular, it broke sys_access when called with
11845 relative file names.
11846 (sys_access): Map GetLastError to errno.
11847
11848 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11849
11850 * window.h (struct window): Change type of 'fringes_outside_margins'
11851 to bitfield. Fix comment. Adjust users accordingly.
11852 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11853 Adjust comment.
11854 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11855 to ptrdiff_t.
11856
11857 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11858
11859 * gnutls.c (emacs_gnutls_handshake):
11860 Add QUIT to make the loop interruptible.
11861
11862 2012-06-29 Glenn Morris <rgm@gnu.org>
11863
11864 * charset.c (init_charset): Make lack of etc/charsets fatal.
11865
11866 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11867
11868 * editfns.c (region_limit): Fix type mismatch.
11869
11870 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11871
11872 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11873 undefined. Convert from xassert to eassert.
11874 * nsmenu.m: Convert from xassert to eassert.
11875 * nsterm.m: Likewise.
11876
11877 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11878
11879 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11880
11881 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11882
11883 Avoid integer overflow on scroll-left and scroll-right.
11884 * window.c (HSCROLL_MAX): New macro.
11885 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11886 overflow when requested scroll falls outside ptrdiff_t range.
11887
11888 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11889
11890 * window.h (struct window): Change type of 'hscroll',
11891 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11892 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11893 Adjust users accordingly.
11894 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11895 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11896 from EMACS_INT to ptrdiff_t.
11897 (make_window): Omit redundant initialization.
11898
11899 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11900
11901 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11902
11903 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11904
11905 * window.h (struct window): Change type of 'use_time' and
11906 'sequence_number' from Lisp_Object to int.
11907 * frame.c (make_frame): Adjust users accordingly.
11908 * print.c (print_object): Likewise.
11909 * window.c (select_window, Fwindow_use_time, make_parent_window)
11910 (make_window): Likewise.
11911
11912 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11913
11914 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11915 enabled with --enable-checking=[all,glyphs] configure option.
11916 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11917 adjust comments accordingly.
11918 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11919 undefined, adjust comments accordingly.
11920 * image.c: Likewise.
11921 * scroll.c: Likewise.
11922 * w32fns.c: Likewise.
11923 * w32term.c: Likewise.
11924 * xdisp.c: Likewise.
11925 * xfaces.c: Likewise.
11926 * xfns.c: Likewise.
11927 * xterm.c: Likewise.
11928
11929 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11930
11931 Generalize run-time debugging checks.
11932 * dispextern.h (XASSERTS): Remove.
11933 * fontset.c (xassert): Remove.
11934 Convert from xassert to eassert.
11935 * alloc.c: Convert from xassert to eassert.
11936 * bidi.c: Likewise.
11937 * dispnew.c: Likewise.
11938 * fns.c: Likewise.
11939 * fringe.c: Likewise.
11940 * ftfont.c: Likewise.
11941 * gtkutil.c: Likewise.
11942 * image.c: Likewise.
11943 * keyboard.c: Likewise.
11944 * menu.c: Likewise.
11945 * process.c: Likewise.
11946 * scroll.c: Likewise.
11947 * sound.c: Likewise.
11948 * term.c: Likewise.
11949 * w32console.c: Likewise.
11950 * w32fns.c: Likewise.
11951 * w32term.c: Likewise.
11952 * window.c: Likewise.
11953 * xdisp.c: Likewise.
11954 * xfaces.c: Likewise.
11955 * xfns.c: Likewise.
11956 * xselect.c: Likewise.
11957 * xterm.c: Likewise.
11958
11959 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11960
11961 * fns.c (maybe_resize_hash_table): Output message when growing the
11962 purify-hashtable.
11963
11964 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11965
11966 * alloc.c (allocate_string_data): Remove dead code.
11967 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11968 avoid GCC warning about unused macro.
11969
11970 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11971
11972 * alloc.c (allocate_string): Omit intervals initialization.
11973 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11974 as in make_pure_string and make_pure_c_string.
11975
11976 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11977
11978 * alloc.c (allocate_string): Fix last change.
11979
11980 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11981
11982 * alloc.c (allocate_string): Remove two redundant calls
11983 to memset, add explicit initialization where appropriate.
11984
11985 2012-06-27 Glenn Morris <rgm@gnu.org>
11986
11987 * lisp.mk (lisp): Remove paths.elc.
11988
11989 2012-06-27 Chong Yidong <cyd@gnu.org>
11990
11991 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11992
11993 2012-06-26 John Wiegley <johnw@newartisans.com>
11994
11995 * unexmacosx.c (copy_data_segment): Add two section names used
11996 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11997
11998 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11999 when building with Clang.
12000
12001 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12002
12003 * eval.c (Fapply): Allow calling it with a single argument.
12004
12005 2012-06-26 Eli Zaretskii <eliz@gnu.org>
12006
12007 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12008 _stricmp and _strnicmp.
12009 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12010
12011 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12012
12013 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12014 allocated window.
12015 (allocate_process): Likewise for new process.
12016 (allocate_terminal): Change to use offsetof.
12017 (allocate_frame): Likewise.
12018 * frame.c (make_frame): Omit redundant initialization.
12019 * window.c (make_parent_window): Use memset.
12020 (make_window): Omit redundant initialization.
12021 * process.c (make_process): Omit redundant initialization.
12022 * terminal.c (create_terminal): Likewise.
12023
12024 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12025
12026 * term.c (delete_tty): Remove redundant call to memset.
12027
12028 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12029
12030 * alloc.c: Remove build_string.
12031 * lisp.h: Define build_string as static inline. This provides
12032 a better opportunity to optimize away calls to strlen when the
12033 function is called with compile-time constant argument.
12034 * image.c (imagemagick_error): Convert to build_string.
12035 * w32proc.c (sys_spawnve): Likewise.
12036 * xterm.c (x_term_init): Likewise.
12037
12038 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12039
12040 Use sprintf return value instead of invoking strlen on result.
12041 In the old days this wasn't portable, since some sprintf
12042 implementations returned char *. But they died out years ago and
12043 Emacs already assumes sprintf returns int.
12044 Similarly for float_to_string.
12045 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12046 * ccl.c (ccl_driver):
12047 * character.c (string_escape_byte8):
12048 * data.c (Fnumber_to_string):
12049 * doprnt.c (doprnt):
12050 * print.c (print_object):
12051 * xdisp.c (message_dolog):
12052 * xfns.c (syms_of_xfns):
12053 Use sprintf or float_to_string result to avoid need to call strlen.
12054 * data.c (Fnumber_to_string):
12055 Use make_unibyte_string, since the string must be ASCII.
12056 * lisp.h, print.c (float_to_string): Now returns int length.
12057 * term.c (produce_glyphless_glyph):
12058 Use sprintf result rather than recomputing it.
12059
12060 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12061 * Makefile.in (ALL_CFLAGS):
12062 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12063 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12064
12065 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12066
12067 * dispextern.h (xstrcasecmp): Define to library function
12068 strcasecmp if available.
12069 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12070
12071 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12072
12073 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12074 Avoid comma operator.
12075 * menu.c (push_submenu_start, push_submenu_end)
12076 (push_left_right_boundary, push_menu_pane): Likewise.
12077 * msdos.c (dos_rawgetc): Likewise.
12078
12079 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12080
12081 * xfns.c (xic_create_fontsetname): Remove redundant calls
12082 to memset.
12083
12084 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12085
12086 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12087 sprintf already null-terminates its output.
12088
12089 * xfns.c (x_window): Remove redundant cast.
12090
12091 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12092
12093 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12094 `const char *' to `char *' to avoid compiler warning.
12095
12096 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12097
12098 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12099 instead of truncating it to 63 (admittedly a generous limit).
12100
12101 * process.c: Fix spelling and caps in comments.
12102
12103 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12104
12105 * emacs.c (setpgrp): Remove definition, unused.
12106 * sysdep.c (setpgrp): Remove definition, not used in this file.
12107
12108 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
12109
12110 * makefile.w32-in: Update dependencies.
12111
12112 2012-06-24 Eli Zaretskii <eliz@gnu.org>
12113
12114 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12115 (SYSTIME_H): Add nt/inc/sys/time.h.
12116
12117 * systime.h [WINDOWSNT]: Include sys/time.h.
12118
12119 * s/ms-w32.h (struct timespec): Definition moved from
12120 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12121
12122 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12125 * buffer.h (buffer_slot_type_mismatch):
12126 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12127 * eval.c (unwind_to_catch):
12128 * image.c (my_png_error, my_error_exit):
12129 * keyboard.c (quit_throw_to_read_char, user_error)
12130 (Fexit_recursive_edit, Fabort_recursive_edit):
12131 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12132 (wrong_type_argument, buffer_overflow, __executable_start)
12133 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12134 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12135 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12136 (fatal):
12137 (child_setup) [!DOS_NT]:
12138 * lread.c (end_of_file_error, invalid_syntax):
12139 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12140 * puresize.h (pure_write_error):
12141 * search.c (matcher_overflow):
12142 * sound.c (sound_perror, alsa_sound_perror):
12143 * sysdep.c, syssignal.h (croak):
12144 * term.c (maybe_fatal, vfatal):
12145 * textprop.c (text_read_only):
12146 * undo.c (user_error):
12147 * unexmacosx.c (unexec_error):
12148 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12149 Use _Noreturn rather than NO_RETURN.
12150 No need for separate decl merely because of _Noreturn.
12151 * sound.c (sound_warning, parse_sound):
12152 Remove unnecessary forward decls.
12153
12154 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12155
12156 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12157 * lisp.h (WAIT_READING_MAX): New macro.
12158 * dispnew.c (Fsleep_for, sit_for):
12159 * keyboard.c (kbd_buffer_get_event):
12160 * process.c (Faccept_process_output):
12161 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12162 This improves on the previous patch, which introduced a bug
12163 when time_t is unsigned and as wide as intmax_t.
12164 See <http://bugs.gnu.org/9000#51>.
12165
12166 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12167
12168 * dispnew.c (sit_for, Fsleep_for):
12169 * keyboard.c (kbd_buffer_get_event):
12170 * process.c (Faccept_process_output): Avoid compiler warnings when
12171 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12172
12173 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
12174
12175 * makefile.w32-in: Update dependencies.
12176
12177 * w32.c (ltime): Add return type and declare static.
12178 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12179
12180 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12181
12182 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12183 Privately reported by Herbert J. Skuhra.
12184 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12185 All uses changed.
12186 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12187 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12188
12189 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12190
12191 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12192 last argument of make_unibyte_string.
12193
12194 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12195 language ID in the event parameters.
12196
12197 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12198 event.code, not the obscure "character set ID".
12199
12200 2012-06-23 Chong Yidong <cyd@gnu.org>
12201
12202 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12203
12204 2012-06-23 Eli Zaretskii <eliz@gnu.org>
12205
12206 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12207 * w32.c (fdutimens): New function.
12208
12209 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12210
12211 * s/ms-w32.h (pselect): Redirect to sys_select.
12212
12213 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12214
12215 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12216 in the logic of incrementing and decrementing the value of
12217 use_relocatable_buffers.
12218
12219 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12222 Privately reported by Herbert J. Skuhra.
12223 [__FreeBSD__]: Remove "*/" typo after "#include".
12224 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12225 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12226 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12227 Don't assume EMACS_TIME and struct timeval are the same type.
12228
12229 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12230
12231 Support higher-resolution time stamps (Bug#9000).
12232 The time stamps are only nanosecond-resolution at the C level,
12233 since that's the best that any real-world system supports now.
12234 But they are picosecond-resolution at the Lisp level, as that's
12235 easy, and leaves room for future OS improvements.
12236
12237 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12238 (LIBES): Use it.
12239
12240 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12241 Don't get current time unless it's needed.
12242
12243 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12244 now provides it if it's absent.
12245 (start_atimer): Port to higher-res time stamps.
12246 Check for time stamp overflow. Don't get current time more
12247 often than is needed.
12248
12249 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12250 Include systime.h, not time.h.
12251 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12252
12253 * dired.c: Include stat-time.h.
12254 (Ffile-attributes): File times now have higher resolution.
12255
12256 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12257 (struct image): Timestamp now has higher resolution.
12258
12259 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12260 has at least microseconds now. All uses removed.
12261 (update_frame, update_single_window, update_window, update_frame_1)
12262 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12263 (duration_to_sec_usec): Remove; no longer needed.
12264
12265 * editfns.c (time_overflow): Now extern.
12266 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12267 (float-time, Fformat_time_string, Fcurrent_time_string)
12268 (Fcurrent_time_zone): Accept and generate higher-resolution
12269 time stamps.
12270 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12271 (decode_time_components, lisp_seconds_argument): New functions.
12272 (make_time): Now static.
12273 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12274 Report an error if the time is invalid, rather than having the caller
12275 do that.
12276
12277 * fileio.c: Include <stat-time.h>
12278 (Fcopy_file): Copy higher-resolution time stamps.
12279 Prefer to set the time stamp via a file descriptor if that works.
12280 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12281 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12282 (Fvisited_file_modtime, Fset_visited_file_modtime):
12283 Support higher-resolution time stamps.
12284
12285 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12286
12287 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12288
12289 * image.c (prepare_image_for_display, clear_image_cache)
12290 (lookup_image): Port to higer-resolution time stamps.
12291
12292 * keyboard.c (start_polling, bind_polling_period):
12293 Check for time stamp overflow.
12294 (read_char, kbd_buffer_get_event, timer_start_idle)
12295 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12296 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12297 Port to higher-resolution time stamps. Do not assume time_t is signed.
12298 (decode_timer): New function. Timers are now vectors of length 9,
12299 not 8, to accommodate the picosecond component.
12300 (timer_check_2): Use it.
12301
12302 * nsterm.m (select_timeout, timeval_subtract): Remove.
12303 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12304 as they're a bit more accurate and handle overflow better.
12305 (ns_select): Change prototype to be compatible with pselect.
12306 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12307 * nsterm.h (ns_select): Adjust prototype.
12308
12309 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12310 us-resolution time stamps.
12311 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12312
12313 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12314
12315 * lisp.h (time_overflow): New decl.
12316 (wait_reading_process_output): First arg is now intmax_t, not int,
12317 to accommodate larger waits.
12318
12319 * process.h (struct Lisp_Process.read_output_delay):
12320 Now counts nanoseconds, not microseconds.
12321 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12322 EMACS_HAS_USECS.
12323 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12324 (wait_reading_process_output):
12325 Port to ns-resolution time stamps.
12326 (Faccept_process_output, wait_reading_process_output):
12327 Check for time stamp overflow. Do not assume time_t is signed.
12328 (select_wrapper): Remove; we now use pselect.
12329 (Fprocess_attributes): Now generates ns-resolution time stamps.
12330
12331 * sysdep.c: Include utimens.h. Don't include utime.h
12332 or worry about struct utimbuf; gnulib does that for us now.
12333 (gettimeofday): Remove; gnulib provides a substitute.
12334 (make_timeval): New function.
12335 (set_file_times): Now sets ns-resolution time stamps.
12336 New arg FD; all uses changed.
12337 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12338 (system_process_attributes):
12339 Now returns ns-resolution time stamp. All uses changed.
12340 Check for time stamp overflow.
12341
12342 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12343 provides a substitute now.
12344
12345 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12346 since it guarantees struct timespec.
12347 (EMACS_TIME): Now struct timespec, so that we can support
12348 ns-resolution time stamps.
12349 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12350 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12351 (EMACS_USECS): Remove.
12352 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12353 so multiply the arg by 1000 before storing it.
12354 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12355 New macros.
12356 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12357 Port to ns-resolution time stamps.
12358 (EMACS_TIME_NEG_P): Remove; replaced by....
12359 (EMACS_TIME_SIGN): New macro.
12360 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12361 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12362 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12363 (make_timeval, make_lisp_time, decode_time_components): New decls.
12364 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12365 that it mishandled time_t overflow. You can't compare by subtracting!
12366 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12367 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12368
12369 * term.c: Include <sys/time.h>.
12370 (timeval_to_Time): New function, for proper overflow wraparound.
12371 (term_mouse_position, term_mouse_click): Use it.
12372
12373 * undo.c (record_first_change): Support higher-resolution time stamps
12374 in the undo buffer.
12375 (Fprimitive_undo): Use them when restoring time stamps.
12376
12377 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12378 (w32_get_internal_run_time):
12379 Port to higher-resolution Emacs time stamps.
12380 (ltime): Now accepts single 64-bit integer, as that's more convenient
12381 for callers.
12382
12383 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12384
12385 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12386 for compatibility with pselect. Support ns-resolution time stamps.
12387
12388 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12389
12390 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12391 Check for time stamp overflow, and support ns-resolution time stamps.
12392
12393 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12394 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12395 (timeval_subtract): Remove; no longer needed.
12396 (XTflash, XTring_bell, x_wait_for_event):
12397 Port to ns-resolution time stamps. Don't assume time_t is signed.
12398
12399 2012-06-22 Chong Yidong <cyd@gnu.org>
12400
12401 * xdisp.c (x_consider_frame_title): Revert last change.
12402
12403 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12404
12405 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12406 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12407 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12408 staticidx goes up to 1597 out of 1600 = 0x640.)
12409
12410 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12411
12412 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12413 Otherwise, the umask might be mistakenly 0 while handling input signals.
12414
12415 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12416
12417 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12418
12419 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12420
12421 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12422 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12423 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12424 access to `contents' member of Lisp_Vector objects with AREF and ASET
12425 where appropriate.
12426
12427 2012-06-19 Chong Yidong <cyd@gnu.org>
12428
12429 * frame.c (delete_frame): When selecting a frame on a different
12430 text terminal, do not alter the terminal's top-frame.
12431
12432 * xdisp.c (format_mode_line_unwind_data): Record the target
12433 frame's selected window and its terminal's top-frame.
12434 (unwind_format_mode_line): Restore them.
12435 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12436 Callers changed.
12437 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12438 since tty frames can be explicitly named.
12439 (prepare_menu_bars): Likewise.
12440
12441 * term.c (Ftty_top_frame): New function.
12442
12443 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12444
12445 Port byte-code-meter to modern targets.
12446 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12447 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12448 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12449 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12450 (METER_1, METER_2): Simplify.
12451
12452 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12453
12454 * data.c (Fdefalias): Return `symbol' (bug#11686).
12455
12456 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12457
12458 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12459 gets killed during executing of this function (Bug#11665).
12460 Try to always return Qt when the buffer has been actually killed.
12461 (Vkill_buffer_query_functions): In doc-string say that functions
12462 run by this hook should not change the current buffer.
12463
12464 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 Fix recently-introduced process.c problems found by static checking.
12467 * process.c (write_queue_push, write_queue_pop, send_process):
12468 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12469 (write_queue_pop): Fix pointer signedness problem.
12470 (send_process): Remove unused local.
12471
12472 2012-06-17 Chong Yidong <cyd@gnu.org>
12473
12474 * xdisp.c (redisplay_internal): No need to redisplay terminal
12475 frames that are not on top.
12476
12477 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12478
12479 * process.c (make_process): Initialize write_queue.
12480 (write_queue_push, write_queue_pop): New functions.
12481 (send_process): Use them to maintain correct ordering of process
12482 writes (Bug#10815).
12483
12484 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 * lisp.h (eassert): Assume C89 or later.
12487 This removes the need for CHECK.
12488 (CHECK): Remove. Its comments about always evaluating its
12489 argument were confusing, as 'eassert' typically does not evaluate
12490 its argument.
12491
12492 * coding.c (produce_chars): Use ptrdiff_t, not int.
12493
12494 * xterm.c (x_draw_underwave): Check for integer overflow.
12495 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12496
12497 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12498
12499 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12500 referenced (Bug#11583).
12501
12502 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12503
12504 Implement wave-style variant of underlining.
12505 * dispextern.h (face_underline_type): New enum.
12506 (face): Add field for underline type.
12507 * nsterm.m (ns_draw_underwave): New function.
12508 (ns_draw_text_decoration): Use it.
12509 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12510 New functions.
12511 (x_draw_glyph_string): Use them.
12512 * xfaces.c (Qline, Qwave): New Lisp objects.
12513 (check_lface_attrs, merge_face_ref)
12514 (Finternal_set_lisp_face_attribute, realize_x_face):
12515 Handle wave-style underline face attributes.
12516 * xterm.c (x_draw_underwave): New function.
12517 (x_draw_glyph_string): Use it.
12518
12519 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12520
12521 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12522 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12523 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12524 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12525 ($(BLD)/w32select.$(O)): Update dependencies.
12526
12527 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12528
12529 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12530 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12531 * character.c (_fetch_multibyte_char_p): Remove.
12532 * alloc.c: Include "character.h" before "buffer.h".
12533 * bidi.c: Likewise.
12534 * buffer.c: Likewise.
12535 * bytecode.c: Likewise.
12536 * callint.c: Likewise.
12537 * callproc.c: Likewise.
12538 * casefiddle.c: Likewise.
12539 * casetab.c: Likewise.
12540 * category.c: Likewise.
12541 * cmds.c: Likewise.
12542 * coding.c: Likewise.
12543 * composite.c: Likewise.
12544 * dired.c: Likewise.
12545 * dispnew.c: Likewise.
12546 * doc.c: Likewise.
12547 * dosfns.c: Likewise.
12548 * editfns.c: Likewise.
12549 * emacs.c: Likewise.
12550 * fileio.c: Likewise.
12551 * filelock.c: Likewise.
12552 * font.c: Likewise.
12553 * fontset.c: Likewise.
12554 * fringe.c: Likewise.
12555 * indent.c: Likewise.
12556 * insdel.c: Likewise.
12557 * intervals.c: Likewise.
12558 * keyboard.c: Likewise.
12559 * keymap.c: Likewise.
12560 * lread.c: Likewise.
12561 * macros.c: Likewise.
12562 * marker.c: Likewise.
12563 * minibuf.c: Likewise.
12564 * nsfns.m: Likewise.
12565 * nsmenu.m: Likewise.
12566 * print.c: Likewise.
12567 * process.c: Likewise.
12568 * regex.c: Likewise.
12569 * region-cache.c: Likewise.
12570 * search.c: Likewise.
12571 * syntax.c: Likewise.
12572 * term.c: Likewise.
12573 * textprop.c: Likewise.
12574 * undo.c: Likewise.
12575 * unexsol.c: Likewise.
12576 * w16select.c: Likewise.
12577 * w32fns.c: Likewise.
12578 * w32menu.c: Likewise.
12579 * window.c: Likewise.
12580 * xdisp.c: Likewise.
12581 * xfns.c: Likewise.
12582 * xmenu.c: Likewise.
12583 * xml.c: Likewise.
12584 * xselect.c: Likewise.
12585
12586 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12587
12588 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12589 If all the glyphs of the glyph row came from strings, and we have no
12590 cursor positioning clues, put the cursor on the first glyph of the
12591 row.
12592 (handle_face_prop): Use chunk-relative overlay string index when
12593 indexing into it->string_overlays array. (Bug#11653)
12594 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12595 the rightmost. (Bug#11720)
12596
12597 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12598
12599 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12600 (CATEGORY_MEMBER): Enforce 1/0 value.
12601 * category.c (_temp_category_set): Remove.
12602
12603 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12604
12605 * window.c (Fdelete_other_windows_internal)
12606 (Fdelete_window_internal): Don't access frame's mouse highlight
12607 info of the initial frame. (Bug#11677)
12608
12609 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12610
12611 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12612 Assume USE_2_TAGS_FOR_INTS.
12613 (xreload): Adjust $tagmask width to match recent lisp.h change.
12614
12615 Simplify lisp.h in minor ways that should not affect code.
12616 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12617 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12618 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12619 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12620 (INTTYPEBITS): New macro, for clarity.
12621 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12622 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12623 Simplify now that USE_LSB_TAG is always defined.
12624 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12625 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12626
12627 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12628
12629 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12630
12631 2012-06-13 Glenn Morris <rgm@gnu.org>
12632
12633 * s/bsd-common.h (BSD4_3):
12634 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12635
12636 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12637
12638 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12639 instead of union.
12640 (XLI, XIL): Define.
12641 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12642 Use them.
12643 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12644 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12645 * alloc.c (widen_to_Lisp_Object): Remove.
12646 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12647 * frame.c (delete_frame): Remove outdated comment.
12648 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12649 USE_LISP_UNION_TYPE.
12650 (Fw32_unregister_hot_key): Likewise.
12651 (Fw32_toggle_lock_key): Likewise.
12652 * w32menu.c (add_menu_item): Likewise.
12653 (w32_menu_display_help): Use XIL instead of checking
12654 USE_LISP_UNION_TYPE.
12655 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12656 (init_heap): Likewise.
12657 * w32term.c (w32_read_socket): Update comment.
12658
12659 2012-06-13 Glenn Morris <rgm@gnu.org>
12660
12661 * s/usg5-4-common.h, src/s/unixware.h:
12662 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12663
12664 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12665
12666 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12667
12668 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12669 * alloc.c (make_number) [!defined make_number]:
12670 Remove, as lisp.h always defines this now.
12671 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12672 (roundup_size): Verify that it is a power of 2.
12673 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12674 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12675 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12676 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12677 USE_LSB_TAG now is always defined to be either 0 or 1.
12678 All uses changed.
12679 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12680 code works fine either way, and efficiency is not a concern here,
12681 as the union type is for debugging, not for production.
12682 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12683 Use an inline function on all platforms when using the union type,
12684 since this is simpler and 'static inline' can be used portably
12685 within Emacs now.
12686 (LISP_INITIALLY_ZERO): New macro.
12687 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12688 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12689
12690 2012-06-12 Glenn Morris <rgm@gnu.org>
12691
12692 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12693
12694 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12695
12696 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12697 Move BROKEN_SIGIO to configure.
12698
12699 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12700 Move NO_TERMIO to configure.
12701
12702 2012-06-12 Chong Yidong <cyd@gnu.org>
12703
12704 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12705 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12706 MagickExportImagePixels is undefined.
12707
12708 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12709
12710 * image.c (imagemagick_load_image): Remove unused label.
12711
12712 2012-06-11 Glenn Morris <rgm@gnu.org>
12713
12714 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12715 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12716 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12717 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12718
12719 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12720
12721 * alloc.c (make_byte_code): New function.
12722 (Fmake_byte_code): Use it. Don't purify here.
12723 * lread.c (read1): Use it as well to avoid extra allocation.
12724
12725 2012-06-11 Chong Yidong <cyd@gnu.org>
12726
12727 * image.c (imagemagick_load_image): Implement transparency.
12728
12729 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12730
12731 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12732 account for preceding backslashes. (Bug#11663)
12733
12734 2012-06-09 Chong Yidong <cyd@gnu.org>
12735
12736 * term.c: Support italics in capable terminals (Bug#9652).
12737 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12738 (turn_on_face): Output using TS_enter_italic_mode if available.
12739 Don't handle unused blinking and alt-charset cases.
12740 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12741 and tty_alt_charset_p cases.
12742 (tty_capable_p, init_tty): Support italics.
12743
12744 * termchar.h (struct tty_display_info): Add field for italics.
12745 Remove unused blink field.
12746
12747 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12748 Handle slant.
12749
12750 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12751 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12752 tty_alt_charset_p. Add tty_italic_p.
12753
12754 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12755
12756 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12757 dbus_type_is_basic if available.
12758 (xd_extract_signed, xd_extract_unsigned): Rename from
12759 extract_signed and extract_unsigned, respectively. Adapt callers.
12760
12761 2012-06-09 Chong Yidong <cyd@gnu.org>
12762
12763 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12764
12765 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12766 case (Bug#9752).
12767
12768 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12769
12770 * xdisp.c (vmessage): Treat frame message as multibyte.
12771 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12772 would generate the diagnostic "Making \302\247 buffer-local while
12773 let-bound!".
12774
12775 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12776
12777 * dispnew.c (showing_window_margins_p): Undo last change, which
12778 was done due to an inadvertent commit.
12779 (adjust_frame_glyphs_for_frame_redisplay): Do call
12780 showing_window_margins_p.
12781
12782 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12783
12784 * eval.c (Fmake_var_non_special): New primitive.
12785 (syms_of_eval): Defsubr it.
12786 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12787
12788 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12789
12790 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12791 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12792
12793 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12794
12795 * alloc.c (allocate_vectorlike): Fix last change.
12796
12797 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12798
12799 Block-based vector allocation of small vectors.
12800 * lisp.h (struct vectorlike_header): New field `nbytes',
12801 adjust comment accordingly.
12802 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12803 to denote vector blocks. Adjust users (live_vector_p,
12804 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12805 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12806 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12807 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12808 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12809 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12810 (roundup_size): New constant.
12811 (struct vector_block): New data type.
12812 (vector_blocks, vector_free_lists, zero_vector): New variables.
12813 (all_vectors): Rename to `large_vectors'.
12814 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12815 (sweep_vectors): New functions.
12816 (allocate_vectorlike): Return `zero_vector' as the only vector of
12817 0 items. Allocate new vector from block if vector size is less than
12818 or equal to VBLOCK_BYTES_MAX.
12819 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12820 (init_alloc_once): Add call to init_vectors.
12821
12822 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12823
12824 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12825
12826 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12827
12828 * doprnt.c (doprnt): Truncate multibyte char correctly.
12829 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12830 would mishandle a string argument "Xc" if X was a multibyte
12831 character of length 2: it would truncate after X's first byte
12832 rather than including all of X.
12833
12834 2012-06-06 Chong Yidong <cyd@gnu.org>
12835
12836 * buffer.c (word_wrap): Doc fix.
12837
12838 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12839
12840 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12841
12842 2012-06-03 Glenn Morris <rgm@gnu.org>
12843
12844 * xdisp.c (tool-bar-style): Doc fix.
12845
12846 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12847
12848 * Makefile.in (PAXCTL): Define.
12849 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12850 binary via PaX flags if the paxctl utility is available.
12851 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12852 Restore PaX flags to their default. (Bug#11398)
12853
12854 2012-06-03 Chong Yidong <cyd@gnu.org>
12855
12856 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12857 buffer (Bug#11226).
12858
12859 2012-06-03 Chong Yidong <cyd@gnu.org>
12860
12861 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12862 (note_mode_line_or_margin_highlight): If there is no help echo,
12863 use mode-line-default-help-echo. Handle the case where the mouse
12864 position is past the end of the mode line string.
12865
12866 * buffer.c (buffer_local_value_1): New function, split from
12867 Fbuffer_local_value; can return Qunbound.
12868 (Fbuffer_local_value): Use it.
12869 (Vmode_line_format): Docstring tweaks.
12870
12871 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12872
12873 * sysdep.c (system_process_attributes): Improve comment.
12874
12875 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12876
12877 * keyboard.c: Export real-this-command to Elisp.
12878 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12879 and DEFVAR it. Update all users.
12880
12881 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12882
12883 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12884
12885 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12886 Convert pctcpu and pctmem to Lisp float properly.
12887 Let the compiler fold better, as 100.0/0x8000 is exact.
12888
12889 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12890
12891 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12892 cons_block.
12893
12894 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12895
12896 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12897
12898 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12899
12900 For a 'struct window', replace some Lisp_Object fields to
12901 bitfields where appropriate, remove unused fields.
12902 * window.h (struct window): Remove unused 'last_mark_x' and
12903 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12904 change its type from Lisp_Object to bitfield.
12905 Change type of 'force_start', 'optional_new_start',
12906 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12907 fields from Lisp_Object to bitfield. Adjust users accordingly.
12908
12909 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12910
12911 Pacify gcc -Wdouble-precision when using Xaw.
12912 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12913 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12914 Use 'float' consistently, rather than 'float' in most places
12915 and 'double' in a couple of places.
12916
12917 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12918
12919 * xdisp.c (handle_stop): Detect whether we have overlay strings
12920 loaded by testing it->current.overlay_string_index to be
12921 non-negative, instead of checking whether n_overlay_strings is
12922 positive. (Bug#11587)
12923
12924 2012-05-31 Chong Yidong <cyd@gnu.org>
12925
12926 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12927
12928 * doc.c (Fsubstitute_command_keys): Doc fix.
12929
12930 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12931
12932 * search.c (search_buffer): Remove calls to
12933 r_alloc_inhibit_buffer_relocation, as it is now called by
12934 maybe_unify_char, which was the cause of relocation of buffer text
12935 in bug#11519.
12936
12937 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12938
12939 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12940 for the duration of call to load_charset, to avoid problems with
12941 callers of maybe_unify_char that access buffer text through C
12942 pointers.
12943
12944 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12945 decrement the inhibition flag, instead of just setting or
12946 resetting it.
12947
12948 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12949
12950 Remove obsolete '#define static' cruft.
12951 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12952 This #undef was "temporary" in 2000; it is no longer needed
12953 now that '#define static' has gone away.
12954 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12955 (gray_bitmap_bits): Remove; no longer needed.
12956 All uses replaced with definiens.
12957 * xterm.c: Include "bitmaps/gray.xbm".
12958
12959 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12960
12961 Clean up __executable_start, monstartup when --enable-profiling.
12962 The following changes affect the code only when profiling.
12963 * dispnew.c (__executable_start): Rename from safe_bcopy.
12964 Define only on platforms that need it.
12965 * emacs.c: Include <sys/gmon.h> when profiling.
12966 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12967 (__executable_start): Remove decl, since lisp.h does it now.
12968 (safe_bcopy): Remove decl; no longer has that name.
12969 (main): Coalesce #if into single bit of code, for simplicity.
12970 Cast pointers to uintptr_t, since standard libraries want integers
12971 and not pointers.
12972 * lisp.h (__executable_start): New decl.
12973
12974 2012-05-31 Glenn Morris <rgm@gnu.org>
12975
12976 * image.c (Fimagemagick_types): Doc fix.
12977
12978 2012-05-30 Jim Meyering <meyering@redhat.com>
12979
12980 * callproc.c (Fcall_process_region): Include directory component
12981 in mkstemp error message (Bug#11586).
12982
12983 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12984
12985 * alloc.c, lisp.h (make_pure_vector): Now static.
12986
12987 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12988
12989 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12990 Move to byte-run.el.
12991 (Fautoload): Do the hash-doc more carefully.
12992 * data.c (Fdefalias): Purify definition, except for keymaps.
12993 (Qdefun): Move from eval.c.
12994 * lisp.h (Qdefun): Remove.
12995 * lread.c (read1): Tiny simplification.
12996
12997 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12998
12999 Do not create empty overlays with the evaporate property (Bug#9642).
13000 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13001 Bug#9642, but explicitly check that the buffer the overlay would
13002 be moved to is live and rearrange lines to make sure that errors
13003 will not put the overlay in an inconsistent state.
13004 (Fdelete_overlay): Cosmetics.
13005
13006 2012-05-28 Eli Zaretskii <eliz@gnu.org>
13007
13008 * w32term.c (my_bring_window_to_top): New function.
13009 (x_raise_frame): Use handle returned by DeferWindowPos, which
13010 could be different from the original one.
13011 Call my_bring_window_to_top instead of my_set_foreground_window.
13012 (Bug#11513)
13013
13014 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13015 by calling BringWindowToTop.
13016
13017 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13018 (WM_EMACS_END): Increase by one.
13019
13020 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13021
13022 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13023 This avoids undefined behavior that might cause the eassert
13024 to not catch an out-of-range value.
13025
13026 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
13027
13028 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13029 Update dependencies.
13030
13031 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13032
13033 * bidi.c (bidi_mirror_char): Fix last change.
13034
13035 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13036
13037 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13038 when referring to sectname field in printf format.
13039
13040 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13041
13042 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13043 Only r_alloc_inhibit_buffer_relocation needed to be added;
13044 the others were already declared.
13045
13046 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13047 before checking whether it's out of range. Put the check inside
13048 eassert. See
13049 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13050
13051 2012-05-27 Ken Brown <kbrown@cornell.edu>
13052
13053 * callproc.c (Fcall_process): Restore a line that was accidentally
13054 commented out in the 2011-02-13 change (bug#11547).
13055
13056 2012-05-27 Eli Zaretskii <eliz@gnu.org>
13057
13058 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13059 defined on ralloc.c.
13060
13061 * buffer.c [REL_ALLOC]: Remove prototypes of
13062 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13063 they are now on lisp.h.
13064
13065 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13066
13067 * search.c (search_buffer): Use it to inhibit relocation of buffer
13068 text while re_search_2 is doing its job, because re_search_2 is
13069 passed C pointers to buffer text. (Bug#11519)
13070
13071 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13072 Update value to 24.
13073
13074 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13075 state after an additional call to move_it_in_display_line_to, keep
13076 the values of it->max_ascent and it->max_descent found for the
13077 entire line.
13078 (pos_visible_p): Revert the comparison against bottom_y to what it
13079 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13080 (Bug#11464)
13081
13082 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13083
13084 Fix coding-related core dumps with gcc -ftrapv.
13085 The code was computing A - B, where A and B are pointers, and B is
13086 random garbage. This can lead to core dumps on platforms that
13087 have special pointer registers, and it also leads to core dumps on
13088 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13089 A - B only when B is initialized properly.
13090 * coding.c (coding_set_source, coding_set_destination): Return void.
13091 (coding_change_source, coding_change_destinations): New functions,
13092 with the old behaviors of coding_set_source and coding_set_destination.
13093 All callers that need an offset changed to use these new functions.
13094
13095 2012-05-26 Glenn Morris <rgm@gnu.org>
13096
13097 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13098
13099 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13100
13101 Extend mouse support on W32 text-mode console.
13102 * xdisp.c (draw_row_with_mouse_face):
13103 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13104
13105 * w32console.c: Include window.h.
13106 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13107 New functions.
13108 (initialize_w32_display): Initialize mouse-highlight data.
13109
13110 * w32inevt.c: Include termchar.h and window.h.
13111 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13112 moves, call note_mouse_highlight. If help_echo changed, call
13113 gen_help_event to produce help-echo message in the echo area.
13114 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13115 highlight info.
13116
13117 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13118
13119 * lread.c (read1): Simplify slightly to avoid an overflow warning
13120 with GCC 4.7.0 on x86-64.
13121
13122 2012-05-26 Eli Zaretskii <eliz@gnu.org>
13123
13124 * bidi.c (bidi_mirror_char): Revert last change: an int is
13125 definitely wide enough here.
13126
13127 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13128
13129 Fix integer width and related bugs (Bug#9874).
13130 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13131 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13132 (string_bytes, check_sblock, allocate_string_data):
13133 (compact_small_strings, Fmake_bool_vector, make_string)
13134 (make_unibyte_string, make_multibyte_string)
13135 (make_string_from_bytes, make_specified_string)
13136 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13137 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13138 (mark_vectorlike):
13139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13140 (allocate_pseudovector):
13141 Use int, not EMACS_INT, where int is wide enough.
13142 (inhibit_garbage_collection, Fgarbage_collect):
13143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13144 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13145 int might not be wide enough.
13146 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13147 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13148 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13149 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13150 (bidi_level_of_next_char, bidi_move_to_visually_next):
13151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13152 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13153 (Fkill_buffer, Fset_buffer_major_mode)
13154 (advance_to_char_boundary, Fbuffer_swap_text)
13155 (Fset_buffer_multibyte, overlays_at, overlays_in)
13156 (overlay_touches_p, struct sortvec, record_overlay_string)
13157 (overlay_strings, recenter_overlay_lists)
13158 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13159 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13160 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13161 (Foverlay_recenter, last_overlay_modification_hooks_used)
13162 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13164 (validate_region): Omit unnecessary test for b <= e,
13165 since that's guaranteed by the previous test.
13166 (adjust_overlays_for_delete): Avoid pos + length overflow.
13167 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13168 (report_overlay_modification):
13169 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13170 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13171 Omit pointer cast, which isn't needed anyway, and doesn't work
13172 after the EMACS_INT -> ptrdiff_t change.
13173 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13174 * buffer.h: Adjust decls to match defn changes elsewhere.
13175 (struct buffer_text, struct buffer):
13176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13177 Use EMACS_INT, not int, where int might not be wide enough.
13178 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13179 not int, to avoid needless 32-bit limit on 64-bit hosts.
13180 (exec_byte_code): Use tighter memory-full test, one that checks
13181 for alloca overflow. Don't compute the address of the object just
13182 before an array, as that's not portable. Use EMACS_INT, not
13183 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13184 * callint.c (Fcall_interactively):
13185 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13186 * callproc.c (call_process_kill, Fcall_process):
13187 Don't assume pid_t fits into an Emacs fixnum.
13188 (call_process_cleanup, Fcall_process, child_setup):
13189 Don't assume pid_t fits into int.
13190 (call_process_cleanup, Fcall_process, delete_temp_file)
13191 (Fcall_process_region):
13192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13193 (Fcall_process): Simplify handling of volatile integers.
13194 Use int, not EMACS_INT, where int will do.
13195 * casefiddle.c (casify_object, casify_region, operate_on_word)
13196 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13198 (casify_object): Avoid integer overflow when overallocating buffer.
13199 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13200 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13201 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13202 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13203 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13204 integers are now checked earlier. All uses replaced with XINT.
13205 (ccl_driver):
13206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13207 For CCL_MapSingle, check that content and value are in int range.
13208 (ccl_driver, Fregister_code_conversion_map):
13209 Check that Vcode_version_map_vector is a vector.
13210 (resolve_symbol_ccl_program): Check that vector header is in range.
13211 Always copy the vector, so that we can check its contents reliably
13212 now rather than having to recheck each instruction as it's being
13213 executed. Check that vector words fit in 'int'.
13214 (ccl_get_compiled_code, Fregister_ccl_program)
13215 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13216 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13217 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13218 contents are in range.
13219 (Fccl_execute_on_string): Check that status is in range.
13220 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13221 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13222 Accept and return EMACS_INT, not int, because callers can pass values
13223 out of 'int' range.
13224 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13225 (multibyte_chars_in_text, parse_str_as_multibyte)
13226 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13227 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13228 (string_escape_byte8, Fget_byte):
13229 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13230 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13231 avoid mishandling large integers.
13232 * character.h: Adjust decls to match defn changes elsewhere.
13233 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13234 (Ffind_charset_region):
13235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13236 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13237 (load_charset_map_from_vector, Fdefine_charset_internal):
13238 Don't assume fixnum fits in int.
13239 (load_charset_map_from_vector, Fmap_charset_chars):
13240 Remove now-unnecessary CHECK_NATNUMs.
13241 (Fdefine_charset_internal): Check ranges here, more carefully.
13242 Don't rely on undefined behavior with signed left shift overflow.
13243 Don't assume unsigned int fits into fixnum, or that fixnum fits
13244 into unsigned int. Don't require max_code to be a valid fixnum;
13245 that's not true for gb10830 4-byte on a 32-bit host. Allow
13246 invalid_code to be a cons, for the same reason. Require code_offset
13247 to be a character. Avoid int overflow if max_char is close
13248 to INT_MAX.
13249 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13250 this is intended anyway and avoids some undefined behavior.
13251 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13252 INDEX_TO_CODE_POINT, as that's what it expects.
13253 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13254 * charset.h (DECODE_CHAR): Return int, not unsigned;
13255 this is what was intended anyway, and it avoids undefined behavior.
13256 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13257 integer-overflow issues.
13258 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13259 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13260 where the argument is EMACS_INT, and this behavior is not intended.
13261 * chartab.c (Fmake_char_table, Fset_char_table_range)
13262 (uniprop_get_decoder, uniprop_get_encoder):
13263 Don't assume fixnum fits in int.
13264 * cmds.c (move_point): New function, that does the gist of
13265 Fforward_char and Fbackward_char, but does so while checking
13266 for integer overflow more accurately.
13267 (Fforward_char, Fbackward_char): Use it.
13268 (Fforward_line, Fend_of_line, internal_self_insert)
13269 (internal_self_insert):
13270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13271 Fix a FIXME, by checking for integer overflow when calculating
13272 target_clm and actual_clm.
13273 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13274 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13275 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13276 (coding_alloc_by_making_gap, alloc_destination)
13277 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13278 (encode_coding_utf_16, detect_coding_emacs_mule)
13279 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13280 (detect_coding_iso_2022, decode_coding_iso_2022)
13281 (encode_invocation_designation, encode_designation_at_bol)
13282 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13283 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13284 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13285 (encode_coding_ccl, encode_coding_raw_text)
13286 (detect_coding_charset, decode_coding_charset)
13287 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13288 (produce_composition, produce_charset, produce_annotation)
13289 (decode_coding, handle_composition_annotation)
13290 (handle_charset_annotation, consume_chars, decode_coding_gap)
13291 (decode_coding_object, encode_coding_object, detect_coding_system)
13292 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13293 (code_convert_region, code_convert_string)
13294 (Fdefine_coding_system_internal)
13295 (coding_set_source, coding_set_destination):
13296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13297 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13298 (Fdefine_coding_system_internal):
13299 Don't assume fixnums fit in int.
13300 (decode_coding_gap, decode_coding_object, encode_coding_object)
13301 (Fread_coding_system, Fdetect_coding_region)
13302 (Funencodable_char_position, Fcheck_coding_systems_region)
13303 (get_translation, handle_composition_annotation, consume_chars):
13304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13305 (consume_chars): Rewrite to not calculate an address outside buffer.
13306 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13307 Don't access memory outside of the args array.
13308 (Fdefine_coding_system_internal): Check for charset-id overflow.
13309 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13310 result of ENCODE_CHAR.
13311 * coding.h: Adjust decls to match defn changes elsewhere.
13312 (struct coding_system):
13313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13314 * composite.c (get_composition_id, find_composition)
13315 (run_composition_function, update_compositions)
13316 (compose_text, composition_gstring_put_cache)
13317 (composition_gstring_p, composition_gstring_width)
13318 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13319 (composition_compute_stop_pos, composition_reseat_it)
13320 (composition_update_it, struct position_record)
13321 (find_automatic_composition, composition_adjust_point)
13322 (Fcomposition_get_gstring, Ffind_composition_internal):
13323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13324 (update_compositions):
13325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13326 * composite.h: Adjust decls to match defn changes elsewhere.
13327 (struct composition):
13328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13329 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13330 Do not attempt to compute the address of the object just before a
13331 buffer; this is not portable.
13332 (Faref, Faset):
13333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13334 (Faset): Use int, not EMACS_INT, where int is wide enough.
13335 (Fstring_to_number): Don't assume fixnums fit in int.
13336 (Frem): Don't assume arg is nonnegative.
13337 * dbusbind.c (xd_append_arg): Check for integers out of range.
13338 (Fdbus_call_method): Don't overflow the timeout int.
13339 (extract_signed, extract_unsigned): New functions.
13340 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13341 (xd_get_connection_references): Return ptrdiff_t, not int.
13342 All uses changed.
13343 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13344 (xd_read_message_1):
13345 Use int, not unsigned, where the dbus API uses int.
13346 (Fdbus_message_internal): Don't overflow mtype.
13347 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13348 * dired.c (directory_files_internal, file_name_completion, scmp)
13349 (file_name_completion_stat):
13350 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13351 (file_name_completion): Don't overflow matchcount.
13352 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13353 * dispextern.h: Adjust decls to match defn changes elsewhere.
13354 (struct text_pos, struct glyph, struct bidi_saved_info)
13355 (struct bidi_string_data, struct bidi_it, struct composition_it)
13356 (struct it):
13357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13358 (struct display_pos, struct composition_it, struct it):
13359 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13360 * dispnew.c (increment_matrix_positions)
13361 (increment_row_positions, mode_line_string)
13362 (marginal_area_string):
13363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13364 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13365 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13366 (duration_to_sec_usec): New function, to check for overflow better.
13367 (Fsleep_for, sit_for): Use it.
13368 * doc.c (get_doc_string, store_function_docstring):
13369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13370 (get_doc_string, Fsnarf_documentation):
13371 Use int, not EMACS_INT, where int is wide enough.
13372 (get_doc_string):
13373 Use SAFE_ALLOCA, not alloca.
13374 Check for overflow when converting EMACS_INT to off_t.
13375 * doprnt.c (doprnt):
13376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13377 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13378 Don't assume uid_t fits into fixnum.
13379 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13380 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13381 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13382 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13383 (general_insert_function)
13384 (Finsert_char, make_buffer_string, make_buffer_string_both)
13385 (update_buffer_properties, Fbuffer_substring)
13386 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13387 (Fsubst_char_in_region, check_translation)
13388 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13389 (transpose_markers, Ftranspose_regions):
13390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13391 (clip_to_bounds): Move to lisp.h as an inline function).
13392 (Fconstrain_to_field): Don't assume integers are nonnegative.
13393 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13394 (Fsubst_char_in_region, Fsave_restriction):
13395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13396 (Femacs_pid): Don't assume pid_t fits into fixnum.
13397 (lo_time): Use int, not EMACS_INT, when int suffices.
13398 (lisp_time_argument): Check for usec out of range.
13399 (Fencode_time): Don't assume fixnum fits in int.
13400 (Fuser_login_name, Fuser_full_name): Signal an error
13401 if a uid argument is out of range, rather than relying on
13402 undefined behavior.
13403 (Fformat_time_string): Remove now-unnecessary check.
13404 lisp_time_argument checks for out-of-range usec now.
13405 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13406 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13407 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13408 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13409 (init_cmdargs, Fdump_emacs):
13410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13411 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13412 the bottom (typically) 32 bits of the fixnum.
13413 * eval.c (specpdl_size, call_debugger):
13414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13415 (when_entered_debugger, Fbacktrace_debug):
13416 Don't assume fixnum can fit in int.
13417 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13418 the object just before a buffer; this is not portable.
13419 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13420 (grow_specpdl, unbind_to):
13421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13422 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13423 (grow_specpdl): Simplify allocation by using xpalloc.
13424 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13425 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13426 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13428 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13429 (a_write, e_write):
13430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13431 (Fcopy_file, non_regular_nbytes, read_non_regular)
13432 (Finsert_file_contents):
13433 Use int, not EMACS_INT, where int is wide enough.
13434 (READ_BUF_SIZE): Verify that it fits in int.
13435 (Finsert_file_contents): Check that counts are in proper range,
13436 rather than assuming fixnums fit into ptrdiff_t etc.
13437 Don't assume fixnums fit into int.
13438 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13439 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13440 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13441 (string_char_to_byte, string_byte_to_char)
13442 (string_make_multibyte, string_to_multibyte)
13443 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13444 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13445 (substring_both, Fdelete, internal_equal, Ffillarray)
13446 (Fclear_string, mapcar1)
13447 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13448 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13449 (larger_vector, make_hash_table, maybe_resize_hash_table)
13450 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13451 (Fmaphash, secure_hash):
13452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13453 (concat): Check for string index and length overflow.
13454 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13455 (Frequire):
13456 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13457 (larger_vector): New API (vec, incr_min, size_max) replaces old
13458 one (vec, new_size, init). This catches size overflow.
13459 INIT was removed because it was always Qnil.
13460 All callers changed.
13461 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13462 the upper bound on a hash table index size.
13463 (make_hash_table, maybe_resize_hash_table): Use it.
13464 (secure_hash): Computer start_byte and end_byte only after
13465 they're known to be in ptrdiff_t range.
13466 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13467 (Ffont_get_glyphs, Ffont_at):
13468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13469 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13470 (Flist_fonts, Fopen_font):
13471 Don't assume fixnum can fit in int.
13472 (check_gstring): Don't assume index can fit in int.
13473 (font_match_p): Check that fixnum is a character, not a nonnegative
13474 fixnum, since the later code needs to stuff it into an int.
13475 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13476 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13477 conversion overflow issues.
13478 (Fopen_font): Check for integer out of range.
13479 (Ffont_get_glyphs): Don't assume index can fit in int.
13480 * font.h: Adjust decls to match defn changes elsewhere.
13481 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13482 integer overflow.
13483 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13484 printmax_t, where ptrdiff_t is wide enough.
13485 (Finternal_char_font):
13486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13487 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13488 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13489 (Fset_frame_position, x_set_frame_parameters)
13490 (x_set_line_spacing, x_set_border_width)
13491 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13492 Check that fixnums are in proper range for system types.
13493 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13495 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13496 Use SAFE_ALLOCA_LISP, not alloca.
13497 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13498 intptr_t is wide enough.
13499 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13500 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13501 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13502 Check for fixnum out of range.
13503 * ftfont.c (ftfont_list): Don't assume index fits in int.
13504 Check that fixnums are in proper range for system types.
13505 (ftfont_shape_by_flt):
13506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13507 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13509 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13510 Check that fixnums are in proper range for system types.
13511 * gnutls.h: Adjust decls to match defn changes elsewhere.
13512 * gtkutil.c (xg_dialog_run):
13513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13514 (update_frame_tool_bar):
13515 Check that fixnums are in proper range for system types.
13516 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13517 (lookup_image): Check that fixnums are in range for system types.
13518 * indent.c (last_known_column, last_known_column_point):
13519 (current_column_bol_cache):
13520 (skip_invisible, current_column, check_display_width):
13521 (check_display_width, scan_for_column, current_column_1)
13522 (Findent_to, Fcurrent_indentation, position_indentation)
13523 (indented_beyond_p, Fmove_to_column, compute_motion):
13524 (Fcompute_motion, Fvertical_motion):
13525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13526 (last_known_column_modified): Use EMACS_INT, not int.
13527 (check_display_width):
13528 (Fcompute_motion):
13529 Check that fixnums and floats are in proper range for system types.
13530 (compute_motion): Don't assume index or fixnum fits in int.
13531 (compute_motion, Fcompute_motion):
13532 Use int, not EMACS_INT, when it is wide enough.
13533 (vmotion): Omit local var start_hpos that is always 0; that way
13534 we don't need to worry about overflow in expressions involving it.
13535 * indent.h: Adjust decls to match defn changes elsewhere.
13536 (struct position):
13537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13538 Use int, not EMACS_INT, where int is wide enough.
13539 Remove unused members ovstring_chars_done and tab_offset;
13540 all uses removed.
13541 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13542 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13543 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13544 (make_gap, copy_text, insert, insert_and_inherit)
13545 (insert_before_markers, insert_before_markers_and_inherit)
13546 (insert_1, count_combining_before, count_combining_after)
13547 (insert_1_both, insert_from_string)
13548 (insert_from_string_before_markers, insert_from_string_1)
13549 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13550 (adjust_after_replace, adjust_after_insert, replace_range)
13551 (replace_range_2, del_range, del_range_1, del_range_byte)
13552 (del_range_both, del_range_2, modify_region)
13553 (prepare_to_modify_buffer, signal_before_change)
13554 (signal_after_change, Fcombine_after_change_execute):
13555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13556 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13557 (balance_an_interval, split_interval_right, split_interval_left)
13558 (find_interval, next_interval, update_interval)
13559 (adjust_intervals_for_insertion, delete_node, delete_interval)
13560 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13561 (static_offset_intervals, offset_intervals)
13562 (merge_interval_right, merge_interval_left, make_new_interval)
13563 (graft_intervals_into_buffer, temp_set_point_both)
13564 (temp_set_point, set_point, adjust_for_invis_intang)
13565 (set_point_both, move_if_not_intangible, get_property_and_range)
13566 (get_local_map, copy_intervals, copy_intervals_to_string)
13567 (compare_string_intervals, set_intervals_multibyte_1):
13568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13569 * intervals.h: Adjust decls to match defn changes elsewhere.
13570 (struct interval):
13571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13572 * keyboard.c (this_command_key_count, this_single_command_key_start)
13573 (before_command_key_count, before_command_echo_length, echo_now)
13574 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13575 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13576 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13577 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13579 (last_non_minibuf_size, last_point_position, echo_truncate)
13580 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13581 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13582 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13583 (stuff_buffered_input):
13584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13585 (last_auto_save, command_loop_1, read_char):
13586 Use EMACS_INT, not int, to avoid integer overflow.
13587 (record_char): Avoid overflow in total_keys computation.
13588 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13589 * keyboard.h: Adjust decls to match defn changes elsewhere.
13590 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13591 (Fkey_description, Fdescribe_vector, Flookup_key):
13592 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13593 (click_position): New function, to check that positions are in range.
13594 (Fcurrent_active_maps):
13595 (describe_command):
13596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13597 (Faccessible_keymaps, Fkey_description):
13598 (preferred_sequence_p):
13599 Don't assume fixnum can fit into int.
13600 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13601 Check for integer overflow in size calculations.
13602 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13603 avoid mishandling large integers.
13604 * lisp.h: Adjust decls to match defn changes elsewhere.
13605 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13606 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13607 (struct Lisp_Marker):
13608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13609 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13610 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13611 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13612 All callers changed.
13613 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13614 Assume the arg has valid form, since it always does.
13615 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13616 unsigned integer system type.
13617 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13618 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13620 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13621 (duration_to_sec_usec): New decl.
13622 * lread.c (read_from_string_index, read_from_string_index_byte)
13623 (read_from_string_limit, readchar, unreadchar, openp)
13624 (read_internal_start, read1, oblookup):
13625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13626 (Fload, readevalloop, Feval_buffer, Feval_region):
13627 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13628 (openp): Check for out-of-range argument to 'access'.
13629 (read1): Use int, not EMACS_INT, where int is wide enough.
13630 Don't assume fixnum fits into int.
13631 Fix off-by-one error that can read outside a buffer.
13632 (read_filtered_event): Use duration_to_sec_usec
13633 to do proper overflow checking on durations.
13634 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13635 in size calculation.
13636 (Fexecute_kbd_macro):
13637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13638 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13639 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13640 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13641 (set_marker_both, set_marker_restricted_both, marker_position)
13642 (marker_byte_position, Fbuffer_has_markers_at):
13643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13644 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13645 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13646 It now merely ensures that the menu is large enough, without
13647 necessarily growing it, as this avoids some integer overflow issues.
13648 All callers changed.
13649 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13650 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13651 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13652 Use SAFE_ALLOCA_LISP, not alloca.
13653 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13654 to EMACS_INT. Check that fixnums are in proper range for system types.
13655 * minibuf.c (minibuf_prompt_width, string_to_object)
13656 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13657 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13659 (get_minibuffer, read_minibuf_unwind):
13660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13661 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13662 this simplifies overflow checking. All callers changed.
13663 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13664 (Ftest_completion):
13665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13666 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13667 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13668 Check that fixnums are in proper range for system types.
13669 (Fx_create_frame, Fx_show_tip):
13670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13671 * nsfont.m (ns_findfonts, nsfont_list_family):
13672 Don't assume fixnum fits in long.
13673 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13675 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13676 wide enough.
13677 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13679 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13680 (PRINTDECLARE, PRINTPREPARE):
13681 (strout, print_string):
13682 (print, print_preprocess, print_check_string_charset_prop)
13683 (print_object):
13684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13685 (PRINTDECLARE):
13686 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13688 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13689 (printchar, strout): Use xpalloc to catch size calculation overflow.
13690 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13691 (print_error_message): Use SAFE_ALLOCA, not alloca.
13692 (print_object): Use int, not EMACS_INT, where int is wide enough.
13693 (print_depth, new_backquote_output, print_number_index):
13694 Use ptrdiff_t, not int, where int might not be wide enough.
13695 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13696 (Fset_process_window_size, Fformat_network_address)
13697 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13698 (sigchld_handler):
13699 Check that fixnums are in proper range for system types.
13700 (Fsignal_process): Simplify by avoiding a goto.
13701 Check for process-ids out of pid_t range rather than relying on
13702 undefined behavior.
13703 (process_tick, update_tick): Use EMACS_INT, not int.
13704 (Fformat_network_address, read_process_output, send_process)
13705 (Fprocess_send_region, status_notify):
13706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13707 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13708 (wait_reading_process_output, read_process_output, exec_sentinel):
13709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13710 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13711 (Faccept_process_output): Use duration_to_sec_usec to do proper
13712 overflow checking on durations.
13713 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13714 Don't assume pid_t fits in int.
13715 * process.h (struct Lisp_Process): Members tick and update_tick
13716 are now of type EMACS_INT, not int.
13717 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13718 configured --with-wide-int.
13719 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13720 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13721 * search.c (looking_at_1, string_match_1):
13722 (fast_string_match, fast_c_string_match_ignore_case)
13723 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13724 (scan_newline, find_before_next_newline, search_command)
13725 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13726 (set_search_regs, wordify):
13727 (Freplace_match):
13728 (Fmatch_data):
13729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13730 (string_match_1, search_buffer, set_search_regs):
13731 (Fmatch_data):
13732 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13733 (wordify): Check for overflow in size calculation.
13734 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13735 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13736 Check that fixnums are in proper range for system types.
13737 * sound.c (struct sound_device)
13738 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13740 (Fplay_sound_internal):
13741 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13742 * syntax.c (struct lisp_parse_state, find_start_modiff)
13743 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13744 (Fparse_partial_sexp):
13745 Don't assume fixnums can fit in int.
13746 (struct lisp_parse_state, find_start_pos, find_start_value)
13747 (find_start_value_byte, find_start_begv)
13748 (update_syntax_table, char_quoted, dec_bytepos)
13749 (find_defun_start, prev_char_comend_first, back_comment):
13750 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13751 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13753 (Finternal_describe_syntax_value): Check that match_lisp is a
13754 character, not an integer, since the code stuffs it into int.
13755 (scan_words, scan_sexps_forward):
13756 Check that fixnums are in proper range for system types.
13757 (Fforward_word):
13758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13759 (scan_sexps_forward):
13760 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13761 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13762 * syntax.h: Adjust decls to match defn changes elsewhere.
13763 (struct gl_state_s):
13764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13765 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13766 MOST_POSITIVE_FIXNUM.
13767 * sysdep.c (wait_for_termination_1, wait_for_termination)
13768 (interruptible_wait_for_termination, mkdir):
13769 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13770 (emacs_read, emacs_write):
13771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13772 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13773 and double all fit in int.
13774 * term.c (set_tty_color_mode):
13775 Check that fixnums are in proper range for system types.
13776 * termhooks.h (struct input_event):
13777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13778 * textprop.c (validate_interval_range, interval_of)
13779 (Fadd_text_properties, set_text_properties_1)
13780 (Fremove_text_properties, Fremove_list_of_text_properties)
13781 (Ftext_property_any, Ftext_property_not_all)
13782 (copy_text_properties, text_property_list, extend_property_ranges)
13783 (verify_interval_modification):
13784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13785 (Fnext_single_char_property_change)
13786 (Fprevious_single_char_property_change):
13787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13788 (copy_text_properties):
13789 Check for integer overflow in index calculation.
13790 * undo.c (last_boundary_position, record_point, record_insert)
13791 (record_delete, record_marker_adjustment, record_change)
13792 (record_property_change):
13793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13794 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13796 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13797 (Fx_hide_tip, Fx_file_dialog):
13798 * w32menu.c (set_frame_menubar):
13799 Use ptrdiff_t, not int, for consistency with rest of code.
13800 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13801 (select_window, Fdelete_other_windows_internal)
13802 (window_scroll_pixel_based, window_scroll_line_based)
13803 (Frecenter, Fset_window_configuration):
13804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13805 (Fset_window_hscroll, run_window_configuration_change_hook)
13806 (set_window_buffer, temp_output_buffer_show, scroll_command)
13807 (Fscroll_other_window, Frecenter):
13808 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13809 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13810 Don't assume fixnum fits in int.
13811 (Fset_window_scroll_bars):
13812 Check that fixnums are in proper range for system types.
13813 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13814 (string_pos, c_string_pos, number_of_chars, init_iterator)
13815 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13816 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13817 (compute_display_string_end, handle_face_prop)
13818 (face_before_or_after_it_pos, handle_invisible_prop)
13819 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13820 (display_prop_intangible_p, string_buffer_position_lim)
13821 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13822 (get_overlay_strings_1, get_overlay_strings)
13823 (iterate_out_of_display_property, forward_to_next_line_start)
13824 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13825 (get_next_display_element, set_iterator_to_next)
13826 (get_visually_first_element, compute_stop_pos_backwards)
13827 (handle_stop_backwards, next_element_from_buffer)
13828 (move_it_in_display_line_to, move_it_in_display_line)
13829 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13830 (add_to_log, message_dolog, message_log_check_duplicate)
13831 (message2, message2_nolog, message3, message3_nolog
13832 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13833 (current_message_1, truncate_echo_area, truncate_message_1)
13834 (set_message, set_message_1, store_mode_line_noprop)
13835 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13836 (text_outside_line_unchanged_p, check_point_in_composition)
13837 (reconsider_clip_changes)
13838 (redisplay_internal, set_cursor_from_row, try_scrolling)
13839 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13840 (redisplay_window, find_last_unchanged_at_beg_row)
13841 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13842 (trailing_whitespace_p, find_row_edges, display_line)
13843 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13844 (display_mode_element, store_mode_line_string)
13845 (pint2str, pint2hrstr, decode_mode_spec)
13846 (display_count_lines, display_string, draw_glyphs)
13847 (x_produce_glyphs, x_insert_glyphs)
13848 (rows_from_pos_range, mouse_face_from_buffer_pos)
13849 (fast_find_string_pos, mouse_face_from_string_pos)
13850 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13852 (safe_call, init_from_display_pos, handle_fontified_prop)
13853 (handle_single_display_spec, load_overlay_strings)
13854 (with_echo_area_buffer, setup_echo_area_for_printing)
13855 (display_echo_area, echo_area_display)
13856 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13857 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13858 (redisplay_window, dump_glyph_row, display_mode_line)
13859 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13860 (handle_display_spec, display_prop_string_p):
13861 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13862 (handle_single_display_spec, build_desired_tool_bar_string)
13863 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13864 (get_specified_cursor_type):
13865 Check that fixnums are in proper range for system types.
13866 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13867 (Flookup_image_map):
13868 Don't assume fixnums fit in int.
13869 (compare_overlay_entries):
13870 Avoid mishandling comparisons due to subtraction overflow.
13871 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13872 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13873 (handle_tool_bar_click):
13874 Use int, not unsigned, since we prefer signed and the signedness
13875 doesn't matter here.
13876 (get_next_display_element, next_element_from_display_vector):
13877 Use int, not EMACS_INT, when int is wide enough.
13878 (start_hourglass): Use duration_to_sec_usec to do proper
13879 overflow checking on durations.
13880 * xfaces.c (Fbitmap_spec_p):
13881 Check that fixnums are in proper range for system types.
13882 (compare_fonts_by_sort_order):
13883 Avoid mishandling comparisons due to subtraction overflow.
13884 (Fx_family_fonts, realize_basic_faces):
13885 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13886 (Fx_family_fonts):
13887 Don't assume fixnum fits in int.
13888 Use SAFE_ALLOCA_LISP, not alloca.
13889 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13890 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13891 (face_at_buffer_position, face_for_overlay_string)
13892 (face_at_string_position):
13893 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13894 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13895 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13896 (Fx_show_tip):
13897 Check that fixnums are in proper range for system types.
13898 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13899 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13901 (Fx_change_window_property): Don't assume fixnums fit in int.
13902 * xfont.c (xfont_chars_supported):
13903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13904 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13905 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13907 * xml.c (parse_region):
13908 * xrdb.c (magic_file_p):
13909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13910 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13911 (x_get_local_selection, x_reply_selection_request)
13912 (x_handle_selection_request, wait_for_property_change):
13913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13914 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13915 short is wide enough.
13916 (x_send_client_event): Don't assume fixnum fits in int.
13917 * xterm.c (x_x_to_emacs_modifiers):
13918 Don't assume EMACS_INT overflows nicely into int.
13919 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13920 may come from Lisp.
13921 (handle_one_xevent): NATNUMP can eval its arg twice.
13922 (x_connection_closed):
13923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13924 * xterm.h: Adjust decls to match defn changes elsewhere.
13925 (struct scroll_bar): Use struct vectorlike_header
13926 rather than rolling our own approximation.
13927 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13928
13929 2012-05-25 Glenn Morris <rgm@gnu.org>
13930
13931 * lisp.mk (lisp): Update for more files being compiled now.
13932
13933 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13934
13935 * lread.c: Remove `read_pure' which makes no difference.
13936 (read_pure): Remove var.
13937 (unreadpure): Remove function.
13938 (readevalloop): Don't call read_list with -1 flag.
13939 (read1, read_vector): Don't test read_pure any more.
13940 (read_list): Simplify.
13941
13942 * fileio.c, character.h: Minor style tweaks.
13943
13944 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13945
13946 * window.h (clip_changed): Remove useless declaration.
13947
13948 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13949
13950 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13951 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13952
13953 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13954
13955 Remove src/m/*.
13956 This directory predates autoconf and is no longer needed nowadays.
13957 Move its few remaining bits of functionality to where they're needed.
13958 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13959 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13960 * m/template.h: Remove.
13961 * Makefile.in (M_FILE): Remove. All uses removed.
13962 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13963 * lisp.h (USE_LSB_TAG):
13964 * mem-limits.h (EXCEEDS_LISP_PTR):
13965 Use VAL_MAX, not VALBITS, in #if.
13966 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13967 (EMACS_UINT): Define unconditionally now.
13968 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13969 (BITS_PER_EMACS_INT): New constants, replacing
13970 what used to be in config.h, but not useful in #if.
13971 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13972 define them any more.
13973 (VAL_MAX): New macro.
13974 (VALMASK): Use it.
13975 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13976 BITS_PER_EMACS_INT, in #if.
13977 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13978 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13979 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13980 * s/ms-w32.h (DATA_START):
13981 Move here from removed file m/intel386.h.
13982 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13983 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13984
13985 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13986
13987 Assume C89 or later.
13988 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13989 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13990 (xrealloc):
13991 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13992 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13993 * textprop.c, tparam.c (NULL): Remove.
13994 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13995 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13996 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13997 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13998 * xterm.c (input_signal_count): Assume volatile works.
13999
14000 2012-05-21 Ken Brown <kbrown@cornell.edu>
14001
14002 * xgselect.c (xg_select): Fix first argument in call to 'select'
14003 (bug#11508).
14004
14005 2012-05-20 Ken Brown <kbrown@cornell.edu>
14006
14007 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14008 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14009
14010 2012-05-19 Ken Brown <kbrown@cornell.edu>
14011
14012 * xfns.c (x_in_use): Remove `static' qualifier.
14013 * xterm.h (x_in_use): Declare.
14014 * xgselect.c: Include xterm.h.
14015 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14016 and `display_arg' (bug#9754).
14017
14018 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14019
14020 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14021
14022 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14023 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14024
14025 2012-05-18 Eli Zaretskii <eliz@gnu.org>
14026
14027 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14028
14029 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14030 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14031
14032 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14033 reference to image_cache->refcount.
14034 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14035
14036 2012-05-17 Juri Linkov <juri@jurta.org>
14037
14038 * search.c (Fword_search_regexp, Fword_search_backward)
14039 (Fword_search_forward, Fword_search_backward_lax)
14040 (Fword_search_forward_lax): Move functions to isearch.el
14041 (bug#10145, bug#11381).
14042
14043 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14044
14045 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14046
14047 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14048
14049 * lread.c (init_obarray): Declare Qt and Qnil as special.
14050
14051 2012-05-14 Glenn Morris <rgm@gnu.org>
14052
14053 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14054 Put "libexec" before "bin", for the sake of init_callproc_1.
14055
14056 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14057
14058 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14059
14060 * unexaix.c: Port to more-recent AIX compilers.
14061 (report_error, report_error_1, make_hdr, copy_sym)
14062 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14063 Make arguments const char *, not char *, to avoid violations of C
14064 standard and to fix some AIX warnings reported by Gilles Pion.
14065
14066 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14067
14068 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14069 already have overlays loaded.
14070 (handle_single_display_spec): Before returning without displaying
14071 fringe bitmap, synchronize the bidi iterator with the main display
14072 iterator, by calling iterate_out_of_display_property.
14073 (iterate_out_of_display_property): Detect buffer iteration by
14074 testing that it->string is a Lisp string.
14075 (get_next_display_element): When the current object is exhausted,
14076 and there's something on it->stack, call set_iterator_to_next to
14077 proceed with what's on the stack, instead of returning zero.
14078 (set_iterator_to_next): If called at the end of a Lisp string,
14079 proceed to consider_string_end without incrementing string
14080 position. Don't increment display vector index past the end of
14081 the display vector. (Bug#11417)
14082 (pos_visible_p): Don't report a position visible when move_it_to
14083 stopped at the last line of window, which happens to be scanned
14084 backwards by the bidi iteration. (Bug#11464)
14085
14086 2012-05-14 Eli Zaretskii <eliz@gnu.org>
14087
14088 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14089 and right-margin display specs even if the spec is invalid or we
14090 are on a TTY, and thus unable to display on the fringes.
14091 That's because the text with the property will not be displayed anyway,
14092 so we need to signal to the caller that this is a "replacing"
14093 display spec. This fixes display when the spec is invalid or we
14094 are on a TTY.
14095
14096 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14097
14098 * unexaix.c (make_hdr): Fix typo in prototype.
14099 This bug broke the build on AIX. Problem reported by Gilles Pion.
14100
14101 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
14102
14103 * keyboard.c (kbd_buffer_get_event): Read special events also in
14104 batch mode. (Bug#11415)
14105
14106 2012-05-12 Glenn Morris <rgm@gnu.org>
14107
14108 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14109
14110 2012-05-12 Eli Zaretskii <eliz@gnu.org>
14111
14112 * lisp.mk (lisp): Add newcomment.elc.
14113
14114 2012-05-12 Glenn Morris <rgm@gnu.org>
14115
14116 * Makefile.in (MKDIR_P): New, set by configure.
14117 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14118
14119 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14120
14121 Remove unused function hourglass_started.
14122 * dispextern.h (hourglass_started):
14123 * w32fns.c (hourglass_started):
14124 * xdisp.c (hourglass_started): Remove.
14125
14126 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
14127
14128 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14129 Update dependencies.
14130
14131 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14132
14133 * xgselect.c (xg_select): Put maxfds+1 into a var.
14134 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14135
14136 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14137
14138 2012-05-10 Dave Abrahams <dave@boostpro.com>
14139
14140 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14141 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14142
14143 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
14144
14145 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14146 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14147 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14148 Initialize xd_registered_buses.
14149
14150 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14151
14152 Untag more efficiently if USE_LSB_TAG.
14153 This is based on a proposal by YAMAMOTO Mitsuharu in
14154 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14155 For an admittedly artificial (nth 8000 longlist) benchmark on
14156 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14157 Emacs's overall text size by 1%.
14158 * lisp.h (XUNTAG): New macro.
14159 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14160 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14161 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14162 * eval.c (Fautoload):
14163 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14164 * frame.h (XFRAME): Use XUNTAG.
14165
14166 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14167 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14168 Remove unportable assumptions about print widths of types like
14169 dbus_uint32_t.
14170 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14171 intptr_t when converting between pointer and integer, to avoid GCC
14172 warnings about wrong width.
14173
14174 2012-05-09 Eli Zaretskii <eliz@gnu.org>
14175
14176 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14177 stack for each reader_thread, instead of defaulting to 8MB
14178 determined by the linker. This avoids failures in creating
14179 subprocesses on Windows 7, see the discussion in this thread:
14180 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14181
14182 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14183
14184 Fix up display of the *Minibuf-0* buffer in the mini window.
14185 * keyboard.c (read_char): Don't clear the echo area if there's no
14186 message to clear.
14187 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14188 contents of *Minibuf-0*) if there's no message displayed in its stead.
14189
14190 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
14191
14192 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14193 batch mode.
14194
14195 2012-05-06 Chong Yidong <cyd@gnu.org>
14196
14197 * lisp.mk (lisp): Update.
14198
14199 2012-05-05 Jim Meyering <meyering@redhat.com>
14200
14201 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14202
14203 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14204
14205 * data.c (PUT_ERROR): New macro.
14206 (syms_of_data): Use it. Add new error type `user-error'.
14207 * undo.c (user_error): New function.
14208 (Fprimitive_undo): Use it.
14209 * print.c (print_error_message): Adjust print style for `user-error'.
14210 * keyboard.c (user_error): New function.
14211 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14212
14213 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14214
14215 Do not limit current-time-string to years 1000..9999.
14216 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14217 (Fcurrent_time_string): Support any year that is supported by the
14218 underlying localtime representation. Don't use asctime, as it
14219 has undefined behavior for years outside the range -999..9999.
14220
14221 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14222
14223 Fix race conditions involving setenv, gmtime, localtime, asctime.
14224 Without this fix, interrupts could mess up code that uses these
14225 nonreentrant functions, since setting TZ invalidates existing
14226 tm_zone or tzname values, and since most of these functions return
14227 pointers to static storage.
14228 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14229 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14230 Grow the critical sections to include not just invoking
14231 localtime/gmtime, but also accessing these functions' results
14232 including their tm_zone values if any, and any related TZ setting.
14233 (format_time_string): Last arg is now struct tm *, not struct tm **,
14234 so that the struct tm is saved in the critical section.
14235 All callers changed. Simplify allocation of initial buffer, partly
14236 motivated by the fact that memory allocation needs to be outside
14237 the critical section.
14238
14239 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14240
14241 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14242 with RESET_INTERVAL.
14243
14244 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14245 Remove duplicated buffer name initialization.
14246
14247 2012-05-02 Jim Meyering <jim@meyering.net>
14248
14249 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14250
14251 * xfns.c (x_window): Use xstrdup (Bug#11375).
14252
14253 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14254
14255 * xdisp.c (pos_visible_p): If already at a newline from the
14256 display string before the 'while' loop, don't walk back the glyphs
14257 from it3.glyph_row. Solves assertion violation when the display
14258 string begins with a newline (egg.el). (Bug#11367)
14259
14260 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14261
14262 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14263 Move to simple.el.
14264
14265 2012-05-01 Glenn Morris <rgm@gnu.org>
14266
14267 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14268 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14269 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14270 All were removed before 23.1.
14271
14272 * dispnew.c: Remove HAVE_LIBNCURSES test;
14273 it is always true on relevant platforms.
14274
14275 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14276 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14277
14278 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14279
14280 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14281
14282 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14283 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14284 Remove.
14285
14286 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14287
14288 Do not avoid creating empty evaporating overlays (Bug#9642).
14289 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14290 That is, do not delete an evaporating overlay if it becomes
14291 empty after its bounds are adjusted to fit within its buffer.
14292 This fix caused other problems, and I'm reverting it until we get
14293 to the bottom of them.
14294
14295 2012-04-27 Chong Yidong <cyd@gnu.org>
14296
14297 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14298
14299 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14300
14301 * xdisp.c (pos_visible_p): If the window start position is beyond
14302 ZV, start the display from buffer beginning. Prevents assertion
14303 violation in init_iterator when the minibuffer window is scrolled
14304 via the scroll bar.
14305
14306 * window.c (window_scroll_pixel_based): Likewise.
14307
14308 2012-04-27 Chong Yidong <cyd@gnu.org>
14309
14310 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14311
14312 2012-04-27 Glenn Morris <rgm@gnu.org>
14313
14314 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14315 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14316
14317 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14318
14319 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14320 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14321
14322 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14323
14324 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14325 display element, check also the underlying string or buffer
14326 character. (Bug#11341)
14327
14328 * w32menu.c: Include w32heap.h.
14329 (add_menu_item): If the call to AppendMenuW (via
14330 unicode_append_menu) fails, disable Unicode menus only if we are
14331 running on Windows 9X/Me.
14332
14333 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14334
14335 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14336 (xgetint): Add missing shift for LSB tags.
14337
14338 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14339
14340 * keyboard.c (read_char): Don't wipe echo area for select window
14341 events: These might get delayed via `mouse-autoselect-window'
14342 (Bug#11304).
14343
14344 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14345
14346 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14347 manipulation of :loaded-from data.
14348
14349 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14350
14351 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14352 now a cons (bug#11311).
14353
14354 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14355
14356 Do not create empty overlays with the evaporate property (Bug#9642).
14357 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14358 if it becomes empty after its bounds are adjusted to fit within
14359 its buffer. Without this fix, in a nonempty buffer (let ((o
14360 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14361 yields an empty overlay that has the evaporate property, which is
14362 not supposed to happen.
14363
14364 Fix minor GTK3 problems found by static checking.
14365 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14366 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14367 (struct _EmacsFixedClass, emacs_fixed_get_type):
14368 Move decls here from emacsgtkfixed.h, since they needn't be public.
14369 (emacs_fixed_get_type): Now static.
14370 (emacs_fixed_class_init): Omit unused local.
14371 (emacs_fixed_child_type): Remove; unused.
14372 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14373 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14374 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14375 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14376 (EMACS_FIXED_GET_CLASS): Remove; unused.
14377 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14378
14379 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14380 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14381
14382 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14383
14384 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14385 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14386 (__malloc_size_t, __malloc_ptrdiff_t):
14387 Remove. All uses removed, replaced by the definiens if needed,
14388 since we can assume C89 or better now.
14389 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14390 (protect_malloc_state, align, get_contiguous_space)
14391 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14392 (malloc_atfork_handler_child, malloc_enable_thread)
14393 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14394 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14395 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14396 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14397 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14398 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14399 Define using prototypes, not old style.
14400 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14401 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14402 (align): Don't assume that signed integer overflow wraps around.
14403 Omit unused local var.
14404 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14405 (_free_internal_nolock, memalign, mallochook, reallochook):
14406 Omit no-longer-needed casts.
14407 (valloc): Use getpagesize, not __getpagesize.
14408 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14409 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14410
14411 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14412
14413 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14414
14415 Move functions from C to Lisp. Make non-blocking method calls
14416 the default. Implement further D-Bus standard interfaces.
14417
14418 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14419 (QCdbus_request_name_allow_replacement)
14420 (QCdbus_request_name_replace_existing)
14421 (QCdbus_request_name_do_not_queue)
14422 (QCdbus_request_name_reply_primary_owner)
14423 (QCdbus_request_name_reply_in_queue)
14424 (QCdbus_request_name_reply_exists)
14425 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14426 (QCdbus_registered_serial, QCdbus_registered_method)
14427 (QCdbus_registered_signal): New Lisp objects.
14428 (XD_DEBUG_MESSAGE): Use sizeof.
14429 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14430 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14431 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14432 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14433 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14434 (xd_signature, xd_append_arg): Allow float for integer types.
14435 (xd_get_connection_references): New function.
14436 (xd_get_connection_address): Rename from xd_initialize.
14437 Return cached address.
14438 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14439 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14440 level.
14441 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14442 Return number of refcounts.
14443 (Fdbus_get_unique_name): Make stronger parameter check.
14444 (Fdbus_message_internal): New defun.
14445 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14446 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14447 (Fdbus_send_signal, Fdbus_register_service)
14448 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14449 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14450 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14451 (Vdbus_compiled_version, Vdbus_runtime_version)
14452 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14453 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14454 (Vdbus_message_type_signal): New defvars.
14455 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14456 Adapt docstring.
14457
14458 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14459
14460 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14461 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14462 Do not assume ptrdiff_t is the same width as 'int'.
14463
14464 * alloc.c: Handle unusual debugging option combinations.
14465 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14466 since the two debugging options are incompatible.
14467 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14468 is defined.
14469 (mem_init, mem_insert, mem_insert_fixup):
14470 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14471 (NEED_MEM_INSERT): Remove; no longer needed.
14472
14473 2012-04-22 Leo Liu <sdl.web@gmail.com>
14474
14475 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14476
14477 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14478
14479 * sysdep.c [__FreeBSD__]: Minor cleanups.
14480 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14481 Use Emacs indenting style more consistently. Avoid some casts.
14482 Use 'double' consistently rather than mixing 'float' and 'double'.
14483
14484 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14485
14486 * sysdep.c (list_system_processes, system_process_attributes):
14487 Add implementation for FreeBSD (Bug#5243).
14488
14489 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14490
14491 * lisp.mk (lisp): Update.
14492
14493 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14496 It is never used otherwise.
14497
14498 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14499
14500 * print.c (print_preprocess): Only check print_depth if print-circle
14501 is nil.
14502 (print_object): Check for cycles even when print-circle is nil and
14503 print-gensym is t, but only check print_depth if print-circle is nil.
14504
14505 2012-04-20 Chong Yidong <cyd@gnu.org>
14506
14507 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14508 set the status to "failed" and ensure that sentinel is run.
14509
14510 2012-04-20 Glenn Morris <rgm@gnu.org>
14511
14512 * process.c (Fset_process_inherit_coding_system_flag)
14513 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14514 (Fmake_network_process, Fmake_serial_process): Doc fix.
14515
14516 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14517
14518 * xdisp.c (string_buffer_position_lim): Limit starting position to
14519 BEGV.
14520 (set_cursor_from_row): If called for a mode-line or header-line
14521 row, return zero immediately.
14522 (try_cursor_movement): If inside continuation line, don't back up
14523 farther than the first row after the header line, if any.
14524 Don't consider the header-line row as "partially visible", even if
14525 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14526
14527 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14528
14529 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14530 (bug#11238).
14531
14532 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14533 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14534
14535 configure: new option --enable-gcc-warnings (Bug#11207)
14536 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14537 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14538 (ALL_CFLAGS): Use new macros rather than old.
14539 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14540 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14541 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14542 -Wunused-result, -Wunused-variable. This should go away once
14543 the Emacs and Gnulib regex code is merged.
14544 (xmalloc, xrealloc): Now static.
14545
14546 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14547
14548 * dired.c (Fsystem_groups): Remove unused local.
14549
14550 2012-04-17 Glenn Morris <rgm@gnu.org>
14551
14552 * dired.c (Fsystem_users): Doc fix.
14553
14554 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14555
14556 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14557 (syms_of_dired): Add them.
14558
14559 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14560
14561 Fix minor alloc.c problems found by static checking.
14562 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14563 New extern decls, to avoid calling undeclared functions.
14564 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14565 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14566 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14567 (NEED_MEM_INSERT): New macro.
14568 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14569 Remove one incorrect comment and fix another.
14570
14571 Fix minor ralloc.c problems found by static checking.
14572 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14573 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14574 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14575 (r_alloc_sbrk): Now static.
14576
14577 Improve ralloc.c interface checking.
14578 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14579 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14580 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14581 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14582 [REL_ALLOC]: ... to here, to check interface.
14583 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14584 Remove decls. This fixes an "It stinks!".
14585
14586 * alloc.c (which_symbols): Fix alignment issue / type clash.
14587
14588 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14589
14590 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14591 (struct Lisp_Misc_Any): Likewise.
14592 (struct Lisp_Free): Likewise.
14593 * alloc.c (union aligned_Lisp_Symbol): Define.
14594 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14595 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14596 (union aligned_Lisp_Misc): Define.
14597 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14598 aligned_Lisp_Misc instead of union Lisp_Misc.
14599 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14600
14601 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14602
14603 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14604 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14605 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14606 * s/netbsd.h, s/sol2-6.h:
14607 Remove definition of GC_MARK_STACK, since the default now works.
14608 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14609 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14610 no longer the default.
14611 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14612
14613 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14614
14615 * lread.c (lisp_file_lexically_bound_p):
14616 Fix hang at ";-*-\n" (bug#11238).
14617
14618 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14619
14620 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14621 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14622
14623 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14624
14625 * nsterm.m (constrainFrameRect): Always constrain when there is only
14626 one screen (Bug#10962).
14627
14628 2012-04-13 Ken Brown <kbrown@cornell.edu>
14629
14630 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14631
14632 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14633
14634 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14635
14636 2012-04-11 Daniel Colascione <dancol@dancol.org>
14637
14638 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14639 against is gone. It's better to use vfork now so that when Cygwin
14640 gains a new, working vfork, we use it automatically (bug#10398).
14641
14642 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14643
14644 * window.c (save_window_save): Obey window-point-insertion-type.
14645
14646 2012-04-11 Glenn Morris <rgm@gnu.org>
14647
14648 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14649
14650 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14651
14652 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14653
14654 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14655
14656 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14657 (force_quit_count): New var.
14658 (handle_interrupt): Use it.
14659
14660 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14661
14662 * w32.c (w32_delayed_load): Record the full path of the library
14663 being loaded (bug#10424).
14664
14665 2012-04-09 Glenn Morris <rgm@gnu.org>
14666
14667 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14668 not just in the obarray, before snarfing them. (Bug#11036)
14669
14670 * Makefile.in ($(leimdir)/leim-list.el):
14671 Pass EMACS rather than BUILT_EMACS.
14672
14673 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14674
14675 * process.c (make_process):
14676 * process.h: Add integer `gnutls_handshakes_tried' member to
14677 process struct.
14678
14679 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14680 Add convenience `GNUTLS_LOG2i' macro.
14681
14682 * gnutls.c (gnutls_log_function2i): Convenience log function.
14683 (emacs_gnutls_read): Use new log functions,
14684 `gnutls_handshakes_tried' process member, and
14685 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14686 attempts per process (connection).
14687
14688 2012-04-09 Chong Yidong <cyd@gnu.org>
14689
14690 * eval.c (Fuser_variable_p, user_variable_p_eh)
14691 (lisp_indirect_variable): Functions deleted.
14692 (Fdefvar): Caller changed.
14693
14694 * callint.c (Finteractive, Fcall_interactively):
14695 * minibuf.c (Fread_variable): Callers changed.
14696
14697 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14698
14699 * xdisp.c (set_cursor_from_row): If the display string appears in
14700 the buffer at position that is closer to point than the position
14701 after the display string, display the cursor on the first glyph of
14702 the display string. Fixes cursor display when a 'display' text
14703 property immediately follows invisible text. (Bug#11094)
14704
14705 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14706
14707 composite.c: use 'double' consistently
14708 * composite.c (get_composition_id): Use 'double' consistently
14709 instead of converting 'float' to 'double' and vice versa; this is
14710 easier to understand and avoids a GCC warning.
14711
14712 2012-04-09 Glenn Morris <rgm@gnu.org>
14713
14714 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14715 preparation for dumping it with emacs. (Bug#4789)
14716 (leimdir): New variable.
14717 ($(leimdir)/leim-list.el): New rule.
14718 (emacs$(EXEEXT)): Depend on leim-list.el.
14719
14720 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14721 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14722 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14723
14724 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14725
14726 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14727 proper alignment.
14728
14729 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14730
14731 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14732 Remove unused local variable.
14733
14734 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14735
14736 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14737 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14738 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14739 objects, as mark_maybe_pointer will catch them otherwise.
14740 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14741 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14742
14743 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14744
14745 Fix typo that broke non-Windows builds.
14746 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14747
14748 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14749
14750 Support building on MS-Windows with libxml2.
14751
14752 * makefile.w32-in (OBJ2): Add xml.$(O).
14753 (GLOBAL_SOURCES): Add xml.c.
14754 ($(BLD)/xml.$(O)): New dependency list.
14755
14756 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14757 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14758 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14759 [!WINDOWSNT]: New macros.
14760 (init_libxml2_functions, libxml2_loaded_p): New functions.
14761 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14762 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14763 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14764 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14765 linked in).
14766 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14767 Call init_libxml2_functions before calling libxml2 functions.
14768 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14769
14770 * emacs.c: Don't include libxml/parser.h.
14771 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14772 xmlCleanupParser directly.
14773
14774 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14775
14776 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14777
14778 * indent.c (Fvertical_motion): If there is a display string at
14779 point, use it.vpos to compute how many lines to backtrack after
14780 move_it_to point. (Bug#11133)
14781
14782 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14783
14784 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14785 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14786 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14787 macros related to unification of CJK characters. For the details,
14788 see the discussion following the message here:
14789 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14790
14791 2012-04-04 Chong Yidong <cyd@gnu.org>
14792
14793 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14794
14795 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14796
14797 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14798 instead of alloca. (Bug#11138)
14799
14800 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14801
14802 * w32menu.c (is_simple_dialog): Properly check lisp types.
14803 (Bug#11141)
14804
14805 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14806
14807 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14808 position we get to after a call to move_it_to fails the
14809 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14810 only if we wind up in a string from display property. (Bug#11063)
14811
14812 * window.c (Fdelete_other_windows_internal): Invalidate the row
14813 and column information about mouse highlight, so that redisplay
14814 restores it after reallocating the glyph matrices. (Bug#7464)
14815
14816 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14817 string comes from a `display' text property, use the buffer
14818 position of that property as if we actually saw that position in
14819 the row's glyphs.
14820 (move_it_by_lines): Remove the assertion that
14821 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14822 violated when there's a before-string at the beginning of a line.
14823 (Bug#11063)
14824
14825 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14826
14827 * xdisp.c (append_space_for_newline): If the default face was
14828 remapped, use the remapped face for the appended newline.
14829 (extend_face_to_end_of_line): Use the remapped default face for
14830 extending the face to the end of the line.
14831 (display_line): Call extend_face_to_end_of_line when the default
14832 face was remapped. (Bug#11068)
14833
14834 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14835
14836 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14837
14838 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14839
14840 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14841
14842 2012-03-27 Glenn Morris <rgm@gnu.org>
14843
14844 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14845 Doc fixes.
14846
14847 2012-03-26 Kenichi Handa <handa@m17n.org>
14848
14849 * dispextern.h (struct glyph): Fix previous change. Change the
14850 bit length of glyphless.ch to 25 (Bug#11082).
14851
14852 2012-03-26 Chong Yidong <cyd@gnu.org>
14853
14854 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14855 (command_loop_1): Use it; inhibit selection update for
14856 handle-select-window too (Bug#8996).
14857
14858 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14859
14860 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14861
14862 2012-03-25 Kenichi Handa <handa@m17n.org>
14863
14864 * dispextern.h (struct glyph): Change the bit length of
14865 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14866
14867 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14868
14869 * s/ms-w32.h (tzname): Include time.h before redirecting to
14870 _tzname. Fixes the MSVC build. (Bug#9960)
14871
14872 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14873
14874 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14875 characters.
14876
14877 * xterm.c (XTread_socket): Only modify handling_signal if
14878 !SYNC_INPUT. (Bug#11080)
14879
14880 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14881
14882 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14883 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14884 when fetching a multibyte character consumes more bytes than
14885 CHAR_BYTES returns, due to unification of CJK characters in
14886 string_char. (Bug#11073)
14887
14888 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14889
14890 * process.c (wait_reading_process_output): Handle pty disconnect
14891 by refraining from sending oneself a SIGCHLD (bug#10933).
14892
14893 2012-03-22 Chong Yidong <cyd@gnu.org>
14894
14895 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14896
14897 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14898 Mark string as coming from a prefix property.
14899 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14900 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14901
14902 2012-03-21 Chong Yidong <cyd@gnu.org>
14903
14904 * xfaces.c (Vface_remapping_alist): Doc fix.
14905
14906 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14907
14908 * w32proc.c (Fw32_set_console_codepage)
14909 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14910 Doc fixes.
14911
14912 2012-03-20 Chong Yidong <cyd@gnu.org>
14913
14914 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14915 to reflect default non-nil value of redisplay-dont-pause.
14916
14917 2012-03-19 Kenichi Handa <handa@m17n.org>
14918
14919 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14920 it fit in a valid range (Bug#11003).
14921
14922 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14923
14924 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14925 that is not from display property, accept the row as a "cursor
14926 row" if one of the string's character has a non-nil `cursor'
14927 property. Fixes cursor positioning when there are newlines in
14928 overlay strings, e.g. in icomplete.el. (Bug#11035)
14929
14930 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14931
14932 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14933
14934 2012-03-12 Chong Yidong <cyd@gnu.org>
14935
14936 * eval.c (inhibit_lisp_code): Rename from
14937 inhibit_window_configuration_change_hook; move from window.c.
14938
14939 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14940 * window.c (run_window_configuration_change_hook)
14941 (syms_of_window): Callers changed.
14942
14943 2012-03-11 Chong Yidong <cyd@gnu.org>
14944
14945 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14946
14947 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14948
14949 2012-03-10 Chong Yidong <cyd@gnu.org>
14950
14951 * frame.c (other_visible_frames): Don't assume the selected frame
14952 is visible (Bug#10955).
14953
14954 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14955
14956 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14957
14958 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14959
14960 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14961 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14962 zero (Bug#10954).
14963
14964 2012-03-03 Glenn Morris <rgm@gnu.org>
14965
14966 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14967
14968 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14969
14970 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14971 position past the first glyph_row that ends at ZV. (Bug#10902)
14972 (redisplay_window, next_element_from_string): Fix typos in
14973 comments.
14974 (redisplay_window): Pass to move_it_vertically the margin in
14975 pixels, not in screen lines.
14976
14977 2012-03-02 Glenn Morris <rgm@gnu.org>
14978
14979 * buffer.c (buffer-list-update-hook): Doc fix.
14980
14981 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14982
14983 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14984 push_it before setting up the iterator for the first overlay
14985 string, even if we have an empty string loaded.
14986 (next_overlay_string): If there's an empty string on the iterator
14987 stack, pop the stack. (Bug#10903)
14988
14989 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14990
14991 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14992 Suggested by Stefan Monnier in
14993 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14994 * alloc.c (widen_to_Lisp_Object): New static function.
14995 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14996 and widening them to Lisp_Objects. This would work even if
14997 USE_LSB_TAG is defined and wide integers are used, which might
14998 happen in a future version of Emacs.
14999
15000 2012-02-25 Chong Yidong <cyd@gnu.org>
15001
15002 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15003 Doc fix.
15004
15005 * xselect.c (Fx_selection_exists_p): Doc fix.
15006 (x_clipboard_manager_save_all): Print an informative message
15007 before saving to clipboard manager.
15008
15009 2012-02-24 Chong Yidong <cyd@gnu.org>
15010
15011 * keyboard.c (process_special_events): Handle all X selection
15012 requests in kbd_buffer, not just the next one (Bug#8869).
15013
15014 2012-02-23 Chong Yidong <cyd@gnu.org>
15015
15016 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15017 call when setting menu-bar-lines and tool-bar-lines parameters.
15018 (unwind_create_frame_1): New helper function.
15019
15020 * window.c (inhibit_window_configuration_change_hook): New var.
15021 (run_window_configuration_change_hook): Obey it.
15022 (syms_of_window): Initialize it.
15023
15024 2012-02-22 Chong Yidong <cyd@gnu.org>
15025
15026 * xterm.c (x_draw_image_relief): Add missing type check for
15027 Vtool_bar_button_margin (Bug#10743).
15028
15029 2012-02-21 Chong Yidong <cyd@gnu.org>
15030
15031 * fileio.c (Vfile_name_handler_alist): Doc fix.
15032
15033 * buffer.c (Fget_file_buffer): Protect against invalid file
15034 handler return value.
15035
15036 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15037
15038 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15039 when computing $valmask.
15040
15041 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15042 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15043 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15044 It's useless in that case, and it can cause problems on hosts
15045 that allocate halves of EMACS_INT values separately.
15046 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15047 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15048 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15049 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15050 it avoids undefined behavior on hosts where shifting right by more
15051 than the word width has undefined behavior.
15052
15053 2012-02-19 Chong Yidong <cyd@gnu.org>
15054
15055 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15056 (Funhandled_file_name_directory, Ffile_name_as_directory)
15057 (Fdirectory_file_name, Fexpand_file_name)
15058 (Fsubstitute_in_file_name): Protect against invalid file handler
15059 return values (Bug#10845).
15060
15061 2012-02-18 Eli Zaretskii <eliz@gnu.org>
15062
15063 * .gdbinit (pitx): Fix incorrect references to fields of the
15064 iterator stack.
15065
15066 2012-02-17 Chong Yidong <cyd@gnu.org>
15067
15068 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15069
15070 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15071
15072 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15073 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15074
15075 2012-02-15 Chong Yidong <cyd@gnu.org>
15076
15077 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15078 marked as special. Also, starting docstrings with * is obsolete.
15079
15080 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15081
15082 * gnutls.c (emacs_gnutls_write): Fix last change.
15083
15084 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15085
15086 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15087 send_process.
15088
15089 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15090
15091 * keymap.c (Fsingle_key_description): Handle char ranges.
15092
15093 2012-02-12 Chong Yidong <cyd@gnu.org>
15094
15095 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15096 as that creates a dangerous corner case.
15097
15098 * window.c (Fdelete_window_internal): Invalidate the mouse
15099 highlight (Bug#9904).
15100
15101 2012-02-12 Glenn Morris <rgm@gnu.org>
15102
15103 * xselect.c (Fx_own_selection_internal)
15104 (Fx_get_selection_internal, Fx_disown_selection_internal)
15105 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15106 * nsselect.m (Fx_own_selection_internal)
15107 (Fx_disown_selection_internal, Fx_selection_exists_p)
15108 (Fx_selection_owner_p, Fx_get_selection_internal):
15109 Sync docs and argument specs with the xselect.c versions.
15110
15111 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15112
15113 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15114
15115 2012-02-11 Eli Zaretskii <eliz@gnu.org>
15116
15117 * w32select.c (Fx_selection_exists_p): Sync doc string and
15118 argument list with xselect.c. (Bug#10783)
15119
15120 * w16select.c (Fx_selection_exists_p): Sync doc string and
15121 argument list with xselect.c. (Bug#10783)
15122
15123 2012-02-10 Glenn Morris <rgm@gnu.org>
15124
15125 * fns.c (Fsecure_hash): Doc fix.
15126
15127 2012-02-09 Kenichi Handa <handa@m17n.org>
15128
15129 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15130
15131 2012-02-07 Chong Yidong <cyd@gnu.org>
15132
15133 * buffer.c (Fbuffer_local_variables)
15134 (buffer_lisp_local_variables): Handle unbound vars correctly;
15135 don't let Qunbound leak into Lisp.
15136
15137 2012-02-07 Glenn Morris <rgm@gnu.org>
15138
15139 * image.c (Fimagemagick_types): Doc fix.
15140
15141 * image.c (imagemagick-render-type): Change it from a lisp object
15142 to an integer. Move the doc here from the lisp manual.
15143 Treat all values not equal to 0 the same.
15144
15145 2012-02-06 Chong Yidong <cyd@gnu.org>
15146
15147 * doc.c (store_function_docstring): Avoid applying docstring of
15148 alias to base function (Bug#2603).
15149
15150 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15151
15152 * .gdbinit (pp1, pv1): Remove redundant defines.
15153 (pr): Use pp.
15154
15155 2012-02-04 Chong Yidong <cyd@gnu.org>
15156
15157 * nsterm.m: Declare a global (Bug#10694).
15158
15159 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15160
15161 * w32.c (get_emacs_configuration_options):
15162 Include --enable-checking, if specified, in the return value.
15163
15164 2012-02-04 Martin Rudalics <rudalics@gmx.at>
15165
15166 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15167 after rounding frame sizes. (Bug#9723)
15168
15169 2012-02-04 Eli Zaretskii <eliz@gnu.org>
15170
15171 * keyboard.c (adjust_point_for_property): Don't position point
15172 before BEGV. (Bug#10696)
15173
15174 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15175
15176 Handle overflow when computing char display width (Bug#9496).
15177 * character.c (char_width): Return EMACS_INT, not int.
15178 (char_width, c_string_width): Check for overflow when
15179 computing the width; this is possible now that individual
15180 characters can have unbounded width. Problem introduced
15181 by merge from Emacs 23 on 2012-01-19.
15182
15183 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
15184
15185 * dbusbind.c (Fdbus_register_method): Mention the return value
15186 :ignore in the docstring.
15187
15188 2012-02-02 Glenn Morris <rgm@gnu.org>
15189
15190 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15191
15192 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15193 Unconditionally set to t. (Bug#10673)
15194 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15195 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15196 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15197
15198 2012-02-02 Kenichi Handa <handa@m17n.org>
15199
15200 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15201 0, do not call append_composite_glyph.
15202
15203 2012-02-02 Kenichi Handa <handa@m17n.org>
15204
15205 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15206 NULL (Bug#6988).
15207 (x_produce_glyphs): If the component of a composition is a null
15208 string, set it->pixel_width to 1 to avoid zero-width glyph.
15209
15210 2012-02-01 Eli Zaretskii <eliz@gnu.org>
15211
15212 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15213 first 2 arguments are identical. This makes inserting large
15214 output from a subprocess an order of magnitude faster on
15215 MS-Windows, where all sbrk'ed memory is always contiguous.
15216
15217 2012-01-31 Glenn Morris <rgm@gnu.org>
15218
15219 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15220 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15221 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15222
15223 2012-01-29 Glenn Morris <rgm@gnu.org>
15224
15225 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15226
15227 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15228
15229 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15230
15231 2012-01-28 Chong Yidong <cyd@gnu.org>
15232
15233 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15234
15235 2012-01-26 Chong Yidong <cyd@gnu.org>
15236
15237 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15238
15239 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15240 repeat counts (Bug#10507).
15241
15242 2012-01-26 Glenn Morris <rgm@gnu.org>
15243
15244 * lread.c (syms_of_lread): Doc fix.
15245
15246 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15247
15248 * coding.c (encode_designation_at_bol): Change return value to
15249 EMACS_INT.
15250
15251 2012-01-25 Chong Yidong <cyd@gnu.org>
15252
15253 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15254
15255 2012-01-21 Chong Yidong <cyd@gnu.org>
15256
15257 * floatfns.c (Fcopysign): Make the second argument non-optional,
15258 since nil is not allowed anyway.
15259
15260 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15261
15262 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15263 (send_process): Likewise.
15264
15265 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15266
15267 * window.c (save_window_save, Fcurrent_window_configuration)
15268 (Vwindow_persistent_parameters): Do not use Qstate.
15269 Rewrite doc-strings.
15270
15271 2012-01-19 Kenichi Handa <handa@m17n.org>
15272
15273 * character.c (char_width): New function.
15274 (Fchar_width, c_string_width, lisp_string_width):
15275 Use char_width (Bug#9496).
15276
15277 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15278
15279 * window.c (Vwindow_persistent_parameters): New variable.
15280 (Fset_window_configuration, save_window_save): Handle persistent
15281 window parameters.
15282
15283 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15284
15285 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15286 thrashing the stack of the thread. (Bug#9087)
15287
15288 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15289
15290 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15291
15292 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15293
15294 * xdisp.c (rows_from_pos_range): Handle the case where the
15295 highlight ends on a newline. (Bug#10464)
15296 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15297 he end column for display of highlight that ends on a newline
15298 before a R2L line.
15299
15300 2012-01-11 Glenn Morris <rgm@gnu.org>
15301
15302 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15303 from load-path also when installation-directory is nil. (Bug#10208)
15304
15305 2012-01-10 Glenn Morris <rgm@gnu.org>
15306
15307 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15308
15309 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15310 Update template values to be closer to their typical values these days.
15311
15312 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15313
15314 * xdisp.c (rows_from_pos_range): Accept additional argument
15315 DISP_STRING, and accept any glyph in a row whose object is that
15316 string as eligible for mouse highlight. Fixes mouse highlight of
15317 display strings from overlays. (Bug#10464)
15318
15319 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15320
15321 emacs: fix an auto-save permissions race condition (Bug#10400)
15322 * fileio.c (auto_saving_dir_umask): New static var.
15323 (Fmake_directory_internal): Use it.
15324 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15325 creating the directory. The old code temporarily assigns
15326 too-generous permissions to the directory.
15327 (do_auto_save_eh): Clear it.
15328 (Fdo_auto_save): Catch all errors, not just file errors, so
15329 that the var is always cleared.
15330
15331 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15332
15333 * search.c (scan_buffer): Pass character positions to
15334 know_region_cache, not byte positions. (Bug#6540)
15335
15336 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15337
15338 * w32.c (sys_rename): Report EXDEV when rename of a directory
15339 fails because the target is on another logical disk. (Bug#10284)
15340
15341 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15342
15343 * xterm.c (x_embed_request_focus): New function.
15344
15345 * xterm.h: Add prototype.
15346
15347 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15348
15349 2012-01-05 Glenn Morris <rgm@gnu.org>
15350
15351 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15352
15353 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15354
15355 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15356 Load gnutls_transport_set_lowat only if GnuTLS version is below
15357 2.11.1.
15358 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15359 GnuTLS versions below 2.11.1.
15360
15361 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15362
15363 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15364 to the doc string advising against its use for altering the way
15365 windows are scrolled.
15366
15367 2011-12-28 Kenichi Handa <handa@m17n.org>
15368
15369 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15370 coding-system ASCII compatible only when it does not produce BOM
15371 on encoding (Bug#10383).
15372
15373 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15374
15375 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15376 can scroll.
15377 (create_and_show_popup_menu): Always use menu_position_func for
15378 Gtk3 (Bug#10361).
15379
15380 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15381
15382 * callint.c (Fcall_interactively): Don't truncate prompt string.
15383
15384 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15385
15386 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15387 property that ends at ZV, so that the bidi iteration could be
15388 resumed from there (after widening). (Bug#10360)
15389
15390 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15391
15392 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15393
15394 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15395
15396 * nsterm.m (x_free_frame_resources):
15397 Release f->output_data.ns->miniimage.
15398 (ns_index_color): Fix indentation. Do not retain
15399 color_table->colors[i].
15400
15401 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15402 before returning.
15403
15404 * nsfns.m (x_set_background_color): Assign return value from
15405 ns_index_color to face-background instead of NSColor*.
15406 (ns_implicitly_set_icon_type): Fix indentation.
15407 Change assignment in for loop to comparison.
15408
15409 * emacs.c (ns_pool): New variable.
15410 (main): Assign ns_pool.
15411 (Fkill_emacs): Call ns_release_autorelease_pool.
15412
15413 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15414 autorelease fdesc, release fdAttrs and tdict.
15415 (ns_get_covering_families): Release charset.
15416 (ns_findfonts): Release NSFontDescriptor created with new.
15417 (ns_uni_to_glyphs): Fix indentation.
15418 (setString): Release attrStr before assigning new value.
15419
15420 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15421
15422 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15423 and NS_IMPL_COCOA.
15424 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15425 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15426
15427 2011-12-18 David Reitter <reitter@cmu.edu>
15428
15429 * nsterm.m (ns_term_init): Subscribe for notifications
15430 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15431 to method trackingNotification in EmacsMenu.
15432
15433 * nsmenu.m (trackingMenu): New variable.
15434 (trackingNotification): New method (from Aquamacs).
15435 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15436 from Aquamacs (Bug#7030).
15437
15438 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15439
15440 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15441 (symbol_to_nsstring): Fix indentation.
15442 (ns_symbol_to_pb): New function.
15443 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15444 (Fns_rotate_cut_buffers_internal): Remove.
15445 (Fns_store_selection_internal): Rename from
15446 Fns_store_cut_buffer_internal.
15447 (ns_get_foreign_selection, Fx_own_selection_internal)
15448 (Fx_disown_selection_internal, Fx_selection_exists_p)
15449 (Fns_get_selection_internal, Fns_store_selection_internal):
15450 Use ns_symbol_to_pb and check if return value is nil.
15451 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15452 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15453 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15454 renamed to Sns_store_selection_internal.
15455 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15456 and remove this function.
15457 (ns_handle_selection_clear): Remove, never used.
15458 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15459 here.
15460
15461 2011-12-17 Ken Brown <kbrown@cornell.edu>
15462
15463 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15464 GID is unknown (Bug#10257).
15465
15466 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15467
15468 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15469 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15470 which caused a build failure on GNU/Linux IA-64. This problem was
15471 introduced by my 2011-10-07 patch.
15472
15473 2011-12-15 Juri Linkov <juri@jurta.org>
15474
15475 * image.c (imagemagick_error): New function. (Bug#10112)
15476 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15477 Use `imagemagick_error' where ImageMagick functions return
15478 `MagickFalse'.
15479 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15480 proper order.
15481
15482 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15483
15484 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15485 fill background (Bug#8992).
15486
15487 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15488
15489 * window.c (Vwindow_combination_resize)
15490 (Vwindow_combination_limit): Use t instead of non-nil in
15491 doc-strings.
15492 (Vrecenter_redisplay): Add first sentence of doc-string on
15493 separate line.
15494 (Frecenter): Fix doc-string typo.
15495
15496 2011-12-11 Kenichi Handa <handa@m17n.org>
15497
15498 * coding.c (Funencodable_char_position): Pay attention to the
15499 buffer text relocation (Bug#9389).
15500
15501 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15502
15503 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15504 gtk_init (Bug#10100).
15505
15506 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15507
15508 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15509 IT->string is nil. (Bug#10263)
15510
15511 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15512
15513 * nsterm.h (x_free_frame_resources): Declare.
15514
15515 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15516 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15517
15518 * nsterm.h (ns_get_defaults_value): Declare.
15519
15520 * nsterm.m (ns_default): Call ns_get_defaults_value.
15521
15522 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15523
15524 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15525 (Bug#10170)
15526
15527 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15528
15529 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15530 that where the value of an _OBJC_* symbol points to is in the .bss
15531 section (Bug#10240).
15532
15533 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15534
15535 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15536 after the loop to call ccl_driver at least once (Bug#8619).
15537
15538 2011-12-08 Kenichi Handa <handa@m17n.org>
15539
15540 * ftfont.c (get_adstyle_property): Fix previous change
15541 (Bug#10233).
15542
15543 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15544
15545 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15546 dirs from the default value of EMACSLOADPATH (bug#10208).
15547
15548 2011-12-07 Glenn Morris <rgm@gnu.org>
15549
15550 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15551 installation and source directories as well. (Bug#10208)
15552
15553 2011-12-06 Chong Yidong <cyd@gnu.org>
15554
15555 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15556
15557 2011-12-06 Glenn Morris <rgm@gnu.org>
15558
15559 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15560 as an error, not just -1. (Bug#10217)
15561
15562 2011-12-05 Chong Yidong <cyd@gnu.org>
15563
15564 * keyboard.c (process_special_events): New function.
15565 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15566
15567 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15568
15569 * coding.c (encode_designation_at_bol): Don't use uninitialized
15570 local variable (Bug#9318).
15571
15572 2011-12-05 Kenichi Handa <handa@m17n.org>
15573
15574 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15575 return Qnil (Bug#8046, Bug#10193).
15576
15577 2011-12-05 Kenichi Handa <handa@m17n.org>
15578
15579 * coding.c (encode_designation_at_bol): New args charbuf_end and
15580 dst. Return the number of produced bytes. Callers changed.
15581 (coding_set_source): Return how many bytes coding->source was
15582 relocated.
15583 (coding_set_destination): Return how many bytes
15584 coding->destination was relocated.
15585 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15586 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15587
15588 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15589
15590 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15591 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15592 macro (Bug#9318).
15593
15594 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15595
15596 The following changes are to fix Bug#9318.
15597
15598 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15599 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15600 (encode_coding_iso_2022, encode_coding_sjis)
15601 (encode_coding_big5, encode_coding_charset): Use the above macros.
15602
15603 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15604
15605 * lisp.h (process_quit_flag): Fix external declaration.
15606
15607 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15608
15609 Don't macro-inline non-performance-critical code.
15610 * eval.c (process_quit_flag): New function.
15611 * lisp.h (QUIT): Use it.
15612
15613 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15614
15615 * nsfns.m (get_geometry_from_preferences): New function.
15616 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15617
15618 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15619
15620 * emacs.c (Qkill_emacs): Define.
15621 (syms_of_emacs): Initialize it.
15622 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15623 Qquit_flag to `kill-emacs' instead.
15624 (quit_throw_to_read_char): Add parameter `from_signal'.
15625 All callers changed. Call Fkill_emacs if requested and safe.
15626 * lisp.h (QUIT): Call Fkill_emacs if requested.
15627
15628 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15629
15630 * widget.c (update_wm_hints): Return if wmshell is null.
15631 (widget_update_wm_size_hints): New function.
15632
15633 * widget.h (widget_update_wm_size_hints): Declare.
15634
15635 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15636 widget_update_wm_size_hints (Bug#10104).
15637
15638 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15639
15640 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15641 before a newline, prepare the bidi iterator for consuming the
15642 newline, and keep the current paragraph direction. (Bug#10183)
15643 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15644
15645 2011-12-02 Juri Linkov <juri@jurta.org>
15646
15647 * search.c (Fword_search_regexp): New Lisp function created from
15648 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15649 (Fword_search_backward, Fword_search_forward)
15650 (Fword_search_backward_lax, Fword_search_forward_lax):
15651 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15652 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15653
15654 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15655
15656 * fileio.c (Finsert_file_contents): Move after-change-function call
15657 to before the "handled:" label, since all "goto handled" appear in
15658 cases where the *-change-functions have already been properly called
15659 (bug#10117).
15660
15661 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15662
15663 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15664 waiting for input. (Bug#10169)
15665
15666 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15667
15668 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15669 verifies glyph row's hash code--we have just reallocated the
15670 glyphs, so their contents can be complete garbage. (Bug#10164)
15671
15672 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15673
15674 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15675
15676 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15677
15678 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15679 attributes are tested _before_ calling verify_row_hash, to protect
15680 against GCC re-ordering of the tests. (Bug#10164)
15681
15682 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15683
15684 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15685
15686 * xterm.c (handle_one_xevent): Only set async_visible and friends
15687 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15688 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15689 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15690
15691 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15692
15693 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15694 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15695 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15696 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15697 All uses changed to use GCPRO1 etc.
15698 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15699 Revert to old implementation (i.e., before 2011-03-11).
15700
15701 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15702
15703 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15704 of scroll runs so as to avoid assigning disabled bogus rows and
15705 unnecessary graphics copy operations.
15706
15707 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15708
15709 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15710 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15711 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15712 (malloc, free, realloc, calloc): Redirect to e_* only when
15713 compiling Emacs.
15714
15715 * lisp.h (GCTYPEBITS): Move before first use.
15716 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15717 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15718 this macro definition.
15719
15720 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15721 _MSC_VER.
15722
15723 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15724
15725 * gtkutil.c (xg_create_frame_widgets):
15726 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15727 present with Gtk+ 2.0.
15728
15729 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15730
15731 * fileio.c (Finsert_file_contents): Undo previous change; see
15732 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15733
15734 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15735
15736 Rename locals to avoid shadowing.
15737 * fileio.c (Finsert_file_contents):
15738 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15739 * process.c (wait_reading_process_output):
15740 Rename inner 'proc' to 'p' to avoid shadowing.
15741 Indent for consistency with usual Emacs style.
15742
15743 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15744
15745 * xdisp.c (redisplay_window): If cursor row is not fully visible
15746 after recentering, and scroll-conservatively is set to a large
15747 number, scroll window by a few more lines to make the cursor fully
15748 visible and out of scroll-margin. (Bug#10105)
15749 (start_display): Don't move to the next line if the display should
15750 start at a newline that is part of a display vector or an overlay
15751 string. (Bug#10119)
15752
15753 2011-11-24 Juri Linkov <juri@jurta.org>
15754
15755 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15756 after the `MagickPingImage' call. (Bug#10112)
15757
15758 2011-11-23 Chong Yidong <cyd@gnu.org>
15759
15760 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15761
15762 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15763
15764 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15765 making another buffer current. (Bug#10114)
15766
15767 2011-11-23 Glenn Morris <rgm@gnu.org>
15768
15769 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15770
15771 2011-11-23 Chong Yidong <cyd@gnu.org>
15772
15773 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15774 using it (Bug#5984).
15775
15776 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15777
15778 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15779 and header-lines, as they don't have one computed for them.
15780 (Bug#10098)
15781
15782 * .gdbinit (prow): Make displayed values more self-explaining.
15783 Add row's hash code.
15784
15785 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15786
15787 * process.c (wait_reading_process_output): Fix asynchrounous
15788 GnuTLS socket handling on some versions of the GnuTLS library.
15789 (wait_reading_process_output): Add comment and URL.
15790
15791 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15792
15793 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15794
15795 2011-11-21 Chong Yidong <cyd@gnu.org>
15796
15797 * window.c (Fnext_window, Fprevious_window): Doc fix.
15798
15799 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15800
15801 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15802
15803 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15804
15805 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15806
15807 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15808
15809 * window.c (Fset_window_combination_limit): Rename argument
15810 STATUS to LIMIT.
15811 (Vwindow_combination_limit): Remove "status" from doc-string.
15812
15813 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15814
15815 * m/ibms390.h: Remove.
15816 * m/ibms390x.h: Don't include "ibms390.h".
15817
15818 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15819
15820 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15821 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15822
15823 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15824
15825 * casetab.c (Fset_case_table):
15826 * charset.c (Fcharset_after): Fix typos.
15827
15828 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15829
15830 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15831 Otherwise, valgrind does not work on some platforms.
15832 Problem reported by Andreas Schwab in
15833 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15834 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15835 is set, removing the need for VIRT_ADDRESS_VARIES.
15836 (PURE_P): Use a more-efficient implementation that needs just one
15837 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15838 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15839 to 4 (xorl, subq, cmpq, setbe).
15840 * alloc.c (pure): Always extern now, since that's the
15841 VIRT_ADDR_VARIES behavior.
15842 (PURE_POINTER_P): Use a single comparison, not two, for
15843 consistency with the new puresize.h.
15844 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15845 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15846 Remove VIRT_ADDR_VARIES no longer needed.
15847
15848 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15849
15850 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15851 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15852 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15853 behave as if the cursor position were at the window margin.
15854
15855 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15856 and the cursor position is out of bounds, behave as if the cursor
15857 position were at the window margin. (Bug#10075)
15858
15859 2011-11-18 Chong Yidong <cyd@gnu.org>
15860
15861 * window.c (Fwindow_combination_limit): Make first argument
15862 non-optional, since it is meaningless for live windows like the
15863 selected window.
15864
15865 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15866
15867 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15868
15869 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15870
15871 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15872 (graft_intervals_into_buffer): Simplify.
15873
15874 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15875
15876 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15877 hash values of the two rows.
15878 (copy_row_except_pointers): Preserve the used[] arrays and the
15879 hash values of the two rows. (Bug#10035)
15880 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15881
15882 * xdisp.c (row_hash): New function, body extracted from
15883 compute_line_metrics.
15884 (compute_line_metrics): Call row_hash, instead of computing the
15885 hash code inline.
15886
15887 * dispnew.c (verify_row_hash): Call row_hash for computing the
15888 hash code of a row, instead of duplicating code from xdisp.c.
15889
15890 * dispextern.h (row_hash): Add prototype.
15891
15892 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15893
15894 * frame.c (delete_frame): Don't delete the terminal when the last
15895 X frame is closed if emacs is built with GTK toolkit.
15896
15897 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15898
15899 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15900
15901 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15902
15903 * window.c (Vwindow_splits): Rename to
15904 Vwindow_combination_resize. Suggested by Juri Linkov.
15905 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15906 of Vwindow_splits.
15907
15908 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15909
15910 * nsfns.m (Fns_font_name):
15911 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15912
15913 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15914
15915 * window.h (window): Rename slot "nest" to "combination_limit".
15916 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15917 (Fset_window_nest): Rename to Fset_window_combination_limit.
15918 (Vwindow_nest): Rename to Vwindow_combination_limit.
15919 (recombine_windows, make_parent_window, make_window)
15920 (Fsplit_window_internal, saved_window)
15921 (Fset_window_configuration, save_window_save): Rename all
15922 occurrences of window_nest to window_combination_limit.
15923
15924 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15925
15926 * image.c (imagemagick_load_image): Fix typo.
15927
15928 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15929
15930 * xdisp.c (display_line): Move the call to
15931 highlight_trailing_whitespace before the call to
15932 compute_line_metrics, since the latter needs to see the final
15933 faces of all the glyphs to compute ROW's hash value.
15934 Fixes assertion violations in row_equal_p. (Bug#10035)
15935
15936 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15937
15938 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15939 just return (bug#10044).
15940
15941 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15942
15943 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15944 with user-defined heap size. Bump the default size of the temacs
15945 heap to 27MB, to avoid memory warning when running temacs.
15946 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15947
15948 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15949 current_matrix and desired_matrix. (Bug#9990)
15950 (verify_row_hash) [XASSERTS]: New function.
15951 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15952 that the hash value of glyph rows is correct.
15953
15954 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15955
15956 * window.h (window): Remove splits slot.
15957 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15958 (Fdelete_other_windows_internal, make_parent_window)
15959 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15960 (Fset_window_configuration, save_window_save): Don't deal with
15961 split status of windows.
15962 (saved_window): Remove splits slot.
15963 (Vwindow_splits): Rewrite doc-string.
15964
15965 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15966
15967 * xfns.c (unwind_create_frame):
15968 * nsfns.m (unwind_create_frame):
15969 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15970 Vframe_list (Bug#9999).
15971
15972 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15973
15974 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15975
15976 2011-11-11 Kenichi Handa <handa@m17n.org>
15977
15978 * callproc.c (Fcall_process): Set the member dst_multibyte of
15979 process_coding.
15980
15981 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15982
15983 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15984 avoid a crash (bug#9496).
15985
15986 2011-11-09 Chong Yidong <cyd@gnu.org>
15987
15988 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15989 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15990
15991 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15992
15993 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15994
15995 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15996
15997 Avoid some portability problems by eschewing 'extern inline' functions.
15998 The trivial performance wins aren't worth the portability hassles; see
15999 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16000 et seq.
16001 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16002 (window_box_width, window_box_left, window_box_left_offset)
16003 (window_box_right, window_box_right_offset): Undo previous change,
16004 by removing the "extern"s.
16005 * intervals.c (adjust_intervals_for_insertion)
16006 (adjust_intervals_for_deletion): Undo previous change,
16007 making these static again.
16008 (offset_intervals, temp_set_point_both, temp_set_point)
16009 (copy_intervals_to_string): No longer inline.
16010 * xdisp.c (window_text_bottom_y, window_box_width)
16011 (window_box_height, window_box_left_offset)
16012 (window_box_right_offset, window_box_left, window_box_right)
16013 (window_box): No longer inline.
16014
16015 2011-11-08 Chong Yidong <cyd@gnu.org>
16016
16017 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16018 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16019 Signal an error if not a live window.
16020 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16021 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16022
16023 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
16024
16025 * lisp.h (syms_of_abbrev): Remove declaration.
16026 Reported by CHENG Gao <chenggao@royau.me>.
16027
16028 2011-11-07 Eli Zaretskii <eliz@gnu.org>
16029
16030 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16031 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16032 of temacs in GUI mode.
16033
16034 2011-11-07 Martin Rudalics <rudalics@gmx.at>
16035
16036 * window.h: Declare delete_all_child_windows instead of
16037 delete_all_subwindows.
16038 * window.c (Fwindow_nest, Fset_window_nest)
16039 (Fset_window_new_total, Fset_window_new_normal)
16040 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16041 (delete_all_subwindows): Rename to delete_all_child_windows.
16042 (Fdelete_other_windows_internal, Fset_window_configuration):
16043 Call delete_all_child_windows instead of delete_all_subwindows.
16044 * frame.c (delete_frame): Call delete_all_child_windows instead
16045 of delete_all_subwindows.
16046
16047 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16048
16049 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16050 This is also needed for porting to any host where GC_MARK_STACK is
16051 not GC_MAKE_GCPROS_NOOPS.
16052 (which_symbols): Use it.
16053
16054 2011-11-07 Kenichi Handa <handa@m17n.org>
16055
16056 * coding.c (coding_set_destination): Check coding->src_pos only
16057 when coding->src_object is a buffer (bug#9910).
16058
16059 * process.c (send_process): Set the member src_multibyte of coding
16060 to 0 (bug#9911) when sending a unibyte text.
16061
16062 * callproc.c (Fcall_process): Set the member src_multibyte of
16063 process_coding to 0 (bug#9912).
16064
16065 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16066
16067 * xmenu.c (cleanup_widget_value_tree): New function.
16068 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16069 calling free_menubar_widget_value_tree directly (Bug#9830).
16070
16071 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16072
16073 Fix some portability problems with 'inline'.
16074 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16075 (window_box_width, window_box_left, window_box_left_offset)
16076 (window_box_right, window_box_right_offset): Declare extern.
16077 Otherwise, these inline functions do not conform to C99 and
16078 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16079 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16080 * intervals.c (adjust_intervals_for_insertion)
16081 (adjust_intervals_for_deletion): Now extern, because otherwise the
16082 extern inline functions 'offset_intervals' couldn't refer to it.
16083 (static_offset_intervals): Remove.
16084 (offset_intervals): Rewrite using the old contents of
16085 static_offset_intervals. The old version didn't conform to C99
16086 because an extern inline function contained a reference to an
16087 identifier with static linkage.
16088
16089 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16090
16091 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16092 GC.
16093
16094 2011-11-06 Eli Zaretskii <eliz@gnu.org>
16095
16096 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16097 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16098 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16099 return Qleft_to_right.
16100
16101 2011-11-06 Chong Yidong <cyd@gnu.org>
16102
16103 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16104 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16105 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16106 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16107 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16108 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16109 (Fwindow_vscroll): Doc fix.
16110 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16111 argument, since it makes no sense to pass a live window and for
16112 consistency with window-child.
16113
16114 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16115
16116 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16117 support MSVC.
16118
16119 2011-11-05 Jason Rumney <jasonr@gnu.org>
16120
16121 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16122 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16123 fonts (Bug#6029).
16124 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16125 bitwise arithmetic preventing use of unicode-sip and non-truetype
16126 opentype fonts.
16127
16128 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16129
16130 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16131 "emacs"-only part.
16132
16133 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16134 initialization code to keep similarity to xfns.c after changes
16135 from 2011-11-05.
16136
16137 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16138
16139 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16140 (unwind_create_frame): New function (Bug#9943).
16141 (Fx_create_frame): Restructure code to be more similar to the one in
16142 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16143 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16144 Move terminal->reference_count++ just before making the frame official
16145 (Bug#9943).
16146
16147 * nsterm.m (x_free_frame_resources): New function.
16148 (x_destroy_window): Move code to x_free_frame_resources.
16149
16150 * xfns.c (unwind_create_frame): Fix comment.
16151 (Fx_create_frame, x_create_tip_frame):
16152 Move terminal->reference_count++ just before making the frame
16153 official. Move initialization of image_cache_refcount and
16154 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16155
16156 2011-11-05 Eli Zaretskii <eliz@gnu.org>
16157
16158 Support MSVC build with newer versions of Visual Studio.
16159 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16160 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16161 nt/gmake.defs.
16162
16163 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16164 which are not supported by MSVC.
16165 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16166 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16167 bitfields.
16168 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16169 types in bitfields.
16170 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16171
16172 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16173
16174 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16175
16176 Support MSVC build with newer versions of Visual Studio.
16177 * w32.c: Don't include w32api.h for MSVC.
16178 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16179
16180 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16181 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16182 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16183 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16184 e_* cousins.
16185 (alloca) [_MSC_VER]: Define to _alloca.
16186
16187 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16188
16189 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16190
16191 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16192
16193 * xdisp.c (note_mouse_highlight): If either of
16194 previous/next-single-property-change returns nil, treat that as
16195 the beginning or the end of the buffer. (Bug#9955)
16196
16197 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16198
16199 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16200 label is not null (Bug#9951).
16201 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16202 may be NULL.
16203
16204 2011-11-04 Eli Zaretskii <eliz@gnu.org>
16205
16206 * window.c (Fwindow_body_size): Mention in the doc string that the
16207 return value is in frame's canonical units. (Bug#9949)
16208
16209 2011-11-03 Eli Zaretskii <eliz@gnu.org>
16210
16211 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16212
16213 * w32fns.c (unwind_create_frame): If needed, free the glyph
16214 matrices of the partially constructed frame. (Bug#9943)
16215 * xfns.c (unwind_create_frame): Likewise.
16216
16217 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16218
16219 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16220 Don't stop backward scan on the continuation glyph, even though
16221 its CHARPOS is positive.
16222 (mouse_face_from_buffer_pos, note_mouse_highlight):
16223 Rename cover_string to disp_string.
16224
16225 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16226
16227 * window.c (temp_output_buffer_show): Don't use
16228 Vtemp_buffer_show_specifiers.
16229 (Vtemp_buffer_show_specifiers): Remove unused variable.
16230
16231 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16232
16233 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16234 past the beginning of the current glyph matrix.
16235
16236 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16237
16238 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16239 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16240 HAVE_GTK3 (Bug#9869).
16241
16242 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16243 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16244
16245 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16246
16247 * xterm.c: Declare x_handle_net_wm_state to return int.
16248 (handle_one_xevent): Check if we are iconified but don't have
16249 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16250 (get_current_wm_state): Return non-zero if not hidden,
16251 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16252 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16253 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16254 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16255
16256 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16257
16258 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16259 so that this new function doesn't get optimized away by a
16260 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16261
16262 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16263
16264 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16265
16266 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16267
16268 Fix the `xbytecode' command.
16269 * .gdbinit (xprintbytestr): New command.
16270 (xwhichsymbols): Rename from `which'; all callers changed.
16271 (xbytecode): Print the byte-code string as well.
16272
16273 2011-10-29 Kim Storm <storm@cua.dk>
16274
16275 * alloc.c (which_symbols): New function.
16276
16277 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16278
16279 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16280 line. (Bug#9903)
16281
16282 2011-10-29 Glenn Morris <rgm@gnu.org>
16283
16284 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16285 Not clear what it was for, and it causes various bugs. (Bug#9839)
16286
16287 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16288
16289 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16290 possible random value that matches one of those tested as
16291 condition to clear the mouse face.
16292
16293 2011-10-28 Chong Yidong <cyd@gnu.org>
16294
16295 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16296
16297 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16298
16299 * window.c (make_window): Initialize phys_cursor_on_p.
16300
16301 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16302
16303 * lisp.h (struct Lisp_Symbol): Update comments.
16304
16305 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16306
16307 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16308
16309 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16310
16311 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16312 <oslsachem@gmail.com> for helping to debug this.
16313
16314 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16315 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16316 (g_b_init_get_glyph_outline_w): New static variables.
16317 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16318 (GetGlyphOutlineW_Proc): New typedefs.
16319 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16320 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16321 New functions.
16322 (w32font_open_internal, compute_metrics):
16323 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16324 instead of calling the "wide" APIs directly.
16325
16326 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16327
16328 * w32.h (syms_of_w32font): Add prototype.
16329
16330 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16331
16332 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16333 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16334 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16335 (Fmove_to_window_line): Doc fix.
16336
16337 2011-10-27 Chong Yidong <cyd@gnu.org>
16338
16339 * process.c (make_process): Set gnutls_state to NULL.
16340
16341 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16342 non-NULL, regardless of GNUTLS_INITSTAGE.
16343 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16344 an error. Set process slots as soon as we allocate them.
16345
16346 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16347
16348 2011-10-27 Chong Yidong <cyd@gnu.org>
16349
16350 * gnutls.c (emacs_gnutls_deinit): New function.
16351 Deallocate credentials structures as well as calling gnutls_deinit.
16352 (Fgnutls_deinit, Fgnutls_boot): Use it.
16353
16354 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16355 (deactivate_process): Call emacs_gnutls_deinit.
16356
16357 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16358
16359 * image.c (x_create_x_image_and_pixmap):
16360 * w32.c (sys_rename, w32_delayed_load):
16361 * w32font.c (fill_in_logfont):
16362 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16363
16364 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16365
16366 * w32fns.c (w32_default_color_map): New function,
16367 extracted from Fw32_default_color_map.
16368 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16369
16370 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16371
16372 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16373
16374 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16375
16376 * keyboard.c (test_undefined): New function (bug#9751).
16377 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16378
16379 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16380
16381 * sysdep.c (init_sys_modes): Fix the check for the controlling
16382 terminal (Bug#6649).
16383
16384 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16385
16386 * dispextern.h (struct bidi_it): New member next_en_type.
16387
16388 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16389 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16390 current character, check also for next_en_type being WEAK_EN.
16391 (bidi_resolve_weak): Don't enter the expensive loop if the current
16392 position is before next_en_pos. Record the bidi type of the first
16393 non-ET, non-BN character we find, in addition to its position.
16394 (bidi_level_of_next_char): Invalidate next_en_type when
16395 next_en_pos is over-stepped.
16396
16397 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16398
16399 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16400 * editfns.c: Rewrite current-time-zone so that it invokes
16401 the equivalent of (format-time-string "%Z") to get the time zone name.
16402 This fixes a bug when the time zone name contains characters that
16403 need converting from the system time locale to Emacs internal format.
16404 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16405 that patch fixed format-time-string to do the conversion, but
16406 I forgot to fix current-time-zone.
16407 (format_time_string): New function, containing most of
16408 what Fformat_time_string used to contain.
16409 (Fformat_time_string): Rewrite in terms of format_time_string.
16410 This doesn't change this function's behavior.
16411 (current-time-zone): Rewrite to use format_time_string.
16412 This fixes the bug reported by Michael Schierl in
16413 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16414 Jason Rumney's 2007-06-07 change worked around this bug, but
16415 didn't fix it.
16416 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16417
16418 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16419
16420 * xdisp.c (start_display): If the character at POS is displayed
16421 via a display vector, reset IT->current.dpvec_index to zero.
16422 (try_window_reusing_current_matrix): If a line ends in a display
16423 vector or the next line starts in a display vector, continue
16424 redrawing the window even though the character position of
16425 start_row was reached.
16426 (Bug#9771, part 2)
16427
16428 2011-10-18 Chong Yidong <cyd@gnu.org>
16429
16430 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16431 with nobreak-char-display too.
16432
16433 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16434
16435 Fix part 3 of bug#9771.
16436 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16437 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16438 non-neutral characters if the current character is a paragraph
16439 separator (a.k.a. Newline). This avoids running the same
16440 expensive loop twice, once when we consume the preceding newline
16441 and the other time when the line actually needs to be displayed.
16442 Avoid the loop when we see neutrals on the base embedding level
16443 following a character whose directionality is the same as the
16444 paragraph's. This avoids running the expensive loop when a line
16445 ends in a long sequence of neutrals, like control characters.
16446 Add assertion against STRONG_AL type. Slightly rearrange code
16447 that determines the type of a neutral given the first non-neutral
16448 that follows it.
16449 (bidi_level_of_next_char): Set next_en_pos to zero when
16450 invalidating its info.
16451
16452 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16453
16454 * xdisp.c (push_display_prop): Determine whether to record string
16455 or buffer position by IT->string, not by IT->method. Allow
16456 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16457 (move_it_vertically_backward): Don't look for character position
16458 immediately after the newline when in a continuation line.
16459 (Bug#9771, part 1)
16460
16461 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16462
16463 * window.c (coordinates_in_window): Rewrite and delabelize
16464 vertical border check. (Bug#5357) (Bug#9618)
16465
16466 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16467
16468 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16469 errors in XSetWindowBorder (bug#9310).
16470
16471 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16472
16473 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16474 avoid crash when xmalloc overrun checking is enabled.
16475
16476 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16477
16478 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16479 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16480 cursor motion with <left> and <right> arrow keys.
16481
16482 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16483 some callers set that themselves.
16484
16485 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16486
16487 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16488 display string and the previous row comes from the same string and
16489 is empty. (Bug#9739) (Bug#9738)
16490
16491 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16492
16493 * doc.c (get_doc_string): Encode file name (bug#9735).
16494
16495 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16496
16497 * bidi.c (bidi_level_of_next_char):
16498 * xdisp.c (get_visually_first_element): Remove old incorrect
16499 comments regarding the Unicode Line Separator character.
16500
16501 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16502
16503 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16504
16505 * alloc.c (Fgc_status): Do not access beyond zombies array
16506 boundary if nzombies > MAX_ZOMBIES.
16507 * alloc.c (dump_zombies): Add missing format specifier.
16508
16509 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16510
16511 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16512 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16513
16514 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16515 Some packages use them to denote characters with modifiers.
16516
16517 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16518
16519 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16520 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16521 matching a pp-number. Rename parameter var to var1.
16522
16523 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16524
16525 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16526
16527 2011-10-08 Glenn Morris <rgm@gnu.org>
16528
16529 * callint.c (Fcall_interactively): Give a more explicit error for the
16530 'c' case with a non-character input. (Bug#8479)
16531
16532 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16533
16534 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16535 lines.
16536 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16537 lines that are hscrolled on the left.
16538
16539 * dispnew.c (buffer_posn_from_coords): Account for a possible
16540 presence of header-line. (Bug#4426)
16541
16542 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16543
16544 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16545 Don't advertise functionality which we discourage or doesn't work.
16546
16547 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16548
16549 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16550 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16551 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16552 this makes Emacs dump core during garbage collection on rare
16553 occasions. sizeof is obviously inferior to offsetof here, so
16554 stick with offsetof.
16555 (GC_POINTER_ALIGNMENT): New macro.
16556 (mark_memory): Omit 3rd (offset) arg; caller changed.
16557 Don't assume EMACS_INT alignment is the same as pointer alignment.
16558
16559 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16560
16561 * keyboard.c (read_key_sequence_remapped): New var.
16562 (read_key_sequence): Compute remapping in the right buffer.
16563 (command_loop_1): Use read_key_sequence's remapping directly.
16564
16565 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16566
16567 * dired.c (file_name_completion): Don't expand file name.
16568 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16569 before checking file name handler.
16570
16571 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16572 they've been requested explicitly (bug#9591).
16573
16574 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16575
16576 * keymap.c (Fsingle_key_description): Use make_specified_string
16577 instead of build_string to build string from push_key_description.
16578 (Bug#5193)
16579
16580 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16581
16582 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16583 This fixes a Y2038 bug on 64-bit hosts.
16584 * buffer.c (reset_buffer):
16585 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16586 (Fclear_buffer_auto_save_failure):
16587 Use 0, not -1, to represent an unset failure time, since time_t
16588 might not be signed.
16589
16590 Remove dependency on glibc malloc internals.
16591 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16592 Move back here from lisp.h, but with their new implementations.
16593 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16594 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16595 * charset.c (charset_table_init): New static var.
16596 (syms_of_charset): Use it instead of xmalloc. This removes a
16597 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16598 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16599 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16600 Move back to alloc.c.
16601 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16602 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16603
16604 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16605
16606 * nsterm.m (windowDidResize): Call x_set_window_size only when
16607 ns_in_resize is true. Otherwise set pixelwidth/height and
16608 call change_frame_size (Bug#9628).
16609
16610 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16611
16612 Port --enable-checking=all to Fedora 14 x86-64.
16613 * charset.c (syms_of_charset): Also account for glibc malloc's
16614 internal overhead when calculating the initial malloc maximum.
16615
16616 Port --enable-checking=all to Fedora 14 x86.
16617 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16618 Move to lisp.h.
16619 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16620 (overrun_check_realloc, overrun_check_free):
16621 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16622 That way, xmalloc returns a properly-aligned pointer even if
16623 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16624 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16625 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16626 into account when calculating the initial malloc maximum.
16627 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16628 Move here from alloc.c, so that charset.c can use it too.
16629 Properly align; the old code wasn't right for common 32-bit hosts
16630 when configured with --enable-checking=all.
16631 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16632 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16633
16634 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16635
16636 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16637 use EDOM.
16638
16639 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16640
16641 * xdisp.c (compute_display_string_end): If there's no display
16642 string at CHARPOS, return -1.
16643
16644 * bidi.c (bidi_fetch_char): When compute_display_string_end
16645 returns a negative value, treat the character as a normal
16646 character not covered by a display string. (Bug#9624)
16647
16648 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16649
16650 * lread.c (Fread_from_string): Fix typo in docstring.
16651
16652 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16653
16654 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16655 newline, reseat the iterator instead of bidi-iterating there one
16656 character at a time. (Bug#9610)
16657 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16658 TO_CHARPOS if the bidi iterator is at base embedding level.
16659
16660 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16661
16662 * lread.c (readevalloop): Use correct code for NBSP.
16663 (read1): Likewise. (Bug#9608)
16664
16665 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16666
16667 * dbusbind.c (Fdbus_register_signal): When service is not
16668 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16669
16670 2011-09-25 Glenn Morris <rgm@gnu.org>
16671
16672 * buffer.c (truncate-lines): Doc fix.
16673
16674 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16675
16676 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16677 (Fset_window_next_buffers): Doc fix.
16678
16679 2011-09-24 Glenn Morris <rgm@gnu.org>
16680
16681 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16682
16683 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16684
16685 Fix minor problems found by static checking.
16686 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16687 * indent.c (Fvertical_motion): Fix == vs = typo.
16688
16689 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16690
16691 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16692 Default value is now t. Doc fix.
16693
16694 * indent.c (Fvertical_motion): Compute and apply the overshoot
16695 logic when moving up, not only when moving down. Fix the
16696 confusing name and values of the it_overshoot_expected variable;
16697 logic changes accordingly. (Bug#9254) (Bug#9549)
16698
16699 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16700 CHARPOS is covered by a display string which includes newlines.
16701 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16702 is covered by a display string with embedded newlines.
16703
16704 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16705
16706 * dbusbind.c (Fdbus_register_signal): Add match rule to
16707 Vdbus_registered_objects_table. (Bug#9581)
16708 (Fdbus_register_method, Vdbus_registered_objects_table):
16709 Fix docstring.
16710
16711 2011-09-24 Jim Meyering <meyering@redhat.com>
16712
16713 do not ignore write error for any output size
16714 The previous change was incomplete.
16715 While it makes emacs --batch detect the vast majority of stdout
16716 write failures, errors were still ignored whenever the output size is
16717 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16718 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16719 && echo FAIL: ignored write error
16720 FAIL: ignored write error
16721 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16722 && echo FAIL: ignored write error
16723 FAIL: ignored write error
16724 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16725
16726 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16727
16728 * emacs.c (Fkill_emacs): In noninteractive mode exit
16729 non-successfully if a write error occurred on stdout. (Bug#9574)
16730
16731 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16732
16733 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16734 the xassert test.
16735
16736 * dispextern.h (struct it): Update the comment documenting what
16737 can it->OBJECT be.
16738
16739 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16740
16741 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16742 a display string, extend search for cursor position to end of row.
16743 (find_row_edges): If the row ends in a newline from a display
16744 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16745 Handle the case of a display string with multiple newlines.
16746 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16747 non-empty line. Fixes confusing cursor motion with arrow keys at
16748 the beginning of a line that starts with whitespace.
16749
16750 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16751
16752 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16753 (bug#9493).
16754
16755 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16756
16757 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16758 boolean (Bug#9154).
16759
16760 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16761
16762 * xdisp.c (display_line): Record maximum and minimum buffer
16763 positions even if no glyphs were produced (e.g., by a zero-width
16764 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16765 buffer positions that will be removed from the glyph row because
16766 they don't fit.
16767 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16768 column is beyond frame width: don't subtract 1 "pixel" when
16769 computing width of the stretch.
16770 (reseat_at_next_visible_line_start): Undo the change made on
16771 2011-09-17 that saved paragraph information and restored it after
16772 the call to `reseat'. (Bug#9545)
16773
16774 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16775
16776 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16777 and turn window cursor on if cleared (Bug#9415).
16778
16779 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16780
16781 * search.c (boyer_moore): Take unibyte characters from pattern
16782 literally. (Bug#9458)
16783
16784 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16785
16786 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16787
16788 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16789
16790 Fix minor problem found by static checking.
16791 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16792 initialized, to pacify gcc -Wuninitialized.
16793
16794 * fileio.c: Report proper errno when syscall falls.
16795 (Finsert_file_contents): Save and restore errno,
16796 so that report_file_error outputs the correct diagnostic.
16797 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16798
16799 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16800
16801 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16802
16803 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16804
16805 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16806 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16807
16808 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16809
16810 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16811 about the current paragraph and restore it after the call to reseat.
16812
16813 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16814 (bidi_find_paragraph_start): Search back for paragraph beginning
16815 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16816 (bidi_move_to_visually_next): Only trigger paragraph-related
16817 computations when the last character is a newline or at EOB, not
16818 just any NEUTRAL_B. (Bug#9470)
16819
16820 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16821 truncated lines if point is covered by a display string. (Bug#9524)
16822
16823 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16824
16825 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16826 (cons_to_x_long): New function.
16827 (lisp_data_to_selection_data): Use it. Correct the test for
16828 short-versus-long data; it was negated. Break out of vector
16829 loop, for efficiency, when a long datum is discovered.
16830
16831 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16832
16833 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16834
16835 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16836
16837 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16838 GCC PR/17406) by declaring this function with external scope.
16839
16840 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16841
16842 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16843 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16844
16845 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16846
16847 * editfns.c (Fformat): Correctly handle text properties on "%%".
16848
16849 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16850
16851 * xterm.c (x_draw_composite_glyph_string_foreground):
16852 * w32term.c (x_draw_composite_glyph_string_foreground):
16853 * term.c (encode_terminal_code):
16854 * composite.c (composition_update_it, get_composition_id):
16855 * xdisp.c (get_next_display_element)
16856 (fill_composite_glyph_string): Add comments about special meaning
16857 of TAB characters in a composition.
16858
16859 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16860
16861 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16862 This occurs when processing a multibyte format.
16863 Problem reported by Wolfgang Jenker.
16864
16865 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16866
16867 * xdisp.c (try_cursor_movement): Only check for exact match if
16868 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16869
16870 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16871
16872 Remove unused external symbols.
16873 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16874 * xdisp.c (calc_pixel_width_or_height): Now static.
16875 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16876 * indent.c (check_display_width):
16877 * w32term.c: Fix comment to match code.
16878 * xterm.c, xterm.h (x_catching_errors): Remove.
16879
16880 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16881
16882 * xselect.c: Use signed conversions more consistently (Bug#9498).
16883 (selection_data_to_lisp_data): Assume incoming selection data are
16884 signed integers, not unsigned. This is to be consistent with
16885 outgoing selection data, which was modified to use signed integers
16886 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16887 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16888 expects long, not unsigned long.
16889
16890 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16891
16892 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16893 computation of loop end. Reported by Johan Bockgård
16894 <bojohan@gnu.org>.
16895
16896 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16897
16898 * frame.c (Fother_visible_frames_p): Function deleted.
16899
16900 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16901
16902 * indent.c (compute_motion): Process display vector front to back
16903 rather than the other way around. (Bug#2496)
16904
16905 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16906
16907 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16908
16909 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16910
16911 * minibuf.c (Fread_from_minibuffer): Doc fix.
16912
16913 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16914
16915 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16916 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16917
16918 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16919
16920 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16921 value for non-existent files.
16922
16923 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16924
16925 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16926 set its "size" to -1. This will set the modtime_size field of
16927 the corresponding buffer to -1, which is what
16928 verify-visited-file-modtime expects for files that do not exist.
16929 (Bug#9139)
16930
16931 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16932
16933 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16934 here ...
16935 * lisp.h: ... from here. push_key_description is no longer
16936 defined in keyboard.c, so its declaration should not be in
16937 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16938 logically belongs with push_key_description.
16939
16940 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16941
16942 * buffer.h: Include <sys/types.h> instead of <time.h>.
16943 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16944 Problem reported by Herbert J. Skuhra.
16945
16946 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16947
16948 * xml.c (parse_region): Make the parsing work for
16949 non-comment-starting XML files again (bug#9144).
16950
16951 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16952
16953 * image.c (gif_load): Fix calculation of bottom and right corner.
16954 (Bug#9468)
16955
16956 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16957
16958 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16959 redisplay in small windows.
16960
16961 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16962
16963 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16964
16965 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16966
16967 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16968 Operate on live windows only.
16969
16970 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16971
16972 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16973
16974 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16975
16976 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16977 only under bidi iteration.
16978
16979 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16980
16981 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16982
16983 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16984
16985 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16986 Without this fix, the command to link temacs failed due to an
16987 undefined symbol __builtin_isnan. This is because
16988 /usr/include/iso/math_c99.h #defines isnan(x) to
16989 __builtin_isnan(x), but the bundled gcc, which identifies itself
16990 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16991 a __builtin_isnan.
16992 * floatfns.c (isnan): #undef, and then #define to a clone of
16993 what's in data.c.
16994 (Fisnan): Always define, since it's always available now.
16995 (syms_of_floatfns): Always define isnan at the Lisp level.
16996
16997 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16998
16999 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17000
17001 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17002
17003 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17004 The previous code assumed that file offsets (off_t values) fit in
17005 EMACS_INT variables, which is not true on typical 32-bit hosts.
17006 The code messed up by falsely reporting buffer overflow in cases
17007 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17008 when "big" contains more than 2**29 bytes, even though this
17009 inserts just one byte and does not overflow the buffer.
17010 (Finsert_file_contents): Store file offsets as off_t
17011 values, not as EMACS_INT values. Check for overflow when
17012 converting between EMACS_INT and off_t. When checking for
17013 buffer overflow or for overlap, take the offsets into account.
17014 Don't use EMACS_INT for small values where int suffices.
17015 When checking for overlap, fix a typo: ZV was used where
17016 ZV_BYTE was intended.
17017 (Fwrite_region): Don't assume off_t fits into 'long'.
17018 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17019
17020 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
17021
17022 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17023
17024 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17025
17026 sprintf-related integer and memory overflow issues (Bug#9412).
17027
17028 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17029 (esprintf, exprintf, evxprintf): New functions.
17030 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17031 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17032 (modify_event_symbol): Do not assume that the length of
17033 name_alist_or_stem is safe to alloca and fits in int.
17034 (Fexecute_extended_command): Likewise for function name and binding.
17035 (Frecursion_depth): Wrap around reliably on integer overflow.
17036 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17037 since some callers pass EMACS_INT values.
17038 (Fsingle_key_description): Don't crash if symbol name contains more
17039 than MAX_ALLOCA bytes.
17040 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17041 (get_minibuffer): Arg is now EMACS_INT, not int.
17042 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17043 (esprintf, exprintf, evxprintf): New decls.
17044 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17045
17046 * dbusbind.c (signature_cat): New function.
17047 (xd_signature, Fdbus_register_signal):
17048 Do not overrun buffer; instead, report string overflow.
17049
17050 * dispnew.c (add_window_display_history): Don't overrun buffer.
17051 Truncate instead; this is OK since it's just a log.
17052
17053 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17054 even if the time zone offset is outlandishly large.
17055 Don't mishandle offset == INT_MIN.
17056
17057 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17058 when creating daemon; the previous buffer-overflow check was incorrect.
17059
17060 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17061 which has the guts of the old verror function.
17062
17063 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17064 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17065
17066 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17067 (font_unparse_xlfd): Don't blindly alloca long strings.
17068 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17069 fits in int, when using sprintf. Use single snprintf to count
17070 length of string rather than counting it via multiple sprintfs;
17071 that's simpler and more reliable.
17072 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17073 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17074 sprintf, in case result does not fit in int.
17075
17076 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17077 (fontset_from_font): Print it.
17078
17079 * frame.c (tty_frame_count): Now printmax_t, not int.
17080 (make_terminal_frame, set_term_frame_name): Print it.
17081 (x_report_frame_params): In X, window IDs are unsigned long,
17082 not signed long, so print them as unsigned.
17083 (validate_x_resource_name): Check for implausibly long names,
17084 and don't assume name length fits in 'int'.
17085 (x_get_resource_string): Don't blindly alloca invocation name;
17086 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17087 not fit in int.
17088
17089 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17090 (xg_check_special_colors, xg_set_geometry):
17091 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17092
17093 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17094 Use esprintf, not sprintf, in case result does not fit in int.
17095
17096 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17097 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17098 it as a large positive number.
17099 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17100 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17101
17102 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17103 in case result does not fit in int.
17104
17105 * print.c (float_to_string): Detect width overflow more reliably.
17106 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17107 buffer overrun. Don't assume list length fits in 'int'. Treat
17108 print length of 0 as 0, not as infinity; to be consistent with other
17109 uses of print length in this function. Don't overflow print length
17110 index. Don't assume hash table size fits in 'long', or that
17111 vectorlike size fits in 'unsigned long'.
17112
17113 * process.c (make_process): Use printmax_t, not int, to format
17114 process-name gensyms.
17115
17116 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17117
17118 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17119 to avoid potential buffer overrun.
17120
17121 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17122 if X resource line is longer than 512 bytes.
17123
17124 * xfns.c (x_window): Make sprintf buffer a bit bigger
17125 to avoid potential buffer overrun.
17126
17127 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17128
17129 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17130
17131 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17132
17133 Integer overflow fixes for scrolling, etc.
17134 Without these, Emacs silently mishandles large integers sometimes.
17135 For example, "C-u 4294967297 M-x recenter" was treated as if
17136 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17137
17138 * xdisp.c (try_window_id): Check Emacs fixnum range before
17139 converting to 'int'.
17140
17141 * window.c (window_scroll_line_based, Frecenter):
17142 Check that an Emacs fixnum is in range before assigning it to 'int'.
17143 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17144 values converted from Emacs fixnums.
17145 (Frecenter): Don't wrap around a line count if it is out of 'int'
17146 range; instead, treat it as an extreme value.
17147 (Fset_window_configuration, compare_window_configurations):
17148 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17149
17150 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17151 that can exceed INT_MAX. Check that EMACS_INT value is in range
17152 before assigning it to the (possibly-narrower) index.
17153 (match_limit): Don't assume that a fixnum can fit in 'int'.
17154
17155 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17156 exceed INT_MAX.
17157
17158 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17159 (Fvertical_motion): Don't wrap around LINES values that don't fit
17160 in 'int'. Instead, treat them as extreme values. This is good
17161 enough for windows, which can't have more than INT_MAX lines anyway.
17162
17163 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17164
17165 * Require libxml/parser.h to avoid compilation warning.
17166
17167 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17168
17169 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17170 since this reportedly can destroy thread storage.
17171
17172 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
17173
17174 * syntax.c (find_defun_start): Update all cache variables if
17175 exiting early (Bug#9401).
17176
17177 2011-08-30 Eli Zaretskii <eliz@gnu.org>
17178
17179 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17180
17181 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17182 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17183 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17184
17185 * term.c (tty_append_glyph): New function.
17186 (produce_stretch_glyph): Static function and its prototype deleted.
17187
17188 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17189 Add prototypes.
17190
17191 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17192
17193 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17194 when checking :margin (Bug#9390).
17195 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17196 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17197 so that the name doesn't mislead. All uses changed.
17198
17199 2011-08-28 Johan Bockgård <bojohan@gnu.org>
17200
17201 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17202 set_tty_hooks.
17203
17204 2011-08-27 Eli Zaretskii <eliz@gnu.org>
17205
17206 * xdisp.c (move_it_to): Don't bail out early when reaching
17207 position beyond to_charpos, if we are scanning backwards.
17208 (move_it_vertically_backward): When DY == 0, make sure we get to
17209 the first character in the line after the newline.
17210
17211 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17212
17213 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17214 (ccl_driver): Do not generate an out-of-range pointer.
17215 (Fccl_execute_on_string): Remove unnecessary check for
17216 integer overflow, noted by Stefan Monnier in
17217 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17218 Remove a FIXME that didn't need fixing.
17219 Simplify the newly-introduced buffer reallocation code.
17220
17221 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17222
17223 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17224
17225 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17226
17227 Integer and memory overflow issues (Bug#9196).
17228
17229 * doc.c (get_doc_string): Rework so that
17230 get_doc_string_buffer_size is the actual buffer size, rather than
17231 being 1 less than the actual buffer size; this makes xpalloc more
17232 convenient.
17233
17234 * image.c (x_allocate_bitmap_record, cache_image):
17235 * xselect.c (Fx_register_dnd_atom):
17236 Simplify previous changes by using xpalloc.
17237
17238 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17239 since either will do and ptrdiff_t is convenient with xpalloc.
17240
17241 * charset.c (charset_table_size)
17242 (struct charset_sort_data.priority): Now ptrdiff_t.
17243 (charset_compare): Don't overflow if priorities differ greatly.
17244 (Fsort_charsets): Don't assume list length fits in int.
17245 Check for size-calculation overflow when allocating sort data.
17246 (syms_of_charset): Allocate an initial charset table that is
17247 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17248
17249 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17250
17251 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17252 The actual value is always <= INT_MAX, and leaving it unsigned made
17253 overflow checking harder.
17254
17255 * dispextern.h (struct glyph_matrix.rows_allocated)
17256 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17257 with xpalloc. The values are still always <= INT_MAX.
17258
17259 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17260
17261 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17262 (SAFE_NALLOCA): New macro.
17263
17264 * region-cache.c (struct boundary.pos, find_cache_boundary)
17265 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17266 (set_cache_region, invalidate_region_cache)
17267 (revalidate_region_cache, know_region_cache, region_cache_forward)
17268 (region_cache_backward, pp_cache):
17269 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17270 so that ptrdiff_t * can be passed to xpalloc.
17271 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17272 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17273 (pp_cache): Don't assume cache_len fits in int.
17274 * region-cache.h: Adjust extern decls to match.
17275
17276 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17277 EMACS_INT, since either will do, for xpalloc.
17278
17279 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17280 (xnmalloc, xnrealloc, xpalloc): New functions.
17281
17282 * bidi.c (bidi_shelve_header_size): New constant.
17283 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17284 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17285
17286 * bidi.c (bidi_cache_shrink):
17287 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17288 (overlay_strings):
17289 Don't update size of array until after memory allocation succeeds,
17290 because xmalloc/xrealloc may not return.
17291 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17292 now that we have proper integer overflow checking.
17293 (record_overlay_string, overlay_strings): Catch overflows when
17294 calculating size of overlay_str_buf.
17295
17296 * callproc.c (Fcall_process): Check for size overflow when
17297 calculating size of args2.
17298 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17299 Normally we prefer signed values, but sticking with ptrdiff_t would
17300 require adding more-complicated checks.
17301
17302 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17303 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17304 Redo buffer-overflow calculations to avoid integer overflow.
17305 Add a FIXME comment where memory seems to be over-allocated.
17306
17307 * character.c (Fstring): Check for size-calculation overflow.
17308
17309 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17310 unnecessary integer overflow. Check for size overflow.
17311 (encode_coding_object): Don't update size until xmalloc succeeds.
17312
17313 * composite.c (get_composition_id): Check for overflow in glyph
17314 length calculations.
17315
17316 Integer and memory overflow fixes for display code.
17317 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17318 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17319 (scrolling_window): Check for overflow in size calculations.
17320 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17321 Don't assume glyph table len fits in int.
17322 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17323 (row_table_size): Now ptrdiff_t, not int.
17324 (scrolling_window): Avoid overflow in size calculations.
17325 Don't update size until allocation succeeds.
17326 * fns.c (concat): Check for overflow in size calculations.
17327 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17328 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17329 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17330
17331 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17332 (get_doc_string): Check for size calculation overflow.
17333 Don't update size until allocation succeeds.
17334 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17335 EMACS_INT, where ptrdiff_t will do.
17336 (Fsubstitute_command_keys): Check for string overflow.
17337
17338 * editfns.c (set_time_zone_rule): Don't assume environment length
17339 fits in int.
17340 (message_length): Now ptrdiff_t, not int.
17341 (Fmessage_box): Don't update size until allocation succeeds.
17342 Don't assume message length fits in int.
17343 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17344
17345 * emacs.c (main): Do not reallocate argv, since there is a null at
17346 the end that can be overwritten, and this way there's no need to
17347 worry about size-calculation overflow.
17348 (sort_args): Check for size-calculation overflow.
17349
17350 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17351 alloc succeeds.
17352 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17353
17354 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17355 (x_set_scroll_bar_width, x_figure_window_size):
17356 Check for integer overflow.
17357 (x_set_alpha): Do not assume XINT fits in int.
17358
17359 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17360 This is for the members text_lines, text_cols, total_lines, total_cols,
17361 where the system imposes an 'int' limit.
17362
17363 * fringe.c (Fdefine_fringe_bitmap):
17364 Don't update size until alloc works.
17365
17366 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17367 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17368
17369 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17370 Check for size-calculation overflow.
17371 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17372 do, as we prefer signed integers.
17373 (id_to_widget.max_size, id_to_widget.used)
17374 (xg_store_widget_in_map, xg_remove_widget_from_map)
17375 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17376 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17377 Use and return ptrdiff_t, not int.
17378 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17379 * gtkutil.h: Change prototypes to match the above.
17380
17381 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17382 are duplicate now that they've been promoted to lisp.h.
17383 (x_allocate_bitmap_record, x_alloc_image_color)
17384 (make_image_cache, cache_image, xpm_load):
17385 Don't update size until alloc is done.
17386 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17387 (x_detect_edges):
17388 Check for size calculation overflow.
17389 (ct_colors_allocated_max): New constant.
17390 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17391 overflow.
17392
17393 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17394 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17395 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17396 Use ptrdiff_t, not int, to count maps.
17397 (read_char_minibuf_menu_prompt): Check for overflow in size
17398 calculations. Don't update size until allocation succeeds.
17399 Redo calculations to avoid overflow.
17400 * keyboard.h: Change prototypes to match the above.
17401
17402 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17403 to count maps.
17404 (current_minor_maps): Check for size calculation overflow.
17405 * keymap.h: Change prototypes to match the above.
17406
17407 * lread.c (read1, init_obarray): Don't update size until alloc done.
17408
17409 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17410 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17411
17412 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17413 Now ptrdiff_t, not int.
17414 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17415 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17416
17417 * process.c (Fnetwork_interface_list): Check for overflow
17418 in size calculation.
17419
17420 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17421
17422 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17423 overflow. Don't bother calling xmalloc when xrealloc will do.
17424
17425 * search.c (Freplace_match): Check for size calculation overflow.
17426 (Fset_match_data): Don't assume list lengths fit in 'int'.
17427
17428 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17429 for command line length. Do not attempt to address one before the
17430 beginning of an array, as that's not portable.
17431
17432 * term.c (max_frame_lines): Remove; unused.
17433 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17434 not int.
17435 (encode_terminal_code, calculate_costs): Check for size
17436 calculation overflow.
17437 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17438 table lengths and related sizes. Don't update size until alloc
17439 done. Redo calculations to avoid overflow.
17440 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17441
17442 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17443 subtracting pointers.
17444 (gobble_line): Check for overflow more carefully. Don't update size
17445 until alloc done.
17446
17447 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17448 Don't update size until alloc done.
17449 Redo size calculations to avoid overflow.
17450 Check for size calculation overflow.
17451 (main) [DEBUG]: Fix typo in invoking tparam1.
17452
17453 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17454 Use ptrdiff_t, not int, for sizes.
17455 (store_mode_line_noprop_char): Don't update size until alloc done.
17456
17457 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17458 Use ptrdiff_t, not int, for sizes.
17459 (Finternal_make_lisp_face, cache_face):
17460 Check for size calculation overflow.
17461 (cache_face): Treat size calculation overflows as if they were
17462 memory exhaustion (the usual treatment), rather than aborting.
17463
17464 * xfns.c (x_encode_text, x_set_name_internal)
17465 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17466 sizes, since they can exceed INT_MAX in size. Check for size
17467 calculation overflow.
17468
17469 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17470 (xg_select): Check for size calculation overflow.
17471 Don't update size until alloc done.
17472
17473 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17474 as sprintf is limited to int lengths.
17475
17476 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17477 (X_LONG_MIN): New macros.
17478 Use them to make the following changes clearer.
17479 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17480 This change doesn't affect the value now, but it may help remind
17481 future maintainers not to raise the value too much later.
17482 (SELECTION_QUANTUM): Remove, replacing with ...
17483 (selection_quantum): ... new function, which avoids overflow.
17484 All uses changed.
17485 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17486 assumption that selection length fits in 'int'.
17487 (x_reply_selection_request, x_handle_selection_request)
17488 (x_get_window_property, receive_incremental_selection)
17489 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17490 (lisp_data_to_selection_data, clean_local_selection_data):
17491 Use ptrdiff_t, not int, to record length of selection.
17492 (x_reply_selection_request, x_get_window_property)
17493 (receive_incremental_selection, x_property_data_to_lisp):
17494 Redo calculations to avoid overflow.
17495 (x_reply_selection_request): When sending hint, ceiling it at
17496 X_LONG_MAX rather than relying on wraparound overflow to send
17497 something.
17498 (x_get_window_property, receive_incremental_selection)
17499 (lisp_data_to_selection_data, x_property_data_to_lisp):
17500 Check for size-calculation overflow.
17501 (x_get_window_property, receive_incremental_selection)
17502 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17503 Don't store size until memory allocation succeeds.
17504 (x_get_window_property): Plug memory leak on memory exhaustion.
17505 Don't double-block input; malloc is safe here. Don't assume 2**34
17506 - 4 fits in unsigned long. Add an xassert to check
17507 XGetWindowProperty overflow. Be more careful about overflow
17508 calculations, and distinguish size from memory overflow better.
17509 (receive_incremental_selection): When tracing, don't assume
17510 unsigned int is less than INT_MAX.
17511 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17512 harmful) conversions of unsigned short to int.
17513 (lisp_data_to_selection_data): Don't assume that integers
17514 in the range -65535 through -1 fit in an X unsigned short.
17515 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17516 result parameters unless successful. Rely on cons_to_unsigned
17517 to report problems with elements; the old code wasn't right anyway.
17518 (x_check_property_data): Check for int overflow; we cannot use
17519 a wider type due to X limits.
17520 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17521
17522 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17523
17524 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17525 (x_term_init): Check for size calculation overflow.
17526 (x_color_cells): Don't store size until memory allocation succeeds.
17527 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17528 Don't assume alloca size is less than MAX_ALLOCA.
17529 (x_term_init): Don't assume length fits in int (sprintf is limited
17530 to int size).
17531
17532 Use ptrdiff_t for composition IDs.
17533 * character.c (lisp_string_width):
17534 * composite.c (composition_table_size, n_compositions)
17535 (get_composition_id, composition_gstring_from_id):
17536 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17537 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17538 * window.c (Frecenter):
17539 Use ptrdiff_t, not int, for composition IDs.
17540 * composite.c (get_composition_id): Check for integer overflow.
17541 * composite.h: Adjust prototypes to match the above changes.
17542
17543 Use ptrdiff_t for hash table indexes.
17544 * category.c (hash_get_category_set):
17545 * ccl.c (ccl_driver):
17546 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17547 * coding.c (coding_system_charset_list, detect_coding_system):
17548 * coding.h (struct coding_system.id):
17549 * composite.c (get_composition_id, gstring_lookup_cache):
17550 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17551 * image.c (xpm_get_color_table_h):
17552 * lisp.h (hash_lookup, hash_put):
17553 * minibuf.c (Ftest_completion):
17554 Use ptrdiff_t for hash table indexes, not int (which is too
17555 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17556 32-bit --with-wide-int hosts).
17557
17558 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17559 Add a FIXME comment about memory leaks.
17560 (syms_of_charset): Don't assume xmalloc returns.
17561
17562 Don't assume that stated character widths fit in int.
17563 * character.c (Fchar_width, c_string_width, lisp_string_width):
17564 * character.h (CHAR_WIDTH):
17565 * indent.c (MULTIBYTE_BYTES_WIDTH):
17566 Use sanitize_char_width to avoid undefined and/or bad behavior
17567 with outlandish widths.
17568 * character.h (sanitize_tab_width): Rename from sanitize_width,
17569 now that we have two such functions. All uses changed.
17570 (sanitize_char_width): New inline function.
17571
17572 Don't assume that tab-width fits in int.
17573 * character.h (sanitize_width): New inline function.
17574 (SANE_TAB_WIDTH): New macro.
17575 (ASCII_CHAR_WIDTH): Use it.
17576 * indent.c (sane_tab_width): Remove. All uses replaced by
17577 SANE_TAB_WIDTH (current_buffer).
17578 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17579
17580 * fileio.c: Integer overflow issues with file modes.
17581 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17582
17583 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17584 Remove unreachable code.
17585 (read_hex, load_charset_map_from_file): Check for integer overflow.
17586
17587 * xterm.c: Don't go over XClientMessageEvent limit.
17588 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17589 (x_send_scroll_bar_event): Likewise. Check that the size does not
17590 exceed limits imposed by XClientMessageEvent, as well as the usual
17591 ptrdiff_t and size_t limits.
17592
17593 * keyboard.c: Overflow, signedness and related fixes.
17594 (make_lispy_movement): Use same integer type in forward decl
17595 that is used in the definition.
17596 (read_key_sequence, keyremap_step):
17597 Change bufsize argument back to int, undoing my 2011-03-30 change.
17598 We prefer signed types, and int is wide enough here.
17599 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17600 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17601 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17602 length, not size_t. Use ptrdiff_t for index, not int.
17603 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17604 possibility of integer overflow.
17605
17606 Overflow, signedness and related fixes for images.
17607
17608 * dispextern.h (struct it.stack[0].u.image.image_id)
17609 (struct_it.image_id, struct image.id, struct image_cache.size)
17610 (struct image_cache.used, struct image_cache.ref_count):
17611 * gtkutil.c (update_frame_tool_bar):
17612 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17613 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17614 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17615 * nsmenu.m (update_frame_tool_bar):
17616 * xdisp.c (calc_pixel_width_or_height):
17617 * xfns.c (image_cache_refcount):
17618 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17619 on typical 64-bit hosts.
17620
17621 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17622 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17623 Omit unnecessary casts to int.
17624 (parse_image_spec): Check that integers fall into 'int' range
17625 when the callers expect that.
17626 (image_ascent): Redo ascent calculation to avoid int overflow.
17627 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17628 (lookup_image): Remove unnecessary tests.
17629 (xbm_image_p): Locals are now of int, not EMACS_INT,
17630 since parse_image_check makes sure they fit into int.
17631 (png_load, gif_load, svg_load_image):
17632 Prefer int to unsigned where either will do.
17633 (tiff_handler): New function, combining the cores of the
17634 old tiff_error_handler and tiff_warning_handler.
17635 This function is rewritten to use vsnprintf and thereby avoid
17636 stack buffer overflows. It uses only the features of vsnprintf
17637 that are common to both POSIX and native Microsoft.
17638 (tiff_error_handler, tiff_warning_handler): Use it.
17639 (tiff_load, gif_load, imagemagick_load_image):
17640 Don't assume :index value fits in 'int'.
17641 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17642 (imagemagick_load_image): Check that crop parameters fit into
17643 the integer types that MagickCropImage accepts. Don't assume
17644 Vimagemagick_render_type has a nonnegative value. Don't assume
17645 size_t fits in 'long'.
17646 (gs_load): Use printmax_t to print the widest integers possible.
17647 Check for integer overflow when computing image height and width.
17648
17649 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17650
17651 * xdisp.c (redisplay_window): Don't force window start if point
17652 will be invisible in the resulting window. (Bug#9324)
17653
17654 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17655
17656 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17657 the display spec is of the form `(space ...)'.
17658 (handle_display_spec): Return the value returned by
17659 handle_single_display_spec, not just 1 or zero.
17660 (handle_single_display_spec): If the display spec is of the form
17661 `(space ...)', and specifies display in the text area, return 2
17662 rather than 1.
17663 (try_cursor_movement): Check for the need to scroll more
17664 accurately, and prefer exact match for point under bidi.
17665 Don't advance `row' beyond the last row of the window.
17666
17667 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17668 into disp_prop; all users changed.
17669
17670 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17671 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17672 for the text covered by the display property.
17673
17674 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17675
17676 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17677 Change return value to nil.
17678 (Frecord_buffer): Delete unused function.
17679
17680 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17681
17682 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17683 buffers, return left-to-right.
17684 (set_cursor_from_row): Consider candidate row a win if its glyph
17685 represents a newline and point is on that newline. Fixes cursor
17686 positioning on the newline at EOL of R2L text within L2R
17687 paragraph, and vice versa.
17688 (try_cursor_movement): Check continued rows, in addition to
17689 continuation rows. Fixes unwarranted scroll when point enters a
17690 continued line of R2L text within an L2R paragraph, or vice versa.
17691 (cursor_row_p): Consider the case of point being equal to
17692 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17693 from the end of a short line to the beginning of a continued line
17694 of R2L text within L2R paragraph.
17695 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17696 composed characters.
17697
17698 * bidi.c (bidi_check_type): Use xassert.
17699 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17700 members.
17701
17702 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17703
17704 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17705 a character.
17706
17707 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17708
17709 * nsfont.m (ns_otf_to_script): Fix typo.
17710
17711 2011-08-22 Kenichi Handa <handa@m17n.org>
17712
17713 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17714 extra slot even if the purpose is char-code-property-table.
17715
17716 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17717
17718 * xdisp.c (redisplay_window): When computing centering_position,
17719 account for the height of the header line. (Bug#8874)
17720
17721 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17722 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17723 candidate is selected by the mouse, and that candidate has a
17724 composed character under the mouse.
17725
17726 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17727 coordinates reported by pos-visible-in-window-p for a composed
17728 character in column zero.
17729
17730 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17731
17732 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17733
17734 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17735
17736 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17737 consider it a hit if to_charpos is anywhere in the range of the
17738 composed buffer positions.
17739
17740 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17741
17742 * image.c (gif_load): Don't assume that each subimage has the same
17743 dimensions as the base image. Handle disposal method that is
17744 "undefined" by the gif spec (Bug#9335).
17745
17746 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17747
17748 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17749 (Fcondition_case): Document `debug' symbol in error handler.
17750
17751 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17752
17753 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17754 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17755 from an Org mode buffer to a Speedbar frame.
17756
17757 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17758 a composition, take its buffer position from IT->cmp_it.charpos.
17759 Fixes cursor positioning at the beginning of a line that begins
17760 with a composed character.
17761
17762 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17763
17764 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17765 character bidirectional type, use STRONG_L instead. Fixes crashes
17766 in a buffer produced by `describe-categories'.
17767
17768 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17769 members before the level stack, so they would be saved and
17770 restored when copying iterator state. Fixes incorrect reordering
17771 around TABs covered by display properties.
17772
17773 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17774
17775 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17776
17777 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17778
17779 * eval.c (internal_condition_case, internal_condition_case_1)
17780 (internal_condition_case_2, internal_condition_case_n):
17781 Remove unnecessary aborts (Bug#9081).
17782
17783 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17784
17785 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17786 has no `load' handler, try opening the file locally. (Bug#9311)
17787
17788 2011-08-16 Ken Brown <kbrown@cornell.edu>
17789
17790 * gmalloc.c: Expand comment.
17791
17792 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17793
17794 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17795 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17796
17797 2011-08-16 Ken Brown <kbrown@cornell.edu>
17798
17799 Fix memory allocation problems in Cygwin build (Bug#9273).
17800
17801 * unexcw.c ( __malloc_initialized): Declare external variable.
17802 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17803
17804 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17805 New variables.
17806 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17807 dumped emacs.
17808 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17809 in the static heap.
17810 [CYGWIN] (special_realloc): New function.
17811 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17812 requests to realloc storage in the static heap.
17813
17814 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17815
17816 * bidi.c (bidi_initialize): Remove unused local.
17817
17818 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17819
17820 * bidimirror.h:
17821 * biditype.h: Remove file.
17822 * makefile.w32-in ($(BLD)/bidi.$(O)):
17823 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17824
17825 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17826
17827 * chartab.c: Improve commentary for the uniprop_table API.
17828
17829 * bidi.c (bidi_paragraph_init): Support zero value of
17830 bidi_ignore_explicit_marks_for_paragraph_level.
17831 (bidi_initialize): Use uniprop_table instead of including
17832 biditype.h and bidimirror.h.
17833
17834 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17835 coordinates of the iterator when restoring from ppos_it.
17836 (Bug#9296)
17837
17838 2011-08-14 Kenichi Handa <handa@m17n.org>
17839
17840 * process.c (create_process): Call setup_process_coding_systems
17841 after the pid of the process is set to -1 (Bug#8162).
17842
17843 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17844
17845 * xdisp.c (move_it_in_display_line_to): Don't invoke
17846 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17847 ppos_it. Fixes vertical cursor motion when line beginning is
17848 covered by an image. (Bug#9296)
17849
17850 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17851
17852 * nsterm.h (ns_run_ascript): Declare.
17853 (NSAPP_DATA2_RUNASSCRIPT): Define.
17854
17855 * nsfns.m (as_script, as_result, as_status): New static variables.
17856 (ns_run_ascript): New function.
17857 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17858 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17859 the event loop. Get status from as_status (Bug#7276).
17860
17861 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17862 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17863 the event loop (Bug#7276).
17864
17865 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17866
17867 * gnutls.c (QCgnutls_bootprop_priority)
17868 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17869 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17870 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17871 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17872 (QCgnutls_bootprop_verify_hostname_error)
17873 (QCgnutls_bootprop_callbacks_verify): Rename from
17874 Qgnutls_bootprop_..., all uses changed.
17875
17876 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17877 uses changed.
17878
17879 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17880
17881 * xfaces.c (Qframe_set_background_mode): Now static.
17882 * dispextern.h (Qframe_set_background_mode): Remove decl.
17883
17884 * process.c (Fnetwork_interface_info): Declare local only if needed.
17885
17886 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17887
17888 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17889 (Fnetwork_interface_list): Allocate in increments of bytes instead
17890 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17891 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17892 sockaddr.
17893 (struct ifflag_def): notrailers is smart on OSX.
17894 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17895 Get hardware address with getifaddrs if available.
17896
17897 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17898
17899 * xdisp.c (iterate_out_of_display_property): xassert that
17900 IT->position is set to within IT->object's boundaries. Break from
17901 the loop as soon as EOB is reached; avoids infloops in redisplay
17902 when IT->position is set up wrongly due to some bug.
17903 Set IT->current to match the bidi iterator unconditionally.
17904 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17905 entry. Force push_it to save on the stack the current
17906 buffer/string position, to be restored by pop_it. Fix flags in
17907 the iterator structure wrt the object coming from a display
17908 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17909 properties. (Bug#9284)
17910
17911 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17912
17913 * fontset.c (fontset_get_font_group): Add proper type checks.
17914 (Bug#9172)
17915
17916 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17917
17918 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17919 and LC_VERSION_MIN_MACOSX.
17920 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17921 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17922
17923 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17924
17925 * xdisp.c (forward_to_next_line_start): Allow to use the
17926 no-display-properties-and-no-overlays under bidi display.
17927 Set disp_pos in the bidi iterator to avoid searches for display
17928 properties and overlays.
17929
17930 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17931
17932 * editfns.c (Fset_time_zone_rule): Document relationship with the
17933 setenv function.
17934
17935 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17936 the font entity extracted from the cache (Bug#8109).
17937
17938 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17939
17940 * composite.c (autocmp_chars): Don't reset point. That is done by
17941 restore_point_unwind (Bug#5984).
17942
17943 2011-08-07 Juri Linkov <juri@jurta.org>
17944
17945 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17946 to show the arg `TIME' instead of `TIMEVAL'.
17947
17948 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17949
17950 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17951 display property strides EOL and includes a newline, as in
17952 longlines-mode. (Bug#9254)
17953 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17954 word-wrap under bidirectional display. (Bug#9224)
17955
17956 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17957 is non-zero, even if the data buffer is NULL. Fixes a crash in
17958 vertical-motion with longlines-mode. (Bug#9254)
17959
17960 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17961
17962 * bidi.c <bidi_cache_total_alloc>: Now static.
17963 (bidi_initialize): Initialize bidi_cache_total_alloc.
17964
17965 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17966 cache. (Bug#9221)
17967
17968 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17969 amount allocated this far in `bidi_cache_total_alloc'.
17970 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17971 non-zero, only free the data buffer without restoring the cache
17972 contents. All callers changed.
17973
17974 * dispextern.h (bidi_unshelve_cache): Update prototype.
17975
17976 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17977 (move_it_in_display_line, move_it_to)
17978 (move_it_vertically_backward, move_it_by_lines): Replace the call
17979 to xfree to an equivalent call to bidi_unshelve_cache.
17980 (move_it_in_display_line_to): Fix logic of returning
17981 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17982
17983 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17984
17985 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17986 came from a string character with a `cursor' property. (Bug#9229)
17987
17988 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17989
17990 * Makefile.in (LIB_PTHREAD): New variable.
17991 (LIBES): Add LIB_PTHREAD (Bug#9216).
17992
17993 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17994 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17995
17996 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17997
17998 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17999
18000 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18001
18002 * xterm.c (x_find_topmost_parent): New function.
18003 (x_set_frame_alpha): Find topmost parent window with
18004 x_find_topmost_parent and set the property there also (bug#9181).
18005 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18006
18007 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18008
18009 * callproc.c (Fcall_process): Avoid vfork clobbering
18010 the local vars buffer, coding_systems, current_dir.
18011
18012 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18013
18014 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18015
18016 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18017
18018 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18019 so that it is not optimized away.
18020
18021 * xdisp.c (compute_display_string_pos): Remove unused local.
18022
18023 2011-08-02 Eli Zaretskii <eliz@gnu.org>
18024
18025 Fix slow cursor motion and scrolling in large buffers with
18026 selective display, like Org Mode buffers. (Bug#9218)
18027
18028 * dispextern.h (struct bidi_it): New member disp_prop_p.
18029
18030 * xdisp.c: Remove one-slot cache of display string positions.
18031 (compute_display_string_pos): Accept an additional argument
18032 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18033 for a display string or property. If found, set DISP_PROP_P
18034 non-zero.
18035
18036 * bidi.c (bidi_fetch_char): Accept an additional argument
18037 DISP_PROP_P, and pass it to compute_display_string_pos.
18038 Only handle text covered by a display string if DISP_PROP_P is returned
18039 non-zero. All callers of bidi_fetch_char changed.
18040
18041 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18042
18043 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18044
18045 2010-12-03 Don March <don@ohspite.net>
18046
18047 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18048 last character M-[char] is translated to ESC [char] (bug#7541).
18049
18050 2011-08-02 Kenichi Handa <handa@m17n.org>
18051
18052 * lisp.h (uniprop_table): Extern it.
18053
18054 * chartab.c (uniprop_table): Make it non-static.
18055
18056 2011-08-01 Eli Zaretskii <eliz@gnu.org>
18057
18058 * xdisp.c (forward_to_next_line_start): Accept additional argument
18059 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18060 on the newline.
18061 (reseat_at_next_visible_line_start): Use the bidi iterator state
18062 returned by forward_to_next_line_start to restore the state of
18063 it->bidi_it after backing up to previous newline. (Bug#9212)
18064
18065 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18066
18067 * regex.c (re_comp): Protoize.
18068 (re_exec): Fix return type.
18069 (regexec): Fix type of `ret'. (Bug#9203)
18070
18071 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18072
18073 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18074 This is needed if max-image-size is a floating-point number.
18075
18076 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18077
18078 * print.c (print_object): Print empty symbol as ##.
18079
18080 * lread.c (read1): Read ## as empty symbol.
18081
18082 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18083
18084 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18085 setting frame foreground color (Bug#9175).
18086 (x_set_background_color): Likewise.
18087
18088 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18089 contents (Bug#9176).
18090 (EmacsTooltip -init): Remove bezels and add shadows to
18091 tooltip windows.
18092
18093 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18094 or scroll bar (Bug#8470).
18095
18096 * nsfont.m (nsfont_open): Remove assignment to voffset and
18097 unnecessary vars hshink, expand, hd, full_height, min_height.
18098 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18099
18100 * nsterm.h (nsfont_info): Remove voffset field.
18101
18102 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18103
18104 Implement strike-through and overline on NextStep (Bug#8863).
18105
18106 * nsfont.m (nsfont_open): Use underline position provided by font,
18107 instead of hard-coded value of 2.
18108 (nsfont_draw): Call ns_draw_text_decoration instead.
18109
18110 * nsterm.h: Add declaration for ns_draw_text_decoration.
18111
18112 * nsterm.m (ns_draw_text_decoration): New function for drawing
18113 underline, overline, and strike-through.
18114 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18115 ns_draw_text_decoration. Change treatment of cursor drawing to
18116 accommodate underlining, etc.
18117
18118 2011-07-28 Eli Zaretskii <eliz@gnu.org>
18119
18120 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18121 default.
18122
18123 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18124
18125 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18126 Without this fix, if a signal arrives just after memory fills up,
18127 'malloc' might be invoked reentrantly.
18128
18129 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18130 In other words, assume that every image size is allowed, on non-X
18131 hosts. This assumption is probably wrong, but it lets Emacs compile.
18132
18133 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18134
18135 * regex.c (re_iswctype): Convert return values to boolean.
18136
18137 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18138
18139 * xdisp.c (compute_display_string_pos): Don't use cached display
18140 string position if the buffer had its restriction changed.
18141 (Bug#9184)
18142
18143 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18144
18145 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18146
18147 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18148
18149 Integer signedness and overflow and related fixes. (Bug#9079)
18150
18151 * bidi.c: Integer size and overflow fixes.
18152 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18153 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18154 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18155 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18156 (bidi_find_other_level_edge):
18157 Use ptrdiff_t instead of EMACS_INT where either will do.
18158 This works better on 32-bit hosts configured --with-wide-int.
18159 (bidi_cache_ensure_space): Check for size-calculation overflow.
18160 Use % rather than repeated addition, for better worst-case speed.
18161 Don't set bidi_cache_size until after xrealloc returns, because it
18162 might not return.
18163 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18164 (bidi_cache_ensure_space): Also check that the bidi cache size
18165 does not exceed that of the largest Lisp string or buffer. See Eli
18166 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18167
18168 * alloc.c (__malloc_size_t): Remove.
18169 All uses replaced by size_t. See Andreas Schwab's note
18170 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18171
18172 * image.c: Improve checking for integer overflow.
18173 (check_image_size): Assume that f is nonnull, since
18174 it is always nonnull in practice. This is one less thing to
18175 worry about when checking for integer overflow later.
18176 (x_check_image_size): New function, which checks for integer
18177 overflow issues inside X.
18178 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18179 This removes the need for a memory_full check.
18180 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18181 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18182 (xbm_read_bitmap_data): Change locals back to 'int', since
18183 their values must fit in 'int'.
18184 (xpm_load_image, png_load, tiff_load):
18185 Invoke x_create_x_image_and_pixmap earlier,
18186 to avoid much needless work if the image is too large.
18187 (tiff_load): Treat overly large images as if
18188 x_create_x_image_and_pixmap failed, not as malloc failures.
18189 (gs_load): Use x_check_image_size.
18190
18191 * gtkutil.c: Omit integer casts.
18192 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18193 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18194
18195 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18196
18197 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18198 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18199 would wrongly return t on a 64-bit host.
18200
18201 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18202 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18203 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18204 and therefore cause GCC to emit a bogus diagnostic in some cases.
18205
18206 * image.c: Integer signedness and overflow and related fixes.
18207 This is not an exhaustive set of fixes, but it's time to
18208 record what I've got.
18209 (lookup_pixel_color, check_image_size): Remove redundant decls.
18210 (check_image_size): Don't assume that arbitrary EMACS_INT values
18211 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18212 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18213 (tiff_load, imagemagick_load_image):
18214 Check for overflow in size calculations.
18215 (x_create_x_image_and_pixmap): Remove unnecessary test for
18216 xmalloc returning NULL; that can't happen.
18217 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18218 (xpm_color_bucket): Use better integer hashing function.
18219 (xpm_cache_color): Don't possibly over-allocate memory.
18220 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18221 (gif_memory_source):
18222 Use ptrdiff_t, not int or size_t, to record sizes.
18223 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18224 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18225 either works, as we prefer signed integers.
18226 (tiff_read_from_memory, tiff_write_from_memory):
18227 Return tsize_t, not size_t, since that's what the TIFF API wants.
18228 (tiff_read_from_memory): Don't fail simply because the read would
18229 go past EOF; instead, return a short read.
18230 (tiff_load): Omit no-longer-needed casts.
18231 (Fimagemagick_types): Don't assume size fits into 'int'.
18232
18233 Improve hashing quality when configured --with-wide-int.
18234 * fns.c (hash_string): New function, taken from sxhash_string.
18235 Do not discard information about ASCII character case; this
18236 discarding is no longer needed.
18237 (sxhash-string): Use it. Change sig to match it. Caller changed.
18238 * lisp.h: Declare it.
18239 * lread.c (hash_string): Remove, since we now use fns.c's version.
18240 The fns.c version returns a wider integer if --with-wide-int is
18241 specified, so this should help the quality of the hashing a bit.
18242
18243 * emacs.c: Integer overflow minor fix.
18244 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18245 Define only if GNU_LINUX.
18246 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18247
18248 * dispnew.c: Integer signedness and overflow fixes.
18249 Remove unnecessary forward decls, that were a maintenance hassle.
18250 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18251 All uses changed.
18252 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18253 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18254 (prepare_desired_row, line_draw_cost):
18255 Use int, not unsigned, where either works.
18256 (save_current_matrix, restore_current_matrix):
18257 Use ptrdiff_t, not size_t, where either works.
18258 (init_display): Check for overflow more accurately, and without
18259 relying on undefined behavior.
18260
18261 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18262 Remove, replacing with the new symbols in lisp.h. All uses changed.
18263 * fileio.c (make_temp_name):
18264 * filelock.c (lock_file_1, lock_file):
18265 * xdisp.c (message_dolog):
18266 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18267 Use pMd etc. instead.
18268 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18269 replacing the pWIDE etc. symbols removed from editfns.c.
18270
18271 * keyboard.h (num_input_events): Now uintmax_t.
18272 This is (very slightly) less likely to mess up due to wraparound.
18273 All uses changed.
18274
18275 * buffer.c: Integer signedness fixes.
18276 (alloc_buffer_text, enlarge_buffer_text):
18277 Use ptrdiff_t rather than size_t when either will do, as we prefer
18278 signed integers.
18279
18280 * alloc.c: Integer signedness and overflow fixes.
18281 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18282 (__malloc_size_t): Default to size_t, not to int.
18283 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18284 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18285 Prefer ptrdiff_t to size_t when either would do, as we prefer
18286 signed integers.
18287 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18288 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18289 Now const. Initialize with values that are in range even if char
18290 is signed.
18291 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18292 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18293 These functions do the right thing with sizes > 2**32.
18294 (check_depth): Now ptrdiff_t, not int.
18295 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18296 Adjust to new way of storing sizes. Check for size overflow bugs
18297 in rest of code.
18298 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18299 slightly wrong anyway, as it missed one instance of
18300 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18301 (refill_memory_reserve): Omit needless cast to size_t.
18302 (mark_object_loop_halt): Mark as externally visible.
18303
18304 * xselect.c: Integer signedness and overflow fixes.
18305 (Fx_register_dnd_atom, x_handle_dnd_message):
18306 Use ptrdiff_t, not size_t, since we prefer signed.
18307 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18308 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18309 x_dnd_atoms_size and x_dnd_atoms_length.
18310
18311 * doprnt.c: Prefer signed to unsigned when either works.
18312 * eval.c (verror):
18313 * doprnt.c (doprnt):
18314 * lisp.h (doprnt):
18315 * xdisp.c (vmessage):
18316 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18317 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18318 prefer signed arithmetic to avoid comparison confusion.
18319 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18320 but is a bit tricky.
18321
18322 Assume freestanding C89 headers, string.h, stdlib.h.
18323 * data.c, doprnt.c, floatfns.c, print.c:
18324 Include float.h unconditionally.
18325 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18326 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18327 * regex.c: Likewise for stddef.h, string.h.
18328 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18329 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18330 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18331 (STDC_HEADERS): Remove obsolete defines.
18332 * sysdep.c: Include limits.h unconditionally.
18333
18334 Assume support for memcmp, memcpy, memmove, memset.
18335 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18336 * regex.c (memcmp, memcpy):
18337 Remove; we assume C89 now.
18338
18339 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18340 (__malloc_safe_bcopy): Remove; no longer needed.
18341
18342 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18343 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18344 well either way, and we prefer signed to unsigned.
18345
18346 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18347
18348 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18349 closes the connection while we're reading (bug#9182).
18350
18351 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18352
18353 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18354 are specified (Bug#9168).
18355
18356 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18357
18358 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18359 Found by GCC static checking and --with-wide-int on a 32-bit host.
18360
18361 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18362
18363 * xdisp.c (compute_display_string_pos): Fix logic of caching
18364 previous display string position. Initialize cached_prev_pos to
18365 -1. Fixes slow-down at the beginning of a buffer.
18366
18367 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18368
18369 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18370 for attrs[LFACE_FONTSET_INDEX].
18371
18372 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18373
18374 * xml.c (parse_region): Remove unused local
18375 that was recently introduced.
18376
18377 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18378
18379 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18380 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18381
18382 * xdisp.c (move_it_in_display_line_to): Record the best matching
18383 position for TO_CHARPOS while scanning the line, and restore it on
18384 exit if none of the characters scanned was an exact match.
18385 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18386 when exact match is impossible due to invisible text, and the
18387 lines are truncated.
18388
18389 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18390
18391 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18392 for OSX >= 10.7.
18393
18394 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18395
18396 Fix a significant slow-down of cursor motion with C-n, C-p,
18397 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18398 auto-repeat under bidi redisplay in fontified buffers.
18399 * xdisp.c (compute_stop_pos_backwards): New function.
18400 (next_element_from_buffer): Call compute_stop_pos_backwards to
18401 find a suitable prev_stop when we find ourselves before
18402 base_level_stop.
18403 (reseat): Don't look for prev_stop, as that could mean a very long
18404 run.
18405 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18406 <cached_disp_overlay_modiff>: Cache for last found display string
18407 position.
18408 (compute_display_string_pos): Return the cached position if asked
18409 about the same buffer in the same area of character positions, and
18410 the buffer wasn't changed since the time the display string
18411 position was cached.
18412
18413 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18414
18415 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18416 is an integer, which is important for empty lines. (Bug#9149)
18417
18418 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18419
18420 * frame.c (Fmodify_frame_parameters): In tty case, update the
18421 default face if necessary (Bug#4238).
18422
18423 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18424
18425 * editfns.c (Fstring_to_char): No need to explain what a character
18426 is in the docstring (Bug#6576).
18427
18428 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18429
18430 * xml.c (parse_region): Make sure we always return a tree.
18431
18432 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18433
18434 * xml.c (parse_region): If a document contains only comments,
18435 return that, too.
18436
18437 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18438
18439 * xml.c (make_dom): Return comments, too.
18440
18441 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18442
18443 Port to OpenBSD.
18444 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18445 and the surrounding thread.
18446 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18447 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18448 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18449 timer goes off.
18450 * s/openbsd.h (BROKEN_SIGIO): Define.
18451 * unexelf.c (unexec) [__OpenBSD__]:
18452 Don't update the .mdebug section of the Alpha COFF symbol table.
18453
18454 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18455
18456 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18457 (bug#8460).
18458
18459 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18460
18461 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18462 This fixes some race conditions on the permissions of any newly
18463 created file.
18464
18465 * alloc.c (valid_pointer_p): Use pipe, not open.
18466 This fixes some permissions issues when debugging.
18467
18468 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18469 If fchown fails to set both uid and gid, try to set just gid,
18470 as that is sometimes allowed. Adjust the file's mode to eliminate
18471 setuid or setgid bits that are inappropriate if fchown fails.
18472
18473 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18474
18475 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18476 to compare Lisp_Objects.
18477 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18478 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18479 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18480
18481 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18482
18483 * lread.c (read_integer): Unread even EOF character.
18484 (read1): Likewise. Properly record start position of symbol.
18485
18486 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18487 symbol character follows.
18488
18489 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18490
18491 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18492 This works around a problem with the previous change to Fcopy_file.
18493 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18494 and without this change, GCC might complain about discarding
18495 fchown's return value.
18496
18497 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18498
18499 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18500
18501 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18502
18503 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18504
18505 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18506
18507 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18508 it's used from the C level.
18509
18510 * process.c: Use the same condition for POLL_FOR_INPUT in both
18511 keyboard.c and process.c (bug#1858).
18512
18513 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18514
18515 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18516 (Fgnutls_boot): Use it.
18517
18518 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18519
18520 * doc.c (Fsubstitute_command_keys): Revert last change.
18521
18522 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18523
18524 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18525 quotes the next character, and doesn't affect other longer
18526 sequences (bug#8935).
18527
18528 * lread.c (syms_of_lread): Clarify that is isn't only
18529 `eval-buffer' and `eval-defun' that's affected by
18530 `lexical-binding' (bug#8460).
18531
18532 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18533
18534 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18535 bidi redisplay when a line includes both an image and is truncated.
18536
18537 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18538
18539 Fix minor problems found by static checking.
18540 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18541 (elsz): Now a signed constant, not a size_t var. We prefer signed
18542 types to unsigned, to avoid integer comparison confusion. Without
18543 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18544 "cannot optimize loop, the loop counter may overflow", a symptom
18545 of the confusion.
18546 * indent.c (Fvertical_motion): Mark locals as initialized.
18547 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18548
18549 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18550
18551 * search.c (Fre_search_backward): Mention `case-fold-search' in
18552 all the re_search_* functions (bug#8138).
18553
18554 * keyboard.c (Fopen_dribble_file): Document when the file is
18555 closed (bug#8056).
18556
18557 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18558
18559 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18560 bidi_cache_idx.
18561
18562 Support bidi reordering of display and overlay strings.
18563 * xdisp.c (compute_display_string_pos)
18564 (compute_display_string_end): Accept additional argument STRING.
18565 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18566 (reseat_to_string): Initialize bidi_it->string.s and
18567 bidi_it->string.schars.
18568 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18569 NULL (avoids a crash in bidi_paragraph_init).
18570 Initialize itb.string.lstring.
18571 (init_iterator): Call bidi_init_it only of a valid
18572 buffer position was specified. Initialize paragraph_embedding to
18573 L2R.
18574 (reseat_to_string): Initialize the bidi iterator.
18575 (display_string): If we need to ignore text properties of
18576 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18577 original value of -1 will not work with bidi.)
18578 (compute_display_string_pos): First arg is now struct
18579 `text_pos *'; all callers changed. Support display properties on
18580 Lisp strings.
18581 (compute_display_string_end): Support display properties on Lisp
18582 strings.
18583 (init_iterator, reseat_1, reseat_to_string): Initialize the
18584 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18585 when iterating on a string not from display properties).
18586 (compute_display_string_pos, compute_display_string_end):
18587 Fix calculation of the object to scan. Fixes an error when using
18588 arrow keys.
18589 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18590 base_level_stop; instead, set base_level_stop to BEGV.
18591 Fixes crashes in vertical-motion.
18592 (next_element_from_buffer): Improve commentary for when
18593 the iterator is before prev_stop.
18594 (init_iterator): Initialize bidi_p from the default value of
18595 bidi-display-reordering, not from buffer-local value. Use the
18596 buffer-local value only if initializing for buffer iteration.
18597 (handle_invisible_prop): Support invisible properties on strings
18598 that are being bidi-reordered.
18599 (set_iterator_to_next): Support bidi reordering of C strings and
18600 Lisp strings.
18601 (next_element_from_string): Support bidi reordering of Lisp
18602 strings.
18603 (handle_stop_backwards): Support Lisp strings as well.
18604 (display_string): Support display of R2L glyph rows.
18605 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18606 (init_iterator): Don't initialize it->bidi_p for strings
18607 here.
18608 (reseat_to_string): Initialize it->bidi_p for strings here.
18609 (next_element_from_string, next_element_from_c_string)
18610 (next_element_from_buffer): Add xassert's for correspondence
18611 between IT's object being iterated and it->bidi_it.string
18612 structure.
18613 (face_before_or_after_it_pos): Support bidi iteration.
18614 (next_element_from_c_string): Handle the case of the first string
18615 character that is not the first one in the visual order.
18616 (get_visually_first_element): New function, refactored from common
18617 parts of next_element_from_buffer, next_element_from_string, and
18618 next_element_from_c_string.
18619 (tool_bar_lines_needed, redisplay_tool_bar)
18620 (display_menu_bar): Force left-to-right direction. Add a FIXME
18621 comment for making that be controlled by a user option.
18622 (push_it, pop_it): Save and restore the state of the
18623 bidi iterator. Save and restore the bidi_p flag.
18624 (pop_it): Iterate out of display property for string iteration as
18625 well.
18626 (iterate_out_of_display_property): Support iteration over strings.
18627 (handle_single_display_spec): Set up it->bidi_it for iteration
18628 over a display string, and call bidi_init_it.
18629 (handle_single_display_spec, next_overlay_string)
18630 (get_overlay_strings_1, push_display_prop): Set up the bidi
18631 iterator for displaying display or overlay strings.
18632 (forward_to_next_line_start): Don't use the shortcut if
18633 bidi-iterating.
18634 (back_to_previous_visible_line_start): If handle_display_prop
18635 pushed the iterator stack, restore the internal state of the bidi
18636 iterator by calling bidi_pop_it same number of times.
18637 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18638 and we are bidi-iterating, don't decrement the iterator position;
18639 instead, set the first_elt flag in the bidi iterator, to produce
18640 the same effect.
18641 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18642 (push_display_prop): xassert that we are iterating a buffer.
18643 (push_it, pop_it): Save and restore paragraph_embedding member.
18644 (handle_single_display_spec, next_overlay_string)
18645 (get_overlay_strings_1, reseat_1, reseat_to_string)
18646 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18647 correctly. Don't assume unibyte strings are not bidi-reordered.
18648 (compute_display_string_pos)
18649 (compute_display_string_end): Fix handling the case of C string.
18650 (push_it, pop_it): Save and restore from_disp_prop_p.
18651 (handle_single_display_spec, push_display_prop): Set the
18652 from_disp_prop_p flag.
18653 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18654 (pop_it): Call iterate_out_of_display_property only if we are
18655 popping after iteration over a string that came from a display
18656 property. Fix a typo in popping stretch info. Add an assertion
18657 for verifying that the iterator position is in sync with the bidi
18658 iterator.
18659 (handle_single_display_spec, get_overlay_strings_1)
18660 (push_display_prop): Fix initialization of paragraph direction for
18661 string when that of the parent object is not yet determined.
18662 (reseat_1): Call bidi_init_it to resync the bidi
18663 iterator with IT's position. (Bug#7616)
18664 (find_row_edges): If ROW->start.pos gives position
18665 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18666 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18667 Reset the from_disp_prop_p flag.
18668 (SAVE_IT, RESTORE_IT): New macros.
18669 (pos_visible_p, face_before_or_after_it_pos)
18670 (back_to_previous_visible_line_start)
18671 (move_it_in_display_line_to, move_it_in_display_line)
18672 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18673 (try_scrolling, redisplay_window, display_line): Use them when
18674 saving a temporary copy of the iterator and restoring it back.
18675 (back_to_previous_visible_line_start, reseat_1)
18676 (init_iterator): Empty the bidi cache "stack".
18677 (move_it_in_display_line_to): If iterator ended up at
18678 EOL, but we never saw any buffer positions smaller than
18679 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18680 motion in bidi-reordered lines.
18681 (move_it_in_display_line_to): Record prev_method and prev_pos
18682 immediately before the call to set_iterator_to_next. Fixes cursor
18683 motion in bidi-reordered lines with stretch glyphs and strings
18684 displayed in margins. (Bug#8133) (Bug#8867)
18685 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18686 TO_CHARPOS.
18687 (pos_visible_p): Support positions in bidi-reordered lines.
18688 Save and restore bidi cache.
18689
18690 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18691 (bidi_paragraph_info): Delete unused struct.
18692 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18693 (bidi_cache_start): New variable.
18694 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18695 to zero.
18696 (bidi_cache_fetch_state, bidi_cache_search)
18697 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18698 (bidi_cache_find, bidi_peek_at_next_level)
18699 (bidi_level_of_next_char, bidi_find_other_level_edge)
18700 (bidi_move_to_visually_next): Compare cache index with
18701 bidi_cache_start rather than with zero.
18702 (bidi_fetch_char): Accept new argument STRING; all callers
18703 changed. Support iteration over a string. Support strings with
18704 display properties. Support unibyte strings. Fix the type of
18705 `len' according to what STRING_CHAR_AND_LENGTH expects.
18706 (bidi_paragraph_init, bidi_resolve_explicit_1)
18707 (bidi_resolve_explicit, bidi_resolve_weak)
18708 (bidi_level_of_next_char, bidi_move_to_visually_next):
18709 Support iteration over a string.
18710 (bidi_set_sor_type, bidi_resolve_explicit_1)
18711 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18712 can now be zero (for strings); special values 0 and -1 were
18713 changed to -1 and -2, respectively.
18714 (bidi_char_at_pos): New function.
18715 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18716 Call it instead of FETCH_MULTIBYTE_CHAR.
18717 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18718 initialized to valid values.
18719 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18720 values.
18721 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18722 the test for valid cached positions. Fix the logic for looking up
18723 the sentinel state in the cache. GCPRO the Lisp string we are
18724 iterating.
18725 (bidi_push_it, bidi_pop_it): New functions.
18726 (bidi_initialize): Initialize the bidi cache start stack pointer.
18727 (bidi_cache_ensure_space): New function, refactored from part of
18728 bidi_cache_iterator_state. Don't assume the required size is just
18729 one BIDI_CACHE_CHUNK away.
18730 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18731 (bidi_count_bytes, bidi_char_at_pos): New functions.
18732 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18733 always valid if bidi_cache_idx is valid.
18734 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18735 is valid if it's going to be used.
18736 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18737 (bidi_cache_fetch_state, bidi_cache_search)
18738 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18739 (bidi_cache_iterator_state, bidi_cache_find)
18740 (bidi_find_other_level_edge, bidi_cache_start_stack):
18741 All variables related to cache indices are now EMACS_INT.
18742
18743 * dispextern.h (struct bidi_string_data): New structure.
18744 (struct bidi_it): New member `string'. Make flag members be 1-bit
18745 fields, and put them last in the struct.
18746 (compute_display_string_pos, compute_display_string_end):
18747 Update prototypes.
18748 (bidi_push_it, bidi_pop_it): Add prototypes.
18749 (struct iterator_stack_entry): New members bidi_p,
18750 paragraph_embedding, and from_disp_prop_p.
18751 (struct it): Member bidi_p is now a bit field 1 bit wide.
18752 (bidi_shelve_cache, bidi_unshelve_cache):
18753 Declare prototypes.
18754
18755 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18756 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18757 and vector-like objects.
18758
18759 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18760 cache around display iteration.
18761
18762 * window.c (Fwindow_end, window_scroll_pixel_based)
18763 (displayed_window_lines, Frecenter): Save and restore the bidi
18764 cache around display iteration.
18765
18766 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18767
18768 * editfns.c (Fdelete_region): Clarify the use of the named
18769 parameters (bug#6788).
18770
18771 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18772
18773 * indent.c (Fvertical_motion): Set and restore w->pointm when
18774 saving and restoring the window's buffer (Bug#9006).
18775
18776 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18777
18778 * editfns.c (Fstring_to_char): Clarify just what is returned
18779 (bug#6576). Text by Eli Zaretskii.
18780
18781 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18782
18783 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18784
18785 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18786
18787 * buffer.c (mmap_find): Fix a typo.
18788
18789 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18790
18791 Fix execution of x selection hooks.
18792 * xselect.c (Qx_lost_selection_functions)
18793 (Qx_sent_selection_functions): New vars.
18794 (syms_of_xselect): DEFSYM them.
18795 (x_handle_selection_request): Pass Qx_sent_selection_functions
18796 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18797 (x_handle_selection_clear,x_clear_frame_selections):
18798 Pass Qx_lost_selection_functions rather than
18799 Vx_lost_selection_functions to Frun_hook_with_args.
18800
18801 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18802
18803 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18804 The old code sometimes used this field without initializing it.
18805
18806 * alloc.c (gc_sweep): Don't read past end of array.
18807 In theory, the old code could also have corrupted Emacs internals,
18808 though it'd be very unlikely.
18809
18810 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18811
18812 * character.c (Fcharacterp): Don't advertise optional ignored
18813 argument. (Bug#4026)
18814
18815 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18816
18817 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18818 key" (bug#4257).
18819
18820 * window.c (Fset_window_start): Doc fix (bug#4199).
18821 (Fset_window_hscroll): Ditto.
18822
18823 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18824
18825 Fix minor new problems caught by GCC 4.6.1.
18826 * term.c (init_tty): Remove unused local.
18827 * xsettings.c (store_monospaced_changed): Define this function only
18828 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18829 not used otherwise.
18830
18831 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18832
18833 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18834
18835 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18836
18837 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18838 are the mini-buffer and the echo area (bug#3320).
18839
18840 * term.c (init_tty): Remove support for supdup, c10 and perq
18841 terminals, which are no longer supported (bug#1482).
18842
18843 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18844
18845 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18846
18847 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18848
18849 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18850 for non-popups (Bug#3642).
18851
18852 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18853
18854 * alloc.c (reset_malloc_hooks): Protoize.
18855 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18856 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18857 * cm.c (losecursor): Likewise.
18858 * data.c (fmod): Likewise.
18859 * dispnew.c (swap_glyphs_in_rows): Likewise.
18860 * emacs.c (memory_warning_signal): Likewise.
18861 * floatfns.c (float_error): Likewise.
18862 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18863 (otf_open, font_otf_capability, generate_otf_features)
18864 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18865 Likewise.
18866 * image.c (pbm_read_file): Likewise.
18867 * indent.c (string_display_width): Likewise.
18868 * intervals.c (check_for_interval, search_for_interval)
18869 (inc_interval_count, count_intervals, root_interval)
18870 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18871 * lread.c (defalias): Likewise.
18872 * ralloc.c (r_alloc_check): Likewise.
18873 * regex.c (set_image_of_range_1, set_image_of_range)
18874 (regex_grow_registers): Likewise.
18875 * sysdep.c (strerror): Likewise.
18876 * termcap.c (valid_filename_p, tprint, main): Likewise.
18877 * tparam.c (main): Likewise.
18878 * unexhp9k800.c (run_time_remap, save_data_space)
18879 (update_file_ptrs, read_header, write_header, calculate_checksum)
18880 (copy_file, copy_rest, display_header): Likewise.
18881 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18882 Likewise.
18883 * xdisp.c (check_it): Likewise.
18884 * xfaces.c (register_color, unregister_color, unregister_colors):
18885 Likewise.
18886 * xfns.c (print_fontset_result): Likewise.
18887 * xrdb.c (member, fatal, main): Likewise.
18888
18889 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18890
18891 Fix minor problems found by static checking (Bug#9031).
18892 * chartab.c (char_table_set_range, map_sub_char_table):
18893 Remove unused locals.
18894 (uniprop_table): Now static.
18895 * composite.c (_work_char): Remove unused static var.
18896
18897 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18898
18899 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18900
18901 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18902
18903 * gtkutil.c (qttip_cb): Remove code without function.
18904
18905 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18906
18907 * w32.c (pthread_sigmask): New stub.
18908
18909 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18910
18911 Use pthread_sigmask, not sigprocmask (Bug#9010).
18912 sigprocmask is portable only for single-threaded applications, and
18913 Emacs can be multi-threaded when it uses GTK.
18914 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18915 (LIBES): Use it.
18916 * callproc.c (Fcall_process):
18917 * process.c (create_process):
18918 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18919 Use pthread_sigmask, not sigprocmask.
18920
18921 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18922
18923 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18924 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18925 wrong (Bug#8591).
18926
18927 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18928
18929 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18930 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18931 (xg_hide_tooltip): Fix comment.
18932
18933 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18934 in registerServicesMenuSendTypes.
18935 (validRequestorForSendType): Don't check ns_return_types.
18936
18937 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18938 ns_return_type.
18939
18940 2011-07-08 Jason Rumney <jasonr@gnu.org>
18941
18942 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18943 SH_SHOW for hidden windows (Bug#5482).
18944
18945 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18946 frame struct members of non-existent frames (Bug#6284).
18947
18948 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18949
18950 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18951 variable firstTime not needed on OSX >= 10.6.
18952 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18953 >= 10.5. Use setKnobProportion, setDoubleValue.
18954
18955 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18956 (MAC_OS_X_VERSION_10_5): Define if not defined.
18957 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18958 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18959 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18960
18961 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18962 cString and lossyCString on OSX >= 10.4.
18963
18964 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18965 sizeToFit on OSX >= 10.2.
18966
18967 * nsimage.m (allocInitFromFile): Don't use deprecated method
18968 bestRepresentationForDevice on OSX >= 10.6.
18969
18970 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18971 to avoid warning.
18972
18973 * emacs.c: Declare unexec_init_emacs_zone.
18974
18975 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18976
18977 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18978
18979 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18980 on svcsMenu (Bug#8842).
18981
18982 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18983 ns_return_types.
18984 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18985
18986 * nsterm.m (QUTF8_STRING): Declare.
18987 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18988 (validRequestorForSendType): Return type is (id).
18989 Change indexOfObjectIdenticalTo to indexOfObject.
18990 Check if we have local selection before returning self (Bug#8842).
18991 (writeSelectionToPasteboard): Put local selection into paste board
18992 if we have a local selection (Bug#8842).
18993 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18994
18995 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18996 (ns_get_local_selection): Declare.
18997
18998 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18999
19000 * keymap.c (describe_map_tree): Don't insert a double newline at
19001 the end of the buffer (bug#1169) and return whether we inserted
19002 something.
19003
19004 * callint.c (Fcall_interactively): Change "reading args" to
19005 "providing args" to try to clarify what it does (bug#1010).
19006
19007 2011-07-07 Kenichi Handa <handa@m17n.org>
19008
19009 * composite.c (composition_compute_stop_pos): Ignore a static
19010 composition starting before CHARPOS (Bug#8915).
19011
19012 * xdisp.c (handle_composition_prop): Likewise.
19013
19014 2011-07-07 Eli Zaretskii <eliz@gnu.org>
19015
19016 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19017 (Bug#9015)
19018
19019 2011-07-07 Kenichi Handa <handa@m17n.org>
19020
19021 * character.h (unicode_category_t): New enum type.
19022
19023 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19024 (Qchar_code_property_table): New variable.
19025 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19026 (UNIPROP_COMPRESSED_FORM_P): New macros.
19027 (char_table_ascii): Uncompress the compressed values.
19028 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19029 Uncompress the compressed values.
19030 (sub_char_table_ref_and_range): Likewise.
19031 (char_table_ref_and_range): Uncompress the compressed values.
19032 (sub_char_table_set): New arg is_uniprop. Callers changed.
19033 Uncompress the compressed values.
19034 (sub_char_table_set_range): Args changed. Callers changed.
19035 (char_table_set_range): Adjuted for the above change.
19036 (map_sub_char_table): Delete args default_val and parent. Add arg
19037 top. Give decoded values to a Lisp function.
19038 (map_char_table): Adjust for the above change. Give decoded
19039 values to a Lisp function. Gcpro more variables.
19040 (uniprop_table_uncompress)
19041 (uniprop_decode_value_run_length): New functions.
19042 (uniprop_decoder, uniprop_decoder_count): New variables.
19043 (uniprop_get_decoder, uniprop_encode_value_character)
19044 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19045 New functions.
19046 (uniprop_encoder, uniprop_encoder_count): New variables.
19047 (uniprop_get_encoder, uniprop_table)
19048 (Funicode_property_table_internal, Fget_unicode_property_internal)
19049 (Fput_unicode_property_internal): New functions.
19050 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19051 Sunicode_property_table_internal, Sget_unicode_property_internal,
19052 and Sput_unicode_property_internal. Defvar_lisp
19053 char-code-property-alist.
19054
19055 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19056 Vunicode_category_table.
19057
19058 * font.c (font_range): Adjust for the change of
19059 Vunicode_category_table.
19060
19061 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19062
19063 * m/iris4d.h: Remove file, move contents ...
19064 * s/irix6-5.h: ... here.
19065
19066 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19067
19068 Remove unportable assumption about struct layout (Bug#8884).
19069 * alloc.c (mark_buffer):
19070 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19071 (clone_per_buffer_values): Don't assume that
19072 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19073 This isn't true in general, and it's particularly not true
19074 if Emacs is configured with --with-wide-int.
19075 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19076 New macros, used in the buffer.c change.
19077
19078 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19079
19080 * xsettings.c: Use both GConf and GSettings if both are available.
19081 (store_config_changed_event): Add comment.
19082 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19083 (store_tool_bar_style_changed): New functions.
19084 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19085 (struct xsettings): Move font inside HAVE_XFT.
19086 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19087 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19088 Move inside HAVE_XFT.
19089 (something_changed_gsettingsCB): Rename from something_changedCB.
19090 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19091 also.
19092 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19093 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19094 (something_changed_gconfCB): Rename from something_changedCB.
19095 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19096 (parse_settings): Move check for font inside HAVE_XFT.
19097 (read_settings, apply_xft_settings): Add comment.
19098 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19099 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19100 call store_font_name_changed.
19101 (xft_settings_event): Add comment.
19102 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19103 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19104 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19105 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19106 (xsettings_initialize): Call init_gsettings last.
19107 (xsettings_get_system_font, xsettings_get_system_normal_font):
19108 Add comment.
19109
19110 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19111
19112 Random fixes. E.g., (random) never returned negative values.
19113 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19114 subseconds part to the entropy, as that's a bit more random.
19115 Prefer signed to unsigned, since the signedness doesn't matter and
19116 in general we prefer signed. When given a limit, use a
19117 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19118 latter isn't right if USE_2_TAGS_FOR_INTS.
19119 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19120 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19121
19122 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19123
19124 * textprop.c (text_property_stickiness):
19125 Obey Vtext_property_default_nonsticky.
19126 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19127 * w32fns.c (syms_of_w32fns):
19128 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19129
19130 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19131
19132 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19133 This is more efficient than Ffile_directory_p and avoids a minor race.
19134
19135 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19136
19137 * buffer.c (Foverlay_put): Say what the return value is
19138 (bug#7835).
19139
19140 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19141 is a directory before asking whether to use the file name
19142 (bug#7564).
19143 (barf_or_query_if_file_exists): Make the "File is a directory"
19144 error be more correct.
19145
19146 * fns.c (Frequire): Remove the mention of the .gz files, since
19147 that's installation-specific, but keep the mention of
19148 `get-load-suffixes'.
19149
19150 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19151
19152 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19153 Report string overflow if the output is too long.
19154
19155 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
19156
19157 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19158 (syms_of_gnutls): Remove duplicate DEFSYM for
19159 Qgnutls_bootprop_verify_hostname_error, an error for
19160 Qgnutls_bootprop_verify_error (which is no longer used).
19161
19162 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19163 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19164 Also (re)move comments that are misplaced or no longer relevant.
19165
19166 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19167
19168 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19169
19170 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
19171
19172 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19173 and background color parameters if they have been changed.
19174
19175 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19176
19177 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19178
19179 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19180
19181 * xsettings.c (SYSTEM_FONT): Define only when used.
19182 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19183
19184 * keymap.c (access_keymap_1): Now static.
19185
19186 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
19187
19188 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19189 leave any prefix arg for the up event (Bug#1586).
19190
19191 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19192
19193 * lread.c (syms_of_lread): Mention single symbols defined by
19194 `defvar' or `defconst' (bug#7154).
19195
19196 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19197 (Frequire): Mention get-load-suffixes.
19198
19199 2011-07-02 Martin Rudalics <rudalics@gmx.at>
19200
19201 * window.h (window): Remove clone_number slot.
19202 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19203 Remove.
19204 (make_parent_window, make_window, saved_window)
19205 (Fset_window_configuration, save_window_save): Don't deal with
19206 clone numbers.
19207 * buffer.c (Qclone_number): Remove declaration.
19208 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19209
19210 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19211
19212 Add multiple inheritance to keymaps.
19213 * keymap.c (Fmake_composed_keymap): New function.
19214 (Fset_keymap_parent): Simplify.
19215 (fix_submap_inheritance): Remove.
19216 (access_keymap_1): New function extracted from access_keymap to handle
19217 embedded parents and handle lists of maps.
19218 (access_keymap): Use it.
19219 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19220 (Fcopy_keymap): Handle embedded parents.
19221 (Fcommand_remapping, define_as_prefix): Simplify.
19222 (Fkey_binding): Simplify.
19223 (syms_of_keymap): Move minibuffer-local-completion-map,
19224 minibuffer-local-filename-completion-map,
19225 minibuffer-local-must-match-map, and
19226 minibuffer-local-filename-must-match-map to Elisp.
19227 (syms_of_keymap): Defsubr make-composed-keymap.
19228 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19229 (parse_menu_item): Trivial simplification.
19230
19231 2011-07-01 Glenn Morris <rgm@gnu.org>
19232
19233 * Makefile.in (SETTINGS_LIBS): Fix typo.
19234
19235 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19236
19237 * coding.c (Fencode_coding_string): Record the last coding system
19238 used, as the function doc string says (bug#8738).
19239
19240 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19241
19242 * xsettings.c (store_monospaced_changed): Take new font as arg and
19243 check for change against current_mono_font.
19244 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19245 (emacs_settings_constructor, emacs_settings_get_property)
19246 (emacs_settings_set_property, emacs_settings_class_init)
19247 (emacs_settings_init, gsettings_obj): Remove.
19248 (something_changedCB): New function for HAVE_GSETTINGS.
19249 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19250 with value as argument.
19251 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19252 g_settings_new (Bug#8967). Do not create gsettings_obj.
19253 Remove calls to g_settings_bind. Connect something_changedCB to
19254 "changed".
19255
19256 * xgselect.c: Add defined (HAVE_GSETTINGS).
19257 (xgselect_initialize): Ditto.
19258
19259 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19260 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19261 xg_select.
19262
19263 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19264
19265 * eval.c (struct backtrace): Simplify and port the data structure.
19266 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19267 signed bit field, as this assumption is not portable and it makes
19268 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19269 "char debug_on_exit : 1" as this is not portable either; instead,
19270 use the portable "unsigned int debug_on_exit : 1". Remove unused
19271 member evalargs. Remove obsolete comments about cc bombing out.
19272
19273 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19274
19275 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19276 Let HAVE_GSETTINGS override HAVE_GCONF.
19277 (store_monospaced_changed): New function.
19278 (EMACS_SETTINGS): A new type derived from GObject to handle
19279 GSettings notifications.
19280 (emacs_settings_constructor, emacs_settings_get_property)
19281 (emacs_settings_set_property, emacs_settings_class_init):
19282 New functions.
19283 (gsettings_client, gsettings_obj): New variables.
19284 (GSETTINGS_SCHEMA): New define.
19285 (something_changedCB): Call store_monospaced_changed.
19286 (init_gsettings): New function.
19287 (xsettings_initialize): Call init_gsettings.
19288 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19289 to NULL.
19290
19291 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19292 GCONF_CFLAGS/LIBS.
19293
19294 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19295
19296 * window.c (resize_root_window, grow_mini_window)
19297 (shrink_mini_window): Rename Qresize_root_window to
19298 Qwindow_resize_root_window and Qresize_root_window_vertically to
19299 Qwindow_resize_root_window_vertically.
19300
19301 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19302
19303 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19304
19305 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19306
19307 * makefile.w32-in: Redesign dependencies so they reflect more
19308 clearly which files are directly included by each source file,
19309 and not through other includes.
19310
19311 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19312
19313 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19314 (sort_overlays, overlay_strings): When an overlay's clone number
19315 matches the window's clone number process the overlay even if
19316 the overlay's window property doesn't match the current window.
19317
19318 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19319 (Fwindow_hchild): Rename to Fwindow_left_child.
19320 (Fwindow_next): Rename to Fwindow_next_sibling.
19321 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19322 (resize_window_check): Rename to window_resize_check.
19323 (resize_window_apply): Rename to window_resize_apply.
19324 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19325 (Fdelete_other_windows_internal, resize_frame_windows)
19326 (Fsplit_window_internal, Fdelete_window_internal)
19327 (grow_mini_window, shrink_mini_window)
19328 (Fresize_mini_window_internal): Fix callers accordingly.
19329
19330 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19331
19332 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19333 (emacs_fixed_set_min_size): Remove.
19334 (emacs_fixed_new): Take frame as argument.
19335
19336 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19337 (_EmacsFixedPrivate): Remove minwidth/height.
19338 Add struct frame *f.
19339 (emacs_fixed_init): Initialize priv->f.
19340 (get_parent_class, emacs_fixed_set_min_size): Remove.
19341 (emacs_fixed_new): Set priv->f to argument.
19342 (emacs_fixed_get_preferred_width)
19343 (emacs_fixed_get_preferred_height): Use min_width/height from
19344 frames size_hint to set minimum and natural (Bug#8919).
19345 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19346 and use min_width/height from frames size_hint to set
19347 min_width/height (Bug#8919).
19348
19349 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19350 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19351 Fix indentation.
19352
19353 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19354
19355 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19356 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19357 called at ZV.
19358
19359 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19360
19361 * process.c (wait_reading_process_output): Bypass select if
19362 waiting for a cell while ignoring keyboard input, and input is
19363 pending. Suggested by Jan Djärv (Bug#8869).
19364
19365 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19366
19367 Use gnulib's dup2 module instead of rolling our own.
19368 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19369
19370 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19371
19372 * dispnew.c (scrolling_window): Before scrolling, turn off a
19373 mouse-highlight in the window being scrolled.
19374
19375 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19376
19377 Move DEFSYM to lisp.h and use everywhere.
19378
19379 * character.h (DEFSYM): Move declaration...
19380 * lisp.h (DEFSYM): ...here.
19381
19382 * gnutls.c:
19383 * minibuf.c:
19384 * w32menu.c:
19385 * w32proc.c:
19386 * w32select.c: Don't include character.h.
19387
19388 * alloc.c (syms_of_alloc):
19389 * buffer.c (syms_of_buffer):
19390 * bytecode.c (syms_of_bytecode):
19391 * callint.c (syms_of_callint):
19392 * casefiddle.c (syms_of_casefiddle):
19393 * casetab.c (init_casetab_once):
19394 * category.c (init_category_once, syms_of_category):
19395 * ccl.c (syms_of_ccl):
19396 * cmds.c (syms_of_cmds):
19397 * composite.c (syms_of_composite):
19398 * dbusbind.c (syms_of_dbusbind):
19399 * dired.c (syms_of_dired):
19400 * dispnew.c (syms_of_display):
19401 * doc.c (syms_of_doc):
19402 * editfns.c (syms_of_editfns):
19403 * emacs.c (syms_of_emacs):
19404 * eval.c (syms_of_eval):
19405 * fileio.c (syms_of_fileio):
19406 * fns.c (syms_of_fns):
19407 * frame.c (syms_of_frame):
19408 * fringe.c (syms_of_fringe):
19409 * insdel.c (syms_of_insdel):
19410 * keymap.c (syms_of_keymap):
19411 * lread.c (init_obarray, syms_of_lread):
19412 * macros.c (syms_of_macros):
19413 * msdos.c (syms_of_msdos):
19414 * print.c (syms_of_print):
19415 * process.c (syms_of_process):
19416 * search.c (syms_of_search):
19417 * sound.c (syms_of_sound):
19418 * syntax.c (init_syntax_once, syms_of_syntax):
19419 * terminal.c (syms_of_terminal):
19420 * textprop.c (syms_of_textprop):
19421 * undo.c (syms_of_undo):
19422 * w32.c (globals_of_w32):
19423 * window.c (syms_of_window):
19424 * xdisp.c (syms_of_xdisp):
19425 * xfaces.c (syms_of_xfaces):
19426 * xfns.c (syms_of_xfns):
19427 * xmenu.c (syms_of_xmenu):
19428 * xsettings.c (syms_of_xsettings):
19429 * xterm.c (syms_of_xterm): Use DEFSYM.
19430
19431 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19432
19433 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19434
19435 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19436
19437 Integer and buffer overflow fixes (Bug#8873).
19438
19439 * print.c (printchar, strout): Check for string overflow.
19440 (PRINTPREPARE, printchar, strout):
19441 Don't set size unless allocation succeeds.
19442
19443 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19444 for sizes. Check for string overflow more accurately.
19445 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19446
19447 * macros.c: Integer and buffer overflow fixes.
19448 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19449 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19450 Use ptrdiff_t, not int, for sizes.
19451 Don't increment bufsize until after realloc succeeds.
19452 Check for size-calculation overflow.
19453 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19454
19455 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19456
19457 * lread.c: Integer overflow fixes.
19458 (read_integer): Radix is now EMACS_INT, not int,
19459 to improve quality of diagnostics for out-of-range radices.
19460 Calculate buffer size correctly for out-of-range radices.
19461 (read1): Check for integer overflow in radices, and in
19462 read-circle numbers.
19463 (read_escape): Avoid int overflow.
19464 (Fload, openp, read_buffer_size, read1)
19465 (substitute_object_recurse, read_vector, read_list, map_obarray):
19466 Use ptrdiff_t, not int, for sizes.
19467 (read1): Use EMACS_INT, not int, for sizes.
19468 Check for size overflow.
19469
19470 * image.c (cache_image): Check for size arithmetic overflow.
19471
19472 * lread.c: Integer overflow issues.
19473 (saved_doc_string_size, saved_doc_string_length)
19474 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19475 Now ptrdiff_t, not int.
19476 (read1): Don't assume doc string length fits in int. Check for
19477 out-of-range doc string lengths.
19478 (read_list): Don't assume file position fits in int.
19479 (read_escape): Check for hex character overflow.
19480
19481 2011-06-22 Leo Liu <sdl.web@gmail.com>
19482
19483 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19484 Move to minibuffer.el.
19485
19486 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19487
19488 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19489 The following patches are for when GLYPH_DEBUG && !XASSERT.
19490 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19491 * dispnew.c (flush_stdout):
19492 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19493 Mark as externally visible.
19494 * dispnew.c (check_window_matrix_pointers): Now static.
19495 * dispnew.c (window_to_frame_vpos):
19496 * xfns.c (unwind_create_frame):
19497 * xterm.c (x_check_font): Remove unused local.
19498 * scroll.c (CHECK_BOUNDS):
19499 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19500 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19501 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19502 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19503 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19504 Now static.
19505 (debug_method_add): Use va_list and vsprintf rather than relying
19506 on undefined behavior with wrong number of arguments.
19507 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19508 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19509 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19510 since we're not interested in debugging glyphs with old libraries.
19511 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19512 GCC 4.6.0's static checking.
19513
19514 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19515
19516 Integer overflow and signedness fixes (Bug#8873).
19517 A few related buffer overrun fixes, too.
19518
19519 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19520
19521 * dispextern.h (struct face.stipple):
19522 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19523 (x_bitmap_mask, x_allocate_bitmap_record)
19524 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19525 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19526 (x_create_bitmap_from_xpm_data):
19527 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19528 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19529 (.bitmaps_last):
19530 * xfaces.c (load_pixmap):
19531 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19532 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19533 (.bitmaps_last, struct x_output.icon_bitmap):
19534 Use ptrdiff_t, not int, for bitmap indexes.
19535 (x_allocate_bitmap_record): Check for size overflow.
19536 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19537
19538 Use ptrdiff_t, not int, for overlay counts.
19539 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19540 * editfns.c (overlays_around, get_pos_property):
19541 * textprop.c (get_char_property_and_overlay):
19542 * xdisp.c (next_overlay_change, note_mouse_highlight):
19543 * xfaces.c (face_at_buffer_position):
19544 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19545 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19546 (Fnext_overlay_change, Fprevious_overlay_change)
19547 (mouse_face_overlay_overlaps, Foverlays_in):
19548 Use ptrdiff_t, not int, for sizes.
19549 (overlays_at, overlays_in): Check for size-calculation overflow.
19550
19551 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19552
19553 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19554 (x_session_initialize): Do not assume string length fits in int.
19555
19556 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19557 This is unlikely, but can occur if DPI is outlandish.
19558
19559 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19560 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19561
19562 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19563 * xrdb.c (magic_file_p, search_magic_path):
19564 Omit last arg SUFFIX; it was always 0. All callers changed.
19565 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19566
19567 * xfont.c (xfont_match): Avoid need for strlen.
19568
19569 * xfns.c: Don't assume strlen fits in int.
19570 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19571
19572 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19573 not unsigned long, as we prefer signed integers. All callers changed.
19574 Detect integer overflow in repeat count.
19575 (message_dolog): Don't assume print length fits in 39 bytes.
19576 (display_mode_element): Don't assume strlen fits in int.
19577
19578 * termcap.c: Don't assume sizes fit in int and never overflow.
19579 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19580 (gobble_line): Check for size-calculation overflow.
19581
19582 * minibuf.c (Fread_buffer):
19583 * lread.c (intern, intern_c_string):
19584 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19585 Don't assume string length fits in int.
19586
19587 * keyboard.c (parse_tool_bar_item):
19588 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19589
19590 * font.c: Don't assume string length fits in int.
19591 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19592 Use ptrdiff_t, not int.
19593 (font_intern_prop): Don't assume string length fits in int.
19594 Don't assume integer property fits in fixnum.
19595 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19596
19597 * filelock.c: Fix some buffer overrun and integer overflow issues.
19598 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19599 Reformulate so as not to need the command string.
19600 Invoke gzip -cd rather than gunzip, as it's more portable.
19601 (lock_info_type, lock_file_1, lock_file):
19602 Don't assume pid_t and time_t fit in unsigned long.
19603 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19604 (current_lock_owner): Prefer signed type for sizes.
19605 Use memcpy, not strncpy, where memcpy is what is really wanted.
19606 Don't assume (via atoi) that time_t and pid_t fit in int.
19607 Check for time_t and/or pid_t out of range, e.g., via a network share.
19608 Don't alloca where an auto var works fine.
19609
19610 * fileio.c: Fix some integer overflow issues.
19611 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19612 Don't assume string length fits in int.
19613 (directory_file_name): Don't assume string length fits in long.
19614 (make_temp_name): Don't assume pid fits in int, or that its print
19615 length is less than 20.
19616
19617 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19618
19619 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19620
19621 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19622
19623 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19624 We prefer signed integers, even for size calculations.
19625
19626 * emacs.c: Don't assume string length fits in 'int'.
19627 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19628 (main): Don't invoke strlen when not needed.
19629
19630 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19631 (XD_DEBUG_MESSAGE): Don't waste a byte.
19632
19633 * callproc.c (getenv_internal_1, getenv_internal)
19634 (Fgetenv_internal):
19635 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19636
19637 * lread.c (invalid_syntax): Omit length argument.
19638 All uses changed. This doesn't fix a bug, but it simplifies the
19639 code away from its former Hollerith-constant appearance, and it's
19640 one less 'int' to worry about when looking at integer-overflow issues.
19641 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19642
19643 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19644 This didn't break anything, but it didn't help either.
19645 It's confusing to put a bogus integer in a place where the actual
19646 value does not matter.
19647 (LIST_END_P): Remove unused macro and its bogus comment.
19648 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19649
19650 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19651 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19652 implementation.
19653 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19654 We prefer signed types, and the value cannot exceed the EMACS_INT
19655 range anyway (because otherwise the length would not be representable).
19656 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19657 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19658 This avoids a GCC warning when WIDE_EMACS_INT.
19659
19660 * indent.c (sane_tab_width): New function.
19661 (current_column, scan_for_column, Findent_to, position_indentation)
19662 (compute_motion): Use it. This is just for clarity.
19663 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19664
19665 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19666
19667 * lisp.h (lint_assume): New macro.
19668 * composite.c (composition_gstring_put_cache):
19669 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19670
19671 * editfns.c, insdel.c:
19672 Omit unnecessary forward decls, to simplify future changes.
19673
19674 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19675
19676 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19677
19678 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19679 Use much-faster test for byte-length change.
19680 Don't assume string byte-length fits in 'int'.
19681 Check that character arg fits in 'int'.
19682 (mapcar1): Declare byte as byte, for clarity.
19683
19684 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19685
19686 * fns.c (concat): Catch string overflow earlier.
19687 Do not rely on integer wraparound.
19688
19689 * dispextern.h (struct it.overlay_strings_charpos)
19690 (struct it.selective): Now EMACS_INT, not int.
19691 * xdisp.c (forward_to_next_line_start)
19692 (back_to_previous_visible_line_start)
19693 (reseat_at_next_visible_line_start, next_element_from_buffer):
19694 Don't arbitrarily truncate the value of 'selective' to int.
19695
19696 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19697
19698 * composite.c: Don't truncate sizes to 'int'.
19699 (composition_gstring_p, composition_reseat_it)
19700 (composition_adjust_point): Use EMACS_INT, not int.
19701 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19702 not EMACS_UINT, for indexes.
19703
19704 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19705
19706 * buffer.c: Include <verify.h>.
19707 (struct sortvec.priority, struct sortstr.priority):
19708 Now EMACS_INT, not int.
19709 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19710 (struct sortstr.size, record_overlay_string)
19711 (struct sortstrlist.size, struct sortlist.used):
19712 Don't truncate size to int.
19713 (record_overlay_string): Check for size-calculation overflow.
19714 (init_buffer_once): Check at compile-time, not run-time.
19715
19716 2011-06-22 Jim Meyering <meyering@redhat.com>
19717
19718 Don't leak an XBM-image-sized buffer
19719 * image.c (xbm_load): Free the image buffer after using it.
19720
19721 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19722
19723 Port to Sun C.
19724 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19725 that Sun C diagnosed.
19726 * fns.c (secure_hash): Fix pointer signedness issue.
19727 * intervals.c (static_offset_intervals): New function.
19728 (offset_intervals): Use it.
19729
19730 2011-06-21 Leo Liu <sdl.web@gmail.com>
19731
19732 * deps.mk (fns.o):
19733 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19734 sha512.h.
19735
19736 * fns.c (secure_hash): Rename from crypto_hash_function and change
19737 the first arg to accept symbols.
19738 (Fsecure_hash): New primitive.
19739 (syms_of_fns): New symbols.
19740
19741 2011-06-20 Deniz Dogan <deniz@dogan.se>
19742
19743 * process.c (Fset_process_buffer): Clarify return value in
19744 docstring.
19745
19746 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19747
19748 * dispnew.c (add_window_display_history): Use BVAR.
19749
19750 * xdisp.c (debug_method_add): Use BVAR.
19751 (check_window_end, dump_glyph_matrix, dump_glyph)
19752 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19753
19754 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19755 Likewise.
19756
19757 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19758 check till after the cache is created in init_frame_faces.
19759
19760 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19761
19762 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19763
19764 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19765
19766 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19767 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19768 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19769
19770 Improve buffer-overflow checking (Bug#8873).
19771 * fileio.c (Finsert_file_contents):
19772 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19773 Remove the old (too-loose) buffer overflow checks.
19774 They weren't needed, since make_gap checks for buffer overflow.
19775 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19776 The old code merely checked for Emacs fixnum overflow, and relied
19777 on undefined (wraparound) behavior. The new code avoids undefined
19778 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19779
19780 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19781 Tune. Don't use wider integers than needed. Don't use alloca.
19782 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19783
19784 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19785
19786 * insdel.c, lisp.h (buffer_overflow): New function.
19787 (insert_from_buffer_1, replace_range, replace_range_2):
19788 * insdel.c (make_gap_larger):
19789 * editfns.c (Finsert_char):
19790 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19791
19792 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19793
19794 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19795
19796 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19797
19798 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19799 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19800
19801 * fileio.c: Don't assume EMACS_INT fits in off_t.
19802 (emacs_lseek): New static function.
19803 (Finsert_file_contents, Fwrite_region): Use it.
19804 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19805
19806 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19807
19808 * fns.c: Don't overflow int when computing a list length.
19809 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19810 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19811 truncation on 64-bit hosts. Check for QUIT every
19812 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19813 faster and is responsive enough.
19814 (Flength): Report an error instead of overflowing an integer.
19815 (Fsafe_length): Return a float if the value is not representable
19816 as a fixnum. This shouldn't happen except in contrived situations.
19817 (Fnthcdr, Fsort): Don't assume list length fits in int.
19818 (Fcopy_sequence): Don't assume vector length fits in int.
19819
19820 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19821 (header_size, word_size): New constants.
19822 (allocate_vectorlike): Don't check size overflow here.
19823 (allocate_vector): Check it here instead, since this is the only
19824 caller of allocate_vectorlike that could cause overflow.
19825 Check that the new vector's length is representable as a fixnum.
19826
19827 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19828 The previous code was bogus. For example, next_almost_prime (32)
19829 returned 39, which is undesirable as it is a multiple of 3; and
19830 next_almost_prime (24) returned 25, which is a multiple of 5 so
19831 why was the code bothering to check for multiples of 7?
19832
19833 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19834
19835 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19836
19837 Variadic C functions now count arguments with ptrdiff_t.
19838 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19839 Back then I didn't know that the Emacs coding style prefers signed int.
19840 Also, in the meantime I found a few more instances where arguments
19841 were being counted with int, which may truncate counts on 64-bit
19842 machines, or EMACS_INT, which may be unnecessarily wide.
19843 * lisp.h (struct Lisp_Subr.function.aMANY)
19844 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19845 Arg counts are now ptrdiff_t, not size_t.
19846 All variadic functions and their callers changed accordingly.
19847 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19848 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19849 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19850 * callint.c (Fcall_interactively): Check arg count for overflow,
19851 to avoid potential buffer overrun. Use signed char, not 'int',
19852 for 'varies' array, so that we needn't bother to check its size
19853 calculation for overflow.
19854 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19855 * eval.c (apply_lambda):
19856 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19857 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19858 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19859
19860 * callint.c (Fcall_interactively): Don't use index var as event count.
19861
19862 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19863 * mem-limits.h (SIZE): Remove; no longer used.
19864
19865 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19866
19867 Remove unnecessary casts.
19868 * xterm.c (x_term_init):
19869 * xfns.c (x_set_border_pixel):
19870 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19871 These aren't needed now that we assume ANSI C.
19872
19873 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19874 It's more likely to cause problems (due to unsigned overflow)
19875 than to cure them.
19876
19877 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19878
19879 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19880
19881 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19882
19883 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19884
19885 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19886
19887 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19888
19889 GLYPH_CODE_FACE returns EMACS_INT, not int.
19890 * dispextern.h (merge_faces):
19891 * xfaces.c (merge_faces):
19892 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19893 Don't assume EMACS_INT fits in int.
19894
19895 * character.h (CHAR_VALID_P): Remove unused parameter.
19896 * fontset.c, lisp.h, xdisp.c: All uses changed.
19897
19898 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19899
19900 * fns.c (concat): Minor tuning based on overflow analysis.
19901 This doesn't fix any bugs. Use int to hold character, instead
19902 of constantly refetching from Emacs object. Use XFASTINT, not
19903 XINT, for value known to be a character. Don't bother comparing
19904 a single byte to 0400, as it's always less.
19905
19906 * floatfns.c (Fexpt):
19907 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19908
19909 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19910 for characters.
19911
19912 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19913
19914 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19915 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19916 incorrectly succeed when S was a string, because 4294967386 was
19917 truncated before it was used.
19918
19919 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19920 Otherwise, an out-of-range integer could cause undefined behavior
19921 on a 64-bit host.
19922
19923 * composite.c: Use int, not EMACS_INT, for characters.
19924 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19925 EMACS_INT, for values that are known to be in character range.
19926 This doesn't fix any bugs but is the usual style inside Emacs and
19927 may generate better code on 32-bit machines.
19928
19929 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19930 This is for reasons similar to the recent CHAR_STRING fix.
19931 * charset.c (Fencode_char): Check that character arg is actually
19932 a character. Pass an int to ENCODE_CHAR.
19933 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19934 wider than 'int', as a compile-time check to prevent future regressions
19935 in this area.
19936
19937 * character.c (char_string): Remove unnecessary casts.
19938
19939 Make sure a 64-bit char is never passed to CHAR_STRING.
19940 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19941 by silently ignoring the top 32 bits, allowing some values
19942 that were far too large to be valid characters.
19943 * character.h: Include <verify.h>.
19944 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19945 arguments are no wider than unsigned, as a compile-time check
19946 to prevent future regressions in this area.
19947 * data.c (Faset):
19948 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19949 (Fsubst_char_in_region):
19950 * fns.c (concat):
19951 * xdisp.c (decode_mode_spec_coding):
19952 Adjust to CHAR_STRING's new requirement.
19953 * editfns.c (Finsert_char, Fsubst_char_in_region):
19954 * fns.c (concat): Check that character args are actually
19955 characters. Without this test, these functions did the wrong
19956 thing with wildly out-of-range values on 64-bit hosts.
19957
19958 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19959 These casts should not be needed on 32-bit hosts, either.
19960 * keyboard.c (read_char):
19961 * lread.c (Fload): Remove casts to unsigned.
19962
19963 * lisp.h (UNSIGNED_CMP): New macro.
19964 This fixes comparison bugs on 64-bit hosts.
19965 (ASCII_CHAR_P): Use it.
19966 * casefiddle.c (casify_object):
19967 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19968 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19969 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19970 * dispextern.h (FACE_FROM_ID):
19971 * keyboard.c (read_char): Use UNSIGNED_CMP.
19972
19973 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19974 not to EMACS_INT, to avoid GCC warning.
19975
19976 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19977
19978 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19979 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19980 isn't needed on 32-bit machines.
19981
19982 * buffer.c (Fgenerate_new_buffer_name):
19983 Use EMACS_INT for count, not int.
19984 (advance_to_char_boundary): Return EMACS_INT, not int.
19985
19986 * data.c (Qcompiled_function): Now static.
19987
19988 * window.c (window_body_lines): Now static.
19989
19990 * image.c (gif_load): Rename local to avoid shadowing.
19991
19992 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19993 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19994 * alloc.c (make_save_value): Integer argument is now of type
19995 ptrdiff_t, not int.
19996 (mark_object): Use ptrdiff_t, not int.
19997 * lisp.h (pD): New macro.
19998 * print.c (print_object): Use it.
19999
20000 * alloc.c: Use EMACS_INT, not int, to count objects.
20001 (total_conses, total_markers, total_symbols, total_vector_size)
20002 (total_free_conses, total_free_markers, total_free_symbols)
20003 (total_free_floats, total_floats, total_free_intervals)
20004 (total_intervals, total_strings, total_free_strings):
20005 Now EMACS_INT, not int. All uses changed.
20006 (Fgarbage_collect): Compute overall total using a double, so that
20007 integer overflow is less likely to be a problem. Check for overflow
20008 when converting back to an integer.
20009 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20010 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20011 These were 'int' variables that could overflow on 64-bit hosts;
20012 they were never used, so remove them instead of repairing them.
20013 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20014 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20015 Previously, this ceilinged at INT_MAX, but that doesn't work on
20016 64-bit machines.
20017 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20018
20019 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20020 (allocate_vectorlike): Check for ptrdiff_t overflow.
20021 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20022 when a (possibly-narrower) signed value would do just as well.
20023 We prefer using signed arithmetic, to avoid comparison confusion.
20024
20025 * alloc.c: Catch some string size overflows that we were missing.
20026 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20027 for convenience in STRING_BYTES_MAX.
20028 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20029 The definition here is exact; the one in lisp.h was approximate.
20030 (allocate_string_data): Check for string overflow. This catches
20031 some instances we weren't catching before. Also, it catches
20032 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20033 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20034 and ptrdiff_t and EMACS_INT are both 64 bits.
20035
20036 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20037 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20038 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20039
20040 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20041
20042 * alloc.c (Fmake_string): Check for out-of-range init.
20043
20044 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20045
20046 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20047
20048 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20049
20050 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20051 xg_get_default_scrollbar_width.
20052
20053 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20054 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20055 (style_changed_cb): Call update_theme_scrollbar_width and call
20056 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20057 all frames (Bug#8505).
20058 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20059 Call gtk_window_set_resizable if HAVE_GTK3.
20060 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20061 and height if HAVE_GTK3 (Bug#8505).
20062 (scroll_bar_width_for_theme): New variable.
20063 (update_theme_scrollbar_width): New function.
20064 (xg_get_default_scrollbar_width): Move code to
20065 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20066 (xg_initialize): Call update_theme_scrollbar_width.
20067
20068 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20069
20070 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20071
20072 2011-06-12 Martin Rudalics <rudalics@gmx.at>
20073
20074 * frame.c (make_frame): Call other_buffer_safely instead of
20075 other_buffer.
20076
20077 * window.c (temp_output_buffer_show): Call display_buffer with
20078 second argument Vtemp_buffer_show_specifiers and reset latter
20079 immediately after the call.
20080 (Vtemp_buffer_show_specifiers): New variable.
20081 (auto_window_vscroll_p, next_screen_context_lines)
20082 (Vscroll_preserve_screen_position): Remove leading asterisks from
20083 doc-strings.
20084
20085 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20086
20087 Fix minor problems found by GCC 4.6.0 static checking.
20088 * buffer.c (Qclone_number): Remove for now, as it's unused.
20089 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20090 (record_buffer): Remove unused local.
20091 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20092 (set_frame_buffer_list): Remove; unused.
20093 * frame.h (other_visible_frames): Remove decl.
20094 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20095 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20096 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20097 if HAVE_GPM.
20098 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20099 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20100 Define only if HAVE_GPM.
20101 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20102 (update_hints_inhibit): Remove; never set. All uses removed.
20103 * widgetprv.h (emacsFrameClassRec): Remove decl.
20104 * window.c (delete_deletable_window): Now returns void, since it
20105 wasn't returning anything.
20106 (compare_window_configurations): Remove unused locals.
20107 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20108 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20109 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20110 the same widths as pointers. This follows up on the 2011-05-06 patch.
20111 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20112 * xterm.h: Likewise.
20113 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20114
20115 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
20116
20117 * makefile.w32-in: Update dependencies.
20118 (LISP_H): Add lib/intprops.h.
20119
20120 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20121
20122 * image.c (gif_load): Add animation frame delay to the metadata.
20123 (syms_of_image): Use DEFSYM. New symbol `delay'.
20124
20125 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20126
20127 * window.c (delete_deletable_window): Re-add.
20128 (Fset_window_configuration): Rewrite to handle dead buffers and
20129 consequently deletable windows.
20130 (window_tree, Fwindow_tree): Remove. Supply functionality in
20131 window.el.
20132 (compare_window_configurations): Simplify code.
20133
20134 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20135
20136 * image.c (imagemagick_load_image): Fix type mismatch.
20137 (Fimagemagick_types): Likewise.
20138
20139 * window.h (replace_buffer_in_windows): Declare.
20140
20141 2011-06-11 Martin Rudalics <rudalics@gmx.at>
20142
20143 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20144 Qclone_number. Remove external declaration of Qdelete_window.
20145 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20146 code.
20147 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20148 Run Qbuffer_list_update_hook if allowed.
20149 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20150 buffer list implementation.
20151 (other_buffer_safely): New function.
20152 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20153 calls to replace_buffer_in_windows and
20154 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20155 if allowed.
20156 (record_buffer): Inhibit quitting and rewrite using quittable
20157 functions. Run Qbuffer_list_update_hook if allowed.
20158 (Frecord_buffer, Funrecord_buffer): New functions.
20159 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20160 Move switch-to-buffer to window.el.
20161 (bury-buffer): Move to window.el.
20162 (Vbuffer_list_update_hook): New variable.
20163
20164 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20165 section.
20166
20167 * window.h (resize_frame_windows): Move up in code.
20168 (Fwindow_frame): Remove EXFUN.
20169 (replace_buffer_in_all_windows): Remove prototype.
20170 (replace_buffer_in_windows_safely): Add prototype.
20171
20172 * window.c: Declare Qdelete_window static again. Move down
20173 declaration of select_count.
20174 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20175 (Fother_window): Move to window.el.
20176 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20177 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20178 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20179 window.el.
20180 (replace_buffer_in_windows): Implement by calling
20181 Qreplace_buffer_in_windows.
20182 (replace_buffer_in_all_windows): Remove with some functionality
20183 moved into replace_buffer_in_windows_safely.
20184 (replace_buffer_in_windows_safely): New function.
20185 (select_window_norecord, select_frame_norecord): Move in front
20186 of run_window_configuration_change_hook. Remove now obsolete
20187 declarations.
20188 (Fset_window_buffer): Rewrite doc-string.
20189 Call Qrecord_window_buffer.
20190 (keys_of_window): Move binding for other-window to window.el.
20191
20192 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
20193
20194 * dispextern.h (struct image): Replace data member, whose int_val
20195 and ptr_val fields were not used by anything, with a single
20196 lisp_val object.
20197
20198 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20199 (gif_clear_image, gif_load, imagemagick_load_image)
20200 (gs_clear_image, gs_load): Callers changed.
20201
20202 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20203
20204 * buffer.h: Include <time.h>, for time_t.
20205 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20206
20207 Fix minor problems found by static checking.
20208
20209 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20210
20211 Make identifiers static if they are not used in other modules.
20212 * data.c (Qcompiled_function, Qframe, Qvector):
20213 * image.c (QimageMagick, Qsvg):
20214 * minibuf.c (Qmetadata):
20215 * window.c (resize_window_check, resize_root_window): Now static.
20216 * window.h (resize_window_check, resize_root_window): Remove decls.
20217
20218 * window.c (window_deletion_count, delete_deletable_window):
20219 Remove; unused.
20220 (window_body_lines): Now static.
20221 (Fdelete_other_windows_internal): Mark vars as initialized.
20222 Make sure 'resize_failed' is initialized.
20223 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20224 (resize_window_apply): Remove unused local.
20225 * window.h (delete_deletable_window): Remove decl.
20226
20227 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20228 (imagemagick_load_image): Fix pointer signedness problem by changing
20229 last arg from unsigned char * to char *. All uses changed.
20230 Also, fix a local for similar reasons.
20231 Remove unused locals. Remove locals to avoid shadowing.
20232 (fn_rsvg_handle_free): Remove; unused.
20233 (svg_load, svg_load_image): Fix pointer signedness problem.
20234 (imagemagick_load_image): Don't use garbage pointer image_wand.
20235
20236 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20237
20238 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20239
20240 * image.c (gif_load): Fix omitted cast error introduced by
20241 2011-06-06 change.
20242
20243 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20244
20245 * window.h (resize_proportionally, orig_total_lines)
20246 (orig_top_line): Remove from window structure.
20247 (set_window_height, set_window_width, change_window_heights)
20248 (Fdelete_window): Remove prototypes.
20249 (resize_frame_windows): Remove duplicate declaration.
20250
20251 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20252
20253 * window.h (resize_frame_windows, resize_window_check)
20254 (delete_deletable_window, resize_root_window)
20255 (resize_frame_windows): Declare prototypes.
20256
20257 * window.c (resize_window_apply): Make definition be "static" to
20258 match the prototype.
20259
20260 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20261
20262 * window.c: Remove declarations of Qwindow_size_fixed,
20263 window_min_size_1, window_min_size_2, window_min_size,
20264 size_window, window_fixed_size_p, enlarge_window, delete_window.
20265 Remove static from declaration of Qdelete_window, it's
20266 temporarily needed by Fbury_buffer.
20267 (replace_window): Don't assign orig_top_line and
20268 orig_total_lines.
20269 (Fdelete_window, delete_window): Remove. Window deletion is
20270 handled by window.el.
20271 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20272 Replace Fdelete_window calls with calls to Qdelete_window.
20273 (Fdelete_other_windows): Remove. Deleting other windows is
20274 handled by window.el.
20275 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20276 handled in window.el.
20277 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20278 Window minimum sizes are handled in window.el.
20279 (shrink_windows, size_window, set_window_height)
20280 (set_window_width, change_window_heights, window_height)
20281 (window_width, CURBEG, CURSIZE, enlarge_window)
20282 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20283 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20284 handled in window.el.
20285 (make_dummy_parent): Rename to make_parent_window and give it a
20286 second argument horflag.
20287 (make_window): Don't set resize_proportionally any more.
20288 (Fsplit_window): Remove. Windows are split in window.el.
20289 (save_restore_action, save_restore_orig_size)
20290 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20291 Resize mini windows in window.el.
20292 (grow_mini_window, shrink_mini_window): Implement by calling
20293 Qresize_root_window_vertically, resize_window_check and
20294 resize_window_apply.
20295 (saved_window, Fset_window_configuration, save_window_save):
20296 Do not handle orig_top_line, orig_total_lines, and
20297 resize_proportionally.
20298 (window_min_height, window_min_width): Move to window.el.
20299 (keys_of_window): Move bindings for delete-other-windows,
20300 split-window, delete-window and enlarge-window to window.el.
20301
20302 * buffer.c: Temporarily extern Qdelete_window.
20303 (Fbury_buffer): Temporarily call Qdelete_window instead of
20304 Fdelete_window (Fbury_buffer will move to window.el soon).
20305
20306 * frame.c (set_menu_bar_lines_1): Remove code handling
20307 orig_top_line and orig_total_lines.
20308
20309 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20310 set_window_height but set heights directly.
20311 (change_frame_size_1): Use resize_frame_windows.
20312
20313 * xdisp.c (init_xdisp): Don't use set_window_height but set
20314 heights directly.
20315
20316 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20317 Use resize_frame_windows instead of change_window_heights and run
20318 run_window_configuration_change_hook.
20319
20320 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20321 instead of change_window_heights and run
20322 run_window_configuration_change_hook.
20323
20324 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20325
20326 * window.c (replace_window): Rename second argument REPLACEMENT to
20327 NEW. New third argument SETFLAG. Rewrite.
20328 (delete_window, make_dummy_parent): Call replace_window with
20329 third argument 1.
20330 (window_list_1): Move down in code.
20331 (run_window_configuration_change_hook): Move set_buffer part
20332 before select_frame_norecord part in order to unwind correctly.
20333 Rename count1 to count.
20334 (recombine_windows, delete_deletable_window, resize_root_window)
20335 (Fdelete_other_windows_internal)
20336 (Frun_window_configuration_change_hook, make_parent_window)
20337 (resize_window_check, resize_window_apply, Fresize_window_apply)
20338 (resize_frame_windows, Fsplit_window_internal)
20339 (Fdelete_window_internal, Fresize_mini_window_internal):
20340 New functions.
20341 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20342
20343 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20344
20345 * window.h (window): Add some new members to window structure -
20346 normal_lines, normal_cols, new_total, new_normal, clone_number,
20347 splits, nest, prev_buffers, next_buffers.
20348 (WINDOW_TOTAL_SIZE): Move here from window.c.
20349 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20350
20351 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20352 Remove.
20353 (make_dummy_parent): Set new members of windows structure.
20354 (make_window): Move down in code. Handle new members of window
20355 structure.
20356 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20357 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20358 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20359 (Fset_window_prev_buffers, Fwindow_next_buffers)
20360 (Fset_window_next_buffers, Fset_window_clone_number):
20361 New functions.
20362 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20363 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20364 Doc-string fixes.
20365 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20366 Argument WINDOW can be now internal window too.
20367 (Fwindow_use_time): Move up in code.
20368 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20369 Rewrite doc-string.
20370 (Fset_window_configuration, saved_window)
20371 (Fcurrent_window_configuration, save_window_save): Handle new
20372 members of window structure.
20373 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20374 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20375 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20376 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20377 Qget_mru_window, Qresize_root_window,
20378 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20379 Qauto_buffer_name; staticpro them.
20380
20381 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20382
20383 * window.c (Fwindow_total_size, Fwindow_left_column)
20384 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20385 (Fwindow_list_1): New functions.
20386 (window_box_text_cols): Replace with window_body_cols.
20387 (Fwindow_width, Fscroll_left, Fscroll_right):
20388 Use window_body_cols instead of window_box_text_cols.
20389 (delete_window, Fset_window_configuration):
20390 Call delete_all_subwindows with window as argument.
20391 (delete_all_subwindows): Take a window as argument and not a
20392 structure. Rewrite.
20393 (window_loop): Remove handling of GET_LRU_WINDOW and
20394 GET_LARGEST_WINDOW.
20395 (Fget_lru_window, Fget_largest_window): Move to window.el.
20396
20397 * window.h: Extern window_body_cols instead of
20398 window_box_text_cols. delete_all_subwindows now takes a
20399 Lisp_Object as argument.
20400
20401 * indent.c (compute_motion, Fcompute_motion):
20402 Use window_body_cols instead of window_box_text_cols.
20403
20404 * frame.c (delete_frame): Call delete_all_subwindows with root
20405 window as argument.
20406
20407 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20408
20409 * fns.c (Fputhash): Document return value.
20410
20411 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20412
20413 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20414
20415 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20416
20417 Cons<->int and similar integer overflow fixes (Bug#8794).
20418
20419 Check for overflow when converting integer to cons and back.
20420 * charset.c (Fdefine_charset_internal, Fdecode_char):
20421 Use cons_to_unsigned to catch overflow.
20422 (Fencode_char): Use INTEGER_TO_CONS.
20423 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20424 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20425 * data.c (long_to_cons, cons_to_long): Remove.
20426 (cons_to_unsigned, cons_to_signed): New functions.
20427 These signal an error for invalid or out-of-range values.
20428 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20429 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20430 * font.c (Ffont_variation_glyphs):
20431 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20432 * lisp.h: Include <intprops.h>.
20433 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20434 (cons_to_signed, cons_to_unsigned): New decls.
20435 (long_to_cons, cons_to_long): Remove decls.
20436 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20437 (Fprimitive_undo): Use CONS_TO_INTEGER.
20438 * xfns.c (Fx_window_property): Likewise.
20439 * xselect.c: Include <limits.h>.
20440 (x_own_selection, selection_data_to_lisp_data):
20441 Use INTEGER_TO_CONS.
20442 (x_handle_selection_request, x_handle_selection_clear)
20443 (x_get_foreign_selection, Fx_disown_selection_internal)
20444 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20445 (lisp_data_to_selection_data): Use cons_to_unsigned.
20446 (x_fill_property_data): Use cons_to_signed.
20447 Report values out of range.
20448
20449 Check for buffer and string overflow more precisely.
20450 * buffer.h (BUF_BYTES_MAX): New macro.
20451 * lisp.h (STRING_BYTES_MAX): New macro.
20452 * alloc.c (Fmake_string):
20453 * character.c (string_escape_byte8):
20454 * coding.c (coding_alloc_by_realloc):
20455 * doprnt.c (doprnt):
20456 * editfns.c (Fformat):
20457 * eval.c (verror):
20458 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20459 since they may not be the same number.
20460 * editfns.c (Finsert_char):
20461 * fileio.c (Finsert_file_contents):
20462 Likewise for BUF_BYTES_MAX.
20463
20464 * image.c: Use ptrdiff_t, not int, for sizes.
20465 (slurp_file): Switch from int to ptrdiff_t.
20466 All uses changed.
20467 (slurp_file): Check that file size fits in both size_t (for
20468 malloc) and ptrdiff_t (for sanity and safety).
20469
20470 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20471 if b->modtime has its maximal value.
20472
20473 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20474
20475 Don't assume time_t can fit into int.
20476 * buffer.h (struct buffer.modtime): Now time_t, not int.
20477 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20478 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20479
20480 Minor fixes for signed vs unsigned integers.
20481 * character.h (MAYBE_UNIFY_CHAR):
20482 * charset.c (maybe_unify_char):
20483 * keyboard.c (read_char, reorder_modifiers):
20484 XINT -> XFASTINT, since the integer must be nonnegative.
20485 * ftfont.c (ftfont_spec_pattern):
20486 * keymap.c (access_keymap, silly_event_symbol_error):
20487 XUINT -> XFASTINT, since the integer must be nonnegative.
20488 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20489 since it makes no difference and we prefer signed.
20490 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20491 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20492 nonnegative.
20493
20494 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20495
20496 * window.h (Fwindow_frame): Declare.
20497
20498 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20499
20500 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20501 (SPARE_MEMORY): Always define.
20502 (LARGE_REQUEST): Remove.
20503 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20504
20505 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20506
20507 * lisp.h: Move EXFUNS for Fframe_root_window,
20508 Fframe_first_window and Fset_frame_selected_window to window.h.
20509
20510 * window.h: Move EXFUNS for Fframe_root_window,
20511 Fframe_first_window and Fset_frame_selected_window here from
20512 lisp.h.
20513
20514 * frame.c (Fwindow_frame, Fframe_first_window)
20515 (Fframe_root_window, Fframe_selected_window)
20516 (Fset_frame_selected_window): Move to window.c.
20517 (Factive_minibuffer_window): Move to minibuf.c.
20518 (Fother_visible_frames_p): New function.
20519
20520 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20521
20522 * window.c (decode_window, decode_any_window): Move up in code.
20523 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20524 (inhibit_frame_unsplittable): Remove unused variable.
20525 (Fwindow_buffer): Move up and rewrite doc-string.
20526 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20527 (Fwindow_prev): New functions.
20528 (Fwindow_frame): Move here from frame.c. Accept any window as
20529 argument.
20530 (Fframe_root_window, Fframe_first_window)
20531 (Fframe_selected_window): Move here from frame.c. Accept frame
20532 or arbitrary window as argument. Update doc-strings.
20533 (Fminibuffer_window): Move up in code.
20534 (Fwindow_minibuffer_p): Move up in code and simplify.
20535 (Fset_frame_selected_window): Move here from frame.c.
20536 Marginal rewrite.
20537 (Fselected_window, select_window, Fselect_window): Move up in
20538 code. Minor doc-string fixes.
20539
20540 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20541
20542 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20543 Do not assume that spare memory exists; that assumption is valid
20544 only if SYSTEM_MALLOC.
20545 (LARGE_REQUEST): New macro, so that the issue of large requests
20546 is separated from the issue of spare memory.
20547
20548 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20549
20550 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20551 format. (Bug#8806)
20552
20553 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20554
20555 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20556 before statements.
20557
20558 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20559
20560 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20561
20562 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20563
20564 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20565 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20566
20567 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20568
20569 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20570
20571 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20572
20573 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20574 (x_clipboard_manager_save): Add return value.
20575 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20576 New error handlers.
20577 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20578 Obey Vx_select_enable_clipboard_manager. Catch errors in
20579 x_clipboard_manager_save (Bug#8779).
20580 (Vx_select_enable_clipboard_manager): New variable.
20581 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20582
20583 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20584
20585 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20586
20587 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20588
20589 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20590 in the current matrix if keep_current_p is non-zero.
20591
20592 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20593
20594 * bidi.c (bidi_level_of_next_char): Fix last change.
20595
20596 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20597
20598 Support bidi reordering of text covered by display properties.
20599
20600 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20601 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20602 (bidi_cache_search, bidi_cache_iterator_state)
20603 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20604 (bidi_level_of_next_char, bidi_move_to_visually_next):
20605 Support character positions inside a run of characters covered by a
20606 display string.
20607 (bidi_paragraph_init, bidi_resolve_explicit_1)
20608 (bidi_level_of_next_char): Call bidi_fetch_char and
20609 bidi_fetch_char_advance instead of FETCH_CHAR and
20610 FETCH_CHAR_ADVANCE.
20611 (bidi_init_it): Initialize new members.
20612 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20613 definitions.
20614 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20615 instead of using explicit *_CHAR codes.
20616 (bidi_resolve_explicit, bidi_resolve_weak):
20617 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20618 bidirectional text is supported only in multibyte buffers.
20619 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20620 it to initialize the frame_window_p member of struct bidi_it.
20621 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20622 (bidi_resolve_explicit, bidi_resolve_weak)
20623 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20624 bidi_it->nchars is non-positive.
20625 (bidi_level_of_next_char): Don't try to lookup the cache for the
20626 next/previous character if nothing is cached there yet, or if we
20627 were just reseat()'ed to a new position.
20628
20629 * xdisp.c (set_cursor_from_row): Set start and stop points
20630 according to the row's direction when priming the loop that looks
20631 for the glyph on which to display cursor.
20632 (single_display_spec_intangible_p): Function deleted.
20633 (display_prop_intangible_p): Reimplement to call
20634 handle_display_spec instead of single_display_spec_intangible_p.
20635 Accept 3 additional arguments needed by handle_display_spec.
20636 This fixes incorrect cursor motion across display property with complex
20637 values: lists, `(when COND...)' forms, etc.
20638 (single_display_spec_string_p): Support property values that are
20639 lists with the argument STRING its top-level element.
20640 (display_prop_string_p): Fix the condition for processing a
20641 property that is a list to be consistent with handle_display_spec.
20642 (handle_display_spec): New function, refactored from the
20643 last portion of handle_display_prop.
20644 (compute_display_string_pos): Accept additional argument
20645 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20646 value of a `display' property is a "replacing spec".
20647 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20648 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20649 the display property, but just return a value indicating whether
20650 the display property will replace the characters it covers.
20651 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20652 frame_window_p members of struct bidi_it.
20653 (compute_display_string_pos, compute_display_string_end):
20654 New functions.
20655 (push_it): Accept second argument POSITION, where pop_it should
20656 jump to continue iteration.
20657 (reseat_1): Initialize bidi_it.disp_pos.
20658
20659 * keyboard.c (adjust_point_for_property): Adjust the call to
20660 display_prop_intangible_p to its new signature.
20661
20662 * dispextern.h (struct bidi_it): New member frame_window_p.
20663 (bidi_init_it): Update prototypes.
20664 (display_prop_intangible_p): Update prototype.
20665 (compute_display_string_pos, compute_display_string_end):
20666 Declare prototypes.
20667 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20668 EMACS_INT.
20669
20670 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20671
20672 Malloc failure behavior now depends on size of allocation.
20673 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20674 * lisp.h: Change signatures accordingly.
20675 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20676 All callers changed. (Bug#8762)
20677
20678 * gnutls.c: Use Emacs's memory allocators.
20679 Without this change, the gnutls library would invoke malloc etc.
20680 directly, which causes problems on non-SYNC_INPUT hosts, and which
20681 runs afoul of improving memory_full behavior. (Bug#8761)
20682 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20683 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20684 xfree instead of the default malloc, realloc, free.
20685 (Fgnutls_boot): No need to check for memory allocation failure,
20686 since xmalloc does that for us.
20687
20688 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20689 * category.c (hash_get_category_set):
20690 * ccl.c (ccl_driver):
20691 * charset.c (Fdefine_charset_internal):
20692 * charset.h (struct charset.hash_index):
20693 * composite.c (get_composition_id, gstring_lookup_cache)
20694 (composition_gstring_put_cache):
20695 * composite.h (struct composition.hash_index):
20696 * dispextern.h (struct image.hash):
20697 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20698 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20699 (hashfn_equal, hashfn_user_defined, make_hash_table)
20700 (maybe_resize_hash_table, hash_lookup, hash_put)
20701 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20702 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20703 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20704 * image.c (make_image, search_image_cache, lookup_image)
20705 (xpm_put_color_table_h):
20706 * lisp.h (struct Lisp_Hash_Table):
20707 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20708 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20709 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20710 * alloc.c (allocate_vectorlike):
20711 Check for overflow in vector size calculations.
20712 * ccl.c (ccl_driver):
20713 Check for overflow when converting EMACS_INT to int.
20714 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20715 need to be updated by these changes.
20716 * fns.c (make_hash_table, maybe_resize_hash_table):
20717 Check for integer overflow with large hash tables.
20718 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20719 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20720 (SXHASH_REDUCE): New macro.
20721 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20722 Use it instead of discarding useful hash info with large hash values.
20723 (sxhash_float): New function.
20724 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20725 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20726 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20727 Rewrite to use FIXNUM_BITS, as this simplifies things.
20728 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20729 Adjust signatures to match updated version of code.
20730 (consing_since_gc): Now EMACS_INT, since a single hash table can
20731 use more than INT_MAX bytes.
20732
20733 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20734
20735 Make it possible to build with GCC-4.6+ -O2 -flto.
20736
20737 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20738
20739 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20740
20741 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20742 Call minibuffer-inactive-mode.
20743
20744 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20745
20746 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20747 Update dependencies.
20748
20749 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20750
20751 * data.c (init_data): Remove code for UTS, this system is not
20752 supported anymore.
20753
20754 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20755
20756 Don't force ./temacs to start in terminal mode.
20757
20758 * frame.c (make_initial_frame): Initialize faces in all cases, not
20759 only when CANNOT_DUMP is defined.
20760 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20761
20762 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20763
20764 * dispnew.c (add_window_display_history): Use const for the string
20765 pointer. Remove declaration, not needed.
20766
20767 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20768
20769 Use 'inline', not 'INLINE'.
20770 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20771 * alloc.c, fontset.c (INLINE): Remove.
20772 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20773 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20774 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20775 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20776 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20777
20778 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20779
20780 Make it possible to run ./temacs.
20781
20782 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20783 syms_of_callproc does the same thing. Remove test for
20784 "initialized", do it in the caller.
20785 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20786
20787 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20788
20789 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20790 (read_minibuf): Use get_minibuffer.
20791 (syms_of_minibuf): Use DEFSYM.
20792 (Qmetadata): New var.
20793 * data.c (Qbuffer): Don't make it static.
20794 (syms_of_data): Use DEFSYM.
20795
20796 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20797
20798 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20799 (CCL_CODE_MIN): New macro.
20800
20801 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20802
20803 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20804
20805 * eval.c (Qdebug): Now static.
20806 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20807 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20808 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20809
20810 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20811
20812 * image.c: Various fixes to ImageMagick code comments.
20813 (Fimagemagick_types): Doc fix.
20814
20815 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20816
20817 Minor fixes prompted by GCC 4.6.0 warnings.
20818
20819 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20820
20821 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20822 (x_clipboard_manager_save_all): Move extern decl to ...
20823 * xterm.h: ... here, so that it can be checked for consistency.
20824
20825 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20826
20827 * xselect.c (x_clipboard_manager_save_frame)
20828 (x_clipboard_manager_save_all): New functions.
20829 (Fx_clipboard_manager_save): Lisp function deleted.
20830
20831 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20832 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20833
20834 * xterm.h: Update prototype.
20835
20836 2011-05-28 William Xu <william.xwl@gmail.com>
20837
20838 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20839 exiting (Bug#8239).
20840
20841 2011-05-28 Jim Meyering <meyering@redhat.com>
20842
20843 Avoid a sign-extension bug in crypto_hash_function.
20844 * fns.c (to_uchar): Define.
20845 (crypto_hash_function): Use it to convert some newly-signed
20846 variables to unsigned, to avoid sign-extension bugs. For example,
20847 without this change, (md5 "truc") would evaluate to
20848 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20849 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20850 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20851
20852 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20853
20854 Integer overflow fixes.
20855
20856 * dbusbind.c: Serial number integer overflow fixes.
20857 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20858 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20859 to hold a serial number that is too large for a fixnum.
20860 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20861 Check for serial numbers out of range. Decode any serial number
20862 that was so large that it became a float. (Bug#8722)
20863
20864 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20865 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20866 Use XFASTINT rather than XUINT when numbers are nonnegative.
20867 (xd_append_arg, Fdbus_method_return_internal):
20868 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20869 arguments, check that Lisp number is nonnegative, rather than
20870 silently wrapping negative numbers around. (Bug#8722)
20871 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20872 (Bug#8722)
20873
20874 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20875
20876 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20877
20878 ccl: Add integer overflow checks.
20879 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20880 (IN_INT_RANGE): New macros.
20881 (ccl_driver): Use them to check for integer overflow when
20882 decoding a CCL program. Many of the new checks are whether XINT (x)
20883 fits in int; it doesn't always, on 64-bit hosts. The new version
20884 doesn't catch all possible integer overflows, but it's an
20885 improvement. (Bug#8719)
20886
20887 * alloc.c (make_event_array): Use XINT, not XUINT.
20888 There's no need for unsigned here.
20889
20890 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20891 This follows up to the 2011-05-06 change that substituted uintptr_t
20892 for EMACS_INT. This case wasn't caught back then.
20893
20894 Rework Fformat to avoid integer overflow issues.
20895 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20896 now (part of C89). Include <verify.h>.
20897 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20898 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20899 (Fformat): Avoid the prepass trying to compute sizes; it was only
20900 approximate and thus did not catch overflow reliably. Instead, walk
20901 through the format just once, formatting and computing sizes as we go,
20902 checking for integer overflow at every step, and allocating a larger
20903 buffer as needed. Keep track separately whether the format is
20904 multibyte. Keep only the most-recently calculated precision, rather
20905 than them all. Record whether each argument has been converted to
20906 string. Use EMACS_INT, not int, for byte and char and arg counts.
20907 Support field widths and precisions larger than INT_MAX. Avoid
20908 sprintf's undefined behavior with conversion specifications such as %#d
20909 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20910 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20911 formatting out-of-range floating point numbers with int
20912 formats. (Bug#8668)
20913
20914 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20915
20916 * data.c: Avoid integer truncation in expressions involving floats.
20917 * data.c: Include <intprops.h>.
20918 (arith_driver): When there's an integer overflow in an expression
20919 involving floating point, convert the integers to floating point
20920 so that the resulting value does not suffer from catastrophic
20921 integer truncation. For example, on a 64-bit host (* 4
20922 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20923 Do not rely on undefined behavior after integer overflow.
20924
20925 merge count_size_as_multibyte, parse_str_to_multibyte
20926 * character.c, character.h (count_size_as_multibyte):
20927 Rename from parse_str_to_multibyte; all uses changed.
20928 Check for integer overflow.
20929 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20930 since it's now a duplicate of the other. This is more of
20931 a character than a buffer op, so better that it's in character.c.
20932 * fns.c, print.c: Adjust to above changes.
20933
20934 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20935
20936 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20937
20938 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20939
20940 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20941 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20942 (x_clipboard_manager_save): Now static.
20943 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20944
20945 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20946 (crypto_hash_function): Now static.
20947 Fix pointer signedness problems. Avoid unnecessary initializations.
20948
20949 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20950
20951 * termhooks.h (Vselection_alist): Make it terminal-local.
20952
20953 * terminal.c (create_terminal): Initialize it.
20954
20955 * xselect.c: Support for clipboard managers.
20956 (Vselection_alist): Move to termhooks.h as terminal-local var.
20957 (LOCAL_SELECTION): New macro.
20958 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20959 (symbol_to_x_atom): Remove gratuitous arg.
20960 (x_handle_selection_request, lisp_data_to_selection_data)
20961 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20962 (x_own_selection, x_get_local_selection, x_convert_selection):
20963 New arg, specifying work frame. Use terminal-local Vselection_alist.
20964 (some_frame_on_display): Delete unused function.
20965 (Fx_own_selection_internal, Fx_get_selection_internal)
20966 (Fx_disown_selection_internal, Fx_selection_owner_p)
20967 (Fx_selection_exists_p): New optional frame arg.
20968 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20969 (x_handle_selection_clear): Don't treat other terminals with the
20970 same keyboard specially. Use the terminal-local Vselection_alist.
20971 (x_clear_frame_selections): Use Frun_hook_with_args.
20972
20973 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20974
20975 * xterm.h: Add support for those atoms.
20976
20977 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20978
20979 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20980 (converted_selections, conversion_fail_tag): New global variables.
20981 (x_selection_request_lisp_error): Free the above.
20982 (x_get_local_selection): Remove unnecessary code.
20983 (x_reply_selection_request): Args changed; handle arbitrary array
20984 of converted selections stored in converted_selections.
20985 Separate the XChangeProperty and SelectionNotify steps.
20986 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20987 (x_convert_selection): New function.
20988 (x_handle_selection_event): Simplify.
20989 (x_get_foreign_selection): Don't ignore incoming requests while
20990 waiting for an answer; this will fail when we implement
20991 SAVE_TARGETS, and seems unnecessary anyway.
20992 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20993 (Vx_sent_selection_functions): Doc fix.
20994
20995 2011-05-26 Leo Liu <sdl.web@gmail.com>
20996
20997 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20998
20999 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21000
21001 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21002
21003 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21004 for fringe update if it has periodic bitmap.
21005 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21006 and fringe_bitmap_periodic_p.
21007
21008 * fringe.c (get_fringe_bitmap_data): New function.
21009 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21010 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21011 row. Mark glyph row for fringe update if periodicity changed.
21012
21013 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21014 for fringe update unless it has periodic bitmap.
21015
21016 2011-05-25 Kenichi Handa <handa@m17n.org>
21017
21018 * xdisp.c (get_next_display_element): Set correct it->face_id for
21019 a static composition.
21020
21021 2011-05-24 Leo Liu <sdl.web@gmail.com>
21022
21023 * deps.mk (fns.o):
21024 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21025
21026 * fns.c (crypto_hash_function, Fsha1): New function.
21027 (Fmd5): Use crypto_hash_function.
21028 (syms_of_fns): Add Ssha1.
21029
21030 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21031
21032 * gnutls.c: Remove unused macros.
21033 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21034 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21035 Remove macros that are defined and never used.
21036 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21037
21038 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21039
21040 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21041 (Fx_get_selection_internal): Minor cleanup.
21042 (Fx_own_selection_internal): Rename arguments for consistency with
21043 select.el.
21044
21045 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21046
21047 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21048
21049 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
21050
21051 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21052
21053 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21054
21055 * dispnew.c (scrolling_window): Don't exclude the case that the
21056 last enabled row in the desired matrix touches the bottom boundary.
21057
21058 2011-05-21 Glenn Morris <rgm@gnu.org>
21059
21060 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21061 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21062 and add some more files.
21063
21064 2011-05-20 Eli Zaretskii <eliz@gnu.org>
21065
21066 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21067 report_file_error introduced by the change from 2011-05-07.
21068
21069 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21070
21071 * systime.h (Time): Define only if emacs is defined.
21072 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21073 where the include path doesn't have X11/X.h by default. See
21074 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21075
21076 2011-05-20 Kenichi Handa <handa@m17n.org>
21077
21078 * composite.c (find_automatic_composition): Fix previous change.
21079
21080 2011-05-20 Glenn Morris <rgm@gnu.org>
21081
21082 * lisp.mk: New file, split from Makefile.in.
21083 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21084 (shortlisp): Remove.
21085 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21086
21087 2011-05-19 Glenn Morris <rgm@gnu.org>
21088
21089 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21090 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21091 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21092 (lisp): Set the order to that of loadup.el.
21093 (shortlisp): Make it a copy of $lisp.
21094 (SOME_MACHINE_LISP): Remove.
21095 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21096 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21097
21098 2011-05-18 Kenichi Handa <handa@m17n.org>
21099
21100 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21101 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21102 (find_automatic_composition): Mostly rewrite for efficiency.
21103
21104 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
21105
21106 * makefile.w32-in: Update dependencies.
21107
21108 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21109
21110 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21111 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21112
21113 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21114
21115 Fix some integer overflow issues, such as string length overflow.
21116
21117 * insdel.c (count_size_as_multibyte): Check for string overflow.
21118
21119 * character.c (lisp_string_width): Check for string overflow.
21120 Use EMACS_INT, not int, for string indexes and lengths; in
21121 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21122 the resulting string length overflows an EMACS_INT; instead,
21123 report a string overflow if no precision given. When checking for
21124 precision exhaustion, use a check that cannot possibly have
21125 integer overflow. (Bug#8675)
21126 * character.h (lisp_string_width): Adjust to new signature.
21127
21128 * alloc.c (string_overflow): New function.
21129 (Fmake_string): Use it. This doesn't change behavior, but saves
21130 a few bytes and will simplify future changes.
21131 * character.c (string_escape_byte8): Likewise.
21132 * lisp.h (string_overflow): New decl.
21133
21134 Fixups, following up to the user-interface timestamp change.
21135 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21136 for UI timestamps, instead of unsigned long.
21137 * msdos.c (mouse_get_pos): Likewise.
21138 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21139 * w32gui.h (Time): Define by including "systime.h" rather than by
21140 declaring it ourselves. (Bug#8664)
21141
21142 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21143 * image.c (clear_image_cache): Likewise.
21144
21145 * term.c (term_mouse_position): Don't assume time_t wraparound.
21146
21147 Be more systematic about user-interface timestamps.
21148 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21149 and sometimes 'EMACS_UINT', to represent these timestamps.
21150 This change causes it to use 'Time' uniformly, as that's what X uses.
21151 This makes the code easier to follow, and makes it easier to catch
21152 integer overflow bugs such as Bug#8664.
21153 * frame.c (Fmouse_position, Fmouse_pixel_position):
21154 Use Time, not unsigned long, for user-interface timestamps.
21155 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21156 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21157 * keyboard.h (last_event_timestamp): Likewise.
21158 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21159 * menu.h (xmenu_show): Likewise.
21160 * term.c (term_mouse_position): Likewise.
21161 * termhooks.h (struct input_event.timestamp): Likewise.
21162 (struct terminal.mouse_position_hook): Likewise.
21163 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21164 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21165 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21166 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21167 what it was before.
21168 * menu.h, termhooks.h: Include "systime.h", for Time.
21169
21170 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21171 Don't assume that the difference between two unsigned long values
21172 can fit into an integer. At this point, we know button_down_time
21173 <= event->timestamp, so the difference must be nonnegative, so
21174 there's no need to cast the result if double-click-time is
21175 nonnegative, as it should be; check that it's nonnegative, just in
21176 case. This bug is triggered when events are more than 2**31 ms
21177 apart (about 25 days). (Bug#8664)
21178
21179 * xselect.c (last_event_timestamp): Remove duplicate decl.
21180 (x_own_selection): Remove needless cast to unsigned long.
21181
21182 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21183 that always fit in int. Use a sentinel instead of a counter, to
21184 avoid a temp and to allay GCC's concerns about possible int overflow.
21185 * frame.h (struct frame): Use int for menu_bar_items_used
21186 instead of EMACS_INT, since it always fits in int.
21187
21188 * menu.c (grow_menu_items): Check for int overflow.
21189
21190 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21191
21192 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21193 Before, the code was not consistent. These values cannot exceed
21194 2**31 - 1 so there's no need to make them unsigned.
21195 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21196 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21197 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21198 as modifiers.
21199 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21200
21201 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21202 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21203 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21204 presumably because the widths might not match.
21205
21206 * window.c (size_window): Avoid needless test at loop start.
21207
21208 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21209
21210 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21211
21212 2011-05-12 Drew Adams <drew.adams@oracle.com>
21213
21214 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21215
21216 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21217
21218 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21219 `width' to `bar_area_x' and `bar_area_width', respectively.
21220 (x_scroll_run): Take account of fringe background extension.
21221
21222 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21223 Rename local vars `left' and `width' to `bar_area_x' and
21224 `bar_area_width', respectively.
21225 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21226 background extension.
21227
21228 2011-05-10 Jim Meyering <meyering@redhat.com>
21229
21230 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21231
21232 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21233
21234 * image.c (Finit_image_library): Return t for built-in image types,
21235 like pbm and xbm. (Bug#8640)
21236
21237 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21238
21239 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21240
21241 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21242
21243 * w32console.c (Fset_screen_color): Doc fix.
21244 (Fget_screen_color): New function.
21245 (syms_of_ntterm): Defsubr it.
21246
21247 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21248 unlink the temporary file if Fcall_process didn't create it in the
21249 first place.
21250 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21251 child process will be redirected to a file specified with `:file'.
21252 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21253 cue to call_process_cleanup not to close that handle.
21254
21255 2011-05-07 Ben Key <bkey76@gmail.com>
21256
21257 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21258 one of two shell specific rules, either bootstrap-temacs-CMD or
21259 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21260 to the previous implementation of the bootstrap-temacs rule.
21261 The bootstrap-temacs-CMD rule is similar to the previous
21262 implementation of the bootstrap-temacs rule except that it
21263 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21264 variable.
21265
21266 These changes, along with some changes to nt/configure.bat,
21267 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21268 earlier fix to add support for --cflags and --ldflags options
21269 that include quotes so that it works whether make uses cmd or
21270 sh as the shell.
21271
21272 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21273
21274 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21275 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21276 is a constant.
21277 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21278 a string. Handle both cases.
21279 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21280 (Fdbus_register_method): Use Qinvalid_function.
21281
21282 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21283
21284 * makefile.w32-in: Update dependencies.
21285 (LISP_H): Add inttypes.h and stdin.h.
21286 (PROCESS_H): Add unistd.h.
21287
21288 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21289
21290 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21291 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21292
21293 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21294
21295 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21296
21297 * term.c (vfatal): Remove stray call to va_end.
21298 It's not needed and the C Standard doesn't allow it here anyway.
21299
21300 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21301 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21302
21303 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21304 bytes.
21305
21306 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21307
21308 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21309
21310 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21311
21312 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21313
21314 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21315
21316 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21317 * charset.c (Fdefine_charset_internal): Don't initialize
21318 charset.code_space[15]. The value was garbage, on hosts with
21319 32-bit int (Bug#8600).
21320
21321 * lread.c (read_integer): Be more consistent with string-to-number.
21322 Use string_to_number to do the actual conversion; this avoids
21323 rounding errors and fixes some other screwups. Without this fix,
21324 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21325 (digit_to_number): Move earlier, for benefit of read_integer.
21326 Return -1 if the digit is out of range for the base, -2 if it is
21327 not a digit in any supported base. (Bug#8602)
21328
21329 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21330
21331 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21332 to match comment at start of function. This also removes a
21333 GCC warning about overflow in a 32+64-bit port.
21334
21335 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21336
21337 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21338 Reported by Stefan Monnier in
21339 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21340 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21341 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21342
21343 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21344 (EMACS_UINTPTR): Likewise, with uintptr_t.
21345
21346 * lisp.h: Prefer 64-bit EMACS_INT if available.
21347 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21348 on 32-bit hosts that have 64-bit int, so that they can access
21349 large files.
21350 However, temporarily disable this change unless the temporary
21351 symbol WIDE_EMACS_INT is defined.
21352
21353 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21354
21355 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21356 This removes an assumption that EMACS_INT and long are the same
21357 width as pointers. The assumption is true for Emacs porting targets
21358 now, but we want to make other targets possible.
21359 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21360 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21361 In the rest of the code, change types of integers that hold casted
21362 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21363 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21364 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21365 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21366 No need to cast type when ORing.
21367 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21368 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21369 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21370 assume EMACS_INT is the same width as char *.
21371 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21372 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21373 Remove no-longer-needed casts.
21374 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21375 (xg_tool_bar_help_callback, xg_make_tool_item):
21376 Use EMACS_INTPTR to hold an integer
21377 that will be cast to void *; this can avoid a GCC warning
21378 if EMACS_INT is not the same width as void *.
21379 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21380 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21381 (current_message_1, set_message_1):
21382 Use a local to convert to proper width without a cast.
21383 * xmenu.c (dialog_selection_callback): Likewise.
21384
21385 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21386 Also, don't assume VALBITS / RAND_BITS is less than 5,
21387 and don't rely on undefined behavior when shifting a 1 left into
21388 the sign bit.
21389 * lisp.h (get_random): Change signature to match.
21390
21391 * lread.c (hash_string): Use size_t, not int, for hash computation.
21392 Normally we prefer signed values; but hashing is special, because
21393 it's better to use unsigned division on hash table sizes so that
21394 the remainder is nonnegative. Also, size_t is the natural width
21395 for hashing into memory. The previous code used 'int', which doesn't
21396 retain enough info to hash well into very large tables.
21397 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21398
21399 * dbusbind.c: Don't possibly lose pointer info when converting.
21400 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21401 Use XPNTR rather than XHASH, so that the high-order bits of
21402 the pointer aren't lost when converting through void *.
21403
21404 * eval.c (Fautoload): Don't double-shift a pointer.
21405
21406 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21407
21408 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21409
21410 * gnutls.c (DEF_GNUTLS_FN):
21411 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21412
21413 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21414
21415 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21416 marker. (Bug#8610)
21417
21418 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21419
21420 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21421 New version that can reserve upto 2GB of heap space.
21422
21423 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21424
21425 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21426
21427 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21428
21429 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21430 `gnutls_certificate_set_x509_key_file'.
21431
21432 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21433
21434 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21435 Update dependencies.
21436
21437 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21438
21439 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21440 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21441 Remove unused parameter `fildes'.
21442 * process.c (read_process_output, send_process): Don't pass it.
21443
21444 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21445
21446 Fix previous change: the library cache is defined in w32.c.
21447 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21448 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21449
21450 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21451
21452 Implement dynamic loading of GnuTLS on Windows.
21453
21454 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21455 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21456 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21457 Declare.
21458
21459 * gnutls.c (Qgnutls_dll): Define.
21460 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21461 (gnutls_*): Declare function pointers.
21462 (init_gnutls_functions): New function to initialize function pointers.
21463 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21464 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21465 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21466 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21467 (emacs_gnutls_write, emacs_gnutls_read)
21468 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21469 (Fgnutls_available_p): New function.
21470 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21471 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21472 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21473
21474 * image.c: Include w32.h.
21475 (Vimage_type_cache): Delete.
21476 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21477 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21478 (w32_delayed_load): Move to w32.c.
21479
21480 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21481
21482 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21483 (w32_delayed_load): Move from image.c. When loading a library, record
21484 its filename in the :loaded-from property of the library id.
21485 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21486 Initialize and staticpro them.
21487 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21488
21489 * process.c: Include lisp.h before w32.h, not after.
21490 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21491 instead of gnutls_record_check_pending.
21492
21493 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21494
21495 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21496
21497 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21498 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21499 as passed in.
21500
21501 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21502
21503 * xterm.c (x_set_frame_alpha): Do not set property on anything
21504 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21505
21506 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21507
21508 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21509
21510 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21511
21512 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21513 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21514 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21515 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21516 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21517 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21518 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21519 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21520 (Qgnutls_bootprop_callbacks_verify): Make static.
21521
21522 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21523
21524 * callproc.c: Indentation fixup.
21525
21526 * sysdep.c (wait_for_termination_1): Make static.
21527 (wait_for_termination, interruptible_wait_for_termination):
21528 Move after wait_for_termination_1.
21529
21530 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21531
21532 * sysdep.c (interruptible_wait_for_termination): New function
21533 which is like wait_for_termination, but allows keyboard
21534 interruptions.
21535
21536 * callproc.c (Fcall_process): Add (:file "file") as an option for
21537 the STDOUT buffer.
21538 (Fcall_process_region): Ditto.
21539
21540 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21541
21542 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21543 rather than `XVECTOR (FOO)->size'.
21544
21545 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21546 inttypes.h, as a gnulib replacement is used if it not available in
21547 system headers.
21548
21549 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21550
21551 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21552 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21553 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21554
21555 * coding.c (coding_alloc_by_realloc): Error out if destination
21556 will grow beyond MOST_POSITIVE_FIXNUM.
21557 (decode_coding_emacs_mule): Abort if there isn't enough place in
21558 charbuf for the composition carryover bytes. Reserve an extra
21559 space for up to 2 characters produced in a loop.
21560 (decode_coding_iso_2022): Abort if there isn't enough place in
21561 charbuf for the composition carryover bytes.
21562
21563 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21564
21565 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21566 aborting when %lld or %lll format is passed.
21567 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21568 %llo or %llx format is passed. (Bug#8545)
21569
21570 * window.c (window_scroll_line_based): Use a marker instead of
21571 simple variables to record original value of point. (Bug#7952)
21572
21573 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21574 produced by %s or %c overflows available buffer space. (Bug#8545)
21575
21576 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21577
21578 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21579 (SIZE_MAX): Move defn after all includes, as they might #define it.
21580
21581 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21582
21583 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21584
21585 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21586
21587 * keyboard.c (Qdelayed_warnings_hook): Define.
21588 (command_loop_1): Run `delayed-warnings-hook'
21589 if Vdelayed_warnings_list is non-nil.
21590 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21591 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21592
21593 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21594
21595 * doprnt.c (doprnt): Don't return value smaller than the buffer
21596 size if the message was truncated. (Bug#8545).
21597
21598 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21599
21600 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21601 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21602
21603 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21604
21605 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21606
21607 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21608
21609 * makefile.w32-in: Update dependencies.
21610
21611 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21612
21613 Improve `doprnt' and its usage. (Bug#8545)
21614 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21615 `format_end'. Remove support for %l as a conversion specifier.
21616 Don't use xrealloc. Improve diagnostics when the %l size modifier
21617 is used. Update the commentary.
21618
21619 * eval.c (verror): Simplify calculation of size_t.
21620
21621 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21622 messages.
21623
21624 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21625
21626 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21627 change.
21628
21629 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21630
21631 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21632 This makes this file independent of the recent pseudovector change.
21633
21634 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21635
21636 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21637
21638 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21639 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21640 Remove unused local.
21641 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21642
21643 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21644 GCC 4.6.0 optimizes based on type-based alias analysis.
21645 For example, if b is of type struct buffer * and v of type struct
21646 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21647 != &v->size, and therefore "v->size = 1; b->size = 2; return
21648 v->size;" must therefore return 1. This assumption is incorrect
21649 for Emacs, since it type-puns struct Lisp_Vector * with many other
21650 types. To fix this problem, this patch adds a new type struct
21651 vectorlike_header that documents the constraints on layout of vectors
21652 and pseudovectors, and helps optimizing compilers not get fooled
21653 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21654 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21655 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21656 the size member.
21657 (XSETPVECTYPE): Rewrite in terms of new macro.
21658 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21659 This is a bit clearer, and further avoids the possibility of
21660 undesirable aliasing.
21661 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21662 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21663 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21664 since Lisp_Subr is a special case (no "next" field).
21665 (ASIZE): Now uses header.size rather than size.
21666 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21667 to avoid the hassle of writing XVECTOR (foo)->header.size.
21668 (struct vectorlike_header): New type.
21669 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21670 object, to help avoid aliasing.
21671 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21672 (SUBRP): Likewise, since Lisp_Subr is a special case.
21673 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21674 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21675 (struct Lisp_Hash_Table): Combine first two members into a single
21676 struct vectorlike_header member. All uses of "size" and "next" members
21677 changed to be "header.size" and "header.next".
21678 * buffer.h (struct buffer): Likewise.
21679 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21680 * frame.h (struct frame): Likewise.
21681 * process.h (struct Lisp_Process): Likewise.
21682 * termhooks.h (struct terminal): Likewise.
21683 * window.c (struct save_window_data, struct saved_window): Likewise.
21684 * window.h (struct window): Likewise.
21685 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21686 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21687 * buffer.c (init_buffer_once): Likewise.
21688 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21689 special case.
21690 * process.c (Fformat_network_address): Use local var for size,
21691 for brevity.
21692
21693 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21694
21695 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21696 * data.c (atof): Remove decl; no longer used or needed.
21697 (digit_to_number): Move to lread.c.
21698 (Fstring_to_number): Use new string_to_number function, to be
21699 consistent with how the Lisp reader treats infinities and NaNs.
21700 Do not assume that floating-point numbers represent EMACS_INT
21701 without losing information; this is not true on most 64-bit hosts.
21702 Avoid double-rounding errors, by insisting on integers when
21703 parsing non-base-10 numbers, as the documentation specifies.
21704 * lisp.h (string_to_number): New decl, replacing ...
21705 (isfloat_string): Remove.
21706 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21707 (read1): Do not accept +. and -. as integers; this
21708 appears to have been a coding error. Similarly, do not accept
21709 strings like +-1e0 as floating point numbers. Do not report
21710 overflow for integer overflows unless the base is not 10 which
21711 means we have no simple and reliable way to continue.
21712 Break out the floating-point parsing into a new
21713 function string_to_number, so that Fstring_to_number parses
21714 floating point numbers consistently with the Lisp reader.
21715 (digit_to_number): Move here from data.c. Make it static inline.
21716 (E_CHAR, EXP_INT): Remove, replacing with ...
21717 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21718 (string_to_number): New function, replacing isfloat_string.
21719 This function checks for valid syntax and produces the resulting
21720 Lisp float number too. Rework it so that string-to-number
21721 no longer mishandles examples like "1.0e+". Use strtoumax,
21722 so that overflow for non-base-10 numbers is reported only when
21723 there's no portable and simple way to convert to floating point.
21724
21725 * textprop.c (set_text_properties_1): Rewrite for clarity,
21726 and to avoid GCC warning about integer overflow.
21727
21728 * intervals.h (struct interval): Use EMACS_INT for members
21729 where EMACS_UINT might cause problems. See
21730 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21731 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21732 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21733 All uses changed.
21734 (offset_intervals): Tell GCC not to worry about length overflow
21735 when negating a negative length.
21736
21737 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21738 (overrun_check_free): Likewise.
21739
21740 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21741 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21742 word size.
21743
21744 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21745 (gnutls_make_error): Rename local to avoid shadowing.
21746 (gnutls_emacs_global_deinit): ifdef out; not used.
21747 (Fgnutls_boot): Use const for pointer to readonly storage.
21748 Comment out unused local. Fix pointer signedness problems.
21749
21750 * lread.c (openp): Don't stuff size_t into an 'int'.
21751 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21752 about possible signed overflow.
21753
21754 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21755 (GDK_KEY_g): Don't define if already defined.
21756 (xg_prepare_tooltip): Avoid pointer signedness problem.
21757 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21758
21759 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21760 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21761
21762 * xfns.c (Fx_window_property): Simplify a bit,
21763 to make a bit faster and to avoid GCC 4.6.0 warning.
21764 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21765
21766 * fns.c (internal_equal): Don't assume size_t fits in int.
21767
21768 * alloc.c (compact_small_strings): Tighten assertion a little.
21769
21770 Replace pEd with more-general pI, and fix some printf arg casts.
21771 * lisp.h (pI): New macro, generalizing old pEd macro to other
21772 conversion specifiers. For example, use "...%"pI"d..." rather
21773 than "...%"pEd"...".
21774 (pEd): Remove. All uses replaced with similar uses of pI.
21775 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21776 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21777 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21778 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21779 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21780 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21781 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21782 64-bit hosts.
21783 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21784 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21785 * print.c (safe_debug_print, print_object): Likewise.
21786 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21787 to int.
21788 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21789 avoiding the 0 flag, which is not portable.
21790 * process.c (Fmake_network_process): Use pI to avoid cast.
21791 * region-cache.c (pp_cache): Likewise.
21792 * xdisp.c (decode_mode_spec): Likewise.
21793 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21794 behavior on 64-bit hosts with printf arg.
21795 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21796 (x_stop_queuing_selection_requests): Likewise.
21797 (x_get_window_property): Don't truncate byte count to an 'int'
21798 when tracing.
21799
21800 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21801 here, since it parses constructs like leading '-' and spaces,
21802 which are not wanted; and it overflows with large numbers.
21803 Instead, simply match F[0-9]+, which is what is wanted anyway.
21804
21805 * alloc.c: Remove unportable assumptions about struct layout.
21806 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21807 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21808 (allocate_vectorlike, make_pure_vector): Use the new macros,
21809 plus offsetof, to remove unportable assumptions about struct layout.
21810 These assumptions hold on all porting targets that I know of, but
21811 they are not guaranteed, they're easy to remove, and removing them
21812 makes further changes easier.
21813
21814 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21815 This doesn't fix a bug but makes the code clearer.
21816 (string_overrun_cookie): Now const. Use initializers that
21817 don't formally overflow signed char, to avoid warnings.
21818 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21819 can cause Emacs to crash when string overrun checking is enabled.
21820 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21821 multiple of sizeof (EMACS_INT); it need not be, if
21822 alignof(EMACS_INT) < sizeof (EMACS_INT).
21823 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21824
21825 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21826
21827 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21828
21829 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21830
21831 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21832 supposed to be handshaking. (Bug#8556)
21833 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21834
21835 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21836
21837 * lisp.h (Qdebug): List symbol.
21838 * eval.c (Qdebug): Restore global linkage.
21839 * keyboard.c (debug-on-event): New variable.
21840 (handle_user_signal): Break into debugger when debug-on-event
21841 matches the current signal symbol.
21842
21843 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21844
21845 * alloc.c (check_sblock, check_string_bytes)
21846 (check_string_free_list): Convert to standard C.
21847
21848 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21849
21850 * w32.c (emacs_gnutls_push): Fix typo.
21851
21852 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21853
21854 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21855 "cast to pointer from integer of different size".
21856
21857 Improve doprnt and its use in verror. (Bug#8545)
21858 * doprnt.c (doprnt): Document the set of format control sequences
21859 supported by the function. Use SAFE_ALLOCA instead of always
21860 using `alloca'.
21861
21862 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21863 is one byte too soon. Don't use xrealloc; instead xfree and
21864 xmalloc anew.
21865
21866 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21867
21868 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21869 callbacks stage.
21870
21871 * gnutls.c: Renamed global_initialized to
21872 gnutls_global_initialized. Added internals for the
21873 :verify-hostname-error, :verify-error, and :verify-flags
21874 parameters of `gnutls-boot' and documented those parameters in the
21875 docstring. Start callback support.
21876 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21877 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21878 on error. Return error code.
21879 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21880 (emacs_gnutls_read): Likewise.
21881 (Fgnutls_boot): Return handshake error code.
21882 (emacs_gnutls_handle_error): New function.
21883 (wsaerror_to_errno): Likewise.
21884
21885 * w32.h (emacs_gnutls_pull): Add prototype.
21886 (emacs_gnutls_push): Likewise.
21887
21888 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21889 (emacs_gnutls_push): Likewise.
21890
21891 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21892
21893 * process.c (wait_reading_process_output): Check if GnuTLS
21894 buffered some data internally if no FDs are set for TLS
21895 connections.
21896
21897 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21898 (LIBS): Link to USER_LIBS.
21899 ($(BLD)/gnutls.$(0)): New target.
21900
21901 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21902
21903 * xdisp.c (handle_single_display_spec): Rename the
21904 display_replaced_before_p argument into display_replaced_p, to
21905 make it consistent with the commentary. Fix typos in the
21906 commentary.
21907
21908 * textprop.c (syms_of_textprop): Remove dead code.
21909 (copy_text_properties): Delete obsolete commentary about an
21910 interface that was deleted long ago. Fix typos in the description
21911 of arguments.
21912
21913 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21914 to changes in oldXMenu/XMenu.h from 2011-04-16.
21915 <menu_help_message, prev_menu_help_message>: Constify.
21916 (IT_menu_make_room): menu->help_text is now `const char **';
21917 adjust.
21918
21919 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21920 to changes in oldXMenu/XMenu.h from 2011-04-16.
21921 (struct XMenu): Declare `help_text' `const char **'.
21922
21923 * xfaces.c <Qunspecified>: Make extern again.
21924
21925 * syntax.c: Include sys/types.h before including regex.h, as
21926 required by POSIX.
21927
21928 * doc.c (get_doc_string): Improve the format passed to `error'.
21929
21930 * doprnt.c (doprnt): Improve commentary.
21931
21932 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21933
21934 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21935 them with etags.
21936
21937 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21938 changes in globals.h immediately force recompilation.
21939 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21940 $(CURDIR)/s/ms-w32.h.
21941 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21942
21943 * character.c (Fchar_direction): Function deleted.
21944 (syms_of_character): Don't defsubr it.
21945 <char-direction-table>: Deleted.
21946
21947 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21948
21949 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21950 * doprnt.c: Include limits.h.
21951 (SIZE_MAX): New macro.
21952 (doprnt): Return a size_t value. 2nd arg is now size_t.
21953 Many local variables are now size_t instead of int or unsigned.
21954 Improve overflow protection. Support `l' modifier for integer
21955 conversions. Support %l conversion. Don't assume an EMACS_INT
21956 argument for integer conversions and for %c.
21957
21958 * lisp.h (doprnt): Restore prototype.
21959
21960 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21961 $(SRC)/character.h.
21962
21963 * Makefile.in (base_obj): Add back doprnt.o.
21964
21965 * deps.mk (doprnt.o): Add back prerequisites.
21966 (callint.o): Depend on character.h.
21967
21968 * eval.c (internal_lisp_condition_case): Include the handler
21969 representation in the error message.
21970 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21971 when breaking from the loop.
21972
21973 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21974
21975 * callint.c (Fcall_interactively): When displaying error message
21976 about invalid control letter, pass the character's codepoint, not
21977 a pointer to its multibyte form. Improve display of the character
21978 in octal and display also its hex code.
21979
21980 * character.c (char_string): Use %x to display the (unsigned)
21981 codepoint of an invalid character, to avoid displaying a bogus
21982 negative value.
21983
21984 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21985 `error', not SYMBOL_NAME itself.
21986
21987 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21988 character arguments to `error'.
21989
21990 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21991 to `error' in error message about FINAL_CHAR argument. Make sure
21992 FINAL_CHAR is a character, and use %c when it is passed as
21993 argument to `error'.
21994
21995 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21996
21997 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21998
21999 * w32.c: Include <time.h>.
22000 (sys_localtime): New function.
22001
22002 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
22003
22004 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22005
22006 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22007
22008 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22009
22010 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22011 zombies (Bug#8467).
22012
22013 2011-04-19 Eli Zaretskii <eliz@gnu.org>
22014
22015 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22016 gl_state.e_property when gl_state.object is Qt.
22017
22018 * insdel.c (make_gap_larger): Remove limitation of buffer size
22019 to <= INT_MAX.
22020
22021 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
22022
22023 * xdisp.c (lookup_glyphless_char_display)
22024 (produce_glyphless_glyph): Handle cons cell entry in
22025 glyphless-char-display.
22026 (Vglyphless_char_display): Document it.
22027
22028 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22029 glyphless-char-display.
22030
22031 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
22032
22033 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22034
22035 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22036
22037 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22038 definition for no-X builds.
22039
22040 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22041
22042 Static checks with GCC 4.6.0 and non-default toolkits.
22043
22044 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22045
22046 * process.c (keyboard_bit_set): Define only if SIGIO.
22047 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22048 (send_process): Repair possible setjmp clobbering.
22049
22050 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22051
22052 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22053
22054 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22055
22056 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22057 Define only if needed.
22058
22059 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22060 by pacifying GCC about it. Maybe it's time to retire it?
22061 * xfaces.c (USG, __TIMEVAL__): Likewise.
22062
22063 * dispextern.h (struct redisplay_interface): Rename param
22064 to avoid shadowing.
22065 * termhooks.h (struct terminal): Likewise.
22066 * xterm.c (xembed_send_message): Likewise.
22067
22068 * insdel.c (make_gap_smaller): Define only if
22069 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22070
22071 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22072 it.
22073
22074 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22075 so that we aren't warned about unused symbols.
22076
22077 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22078
22079 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22080
22081 * xfns.c (x_real_positions): Mark locals as initialized.
22082
22083 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22084
22085 * xterm.c: Fix problems found by static analysis with other toolkits.
22086 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22087 (x_dispatch_event): Declare static if USE_GTK, and
22088 define if USE_GTK || USE_X_TOOLKIT.
22089 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22090 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22091 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22092 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22093
22094 * xmenu.c (menu_help_callback): Pointer type fixes.
22095 Use const pointers when pointing at readonly data. Avoid pointer
22096 signedness clashes.
22097 (FALSE): Remove unused macro.
22098 (update_frame_menubar): Remove unused decl.
22099
22100 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22101
22102 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22103 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22104 (single_menu_item): Rename local to avoid shadowing.
22105
22106 * keyboard.c (make_lispy_event): Remove unused local var.
22107
22108 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22109 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22110
22111 * bitmaps: Change bitmaps from unsigned char back to the X11
22112 compatible char. Avoid the old compiler warnings about
22113 out-of-range initializers by using, for example, '\xab' rather
22114 than 0xab.
22115
22116 * xgselect.c (xgselect_initialize): Check vs interface
22117 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22118
22119 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22120
22121 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22122 to read-only memory.
22123
22124 * fns.c (vector): Remove; this old hack is no longer needed.
22125
22126 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22127 Remove unused var.
22128 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22129
22130 * xrdb.c (x_load_resources): Omit unused local.
22131
22132 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22133 (x_window): Rename locals to avoid shadowing.
22134 (USG): Use the kludged USG macro, to pacify gcc.
22135
22136 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22137 (x_term_init): Remove local to avoid shadowing.
22138
22139 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22140
22141 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22142 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22143
22144 2011-04-16 Eli Zaretskii <eliz@gnu.org>
22145
22146 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22147
22148 Fix regex.c, syntax.c and friends for buffers > 2GB.
22149 * syntax.h (struct gl_state_s): Declare character position members
22150 EMACS_INT.
22151
22152 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22153
22154 * textprop.c (verify_interval_modification, interval_of):
22155 Declare arguments EMACS_INT.
22156
22157 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22158 EMACS_INT.
22159
22160 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22161
22162 * indent.c (Fvertical_motion): Local variable it_start is now
22163 EMACS_INT.
22164
22165 * regex.c (re_match, re_match_2, re_match_2_internal)
22166 (bcmp_translate, regcomp, regexec, print_double_string)
22167 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22168 (re_compile_pattern, re_exec): Declare arguments and local
22169 variables `size_t' and `ssize_t' and return values `regoff_t', as
22170 appropriate.
22171 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22172 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22173 <compile_stack_type>: `size' and `avail' are now `size_t'.
22174
22175 * regex.h <regoff_t>: Use ssize_t, not int.
22176 (re_search, re_search_2, re_match, re_match_2): Arguments that
22177 specify buffer/string position and length are now ssize_t and
22178 size_t. Return type is regoff_t.
22179
22180 2011-04-16 Ben Key <bkey76@gmail.com>
22181
22182 * nsfont.m: Fixed bugs in ns_get_family and
22183 ns_descriptor_to_entity that were caused by using free to
22184 deallocate memory blocks that were allocated by xmalloc (via
22185 xstrdup). This caused Emacs to crash when compiled with
22186 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22187 --enable-checking=xmallocoverrun). xfree is now used to
22188 deallocate these memory blocks.
22189
22190 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22191
22192 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22193
22194 emacs_write: Accept and return EMACS_INT for sizes.
22195 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22196 et seq.
22197 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22198 Accept and return EMACS_INT.
22199 (emacs_gnutls_write): Return the number of bytes written on
22200 partial writes.
22201 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22202 (emacs_read, emacs_write): Remove check for negative size, as the
22203 Emacs source code has been audited now.
22204 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22205 (emacs_read, emacs_write): Use it.
22206 * process.c (send_process): Adjust to the new signatures of
22207 emacs_write and emacs_gnutls_write. Do not attempt to store
22208 a byte offset into an 'int'; it might overflow.
22209 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22210
22211 * sound.c: Don't assume sizes fit in 'int'.
22212 (struct sound_device.period_size, alsa_period_size):
22213 Return EMACS_INT, not int.
22214 (struct sound_device.write, vox_write, alsa_write):
22215 Accept EMACS_INT, not int.
22216 (wav_play, au_play): Use EMACS_INT to store sizes and to
22217 record read return values.
22218
22219 2011-04-15 Ben Key <bkey76@gmail.com>
22220
22221 * keyboard.c (Qundefined): Don't declare static since it is used
22222 in nsfns.m.
22223 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22224 static since they are used in nsfont.m.
22225
22226 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22227
22228 * process.c (Qprocessp): Don't declare static.
22229 * lisp.h (Qprocessp): Declare again.
22230
22231 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22232
22233 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22234
22235 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22236
22237 Improve C-level modularity by making more things 'static'.
22238
22239 Don't publish debugger-only interfaces to other modules.
22240 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22241 (verify_bytepos, count_markers): Move decls to the only modules
22242 that need them.
22243 * region-cache.h (pp_cache): Likewise.
22244 * window.h (check_all_windows): Likewise.
22245 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22246
22247 * sysdep.c (croak): Now static, if
22248 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22249 * syssignal.h (croak): Declare only if not static.
22250
22251 * alloc.c (refill_memory_reserve): Now static if
22252 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22253 * lisp.h (refill_memory_reserve): Declare only if not static.
22254
22255 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22256 Define only if USE_LUCID.
22257
22258 * xrdb.c (x_customization_string, x_rm_string): Now static.
22259
22260 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22261 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22262
22263 * xdisp.c (draw_row_with_mouse_face): Now static.
22264 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22265
22266 * window.h (check_all_windows): Mark externally visible.
22267
22268 * window.c (window_deletion_count): Now static.
22269
22270 * undo.c: Make symbols static if they're not exported.
22271 (last_undo_buffer, last_boundary_position, pending_boundary):
22272 Now static.
22273
22274 * textprop.c (interval_insert_behind_hooks): Now static.
22275 (interval_insert_in_front_hooks): Likewise.
22276
22277 * term.c: Make symbols static if they're not exported.
22278 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22279 (max_frame_lines, tty_set_terminal_modes):
22280 (tty_reset_terminal_modes, tty_turn_off_highlight):
22281 (get_tty_terminal): Now static.
22282 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22283 * termhooks.h (term_mouse_moveto): Do not declare if
22284 HAVE_WINDOW_SYSTEM.
22285 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22286 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22287
22288 * sysdep.c: Make symbols static if they're not exported.
22289 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22290 Now static.
22291 (sigprocmask_set, full_mask): Remove; unused.
22292 (wait_debugging): Mark as visible.
22293 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22294 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22295
22296 * syntax.c (syntax_temp): Define only if !__GNUC__.
22297
22298 * sound.c (current_sound_device, current_sound): Now static.
22299
22300 * search.c (searchbufs, searchbuf_head): Now static.
22301
22302 * scroll.c (scroll_cost): Remove; unused.
22303 * dispextern.h (scroll_cost): Remove decl.
22304
22305 * region-cache.h (pp_cache): Mark as externally visible.
22306
22307 * process.c: Make symbols static if they're not exported.
22308 (process_tick, update_tick, create_process, chan_process):
22309 (Vprocess_alist, proc_buffered_char, datagram_access):
22310 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22311 (deactivate_process): Mark defn as static, as well as decl.
22312 * lisp.h (create_process): Remove decl.
22313 * process.h (chan_process, Vprocess_alist): Remove decls.
22314
22315 * print.c: Make symbols static if they're not exported.
22316 (print_depth, new_backquote_output, being_printed, print_buffer):
22317 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22318 (print_interval, print_number_index, initial_stderr_stream):
22319 Now static.
22320 * lisp.h (Fprinc): Remove decl.
22321 (debug_output_compilation_hack): Mark as externally visible.
22322
22323 * sysdep.c (croak): Move decl from here to syssignal.h.
22324 * syssignal.h (croak): Put it here, so the API can be checked when
22325 'croak' is called from dissociate_if_controlling_tty.
22326
22327 * minibuf.c: Make symbols static if they're not exported.
22328 (minibuf_save_list, choose_minibuf_frame): Now static.
22329 * lisp.h (choose_minibuf_frame): Remove decl.
22330
22331 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22332
22333 * lread.c: Make symbols static if they're not exported.
22334 (read_objects, initial_obarray, oblookup_last_bucket_number):
22335 Now static.
22336 (make_symbol): Remove; unused.
22337 * lisp.h (initial_obarray, make_symbol): Remove decls.
22338
22339 * keyboard.c: Make symbols static if they're not exported.
22340 (single_kboard, recent_keys_index, total_keys, recent_keys):
22341 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22342 (this_single_command_key_start, echoing, last_auto_save):
22343 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22344 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22345 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22346 (Vlispy_mouse_stem, double_click_count):
22347 Now static.
22348 (force_auto_save_soon): Define only if SIGDANGER.
22349 (ignore_mouse_drag_p): Now static if
22350 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22351 (print_help): Remove; unused.
22352 (stop_character, last_timer_event): Mark as externally visible.
22353 * keyboard.h (ignore_mouse_drag_p): Declare only if
22354 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22355 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22356 * lisp.h (echoing): Remove decl.
22357 (force_auto_save_soon): Declare only if SIGDANGER.
22358 * xdisp.c (redisplay_window): Simplify code, to make it more
22359 obvious that ignore_mouse_drag_p is not accessed if !defined
22360 USE_GTK && !defined HAVE_NS.
22361
22362 * intervals.c: Make symbols static if they're not exported.
22363 (merge_properties_sticky, merge_interval_right, delete_interval):
22364 Now static.
22365 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22366
22367 * insdel.c: Make symbols static if they're not exported.
22368 However, leave prepare_to_modify_buffer alone. It's never
22369 called from outside this function, but that appears to be a bug.
22370 (combine_after_change_list, combine_after_change_buffer):
22371 (adjust_after_replace, signal_before_change): Now static.
22372 (adjust_after_replace_noundo): Remove; unused.
22373 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22374 (signal_before_change): Remove decls.
22375
22376 * indent.c (val_compute_motion, val_vmotion): Now static.
22377
22378 * image.c: Make symbols static if they're not exported.
22379 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22380 if USE_GTK.
22381 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22382 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22383
22384 * fringe.c (standard_bitmaps): Now static.
22385 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22386
22387 * frame.c: Make symbols static if they're not exported.
22388 (x_report_frame_params, make_terminal_frame): Now static.
22389 (get_frame_param): Now static, unless HAVE_NS.
22390 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22391 (x_get_resource_string): Remove; not used.
22392 * frame.h (make_terminal_frame, x_report_frame_params):
22393 (x_get_resource_string); Remove decls.
22394 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22395 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22396
22397 * font.c, fontset.c: Make symbols static if they're not exported.
22398 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22399 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22400 * font.c (font_close_object): Now static.
22401 * font.h (font_close_object): Remove.
22402 * fontset.c (FONTSET_OBJLIST): Remove.
22403 (free_realized_fontset) #if-0 the body, which does nothing.
22404 (face_suitable_for_char_p): #if-0, as it's never called.
22405 * fontset.h (face_suitable_for_char_p): Remove decl.
22406 * xfaces.c (face_at_string_position):
22407 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22408 since 0 is always ASCII.
22409
22410 * fns.c (weak_hash_tables): Now static.
22411
22412 * fileio.c: Make symbols static if they're not exported.
22413 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22414 (Vwrite_region_annotation_buffers): Now static.
22415
22416 * eval.c: Make symbols static if they're not exported.
22417 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22418 * lisp.h (backtrace_list): Remove decl.
22419
22420 * emacs.c: Make symbols static if they're not exported.
22421 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22422 (fatal_error_code, fatal_error_signal_hook, standard_args):
22423 Now static.
22424 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22425 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22426 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22427 * lisp.h (fatal_error_signal_hook): Remove decl.
22428 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22429
22430 * editfns.c: Move a (normally-unused) function to its only use.
22431 * editfns.c, lisp.h (get_operating_system_release): Remove.
22432 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22433 worth the hassle of breaking this out.
22434
22435 * xterm.c: Make symbols static if they're not exported.
22436 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22437 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22438 (x_destroy_window, x_delete_display):
22439 Now static.
22440 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22441 (x_mouse_leave): Remove; unused.
22442 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22443 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22444 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22445 Remove decls.
22446 (x_mouse_leave): Declare only if WINDOWSNT.
22447 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22448 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22449 USE_X_TOOLKIT.
22450
22451 * ftxfont.c: Make symbols static if they're not exported.
22452 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22453 HAVE_FREETYPE.
22454 * font.h (ftxfont_driver): Likewise.
22455
22456 * xfns.c: Make symbols static if they're not exported.
22457 (x_last_font_name, x_display_info_for_name):
22458 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22459 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22460 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22461 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22462 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22463 (last_show_tip_args): Now static.
22464 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22465 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22466 (x_screen_planes): Remove; unused.
22467 * dispextern.h (x_screen_planes): Remove decl.
22468
22469 * dispnew.c: Make symbols static if they're not exported.
22470 * dispextern.h (redraw_garbaged_frames, scrolling):
22471 (increment_row_positions): Remove.
22472 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22473 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22474 Now static.
22475 (redraw_garbaged_frames): Remove; unused.
22476
22477 * xfaces.c: Make symbols static if they're not exported.
22478 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22479 Remove decls.
22480 * xterm.h (defined_color): Remove decls.
22481 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22482 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22483 (menu_face_changed_default, defined_color, free_realized_face):
22484 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22485 (ascii_face_of_lisp_face): Remove; unused.
22486
22487 * xdisp.c: Make symbols static if they're not exported.
22488 * dispextern.h (scratch_glyph_row, window_box_edges):
22489 (glyph_to_pixel_coords, set_cursor_from_row):
22490 (get_next_display_element, set_iterator_to_next):
22491 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22492 (show_mouse_face): Remove decls
22493 * frame.h (message_buf_print): Likewise.
22494 * lisp.h (pop_message, set_message, check_point_in_composition):
22495 Likewise.
22496 * xterm.h (set_vertical_scroll_bar): Likewise.
22497 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22498 (message_buf_print, scratch_glyph_row, displayed_buffer):
22499 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22500 (get_next_display_element, show_mouse_face, window_box_edges):
22501 (frame_to_window_pixel_xy, check_point_in_composition):
22502 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22503 (glyph_to_pixel_coords): Remove; unused.
22504
22505 * dired.c (file_name_completion): Now static.
22506
22507 * dbusbind.c (xd_in_read_queued_messages): Now static.
22508
22509 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22510 * data.c (circular_list_error): Remove.
22511
22512 * commands.h (last_point_position, last_point_position_buffer):
22513 (last_point_position_window): Remove decls.
22514 * keyboard.c: Make these variables static.
22515
22516 * coding.h (coding, code_convert_region, encode_coding_gap):
22517 Remove decls.
22518 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22519 (iso_code_class, detect_coding, code_convert_region): Now static.
22520 (encode_coding_gap): Remove; unused.
22521
22522 * chartab.c (chartab_chars, chartab_bits): Now static.
22523
22524 * charset.h (charset_iso_8859_1): Remove decl.
22525 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22526 Now static.
22527
22528 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22529 * ccl.c (Vccl_program_table): Now static.
22530 (check_ccl_update): Remove; unused.
22531
22532 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22533 * category.h: ... from here.
22534 * category.c (check_category_table, set_category_set): Now static.
22535
22536 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22537 * lisp.h: Remove these decls.
22538
22539 * buffer.c (buffer_count): Remove unused var.
22540
22541 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22542 so that it's not optimized away.
22543 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22544 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22545 exported only to the debugger.
22546
22547 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22548 * atimer.h (run_all_atimers): Remove; not exported.
22549
22550 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22551 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22552 was inaccessible from Lisp.
22553 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22554 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22555
22556 alloc.c: Import and export fewer symbols, and remove unused items.
22557 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22558 is defined.
22559 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22560 it's not optimized away by whole-program optimization.
22561 (message_enable_multibyte, free_misc): Remove.
22562 (catchlist, handlerlist, mark_backtrace):
22563 Declare only if BYTE_MARK_STACK.
22564 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22565 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22566 (message_enable_multibyte): Remove decl.
22567 (free_misc, interval_free_list, float_block, float_block_index):
22568 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22569 (cons_free_list, last_marked_index):
22570 Now static.
22571 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22572 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22573 (mark_backtrace): Define only if BYTE_MARK_STACK.
22574 * xdisp.c (message_enable_multibyte): Now static.
22575
22576 Declare Lisp_Object Q* variables to be 'static' if not exported.
22577 This makes it easier for human readers (and static analyzers)
22578 to see whether these variables are used from other modules.
22579 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22580 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22581 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22582 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22583 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22584 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22585 * xmenu.c, xselect.c:
22586 Declare Q* vars static if they are not used in other modules.
22587 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22588 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22589 Remove decls of unexported vars.
22590 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22591
22592 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22593
22594 Make Emacs functions such as Fatom 'static' by default.
22595 This makes it easier for human readers (and static analyzers)
22596 to see whether these functions can be called from other modules.
22597 DEFUN now defines a static function. To make the function external
22598 so that it can be used in other C modules, use the new macro DEFUE.
22599 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22600 (Finit_image_library):
22601 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22602 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22603 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22604 Remove decls, since these functions are now static.
22605 (Funintern, Fget_internal_run_time): New decls, since these functions
22606 were already external.
22607
22608 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22609 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22610 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22611 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22612 * keyboard.c, keymap.c, lread.c:
22613 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22614 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22615 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22616 Mark functions with DEFUE instead of DEFUN,
22617 if they are used in other modules.
22618 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22619 decls for now-static functions.
22620 * buffer.h (Fdelete_overlay): Remove decl.
22621 * callproc.c (Fgetenv_internal): Mark as internal.
22622 * composite.c (Fremove_list_of_text_properties): Remove decl.
22623 (Fcomposition_get_gstring): New forward static decl.
22624 * composite.h (Fcomposite_get_gstring): Remove decl.
22625 * dired.c (Ffile_attributes): New forward static decl.
22626 * doc.c (Fdocumntation_property): New forward static decl.
22627 * eval.c (Ffetch_bytecode): New forward static decl.
22628 (Funintern): Remove extern decl; now in .h file where it belongs.
22629 * fileio.c (Fmake_symbolic_link): New forward static decl.
22630 * image.c (Finit_image_library): New forward static decl.
22631 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22632 * intervals.h (Fprevious_property_change):
22633 (Fremove_list_of_text_properties): Remove decls.
22634 * keyboard.c (Fthis_command_keys): Remove decl.
22635 (Fcommand_execute): New forward static decl.
22636 * keymap.c (Flookup_key): New forward static decl.
22637 (Fcopy_keymap): Now static.
22638 * keymap.h (Flookup_key): Remove decl.
22639 * process.c (Fget_process): New forward static decl.
22640 (Fprocess_datagram_address): Mark as internal.
22641 * syntax.c (Fsyntax_table_p): New forward static decl.
22642 (skip_chars): Remove duplicate decl.
22643 * textprop.c (Fprevious_property_change): New forward static decl.
22644 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22645 Now internal.
22646 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22647 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22648
22649 * editfns.c (Fformat): Remove unreachable code.
22650
22651 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22652
22653 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22654 change. (Bug#8496)
22655
22656 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22657
22658 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22659 when at ZV. (Bug#8487)
22660
22661 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22662
22663 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22664 (Bug#8437)
22665 * keyboard.c (parse_tool_bar_item): Likewise.
22666 * sound.c (sound_cleanup, alsa_close): Likewise.
22667 * termcap.c (tgetent): Likewise.
22668 * xfns.c (x_default_font_parameter): Likewise.
22669 * xsettings.c (read_and_apply_settings): Likewise.
22670
22671 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22672 (overrun_check_free): Protoize.
22673
22674 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22675
22676 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22677 since callers should never pass a negative size.
22678 Change the signature to match that of plain 'read' and 'write'; see
22679 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22680 * lisp.h: Update prototypes of emacs_write and emacs_read.
22681
22682 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22683
22684 * xdisp.c (redisplay_window): Don't try to determine the character
22685 position of the scroll margin if the window start point w->startp
22686 is outside the buffer's accessible region. (Bug#8468)
22687
22688 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22689
22690 Fix write-region and its subroutines for buffers > 2GB.
22691 * fileio.c (a_write, e_write): Modify declaration of arguments and
22692 local variables to support buffers larger than 2GB.
22693 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22694
22695 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22696 argument, local variables, and return value.
22697
22698 * lisp.h: Update prototypes of emacs_write and emacs_read.
22699
22700 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22701
22702 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22703
22704 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22705
22706 Fix more problems found by GCC 4.6.0's static checks.
22707
22708 * xdisp.c (vmessage): Use a better test for character truncation.
22709
22710 * charset.c (load_charset_map): <, not <=, for optimization,
22711 and to avoid potential problems with integer overflow.
22712 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22713 * casetab.c (set_identity, shuffle): Likewise.
22714 * editfns.c (Fformat): Likewise.
22715 * syntax.c (skip_chars): Likewise.
22716
22717 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22718 This also lets GCC 4.6.0 generate slightly better loop code.
22719
22720 * callint.c (Fcall_interactively): <, not <=, for optimization.
22721 (Fcall_interactively): Count the number of arguments produced,
22722 not the number of arguments given. This is simpler and lets GCC
22723 4.6.0 generate slightly better code.
22724
22725 * ftfont.c: Distingish more carefully between FcChar8 and char.
22726 The previous code passed unsigned char * to a functions like
22727 strlen and xstrcasecmp that expect char *, which does not
22728 conform to the C standard.
22729 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22730 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22731 char * when the C standard requires it.
22732
22733 * keyboard.c (read_char): Remove unused var.
22734
22735 * eval.c: Port to Windows vsnprintf (Bug#8435).
22736 Include <limits.h>.
22737 (SIZE_MAX): Define if the headers do not.
22738 (verror): Do not give up if vsnprintf returns a negative count.
22739 Instead, grow the buffer. This ports to Windows vsnprintf, which
22740 does not conform to C99. Problem reported by Eli Zaretskii.
22741 Also, simplify the allocation scheme, by avoiding the need for
22742 calling realloc, and removing the ALLOCATED variable.
22743
22744 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22745
22746 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22747 But keep the doprint source code for now, as we might revamp it
22748 and use it again (Bug#8435).
22749 * lisp.h (doprnt): Remove.
22750 * Makefile.in (base_obj): Remove doprnt.o.
22751 * deps.mk (doprnt.o): Remove.
22752
22753 error: Print 32- and 64-bit integers portably (Bug#8435).
22754 Without this change, on typical 64-bit hosts error ("...%d...", N)
22755 was used to print both 32- and 64-bit integers N, which relied on
22756 undefined behavior.
22757 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22758 * lisp.h (error, verror): Mark as printf-like functions.
22759 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22760 Report overflow in size calculations when allocating printf buffer.
22761 Do not truncate output string at its first null byte.
22762 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22763 Truncate the output at a character boundary, since vsnprintf does not
22764 do that.
22765 * charset.c (check_iso_charset_parameter): Convert internal
22766 character to string before calling 'error', since %c now has the
22767 printf meaning.
22768 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22769 overflow when computing char to be passed to 'error'. Do not
22770 pass Lisp_Object to 'error'; pass the integer instead.
22771 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22772 formatted with plain %d.
22773
22774 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22775
22776 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22777
22778 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22779
22780 * xterm.c (x_catch_errors): Remove duplicate declaration.
22781
22782 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22783
22784 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22785
22786 2011-04-10 Jim Meyering <meyering@redhat.com>
22787
22788 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22789 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22790 return ssize_t not "int", and use size_t as the buffer length.
22791 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22792 * gnutls.h: Update declarations.
22793 * process.c (read_process_output): Use ssize_t, to match.
22794 (send_process): Likewise.
22795
22796 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22797
22798 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22799
22800 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22801
22802 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22803 Use unsigned char, to match FcChar8 type definition.
22804
22805 * xterm.c (handle_one_xevent):
22806 * xmenu.c (create_and_show_popup_menu):
22807 * xselect.c (x_decline_selection_request)
22808 (x_reply_selection_request): Avoid type-punned deref of X events.
22809
22810 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22811
22812 Fix some uses of `int' instead of EMACS_INT.
22813 * search.c (string_match_1, fast_string_match)
22814 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22815 (scan_buffer, find_next_newline_no_quit)
22816 (find_before_next_newline, search_command, Freplace_match)
22817 (Fmatch_data): Make some `int' variables be EMACS_INT.
22818
22819 * xdisp.c (display_count_lines): 3rd argument and return value now
22820 EMACS_INT. All callers changed.
22821 (pint2hrstr): Last argument is now EMACS_INT.
22822
22823 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22824 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22825 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22826 (decode_coding_utf_16, decode_coding_emacs_mule)
22827 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22828 (decode_coding_ccl, decode_coding_charset)
22829 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22830 (decode_coding_iso_2022, decode_coding_emacs_mule)
22831 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22832 <char_offset, last_offset>: Declare EMACS_INT.
22833 (encode_coding_utf_8, encode_coding_utf_16)
22834 (encode_coding_emacs_mule, encode_invocation_designation)
22835 (encode_designation_at_bol, encode_coding_iso_2022)
22836 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22837 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22838 Declare EMACS_INT.
22839 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22840 (encode_invocation_designation): Last argument P_NCHARS is now
22841 EMACS_INT.
22842 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22843 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22844
22845 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22846 All users changed.
22847
22848 * ccl.c (Fccl_execute_on_string): Declare some variables
22849 EMACS_INT.
22850
22851 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22852
22853 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22854
22855 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22856
22857 * process.c (Fformat_network_address): Doc fix.
22858
22859 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22860
22861 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22862
22863 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22864
22865 * keyboard.c (read_char): Call Lisp function help-form-show,
22866 instead of using internal_with_output_to_temp_buffer.
22867 (Qhelp_form_show): New var.
22868 (syms_of_keyboard): Use DEFSYM macro.
22869
22870 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22871
22872 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22873
22874 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22875
22876 * process.c (Flist_processes): Remove to Lisp.
22877 (list_processes_1): Delete.
22878
22879 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22880
22881 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22882
22883 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22884
22885 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22886
22887 Fix more problems found by GCC 4.6.0's static checks.
22888
22889 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22890
22891 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22892
22893 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22894
22895 * xdisp.c (vmessage): Mark as a printf-like function.
22896
22897 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22898
22899 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22900
22901 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22902 printf-like functions.
22903 (tiff_load): Add casts to remove these marks before passing them
22904 to system-supplied API.
22905
22906 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22907
22908 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22909 This avoids several warnings with gcc -Wstrict-overflow.
22910 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22911 directly, rather than having caller test rule sign. This avoids
22912 some unnecessary tests.
22913 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22914 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22915 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22916
22917 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22918 (xfont_open): Avoid unnecessary tests.
22919
22920 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22921
22922 * composite.h, composite.c (composition_gstring_put_cache):
22923 Use EMACS_INT, not int, for length.
22924
22925 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22926 breaking out part of COMPOSITION_DECODE_RULE.
22927 (COMPOSITION_DECODE_RULE): Use it.
22928 * composite.c (get_composition_id): Remove unused local vars,
22929 by using the new macro.
22930
22931 * textprop.c (set_text_properties_1): Change while to do-while,
22932 since the condition is always true at first.
22933
22934 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22935 (interval_deletion_adjustment): Return unsigned value.
22936 All uses changed.
22937
22938 * process.c (list_processes_1, create_pty, read_process_output):
22939 (exec_sentinel): Remove vars that were set but not used.
22940 (create_pty): Remove unnecessary "volatile"s.
22941 (Fnetwork_interface_info): Avoid possibility of int overflow.
22942 (read_process_output): Do adaptive read buffering even if carryover.
22943 (read_process_output): Simplify nbytes computation if buffered.
22944
22945 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22946
22947 * syntax.c (scan_words): Remove var that was set but not used.
22948 (update_syntax_table): Use unsigned instead of int.
22949
22950 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22951 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22952 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22953
22954 * print.c (print_error_message): Avoid int overflow.
22955
22956 * font.c (font_list_entities): Redo for clarity,
22957 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22958
22959 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22960 (font_score): Avoid potential overflow in diff calculation.
22961
22962 * fns.c (substring_both): Remove var that is set but not used.
22963 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22964
22965 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22966
22967 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22968 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22969 can always succeed if overflow has undefined behavior.
22970
22971 * search.c (boyer_moore, wordify): Remove vars set but not used.
22972 (wordify): Omit three unnecessary tests.
22973
22974 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22975 All callers changed. This avoids the need for an unused var.
22976
22977 * casefiddle.c (casify_region): Remove var that is set but not used.
22978
22979 * dired.c (file_name_completion): Remove var that is set but not used.
22980
22981 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22982
22983 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22984 (Finsert_file_contents): Remove unnecessary code checking fd.
22985
22986 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22987 Check for integer overflow on size calculations.
22988
22989 * buffer.c (Fprevious_overlay_change): Remove var that is set
22990 but not used.
22991
22992 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22993 Remove vars that are set but not used.
22994 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22995 (timer_check_2): Mark vars as initialized.
22996
22997 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22998
22999 * image.c (lookup_image): Remove var that is set but not used.
23000 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23001
23002 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23003 that are set but not used.
23004
23005 * xfns.c (make_invisible_cursor): Don't return garbage
23006 if XCreateBitmapFromData fails (Bug#8410).
23007
23008 * xselect.c (x_get_local_selection, x_handle_property_notify):
23009 Remove vars that are set but not used.
23010
23011 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23012 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23013
23014 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23015 Remove var that is set but not used.
23016 (scroll_bar_windows_size): Now size_t, not int.
23017 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23018 Check for overflow.
23019
23020 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23021 (map_tty_color) [!defined MSDOS]: Likewise.
23022
23023 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23024
23025 * coding.c: Remove vars that are set but not used.
23026 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23027 All callers changed.
23028 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23029 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23030 (decode_coding_charset): Remove vars that are set but not used.
23031
23032 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23033 that is set but not used.
23034
23035 * print.c (print_object): Remove var that is set but not used.
23036
23037 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23038 The gnulib version avoids calling malloc in the usual case,
23039 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23040 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23041 * filelock.c (current_lock_owner): Likewise.
23042 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23043 * sysdep.c: Include allocator.h, careadlinkat.h.
23044 (emacs_no_realloc_allocator): New static constant.
23045 (emacs_readlink): New function.
23046 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23047 ../lib/careadlinkat.h.
23048
23049 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23050
23051 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23052 first non-nil return value).
23053
23054 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23055
23056 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23057 if not defined (Bug#8403).
23058
23059 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23060
23061 * xdisp.c (display_count_lines): Remove parameter `start',
23062 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23063 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23064 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23065 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23066 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23067 and thereabouts. All callers changed.
23068 (get_per_char_metric): Remove parameter `f', unused since
23069 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23070
23071 2011-04-02 Jim Meyering <meyering@redhat.com>
23072
23073 do not dereference NULL upon failed strdup
23074 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23075 (ns_get_family): Likewise.
23076
23077 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
23078
23079 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23080
23081 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23082
23083 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23084 later (Bug#8403).
23085
23086 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23087
23088 Add lexical binding.
23089
23090 * window.c (Ftemp_output_buffer_show): New fun.
23091 (Fsave_window_excursion):
23092 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23093
23094 * lread.c (lisp_file_lexically_bound_p): New function.
23095 (Fload): Bind Qlexical_binding.
23096 (readevalloop): Remove `evalfun' arg.
23097 Bind Qinternal_interpreter_environment.
23098 (Feval_buffer): Bind Qlexical_binding.
23099 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23100 Mark as dynamic.
23101 (syms_of_lread): Declare `lexical-binding'.
23102
23103 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23104
23105 * keyboard.c (eval_dyn): New fun.
23106 (menu_item_eval_property): Use it.
23107
23108 * image.c (parse_image_spec): Use Ffunctionp.
23109
23110 * fns.c (concat, mapcar1): Accept byte-code-functions.
23111
23112 * eval.c (Fsetq): Handle lexical vars.
23113 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23114 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23115 (FletX, Flet): Obey lexical binding.
23116 (Fcommandp): Handle closures.
23117 (Feval): New `lexical' arg.
23118 (eval_sub): New function extracted from Feval. Use it almost
23119 everywhere where Feval was used. Look up vars in lexical env.
23120 Handle closures.
23121 (Ffunctionp): Move from subr.el.
23122 (Ffuncall): Handle closures.
23123 (apply_lambda): Remove `eval_flags'.
23124 (funcall_lambda): Handle closures and new byte-code-functions.
23125 (Fspecial_variable_p): New function.
23126 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23127 but without exporting it to Lisp.
23128
23129 * doc.c (Fdocumentation, store_function_docstring):
23130 * data.c (Finteractive_form): Handle closures.
23131
23132 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23133 interactive spec.
23134
23135 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23136 New byte-codes.
23137 (exec_byte_code): New function extracted from Fbyte_code to handle new
23138 calling convention for byte-code-functions. Add new byte-codes.
23139
23140 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23141
23142 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23143
23144 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23145
23146 * xdisp.c (redisplay_internal): Fix prototype.
23147
23148 2011-03-31 Eli Zaretskii <eliz@gnu.org>
23149
23150 * xdisp.c (SCROLL_LIMIT): New macro.
23151 (try_scrolling): Use it when setting scroll_limit.
23152 Limit scrolling to 100 screen lines.
23153 (redisplay_window): Even when falling back on "recentering",
23154 position point in the window according to scroll-conservatively,
23155 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23156
23157 (try_scrolling): When point is above the window, allow searching
23158 as far as scroll_max, or one screenful, to compute vertical
23159 distance from PT to the scroll margin position. This prevents
23160 try_scrolling from unnecessarily failing when
23161 scroll-conservatively is set to a value slightly larger than the
23162 window height. Clean up the case of PT below the margin at bottom
23163 of window: scroll_max can no longer be INT_MAX. When aggressive
23164 scrolling is in use, don't let point enter the opposite scroll
23165 margin as result of the scroll.
23166 (syms_of_xdisp) <scroll-conservatively>: Document the
23167 threshold of 100 lines for never-recentering scrolling.
23168
23169 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
23170
23171 * dispextern.h (move_it_by_lines):
23172 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23173 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23174 (message_log_check_duplicate): Remove parameters `prev_bol' and
23175 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23176 (redisplay_internal): Remove parameter `preserve_echo_area',
23177 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23178
23179 * indent.c (Fvertical_motion):
23180 * window.c (window_scroll_pixel_based, Frecenter):
23181 Don't pass `need_y_p' to `move_it_by_lines'.
23182
23183 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23184
23185 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23186 steal a few bits to be more compact.
23187 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23188 Remove unneeded casts.
23189
23190 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23191
23192 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23193
23194 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23195 binding" message (bug#7967).
23196
23197 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23198
23199 Fix more problems found by GCC 4.6.0's static checks.
23200
23201 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23202 Remove unused local var.
23203
23204 * editfns.c (Fmessage_box): Remove unused local var.
23205
23206 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23207 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23208 Omit unused local vars.
23209 * window.c (shrink_windows): Omit unused local var.
23210 * menu.c (digest_single_submenu): Omit unused local var.
23211 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23212 Omit unused local var.
23213
23214 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23215 Don't assume string length fits in int.
23216 (keyremap_step, read_key_sequence): Use size_t for sizes.
23217 (read_key_sequence): Don't check last_real_key_start redundantly.
23218
23219 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23220 instead of alloca (Bug#8344).
23221
23222 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23223 (Fbacktrace_frame): Don't assume nframes fits in int.
23224
23225 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23226
23227 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23228 concerns.
23229
23230 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23231
23232 * cm.c (calccost): Turn while-do into do-while, for clarity.
23233
23234 * keyboard.c (syms_of_keyboard): Use the same style as later
23235 in this function when indexing through an array. This also
23236 works around GCC bug 48267.
23237
23238 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23239
23240 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23241
23242 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23243 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23244
23245 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23246 This avoids undefined behavior on integer overflow, and is a bit
23247 more convenient anyway since it is compared to a size_t variable.
23248
23249 Variadic C functions now count arguments with size_t, not int.
23250 This avoids an unnecessary limitation on 64-bit machines, which
23251 caused (substring ...) to crash on large vectors (Bug#8344).
23252 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23253 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23254 All variadic functions and their callers changed accordingly.
23255 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23256 * data.c (arith_driver, float_arith_driver): Likewise.
23257 * editfns.c (general_insert_function): Likewise.
23258 * eval.c (struct backtrace.nargs, interactive_p)
23259 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23260 (funcall_lambda, mark_backtrace): Likewise.
23261 * fns.c (concat): Likewise.
23262 * frame.c (x_set_frame_parameters): Likewise.
23263 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23264 0 if not found, not -1. All callers changed.
23265
23266 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23267 (stack_copy_size): Now size_t, not int.
23268 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23269
23270 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23271
23272 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23273 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23274 All callers changed.
23275
23276 * lisp.h (multibyte_char_to_unibyte):
23277 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23278 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23279 * character.h (CHAR_TO_BYTE8):
23280 * cmds.c (internal_self_insert):
23281 * editfns.c (general_insert_function):
23282 * keymap.c (push_key_description):
23283 * search.c (Freplace_match):
23284 * xdisp.c (message_dolog, set_message_1): All callers changed.
23285
23286 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23287
23288 * keyboard.c (safe_run_hook_funcall): New function.
23289 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23290 don't set the hook to nil, but remove the offending function instead.
23291 (Qcommand_hook_internal): Remove, unused.
23292 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23293 Vcommand_hook_internal.
23294
23295 * eval.c (enum run_hooks_condition): Remove.
23296 (funcall_nil, funcall_not): New functions.
23297 (run_hook_with_args): Call each function through a `funcall' argument.
23298 Remove `cond' argument, now redundant.
23299 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23300 (Frun_hook_with_args_until_failure): Adjust accordingly.
23301 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23302
23303 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23304
23305 * dispextern.h (string_buffer_position): Remove declaration.
23306
23307 * print.c (strout): Remove parameter `multibyte', unused since
23308 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23309
23310 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23311 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23312 All callers changed.
23313
23314 * w32.c (_wsa_errlist): Use braces for struct initializers.
23315
23316 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23317 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23318 All callers changed.
23319 (string_buffer_position): Likewise. Also, make static (it's never
23320 used outside xdisp.c).
23321 (cursor_row_p): Remove parameter `w', unused since
23322 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23323 (decode_mode_spec): Remove parameter `precision', introduced during
23324 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23325 All callers changed.
23326
23327 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23328
23329 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23330
23331 2011-03-27 Anders Lindgren <andlind@gmail.com>
23332
23333 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23334 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23335 (ns_update_auto_hide_menu_bar): New functions.
23336 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23337 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23338 ns_constrain_all_frames.
23339 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23340 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23341
23342 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23343
23344 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23345
23346 2011-03-27 Glenn Morris <rgm@gnu.org>
23347
23348 * syssignal.h: Replace RETSIGTYPE with void.
23349 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23350 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23351 Replace SIGTYPE with void everywhere.
23352 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23353 * s/template.h (SIGTYPE): Remove commented out definition.
23354
23355 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23356
23357 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23358 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23359
23360 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23361
23362 * w32.c (read_unc_volume): Use parameter `henum', instead of
23363 global variable `wget_enum_handle'.
23364
23365 * keymap.c (describe_vector): Remove parameters `indices' and
23366 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23367 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23368
23369 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23370
23371 * keyboard.c (timer_check): Remove parameter `do_it_now',
23372 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23373 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23374 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23375
23376 * keyboard.c (read_char):
23377 * w32menu.c (w32_menu_display_help):
23378 * xmenu.c (show_help_event, menu_help_callback):
23379 Adjust calls to `show_help_echo'.
23380
23381 * gtkutil.c (xg_maybe_add_timer):
23382 * keyboard.c (readable_events):
23383 * process.c (wait_reading_process_output):
23384 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23385
23386 * insdel.c (adjust_markers_gap_motion):
23387 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23388 (gap_left, gap_right): Don't call it.
23389
23390 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23391
23392 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23393 incurred during fontification.
23394
23395 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23396
23397 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23398 (DEFVAR_PER_BUFFER): Don't pass it.
23399
23400 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23401 (scrolling_window): Don't pass it.
23402
23403 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23404
23405 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23406
23407 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23408 and `suffix'.
23409 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23410 of variables specific to SELinux and computation of `encoded_absname'.
23411
23412 * image.c (XPutPixel): Remove unused variable `height'.
23413
23414 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23415
23416 * unexw32.c (get_section_info): Remove unused variable `section'.
23417
23418 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23419 (system_process_attributes): Remove unused variable `sess'.
23420 (sys_read): Remove unused variable `err'.
23421
23422 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23423 (w32_wnd_proc): Remove unused variable `isdead'.
23424 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23425 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23426 (x_create_tip_frame): Remove unused variable `tem'.
23427
23428 * w32inevt.c (w32_console_read_socket):
23429 Remove unused variable `no_events'.
23430
23431 * w32term.c (x_draw_composite_glyph_string_foreground):
23432 Remove unused variable `width'.
23433
23434 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23435
23436 * w32term.c (x_set_glyph_string_clipping):
23437 Don't pass uninitialized region to CombineRgn.
23438
23439 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23440
23441 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23442 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23443 (Fx_close_connection): Remove unused variable `i'.
23444
23445 * w32font.c (w32font_draw): Return number of glyphs.
23446 (w32font_open_internal): Remove unused variable `i'.
23447 (w32font_driver): Add missing initializer.
23448
23449 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23450 (fill_in_menu): Remove unused variable `items_added'.
23451
23452 * w32term.c (last_mouse_press_frame): Remove static global variable.
23453 (w32_clip_to_row): Remove unused variable `f'.
23454 (x_delete_terminal): Remove unused variable `i'.
23455
23456 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23457 (NOTHING): Remove unused static global variable.
23458 (uniscribe_check_otf): Remove unused variable `table'.
23459 (uniscribe_font_driver): Add missing initializers.
23460
23461 2011-03-23 Julien Danjou <julien@danjou.info>
23462
23463 * term.c (Fsuspend_tty, Fresume_tty):
23464 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23465 * window.c (temp_output_buffer_show):
23466 * insdel.c (signal_before_change):
23467 * frame.c (Fhandle_switch_frame):
23468 * fileio.c (Fdo_auto_save):
23469 * emacs.c (Fkill_emacs):
23470 * editfns.c (save_excursion_restore):
23471 * cmds.c (internal_self_insert):
23472 * callint.c (Fcall_interactively):
23473 * buffer.c (Fkill_all_local_variables):
23474 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23475 Use Frun_hooks.
23476 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23477 unconditionally since it does the check itself.
23478
23479 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23480
23481 Fix more problems found by GCC 4.5.2's static checks.
23482
23483 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23484 the first time through the loop, since we know p0 < p1 then.
23485 This also avoids a gcc -Wstrict-overflow warning.
23486
23487 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23488 leading to a memory leak, possible in functions like
23489 load_charset_map_from_file that can allocate an unbounded number
23490 of objects (Bug#8318).
23491
23492 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23493 that could (at least in theory) be that large.
23494
23495 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23496 This is less likely to overflow, and avoids undefined behavior if
23497 overflow does occur. All callers changed. Use strtoul to scan
23498 for the unsigned long integer.
23499 (pint2hrstr): Simplify and tune code slightly.
23500 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23501
23502 * scroll.c (do_scrolling): Work around GCC bug 48228.
23503 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23504
23505 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23506 This also avoids a warning with gcc -Wstrict-overflow.
23507 (validate_x_resource_name): Simplify count usage.
23508 This also avoids a warning with gcc -Wstrict-overflow.
23509
23510 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23511 fail (Bug#8306).
23512
23513 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23514
23515 * process.c (Fmake_network_process): Use socklen_t, not int,
23516 where POSIX says socklen_t is required in portable programs.
23517 This fixes a porting bug on hosts like 64-bit HP-UX, where
23518 socklen_t is wider than int (Bug#8277).
23519 (Fmake_network_process, server_accept_connection):
23520 (wait_reading_process_output, read_process_output):
23521 Likewise.
23522
23523 * process.c: Rename or move locals to avoid shadowing.
23524 (list_processes_1, Fmake_network_process):
23525 (read_process_output_error_handler, exec_sentinel_error_handler):
23526 Rename or move locals.
23527 (Fmake_network_process): Define label "retry_connect" only if needed.
23528 (Fnetwork_interface_info): Fix pointer signedness.
23529 (process_send_signal): Add cast to avoid pointer signedness problem.
23530 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23531 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23532
23533 Make tparam.h and terminfo.c consistent.
23534 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23535 Include tparam.h instead, since it declares them.
23536 * cm.h (PC): Remove extern decl; tparam.h now does this.
23537 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23538 * terminfo.c: Include tparam.h, to check interfaces.
23539 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23540 (tparam): Adjust signature to match interface in tparam.h;
23541 this removes some undefined behavior. Check that outstring and len
23542 are zero, which they always are with Emacs.
23543 * tparam.h (PC, BC, UP): New extern decls.
23544
23545 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23546 (xftfont_open): Rename locals to avoid shadowing.
23547
23548 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23549 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23550 (OTF_TAG_SYM): Omit macro if not needed.
23551 (ftfont_list): Remove unused local.
23552 (get_adstyle_property, ftfont_pattern_entity):
23553 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23554 Rename locals to avoid shadowing.
23555
23556 * xfont.c (xfont_list_family): Mark var as initialized.
23557
23558 * xml.c (make_dom): Now static.
23559
23560 * composite.c (composition_compute_stop_pos): Rename local to
23561 avoid shadowing.
23562 (composition_reseat_it): Remove unused locals.
23563 (find_automatic_composition, composition_adjust_point): Likewise.
23564 (composition_update_it): Mark var as initialized.
23565 (find_automatic_composition): Mark vars as initialized,
23566 with a FIXME (Bug#8290).
23567
23568 character.h: Rename locals to avoid shadowing.
23569 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23570 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23571 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23572 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23573 to avoid shadowing.
23574
23575 * textprop.c (property_change_between_p): Remove; unused.
23576
23577 * intervals.c (interval_start_pos): Now static.
23578
23579 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23580
23581 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23582 Rename locals to avoid shadowing.
23583
23584 * sound.c (wav_play, au_play, Fplay_sound_internal):
23585 Fix pointer signedness.
23586 (alsa_choose_format): Remove unused local var.
23587 (wav_play): Initialize a variable to 0, to prevent undefined
23588 behavior (Bug#8278).
23589
23590 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23591
23592 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23593
23594 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23595 clobbering (Bug#8298).
23596 * sysdep.c (sys_subshell): Likewise.
23597 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23598
23599 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23600 This should get cleaned up, so that child_setup has the
23601 same signature on all platforms.
23602
23603 * callproc.c (call_process_cleanup): Now static.
23604 (relocate_fd): Rename locals to avoid shadowing.
23605
23606 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23607
23608 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23609 not to be necessary, and produces flickering.
23610
23611 2011-03-20 Glenn Morris <rgm@gnu.org>
23612
23613 * config.in: Remove file.
23614
23615 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23616
23617 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23618 are now in src/globals.h.
23619 (syms_of_minibuf): Remove spurious & from previous change.
23620
23621 2011-03-20 Leo Liu <sdl.web@gmail.com>
23622
23623 * minibuf.c (completing-read-function): New variable.
23624 (completing-read-default): Rename from completing-read.
23625 (completing-read): Call completing-read-function.
23626
23627 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23628
23629 * xfaces.c (Fx_load_color_file):
23630 Read color file from absolute filename (bug#8250).
23631
23632 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23633
23634 * makefile.w32-in: Update dependencies.
23635
23636 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23637
23638 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23639
23640 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23641
23642 Fix more problems found by GCC 4.5.2's static checks.
23643
23644 * process.c (make_serial_process_unwind, send_process_trap):
23645 (sigchld_handler): Now static.
23646
23647 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23648 That way, the code declares only the vars that it needs.
23649 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23650 * s/cygwin.h (PTY_ITERATION): Likewise.
23651 * s/darwin.h (PTY_ITERATION): Likewise.
23652 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23653
23654 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23655 * process.c (allocate_pty): Don't declare stb unless it's needed.
23656
23657 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23658 (CONSTANTLIM): Remove; unused.
23659 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23660 Define only if needed.
23661
23662 * unexelf.c (unexec): Name an expression,
23663 to avoid gcc -Wbad-function-cast warning.
23664 Use a different way to cause a compilation error if anyone uses
23665 n rather than nn, a way that does not involve shadowing.
23666 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23667
23668 * deps.mk (unexalpha.o): Remove; unused.
23669
23670 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23671 * unexec.h: New file.
23672 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23673 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23674 Depend on unexec.h.
23675 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23676 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23677 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23678 Change as necessary to match prototype in unexec.h.
23679
23680 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23681 shadowing.
23682 (back_comment, skip_chars): Mark vars as initialized.
23683
23684 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23685 Rename locals to avoid shadowing.
23686
23687 * lread.c (read1): Rewrite so as not to use empty "else".
23688 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23689
23690 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23691
23692 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23693 warning when compiling print.c.
23694
23695 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23696 instead of using an uninitialized var.
23697 (font_sort_entities): Mark var as initialized.
23698
23699 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23700
23701 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23702 pointers to constants.
23703 (font_parse_fcname): Remove unused vars.
23704 (font_delete_unmatched): Now static.
23705 (font_get_spec): Remove; unused.
23706 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23707 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23708 Rename or move locals to avoid shadowing.
23709
23710 * fns.c (require_nesting_list, require_unwind): Now static.
23711 (Ffillarray): Rename locals to avoid shadowing.
23712
23713 * floatfns.c (domain_error2): Define only if needed.
23714 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23715
23716 * alloc.c (mark_backtrace): Move decl from here ...
23717 * lisp.h: ... to here, so that it can be checked.
23718
23719 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23720 (Fdefvar): Rewrite so as not to use empty "else".
23721 (lisp_indirect_variable): Name an expression,
23722 to avoid gcc -Wbad-function-cast warning.
23723 (Fdefvar): Rename locals to avoid shadowing.
23724
23725 * callint.c (quotify_arg, quotify_args): Now static.
23726 (Fcall_interactively): Rename locals to avoid shadowing.
23727 Use const pointer when appropriate.
23728
23729 * lisp.h (get_system_name, get_operating_system_release):
23730 Move decls here, to check interfaces.
23731 * process.c (get_operating_system_release): Move decl to lisp.h.
23732 * xrdb.c (get_system_name): Likewise.
23733 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23734 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23735 some of which prompt warnings from gcc -Wbad-function-cast.
23736 (Fformat_time_string, Fencode_time, Finsert_char):
23737 (Ftranslate_region_internal, Fformat):
23738 Rename or remove local vars to avoid shadowing.
23739 (Ftranslate_region_internal): Mark var as initialized.
23740
23741 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23742 avoid shadowing.
23743
23744 * lisp.h (eassert): Check that the argument compiles, even if
23745 ENABLE_CHECKING is not defined.
23746
23747 * data.c (Findirect_variable): Name an expression, to avoid
23748 gcc -Wbad-function-cast warning.
23749 (default_value, arithcompare, arith_driver, arith_error): Now static.
23750 (store_symval_forwarding): Rename local to avoid shadowing.
23751 (Fmake_variable_buffer_local, Fmake_local_variable):
23752 Mark variables as initialized.
23753 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23754
23755 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23756 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23757 Rename locals to avoid shadowing.
23758 (mark_stack): Move local variables into the #ifdef region where
23759 they're used.
23760 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23761 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23762 needed otherwise.
23763 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23764 (GC_STRING_CHARS): Remove; not used.
23765 (Fmemory_limit): Cast sbrk's returned value to char *.
23766
23767 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23768 avoids undefined behavior in theory.
23769
23770 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23771
23772 Use functions, not macros, for up- and down-casing (Bug#8254).
23773 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23774 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23775 to use the following functions instead of these macros.
23776 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23777 EMACS_INT, since callers assume the returned value fits in int.
23778 (upcase1): Likewise, for UPCASE_TABLE.
23779 (uppercasep, lowercasep, upcase): New static inline functions.
23780 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23781 the race-condition problem in the old DOWNCASE.
23782
23783 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23784 Rename locals to avoid shadowing.
23785 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23786 (regex_compile, re_search_2, re_match_2_internal):
23787 Remove unused local vars.
23788 (FREE_VAR): Rewrite so as not to use empty "else",
23789 which gcc can warn about.
23790 (regex_compile, re_match_2_internal): Mark locals as initialized.
23791 (RETALLOC_IF): Define only if needed.
23792 (WORDCHAR_P): Likewise. This one is never needed, but is used
23793 only in a comment talking about a compiler bug, so put inside
23794 the #if 0 of that comment.
23795 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23796 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23797 Remove; unused.
23798
23799 * search.c (boyer_moore): Rename locals to avoid shadowing.
23800 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23801 (PREV_CHAR_BOUNDARY): Likewise.
23802
23803 * search.c (simple_search): Remove unused var.
23804
23805 * dired.c (compile_pattern): Move decl from here ...
23806 * lisp.h: ... to here, so that it can be checked.
23807 (struct re_registers): New forward decl.
23808
23809 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23810
23811 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23812 All uses changed.
23813 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23814 Rename locals to avoid shadowing.
23815 (Fvertical_motion): Mark locals as initialized.
23816
23817 * casefiddle.c (casify_object, casify_region): Now static.
23818 (casify_region): Mark local as initialized.
23819
23820 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23821
23822 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23823 New macros, so that the caller can use some names other than
23824 gcpro1, gcpro2, etc.
23825 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23826 of the new macros.
23827 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23828 argument, for consistency with GCPRO2_VAR, etc: it is now the
23829 prefix of the variable, not the variable itself. All uses
23830 changed.
23831 * dired.c (directory_files_internal, file_name_completion):
23832 Rename locals to avoid shadowing.
23833
23834 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23835 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23836 dired.c's scmp function, had undefined behavior.
23837 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23838 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23839 * buffer.h: ... to here, because these macros use current_buffer,
23840 and the new implementation with inline functions needs to have
23841 current_buffer in scope now, rather than later when the macros
23842 are used.
23843 (downcase, upcase1): New static inline functions.
23844 (DOWNCASE, UPCASE1): Reimplement using these functions.
23845 This avoids undefined behavior in expressions like
23846 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23847 from race conditions in accessing the global variables
23848 case_temp1 and case_temp2.
23849 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23850 * lisp.h (case_temp1, case_temp2): Remove their decls.
23851 * character.h (ASCII_CHAR_P): Move from here ...
23852 * lisp.h: ... to here, so that the inline functions mentioned
23853 above can use them.
23854
23855 * dired.c (directory_files_internal_unwind): Now static.
23856
23857 * fileio.c (file_name_as_directory, directory_file_name):
23858 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23859 Now static.
23860 (file_name_as_directory): Use const pointers when appropriate.
23861 (Fexpand_file_name): Likewise. In particular, newdir might
23862 point at constant storage, so make it a const pointer.
23863 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23864 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23865 signedness issues.
23866 (Fset_file_times, Finsert_file_contents, auto_save_error):
23867 Rename locals to avoid shadowing.
23868
23869 * minibuf.c (choose_minibuf_frame_1): Now static.
23870 (Ftry_completion, Fall_completions): Rename or remove locals
23871 to avoid shadowing.
23872
23873 * marker.c (bytepos_to_charpos): Remove; unused.
23874
23875 * lisp.h (verify_bytepos, count_markers): New decls,
23876 so that gcc does not warn that these functions aren't declared.
23877
23878 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23879 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23880 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23881 (copy_text): Remove unused local var.
23882
23883 * filelock.c (within_one_second): Now static.
23884 (lock_file_1): Rename local to avoid shadowing.
23885
23886 * buffer.c (fix_overlays_before): Mark locals as initialized.
23887 (fix_start_end_in_overlays): Likewise. This function should be
23888 simplified by using pointers-to-pointers, but that's a different
23889 matter.
23890 (switch_to_buffer_1): Now static.
23891 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23892 (report_overlay_modification): Rename locals to avoid shadowing.
23893
23894 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23895 Fix pointer signedness issue.
23896 (sys_subshell): Mark local as volatile if checking for lint,
23897 to suppress a gcc -Wclobbered warning that does not seem to be right.
23898 (MAXPATHLEN): Define only if needed.
23899
23900 * process.c (serial_open, serial_configure): Move decls from here ...
23901 * systty.h: ... to here, so that they can be checked.
23902
23903 * fns.c (get_random, seed_random): Move extern decls from here ...
23904 * lisp.h: ... to here, so that they can be checked.
23905
23906 * sysdep.c (reset_io): Now static.
23907 (wait_for_termination_signal): Remove; unused.
23908
23909 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23910 (copy_keymap_item, append_key, push_text_char_description):
23911 Now static.
23912 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23913 (DENSE_TABLE_SIZE): Remove; unused.
23914 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23915 (describe_map_tree):
23916 Rename locals to avoid shadowing.
23917
23918 * keyboard.c: Declare functions static if they are not used elsewhere.
23919 (echo_char, echo_dash, cmd_error, top_level_2):
23920 (poll_for_input, handle_async_input): Now static.
23921 (read_char, kbd_buffer_get_event, make_lispy_position):
23922 (make_lispy_event, make_lispy_movement, apply_modifiers):
23923 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23924 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23925 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23926 (read_key_sequence, read_char): Mark locals as initialized.
23927 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23928
23929 * keyboard.h (make_ctrl_char): New decl.
23930 (mark_kboards): Move decl here ...
23931 * alloc.c (mark_kboards): ... from here.
23932
23933 * lisp.h (force_auto_save_soon): New decl.
23934
23935 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23936 (DEFINE_DUMMY_FUNCTION): New macro.
23937 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23938 Use it.
23939 (main): Add casts to avoid warnings
23940 if GCC considers string literals to be constants.
23941
23942 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23943
23944 * dbusbind.c: Pointer signedness fixes.
23945 (xd_signature, xd_append_arg, xd_initialize):
23946 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23947 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23948 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23949 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23950
23951 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23952 if GCC considers string literals to be constants.
23953 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23954
23955 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23956
23957 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23958 (print_preprocess, print_object): New macro to fix last change.
23959
23960 * print.c (print_preprocess): Don't forget font objects.
23961
23962 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23963
23964 * emacs.c (USAGE3): Doc fixes.
23965
23966 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23967
23968 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23969 structure.
23970
23971 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23972
23973 * lisp.h (VWindow_system, Qfile_name_history):
23974 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23975 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23976 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23977
23978 * w32select.c: Don't #include "keyboard.h".
23979 (run_protected): Add extern declaration for waiting_for_input.
23980
23981 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23982 * w32console.c (detect_input_pending, read_input_pending)
23983 (encode_terminal_code):
23984 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23985 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23986 (w32_system_caret_y, Qfile_name_history):
23987 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23988 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23989 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23990 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23991 * w32proc.c (Qlocal, report_file_error):
23992 * w32term.c (Vwindow_system, updating_frame):
23993 * w32uniscribe.c (initialized, uniscribe_font_driver):
23994 Remove unneeded extern declarations.
23995
23996 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23997
23998 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23999
24000 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
24001
24002 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24003 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24004 These macros can no longer be used for assignment.
24005
24006 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24007 Assign struct members directly, instead of using BUF_BEGV etc.
24008 (record_buffer_markers, fetch_buffer_markers): New functions for
24009 recording and fetching special buffer markers.
24010 (set_buffer_internal_1, set_buffer_temp): Use them.
24011
24012 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24013
24014 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24015
24016 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24017 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24018
24019 * xdisp.c (hscroll_window_tree):
24020 (reconsider_clip_changes): Use PT instead of BUF_PT.
24021
24022 2011-03-13 Eli Zaretskii <eliz@gnu.org>
24023
24024 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24025 $(EMACS_ROOT)/lib/intprops.h.
24026
24027 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24028
24029 Fix more problems found by GCC 4.5.2's static checks.
24030
24031 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24032 to unsigned char * to avoid compiler diagnostic.
24033 (xg_free_frame_widgets): Make it clear that a local variable is
24034 needed only if USE_GTK_TOOLTIP.
24035 (gdk_window_get_screen): Make it clear that this macro is needed
24036 only if USE_GTK_TOOLTIP.
24037 (int_gtk_range_get_value): New function, which avoids a diagnostic
24038 from gcc -Wbad-function-cast.
24039 (xg_set_toolkit_scroll_bar_thumb): Use it.
24040 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24041 diagnostic from gcc -Wbad-function-cast.
24042 (get_utf8_string, xg_get_file_with_chooser):
24043 Rename locals to avoid shadowing.
24044 (create_dialog): Move locals to avoid shadowing.
24045
24046 * xgselect.c (xg_select): Remove unused var.
24047
24048 * image.c (four_corners_best): Mark locals as initialized.
24049 (gif_load): Initialize transparent_p to zero (Bug#8238).
24050 Mark another local as initialized.
24051 (my_png_error, my_error_exit): Mark with NO_RETURN.
24052
24053 * image.c (clear_image_cache): Now static.
24054 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24055 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24056 (x_edge_detection): Remove unnecessary cast that
24057 gcc -Wbad-function-cast diagnoses.
24058 (gif_load): Fix pointer signedness.
24059 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24060 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24061
24062 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24063
24064 Improve quality of tests for time stamp overflow.
24065 For example, without this patch (encode-time 0 0 0 1 1
24066 1152921504606846976) returns the obviously-bogus value (-948597
24067 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24068 reports time overflow. See
24069 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24070 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24071 * editfns.c: Include limits.h and intprops.h.
24072 (TIME_T_MIN, TIME_T_MAX): New macros.
24073 (time_overflow): Move earlier, to before first use.
24074 (hi_time, lo_time): New functions, for an accurate test for
24075 out-of-range times.
24076 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24077 (Fget_internal_run_time): Don't assume time_t fits in int.
24078 (make_time): Use list2 instead of Fcons twice.
24079 (Fdecode_time): More accurate test for out-of-range times.
24080 (check_tm_member): New function.
24081 (Fencode_time): Use it, to test for out-of-range times.
24082 (lisp_time_argument): Don't rely on undefined left-shift and
24083 right-shift behavior when checking for time stamp overflow.
24084
24085 * editfns.c (time_overflow): New function, refactoring common code.
24086 (Fformat_time_string, Fdecode_time, Fencode_time):
24087 (Fcurrent_time_string): Use it.
24088
24089 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24090 * dired.c (make_time): Move to ...
24091 * editfns.c (make_time): ... here.
24092 * systime.h: Note the move.
24093
24094 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24095
24096 * fringe.c (update_window_fringes): Remove unused variables.
24097
24098 * unexmacosx.c (copy_data_segment): Also copy __got section.
24099 (Bug#8223)
24100
24101 2011-03-12 Eli Zaretskii <eliz@gnu.org>
24102
24103 * termcap.c [MSDOS]: Include "msdos.h".
24104 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24105 Constify `char *' arguments and their references according to
24106 prototypes in tparam.h.
24107
24108 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24109
24110 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24111 Adapt all references accordingly.
24112
24113 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24114
24115 2011-03-11 Tom Tromey <tromey@redhat.com>
24116
24117 * buffer.c (syms_of_buffer): Remove obsolete comment.
24118
24119 2011-03-11 Eli Zaretskii <eliz@gnu.org>
24120
24121 * termhooks.h (encode_terminal_code): Declare prototype.
24122
24123 * msdos.c (encode_terminal_code): Don't declare prototype.
24124
24125 * term.c (encode_terminal_code): Now external again, used by
24126 w32console.c and msdos.c.
24127
24128 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24129 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24130
24131 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24132
24133 Fix some minor problems found by GCC 4.5.2's static checks.
24134
24135 * fringe.c (update_window_fringes): Mark locals as initialized
24136 (Bug#8227).
24137 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24138
24139 * alloc.c (mark_fringe_data): Move decl from here ...
24140 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24141 to check its interface.
24142 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24143
24144 * fontset.c (free_realized_fontset): Now static.
24145 (Fset_fontset_font): Rename local to avoid shadowing.
24146 (fontset_font): Mark local as initialized.
24147 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24148
24149 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24150
24151 * xselect.c (x_disown_buffer_selections): Remove; not used.
24152 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24153 (x_own_selection, Fx_disown_selection_internal): Rename locals
24154 to avoid shadowing.
24155 (x_handle_dnd_message): Remove local to avoid shadowing.
24156
24157 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24158 so that the caller can use some name other than gcpro1.
24159 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24160 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24161 (Fx_backspace_delete_keys_p):
24162 Use them to avoid shadowing, and rename vars to avoid shadowing.
24163 (x_decode_color, x_set_name, x_window): Now static.
24164 (Fx_create_frame): Add braces to silence GCC warning.
24165 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24166 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24167 Remove unused locals.
24168 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24169 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24170 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24171 macros.
24172
24173 * xterm.h (x_mouse_leave): New decl.
24174
24175 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24176 Remove unused functions.
24177 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24178 (x_calc_absolute_position): Now static.
24179 (XTread_socket): Don't define label "out" unless it's used.
24180 Don't declare local "event" unless it's used.
24181 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24182 unless they are used.
24183 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24184 (x_fatal_error_signal): Remove; not used.
24185 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24186 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24187 (x_error_catcher, x_connection_closed, x_error_handler):
24188 (x_error_quitter, xembed_send_message, x_iconify_frame):
24189 (my_log_handler): Rename locals to avoid shadowing.
24190 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24191 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24192
24193 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24194 Rename or move locals to avoid shadowing.
24195 (tty_defined_color, merge_face_heights): Now static.
24196 (free_realized_faces_for_fontset): Remove; not used.
24197 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24198 does not deduce is never used uninitialized.
24199 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24200 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24201
24202 * terminal.c (store_terminal_param): Now static.
24203
24204 * xmenu.c (menu_highlight_callback): Now static.
24205 (set_frame_menubar): Remove unused local.
24206 (xmenu_show): Rename parameter to avoid shadowing.
24207 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24208 since they might point to immutable storage.
24209 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24210 since it's unused otherwise.
24211
24212 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24213 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24214 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24215 avoids a gcc -Wuninitialized diagnostic.
24216 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24217 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24218 does not deduce are never used uninitialized.
24219
24220 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24221
24222 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24223 * window.c (window_loop, size_window):
24224 (run_window_configuration_change_hook, enlarge_window): Likewise.
24225
24226 * window.c (display_buffer): Now static.
24227 (size_window): Mark variables that gcc -Wuninitialized
24228 does not deduce are never used uninitialized.
24229 * window.h (check_all_windows): New decl, to forestall
24230 gcc -Wmissing-prototypes diagnostic.
24231 * dispextern.h (bidi_dump_cached_states): Likewise.
24232
24233 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24234 shadowing.
24235 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24236 Include <limits.h>.
24237 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24238 and to avoid gcc -Wuninitialized warning.
24239 (load_charset_map): Mark variables that gcc -Wuninitialized
24240 does not deduce are never used uninitialized.
24241 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24242
24243 * coding.c (coding_set_source, coding_set_destination):
24244 Use "else { /* comment */ }" rather than "else /* comment */;"
24245 for clarity, and to avoid gcc -Wempty-body warning.
24246 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24247 a block, when the outer 'i' will do.
24248 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24249 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24250 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24251 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24252 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24253 Rename locals to avoid shadowing.
24254 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24255 * coding.c (emacs_mule_char, encode_invocation_designation):
24256 Now static, since they're not used elsewhere.
24257 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24258 (decode_coding_object, encode_coding_object, detect_coding_system):
24259 (decode_coding_emacs_mule): Mark variables that gcc
24260 -Wuninitialized does not deduce are never used uninitialized.
24261 (detect_coding_iso_2022): Initialize a local variable that might
24262 be used uninitialized. Leave a FIXME because it's not clear that
24263 this initialization is needed. (Bug#8211)
24264 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24265 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24266 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24267 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24268 Remove unused macros.
24269
24270 * category.c (hash_get_category_set): Remove unused local var.
24271 (copy_category_table): Now static, since it's not used elsewhere.
24272 * character.c (string_count_byte8): Likewise.
24273
24274 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24275 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24276
24277 * chartab.c (copy_sub_char_table): Now static, since it's not used
24278 elsewhere.
24279 (sub_char_table_ref_and_range, char_table_ref_and_range):
24280 Rename locals to avoid shadowing.
24281 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24282
24283 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24284 (BIDI_BOB): Remove unused macro.
24285
24286 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24287 deduce are never used uninitialized.
24288 * term.c (encode_terminal_code): Likewise.
24289
24290 * term.c (encode_terminal_code): Now static. Remove unused local.
24291
24292 * tparam.h: New file.
24293 * term.c, tparam.h: Include it.
24294 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24295 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24296 Move these decls to tparam.h, and make them agree with what
24297 is actually in tparam.c. The previous trick of using incompatible
24298 decls in different modules does not conform to the C standard.
24299 All callers of tparam changed to use tparam's actual API.
24300 * tparam.c (tparam1, tparam, tgoto):
24301 Use const pointers where appropriate.
24302
24303 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24304 * cm.h (struct cm): Likewise.
24305 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24306 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24307 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24308 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24309 (turn_on_face, init_tty): Likewise.
24310 * termchar.h (struct tty_display_info): Likewise.
24311
24312 * term.c (term_mouse_position): Rename local to avoid shadowing.
24313
24314 * alloc.c (mark_ttys): Move decl from here ...
24315 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24316
24317 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24318
24319 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24320
24321 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24322
24323 * search.c (compile_pattern_1): Remove argument regp, unused since
24324 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24325 (compile_pattern): Don't pass it.
24326
24327 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24328
24329 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24330 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24331 for ! HAVE_GTK3.
24332 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24333
24334 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24335
24336 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24337 gdk_window_get_screen, gdk_window_get_geometry,
24338 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24339 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24340 (xg_get_pixbuf_from_pixmap): New function.
24341 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24342 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24343 Call xg_get_pixbuf_from_pixmap instead of
24344 gdk_pixbuf_get_from_drawable.
24345 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24346 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24347 (xg_check_special_colors): Use GtkStyleContext and its functions
24348 for HAVE_GTK3.
24349 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24350 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24351 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24352 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24353 Call gtk_widget_get_preferred_size.
24354 (xg_frame_resized): gdk_window_get_geometry only takes 5
24355 parameters.
24356 (xg_win_to_widget, xg_event_is_for_menubar):
24357 Call gdk_x11_window_lookup_for_display.
24358 (xg_set_widget_bg): New function.
24359 (delete_cb): New function.
24360 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24361 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24362 (xg_set_background_color): Call xg_set_widget_bg.
24363 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24364 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24365 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24366 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24367 if ! HAVE_GTK3.
24368 (update_frame_tool_bar): Call gtk_widget_hide.
24369 (xg_initialize): Use GDK_KEY_g.
24370
24371 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24372 if ! HAVE_GTK3
24373 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24374
24375 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24376 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24377 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24378
24379 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24380
24381 * w32xfns.c (select_palette): Check success of RealizePalette against
24382 GDI_ERROR, not zero.
24383
24384 See ChangeLog.11 for earlier changes.
24385
24386 ;; Local Variables:
24387 ;; coding: utf-8
24388 ;; End:
24389
24390 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24391
24392 This file is part of GNU Emacs.
24393
24394 GNU Emacs is free software: you can redistribute it and/or modify
24395 it under the terms of the GNU General Public License as published by
24396 the Free Software Foundation, either version 3 of the License, or
24397 (at your option) any later version.
24398
24399 GNU Emacs is distributed in the hope that it will be useful,
24400 but WITHOUT ANY WARRANTY; without even the implied warranty of
24401 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24402 GNU General Public License for more details.
24403
24404 You should have received a copy of the GNU General Public License
24405 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.