1 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
5 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
7 Port --enable-gcc-warnings to clang.
8 * bytecode.c (exec_byte_code):
10 Redo diagnostic pragmas to pacify clang, too.
11 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
12 * editfns.c (Fencode_time):
13 * fileio.c (file_accessible_directory_p):
14 * font.c (font_unparse_xlfd):
15 Use '&"string"[index]' instead of '"string" + (index)'.
16 * undo.c (user_error): Remove; unused.
18 2013-05-16 Eli Zaretskii <eliz@gnu.org>
20 * insdel.c (insert_1_both): Document the arguments, instead of
21 referring to insert_1, which no longer exists.
23 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
24 some window, increment windows_or_buffers_changed, so that
25 *Messages* display in that window is updated. (Bug#14408)
27 * w32.c: Include epaths.h.
28 (init_environment): Use cmdproxy.exe without leading directories.
29 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
31 (gettimeofday): Adjust signature and return value to Posix
34 * unexw32.c (open_output_file): Delete the existing emacs.exe
35 before creating it, to break the hard link to the versioned
38 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
39 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
40 (FIRSTFILE_OBJ): New variables.
41 (W32_RES): Rename to EMACSRES. All users changed.
42 (base_obj): Use $(CM_OBJ).
43 (ALLOBJS): Use $(FIRSTFILE_OBJ).
44 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
45 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
46 $(W32_RES_LINK) before $(LIBES).
47 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
49 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
51 * makefile.w32-in (DOC): Use just "DOC".
53 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
55 * process.c: Export default filters and sentinels to Elisp.
56 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
58 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
59 (Fset_process_sentinel, Fformat_network_address):
60 Default to them instead of nil.
61 (server_accept_connection): Sentinels can't be nil any more.
62 (read_and_dispose_of_process_output): New function, extracted from
64 (read_process_output): Use it; filters can't be nil.
65 (Finternal_default_process_filter): New function, extracted from
67 (exec_sentinel_unwind): Remove function.
68 (exec_sentinel): Don't zilch sentinel while running.
69 (status_notify): Sentinels can't be nil.
70 (Finternal_default_process_sentinel): New function extracted from
72 (setup_process_coding_systems): Default filter is not nil any more.
73 (syms_of_process): Export new Elisp functions and initialize
75 * lisp.h (make_lisp_proc): New function.
77 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
79 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
81 2013-05-14 Eli Zaretskii <eliz@gnu.org>
83 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
84 unless we know that the window w is a leaf window.
85 Another attempt at solving bug#14062.
87 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
89 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
92 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
94 * image.c (gif_load): Check that subimages fit (Bug#14345).
96 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
98 * lread.c (skip_dyn_eof): New function.
99 (read1): Use it to skip the end of a file in response to #@00.
101 * doc.c (get_doc_string): Slightly relax the sanity checking.
103 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
105 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
106 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
107 (MonitorInfo): New struct.
108 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
109 (Fns_display_monitor_attributes_list): New functions.
110 (display-usable-bounds): Remove.
111 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
114 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
116 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
117 (GTK_CHECK_VERSION): New macro, if not already defined.
118 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
119 replaced by GTK_CHECK_VERSION.
121 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
123 * xterm.h (GTK_PREREQ): New macro.
124 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
125 to use this macro instead, for consistency and clarity.
127 2013-05-08 Eli Zaretskii <eliz@gnu.org>
129 * xdisp.c (row_for_charpos_p): New function, with code of
130 cursor_row_p, but accepts an additional argument CHARPOS instead
131 of using a hardcoded PT.
132 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
133 (row_containing_pos): Call row_for_charpos_p instead of partially
134 doing the same. Fixes cursor positioning under longlines-mode
135 when longlines-show-effect includes more than one newline, when
136 moving the cursor vertically up.
138 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
140 * makefile.w32-in (ACL_H): New macro.
141 ($(BLD)/fileio.$(O)): Update dependencies.
143 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
145 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
146 * Makefile.in (LIB_ACL): New macro.
147 (LIBACL_LIBS): Remove.
148 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
149 * fileio.c: Include <acl.h>.
150 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
151 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
153 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
156 * unexelf.c: Don't assume ElfW (Half) fits in int.
157 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
158 when dealing with ElfW (Half) values, since they can exceed 2**31
159 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
160 (entry_address): Omit unused NUM arg. All uses changed.
162 2013-05-07 Juri Linkov <juri@jurta.org>
164 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
165 to the string converted from number with `Fnumber_to_string'.
168 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
170 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
171 This fixes a problem introduced by my previous change.
173 2013-05-07 Glenn Morris <rgm@gnu.org>
175 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
177 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
179 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
181 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
183 Static checking by GCC 4.8.0.
184 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
185 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
186 (x_get_monitor_attributes_fallback)
187 (x_get_monitor_attributes_xinerama)
188 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
189 Define only if USE_GTK.
190 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
191 (x_get_monitor_attributes_fallback): Omit unused locals.
192 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
193 Use double, not float, to avoid mixed-mode floating point arithmetic.
195 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
196 Jan Djärv <jan.h.d@swipnet.se>
198 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
199 (XINERAMA_CFLAGS): New macros.
200 (ALL_CFLAGS, LIBES): Use them.
202 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
203 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
204 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
205 (syms_of_xfns): DEFSYM them.
206 (struct MonitorInfo): New struct.
207 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
208 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
209 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
210 (x_get_monitor_attributes_xinerama): New functions.
211 (Fx_display_monitor_attributes_list): New primitive.
212 (syms_of_xfns): Defsubr it.
214 * xterm.h (x_display_info): Add Xatom_net_workarea and
215 Xatom_net_current_desktop.
217 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
218 and dpyinfo->Xatom_net_current_desktop.
220 2013-05-06 Eli Zaretskii <eliz@gnu.org>
222 * xdisp.c (pos_visible_p): Use the special code for finding the
223 beginning of a display property or overlay for any "replacing"
224 display property, not just for display strings. This solves
225 incorrect reporting of position by posn-at-point. (Bug#14241)
227 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
229 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
230 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
231 Verify that ElfW (Half) fits in int.
232 (fatal): Use same signature as lisp.h.
233 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
234 configure and build with -DUNEXELF_DEBUG without worrying about
235 other modules that use DEBUG.
236 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
237 possibly-wide integers now uses it instead of plain fprintf.
238 (entry_address): New function, which avoids problems with 32-bit
239 overflow on 64-bit hosts.
240 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
241 (round_up): Don't assume the remainder fits in int.
242 (find_section): Use bool for boolean. Simplify debug code.
243 (unexec): Don't assume file sizes fit in int or size_t.
244 Omit unnecessary trailing newline in 'fatal' format.
245 Use strerror rather than outputting decimal error number.
246 Remove unused code when emacs is not defined;
247 this file relies on Emacs now.
248 Don't assume e_phnum and e_shnum are positive.
250 * regex.c: Fix problems when DEBUG is defined.
251 (extract_number, extract_number_and_incr): Define regardless of
252 whether DEBUG is defined; that's simpler and makes the code less
253 likely to go stale in the normal case when DEBUG is not defined.
254 Return int rather than taking an int * arg. All callers changed.
255 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
256 Remove, replacing with ...
257 (DEBUG_PRINT): New macro. All callers changed.
258 (DEBUG_COMPILES_ARGUMENTS): New macro.
259 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
260 (print_compiled_pattern, print_double_string) [DEBUG]:
261 Use prototype rather than old-style definition.
262 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
263 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
264 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
265 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
266 Don't assume ptrdiff_t, size_t, and long are the same width as int.
267 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
268 This matters only when DEBUG is defined.
270 2013-05-05 Eli Zaretskii <eliz@gnu.org>
272 * xdisp.c (set_iterator_to_next): Set the
273 ignore_overlay_strings_at_pos_p flag only if we are _really_
274 iterating over an overlay string, as indicated by the
275 current.overlay_string_index member. (Bug#14306)
277 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
279 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
280 to where it is used, to avoid autorelease issues (Bug#14050).
282 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
284 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
285 * fileio.c (syms_of_fileio): Implement this.
286 * filelock.c (create_lock_file): If symbolic links don't work, so
287 we use a regular file as a lock file, do not fsync the lock file;
290 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
292 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
293 (syms_of_minibuf): Adjust accodingly.
295 * callint.c (Fcall_interactively): Adjust calls accordingly.
297 2013-05-04 Eli Zaretskii <eliz@gnu.org>
299 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
300 w->contents is a buffer before computing everything else.
301 Use parentheses to disambiguate last part of the condition.
303 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
304 assertion violations. (Bug#14062)
306 2013-05-01 David Reitter <david.reitter@gmail.com>
308 * nsfns.m (ns_tooltip): Initialize.
310 2013-04-28 Eli Zaretskii <eliz@gnu.org>
312 * coding.c (decode_coding_gap): Don't remove the character before
313 a newline unless it's a CR character. (Bug#14287)
315 2013-04-28 Dan Nicolaescu <dann@gnu.org>
317 * dispextern.h (struct face): Move enum face_underline_type
318 earlier so that bitfields can be in the same word.
320 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
322 * nsfns.m (handlePanelKeys): New function.
323 (EmacsOpenPanel:performKeyEquivalent:)
324 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
325 arrows/function/control and copy/paste keys (Bug#14296).
327 2013-04-27 Juri Linkov <juri@jurta.org>
329 * callint.c (Fcall_interactively): Call `Qread_number' for
330 interactive code letter `n' instead of using duplicate code.
333 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
335 * systime.h (make_timeval): Declare as 'const'.
337 2013-04-27 Kenichi Handa <handa@gnu.org>
339 * font.c (font_open_entity): Always open a font of manageable
342 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
344 Port better to AIX (Bug#14258).
345 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
348 2013-04-24 Kenichi Handa <handa@gnu.org>
350 * coding.c (decode_coding_iso_2022): When an invalid escape
351 sequence is encountered, reset the invocation and designation
352 status to the safest one.
354 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
356 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
357 Without this fix, "make distclean" leaves stamp-h1 behind.
359 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
361 * w32fns.c (w32_fullscreen_rect): New function to compute the
362 window rectangle for the given fullscreen mode.
363 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
364 longer tunes the window size. This keeps the window's edges flush
365 with the screen and allows the taskbar to hide itself in fullboth.
367 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
368 window decorations and uses the entire screen.
370 * w32term.h (w32_fullscreen_rect) Add prototype.
371 (struct w32_output): Replace normal_width, normal_height,
372 normal_top, and normal_left members with a single normal_placement
374 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
376 (FRAME_NORMAL_PLACEMENT): New macro.
378 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
380 * minibuf.c (Ftest_completion): Silence compiler warning.
382 2013-04-15 Eli Zaretskii <eliz@gnu.org>
384 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
387 * frame.h (WINDOW_FRAME): Protect macro and its argument with
390 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
391 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
392 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
393 parentheses where appropriate.
395 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
397 * keyboard.c (timer_start_idle): Remove no-longer-used local.
399 2013-04-14 Eli Zaretskii <eliz@gnu.org>
401 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
402 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
403 Mention in the doc string that setting these variables takes
404 effect only after a call to set-window-buffer. (Bug#14200)
406 2013-04-13 Eli Zaretskii <eliz@gnu.org>
408 * indent.c (Fvertical_motion): Don't consider display strings on
409 overlay strings as display strings on the buffer position we
410 started from. This prevents vertical cursor motion from jumping
411 more than one line when there's an overlay string with a display
412 property at end of line.
413 Reported by Karl Chen <Karl.Chen@quarl.org> in
414 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
416 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
418 * window.c (select_window): `record_buffer' even if window is
419 already selected (bug#14191).
421 2013-04-11 Eli Zaretskii <eliz@gnu.org>
423 * window.c (Fwindow_end): Test more flags, including the buffer's
424 last_overlay_modified flag, to determine whether the window's
425 display is really up-to-date. Prevents the function from
426 returning a stale value. (Bug#14170)
427 (Fwindow_line_height): Fix the test for up-to-date-ness of the
430 2013-04-10 Eli Zaretskii <eliz@gnu.org>
432 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
433 garbaged only if it is not already the top frame on its TTY.
434 This prevents flickering due to constant redrawing of TTY frames when
435 there are GUI frames open in the same session. (Bug#13864)
437 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
439 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
440 of marking the idle timers directly.
442 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
444 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
447 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
449 * window.c (select_window): Don't record_buffer while the invariant is
450 temporarily broken (bug#14161).
452 * fns.c (Fdelq): Don't assume !NILP => CONSP.
454 2013-04-07 Eli Zaretskii <eliz@gnu.org>
456 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
458 2013-04-07 Romain Francoise <romain@orebokech.com>
460 Ignore additional platform-specific ACL errors (Bug#13702).
461 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
462 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
464 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
466 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
469 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
471 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
472 This bug was introduced by my 2013-02-25 change that simplified
473 data_start configuration. Without this change, on GNU/Linux
474 an Emacs configured with --enable-profiling fails immediately
475 due to a profiler signal.
476 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
477 with these flags. On platforms where special flags are needed
478 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
479 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
480 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
482 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
484 Get rid of some platform-specific functions examining window
485 system and its capabilities. This is a partial rework of the
487 * lisp.h (have_menus_p): Remove prototype. This function is
488 replaced with platform-independent window_system_available.
489 (check_window_system): Move to...
490 * frame.h (decode_window_system_frame, window_system_available):
491 ...here, add new prototypes.
492 * frame.c (window_system_available, decode_window_system_frame):
494 (check_window_system): Platform-independent now.
495 * xterm.h (x_in_use): Remove declaration.
497 * w32term.h (check_x_frame):
498 * nsterm.h (check_x_frame): Remove prototypes. This function
499 is replaced with platform-independent decode_window_system_frame.
500 * msdos.c (have_menus_p): Remove.
501 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
502 Remove platform-specific functions. Use check_window_system,
503 decode_window_system_frame and check_ns_display_info where
504 appropriate. Minor style and comment tweaks.
505 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
506 (check_x_frame): Likewise.
507 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
509 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
510 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
511 * xmenu.c, xselect.c: All related users changed.
513 2013-04-03 Kenichi Handa <handa@gnu.org>
515 The following changes is to optimize the code for reading UTF-8
518 * coding.c (check_ascii): Rename from detect_ascii. Return value
519 changed. Check EOL format. Do not call adjust_coding_eol_type
521 (check_utf_8): New function.
522 (adjust_coding_eol_type): Do nothing if already adjusted.
523 (detect_coding): Compare the return value of check_ascii with
524 coding->src_bytes. Call adjust_coding_eol_type if necessary.
525 (decode_coding_gap): Optimize for valid UTF-8.
527 2013-03-21 Kenichi Handa <handa@gnu.org>
529 * coding.c (syms_of_coding): Cancel previous change.
531 * insdel.c (insert_from_gap): Fix previous change.
533 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
535 Consistently use platform-specific function to detect window system.
536 * lisp.h (check_window_system): New prototype. This function is
537 going to replace check_x, check_w32 and check_ns.
538 (have_menus_p): Mention msdos.c in comment.
539 * fontset.c (check_window_system_func): Remove. Adjust all users.
540 * fontset.h (check_window_system_func): Remove prototype.
541 * nsterm.h (check_ns):
543 * w32term.h (check_w32): Likewise.
544 * menu.c (Fx_popup_menu): Use check_window_system.
545 * msdos.c (check_window_system): Define for MS-DOS.
546 * nsfns.m (check_window_system): Define for NS. Adjust all users.
547 * w32fns.c (check_window_system): Likewise for MS-Windows.
548 * xfns.c (check_window_system): Likewise for X.
549 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
550 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
552 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
554 Prefer < to > in range checks such as 0 <= i && i < N.
555 This makes it easier to visualize quantities on a number line.
556 This patch doesn't apply to all such range checks,
557 only to the range checks affected by the 2013-03-24 change.
558 This patch reverts most of the 2013-03-24 change.
559 * alloc.c (xpalloc, Fgarbage_collect):
560 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
561 * character.c (string_escape_byte8):
562 * charset.c (read_hex):
563 * data.c (cons_to_unsigned):
564 * dispnew.c (update_frame_1):
565 * doc.c (Fsubstitute_command_keys):
567 * editfns.c (hi_time, decode_time_components):
568 * fileio.c (file_offset):
569 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
570 * font.c (font_intern_prop):
571 * frame.c (x_set_alpha):
572 * gtkutil.c (get_utf8_string):
573 * indent.c (check_display_width):
574 * keymap.c (Fkey_description):
575 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
577 * minibuf.c (read_minibuf_noninteractive):
578 * process.c (wait_reading_process_output):
579 * search.c (Freplace_match):
580 * window.c (get_phys_cursor_glyph):
581 * xdisp.c (redisplay_internal):
582 * xsmfns.c (smc_save_yourself_CB):
583 Prefer < to > for range checks.
584 * dispnew.c (sit_for): Don't mishandle NaNs.
585 This fixes a bug introduced in the 2013-03-24 change.
586 * editfns.c (decode_time_components): Don't hoist comparison.
587 This fixes another bug introduced in the 2013-03-24 change.
589 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
591 * frame.h (struct frame): Drop scroll_bottom_vpos
592 member becaue all real users are dead long ago.
593 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
594 * xdisp.c (redisplay_internal): Adjust user.
596 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
598 * nsmenu.m (showAtX:Y:for:): setLevel to
599 NSPopUpMenuWindowLevel (Bug#13998).
601 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
603 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
604 (ns_check_pending_open_menu): Declare.
606 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
607 (x_activate_menubar): Update the menu with title that matches
608 ns_get_pending_menu_title, and call
609 ns_check_pending_openmenu (Bug#12698).
610 (menuWillOpen:): New method.
611 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
613 * nsterm.m (menu_will_open_state, menu_mouse_point)
614 (menu_pending_title): New varaibles.
615 (ns_get_pending_menu_title, ns_check_menu_open)
616 (ns_check_pending_open_menu): New functions.
618 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
620 * indent.c (current_column_bol_cache): Remove leftover which is not
621 used in Fmove_to_column any more.
622 (current_column, scan_for_column): Adjust users.
623 * keyboard.c (last_point_position_buffer, last_point_position_window):
624 Remove leftovers which are not used for recording undo any more.
625 (command_loop_1, syms_of_keyboard): Adjust users.
626 * xdisp.c (last_max_ascent): Remove leftover which is not used in
627 redisplay_window any more.
628 (move_it_to): Adjust user.
630 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
632 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
635 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
637 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
638 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
641 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
643 * window.h (struct window): Replace hchild, vchild and buffer slots
644 with the only contents slot. This is possible because each valid
645 window may have either the child window (in vertical or horizontal
646 combination) or buffer to display (for the leaf window). Using that,
647 a lof of operations to traverse and/or change window hierarchies may
648 be simplified. New member horizontal is used to distinguish between
649 horizontal and vertical combinations of internal windows.
650 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
651 (WINDOW_VERTICAL_COMBINATION_P): New macros.
652 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
653 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
654 Use contents slot, not buffer, where appropriate.
655 (wset_combination): New function.
656 (wset_buffer): Add eassert.
657 (Fframe_first_window): Simplify the loop reaching first window.
658 (Fwindow_buffer): Use WINDOW_LEAF_P.
659 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
660 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
661 (unshow_buffer): Convert initial debugging check to eassert.
662 (replace_window, recombine_windows, Fdelete_other_windows_internal)
663 (make_parent_window, window_resize_check, window_resize_apply)
664 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
665 (Fset_window_configuration, delete_all_child_windows, save_window_save):
666 Adjust to match struct window changes.
667 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
668 (mark_window_cursors_off, count_windows, get_leaf_windows)
669 (foreach_window_1): Simplify the loop.
670 * alloc.c (mark_object): Do not check for the leaf window because
671 internal windows has no glyph matrices anyway.
672 * dispnew.c (clear_window_matrices, showing_window_margins_p)
673 (allocate_matrices_for_window_redisplay, fake_current_matrices)
674 (allocate_matrices_for_frame_redisplay, free_window_matrices)
675 (build_frame_matrix_from_window_tree, mirror_make_current)
676 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
677 (update_window_tree, set_window_update_flags): Simplify the loop.
678 (sync_window_with_frame_matrix_rows): Enforce live window.
679 Use contents slot, not buffer, where appropriate.
680 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
681 and WINDOW_HORIZONTAL_COMBINATION_P.
682 (make_frame_visible_1): Simplify the loop.
683 Use contents slot, not buffer, where appropriate.
684 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
685 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
686 (expose_window_tree): Likewise.
687 Use contents slot, not buffer, where appropriate.
688 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
689 to avoid deleted windows. Use contents slot instead of buffer.
690 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
691 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
692 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
693 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
695 2013-03-28 Eli Zaretskii <eliz@gnu.org>
697 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
698 identify the reasons for assertion violations in bug#14062 and
700 (Fx_show_tip): Fix compilation error under
701 "--enable-check-lisp-object-type". (Bug#14073)
703 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
704 Reported by <rzl24ozi@gmail.com>.
706 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
708 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
710 (unwind_with_echo_area_buffer): ...to restore it here.
711 This is needed to ensure that...
712 (redisplay_window): ...both window markers are valid here,
713 which is verified by eassert.
714 * editfns.c (save_excursion_save): Do not assume that
715 selected_window always displays the buffer.
716 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
719 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
721 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
724 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
726 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
728 2013-03-27 Eli Zaretskii <eliz@gnu.org>
730 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
731 since MinGW's w32api headers do. This avoids compiler warnings.
733 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
736 2013-03-26 Eli Zaretskii <eliz@gnu.org>
738 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
740 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
742 * gtkutil.c (style_changed_cb): Check if frame is live and an
745 2013-03-26 Eli Zaretskii <eliz@gnu.org>
747 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
748 Define only for _WIN32_WINNT less than 0x0500.
749 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
751 Move inclusion of time.h before sys/time.h, so that MinGW64 could
752 see its own definitions of 'struct timeval' and 'struct timezone'.
754 Fix incompatibilities between MinGW.org and MinGW64 headers.
755 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
757 * w32.c (REPARSE_DATA_BUFFER): Guard with
758 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
760 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
762 * xterm.c: Include X11/XKBlib.h
763 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
765 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
767 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
769 * blockinput.h (input_blocked_p): Likewise.
770 * bytecode.c (exec_byte_code): Likewise.
771 * callproc.c (call_process_kill, call_process_cleanup)
772 (Fcall_process): Likewise.
773 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
774 (Fccl_execute_on_string): Likewise.
775 * character.c (string_escape_byte8): Likewise.
776 * charset.c (read_hex): Likewise.
777 * cm.c (calccost): Likewise.
778 * data.c (cons_to_unsigned): Likewise.
779 * dired.c (directory_files_internal, file_name_completion):
781 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
783 * doc.c (Fsubstitute_command_keys): Likewise.
784 * doprnt.c (doprnt): Likewise.
785 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
786 * emacsgtkfixed.c: Likewise.
787 * fileio.c (file_offset, Fwrite_region): Likewise.
788 * floatfns.c (Fexpt, fmod_float): Likewise.
789 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
791 * font.c (font_intern_prop): Likewise.
792 * frame.c (x_set_alpha): Likewise.
793 * gtkutil.c (get_utf8_string): Likewise.
794 * indent.c (check_display_width): Likewise.
795 * intervals.c (create_root_interval, rotate_right, rotate_left)
796 (split_interval_right, split_interval_left)
797 (adjust_intervals_for_insertion, delete_node)
798 (interval_deletion_adjustment, adjust_intervals_for_deletion)
799 (merge_interval_right, merge_interval_left, copy_intervals)
800 (set_intervals_multibyte_1): Likewise.
801 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
802 * keymap.c (Fkey_description): Likewise.
803 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
804 * lread.c (openp, read_integer, read1, string_to_number):
806 * menu.c (ensure_menu_items): Likewise.
807 * minibuf.c (read_minibuf_noninteractive): Likewise.
808 * print.c (printchar, strout): Likewise.
809 * process.c (create_process, Faccept_process_output)
810 (wait_reading_process_output, read_process_output, send_process)
811 (wait_reading_process_output): Likewise.
812 * profiler.c (make_log, handle_profiler_signal): Likewise.
813 * regex.c (re_exec): Likewise.
815 * search.c (looking_at_1, Freplace_match): Likewise.
816 * sysdep.c (get_child_status, procfs_ttyname)
817 (procfs_get_total_memory): Likewise.
818 * systime.h (EMACS_TIME_VALID_P): Likewise.
819 * term.c (dissociate_if_controlling_tty): Likewise.
820 * window.c (get_phys_cursor_glyph): Likewise.
821 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
822 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
824 * xfns.c (Fx_window_property): Likewise.
825 * xmenu.c (set_frame_menubar): Likewise.
826 * xselect.c (x_get_window_property, x_handle_dnd_message):
828 * xsmfns.c (smc_save_yourself_CB): Likewise.
829 * xterm.c (x_scroll_bar_set_handle): Likewise.
831 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
833 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
834 to be optional or nil. Adjust comment and convert it to docstring.
835 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
836 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
838 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
840 Static checking by GCC 4.8-20130319.
841 * image.c (gif_load): Assume pass < 3 to pacify GCC.
842 * process.c (Fset_process_datagram_address)
843 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
844 * xdisp.c (get_char_face_and_encoding):
845 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
846 (get_glyph_face_and_encoding): Prepare face before possibly using it.
847 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
849 2013-03-24 Ken Brown <kbrown@cornell.edu>
851 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
852 fix compilation on 64-bit Cygwin, where underscores are not
853 automatically prepended.
855 * w32term.c (w32_initialize): Silence compiler warning.
857 2013-03-23 Eli Zaretskii <eliz@gnu.org>
859 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
860 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
861 variables, to save and restore frame dimensions.
862 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
863 after returning from a 'fullscreen' configuration.
864 use SendMessage instead of PostMessage to send the SC_RESTORE message,
865 to avoid races between the main thread and the input thread.
867 * w32term.h (struct w32_output): New members normal_width,
868 normal_height, normal_top, normal_left, and prev_fsmode.
869 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
870 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
873 * w32term.c (w32fullscreen_hook): Record last value of the frame's
874 'fullscreen' parameter. Always record previous width and height
875 of the frame, except when switching out of maximized modes, so
876 that they could be restored correctly, instead of resetting to the
877 default frame dimensions. Send SC_RESTORE command to the frame,
878 unless we are going to send SC_MAXIMIZE, to restore the frame
879 resize hints in the mouse pointer shown by the window manager.
882 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
884 * lisp.h (get_frame_param): Adjust conditions for prototype
887 2013-03-22 Ken Brown <kbrown@cornell.edu>
889 * unexcw.c: Drop unneeded inclusion of w32common.h.
890 (report_sheap_usage): Declare.
891 (read_exe_header): Add magic numbers for x86_64.
892 (fixup_executable): Fix printf format specifier for unsigned long
895 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
897 * frame.h (struct frame): Put menu_bar_window under #ifdef
898 because this member is not needed when X toolkit is in use.
899 (fset_menu_bar_window):
900 * dispnew.c (clear_current_matrices, clear_desired_matrices)
901 (free_glyphs, update_frame):
902 * xdisp.c (expose_frame): Likewise.
903 (display_menu_bar): Likewise. Remove redundant eassert.
904 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
907 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
909 Use functions and constants to manipulate Lisp_Save_Value objects.
910 This replaces code that used macros and strings and token-pasting.
911 The change makes the C source a bit easier to follow,
912 and shrinks the Emacs executable a bit.
913 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
914 (make_save_value): Change 1st arg from string to enum. All callers
917 (mark_object): Use if, not #if, for GC_MARK_STACK.
918 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
919 (XSAVE_OBJECT): Now functions, not macros.
920 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
921 the constant was never used.
922 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
923 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
924 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
925 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
927 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
928 type3 with a single member save_type. All uses changed.
929 (save_type, set_save_pointer, set_save_integer): New functions.
930 * print.c (PRINTX): Remove.
932 * alloc.c: Remove redundant static declarations.
934 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
936 * window.h (struct window): Convert left_col, top_line, total_lines
937 and total_cols from Lisp_Objects to integers. Adjust comments.
938 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
940 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
941 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
942 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
943 Adjust users where appropriate.
945 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
947 * frame.h (struct frame): Drop resx and resy because the same data is
948 available from window system-specific output context. Adjust users.
949 (default_pixels_per_inch_x, default_pixels_per_inch_y):
950 New functions to provide defaults when no window system available.
951 (FRAME_RES_X, FRAME_RES_Y): New macros.
952 (NUMVAL): Move from xdisp.c.
953 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
954 (Ffont_face_attributes, Fopen_font):
956 * w32font.c (fill_in_logfont):
957 * xdisp.c (calc_pixel_width_or_height):
958 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
959 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
961 2013-03-20 Kenichi Handa <handa@gnu.org>
963 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
964 to 1 (temporary workaround until a bug related to ASCII
965 optimization is fixed).
967 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
969 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
970 Signal error if window is not internal. Adjust docstring.
971 (delete_all_child_windows): Use combination_limit to save the buffer.
972 (Fset_window_configuration): Adjust accordingly.
973 * print.c (syms_of_print): Initialize debugging output not here...
974 (init_print_once): ...but in a new function here.
975 * lisp.h (init_print_once): Add prototype.
976 * emacs.c (main): Add call to init_print_once. Adjust comments.
978 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
980 * window.c (window_resize_check, window_resize_apply)
981 (window_from_coordinates, recombine_windows, set_window_buffer)
982 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
983 (Fsplit_window_internal, Fdelete_window_internal)
984 (freeze_window_starts): Use bool for booleans.
985 * window.h (window_frame_coordinates, resize_frame_windows)
986 (freeze_window_starts, set_window_buffer): Adjust prototypes.
988 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
990 * dispnew.c (bitch_at_user): Use `user-error'.
992 2013-03-17 Ken Brown <kbrown@cornell.edu>
994 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
995 as return type of image_background. (Bug#13981)
996 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
998 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1000 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1001 (ns_select): Don't return with result uninitialized.
1003 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1006 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1008 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1009 directories. If filename is nil, get directory name (Bug#13932).
1010 Use getFilename and getDirectory.
1011 (getFilename, getDirectory): New methods for EmacsSavePanel and
1013 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1015 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1017 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1019 2013-03-15 Kenichi Handa <handa@gnu.org>
1021 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1022 (adjust_after_replace): Make it back to static. Delete the third
1023 arg text_at_gap_tail. Cancel the code for handling it.
1025 * coding.h (struct coding_system): New member eol_seen.
1027 * coding.c (detect_ascii): New function.
1028 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1029 when the source bytes are actually scanned. On detecting for
1030 coding_category_utf_8_auto, call detect_ascii instead of scanning
1031 source bytes directly.
1032 (produce_chars): Call insert_from_gap with the new arg 0.
1033 (encode_coding): Likewise.
1034 (decode_coding_gap): Control ASCII optimization by the variable
1035 disable_ascii_optimization instead of #ifndef .. #endif.
1036 Deccode EOL format according to coding->eol_seen.
1037 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1040 * lisp.h (adjust_after_replace): Cancel externing it.
1041 (insert_from_gap): Adjust prototype.
1043 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1045 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1046 FULLSCREEN_MAXIMIZED. (Bug#13935)
1048 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1050 * region-cache.c (find_cache_boundary, move_cache_gap)
1051 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1052 Simplify debugging check and convert to eassert. Adjust comment.
1053 (pp_cache): Put under ENABLE_CHECKING.
1055 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1057 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1058 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1060 (w32fullscreen_hook): If the frame is visible, reset
1061 f->want_fullscreen flag after changing the frame size. If the
1062 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1065 2013-03-13 Daniel Colascione <dancol@dancol.org>
1067 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1068 too so that these builds can use Cygwin's file conversion
1069 functions. (We've been building and linking cygw32.o all along
1070 and just not using it.)
1072 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1074 File synchronization fixes (Bug#13944).
1075 * Makefile.in (LIB_FDATASYNC): New macro.
1077 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1078 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1079 Don't worry about HAVE_FSYNC, since a substitute fsync is
1080 available if the system lacks one.
1081 (Fwrite_regin): Retry fsync if interrupted.
1083 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1085 * w32term.c (w32_read_socket): If the Emacs frame is being
1086 activated, call w32fullscreen_hook, to make sure the new frame
1087 dimensions are in effect. (Bug#13937)
1089 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1091 * xdisp.c (init_iterator): Simplify because both character and byte
1092 positions are either specified or -1. Add eassert. Adjust comment.
1093 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1094 character and byte positions can be obtained from marker.
1096 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1098 Static checking by Sun C 5.12.
1099 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1100 * bytecode.c (exec_byte_code):
1101 * dispnew.c (init_display):
1103 * fileio.c (Fsubstitute_in_file_name):
1104 * keyboard.c (Fevent_convert_list):
1105 * keymap.c (Fsingle_key_description):
1106 * term.c (maybe_fatal, fatal):
1107 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1108 * xsmfns.c (Fhandle_save_session):
1109 Omit unreachable code.
1110 * keymap.c (map_keymap_char_table_item): Cast void * to
1111 a function pointer type; the C Standard requires this.
1113 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1114 Include <sys/param.h> unconditionally, as that works elsewhere and
1115 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1116 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1119 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1121 * insdel.c (adjust_after_replace): Use bool for boolean.
1123 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1125 * keyboard.c: Move keyboard decoding to read_key_sequence.
1126 (decode_keyboard_code): Remove.
1127 (tty_read_avail_input): Don't try to decode input.
1128 (read_decoded_char): New function.
1129 (read_key_sequence): Use it.
1131 2013-03-10 Daniel Colascione <dancol@dancol.org>
1133 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1134 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1135 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1138 * w32term.c (construct_drag_n_drop): Use the above macros to make
1139 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1141 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1142 properly display non-ASCII frame titles in cygw32 builds.
1144 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1145 call ShellExecute in cygw32 builds.
1147 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1148 common file dialog code.
1150 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1151 can just use du like other systems.
1153 * coding.c (from_unicode_buffer): Declare.
1154 * coding.c (from_unicode_buffer): Implement.
1156 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1158 * lread.c: Minor cleanup.
1159 (FROM_FILE_P): New macro.
1160 (skip_dyn_bytes, unreadchar, read1): Use it.
1161 (read_list): Consolidate duplicated code.
1163 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1165 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1167 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1168 (redisplay_internal, set_cursor_from_row, try_window)
1169 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1170 (display_line, notice_overwritten_cursor)
1171 (mouse_face_from_buffer_pos, note_mouse_highlight):
1172 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1173 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1174 (mouse_face_from_string_pos, fast_find_string_pos):
1175 Use MATRIX_ROW_VPOS.
1177 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1179 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1181 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1182 MATRIX_MODE_LINE_ROW.
1184 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1186 2013-03-10 handa <handa@gnu.org>
1188 * lisp.h (adjust_after_replace): Extern it.
1190 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1191 case of detection for coding_category_utf_8_auto.
1192 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1193 Skip decoding if all bytes are ASCII.
1195 * insdel.c (adjust_after_replace): Make it public. New arg
1197 (adjust_after_insert): Call adjust_after_replace with the new arg
1200 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1202 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1203 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1204 from Elisp via unread-command-events.
1206 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1207 functions to mean "no change".
1209 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1211 region-cache.c, scroll.c, search.c: Use bool for booleans.
1212 * lisp.h (compile_pattern):
1213 * scroll.c (do_scrolling, do_direct_scrolling):
1214 * search.c (struct regexp_cache, compile_pattern_1)
1215 (compile_pattern, string_match_1, search_command)
1216 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1217 (search_regs_saved, Fregexp_quote):
1218 Use bool for boolean.
1219 * region-cache.c (region_cache_forward, region_cache_backward):
1220 Fix comments to match code: these functions return int, not boolean.
1222 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1224 * search.c (find_newline): Accept start and end byte positions
1225 as arguments and allow -1 if not known.
1226 (find_newline_no_quit): Likewise for start position.
1227 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1228 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1229 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1230 * editfns.c (Fconstrain_to_field): Break long line.
1231 Adjust call to find_newline.
1232 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1233 Use DEC_BOTH to start next search from the previous buffer
1234 position, where appropriate.
1235 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1236 (get_visually_first_element, move_it_vertically_backward): Likewise.
1237 Obtain byte position from the display iterator, where appropriate.
1239 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1241 print.c, process.c: Use bool for booleans.
1242 * lisp.h (wait_reading_process_output):
1243 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1244 (strout, debug_output_compilation_hack, float_to_string, print)
1246 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1247 (decode_status, status_message, create_process, create_pty)
1248 (Fmake_network_process, Fnetwork_interface_info)
1249 (wait_reading_process_output, read_process_output)
1250 (write_queue_push, write_queue_pop, process_send_signal)
1251 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1252 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1253 Use bool for booleans.
1254 * process.c (Fnetwork_interface_list): Remove unused local.
1255 (connect_counter): Now EMACS_INT, not int.
1257 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1259 * bidi.c (bidi_fetch_char): Swap first and second arguments
1260 to match other functions accepting character and byte positions.
1262 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1263 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1264 when you need just to move to the previous buffer position.
1265 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1267 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1269 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1271 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1273 Avoid character to byte conversions in motion subroutines.
1274 * indent.h (compute_motion, vmotion): Add byte position argument.
1275 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1277 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1278 Use list5 for return value.
1279 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1280 Adjust comments, style and calls to compute_motion.
1281 (Fvertical_motion): Adjust call to vmotion.
1282 * window.c (Fdelete_other_windows_internal): Record window start
1283 byte position and adjust call to vmotion.
1284 (window_scroll_line_based): Likewise with call to compute_motion.
1286 (Frecenter): Adjust calls to vmotion.
1288 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1290 * lisp.h (list2i, list3i): New functions.
1291 (list4i): Move from window.c and make LISP_INLINE.
1292 * editfns.c (make_lisp_time):
1293 * fns.c (Flocale_info):
1294 * keyboard.c (parse_modifiers):
1295 * xterm.c (x_ewmh_activate_frame): Use list2i.
1296 * instel.c (signal_after_change):
1297 * nsfns.m (Fx_server_version, Fxw_color_values):
1298 * w32fns.c (Fxw_color_values, Fx_server_version):
1299 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1300 * fileio.c (Fvisited_file_modtime):
1301 * nsfns.m (Fns_display_usable_bounds):
1302 * w32.c (ltime): Use list4i.
1304 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1306 * search.c (find_newline_no_quit): Rename from find_next_newline.
1309 * lisp.h (find_newline_no_quit): Rename prototype.
1311 * xdisp.c (back_to_previous_line_start)
1312 (forward_to_next_line_start, get_visually_first_element)
1313 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1314 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1315 * bidi.c (bidi_find_paragraph_start): Callers of
1316 find_newline_no_quit changed.
1318 * msdos.c: Change encoding to cp850. (Bug#13879)
1319 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1321 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1323 Coding system support cleanup and minor refactoring.
1324 * coding.h (enum coding_result_code): Remove
1325 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1326 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1327 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1328 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1329 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1330 (decode_coding_region, encode_coding_region, decode_coding_string):
1331 Remove unused compatibility macros.
1332 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1333 (record_conversion_result): Adjust user.
1334 (syms_of_coding): Likewise.
1335 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1336 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1337 (decode_coding_object): Simplify since xrealloc never returns NULL.
1340 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1342 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1343 * sysdep.c (list_system_processes)
1344 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1345 Make it a stub in this case; otherwise the build might fail,
1346 and this code hasn't been tested on such hosts anyway.
1347 Problem reported by Nelson H. F. Beebe in
1348 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1349 and analyzed by Jérémie Courrèges-Anglas in
1350 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1352 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1354 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1355 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1356 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1357 * bidi.c (bidi_find_paragraph_start): Likewise.
1358 * indent.c (vmotion): Likewise.
1360 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1362 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1363 * filelock.c: Include <c-ctype.h>.
1364 (MAX_LFINFO): New top-level constant.
1365 (lock_info_type): Remove members pid, boot_time. Add members at,
1366 dot, colon. Change user member to be the entire buffer, not a
1367 pointer. This allows us to handle the case where a foreign
1368 pid or boot time exceeds the local range. All uses changed.
1369 (LINKS_MIGHT_NOT_WORK): New constant.
1370 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1371 (defined_WINDOWSNT): Remove.
1372 (MAKE_LOCK_NAME, file_in_lock_file_name):
1373 Always use .#FILE (not .#-FILE) for the file lock,
1374 even if it is a regular file.
1375 (rename_lock_file): New function.
1376 (create_lock_file): Use it.
1377 (create_lock_file, read_lock_data):
1378 Prefer a symbolic link for the lock file, falling back on a
1379 regular file if symlinks don't work. Do not try to create
1380 symlinks on MS-Windows, due to security hassles. Stick with
1381 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1382 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1383 host may be using a Windowsish file system, and cannot use
1384 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1385 doesn't work. Don't fail merely because of a symlink-contents
1386 length limit in the current file system; fall back on regular
1387 files. Increase the symlink contents length limit to 8 KiB, this
1388 should be big enough for any real use and doesn't crunch the
1390 (create_lock_file, lock_file_1, read_lock_data):
1391 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1392 (lock_file_1): Return error number, not bool. All callers changed.
1393 (ELOOP): New macro, if not already defined.
1394 (read_lock_data): Return size of lock file contents, not Lisp object.
1395 All callers changed. Handle a race condition if some other process
1396 replaces a regular-file lock with a symlink lock or vice versa,
1397 while we're trying to read the lock.
1398 (current_lock_owner): Parse contents more carefully, to help avoid
1399 confusing a regular-file lock with some other application's use
1400 of the file. Check for lock file contents being too long, or
1401 not parsing correctly.
1402 (current_lock_owner, lock_file):
1403 Allow foreign pid and boot times that exceed the local range.
1404 (current_lock_owner, lock_if_free, lock_file):
1405 Simplify allocation of lock file contents.
1406 * w32.c (sys_rename_replace): New function, containing most of
1407 the contents of the old sys_rename.
1408 (sys_rename): Use it.
1409 (fchmod): New dummy function.
1410 * w32.h (sys_rename_replace, fchmod): New decls.
1412 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1414 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1415 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1416 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1417 <dmantipov@yandex.ru>.
1419 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1421 * composite.c (get_composition_id, fill_gstring_header):
1422 Use make_uninit_vector where appropriate.
1423 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1424 * xselect.c (clean_local_selection_data): Likewise.
1426 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1428 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1429 * image.c (imagemagick_load_image): Calculate height and width
1430 after flattening the image, not before.
1432 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1434 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1435 * ftfont.c (ftfont_shape_by_flt): Likewise.
1436 * w32uniscribe.c (uniscribe_shape): Likewise.
1438 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1440 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1441 The old approach, which fell back on DIR/.#FILE.0 through
1442 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1443 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1444 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1445 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1446 because the locking mechanism was never reliable in that case).
1447 This patch fixes this and other bugs discovered by a code
1448 inspection that was prompted by
1449 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1450 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1451 to avoid interoperability problems between the MS-Windows and
1452 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1453 instances of Emacs now ignore each others' locks.
1454 * filelock.c (defined_WINDOWSNT): New constant.
1455 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1456 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1457 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1458 regular files on MS-Windows hosts.
1459 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1460 Use SAFE_ALLOCA to avoid problems with long file names.
1461 (MAX_LFINFO): Now a local constant, not a global macro.
1462 (IS_LOCK_FILE): Remove.
1463 (lock_file_1): Don't inspect errno if symlink call succeeds;
1464 that's not portable.
1465 (lock_file): Document that this function can return if lock
1467 (lock_file): Don't access freed storage.
1469 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1471 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1473 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1475 * textprop.c: Use bool for booleans.
1476 (validate_interval_range, Fadd_text_properties)
1477 (Fremove_text_properties): Prefer bool to int when either works.
1479 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1481 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1482 If the interval tree changes as a side effect of calling
1483 modify_region, re-do processing starting from the call to
1484 validate_interval_range. (Bug#13743)
1486 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1488 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1491 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1493 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1494 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1495 access to the lock file until it is written and closed.
1498 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1500 * callint.c (Qcall_interactively):
1501 * macros.c (Qexecute_kbd_macro):
1504 2013-02-26 Bastien Guerry <bzg@gnu.org>
1506 * window.c (Frecenter): Tiny docstring enhancement.
1508 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1510 Minor textprop integer cleanup.
1511 * intervals.h, textprop.c (add_text_properties_from_list):
1512 Return void, not int, since nobody uses the return value.
1513 * textprop.c (validate_plist, add_properties, remove_properties)
1514 (Fadd_text_properties):
1515 Don't assume list length fits in int.
1516 (interval_has_all_properties, interval_has_some_properties)
1517 (interval_has_some_properties_list, add_properties, remove_properties)
1518 (Fadd_text_properties, Fremove_text_properties)
1519 (Fremove_list_of_text_properties, text_property_stickiness):
1520 Use bool for booleans.
1521 (Fadd_text_properties, Fremove_text_properties):
1522 (Fremove_list_of_text_properties):
1523 Reindent do-while as per GNU style.
1525 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1527 Implement CLASH_DETECTION for MS-Windows.
1529 * filelock.c [WINDOWSNT]: Include w32.h.
1530 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1531 function of that name. Up-case the macro arguments.
1532 (IS_LOCK_FILE): New macro.
1533 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1534 (create_lock_file): New function, with body extracted from
1536 [WINDOWSNT]: Implement lock files by writing a regular file with
1537 the lock information as its contents.
1538 (read_lock_data): New function, on Posix platforms just calls
1540 [WINDOWSNT]: Read the lock info from the file.
1541 (current_lock_owner): Call read_lock_data instead of calling
1542 emacs_readlinkat directly.
1543 (lock_file) [WINDOWSNT]: Run the file name through
1546 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1547 just check if the process by that PID exists.
1549 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1550 also present, as doing so will fail to error out if the file
1553 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1555 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1556 (Fremove_list_of_text_properties): Skip all of the intervals in
1557 the region between START and END that already have resp. don't
1558 have the requested properties, not just the first one.
1559 Add assertions that the loop afterwards always modifies the
1560 properties. (Bug#13743)
1562 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1564 * callint.c (Fcall_interactively): Use the right lexical environment
1565 for `interactive' specs (bug#13811).
1566 * eval.c (Feval): Accept a lexical environment.
1568 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1570 Simplify data_start configuration (Bug#13783).
1571 This is a followon simplification to the fix for Bug#13650.
1572 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1573 (START_FILES): Remove. All uses removed.
1574 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1575 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1576 (buildobj.h): Use it.
1577 ($(ALLOBJS)): Depend on globals.h.
1578 (temacs$(EXEEXT)): Use $(ALLOBJS).
1579 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1580 * deps.mk (vm-limit.o):
1581 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1582 Do not depend on mem-limits.h.
1583 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1584 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1585 [__GNUC__ && !ORDINARY_LINK]: Remove.
1586 * mem-limits.h, pre-crt0.c: Remove.
1587 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1588 * unexcoff.c (etext): New decl.
1589 (make_hdr): Use DATA_START instead of start_of_data.
1590 * vm-limit.c: Move most of mem-limits.h's contents here.
1591 (data_start): New decl. It's OK if this is approximate,
1592 so simplify-away some unnecessary exactness.
1593 (POINTER): Remove; all uses removed.
1594 (data_space_start): Now char *, to avoid casts.
1595 (exceeds_lisp_ptr): New function, replacing the old
1596 EXCEEDS_LISP_PTR macro. All uses changed.
1597 (check_memory_limits): Simplify and remove casts.
1598 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1599 (memory_warnings): Use data_start instead of start_of_data.
1601 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1603 * xdisp.c (set_message): Only check for debug-on-message if STRING
1604 is a string. (Bug#13797)
1606 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1608 Fix regression introduced by July 10 filelock.c patch.
1609 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1610 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1611 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1612 and diagnosed by Andreas Schwab in
1613 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1615 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1617 Assume C89 or better.
1618 * ralloc.c (SIZE, POINTER, NIL):
1619 * vm-limit.c (POINTER):
1620 Remove, replacing all uses with C89 equivalents. These old
1621 symbols were present only for porting to pre-C89 platforms.
1623 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1625 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1626 This avoids warning messages reported as part of Bug#13546.
1628 2013-02-21 Ken Brown <kbrown@cornell.edu>
1630 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1632 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1634 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1636 * keyboard.c (Qcommand_execute): New var.
1637 (command_loop_1, read_char): Use it.
1638 (Fcommand_execute): Remove, replace by an Elisp implementation.
1639 (syms_of_keyboard): Adjust accordingly.
1641 2013-02-19 Daniel Colascione <dancol@dancol.org>
1643 * sheap.c (report_sheap_usage): Use message, not message1, so
1644 that we don't try to create a buffer while we're in the middle
1645 of dumping Emacs. Explain why.
1647 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1649 * search.c (find_newline): Return byte position in bytepos.
1651 (find_next_newline_no_quit, find_before_next_newline):
1652 Add bytepos argument.
1653 * lisp.h (find_newline, find_next_newline_no_quit)
1654 (find_before_next_newline): Adjust prototypes.
1655 * bidi.c (bidi_find_paragraph_start):
1656 * editfns.c (Fconstrain_to_field, Fline_end_position):
1657 * indent.c (compute_motion, vmotion):
1658 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1659 (get_visually_first_element, move_it_vertically_backward):
1660 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1662 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1664 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1665 resources were not orderly released.
1667 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1669 * xdisp.c (x_draw_vertical_border): For a window that is neither
1670 the leftmost nor the rightmost, redraw both the left and the right
1671 vertical borders. (Bug#13723)
1673 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1675 * xml.c (init_libxml2_functions):
1676 * sound.c (sound_warning):
1677 * sheap.c (report_sheap_usage):
1678 * process.c (wait_reading_process_output):
1679 * msdos.c (XMenuActivate):
1680 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1681 * keyboard.c (top_level_1):
1682 * editfns.c (Fmessage, Fmessage_box):
1683 * callint.c (Fcall_interactively):
1684 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1686 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1688 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1689 * frame.c (syms_of_frame): ... to here.
1691 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1693 * w32.c (sys_chown): Remove unused function.
1695 * w32term.c <input_signal_count>: Declare 'volatile'
1696 unconditionally. (Bug#9066)
1698 * w32.c (set_errno): Reset h_errno and don't set it to any other
1699 value. Set errno instead.
1700 (check_errno): Reset h_errno.
1701 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1702 (sys_gethostname, sys_getservbyname, sys_getpeername)
1703 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1704 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1706 (sys_gethostbyname): Set h_errno only errors detected.
1708 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1710 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1712 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1714 * keyboard.c (read_char): Fix calculation of auto-save time out
1715 when auto-save-timeout is less than 4. (Bug#13720)
1717 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1718 time. Improve diagnostics in DebPrint. (Bug#13546)
1720 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1721 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1722 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1723 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1724 make sure errno is set to an appropriate value. (Bug#13546)
1725 (socket_to_fd): Add assertion against indexing fd_info[] with a
1726 value that is out of bounds.
1727 (sys_accept): If fd is negative, do not set up the child_process
1728 structure for reading.
1730 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1732 * composite.c (fill_gstring_header): Remove useless prototype.
1734 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1735 * print.c (PRINTDECLARE, print_object):
1736 * search.c (compile_pattern, fast_looking_at, search_buffer):
1737 (simple_search, boyer_moore, Freplace_match):
1738 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1739 (get_overlay_arrow_glyph_row, display_mode_element):
1740 (decode_mode_spec_coding, message3):
1741 * xfaces.c (face_at_string_position): Use bool for booleans.
1744 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1746 Fix AIX port (Bug#13650).
1747 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1748 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1749 was #undeffed earlier, so it cannot be used as a macro here.
1750 Use the constant and not the macro.
1752 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1754 * w32proc.c (new_child): If no vacant slots are found in
1755 child_procs[], make another pass looking for slots whose process
1756 has exited or died. (Bug#13546)
1758 * w32.c (sys_pipe): When failing due to file descriptors above
1759 MAXDESC, set errno to EMFILE.
1760 (_sys_read_ahead): Update cp->status when failing to read serial
1761 communications input, so that the status doesn't stay at
1762 STATUS_READ_IN_PROGRESS. (Bug#13546)
1764 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1766 * gtkutil.c (tb_size_cb): New function.
1767 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1769 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1771 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1774 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1776 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1778 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1780 * font.c (font_range): Add pos_byte argument. Adjust comment
1781 and break long line.
1782 * font.h (font_range): Adjust prototype.
1783 * composite.c (autocmp_chars): Pass byte position to font_range.
1784 Break long line. Remove useless prototype and format comment.
1786 2013-02-13 Glenn Morris <rgm@gnu.org>
1788 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1790 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1792 Improve AIX port some more (Bug#13650).
1793 With this, it should be as good as it was in 23.3, though it's
1794 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1795 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1796 * unexaix.c (start_of_text): Remove.
1797 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1798 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1799 (orig_load_scnptr, orig_data_scnptr):
1800 Now off_t, not long, since they are file offsets.
1801 (make_hdr): Use _data, not start_of_data ().
1802 This is the key part of the fix.
1803 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1804 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1806 * pre-crt0.c (data_start): Initialize to 1.
1807 This ports to compilers that optimize the external declaration
1808 'int x = 0;' as if it were 'int x;' to shrink the executable.
1810 Improve AIX port (Bug#13650).
1811 This doesn't fix the bug, but it makes progress: Emacs builds now.
1812 * unexaix.c: Include inttypes.h, stdarg.h.
1813 (report_error, report_error_1): Mark as _Noreturn.
1814 (report_error): Don't report the wrong errno.
1815 (report_error_1): Now varargs. All callers changed.
1816 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1817 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1818 (write_ptr): Use %p to print address rather than %lx and a cast
1819 to unsigned long. Grow buffer a bit, to be safer.
1821 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1823 * bidi.c (bidi_resolve_neutral): After finding the next
1824 non-neutral character, accept NEUTRAL_ON type as well, because
1825 directional control characters, such as LRE and RLE, have their
1826 type converted to that by bidi_resolve_weak. This avoids aborts
1827 when LRE/RLE follows a run of neutrals.
1828 (bidi_move_to_visually_next): Assert that return value of
1829 bidi_peek_at_next_level is non-negative. Negative values will
1832 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1834 Minor getenv-related fixes.
1835 * callproc.c (Fcall_process_region) [!DOS_NT]:
1836 Avoid unnecessary duplicate call to getenv.
1837 * callproc.c (init_callproc):
1838 * dispnew.c (init_display):
1839 * sysdep.c (sys_subshell):
1840 Omit unnecessary cast of getenv or egetenv.
1842 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1844 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1845 Update dependencies.
1847 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1849 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1851 (display_line): Set w->region_showing to the value of
1852 it->region_beg_charpos, not to -1. This fixes redisplay
1853 optimization when cursor is moved up after M->. (Bug#13623)
1855 (try_scrolling): Scroll text up more if point is too close to ZV
1856 and inside the scroll margin. This makes sure point is moved
1857 outside the scroll margin in these cases.
1859 * window.h (struct window): region_showing can no longer be
1862 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1864 Tune by using memchr and memrchr.
1865 * doc.c (Fsnarf_documentation):
1866 * fileio.c (Fsubstitute_in_file_name):
1867 * search.c (find_newline, scan_newline):
1868 * xdisp.c (pos_visible_p, display_count_lines):
1869 Use memchr and memrchr rather than scanning byte-by-byte.
1870 * search.c (find_newline): Rename from scan_buffer.
1871 Omit first arg TARGET, as it's always '\n'. All callers changed.
1873 Clean up read_key_sequence a tiny bit more.
1874 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1875 (read_key_sequence): Remove unused locals.
1877 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1879 Clean up read_key_sequence a bit; reread active keymaps after first event.
1880 * keyboard.c (read_char, read_char_x_menu_prompt)
1881 (read_char_minibuf_menu_prompt):
1882 Replace nmaps+maps with a single `map' arg.
1883 (follow_key): Operate on a single map.
1884 (active_maps): New function.
1885 (test_undefined): Also return true for nil bindings.
1886 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1887 a single (composed) keymap. Remember `first_event' to choose the right
1888 set of active keymaps. Recompute the set of keymaps after receiving
1889 the first event. Remove GOBBLE_FIRST_EVENT.
1890 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1891 * keyboard.h (read_char): Update declaration.
1892 * lread.c (read_filtered_event): Adjust call to read_char.
1894 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1896 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1897 Don't use the limitation on backwards movement when lines are truncated
1898 in the window. (Bug#13675)
1900 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1902 * marker.c (set_marker_internal): If desired position is passed
1903 as a marker, avoid call to buf_charpos_to_bytepos.
1904 * window.c (Fset_window_point): Omit redundant type checking.
1905 (Fset_window_start): Likewise. Format comment.
1906 (window_scroll_pixel_based): Use set_marker_restricted_both
1907 with character and byte positions obtained from an iterator.
1908 (Fset_window_configuration): Use set_marker_restricted_both.
1909 * xdisp.c (message_dolog): Likewise.
1911 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1913 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1914 When text lines are longer than window's screen lines, don't move back
1915 too far. This speeds up some redisplay operations. (Bug#13675)
1917 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1919 * syntax.c (scan_sexps_forward): Fix byte position calculation
1920 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1922 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1924 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1925 that was not needed.
1927 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1929 Minor hashing refactoring.
1930 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1931 (sxhash_float): Return EMACS_UINT, for consistency with the other
1933 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1934 non-static inline function and therefore can't use static vars.
1935 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1936 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1937 with the other hash functions.
1939 2013-02-09 Eli Zaretskii <eliz@gnu.org>
1941 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1942 XXXXXX part of the temporary file pattern is not downcased even
1943 when w32-downcase-file-names is non-nil. (Bug#13661)
1945 * xdisp.c (decode_mode_spec): Remove handling of %t.
1947 * msdos.c (careadlinkatcwd): Remove.
1949 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1951 * lread.c (skip_dyn_bytes): New function (bug#12598).
1952 (read1): Use it. Use getc instead of READCHAR to read bytes.
1953 (load_each_byte): Remove. Update users.
1955 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1957 * search.c (scan_buffer): Calculate end byte position just once.
1958 (scan_newline): Do not recalculate start_byte.
1959 (search_command): Use eassert.
1960 * syntax.c (struct lisp_parse_state): New member location_byte.
1961 (scan_sexps_forward): Record from_byte and avoid redundant
1962 character to byte position calculation ...
1963 (Fparse_partial_sexp): ... here. Break too long line.
1965 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1967 * lisp.h (make_uninit_vector): New function.
1968 * alloc.c (Fvector, Fmake_byte_code):
1969 * ccl.c (Fregister_ccl_program):
1970 * charset.c (Fdefine_charset_internal, define_charset_internal):
1971 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1972 * composite.c (syms_of_composite):
1973 * font.c (Fquery_font, Ffont_info, syms_of_font):
1974 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1975 * ftfont.c (ftfont_shape_by_flt):
1976 * indent.c (recompute_width_table):
1977 * nsselect.m (clean_local_selection_data):
1978 * syntax.c (init_syntax_once):
1979 * w32unsubscribe.c (uniscribe_shape):
1980 * window.c (Fcurrent_window_configuration):
1981 * xfaces.c (Fx_family_fonts):
1982 * xselect.c (selection_data_to_lisp_data): Use it.
1984 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1986 * coding.c (Fdefine_coding_system_internal): Use AREF where
1987 argument is known to be a vector.
1988 * fns.c (Flocale_info): Likewise for ASET.
1989 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1990 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1992 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1994 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1997 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1998 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1999 updateCollectionBehaviour.
2001 * nsterm.m (NEW_STYLE_FS): Remove.
2002 (ns_last_use_native_fullscreen): New variable.
2003 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2004 (x_set_window_size): Do not take title bar and tool bar into account
2005 if isFullscreen returns YES.
2006 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2007 (check_native_fs): New function.
2008 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2009 (ns_term_init): Remove NEW_STYLE_FS.
2010 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2011 and tool bar if isFullscreen returns NO.
2012 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2013 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2014 with HAVE_NATIVE_FS.
2015 (window:willUseFullScreenPresentationOptions:): New method.
2016 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2017 Hide toolbar if not enabled (Bug#13444).
2018 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2019 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2020 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2021 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2022 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2023 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2024 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2025 (syms_of_nsterm): Add ns-use-native-fullscreen.
2027 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2029 * fileio.c (Qchoose_write_coding_system): Now static.
2031 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2033 * xdisp.c (window_buffer_changed): region_showing can be negative,
2034 which still means region is being displayed.
2035 (redisplay_internal): Resurrect code that forced redisplay of the
2036 whole window when showing region and the mark has changed.
2037 Record the new mark position to allow redisplay optimizations.
2038 (display_line): If it->region_beg_charpos is non-zero, set the
2039 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2041 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2042 not bitfield of 1 bit.
2044 2013-02-03 Daniel Colascione <dancol@dancol.org>
2046 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2047 daemon mode works on cygw32 when Emacs is installed and not just
2050 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2052 Avoid file time stamp bug on MS-Windows (Bug#13149).
2053 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2054 as FAT32 doesn't update time stamps when truncating them.
2055 Also, check that a file time stamp is not a multiple of 100 ns;
2056 this should catch all instances of the problem on MS-Windows,
2057 as its native file system resolution is 100 ns or worse, and
2058 checking for a non-multiple of 100 ns should impose only a small
2059 overhead on systems with ns resolution.
2061 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2063 Avoid encoding file names on MS-Windows when they need to be run
2064 through dostounix_filename.
2065 * w32.c (normalize_filename): Accept an additional argument
2066 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2067 downcase it even if w32-downcase-file-names is non-nil.
2068 (dostounix_filename): Accept an additional argument MULTIBYTE and
2069 pass it to normalize_filename.
2070 (emacs_root_dir): Adjust.
2072 * msdos.h (dostounix_filename): Adjust prototype.
2074 * w32.h (dostounix_filename): Adjust prototype.
2076 * msdos.c (dostounix_filename): Accept an additional argument and
2078 (init_environment): Adjust callers of dostounix_filename.
2080 * fileio.c (Ffile_name_directory, file_name_as_directory)
2081 (directory_file_name, Fexpand_file_name)
2082 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2084 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2086 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2087 variables, as egetenv is case-insensitive for DOS_NT.
2089 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2090 with an encoded file name.
2092 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2093 Adjust calls to dostounix_filename.
2095 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2097 * unexw32.c (unexec): Adjust call to dostounix_filename.
2099 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2101 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2104 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2107 * callproc.c (Fcall_process): Make sure program name in PATH and
2108 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2109 is passed to exec/spawnve, which fails unless the file-name
2112 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2113 even if w32-quote-process-args is nil.
2115 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2117 Fix timestamp bug when write-region appends nothing (Bug#13149).
2118 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2119 the file's time stamp doesn't change if Emacs happens to write nothing
2120 to the file, and on a buggy file system this could cause Emacs to
2121 incorrectly infer that the file system doesn't have the bug.
2122 Avoid this problem by inhibiting the inference in this case.
2124 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2126 * window.h (struct window): Convert base_line_number, base_line_pos
2127 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2128 Convert region_showing member from Lisp_Object to bitfield.
2129 Remove sequence_number member. Adjust comments.
2130 * window.c (sequence_number): Remove.
2131 (make_window): Initialize column_number_displayed.
2132 * print.c (print_object): Follow the printed representation of
2133 frames and print window pointer to distinguish between windows.
2134 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2135 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2136 (wset_column_number_displayed, wset_region_showing): Remove.
2137 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2138 (try_scrolling, try_cursor_movement, redisplay_window)
2139 (try_window_reusing_current_matrix, try_window_id, display_line)
2140 (display_mode_lines, decode_mode_spec): Adjust users.
2141 * .gdbinit (pwinx): Do not print sequence_number.
2143 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2145 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2146 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2147 * dired.c: Include <fcntl.h>.
2148 (open_directory): New function, which uses open and fdopendir
2149 rather than opendir. DOS_NT platforms still use opendir, though.
2150 (directory_files_internal, file_name_completion): Use it.
2151 (file_attributes): New function, with most of the old Ffile_attributes.
2152 (directory_files_internal, Ffile_attributes): Use it.
2153 (file_attributes, file_name_completion_stat): First arg is now fd,
2154 not dir name. All uses changed. Use fstatat rather than lstat +
2156 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2157 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2158 (emacs_readlinkat): New function, with much of the old
2159 Ffile_symlink_p, but with an fd argument for speed.
2160 It uses readlinkat rather than careadlinkatcwd, so that it
2161 need not assume the working directory.
2162 (Ffile_symlink_p): Use it.
2163 * filelock.c (current_lock_owner): Use emacs_readlinkat
2164 rather than emacs_readlink.
2165 * lisp.h (emacs_readlinkat): New decl.
2166 (READLINK_BUFSIZE, emacs_readlink): Remove.
2167 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2168 (emacs_norealloc_allocator, emacs_readlink): Remove.
2169 This stuff is moved to fileio.c.
2170 * w32.c (fstatat, readlinkat): New functions.
2171 (careadlinkat): Don't check that fd == AT_FDCWD.
2172 (careadlinkatcwd): Remove; no longer needed.
2174 2013-01-31 Glenn Morris <rgm@gnu.org>
2176 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2177 (Fwrite_region): Update for new choose_write_coding_system args.
2178 Move the last piece of choose_write_coding_system here. (Bug#13522)
2179 (syms_of_fileio): Add choose-write-coding-system.
2181 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2183 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2184 (sys_close): Zero out the flags for the file descriptor before
2185 closing it. (Bug#13546)
2187 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2188 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2189 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2192 * w32.c (w32_get_long_filename, init_environment, readlink):
2193 Support file names encoded in DBCS codepages.
2194 (readlink): Use the current file-name-coding-system, not the ANSI
2195 codepage, to decode and handle targets of symlinks.
2197 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2199 * w32.c (opendir): Now accepts a 'const char *'.
2201 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2203 Remove obsolete redisplay code. See the discussion at
2204 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2205 * dispnew.c (preemption_period, preemption_next_check): Remove.
2206 (Vredisplay_preemption_period): Likewise.
2207 (update_frame, update_single_window, update_window, update_frame_1):
2208 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2209 used, following the 2012-06-22 change.
2211 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2213 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2215 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2217 * font.c (num_fonts): Remove the leftover from old
2218 debugging code. Adjust comment style here and there.
2219 * insdel.c (insert_1): Remove.
2220 * lisp.h (insert_1): Remove prototype.
2221 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2223 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2225 * w32.c (max_filename_mbslen): New function.
2226 (normalize_filename, readdir): Use it to detect locales where ANSI
2227 encoding of file names uses a double-byte character set (DBCS).
2228 If a DBCS encoding is used, advance by characters using
2229 CharNextExA, instead of incrementing a 'char *' pointer.
2230 Use _mbslwr instead of _strlwr. (Bug#13515)
2232 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2233 request of memory reservation to 1.7GB. (Bug#13065)
2235 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2237 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2238 at check_extra_latin label. (Bug#13505)
2240 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2242 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2243 Avoid redundant calls to strlen.
2245 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2247 Drop async_visible and async_iconified fields of struct frame.
2248 This is possible because async input is gone; for details, see
2249 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2250 * frame.h (struct frame): Remove async_visible and async_iconified
2251 members, convert garbaged to unsigned bitfield. Adjust comments.
2252 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2253 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2254 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2255 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2256 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2258 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2259 properly. Likewise for obscured.
2261 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2264 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2266 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2268 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2269 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2271 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2273 * xdisp.c (message2, message2_nolog): Remove functions.
2274 (message3, message3_nolog): Extract nbytes and multibyteness directly
2275 from the string. Change all callers.
2276 (message3_nolog): Don't set message_enable_multibyte since set_message
2277 will reset it anyway.
2278 (message1, message1_nolog): Use message3.
2279 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2280 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2281 (set_message): Drop all but the second arg, which has to be a string.
2282 (set_message_1): Simplify now that we know that a1 is NULL and the
2283 second arg is a string.
2284 * frame.h (struct frame): Remove `message_buf' field.
2285 Use glyphs_initialized_p instead.
2286 (FRAME_MESSAGE_BUF): Remove macro.
2287 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2288 * lisp.h (message2, message2_nolog): Remove declarations.
2289 (message3, message3_nolog): Update declarations.
2290 * keyboard.c (read_char_minibuf_menu_text)
2291 (read_char_minibuf_menu_width): Remove vars.
2292 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2293 to correctly handle multibyte strings.
2294 * frame.c (delete_frame): Don't free message_buf any more.
2295 * editfns.c (message_text, message_length): Remove vars.
2296 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2297 * fileio.c (auto_save_error): Use message3 instead of message2.
2298 * dispnew.c (adjust_frame_message_buffer): Remove function.
2300 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2302 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2303 real estate used for the tool bar and the menu bar.
2305 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2307 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2308 hidden buffer is prepared to modification (Bug#13164).
2310 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2312 * window.h (struct window): Change window_end_valid member from
2313 Lisp_Object to a bitfield. Adjust comments.
2314 (wset_window_end_valid): Remove.
2315 * window.c (adjust_window_count): Clear window_end_valid.
2316 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2317 (Fwindow_line_height, set_window_buffer, Frecenter)
2318 (Fsplit_window_internal, Fdelete_other_windows_internal)
2319 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2320 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2321 * xdisp.c (check_window_end, reconsider_clip_changes)
2322 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2323 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2324 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2326 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2328 * xdisp.c (mark_window_display_accurate): Simplify the loop
2329 assuming that the only one of vchild, hchild or buffer window
2330 slots is non-nil. Call mark_window_display_accurate_1 for
2331 the leaf windows only.
2332 (mark_window_display_accurate_1): Always assume leaf window.
2335 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2337 * emacs.c (Qkill_emacs_hook): Now static.
2339 * fileio.c (Finsert_file_contents): Simplify.
2340 Remove unnecessary assignments and tests.
2342 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2344 * w32.c (acl_set_file): Don't test for errors unless
2345 set_file_security returns FALSE. Avoids spurious errors when
2348 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2350 * fileio.c (Finsert_file_contents): Revert code introduced at
2351 2013-01-18 in favor of the simpler and generally better fix.
2352 Save stack space by removing 'buffer' and reusing 'read_buf'
2355 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2357 * lisp.h (eabs): Define unconditionally (Bug#13419).
2358 The old "#if !defined (eabs)" was an unnecessary revenant of back
2359 when this macro was called "abs". Document 'eabs' better.
2361 2013-01-19 Glenn Morris <rgm@gnu.org>
2363 * fns.c (Frandom): Doc fix.
2365 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2367 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2368 segfault when there are lots of overlays.
2370 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2371 when there are lots of overlays.
2372 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2373 for the details and a way to reproduce.
2375 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2377 * fileio.c: Use O_APPEND to append.
2378 This corresponds better to the natural interpretation of "append",
2379 and avoids the need to open the output file twice, or to invoke
2380 lseek when APPEND is neither nil nor a number.
2381 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2382 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2383 file possibly twice, and lseeking to its end; this avoids the
2384 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2385 at the same time: the combination is never needed and apparently
2386 it doesn't work with DOS_NT.
2388 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2389 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2391 Allow floating-point file offsets.
2392 Problem reported by Vitalie Spinu in
2393 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2394 * fileio.c (emacs_lseek): Remove.
2395 (file_offset): New function.
2396 (Finsert_file_contents, Fwrite_region): Use it.
2398 2013-01-19 Chong Yidong <cyd@gnu.org>
2400 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2401 aborting on Fsignal (Bug#13289).
2403 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2405 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2406 set_file_security as failure due to insufficient privileges.
2407 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2408 (fstat): Return owner and group like 'stat' and 'lstat' do.
2410 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2412 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2413 The bug was observed on Ubuntu operating inside a virtual machine,
2414 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2415 The workaround introduces a race condition on non-buggy hosts,
2416 but it's an unlikely race and anyway there's a nearly identical
2417 nearby race that can't be fixed.
2418 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2420 (Fwrite_region): Test for file system time stamp bug.
2421 (init_fileio): New function.
2422 * lisp.h (init_fileio): Declare it.
2423 * emacs.c (main): Call it.
2425 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2426 and make it more consistent with other stat-failure diagnostics.
2428 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2430 Fix crash when inserting data from non-regular files.
2431 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2432 for the error description produced by valgrind.
2433 * fileio.c (read_non_regular): Rename to read_contents.
2434 Free Lisp_Save_Value object used to pass parameters.
2435 (read_non_regular_quit): Rename to read_contents_quit.
2436 (Finsert_file_contents): Redesign internal file reading loop to adjust
2437 gap and end positions after each read and so help make_gap to work
2438 properly. Do not signal an I/O error too early and so do not leave
2439 not yet decoded characters in a buffer, which was the reason of
2440 redisplay crash. Use list2 to build return value. Adjust comments.
2442 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2444 Close a race when statting and reading files (Bug#13149).
2445 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2446 This avoids a race if the file is renamed between stat and open.
2447 This race is not the problem originally noted in Bug#13149;
2448 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2450 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2452 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2453 objects, related functions and macros.
2454 (make_save_value): Adjust prototype.
2455 (make_save_pointer): New prototype.
2456 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2457 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2458 * alloc.c (format_save_value): Rename to make_save_value.
2459 (make_save_pointer): New function.
2460 (record_xmalloc): Use make_save_pointer.
2461 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2462 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2463 Change users of make_save_value to make_save_pointer.
2464 Likewise for format_save_value and make_save_value.
2466 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2468 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2469 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2470 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2473 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2475 * alloc.c (free_save_value): Now static.
2477 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2479 * keymap.c (map_keymap_internal): Use format_save_value.
2480 (map_keymap_char_table_item): Adjust accordingly.
2481 * fileio.c (non_regular_fd, non_regular_inserted)
2482 (non_regular_nbytes): Remove.
2483 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2484 Use format_save_value to pass parameters to read_non_regular.
2485 (read_non_regular): Use XSAVE_ macros to extract parameters.
2487 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2489 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2491 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2493 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2494 extraction from any Lisp_Save_Value slot. Add type checking.
2495 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2496 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2497 * xselect.c: All users changed.
2499 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2501 Some convenient bits to deal with Lisp_Save_Values.
2502 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2503 (allocate_misc): Remove prototype.
2504 (format_save_value): New prototype.
2505 * alloc.c (allocate_misc): Revert back to static.
2506 (format_save_value): New function to build Lisp_Save_Value
2507 object with the specified internal structure.
2508 (make_save_value): Reimplement using format_save_value.
2509 * editfns.c (save_excursion_save): Use format_save_value.
2510 (save_excursion_restore): Use XSAVE_OBJECT.
2512 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2514 Avoid needless casts with XSAVE_POINTER.
2515 * alloc.c (mark_object) [GC_MARK_STACK]:
2516 * dired.c (directory_files_internal_unwind):
2517 * fileio.c (do_auto_save_unwind):
2518 * gtkutil.c (pop_down_dialog):
2519 * keymap.c (map_keymap_char_table_item):
2520 * lread.c (load_unwind):
2521 * nsmenu.m (pop_down_menu):
2522 * print.c (print_object) [GC_MARK_STACK]:
2523 * xfns.c (clean_up_file_dialog):
2524 * xmenu.c (cleanup_widget_value_tree):
2525 Omit casts between XSAVE_POINTER and a pointer type.
2527 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2529 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2530 * eval.c (eval_sub): Protect `form' from being GCed before its
2531 car and cdr becomes protected with the backtrace entry.
2533 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2535 Make Lisp_Save_Value more versatile storage for up to four objects.
2536 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2537 (struct Lisp_Save_Value): New layout. Adjust comments.
2538 (XSAVE_POINTER): New macro.
2539 (XSAVE_INTEGER): Likewise.
2540 (allocate_misc): Add prototype.
2541 (free_misc): Likewise.
2542 * alloc.c (allocate_misc): Now global.
2543 (free_misc): Likewise. Adjust comment.
2544 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2545 (free_save_value): Likewise.
2546 (mark_object): Likewise.
2547 * editfns.c (save_excursion_save): Pack everything within
2548 Lisp_Save_Value and so avoid xmalloc.
2549 (save_excursion_restore): Adjust to match new layout. Use free_misc
2550 because we do not allocate extra memory any more. Add eassert.
2551 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2552 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2553 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2554 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2555 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2557 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2559 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2560 (nsfont_draw): Remove disabling of LCD smoothing.
2561 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2562 Bug#11484 with LCD smoothing on.
2564 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2566 Fix SIGDANGER handlers, for AIX (Bug#13408).
2567 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2568 Move handlers here from emacs.c; they were out of place.
2570 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2572 * xterm.c (syms_of_xterm): Adjust documentation for
2573 scroll-bar-adjust-thumb-portion.
2575 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2577 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2578 determine whether scroll bar thumb size should be adjusted or
2579 not. Use variable for MOTIF.
2581 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2584 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2586 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2588 (doCommandBySelector:): Set processingCompose to NO.
2590 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2591 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2592 (nsfont_list_family): Add block/unblock_input calls.
2593 (nsfont_open): Move block_input earlier. Add unblock_input before early
2595 (nsfont_draw): Add block/unblock_input calls.
2597 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2599 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2600 for old_charpos and old_bytepos.
2602 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2604 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2605 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2606 Clear tzvalbuf_in_environ if this workaround is in effect.
2607 Problem and fix reported by Kazuhiro Ito.
2609 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2611 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2612 Fix ambiguous doc string cross-reference(s).
2614 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2615 doc string cross-reference(s).
2617 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2618 string cross-reference(s).
2620 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2622 Avoid unnecessary byte position calculation for the gap movement.
2623 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2624 anyway, all of them should use move_gap_both instead.
2625 * lisp.h (move_gap): Remove prototype.
2626 * insdel.c (move_gap): Remove.
2627 (move_gap_both): Add eassert.
2628 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2629 * xml.c (parse_region): Likewise.
2631 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2633 emacsclient -t should not suspend Emacs server (Bug#13387)
2634 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2636 * term.c (init_tty): Use them instead of rolling our own code.
2637 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2638 switches from 'signal' to 'pthread_sigmask', which is safer in
2639 multithreaded applications.
2640 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2641 which has already arranged for that.
2642 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2643 This is the main part of the bug fix.
2645 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2647 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2648 x_last_font_name (Bug#13403).
2650 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2652 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2653 the type of per-buffer values where appropriate.
2654 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2655 predicate, which is how it's really used now. Adjust comment.
2656 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2657 * buffer.c (buffer_slot_type_mismatch): Remove.
2658 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2659 predicate. Adjust comment.
2660 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2661 fill-column, left-margin, tab-width, buffer-saved-size,
2662 left-margin-width, right-margin-width, left-fringe-width,
2663 right-fringe-width, scroll-bar-width and buffer-display-count.
2664 Use Qstringp for default-directory, buffer-file-name,
2665 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2666 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2668 * data.c (store_symval_forwarding): Adjust to call the predicate.
2670 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2672 * w32.c (get_name_and_id, acl_set_file):
2673 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2675 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2677 * lisp.h (make_gap_1): New prototype.
2678 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2680 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2682 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2683 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2684 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2685 (make_gap_1): New function to adjust the gap of any buffer.
2686 * coding.c (coding_alloc_by_making_gap): Use it.
2687 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2688 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2690 2013-01-08 Juri Linkov <juri@jurta.org>
2692 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2693 of (supports :underline (:style wave)). (Bug#13000)
2695 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2697 * undo.c (Fprimitive_undo): Move to simple.el.
2698 (syms_of_undo): Remove declarations for Sprimitive_undo.
2700 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2702 * keyboard.c (echo_add_key): Rename from echo_add_char.
2704 2013-01-06 Chong Yidong <cyd@gnu.org>
2706 * keyboard.c (echo_add_char): New function, factored out from
2707 echo_char. Don't add a space if the previous echo string was
2709 (echo_char): Use it.
2710 (read_key_sequence): When echoing mock input, ensure that the
2711 trailing dash is properly added.
2713 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2715 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2716 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2717 digits for buffer positions, before misalignment starts.
2718 Display "0" for integer "object" field.
2719 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2720 Display the newline glyph more unambiguously.
2722 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2724 * nsterm.m (ns_draw_underwave):
2725 * w32term.c (w32_draw_underwave):
2726 * xterm.c (x_draw_underwave): Make underwave look more triangular
2727 and also degrade gracefully for small fonts. (Bug#13000)
2729 * nsterm.m (ns_draw_text_decoration):
2730 * w32term.c (x_draw_glyph_string):
2731 * xterm.c (x_draw_glyph_string): Don't use previous underline
2732 thickness and position if previous underline type is underwave.
2734 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2736 * fileio.c (Ffile_acl): Undocument return format.
2738 2013-01-02 Glenn Morris <rgm@gnu.org>
2740 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2742 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2745 * dired.c (file_name_completion):
2746 * doc.c (get_doc_string):
2747 * floatfns.c (round2):
2748 * font.c (font_score, font_delete_unmatched):
2749 * fringe.c (compute_fringe_widths):
2750 * lread.c (read_list):
2751 * minibuf.c (Ftry_completion):
2752 * term.c (tty_ins_del_lines):
2753 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2754 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2756 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2758 * w32.c (unsetenv): Set up the string passed to _putenv
2760 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2761 for the bug this caused.
2763 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2765 * coding.c (Qmac): Now static.
2767 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2769 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2770 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2771 handlebox_widget. Set toolbar_in_hbox to false/true, set
2772 toolbar_is_packed to true.
2773 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2774 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2775 Show all on TOOLBAR_TOP_WIDGET.
2776 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2777 by TOOLBAR_TOP_WIDGET.
2778 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2779 Check toolbar_is_packed.
2780 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2781 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2782 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2784 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2785 (xg_update_menubar): Update title only if
2786 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2787 (xg_update_submenu): Skip tearoff only if
2788 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2789 (xg_initialize): Initialize xg_detached_menus only if
2790 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2792 * xterm.h (struct x_output): Surround handlebox_widget with
2793 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2794 toolbar_in_hbox is bool.
2796 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2798 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2799 (LIBS_GNUSTEP): Define.
2800 (LIBES): Add $(LIBS_GNUSTEP).
2801 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2803 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2805 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2806 continuation glyph on a TTY with an indication of an empty line.
2809 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2811 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2812 file's SELinux context or ACLs successfully set, nil otherwise.
2814 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2816 * w32proc.c (reader_thread): Avoid passing NULL handles to
2817 SetEvent and WaitForSingleObject.
2819 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2821 Port EXTERNALLY_VISIBLE to Clang 3.2.
2822 * conf_post.h (__has_attribute): New macro.
2823 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2825 2012-12-27 Glenn Morris <rgm@gnu.org>
2827 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2828 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2830 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2832 * fileio.c (file_name_as_directory, directory_file_name):
2833 Accept an additional argument MULTIBYTE to indicate whether the input C
2834 came from a multibyte or a unibyte Lisp string; all callers
2835 adjusted. Don't assume the input string is always multibyte.
2837 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2838 don't ENCODE_FILE them, and return a unibyte string if the input
2840 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2841 don't assume the input strings will always be multibyte. If the
2842 input strings are multibyte, decode strings obtained from C
2845 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2847 * lisp.h (toplevel): Add two notices to the comment about
2848 defining a new Lisp data type.
2849 * print.c (print_object): If Lisp_Save_Value object's pointer
2850 is the address of a memory area containing Lisp_Objects, try
2852 * alloc.c (valid_lisp_object_p): Adjust comment.
2854 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2856 * keyboard.c (record_asynch_buffer_change): Initialize an event
2857 only if it's really needed.
2858 * frame.h (enum output_method): Remove output_mac member since
2859 it's a leftover from the deleted code.
2860 * frame.c (Fframep): Adjust user here ...
2861 * terminal.c (Fterminal_live_p): ... and here.
2862 * coding.c (Qmac): Now here because it's only used to denote
2863 end-of-line encoding type.
2864 (syms_of_coding): DEFSYM it.
2865 * frame.h (Qmac): Remove duplicated declaration.
2867 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2869 * window.c (select_window_1): Now static, since it's used only here.
2871 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2873 * window.c (window_body_cols): Subtract display margins from the
2874 window body width on TTYs as well. See
2875 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2876 for the original report.
2878 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2880 * xdisp.c (redisplay_window): Remove inner local variable
2881 because the outer shadowed one has the same meaning.
2882 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2884 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2885 (xg_create_tool_bar): Adjust users.
2887 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2889 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2890 * buffer.c (Fget_buffer_create): Use it to set compact field of
2891 struct buffer_text to avoid accessing an uninitialized value
2892 when compact_buffer is called for the first time.
2893 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2894 (Fset_buffer_modified_p): Use buffer_window_count to check
2895 whether the buffer is displayed in some window.
2896 * xdisp.c (message_dolog): Likewise.
2898 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2900 * w32.c (acl_set_file): If setting the file security descriptor
2901 fails, and the new DACL is identical to the existing one, silently
2902 return success. This fixes problems for users backing up their
2903 own files without having the necessary privileges for setting
2904 security descriptors.
2906 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2908 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2909 after WaitForSingleObject returns normally. This expedites reader
2910 thread shutdown when delete_child triggers it.
2911 (reap_subprocess): More accurate commentary for why we call
2912 delete_child only when cp->fd is negative.
2914 * w32.c (sys_close): Do not call delete_child on a subprocess
2915 whose handle is not yet closed. Instead, set its file descriptor
2916 to a negative value, so that reap_subprocess will call
2917 delete_child on that subprocess when its SIGCHLD arrives.
2918 This avoids closing handles used for communications between sys_select
2919 and reader_thread, which doesn't give sys_select a chance to
2920 notice that the process exited and invoke the SIGCHLD handler for
2923 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2925 * nsfns.m (Fns_do_applescript): Run event loop until script has
2926 been executed (Bug#12969).
2927 (ns_run_ascript): Chech as_script for nil, set to nil after
2930 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2932 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2934 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2936 * w32term.c (w32fullscreen_hook): New function.
2937 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2939 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2941 * fileio.c (Finsert_file_contents): Doc fix.
2943 * w32proc.c (new_child, delete_child, find_child_pid): For a
2944 subprocess, consider its slot being in use as long as its process
2945 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2946 slot when a new process is started immediately after killing
2947 another one, without waiting enough time for the first process to
2948 be reaped and resources allocated for it be orderly freed.
2950 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2952 2012-12-21 Chong Yidong <cyd@gnu.org>
2954 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2956 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2958 2012-12-21 Eli Zaretskii <eliz@gnu.org>
2960 * w32.c (get_name_and_id): Always pass NULL as the first argument
2961 of lookup_account_sid. Avoids crashes with UNC file names that
2962 refer to DFS domains, not to specific machine names. (Bug#12621)
2963 Remove now unused argument FNAME; all callers changed.
2964 (get_file_owner_and_group): Remove now unused argument FNAME; all
2967 2012-12-21 Chong Yidong <cyd@gnu.org>
2969 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2970 error for invalid chars, don't check for a nil return value.
2972 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2974 Avoid calls to CHAR_TO_BYTE if byte position is known.
2975 * editfns.c (make_buffer_string_both): Use move_gap_both.
2976 (Fbuffer_string): Use make_buffer_string_both.
2977 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2979 (buf_bytepos_to_charpos): Likewise.
2980 (charpos_to_bytepos): Remove.
2981 * fileio.c (Finsert_file_contents): Use move_gap_both.
2982 * search.c (Freplace_match): Likewise.
2983 * process.c (process_send_region): Likewise. Use convenient
2984 names for byte positions.
2985 * lisp.h (charpos_to_bytepos): Remove prototype.
2986 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2987 * insdel.c (move_gap): Likewise.
2989 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2991 * xdisp.c (redisplay_internal): Remove now-unused local.
2993 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2995 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2996 (redisplay_internal): Don't bother selecting the frame to get the
2997 proper value of frame-local variables (bug#13225).
2999 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3001 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3002 Rename 4th argument since it may be buffer or string. Adjust comment.
3003 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3005 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3007 * coding.c (Fdetect_coding_region): Do not check start and end with
3008 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3009 (code_convert_region): Likewise.
3011 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3013 * w32.c (acl_get_file, acl_set_file): Run the file name through
3014 map_w32_filename, and resolve any symlinks in the file name, like
3016 (acl_set_file): Call revert_to_self, if any privileges were
3019 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3021 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3022 ($(BLD)/w32.$(O)): Update dependencies.
3024 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3026 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3027 propagate redisplay's scrolling (if any) to the right window.
3028 (redisplay_internal): Use ensure_selected_frame.
3029 (display_mode_lines): Complete last fix.
3030 * window.c (select_window_1): New func, extracted from select_window.
3031 (select_window): Use it.
3032 * window.h (select_window_1): Declare.
3034 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3036 Emulate Posix ACL APIs on MS-Windows.
3037 * w32.c: Include sddl.h and sys/acl.h.
3038 (SDDL_REVISION_1): Define if not already defined.
3039 (g_b_init_get_security_descriptor_dacl)
3040 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3041 (g_b_init_is_valid_security_descriptor)
3042 (g_b_init_set_file_security): New static flags.
3043 (globals_of_w32): Initialize them to zero.
3044 (SetFileSecurity_Name): New string constant.
3045 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3046 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3047 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3048 (IsValidSecurityDescriptor_Proc): New typedefs.
3049 (get_file_security, get_security_descriptor_owner)
3050 (get_security_descriptor_group): Set errno to ENOTSUP.
3051 (set_file_security, get_security_descriptor_dacl)
3052 (is_valid_security_descriptor, convert_sd_to_sddl)
3053 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3054 (acl_free, acl_get_file, acl_set_file): New functions.
3056 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3058 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3060 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3061 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3062 for some of that bug's symptoms can now cause Emacs to abort.
3063 Remove the workaround.
3064 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3065 The bug that caused SIGCHLD to get lost has been fixed, and the
3066 workaround for it can now cause Emacs to abort.
3068 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3070 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3071 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3072 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3074 2012-12-16 Romain Francoise <romain@orebokech.com>
3076 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3077 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3078 and copy ACL entries of file in addition to SELinux context if set.
3079 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3081 * Makefile.in (LIBACL_LIBS): New macro.
3084 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3086 * fileio.c (internal_delete_file): Use bool for boolean.
3088 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3090 Fix bug #13079 on MS-Windows with temp files not being deleted.
3091 * w32.h (_child_process): New members input_file and
3093 (register_child): First argument is now pid_t.
3094 (record_infile, record_pending_deletion): New prototypes.
3096 * w32proc.c (new_child): Initialize input_file and
3097 pending_deletion members of the child.
3098 (delete_child): Delete the child's temporary input file, if any,
3099 that is pending deletion.
3100 (register_child): First argument is now pid_t.
3101 (record_infile, record_pending_deletion): New functions.
3102 (reap_subprocess): Fix a typo in DebPrint string.
3103 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3105 * fileio.c (internal_delete_file): Return an int again: non-zero
3106 if delete-file succeeds, zero otherwise.
3108 * lisp.h (internal_delete_file): Adjust prototype.
3110 * callproc.c (Fcall_process): Don't overwrite infile with result
3112 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3113 asynchronous subprocess, record the name of the input file name,
3115 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3116 delete the file, record it as pending deletion when the subprocess
3119 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3121 * editfns.c [HAVE_PWD_H]: Include grp.h.
3123 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3125 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3127 Fix permissions bugs with setgid directories etc. (Bug#13125)
3128 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3129 to mark it as a placeholder. The old value was often wrong.
3130 The only user of this attribute has been changed to use
3131 file-ownership-preserved-p instead, with its new group arg.
3132 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3134 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3136 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3137 Keep selected_window and selected_frame in sync.
3139 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3141 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3142 try to get accurate owner and group information from NT file
3143 security APIs. This is to make most callers of 'stat' and
3144 'lstat', which don't need that information, much faster.
3146 * dired.c (Ffile_attributes) [WINDOWSNT]:
3147 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3148 owner and group information from 'lstat'.
3150 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3152 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3153 as that confuses set-auto-coding, so insist on the head-read
3154 returning the full 1024 bytes. Let lseek compute the tail offset;
3155 less work for us. Do not ignore I/O errors when reading the tail.
3157 * xdisp.c: Minor style fixes.
3158 (init_iterator): Hoist assignment out of if-expression.
3159 (markpos_of_region): Callers now test for sign, not for -1.
3161 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3163 Minor redisplay optimization when the region length is zero.
3164 * xdisp.c (markpos_of_region): New function.
3165 (init_iterator): Do not highlight the region of zero length.
3166 (redisplay_window): Check whether the region is of non-zero length.
3167 (try_cursor_movement): Allow if the region length is zero.
3168 (try_window_reusing_current_matrix, try_window_id): Likewise.
3170 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3172 * search.c (search_buffer): Check the inverse translations of each
3173 character in pattern when the buffer being searched is unibyte.
3176 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3178 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3179 files, fixing a regression from 24.2.
3180 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3182 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3184 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3185 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3186 Remove unnecessary S_ISLNK test, as (contra the comments) this
3187 function can't copy symlinks. Improve quality of error message
3188 when attempting to copy files that are neither regular files nor
3191 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3193 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3194 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3195 * window.c (Frecenter):
3196 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3197 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3199 2012-12-12 Daniel Colascione <dancol@dancol.org>
3201 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3202 the dumped Emacs is not a sparse file, greatly improving Cygwin
3203 "make bootstrap" performance.
3205 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3207 * inotify.c (inotify_callback): Generate an Emacs event for every
3208 incoming inotify event.
3210 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3212 * xdisp.c (handle_face_prop): Fix logic of computing
3213 it->start_of_box_run_p.
3214 (append_space_for_newline): If the glyph row is R2L, reset the
3215 iterator's end_of_box_run_p flag before prepending the space glyph.
3216 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3217 iterator's start_of_box_run_p flag before prepending the stretch.
3218 (append_glyph, produce_image_glyph, append_composite_glyph)
3219 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3220 left_box_line_p and right_box_line_p flags of the glyph for R2L
3221 glyph rows. (Bug#13011)
3223 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3225 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3226 if changed buffer is not shown in a window.
3227 * insdel.c (prepare_to_modify_buffer): Likewise.
3228 * window.c (replace_buffer_in_windows_safely): Do nothing
3229 if buffer is not shown in a window.
3230 (Fforce_window_update): Likewise if string or buffer argument
3233 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3235 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3236 encoded_file_name, which is what it is.
3238 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3240 Consistently use marker_position and marker_byte_position.
3241 * fringe.c (Ffringe_bitmaps_at_pos):
3242 * indent.c (Fvertical_motion):
3243 * insdel.c (prepare_to_modify_buffer):
3244 * keyboard.c (make_lispy_position):
3245 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3246 (window_scroll_pixel_based, displayed_window_lines)
3247 (Fset_window_configuration):
3248 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3249 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3250 Replace direct access to marker fields with calls
3251 to marker_position and/or marker_byte_position.
3253 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3255 * makefile.w32-in (SIG2STR_H): New macro.
3256 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3257 ($(BLD)/w32notify.$(O)): Update dependencies.
3259 2012-12-10 Daniel Colascione <dancol@dancol.org>
3261 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3262 Windows file notification functionality unless WINDOWSNT.
3264 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3267 * w32fns.c (cache_system_info): Initialize the global hinst
3268 variable here so various initialization calls DTRT.
3270 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3271 (hinst): Remove unneeded extern declaration.
3272 (_start): Remove initialization of above variables; remove
3273 initialization of hinst, as cache_system_info now does that.
3275 * emacs.c (main): Call cache_system_info early in startup; we
3276 previously weren't calling it in Cygwin builds.
3278 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3279 Teach the autoconf build system how to compile a Windows resource file
3280 and link it to Emacs.
3282 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3284 Per-buffer window counters.
3285 * buffer.h (struct buffer): New member window_count.
3286 (buffer_window_count): New function.
3287 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3288 Initialize window_count.
3289 (Fkill_buffer): Verify window_count for the buffer being killed.
3290 (modify_overlay): Do not force redisplay if buffer is not shown
3292 (init_buffer_once): Initialize window_count for buffer_defaults
3293 and buffer_local_symbols.
3294 * window.h (buffer_shared): Remove declaration.
3295 (wset_buffer): Convert from inline ...
3296 * window.c (wset_buffer): ... to an ordinary function.
3297 (adjust_window_count): New function.
3298 (make_parent_window): Use it.
3299 * xdisp.c (buffer_shared): Remove.
3300 (redisplay_internal, redisplay_window): Adjust users.
3301 (buffer_shared_and_changed): Use per-buffer window counter.
3303 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3305 Support for filesystem notifications on MS-Windows.
3306 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3307 and this is a TTY frame, signal the caller that keyboard input is
3310 * w32xfns.c (drain_message_queue): Now returns an int: an
3311 indication whether any WM_EMACS_FILENOTIFY messages were found in
3314 * w32inevt.c (handle_file_notifications): New function.
3315 (w32_console_read_socket): Call it to process file notifications.
3317 * w32console.c (initialize_w32_display): Record the main thread ID
3320 * deps.mk (inotify.o): New dependency list.
3322 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3324 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3325 (WM_EMACS_END): Bump value by 1.
3326 (notification_buffer_in_use, file_notifications)
3327 (notifications_size, notifications_desc): Declare.
3328 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3331 * w32term.c (lispy_file_action, queue_notifications): New functions.
3332 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3333 <Qrenamed_to>: New symbols.
3334 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3336 * w32notify.c: New file, implements file event notifications for
3339 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3340 by posting it to the w32_read_socket queue.
3342 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3344 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3345 (GLOBAL_SOURCES): Add w32notify.c
3346 ($(BLD)/w32notify.$(O)): New set of dependencies.
3348 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3350 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3351 Handle FILE_NOTIFY_EVENT.
3352 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3353 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3354 w32notify-handle-event by default.
3356 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3359 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3361 Support for filesystem notifications on GNU/Linux via inotify.
3362 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3364 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3366 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3367 (syms_of_keyboard): DEFSYM it.
3368 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3369 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3370 Qfile_inotify events.
3371 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3372 special-event-map to inotify-handle-event.
3374 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3376 * Makefile.in (base_obj): Add inotify.o.
3378 * inotify.c: New file.
3380 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3382 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3384 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3386 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3387 DWORD_PTR, for compatibility with 64-bit builds.
3389 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3390 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3391 (system_process_attributes): Use SIZE_T rather than DWORD, for
3392 compatibility with 64-bit builds.
3394 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3396 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3398 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3400 * indent.c (Fvertical_motion): If a display string will be
3401 displayed on the left or the right margin, don't consider it as a
3402 factor in cursor positioning. (Bug#13108)
3404 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3406 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3408 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3410 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3413 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3415 * w32.c (unsetenv): Return 0 if the input string is too long.
3417 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3419 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3420 * alloc.c (xputenv): New function.
3421 * dbusbind.c (Fdbus_init_bus):
3423 * xterm.c (x_term_init):
3424 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3425 * editfns.c (initial_tz): Move static var decl up.
3426 (tzvalbuf_in_environ): New static var.
3427 (init_editfns): Initialize these two static vars.
3428 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3429 Save old TZ value on stack, if it's small.
3430 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3431 instead, use xputenv+unsetenv to set and restore TZ.
3432 (environbuf): Remove static var. All uses removed.
3433 (Fset_time_zone_rule): Do not save TZ and environ;
3434 no longer needed here.
3435 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3436 Move to inside set_time_zone_rule; they don't need file scope any more.
3437 (set_time_zone_rule): Maintain the TZ=value string separately.
3438 (syms_of_editfns): Don't initialize initial_tz;
3439 init_editfns now does it.
3440 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3441 * lisp.h (xputenv): New decl.
3443 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3445 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3447 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3449 * w32.c (unsetenv, sys_putenv): New functions.
3451 2012-12-08 Chong Yidong <cyd@gnu.org>
3453 * editfns.c (Finsert_char): Make the error message more
3454 informative (Bug#12992).
3456 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3458 Simplify get_lim_data.
3459 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3460 Remove USG and vlimit methods; no longer used these days.
3461 Add #error catchall just in case.
3463 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3464 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3465 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3466 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3467 (deleted_pid_list, Fdelete_process, create_process)
3468 (record_child_status_change, handle_child_signal, deliver_child_signal)
3469 (init_process_emacs, syms_of_process):
3470 Assume SIGCHLD is defined.
3471 (parse_signal): Remove. All uses removed.
3472 (abbr_to_signal): New static function.
3473 (Fsignal_process): Use it to convert signal names to ints.
3474 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3475 kill (getpgrp (), ...).
3476 (emacs_sigaction_init): Assume SIGCHLD is defined.
3477 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3478 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3479 * syssignal.h (EMACS_KILLPG): Remove.
3480 All uses replaced by 'kill' with a negative pid.
3481 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3482 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3484 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3486 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3487 This will cause a production Emacs to dump core instead of
3490 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3492 * frame.c (make_frame): Do not set window's buffer to t.
3493 * window.c (Fsplit_window_internal): Likewise. Previously it was
3494 used to indicate that the window is being set up. Now we use
3495 set_window_buffer for all new windows, so the condition in ...
3496 (Fset_window_buffer): ... is always true and can be removed.
3498 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3500 Convenient macro to check whether the buffer is hidden.
3501 * buffer.h (BUFFER_HIDDEN_P): New macro.
3502 * frame.c (make_frame): Use it. Adjust comment.
3503 * buffer.c (candidate_buffer): New function.
3504 (Fother_buffer, other_buffer_safely): Use it.
3506 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3508 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3509 if the child process is still running. Instead, exit the wait
3510 loop and return zero. (Bug#13086)
3512 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3514 * frame.h (x_char_width, x_char_height): Remove prototypes.
3515 * w32term.h (x_char_width, x_char_height): Likewise.
3516 * xfns.c (x_char_width, x_char_height): Remove.
3517 * w32fns.c (x_char_width, x_char_height): Likewise.
3518 * nsfns.c (x_char_width, x_char_height): Likewise.
3519 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3521 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3522 * keyboard.c (command_loop_1): Remove prototype.
3523 (command_loop_2, top_level_1): Add static to match prototype.
3525 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3527 Fix a recently-introduced delete-process race condition.
3528 * callproc.c, process.h (record_kill_process):
3529 New function, containing part of the old call_process_kill.
3530 (call_process_kill): Use it.
3531 This does not change call_process_kill's behavior.
3532 * process.c (Fdelete_process): Use record_kill_process to fix a
3533 race condition that could cause Emacs to lose track of a child.
3535 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3537 Avoid code duplication between prev_frame and next_frame.
3538 * frame.c (candidate_frame): New function. Add comment.
3539 (prev_frame, next_frame): Use it. Adjust comment.
3541 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3543 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3544 fails, signal an error instead of continuing with an empty
3546 Encode expanded temp file pattern before passing it to mkstemp or
3549 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3550 Encode the file name before passing it to dostounix_filename, in
3551 case it will downcase it (under w32-downcase-file-names).
3554 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3556 Minor call-process cleanups.
3557 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3558 at the same time as other platforms, to simplify analysis.
3559 No need for fd0_volatile since we have synch_process_fd.
3560 Avoid needless emacs_close; arg is always negative.
3562 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3564 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3567 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3569 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3570 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3571 and mouse_face_hidden members to a bitfields.
3572 * frame.h (struct frame): Remove set-but-not-used space_width member.
3573 (FRAME_SPACE_WIDTH): Remove.
3574 * nsterm.m, w32term.c, xterm.c: Adjust users.
3575 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3576 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3577 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3578 members to a bitfields.
3580 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3582 Don't let call-process be a zombie factory (Bug#12980).
3583 Fixing this bug required some cleanup of the signal-handling code.
3584 As a side effect, this change also fixes a longstanding rare race
3585 condition whereby Emacs could mistakenly kill unrelated processes,
3586 and it fixes a bug where a second C-g does not kill a recalcitrant
3587 synchronous process in GNU/Linux and similar platforms.
3588 The patch should also fix the last vestiges of Bug#9488,
3589 a bug which has mostly been fixed on the trunk by other changes.
3590 * callproc.c, process.h (synch_process_alive, synch_process_death)
3591 (synch_process_termsig, sync_process_retcode):
3592 Remove. All uses removed, to simplify analysis and so that
3593 less consing is done inside critical sections.
3594 * callproc.c (call_process_exited): Remove. All uses replaced
3595 with !synch_process_pid.
3596 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3597 These take the role of what used to be in unwind-protect arg.
3599 (block_child_signal, unblock_child_signal):
3600 New functions, to avoid races that could kill innocent-victim processes.
3601 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3602 (call_process_kill): Record killed processes as deleted, so that
3603 zombies do not clutter up the system. Do this inside a critical
3604 section, to avoid a race that would allow the clutter.
3605 (call_process_cleanup): Fix code so that the second C-g works again
3606 on common platforms such as GNU/Linux.
3607 (Fcall_process): Create the child process in a critical section,
3608 to fix a race condition. If creating an asynchronous process,
3609 record it as deleted so that zombies do not clutter up the system.
3610 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3611 light of these changes. Omit unnecessary call to emacs_close
3612 before failure, as the unwind-protect code does that.
3613 * callproc.c (call_process_cleanup):
3614 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3615 * process.c (record_deleted_pid): New function, containing
3616 code refactored out of Fdelete_process.
3617 (Fdelete_process): Use it.
3618 (process_status_retrieved): Remove. All callers changed to use
3619 child_status_change.
3620 (record_child_status_change): Remove, folding its contents into ...
3621 (handle_child_signal): ... this signal handler. Now, this
3622 function is purely a handler for SIGCHLD, and is not called after
3623 a synchronous waitpid returns; the synchronous code is moved to
3624 wait_for_termination. There is no need to worry about reaping
3625 more than one child now.
3626 * sysdep.c (get_child_status, child_status_changed): New functions.
3627 (wait_for_termination): Now takes int * status and bool
3628 interruptible arguments, too. Do not record child status change;
3629 that's now the caller's responsibility. All callers changed.
3630 Reimplement in terms of get_child_status.
3631 (wait_for_termination_1, interruptible_wait_for_termination):
3632 Remove. All callers changed to use wait_for_termination.
3633 * syswait.h: Include <stdbool.h>, for bool.
3634 (record_child_status_change, interruptible_wait_for_termination):
3636 (record_deleted_pid, child_status_changed): New decls.
3637 (wait_for_termination): Adjust to API changes noted above.
3639 * bytecode.c, lisp.h (Qbytecode): Remove.
3640 No longer needed after 2012-11-20 interactive-p changes.
3642 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3644 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3645 the scroll margin, move point outside the margin. (Bug#13055)
3647 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3649 * gtkutil.c (my_log_handler): New function.
3650 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3652 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3654 * lisp.h (modify_region): Rename to...
3655 (modify_region_1): ...new prototype.
3656 * textprop.c (modify_region): Now static. Adjust users.
3657 * insdel.c (modify_region): Rename to...
3658 (modify_region_1): ...new function to work with current buffer.
3659 Adjust comment and users. Use true and false for booleans.
3661 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3663 * alloc.c (free_save_value): New function.
3664 (safe_alloca_unwind): Use it.
3665 * lisp.h (free_save_value): New prototype.
3666 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3668 (save_excursion_restore): Adjust to match saved data structure.
3669 Use free_save_value to offload some work from GC. Drop obsolete
3672 2012-12-03 Chong Yidong <cyd@gnu.org>
3674 * fileio.c (Vauto_save_list_file_name): Doc fix.
3676 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3678 * w32fns.c: Remove prototype of atof.
3679 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3681 (file_dialog_callback): Make it UINT_PTR.
3683 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3686 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3687 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3690 2012-12-03 Glenn Morris <rgm@gnu.org>
3692 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3694 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3696 Fix xpalloc confusion after memory is exhausted.
3697 * alloc.c (xpalloc): Comment fix.
3698 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3699 and signals an error, do not clear charset_table_size, as
3700 charset_table is still valid.
3701 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3703 Use execve to avoid need to munge environ (Bug#13054).
3704 * callproc.c (Fcall_process):
3705 * process.c (create_process):
3706 Don't save and restore environ; no longer needed.
3707 * callproc.c (child_setup):
3708 Use execve, not execvp, to preserve environ.
3710 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3712 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3714 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3716 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3717 display for sliced images (Bug#10500).
3719 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3721 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3723 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3724 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3726 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3728 * xdisp.c (window_outdated): Remove eassert since it hits
3729 some suspicious corner cases (see Bug#13007 and Bug#13012).
3730 (mode_line_update_needed): New function.
3731 (redisplay_internal, redisplay_window): Use it.
3732 (ensure_selected_frame): New function.
3733 (redisplay_internal, unwind_redisplay): Use it.
3734 (redisplay_internal): Move comment about buffer_shared...
3735 (buffer_shared_and_changed): ...near to its real use.
3737 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3739 * callproc.c (Fcall_process): Don't misreport vfork failure.
3741 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3743 * callproc.c (Fcall_process): Fix vfork portability problems.
3744 Do not assume that fd[0], count, filefd, and save_environ survive
3745 vfork. Fix bug whereby wrong errno value could be reported for
3746 pipe failure. Some minor cleanups, too, as follows. Move buf and
3747 bufsize to the context where they're needed. Change new_argv to
3748 be of type char **, as this is more convenient and avoids casts.
3749 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3750 Now local constants, not macros.
3752 2012-11-18 Kenichi Handa <handa@gnu.org>
3754 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3755 for the variable "f".
3757 2012-11-13 Kenichi Handa <handa@gnu.org>
3759 * font.c (font_unparse_xlfd): Exclude special characters from the
3760 generating XLFD name.
3762 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3764 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3765 * dired.c (stat_uname, stat_gname):
3766 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3768 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3769 * dired.c (directory_files_internal, file_name_completion):
3770 Assume EAGAIN and EINTR are defined.
3772 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3773 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3774 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3775 * lread.c (readbyte_from_file): Assume EINTR is defined.
3776 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3777 Assume EIO and EAGAIN are defined.
3778 * unexcoff.c (write_segment): Assume EFAULT is defined.
3780 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3782 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3785 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3786 highlighting on the frame was cleared. Prevents assertion
3787 violations when repeatedly clicking on the "Top" link of the
3788 "bread-crumbs" in Info buffers.
3790 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3792 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3794 2012-11-24 Ken Brown <kbrown@cornell.edu>
3796 * keyboard.c (HAVE_MOUSE):
3797 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3798 were always defined.
3800 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3802 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3803 between bpos_covered and bpos_max. This fixes cursor display when
3804 several display strings follow each other.
3806 * .gdbinit (pgx): If the glyph's object is a string, display the
3807 pointer to string data, rather than the value of the string object
3808 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3810 * indent.c (Fvertical_motion): If the starting position is covered
3811 by a display string, return to one position before that, to avoid
3812 overshooting it inside move_it_to. (Bug#12930)
3814 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3816 * frame.h (struct frame): Remove display_preempted member
3817 since all users are dead long ago.
3818 * nsterm.h (struct x_output): Use the only dummy member.
3819 * w32menu.c (pending_menu_activation): Remove since not
3821 (set_frame_menubar): Adjust user.
3822 * w32term.h (struct x_output): Drop outdated #if 0 code.
3823 (struct w32_output): Use bitfields for explicit_parent,
3824 asked_for_visible and menubar_active members.
3825 Drop unused pending_menu_activation member.
3826 * xterm.h (struct x_output): Drop outdated #if 0 code.
3827 Use bitfields for explicit_parent, asked_for_visible,
3828 has_been_visible and net_wm_state_hidden_seen members.
3830 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3832 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3833 of a literal "/". (Bug#12955)
3834 (gl-stamp): Invoke fc.exe directly, not through cmd.
3836 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3838 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3839 * dired.c: Assume HAVE_DIRENT_H.
3840 (NAMLEN): Remove, replacing with ...
3841 (dirent_namelen): New function. All uses changed. Use the GNU macro
3842 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3843 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3844 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3845 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3847 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3848 * ndir.h: Rename to ../nt/inc/dirent.h.
3849 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3850 Do not include <dirent.h>; no longer needed.
3851 * w32.c: Include <dirent.h> rather than "ndir.h".
3853 2012-11-23 Chong Yidong <cyd@gnu.org>
3855 * xftfont.c (xftfont_open): Remove duplicate assignment.
3857 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3859 * alloc.c (Fgarbage_collect): Unblock input after clearing
3860 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3861 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3862 * msdos.c (IT_frame_up_to_date): Use it here...
3863 * w32term.c (w32_frame_up_to_date): ...here...
3864 * xterm.c (XTframe_up_to_date): ...and here...
3865 * nsterm.m (ns_frame_up_to_date): ...but not here.
3866 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3868 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3869 Do not check whether GC is in progress.
3871 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3873 * xdisp.c (window_buffer_changed): New function.
3874 (update_menu_bar, update_tool_bar): Use it to
3875 simplify large 'if' statements.
3876 (redisplay_internal): Generalize commonly used
3877 'tail' and 'frame' local variables.
3879 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3881 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3882 with Windows system header.
3884 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3886 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3887 * alloc.c: Assume unistd.h exists.
3888 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3889 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3890 (getwd) [USG]: Remove; no longer needed.
3891 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3892 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3893 * w32.h (getcwd): Remove decl.
3895 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3897 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3898 Make it set selected_window as well.
3899 (update_tool_bar): Use it.
3901 2012-11-21 Ken Brown <kbrown@cornell.edu>
3903 * emacs.c (main): Set the G_SLICE environment variable for all
3904 Cygwin builds, not just GTK builds. See
3905 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3907 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3909 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3910 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3911 Define for the MSVC compiler.
3913 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3915 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3916 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3917 dostounix_filename. Prevents crashes down the road, because
3918 dostounix_filename assumes it gets a unibyte string.
3919 Reported by Michel de Ruiter <michel@sentient.nl>, see
3920 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3922 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3924 Conflate Qnil and Qunbound for `symbol-function'.
3925 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3926 * lread.c (init_obarray): Set `function' fields to Qnil.
3927 * eval.c (Fcommandp): Ignore Qunbound.
3928 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3929 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3930 Test NILP rather than Qunbound.
3931 (Ffmakunbound): Set to Qnil.
3932 (Fsymbol_function): Never signal an error.
3933 (Finteractive_form): Ignore Qunbound.
3935 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3937 * eval.c (interactive_p): Remove no-longer-used decl.
3939 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3941 * xdisp.c (buffer_shared): Adjust comment.
3942 (buffer_shared_and_changed): New function.
3943 (prepare_menu_bars, redisplay_internal): Use it to
3944 decide whether all windows or frames should be updated.
3945 (window_outdated): New function.
3946 (text_outside_line_unchanged_p, redisplay_window): Use it.
3947 (redisplay_internal): Likewise. Fix indentation.
3949 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3951 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3952 (syms_of_eval): Remove corresponding defsubr.
3953 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3955 2012-11-19 Daniel Colascione <dancol@dancol.org>
3957 * w32fns.c (Fx_file_dialog):
3958 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3959 cygwin_convert_file_name*.
3961 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3962 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3964 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3966 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3968 2012-11-18 Eli Zaretskii <eliz@gnu.org>
3970 * w32select.c: Include w32common.h before w32term.h, so that
3971 windows.h gets included before w32term.h uses some of its
3972 features, see below.
3974 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3976 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3978 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3980 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
3982 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3983 (ns_select): Return at once if events are held (Bug#12834).
3985 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
3987 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3988 Needed following 2012-10-20 change. (Bug#12902)
3990 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
3992 * w32proc.c (waitpid): Remove unused label get_result.
3994 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
3996 * makefile.w32-in (SYSWAIT_H): New macro.
3997 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3998 ($(BLD)/sysdep.$(O)): Update dependencies.
4000 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4002 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4003 * callproc.c (relocate_fd): Assume F_DUPFD.
4004 * emacs.c, term.c (O_RDWR): Remove.
4005 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4006 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4007 * nsterm.m: Assume <fcntl.h> exists.
4008 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4009 (create_pty, Fmake_network_process, server_accept_connection)
4010 (wait_reading_process_output, init_process_emacs):
4012 (wait_reading_process_output): Put in a special case for WINDOWSNT
4013 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4014 It's not clear this is needed, but it's a more-conservative change.
4015 (create_process): Assume FD_CLOEXEC.
4016 (create_process, create_pty): Assume O_NOCTTY.
4017 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4018 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4019 Omit if not DOS_NT, since F_GETFL is not defined there.
4020 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4021 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4023 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4024 lack it, since gnulib guarantees this.
4025 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4027 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4029 * w32.c (faccessat): Pretend that directories have the execute bit
4030 set. Emacs expects that, e.g., in files.el:cd-absolute.
4032 * w32proc.c (create_child): Don't clip the PID of the child
4033 process to fit into an Emacs integer, as this is no longer a
4035 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4036 reaping only the process specified by PID argument, if that is
4037 positive. Use PID instead of dead_child to know which process to
4038 reap. Wait for the child to die only if WNOHANG is not in
4040 (sys_select): Don't set dead_child.
4042 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4043 as it is no longer needed.
4045 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4047 (record_child_status_change): Remove the setting of
4048 record_at_most_one_child for the !WNOHANG case.
4050 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4052 Fix problems in ns port found by static checking.
4053 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4054 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4055 not to process group.
4056 (ns_select): Use emacs_write, not write, as that's more robust
4057 in the presence of signals.
4058 (fd_handler:): Check for read errors.
4060 2012-11-16 Glenn Morris <rgm@gnu.org>
4062 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4064 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4066 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4068 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4070 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4071 use the same value of thread handle.
4072 (start_timer_thread): If the timer thread exited (due to error),
4073 clean up by closing the two handles it used. Duplicate the caller
4074 thread's handle here, so it gets duplicated only once, when
4075 launching the timer thread. Set priority of the timer thread, not
4077 (getitimer): Don't duplicate the caller thread's handle here.
4080 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4082 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4085 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4087 Remove no-longer-used pty_max_bytes variable.
4088 * process.c (pty_max_bytes): Remove; unused.
4089 (send_process): Do not set it.
4091 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4093 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4094 Update dependencies.
4096 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4098 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4099 This follows up on the 2012-09-29 patch that removed indirection
4100 for the 'function' field. Reported by Sergey Vinokurov in
4101 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4103 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4105 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4106 different name, as the MS runtime does not have such a function,
4107 and probably never will.) All callers changed. Ignore DIRFD
4108 value if PATH is an absolute file name, to match Posix spec
4109 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4112 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4114 * xdisp.c (echo_area_display, redisplay_internal):
4115 Omit redundant check whether frame_garbaged is set.
4117 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4119 Use faccessat, not access, when checking file permissions (Bug#12632).
4120 This fixes a bug that has been present in Emacs since its creation.
4121 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4122 which must set some sort of record. (Torek's bug report was against
4123 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4124 same common flaw.) See Torek's Usenet posting
4125 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4126 Posted: Fri Apr 8 14:18:56 1983.
4127 * Makefile.in (LIB_EACCESS): New macro.
4129 * callproc.c (init_callproc):
4130 * charset.c (init_charset):
4131 * fileio.c (check_existing, check_executable, check_writable)
4133 * lread.c (openp, load_path_check):
4134 * process.c (allocate_pty):
4136 Use effective UID when checking permissions, not real UID.
4137 * callproc.c (init_callproc):
4138 * charset.c (init_charset):
4139 * lread.c (load_path_check, init_lread):
4140 Test whether directories are accessible, not merely whether they exist.
4141 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4142 * fileio.c (check_existing, check_executable, check_writable)
4144 Use symbolic names instead of integers for the flags, as they're
4146 (check_writable): New arg AMODE. All uses changed.
4147 Set errno on failure.
4148 (Ffile_readable_p): Use faccessat, not stat + open + close.
4149 (Ffile_writable_p): No need to call check_existing + check_writable.
4150 Just call check_writable and then look at errno. This saves a syscall.
4151 dir should never be nil; replace an unnecessary runtime check
4152 with an eassert. When checking the parent directory of a nonexistent
4153 file, check that the directory is searchable as well as writable, as
4154 we can't create files in unsearchable directories.
4155 (file_directory_p): New function, which uses 'stat' on most platforms
4156 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4157 (Ffile_directory_p, Fset_file_times): Use it.
4158 (file_accessible_directory_p): New function, which uses a single
4159 syscall for efficiency.
4160 (Ffile_accessible_directory_p): Use it.
4161 * xrdb.c (file_p): Use file_directory_p.
4162 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4163 * lread.c (openp): When opening a file, use fstat rather than
4164 stat, as that avoids a permissions race. When not opening a file,
4165 use file_directory_p rather than stat.
4166 (dir_warning): First arg is now a usage string, not a format.
4167 Use errno. All uses changed.
4168 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4169 that merely introduced a race.
4170 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4171 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4172 and similarly for the other O_* flags.
4173 * w32.c (sys_faccessat): Rename from sys_access and switch to
4174 faccessat's API. All uses changed.
4175 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4176 (magic_db): Rename from magic_file_p.
4177 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4178 char *, so that we don't have to test for file existence
4179 separately from opening the file for reading. This removes a race
4180 fixes a permission-checking problem, and simplifies the code.
4182 (file_p): Remove; no longer needed.
4184 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4186 Omit glyphs initialization at startup.
4187 * dispnew.c (glyphs_initialized_initially_p): Remove.
4188 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4189 (Fredraw_frame): Move actual code from here...
4190 (redraw_frame): ...to here. Add eassert. Adjust comment.
4191 (Fredraw_display): Use redraw_frame.
4192 * xdisp.c (clear_garbaged_frames): Likewise.
4194 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4196 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4197 passed to pint2str and pint2hrstr to be at most the size of the
4198 frame's decode_mode_spec_buffer. This avoids crashes with very
4199 large values of FIELD_WIDTH argument to decode_mode_spec.
4202 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4204 Fix a race with verify-visited-file-modtime (Bug#12863).
4205 Since at least 1991 Emacs has ignored an mtime difference of no
4206 more than one second, but my guess is that this was to work around
4207 file system bugs that were fixed long ago. Since the race is
4208 causing problems now, let's remove that code.
4209 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4210 whose time stamp is off by no more than a second. Insist that the
4211 file time stamps match exactly.
4213 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4215 * frame.h (struct frame): Convert external_tool_bar member to
4216 1-bit unsigned bitfield.
4217 * termhooks.h (struct terminal): Remove mouse_moved member since
4218 all users are long dead. Adjust comment on mouse_position_hook.
4220 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4222 Simplify by using FOR_EACH_FRAME here and there.
4223 * frame.c (next_frame, prev_frame, other_visible_frames)
4224 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4225 * w32term.c (x_window_to_scroll_bar): Likewise.
4226 * window.c (window_list): Likewise.
4227 * xdisp.c (x_consider_frame_title): Likewise.
4228 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4229 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4230 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4231 * xmenu.c (menubar_id_to_frame): Likewise.
4232 * xselect.c (frame_for_x_selection): Likewise.
4233 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4234 (x_window_to_menu_bar): Likewise.
4235 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4237 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4239 * data.c (Qdefalias_fset_function): Now static.
4241 Another tweak to vectorlike_header change.
4242 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4243 Remove, and replace all uses with ...
4244 (next_in_free_list, set_next_in_free_list):
4245 New functions, which respect C's aliasing rules better.
4247 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4249 * window.c (list4i): Rename from 'quad'. All uses changed.
4250 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4252 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4254 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4255 warning about mixing declarations and code in ISO C90.
4257 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4259 * window.c (Fsplit_window_internal): Set combination limit of
4260 new parent window to t iff Vwindow_combination_limit is t;
4261 fixing a regression introduced with the change from 2012-09-22.
4262 (Fset_window_combination_limit): Fix doc-string.
4264 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4266 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4267 amount when the scroll margins are too large. When scrolling
4268 backwards in the buffer, give up if cannot reach point or the
4269 scroll margin within a reasonable number of screen lines.
4270 Fixes point position in window under scroll-up/down-aggressively when
4271 point is positioned many lines beyond the window top/bottom.
4274 * ralloc.c (relinquish): If real_morecore fails to return memory
4275 to the system, don't crash; instead, leave the last heap
4276 unchanged and return. (Bug#12774)
4278 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4280 * lisp.h (AUTOLOADP): New macro.
4281 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4282 * data.c (Ffset): Remove special ad-advice-info handling.
4283 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4285 (Finteractive_form): Simplify.
4286 (Fquo): Don't insist on having at least 2 arguments.
4287 (Qdefalias_fset_function): New var.
4289 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4291 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4293 * nsfont.m (Qcondensed, Qexpanded): New variables.
4294 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4295 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4297 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4299 Fix recently introduced crash on MS-Windows (Bug#12839).
4300 * w32term.h (struct scroll_bar): Use convenient header.
4301 (SCROLL_BAR_VEC_SIZE): Remove.
4302 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4304 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4306 Tweak last vectorlike_header change.
4307 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4308 vectorlike object on the free list. This is introduced to avoid
4309 some (but not all) pointer casting and aliasing problems, see
4310 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4311 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4313 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4315 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4317 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4318 been removed, so remove them here also.
4320 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4322 * doc.c (Fdocumentation): Handle new property
4323 dynamic-docstring-function to replace the old ad-advice-info.
4325 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4327 * fns.c (Qeql, hashtest_eq): Now static.
4329 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4331 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4332 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4333 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4334 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4336 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4338 Use same hash function for hashfn_profiler as for hash_string etc.
4339 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4340 * lisp.h (sxhash_combine): New inline function, with the contents
4341 of the old SXHASH_COMBINE.
4342 * profiler.c (hashfn_profiler): Use it, instead of having a
4343 special hash function containing a comparison that always yields 1.
4345 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4347 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4348 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4349 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4352 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4354 * image.c (xpm_make_color_table_h): Fix compiler error because
4355 make_hash_table changed.
4357 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4359 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4361 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4363 Use ad-hoc comparison function for the profiler's hash-tables.
4364 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4365 (make_log): Use them.
4366 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4367 call Fequal any more.
4368 (Ffunction_equal): New function.
4369 (cmpfn_profiler, hashfn_profiler): New functions.
4370 (syms_of_profiler): Initialize them.
4371 * lisp.h (struct hash_table_test): New struct.
4372 (struct Lisp_Hash_Table): Use it.
4373 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4374 * fns.c (make_hash_table): Take a struct to describe the test.
4375 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4376 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4377 (hash_lookup, hash_remove_from_table): Move assertion checking of
4378 hashfn result here. Check hash-equality before calling cmpfn.
4379 (Fmake_hash_table): Adjust call to make_hash_table.
4380 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4381 (syms_of_fns): Initialize them.
4382 * emacs.c (main): Move syms_of_fns earlier.
4383 * xterm.c (syms_of_xterm):
4384 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4385 * print.c (print_object): Adjust to new hash-table struct.
4386 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4388 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4390 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4391 value of w32-scroll-lock-modifier is neither nil nor one of the
4392 known key modifiers. (Bug#12806)
4394 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4396 Shrink struct vectorlike_header to the only size field.
4397 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4399 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4400 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4401 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4402 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4403 information from the vector header. Adjust comment.
4404 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4405 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4407 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4408 (struct vectorlike_header): Remove next member. Adjust comment.
4409 (struct Lisp_Subr): Add convenient header. Adjust comment.
4410 (allocate_pseudovector): Adjust prototype.
4411 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4412 (sweep_string, lisp_malloc): Remove useless prototypes.
4413 (enum mem_type): Adjust comment.
4414 (NEXT_IN_FREE_LIST): New macro.
4415 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4416 (Fmake_bool_vector): Likewise.
4417 (struct large_vector): New type to represent allocation unit for
4418 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4419 (large_vectors): Change type to struct large_vector.
4420 (allocate_vector_from_block): Simplify.
4421 (PSEUDOVECTOR_NBYTES): Replace with...
4422 (vector_nbytes): ...new function. Adjust users.
4423 (sweep_vectors): Adjust processing of large vectors.
4424 (allocate_vectorlike): Likewise.
4425 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4426 Add easserts. Adjust XSETPVECTYPESIZE usage.
4427 (allocate_buffer): Use BUFFER_PVEC_INIT.
4428 (live_vector_p): Adjust to match large vector.
4429 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4430 * buffer.h (struct buffer): Add next member.
4431 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4433 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4434 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4435 (copy_hash_table): Adjust to match vector header change.
4436 * lread.c (defsubr): Use XSETPVECTYPE.
4437 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4438 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4439 (xvecsize): New command.
4441 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4443 * keyboard.c (event_to_kboard): Do not dereference
4444 frame_or_window field of SELECTION_REQUEST_EVENT
4445 and SELECTION_CLEAR_EVENT events (Bug#12814).
4446 * xterm.h (struct selection_input_event): Adjust comment.
4448 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4450 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4451 such as Scroll Lock, if the respective keys are treated as
4452 function keys, not as modifiers. This avoids destroying non-ASCII
4453 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4455 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4457 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4459 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4461 Restore some duplicate definitions (Bug#12814).
4462 This undoes part of the 2012-11-03 changes. Some people build
4463 with plain -g rather than with -g3, and they need the duplicate
4464 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4465 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4466 Define as macros, as well as as enums or as constants.
4468 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4470 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4471 to keypad keys (Bug#12816).
4473 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4475 Minor adjustments of recently-changed frame functions.
4476 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4477 known to be a frame (we're in the FRAMEP branch).
4478 * lisp.h (Qframep): Remove decl. frame.h declares this.
4479 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4480 since they're meant for Lisp fixnum values.
4482 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4484 * window.c (Fwindow_combination_limit): Revert to the only
4485 required argument and adjust docstring as suggested in
4486 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4487 by Martin Rudalics <rudalics@gmx.at>.
4489 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4491 Widely used frame validity and checking functions.
4492 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4493 * frame.c (decode_live_frame, decode_any_frame): New functions.
4494 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4495 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4496 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4497 (Fframe_pointer_visible_p): Use decode_any_frame.
4498 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4499 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4500 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4501 (Fframe_focus): Likewise. Allow zero number of arguments.
4503 (frame_buffer_list, frame_buffer_predicate): Remove.
4504 * lisp.h (frame_buffer_predicate): Remove prototype.
4505 * buffer.c (Fother_buffer): Use decode_any_frame.
4506 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4507 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4508 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4509 (Fclose_font, Ffont_info): Use decode_live_frame.
4510 * fontset.c (check_fontset_name): Likewise.
4511 * terminal.c (Fframe_terminal): Likewise.
4512 * w32fns.c (check_x_frame): Likewise.
4513 * window.c (Fminibuffer_window, Fwindow_at)
4514 (Fcurrent_window_configuration): Likewise.
4515 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4516 Likewise. Allow zero number of arguments. Adjust docstring.
4517 * dispnew.c (Fredraw_frame): Likewise.
4518 * xfaces.c (frame_or_selected_frame): Remove.
4519 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4520 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4521 (Fframe_face_alist): Use decode_live_frame.
4522 * xfns.c (check_x_frame): Likewise.
4524 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4526 * window.c (quad): New function.
4527 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4528 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4529 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4530 (Fwindow_line_height): Use it.
4531 (Fwindow_fringes): Use list3.
4532 (Fwindow_scroll_bars): Use list4.
4533 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4534 (Fwindow_combination_limit): Allow zero number of arguments.
4536 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4538 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4540 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4541 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4542 file descriptor 2 for standard error. (Bug#12805)
4544 2012-11-05 Chong Yidong <cyd@gnu.org>
4546 * process.c (wait_reading_process_output): Revert previous change.
4548 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4550 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4551 This removes code that has been obsolete since around 1990.
4552 * callproc.c (Fcall_process):
4554 * process.c (create_process):
4555 * term.c (dissociate_if_controlling_tty):
4556 Assume setsid exists.
4557 * callproc.c (child_setup): Assume setpgid exists and behaves as
4558 per POSIX.1-1988 or later.
4559 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4560 * emacs.c (shut_down_emacs):
4561 * sysdep.c (sys_suspend, init_foreground_group):
4562 Assume getpgrp behaves as per POSIX.1-1998 or later.
4563 * msdos.c (setpgrp): Remove.
4564 (tcgetpgrp, setpgid, setsid): New functions.
4565 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4566 * term.c (no_controlling_tty): Remove; unused.
4567 * w32proc.c (setpgrp): Remove.
4568 (setsid, tcgetpgrp): New functions.
4570 Simplify by assuming __fpending.
4571 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4572 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4573 Do not assume that __fpending's result fits in int.
4575 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4577 Remove EMACS_OUTQSIZE+sleep hack.
4578 * dispnew.c (update_frame_1): Remove hack for terminals slower
4579 than 2400 bps, which throttled Emacs by having it sleep.
4580 This code hasn't worked since at least 2007, when the multi-tty stuff
4581 was added, and anyway those old terminals are long dead.
4582 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4583 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4585 Fix data-loss with --version (Bug#9574).
4586 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4587 as we can't assume that emacs_strerror is initialized, and strerror
4588 is good enough here.
4589 (main): Invoke atexit earlier, to catch earlier instances of
4590 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4592 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4594 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4595 (keyDown): Remap keypad keys to X11 virtual key codes.
4597 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4599 Fix data-loss with --batch (Bug#9574).
4600 * emacs.c: Include <close-stream.h>.
4601 (close_output_streams): New function.
4602 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4603 and handles errors appropriately.
4604 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4607 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4608 The symptom is a diagnostic "GLib-WARNING **: In call to
4609 g_spawn_sync(), exit status of a child process was requested but
4610 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4611 waitpid(), so exit status can't be returned." The diagnostic
4612 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4613 The real bug is a race condition between Emacs and glib: Emacs
4614 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4615 so that glib can't find it. Work around the bug by invoking
4616 waitpid only on subprocesses that Emacs itself creates.
4617 * process.c (create_process, record_child_status_change):
4618 Don't use special value -1 in pid field, as the caller now must
4619 know the pid rather than having the callee infer it.
4620 The inference was sometimes incorrect anyway, due to another race.
4621 (create_process): Set new 'alive' member if child is created.
4622 (process_status_retrieved): New function.
4623 (record_child_status_change): Use it.
4624 Accept negative 1st argument, which means to wait for the
4625 processes that Emacs already knows about. Move special-case code
4626 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4627 processes that have already been waited for, by testing and
4628 clearing new 'alive' member.
4629 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4630 now does this internally.
4631 (handle_child_signal): Let record_child_status_change do all
4632 the work, since we do not want to reap all exited child processes,
4633 only the child processes that Emacs itself created.
4634 * process.h (Lisp_Process): New boolean member 'alive'.
4636 Omit duplicate definitions no longer needed with gcc -g3.
4637 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4638 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4639 Define only as macros. There's no longer any need to also define
4640 these symbols as enums or as constants, since we now assume
4641 gcc -g3 when debugging.
4643 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4645 * lisp.mk: Adjust comments to the fact that term/internal is now
4646 loaded from loadup.el.
4648 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4649 (msdos_fatal_signal): New function.
4650 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4653 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4654 for GCC versions before 4.
4655 (emacs_raise): Define to call msdos_fatal_signal.
4657 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4658 iterator when starting in the middle of a display or overlay
4661 2012-11-03 Chong Yidong <cyd@gnu.org>
4663 * process.c (wait_reading_process_output): Clean up the last
4666 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4668 * process.c (wait_reading_process_output): Avoid a race condition
4669 with SIGIO delivery (Bug#11536).
4671 2012-11-03 Chong Yidong <cyd@gnu.org>
4673 * buffer.c (cursor_type): Untabify docstring.
4675 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4677 * frame.h (struct frame): Drop can_have_scroll_bars member
4678 which is meaningless for a long time. Adjust comments.
4679 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4680 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4682 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4684 * window.c (decode_next_window_args): Update window arg after
4685 calling decode_live_window and so fix crash reported at
4686 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4687 by Juanma Barranquero <lekktu@gmail.com>.
4688 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4689 * font.c (Ffont_at): Likewise.
4691 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4693 * widget.c (resize_cb): New function.
4694 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4695 (EmacsFrameResize): Check if all is up to date before changing frame
4698 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4700 Implement backtrace output for fatal errors on MS-Windows.
4701 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4702 (BACKTRACE_LIMIT_MAX): New macro.
4703 (w32_backtrace): New function.
4704 (emacs_abort): Use w32_backtrace when the user chooses not to
4705 attach a debugger. Update the text of the abort dialog.
4707 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4709 Window-related stuff cleanup here and there.
4710 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4711 Use decode_any_window.
4712 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4713 * xdisp.c (Fformat_mode_line): Likewise.
4714 * font.c (Ffont_at): Use decode_live_window.
4715 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4716 * window.c (decode_next_window_args): Likewise.
4717 (decode_any_window): Remove static.
4718 * window.h (decode_any_window): Add prototype.
4719 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4720 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4723 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4725 Remove pad from struct input_event.
4726 * termhooks.h (struct input_event): Remove padding field.
4728 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4729 member is never cons for a long time. Adjust comment.
4730 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4731 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4732 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4733 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4735 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4737 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4739 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4741 Fix crash when using Emacs as commit editor for git (Bug#12697).
4742 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4743 and it is configured in conf_post.h.
4744 (Fcall_process): Don't invoke both setsid and setpgid; the former
4745 is enough, if it exists.
4746 * callproc.c (Fcall_process, child_setup):
4747 * process.c (create_process): Use setpgid.
4748 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4750 * dispnew.c (init_display): Initialize the foreground group
4751 if we are running a tty display.
4752 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4753 * lisp.h (init_foreground_group): New decl.
4754 * sysdep.c (inherited_pgroup): New static var.
4755 (init_foreground_group, tcsetpgrp_without_stopping)
4756 (narrow_foreground_group, widen_foreground_group): New functions.
4757 (init_sys_modes): Narrow foreground group.
4758 (reset_sys_modes): Widen foreground group.
4760 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4762 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4764 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4766 * minibuf.c (read_minibuf): Restore current buffer since
4767 choose_minibuf_frame calling Fset_frame_selected_window may
4768 change it (Bug#12766).
4770 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4772 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4774 2012-10-30 Kenichi Handa <handa@gnu.org>
4776 * font.c (Ffont_at): If WINDOW is specified and it is not
4777 displaying the current buffer, signal an error.
4779 2012-10-29 Daniel Colascione <dancol@dancol.org>
4781 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4782 In preparation for fixing bug#12739, move these functions from
4785 * coding.h, coding.c: ... to here, and compile them only when
4786 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4787 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4789 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4791 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4792 (timer_loop, getitimer, setitimer): Use it instead of
4793 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4795 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4798 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4800 * nsterm.m (NO_APPDEFINED_DATA): New define.
4801 (last_appdefined_event_data): New variable
4802 (last_appdefined_event): Remove.
4803 (ns_select): Initialize t from last_appdefined_event_data instead
4804 of [last_appdefined_event data1].
4805 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4806 remove last_appdefined_event (Bug#12698).
4808 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4810 * frame.c (x_set_font): Catch internal error.
4812 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4814 Avoid overflow in w32 implementation of interval timers.
4815 When possible, for ITIMER_PROF count only times the main thread
4817 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4818 'volatile ULONGLONG' types. All the other data which was
4819 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4820 (GetThreadTimes_Proc): New typedef.
4821 (w32_get_timer_time): New function, returns a suitable time value
4823 (timer_loop): Enter critical section when accessing ULONGLONG
4824 values of the itimer_data struct, as these accesses are no longer
4825 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4826 Remove unused variable.
4827 (init_timers): Initialize s_pfn_Get_Thread_Times.
4828 (start_timer_thread): Don't assign itimer->caller_thread here.
4829 (getitimer): Assign itimer->caller_thread here.
4830 (setitimer): Always call getitimer to get the value of ticks_now.
4831 (sys_spawnve): Avoid compiler warning about format mismatch.
4833 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4835 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4836 mouse movement events if the menu bar is active. This avoids
4837 producing a busy "hour-glass" cursor by Windows if the mouse
4838 pointer is positioned over a tooltip shown for some menu item.
4840 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4842 Don't assume process IDs fit in int.
4843 * emacs.c (shut_down_emacs) [!DOS_NT]:
4844 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4845 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4846 Use pid_t, not int, to store process IDs, as 'int'
4847 is not wide enough on a few platforms (e.g., AIX and IRIX).
4849 2012-10-23 Kenichi Handa <handa@gnu.org>
4851 The following change is to make face-font-rescale-alist work
4852 correctly for non-ASCII fonts.
4854 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4855 (font_open_for_lface): Handle Vface_font_rescale_alist.
4857 2012-10-23 Chong Yidong <cyd@gnu.org>
4859 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4861 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4863 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4865 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4867 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4870 2012-10-21 Glenn Morris <rgm@gnu.org>
4872 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4874 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4876 Port to OpenBSD 5.1.
4877 * frame.c (Fmouse_position, Fmouse_pixel_position):
4878 * xdisp.c (produce_stretch_glyph):
4879 Declare local vars only when they're needed.
4880 This is clearer and avoids a warning on OpenBSD about unused vars.
4881 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4882 This is safer, and avoids OpenBSD warnings about unused vars.
4883 * keyboard.c (record_menu_key): Remove unnecessary decl.
4884 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4885 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4886 as our definition clashes with OpenBSD's.
4887 * xfaces.c (load_face_colors, check_lface_attrs)
4888 (get_lface_attributes_no_remap, get_lface_attributes)
4889 (lface_fully_specified_p, x_supports_face_attributes_p)
4890 (tty_supports_face_attributes_p, face_fontset, realize_face)
4891 (realize_x_face, realize_tty_face):
4892 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4893 merely Lisp_Object *. This is more informative and avoids
4894 a warning on OpenBSD about accessing beyond an object's size.
4896 2012-10-20 Chong Yidong <cyd@gnu.org>
4898 * lread.c (Fload): Doc fix (Bug#12592).
4900 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4902 * font.c (Ffont_at): Fix previous change.
4904 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4906 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4907 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4910 * alloc.c (NSTATICS): Decrease to 0x800.
4912 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4914 * fns.c (Fnreverse): Include the problem element when signaling an
4917 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4919 * nsterm.m (ns_select): Check writefds before call to
4920 FD_ISSET (Bug#12668).
4922 2012-10-18 Daniel Colascione <dancol@dancol.org>
4924 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4925 (staticpro): If we run out of staticpro slots, die with an
4926 informative error instead of just calling emacs_abort.
4928 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4930 Fix two flaws reported by Dmitry Antipov.
4931 * window.c (Ftemp_output_buffer_show): Remove.
4932 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4933 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4935 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4937 * makefile.w32-in ($(BLD)/w32.$(O)):
4938 ($(BLD)/vm-limit.$(O)):
4940 ($(BLD)/unexw32.$(O)):
4941 ($(BLD)/fileio.$(O)):
4942 ($(BLD)/dispnew.$(O)): Update dependencies.
4944 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4947 * w32proc.c: Include ctype.h.
4949 * w32.h (init_environment, check_windows_init_file)
4950 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4951 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4952 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4953 (sys_link): Add prototypes.
4955 * w32.c: Include w32select.h.
4956 (sys_access, e_malloc, sys_select): Add prototypes.
4957 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4959 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4961 * unexw32.c: Include lisp.h and w32.h.
4963 * term.c [WINDOWSNT]: Include w32term.h.
4965 * process.c [WINDOWSNT]: Add prototype of sys_select.
4967 * fileio.c [WINDOWSNT]: Include w32.h.
4969 * dispnew.c [WINDOWSNT]: Include w32.h.
4971 * cygw32.c (Fcygwin_convert_path_to_windows)
4972 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4973 Lisp_Object values. (Bug#12661)
4975 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4976 to Lisp_Object. (Bug#12661)
4978 2012-10-17 Kenichi Handa <handa@gnu.org>
4980 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4983 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4985 * buffer.c (Fkill_buffer): When unchaining the marker,
4986 reset its buffer pointer to NULL (Bug#12652).
4988 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4990 Do not verify indirection counters of killed buffers (Bug#12579).
4991 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4992 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4994 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4996 * alloc.c (Fmake_byte_code): Fix typo in comment.
4997 * print.c (print_interval): Define as static to match prototype.
4998 * indent.c (disptab_matches_widthtab, recompute_width_table):
5001 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5003 * editfns.c (get_system_name): Remove.
5004 * lisp.h (get_system_name): Remove prototype.
5005 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5006 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5008 2012-10-15 Daniel Colascione <dancol@dancol.org>
5010 * dbusbind.c: Add comment explaining reason for previous change.
5012 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5014 * window.c (Fwindow_end): Rewrite check whether cached position
5015 can be used (Bug#12600).
5016 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5017 Set windows_or_buffers_changed.
5019 2012-10-15 Daniel Colascione <dancol@dancol.org>
5021 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5022 enabled by undefining the symbol "interface", which the platform
5023 headers define to something incompatible.
5025 2012-10-14 Daniel Colascione <dancol@dancol.org>
5027 * image.c (init_tiff_functions, init_imagemagick_functions)
5028 (init_svg_functions): Fix cygw32 build break by using these
5029 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5031 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5033 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5035 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5037 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5039 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5041 * coding.c (detect_coding): Set coding->id before calling
5044 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5046 * fileio.c: Formatting fixes.
5048 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5050 Fix some stat-related races.
5051 * fileio.c (Fwrite_region): Avoid race condition if a file is
5052 removed or renamed by some other process immediately after Emacs
5053 writes it but before Emacs stats it. Do not assume that stat (or
5055 * image.c (slurp_file): Resolve the file name with fopen + fstat
5056 rather than stat + fopen.
5057 (pbm_read_file) [0]: Remove unused code with stat race.
5058 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5059 Remove ineffective code with stat race.
5061 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5063 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5065 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5067 * nsterm.m (hold_event_q): New static variable.
5068 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5070 (hold_event): New function.
5071 (ns_read_socket): If hold_event_q have events, store them and
5073 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5074 is zero (Bug#12384).
5076 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5078 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5080 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5082 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5084 * fileio.c (check_existing): New function.
5085 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5086 instead of calling 'stat', when what's needed is to check whether
5087 a file exists. This avoids expensive system calls on MS-Windows.
5090 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5092 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5093 determine whether a file exists and is not a directory.
5095 * lisp.h (check_existing): Add prototype.
5097 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5099 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5101 2012-10-12 Glenn Morris <rgm@gnu.org>
5103 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5105 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5107 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5109 * eval.c (Fautoload): Remember previous autoload status in load-history.
5111 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5113 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5114 * lread.c (load_each_byte, new_backquote_flag, readchar)
5115 (read_filtered_event, lisp_file_lexically_bound_p)
5116 (safe_to_load_version, Fload, complete_filename_p, openp)
5117 (build_load_history, readevalloop, read_escape, read1)
5118 (string_to_number, read_vector, read_list):
5119 * macros.c (Fstart_kbd_macro):
5120 * marker.c (CONSIDER):
5121 * menu.c (parse_single_submenu, digest_single_submenu)
5122 (find_and_return_menu_selection, Fx_popup_menu):
5123 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5125 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5127 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5128 (xmenu_show, xdialog_show):
5129 Use bool for booleans.
5130 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5131 as it's not a predicate. All uses changed. Omit unnecessary
5134 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5136 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5137 (save_excursion_restore): Do not restore mark if it was not saved.
5139 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5141 * marker.c (cached_modiff): EMACS_INT, not int.
5143 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5144 instead of having a wrong decl.
5145 * nsmenu.m (waiting_for_input): Remove wrong decl.
5147 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5149 keyboard.c, keymap.c: Use bool for booleans.
5150 * dispnew.c (sit_for): Distinguish between 3-way display_option
5151 and boolean do_display.
5152 * keyboard.c (single_kboard, this_command_key_count_reset)
5153 (waiting_for_input, echoing, immediate_quit, input_pending)
5154 (interrupt_input, interrupts_deferred, pop_kboard)
5155 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5156 (command_loop_1, adjust_point_for_property)
5157 (safe_run_hooks_error, input_polling_used, read_char):
5158 (help_char_p, readable_events, kbd_buffer_events_waiting)
5159 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5160 (lucid_event_type_list_p, get_input_pending):
5161 (gobble_input, menu_separator_name_p, menu_bar_item)
5162 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5163 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5164 (keyremap_step, test_undefined, read_key_sequence)
5165 (detect_input_pending, detect_input_pending_ignore_squeezables)
5166 (detect_input_pending_run_timers, requeued_events_pending_p)
5167 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5168 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5169 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5170 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5171 (accessible_keymaps_1, Fkey_description, push_key_description):
5172 (shadow_lookup, struct where_is_internal_data)
5173 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5174 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5175 (describe_map, describe_vector):
5176 * menu.c (single_menu_item):
5177 * nsmenu.m (ns_update_menubar):
5178 * process.c (wait_reading_process_output):
5179 * search.c (scan_buffer, scan_newline):
5180 Use bool for boolean.
5181 * keyboard.c (timers_run, swallow_events)
5182 (detect_input_pending_run_timers):
5183 * process.c (wait_reading_process_output):
5184 Use unsigned for counter where wraparound-on-overflow is desired,
5185 since unsigned is guaranteed to have that behavior and signed is not.
5186 (read_char): Use ptrdiff_t for string length.
5187 (get_input_pending): Remove first argument, since it was always
5188 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5189 and behave as if it had that value. Return new value of
5190 input_pending. All callers changed.
5191 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5192 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5194 * keymap.c (push_key_description): Omit last arg, which was always 1.
5195 All callers changed.
5197 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5199 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5201 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5202 ($(BLD)/term.$(O)): Update dependencies.
5204 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5206 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5207 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5208 initializer for PVEC_NORMAL_VECTOR.
5210 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5212 Clean out old termopts cruft.
5213 * termopts.h (flow_control, meta_key): Remove unused decls.
5214 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5215 Don't include termopts.h.
5217 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5219 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5221 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5223 * commands.h (immediate_quit): Remove duplicate decl.
5225 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5227 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5229 (nsfont_open): Remove setting of Vfonts_in_cache.
5230 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5232 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5234 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5235 match what GetLastError returns. Explain why the function is
5238 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5239 'is_tooltip_frame', to avoid confusion with its global namesake.
5241 2012-10-08 Daniel Colascione <dancol@dancol.org>
5243 * xdisp.c (start_hourglass): Call w32_note_current_window when
5244 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5245 build that caused Emacs to display the hourglass cursor forever.
5247 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5248 which is broken under remote desktop, calculate the number of
5249 colors available for a display based on the display's number of
5250 planes and number of bits per pixel per plane. (bug#10397).
5252 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5254 * nsfont.m (Vfonts_in_cache): New variable.
5255 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5256 are used. Add cached fonts to Vfonts_in_cache.
5257 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5259 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5261 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5263 (FONT_H): Define after FRAME_H.
5264 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5265 Update dependencies.
5267 * w32term.c: Remove leftover declaration of keyboard_codepage.
5269 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5271 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5272 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5273 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5274 (GLOBAL_SOURCES): Add cygw32.c.
5275 ($(BLD)/unexw32.$(O)):
5277 ($(BLD)/w32console.$(O)):
5278 ($(BLD)/w32fns.$(O)):
5279 ($(BLD)/w32heap.$(O)):
5280 ($(BLD)/w32menu.$(O)):
5281 ($(BLD)/w32proc.$(O)): Add w32common.h.
5283 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5285 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5287 2012-10-08 Daniel Colascione <dancol@dancol.org>
5289 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5290 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5291 accidental message numbering hole. Change other messages to
5294 * w32select.h (HAVE_W32SELECT): Remove.
5296 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5297 w32common.h instead of w32heap.h.
5299 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5300 (get_allocation_unit, get_processor_type, get_w32_major_version)
5301 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5302 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5303 (OS_NT, os_subtype, cache_system_info): Move declarations to
5306 * w32heap.c: Include w32common.h.
5307 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5308 (w32_minor_version, w32_build_number, w32_subtype):
5309 Remove duplicate definitions.
5311 * w32fns.c: Include w32common.h; include w32heap.h only in
5314 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5315 Use `report_file_error' instead of `error' in order to better
5316 inform users of what went wrong. Increase NTGUI_UNICODE file
5317 dialog box file name length to 32k, the maximum allowed by the NT
5320 * w32common.h: New file.
5321 (ROUND_UP, ROUND_DOWN, get_page_size)
5322 (get_allocation_unit, get_processor_type, get_w32_major_version)
5323 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5324 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5325 (OS_NT, os_subtype, cache_system_info): Move here.
5327 * unexw32.c, unexcw.c: Include w32common.h.
5329 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5330 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5331 to call syms_of_w32select.
5333 * cygw32.h: Remove obsolete EXFUN declarations.
5335 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5337 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5338 of w32inevt.o from SOME_MACHINE_OBJECTS.
5340 2012-10-08 Daniel Colascione <dancol@dancol.org>
5342 * image.c: Permanent fix for JPEG compilation issue --- limit
5343 jpeglib `boolean' redefinition to Cygwin builds.
5345 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5347 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5349 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5352 2012-10-08 Daniel Colascione <dancol@dancol.org>
5354 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5355 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5356 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5357 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5358 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5359 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5360 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5361 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5362 now a supported configuration.
5364 * Makefile.in: consolidate image variables into LIBIMAGE; add
5365 W32_OBJ and W32_LIBS. Compile new files.
5368 (_DebPrint) declare tracing facility for W32 debugging. We need
5369 to unify tracing later.
5371 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5372 unconditional use of W32 Unicode functions. Cygwin runs only on
5373 100% Unicode operating systems.
5375 * cygw32.c: New file. Define Cygwin-specific facilities.
5376 (Fcygwin_convert_path_to_windows)
5377 (Fcygwin_convert_path_from_windows): New user functions for
5378 accessing Cygwin path-munging routines.
5380 * cygw32.h: New file.
5381 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5382 UTF-16LE strings temporarily inside non-Lisp-visible string
5385 (w32_strerror): Just what it says on the tin.
5387 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5388 also run for Cygwin; both systems have the same problem with using
5389 GUI facilities in a forked child. Also call syms_of_cygw32,
5390 syms_of_w32select in correct places.
5392 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5393 needs fork-then-exec for daemon launching.
5395 * font.h: Include frame.h.
5397 * image.c: Use the image library cache machinery only when we're
5398 compiling for native WINDOWSNT; Cygwin can use shared libraries
5399 like any other Unixlike system.
5401 * keyboard.c: Clarify a comment regarding the input loop.
5403 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5404 functions directly instead of trying to detect at runtime that our
5405 host operating system supports them. We make this change for two
5406 reasons: Cygwin lacks support for the multibyte character
5407 conversion functions used by the legacy menu code, and Cygwin
5408 never needs to rely on non-Unicode APIs.
5410 * unexw32.c (hinst): Declare extern.
5412 * w32.c: Change header order;
5413 (w32_strerror): Move to w32fns.c because we need it for
5414 non-WINDOWSNT builds.
5416 * w32.h: Add #error macro to make sure we don't include w32.h for
5417 Cygwin builds. Remove w32select declarations.
5419 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5420 w32fns.c. w32console.c is WINDOWSNT-only.
5422 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5423 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5425 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5426 (w32_major_version, w32_minor_version, w32_build_number)
5427 (os_subtype, sound_type): Define here
5428 (w32_defined_color): Make color parameter const for consistency
5429 with other _defined_color functions.
5430 (w32_createwindow): Unconditionally call w32_init_class instead of
5431 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5432 through the code is complex and unnecessary because class
5433 registration is practically free.
5434 (w32_name_of_message): New EMACSDEBUG-only function.
5435 (Fset_message_beep): Move here
5436 (Fx_open_connection): Require that the display name for Windows be
5437 "w32" for consistency, emacsclient disambiguation, and maybe, one
5438 day, multi-window-system support.
5439 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5440 Cygwin files for W32 GUI facilities, since these clearly don't
5441 expect Cygwin names.
5442 (_DebPrint): Define.
5443 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5444 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5445 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5446 (w32_last_error): Remove.
5448 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5450 * w32heap.c (syspage_mask): Declare here.
5451 (cache_system_info): Remove.
5453 * w32inevt.c (faked_key): Define globally, not statically.
5454 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5455 (w32_console_toggle_lock_key): Move to w32fns.c.
5457 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5459 * w32proc.c (_DebPrint): Move to w32fns.c.
5460 * w32select.c: Include string.h, stdio.h for Cygwin.
5461 * w32select.h: New File.
5463 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5465 (w32_message_fd): New variable. Under Cygwin, holds the file
5466 descriptor the system used to tell us about pending thread
5469 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5470 that prevented compilation under non-WINDOWSNT systems.
5472 (w32_initialize): Open /dev/windows and assign it to
5473 w32_message_fd. Provide w32 feature.
5475 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5476 (WM_EMACS_INPUT_READY): add.
5477 (prepend_msg, w32_message_fd): Declare globally.
5480 (keyboard_handle): Use only when WINDOWSNT.
5481 (notify_msg_ready): New function. Posts a message to the main
5482 thread's message queue under CYGWIN, which wakes up the main
5483 thread from select(2) by making the /dev/windows file descriptor
5484 ready. Under WINDOWSNT, it sets an event the same way the old
5487 (post, prepend_msg): Actually call notify_msg_ready instead of
5488 setting the input event directly.
5490 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5492 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5493 but it still has blocs in it, don't return it to the system,
5494 instead of aborting. (Bug#12402)
5496 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5498 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5500 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5501 MAC_OS_X_VERSION_10_6.
5502 (syms_of_nsterm): Remove comment about Panther and above for
5504 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5505 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5506 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5508 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5509 MAC_OS_X_VERSION_10_4.
5511 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5512 MAC_OS_X_VERSION_10_2.
5514 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5516 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5517 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5519 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5520 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5521 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5522 Remove ns_in_resize check.
5523 (ns_clear_frame_area): Remove resize handle code.
5525 * nsfns.m (ns_in_resize): Remove.
5526 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5527 Remove ns_in_resize check.
5529 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5531 Improve sys_siglist detection.
5532 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5533 defined as a macro, as is done in Solaris.
5534 (sys_siglist_entries): New macro.
5535 (save_strsignal): Use it.
5536 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5537 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5539 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5541 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5542 fullscreen/Fullscreen.
5544 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5545 tobar_height is new.
5547 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5548 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5549 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5550 (windowDidResize:): Check for correct window if old style fullscreen.
5551 Capitalize word in comment. Remove incorrect comment.
5552 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5553 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5554 error in drawing background.
5555 (toggleFullScreen:): Remove comment. Rearrange calls.
5556 Set toolbar values to zero, save old height in tobar_height.
5557 Restore tool bar height when leaving fullscreen.
5558 (canBecomeMainWindow): New function.
5560 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5562 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5564 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5566 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5568 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5569 that time stamps of directories could also be changed.
5570 Don't request the too broad GENERIC_WRITE, only the more restrictive
5571 FILE_WRITE_ATTRIBUTES access rights.
5573 * fileio.c (Fset_file_times): Special-case ignoring errors for
5574 directories only on MSDOS, not on MS-Windows.
5576 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5578 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5580 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5582 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5583 see whether CreateFile failed.
5585 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5587 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5588 to avoid similar races.
5589 * keyboard.c (pending_signals): Now bool, not int.
5591 Port timers to OpenBSD, plus check for timer failures.
5592 OpenBSD problem reported by Han Boetes.
5593 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5595 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5596 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5597 like OpenBSD, which has timer_settime but does not declare it.
5598 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5599 whether to use itimerspec-related primitives. All uses of
5600 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5602 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5604 * profiler.c (handle_profiler_signal): Fix a malloc race
5605 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5607 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5609 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5611 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5613 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5614 consistent with the change in return value of 'safe_strsignal'.
5616 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5618 Prefer plain 'static' to 'static inline' (Bug#12541).
5619 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5620 (bidi_set_sor_type, bidi_push_embedding_level)
5621 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5622 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5623 (bidi_cache_search, bidi_cache_ensure_space)
5624 (bidi_cache_iterator_state, bidi_cache_find)
5625 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5626 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5627 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5628 Now 'static', not 'static inline'.
5630 Count overruns when profiling; change units to ns.
5631 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5632 Give extra weight to samples after overruns, to attempt to count
5633 the time more accurately.
5634 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5635 the underlying primitives nominally do ns.
5636 (Fprofiler_cpu_start): Document the change. Mention that
5637 the sampling intervals are only approximate.
5639 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5641 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5643 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5644 case for the special 0 coding-system.
5646 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5647 (Fmake_overlay): Remove redundant tests.
5648 (fix_start_end_in_overlays): Remove redundant recentering.
5650 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5652 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5653 Update dependencies.
5655 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5657 Fix a malloc race condition involving strsignal.
5658 A signal can arrive in the middle of a malloc, and Emacs's signal
5659 handler can invoke strsignal, which can invoke malloc, which is
5660 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5661 Fix it by altering the signal handler so that it does not invoke
5663 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5664 * process.c (status_message): Use const pointer, in case strsignal
5665 is #defined to safe_strsignal.
5666 * sysdep.c (sys_siglist, init_signals): Always define and
5667 initialize a substitute sys_siglist if the system does not define
5668 one, even if HAVE_STRSIGNAL.
5669 (safe_strsignal): Rename from strsignal. Always define,
5670 using sys_siglist. Return a const pointer.
5671 * syssignal.h (safe_strsignal): New decl.
5672 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5674 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5676 * w32proc.c (timer_loop): Fix code that waits for timer
5677 expiration, to avoid high CPU usage.
5679 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5681 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5682 (sweep_weak_table): Remove redundant prototypes.
5684 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5686 * emacs.c: Move the inclusion of TERM_HEADER after including
5687 windows.h on WINDOWSNT. This avoids compilation problems with
5690 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5692 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5693 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5694 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5695 as the previous version used 'void *'.
5697 * ralloc.c (ROUNDUP): Fix last change.
5698 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5701 * w32proc.c <disable_itimers>: New static flag.
5702 (init_timers): Initialize it to zero, after creating the critical
5703 sections used by the timer threads.
5704 (term_timers): Set to 1 before deleting the critical sections.
5705 (getitimer, setitimer): If disable_itimers is non-zero, return an
5706 error indication without doing anything. Reported by Fabrice
5707 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5708 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5710 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5713 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5714 term_ntproc after all the other bookkeeping, to get timers working
5715 as long as possible.
5717 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5719 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5720 Suggested by Juri Linkov in
5721 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5723 Prefer plain 'static' to 'static inline' (Bug#12541).
5724 With static functions, modern compilers inline pretty well by
5725 themselves; advice from programmers often hurts as much as it helps.
5726 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5727 this change shrinks the text size of the Emacs executable by 1.1%
5728 without affecting CPU significantly in my benchmark.
5729 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5730 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5731 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5732 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5733 (bset_auto_fill_function, bset_auto_save_file_format)
5734 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5735 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5736 (bset_cache_long_line_scans, bset_case_fold_search)
5737 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5738 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5739 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5740 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5741 (bset_header_line_format, bset_indicate_buffer_boundaries)
5742 (bset_indicate_empty_lines, bset_invisibility_spec)
5743 (bset_left_fringe_width, bset_major_mode, bset_mark)
5744 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5745 (bset_name, bset_overwrite_mode, bset_pt_marker)
5746 (bset_right_fringe_width, bset_save_length)
5747 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5748 (bset_scroll_up_aggressively, bset_selective_display)
5749 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5750 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5751 (set_buffer_overlays_after):
5752 * category.c (bset_category_table):
5753 * charset.c (read_hex):
5754 * coding.c (produce_composition, produce_charset)
5755 (handle_composition_annotation, handle_charset_annotation)
5757 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5758 (assign_row, set_frame_matrix_frame, make_current)
5760 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5761 * fns.c (maybe_resize_hash_table):
5762 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5763 * gmalloc.c (register_heapinfo):
5764 * image.c (lookup_image_type):
5765 * intervals.c (set_interval_object, set_interval_left)
5766 (set_interval_right, copy_interval_parent, rotate_right)
5767 (rotate_left, balance_possible_root_interval):
5768 * keyboard.c (kset_echo_string, kset_kbd_queue)
5769 (kset_keyboard_translate_table, kset_last_prefix_arg)
5770 (kset_last_repeatable_command, kset_local_function_key_map)
5771 (kset_overriding_terminal_local_map, kset_real_last_command)
5772 (kset_system_key_syms, clear_event, set_prop):
5773 * lread.c (digit_to_number):
5774 * marker.c (attach_marker, live_buffer, set_marker_internal):
5775 * nsterm.m (ns_compute_glyph_string_overhangs):
5776 * process.c (pset_buffer, pset_command)
5777 (pset_decode_coding_system, pset_decoding_buf)
5778 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5779 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5780 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5781 * syntax.c (bset_syntax_table, dec_bytepos):
5782 * terminal.c (tset_param_alist):
5783 * textprop.c (interval_has_some_properties)
5784 (interval_has_some_properties_list):
5785 * window.c (wset_combination_limit, wset_dedicated)
5786 (wset_display_table, wset_hchild, wset_left_fringe_width)
5787 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5788 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5789 (wset_right_fringe_width, wset_right_margin_cols)
5790 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5791 (wset_vertical_scroll_bar_type, wset_window_parameters):
5792 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5793 (wset_column_number_displayed, wset_region_showing)
5794 (window_box_edges, run_window_scroll_functions)
5795 (append_glyph_string_lists, prepend_glyph_string_lists)
5796 (append_glyph_string, set_glyph_string_background_width)
5797 (append_glyph, append_composite_glyph)
5798 (take_vertical_position_into_account):
5799 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5800 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5801 (lface_hash, lface_same_font_attributes_p, lookup_face):
5802 * xml.c (libxml2_loaded_p):
5803 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5804 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5805 Now 'static', not 'static inline'.
5808 (bidi_copy_it): Do the whole copy with a single memcpy.
5809 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5811 Revert the FOLLOW-SYMLINKS change for file-attributes.
5812 Doing it right would require several changes to Tramp, and there's
5813 not enough time to get that tested before the freeze today.
5814 * dired.c (directory_files_internal, Ffile_attributes):
5817 * frame.c (x_report_frame_params): Port better to wider ints.
5818 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5819 or that pointers can be printed in 15 decimal digits.
5820 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5822 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5824 Support x64 build on MS-Windows.
5825 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5826 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5827 compatibility with x64.
5828 (x_get_focus_frame): Add prototype.
5830 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5831 defining an XRectangle structure.
5833 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5834 arithmetics for compatibility with x64.
5836 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5837 compatibility with x64.
5839 * w32heap.h: Adjust prototypes and declarations.
5841 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5842 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5843 DWORD, long, and unsigned long, for compatibility with x64.
5844 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5845 (sbrk): Argument is now of type ptrdiff_t.
5847 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5849 (w32_msg_pump): Use WPARAM type for 'result'.
5851 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5853 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5854 compatibility with x64.
5856 * vm-limit.c (lim_data): Now size_t.
5857 (check_memory_limits): Adjust prototypes of real_morecore and
5858 __morecore to receive argument of type ptrdiff_t. Use size_t for
5859 five_percent and data_size.
5861 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5862 variables, for compatibility with x64.
5863 (rva_to_section, offset_to_section, relocate_offset)
5864 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5865 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5866 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5867 for compatibility with x64.
5869 * sysdep.c (STDERR_FILENO): Define if not already defined.
5871 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5872 (__morecore): Argument type is now ptrdiff_t.
5873 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5874 (relinquish): Use ptrdiff_t type for 'excess'.
5875 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5877 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5878 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5879 instead of a literal number.
5881 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5882 (min): Define only if not already defined.
5884 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5885 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5888 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5889 'bitmaps' is a pointer.
5891 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5893 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5895 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5897 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5898 * dired.c (directory_files_internal, Ffile_attributes):
5899 New arg follow_symlinks. All uses changed.
5901 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5903 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5905 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5907 Support atimers and CPU profiler via profile.c on MS-Windows.
5908 * w32proc.c (sig_mask, crit_sig): New static variables.
5909 (sys_signal): Support SIGALRM and SIGPROF.
5910 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5911 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5912 sigfillset, and sigprocmask are no longer no-ops.
5913 (sigismember): New function.
5914 (struct itimer_data): New definition.
5915 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5916 (crit_prof): New static variables.
5917 (MAX_SINGLE_SLEEP): New definition.
5918 (timer_loop, stop_timer_thread, term_timers, init_timers)
5919 (start_timer_thread, getitimer, setitimer): New functions.
5920 (alarm): No longer a no-op, calls setitimer.
5922 * w32.c (term_ntproc): Call term_timers.
5923 (init_ntproc): Make sure all signals are unblocked at startup, to
5924 erase any traces of dumping. Call init_timers.
5926 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5927 Windows-specific code to display the hourglass mouse pointer is no
5929 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5930 to hourglass timer expiration.
5931 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5932 Remove, no longer used.
5933 (w32_note_current_window, show_hourglass, hide_hourglass):
5934 New functions, in support of hourglass cursor display similar to other
5936 (syms_of_w32fns): Don't initialize hourglass_timer.
5938 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5940 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5942 * w32.h (init_timers, term_timers): Add prototypes.
5944 2012-09-30 Kenichi Handa <handa@gnu.org>
5946 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5947 to the buffer relocation which may be caused by ccl_driver.
5949 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5951 * xfns.c (Fx_file_dialog): Update comment.
5953 * w32fns.c (Fx_file_dialog): Update comment.
5955 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5956 Initialize panel name field if OSX >= 10.6.
5958 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5960 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5962 * nsterm.m (NEW_STYLE_FS): New define.
5963 (ns_fullscreen_hook, windowWillEnterFullScreen)
5964 (windowDidEnterFullScreen, windowWillExitFullScreen)
5965 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5966 (setFSValue): New functions.
5967 (EmacsFSWindow): New implementation.
5968 (canBecomeKeyWindow): New function for EmacsFSWindow.
5969 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5970 (dealloc): Release nonfs_window if in fullscreen.
5971 (updateFrameSize:): Call windowDidMove to update top/left.
5972 (windowWillResize:toSize:): Check if frame is still maximized.
5973 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5974 next_maximized, maximized_width, maximized_height and nonfs_window.
5975 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5977 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5978 fullscreen. Set maximized_width/height. Act on next_maximized.
5980 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5981 (EmacsView): Add variables for fullscreen.
5982 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5983 (EmacsFSWindow): New interface for fullscreen.
5985 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
5987 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5989 2012-09-30 Chong Yidong <cyd@gnu.org>
5991 * fns.c (Frandom): Doc fix.
5993 2012-09-30 Martin Rudalics <rudalics@gmx.at>
5995 * window.c (Vwindow_combination_limit): New default value.
5996 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5998 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6000 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6001 Suggested by Eli Zaretskii in
6002 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6004 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6006 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6007 HAVE_TIMER_SETTIME is defined.
6009 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6011 Profiler improvements: more-accurate timers, overflow checks.
6012 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6013 signal.h, setjmp.h. Include systime.h instead.
6014 (saturated_add): New function.
6015 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6016 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6017 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6019 (enum profiler_cpu_running): New enum.
6020 (profiler_cpu_running): Now of that enum type, not bool.
6021 All uses changed to store the new value.
6022 (handle_profiler_signal): Rename from sigprof_handler_1,
6023 for consistency with other handlers. Do not check whether
6024 cpu_log is a hash-table if garbage collecting, since it
6025 doesn't matter in that case.
6026 (deliver_profiler_signal): Rename from sigprof_handler,
6027 for consistency with other handlers.
6028 (setup_cpu_timer): New function, with much of what used to be in
6029 Fprofiler_cpu_start. Check for out-of-range argument.
6030 Prefer timer_settime if available, and prefer
6031 thread cputime clocks, then process cputime clocks, then
6032 monotonic clocks, to the old realtime clock. Use make_timeval
6033 to round more-correctly when falling back to setitimer.
6034 (Fprofiler_cpu_start): Use it.
6035 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6036 Don't assume that passing NULL as the 2nd argument of setitimer
6037 is the same as passing a pointer to all-zero storage.
6038 Ignore SIGPROF afterwards.
6039 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6040 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6041 non-fatal signal handlers. Ignore SIGPROF on startup.
6042 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6043 in profiler.c, since sysdep.c now uses it.
6045 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6046 Suggested by Eli Zaretskii in
6047 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6049 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6051 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6053 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6055 * lisp.h (struct backtrace): Remove indirection for `function' field.
6056 * xdisp.c (redisplay_internal):
6057 * profiler.c (record_backtrace, sigprof_handler_1):
6058 * alloc.c (Fgarbage_collect):
6059 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6060 (Fbacktrace_frame): Adjust accordingly.
6062 2012-09-28 Glenn Morris <rgm@gnu.org>
6064 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6065 (Frun_hook_with_args_until_failure): Doc fixes.
6067 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6069 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6070 Qautomatic_redisplay and change the symbol name. All users changed.
6072 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6074 * profiler.c (sigprof_handler): Fix race condition.
6076 2012-09-28 Glenn Morris <rgm@gnu.org>
6078 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6080 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6082 Check more robustly for timer_settime.
6083 * Makefile.in (LIB_TIMER_TIME): New macro.
6085 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6086 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6089 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6091 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6093 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6095 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6097 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6099 * character.h (MAYBE_UNIFY_CHAR): Remove.
6100 * charset.c, charset.h (maybe_unify_char): Now static.
6101 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6102 Since this stuff is now private to charset.c, there's no need for
6103 a public macro and no need to inline by hand.
6105 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6106 Stefan Monnier <monnier@iro.umontreal.ca>
6107 Juanma Barranquero <lekktu@gmail.com>
6109 * profiler.c: New file.
6110 * Makefile.in (base_obj): Add profiler.o.
6111 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6112 ($(BLD)/profiler.$(O)): New target.
6113 * emacs.c (main): Call syms_of_profiler.
6114 * alloc.c (Qautomatic_gc): New constant.
6115 (MALLOC_PROBE): New macro.
6116 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6117 (total_bytes_of_live_objects): New function.
6118 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6119 Call malloc_probe for the memory profiler.
6120 (syms_of_alloc): Define Qautomatic_gc.
6121 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6123 (struct backtrace): Move definition...
6124 * lisp.h (struct backtrace): ..here.
6125 (Qautomatic_gc, profiler_memory_running): Declare vars.
6126 (malloc_probe, syms_of_profiler): Declare functions.
6127 * xdisp.c (Qautomatic_redisplay): New constant.
6128 (redisplay_internal): Record itself in backtrace_list.
6129 (syms_of_xdisp): Define Qautomatic_redisplay.
6131 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6132 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6134 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6136 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6138 Prefer POSIX timers if available.
6139 They avoid a race if the timer is too close to the current time.
6140 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6141 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6142 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6144 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6146 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6147 CHAR_STRING_ADVANCE.
6148 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6149 STRING_CHAR_ADVANCE.
6151 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6153 Move Vlibrary_cache to emacs.c and reset before dumping.
6155 * lisp.h (reset_image_types): Declare.
6156 [WINDOWSNT] (Vlibrary_cache): Declare.
6158 * image.c (reset_image_types): New function.
6160 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6161 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6162 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6164 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6165 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6167 * w32.h (Vlibrary_cache): Do not declare.
6169 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6171 * w32proc.c (sys_signal): Handle all signals defined by the
6172 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6173 handlers for signals supported by Windows. Don't override
6174 term_ntproc as the handler for SIGABRT.
6175 (sigaction): Rewrite to call sys_signal instead of duplicating its
6177 (sys_kill): Improve commentary.
6179 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6180 consistency with a signature of a signal handler. All callers
6182 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6183 install term_ntproc as a signal handler for SIGABRT, as that
6184 should be done by the dumped Emacs.
6186 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6188 * w32select.c (term_w32select): Protect against repeated
6189 invocation by setting clipboard_owner to NULL after calling
6192 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6193 and term_ntproc to their modified signatures.
6195 * character.c (char_string, string_char): Remove calls to
6196 MAYBE_UNIFY_CHAR. See the discussion starting at
6197 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6200 2012-09-25 Chong Yidong <cyd@gnu.org>
6202 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6204 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6206 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6207 when encountering an unknown bytecode.
6209 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6211 image.c, indent.c: Use bool for booleans.
6212 * dispextern.h (struct image_type): Members valid_p, load, init
6213 now return bool, not int. All uses changed.
6214 * image.c: Omit unnecessary static decls.
6215 (x_create_bitmap_mask, x_build_heuristic_mask):
6216 Return void, not int, since callers don't care about the return value.
6217 (x_create_bitmap_mask, define_image_type, valid_image_p)
6218 (struct image_keyword, parse_image_spec, image_spec_value)
6219 (check_image_size, image_background)
6220 (image_background_transparent, x_clear_image_1)
6221 (postprocess_image, lookup_image, x_check_image_size)
6222 (x_create_x_image_and_pixmap, xbm_image_p)
6223 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6224 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6225 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6226 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6227 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6228 (png_image_p, init_png_functions, png_load_body, png_load)
6229 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6230 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6231 (init_gif_functions, gif_load, imagemagick_image_p)
6232 (imagemagick_load_image, imagemagick_load, svg_image_p)
6233 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6235 * nsimage.m (ns_load_image):
6236 * nsterm.m (ns_defined_color):
6237 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6238 * xfns.c (x_defined_color):
6239 * xterm.c (x_alloc_lighter_color_for_widget)
6240 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6241 (x_alloc_lighter_color):
6242 * indent.c (disptab_matches_widthtab, current_column)
6243 (scan_for_column, string_display_width, indented_beyond_p)
6244 (compute_motion, vmotion, Fvertical_motion):
6245 Use bool for booleans.
6247 2012-09-24 Chong Yidong <cyd@gnu.org>
6249 * chartab.c (Fset_char_table_default): Obsolete function removed.
6251 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6253 Move pid_t related decls out of lisp.h.
6254 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6255 (interruptible_wait_for_termination):
6256 Move these decls from lisp.h to syswait.h, since they use pid_t.
6257 Needed on FreeBSD; see Herbert J. Skuhra in
6258 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6259 * callproc.c: Include syswait.h.
6261 gnutls.c, gtkutil.c: Use bool for boolean.
6262 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6263 (emacs_gnutls_handle_error):
6264 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6265 (xg_hide_tooltip, xg_create_frame_widgets)
6266 (create_dialog, xg_uses_old_file_dialog)
6267 (xg_get_file_with_chooser, xg_get_file_with_selection)
6268 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6269 (xg_item_label_same_p, xg_update_menubar)
6270 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6271 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6272 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6273 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6274 (update_frame_tool_bar, free_frame_tool_bar):
6275 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6276 * nsmenu.m (ns_update_menubar):
6277 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6278 * xfns.c (Fx_show_tip) [USE_GTK]:
6279 Use bool for boolean.
6280 * gtkutil.c (xg_update_frame_menubar):
6281 * xmenu.c (update_frame_menubar):
6282 Return void, not int, since caller ignores return value.
6283 * gtkutil.c (xg_change_toolbar_position):
6286 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6288 * makefile.w32-in (BLOCKINPUT_H): Remove.
6289 (SYSSIGNAL_H): New macro.
6290 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6291 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6292 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6293 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6294 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6295 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6296 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6297 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6298 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6299 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6300 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6301 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6302 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6303 ($(BLD)/w32xfns.$(O)): Update dependencies.
6305 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6307 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6308 fatal_error_backtrace.
6310 * w32proc.c (sys_kill): Undo last change: don't do anything when
6311 invoked to deliver SIGABRT to our own process. This is now
6312 handled by emacs_raise.
6314 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6316 * w32term.c (w32_read_socket): Remove leftover reference to
6317 interrupt_input_pending.
6319 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6321 Do not use SA_NODEFER.
6322 Problem reported by Dani Moncayo in
6323 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6325 * sysdep.c (emacs_abort): Do not reset signal handler.
6326 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6327 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6328 wanted even on POSIXish hosts, and it doesn't work on Windows.
6330 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6332 * xterm.c (x_term_init): Call fixup_locale before and after calling
6333 gtk_init (Bug#12392).
6335 2012-09-23 Chong Yidong <cyd@gnu.org>
6337 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6338 Vdynamic_library_alist.
6340 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6341 (Fgnutls_available_p): Caller changed.
6343 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6344 (Flibxml_parse_xml_region): Likewise.
6346 * dispextern.h (struct image_type): Remove arg from init function.
6348 * image.c (Finit_image_library, lookup_image_type)
6349 (define_image_type): Remove now-unneeded second arg.
6350 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6351 (init_tiff_functions, init_gif_functions, init_svg_functions):
6352 Arglist and w32_delayed_load calling convention changed.
6353 (gs_type): Remove init_gs_functions; there is no such function.
6354 (valid_image_p, make_image): Fix caller to lookup_image_type.
6356 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6358 Simplify and avoid signal-handling races (Bug#12471).
6360 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6361 Avoid recursive loop if there's a fatal error in the function itself.
6362 * atimer.c (pending_atimers):
6363 * blockinput.h: Don't include "atimer.h"; no longer needed.
6364 (interrupt_input_pending): Remove. All uses removed.
6365 pending_signals now counts both atimers and ordinary interrupts.
6366 This is less racy than having three separate pending-signal flags.
6367 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6369 Rename from their upper-case counterparts BLOCK_INPUT,
6370 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6371 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6372 This makes it easier to access volatile variables more accurately.
6373 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6374 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6375 that's more reliable if the code is buggy and sets
6376 interrupt_input_blocked to a negative value. All uses changed.
6377 * atimer.c (deliver_alarm_signal):
6378 Remove. No need to deliver this to the parent; any thread can
6379 handle this signal now. All uses replaced by underlying handler.
6380 * atimer.c (turn_on_atimers):
6381 * dispnew.c (handle_window_change_signal):
6382 * emacs.c (handle_danger_signal):
6383 * keyboard.c (kbd_buffer_get_event):
6384 Don't reestablish signal handler; not needed with sigaction.
6385 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6387 Rework to avoid unnecessary accesses to volatile variables.
6388 (UNBLOCK_INPUT_TO): Now a function.
6389 (totally_unblock_input, unblock_input): New decls.
6390 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6391 (init_data): Remove. Necessary stuff now done in init_signal.
6392 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6393 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6394 (fatal_error_code): Remove; no longer needed.
6395 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6396 it doesn't always backtrace. All uses changed. No need to reset
6397 signal to default, since sigaction and/or die does that for us now.
6398 Use emacs_raise (FOO), not kill (getpid (), FOO).
6399 (main): Check more-accurately whether we're dumping.
6400 Move fatal-error setup to sysdep.c
6401 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6402 * gtkutil.c (xg_get_file_name, xg_get_font):
6403 Remove no-longer-needed signal-mask manipulation.
6404 * keyboard.c, process.c (POLL_FOR_INPUT):
6405 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6406 * keyboard.c (read_avail_input): Remove.
6407 All uses replaced by gobble_input.
6408 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6409 (kbd_buffer_store_event_hold, gobble_input):
6410 (record_asynch_buffer_change) [USABLE_SIGIO]:
6411 (store_user_signal_events):
6412 No need to mess with signal mask.
6413 (gobble_input): If blocking input and there are terminals, simply
6414 set pending_signals to 1 and return. All hooks changed to not
6415 worry about whether input is blocked.
6416 (process_pending_signals): Clear pending_signals before processing
6417 them, in case a signal comes in while we're processing.
6418 By convention callers now test pending_signals before calling us.
6419 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6420 New functions, to support changes to blockinput.h.
6421 (handle_input_available_signal): Now extern.
6422 (reinvoke_input_signal): Remove. All uses replaced by
6424 (quit_count): Now volatile, since a signal handler uses it.
6425 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6426 All callers changed. Block SIGINT only if not already blocked.
6427 Clear sigmask reliably, even if Fsignal returns, which it can.
6428 Omit unnecessary accesses to volatile var.
6429 (quit_throw_to_read_char): No need to restore sigmask.
6430 * keyboard.c (gobble_input, handle_user_signal):
6431 * process.c (wait_reading_process_output):
6432 Call signal-handling code rather than killing ourselves.
6433 * lisp.h: Include <float.h>, for...
6434 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6435 (pending_signals): Now volatile.
6436 (syms_of_data): Now const if IEEE floating point.
6437 (handle_input_available_signal) [USABLE_SIGIO]:
6438 (terminate_due_to_signal, record_child_status_change): New decls.
6439 * process.c (create_process): Avoid disaster if memory is exhausted
6440 while we're processing a vfork, by tightening the critical section
6442 (send_process_frame, process_sent_to, handle_pipe_signal)
6443 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6445 (send_process): No need for setjmp/longjmp any more, since the
6446 SIGPIPE stuff is now gone. Instead, report an error if errno
6448 (record_child_status_change): Now extern. PID and W are now args.
6449 Return void, not bool. All callers changed.
6450 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6451 Remove. All uses removed. This bug should be fixed now in a
6453 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6454 and record the child status change directly. This avoids the
6455 need to futz with the signal mask.
6456 (process_fatal_action): Move here from emacs.c.
6457 (emacs_sigaction_flags): New function, containing
6458 much of what used to be in emacs_sigaction_init.
6459 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6460 caught by emacs, to make races less likely.
6461 (deliver_process_signal): Rename from handle_on_main_thread.
6463 (BACKTRACE_LIMIT_MAX): Now at top level.
6464 (thread_backtrace_buffer, threadback_backtrace_pointers):
6466 (deliver_thread_signal, deliver_fatal_thread_signal):
6467 New functions, for more-accurate delivery of thread-specific signals.
6468 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6469 (deliver_arith_signal): Handle in this thread, not
6470 in the main thread, since it's triggered by this thread.
6471 (maybe_fatal_sig): New function.
6472 (init_signals): New arg DUMPING so that we can be more accurate
6473 about whether we're dumping. Caller changed.
6474 Treat thread-specific signals differently from process-general signals.
6475 Block all signals while handling fatal error; that's safer.
6476 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6478 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6479 Ignore SIGPIPE unless batch.
6480 (emacs_backtrace): Output backtrace for the appropriate thread,
6481 which is not necessarily the main thread.
6482 * syssignal.h: Include <stdbool.h>.
6483 (emacs_raise): New macro.
6484 * xterm.c (x_connection_signal): Remove; no longer needed
6485 now that we use sigaction.
6486 (x_connection_closed): No need to mess with sigmask now.
6487 (x_initialize): No need to reset SIGPIPE handler here, since
6488 init_signals does this for us now.
6490 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6492 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6493 background rect may be larger (Bug#12245).
6495 2012-09-23 Chong Yidong <cyd@gnu.org>
6497 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6499 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6501 * .gdbinit: Just stop at fatal_error_backtrace.
6502 See Stefan Monnier's request in
6503 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6504 Remove no-longer-used query of system type.
6506 2012-09-22 Chong Yidong <cyd@gnu.org>
6508 * search.c (Freplace_match): Doc fix (Bug#12325).
6510 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6512 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6513 (Fline_end_position): Doc fix.
6515 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6517 2012-09-22 Chong Yidong <cyd@gnu.org>
6519 * dispextern.h (struct image_type): Add new slot, storing a type
6520 initialization function.
6522 * image.c (define_image_type): Call the image initializer function
6523 if it is defined. Arguments and return value changed.
6524 (valid_image_p, make_image): Callers changed.
6525 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6526 (gif_type, imagemagick_type, svg_type, gs_type):
6527 Add initialization functions.
6528 (Finit_image_library): Call lookup_image_type.
6529 (CHECK_LIB_AVAILABLE): Macro deleted.
6530 (lookup_image_type): Call define_image_type here, rather than via
6531 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6532 (syms_of_image): Move define_image_type calls for xbm_type and
6533 pbm_type to lookup_image_type.
6535 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6537 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6538 'idle_timers' from here ...
6539 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6540 lists, to avoid infloops when the timer does something stupid,
6541 like reinvoke itself with the same or smaller time-out.
6544 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6546 * window.c (Fsplit_window_internal): Handle only Qt value of
6547 Vwindow_combination_limit separately.
6548 (Qtemp_buffer_resize): New symbol.
6549 (Vwindow_combination_limit): New default value.
6552 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6554 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6555 the new overlay string. (Bug#10159)
6557 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6559 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6560 or that fprintf is async-signal-safe. POSIX doesn't require
6563 2012-09-22 Chong Yidong <cyd@gnu.org>
6565 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6568 2012-09-22 Kenichi Handa <handa@gnu.org>
6570 * composite.c (composition_reseat_it): Handle the case that a
6571 grapheme cluster is not covered by a single font (Bug#12352).
6573 2012-09-21 Chong Yidong <cyd@gnu.org>
6575 * image.c (define_image_type): Avoid adding duplicate types to
6576 image_types (Bug#12463). Suggested by Jörg Walter.
6578 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6580 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6581 (print_load_command_name): Add case LC_DATA_IN_CODE.
6582 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6584 2012-09-21 Glenn Morris <rgm@gnu.org>
6586 * eval.c (Frun_hook_with_args_until_success)
6587 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6589 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6591 * fileio.c (Ffile_selinux_context): Only call freecon when
6592 lgetfilecon succeeded.
6593 (Fset_file_selinux_context): Likewise. (Bug#12444)
6595 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6597 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6598 reordering, locate the cursor by calling set_cursor_from_row; if
6599 that fails, clear the desired glyph matrix before returning a
6600 failure indication to the caller. Fixes leaving garbled display
6601 when fast scrolling with a down-key. (Bug#12403)
6602 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6603 scrolling through multibyte text.
6605 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6607 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6608 calling mark_vectorlike since that's the one that marks the window.
6609 (mark_discard_killed_buffers): Mark the final cdr.
6610 * window.h (struct window): Move prev/next_buffers to the
6611 non-standard fields.
6612 * window.c (make_window): Initialize prev/next_buffers manually.
6614 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6616 Omit unused arg EXPECTED from socket hooks.
6617 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6618 * nsterm.m (ns_term_init):
6619 * termhooks.h (struct terminal.read_socket_hook):
6620 * w32inevt.c (w32_console_read_socket):
6621 * w32term.c (w32_read_socket):
6622 * xterm.c (XTread_socket):
6623 Omit unused arg EXPECTED. All callers changed.
6624 (store_user_signal_events): Return void, not int, since callers no
6625 longer care about the return value. All uses changed.
6627 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6629 * w32gui.h (XParseGeometry): Do not declare.
6631 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6633 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6634 Ignore 'expected'. See Eli Zaretskii in
6635 <http://bugs.gnu.org/12471#8> (last line).
6637 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6638 (XParseGeometry): Now static. Substitute extremal values for
6639 values that are out of range.
6641 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6643 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6645 * nsfns.m (XParseGeometry): Remove.
6646 (Fx_create_frame): Call x_set_offset to correctly interpret
6647 top_pos in geometry.
6649 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6650 (Fx_parse_geometry): If there is a space in string, call
6651 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6653 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6655 * search.c (scan_buffer): Use character positions in calls to
6656 region_cache_forward and region_cache_backward, not byte
6657 positions. (Bug#12196)
6659 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6660 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6662 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6663 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6664 emacs_blocked_malloc, now deleted.
6666 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6668 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6669 The workaround was for improving performance on Solaris 2.4, but
6670 is getting in the way now. Emacs will still work if someone is
6671 still running Solaris 2.4 in a museum somewhere; Sun dropped
6672 support for Solaris 2.4 in 2003.
6673 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6674 * process.c (create_process) [HAVE_WORKING_VFORK]:
6675 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6676 since Emacs no longer uses vfork on that platform.
6678 2012-09-17 Glenn Morris <rgm@gnu.org>
6680 * emacs.c: Use COPYRIGHT.
6682 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6684 Remove configure's --without-sync-input option (Bug#12450).
6685 When auditing signal-handling in preparation for cleaning it up,
6686 I found that SYNC_INPUT has race conditions and would be a real
6687 pain to fix. Since it's an undocumented and deprecated
6688 configure-time option, now seems like a good time to remove it.
6689 Also see <http://bugs.gnu.org/11080#16>.
6690 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6691 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6692 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6693 (malloc_hysteresis):
6694 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6695 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6696 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6697 (dont_register_blocks, bytes_used_when_reconsidered)
6698 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6699 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6700 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6701 Remove. All uses removed.
6702 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6703 implementation, one that depends on whether the new macro
6704 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6706 * atimer.c (run_timers, handle_alarm_signal):
6707 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6708 (handle_async_input, process_pending_signals)
6709 (handle_input_available_signal, init_keyboard):
6710 * nsterm.m (ns_read_socket):
6711 * process.c (wait_reading_process_output):
6712 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6713 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6715 * xterm.c (XTread_socket):
6717 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6718 * eval.c (handling_signal): Remove. All uses removed.
6719 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6720 All uses replaced with the SYNC_INPUT version.
6721 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6723 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6726 * font.c (Ffont_shape_gstring): Remove unused local.
6728 2012-09-16 Glenn Morris <rgm@gnu.org>
6730 * Makefile.in (clean): No longer run nextstep's clean.
6732 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6734 (ns-app): Move here from ns.mk, and simplify.
6735 (clean): Simplify nextstep entry.
6736 * ns.mk: Remove file.
6738 2012-09-17 Kenichi Handa <handa@gnu.org>
6740 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6741 not covert the last few charactes.
6743 2012-09-16 Kenichi Handa <handa@gnu.org>
6745 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6746 here, but just check the validity of glyphs in the glyph-string.
6748 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6750 * window.c (Fwindow_parameter, Fset_window_parameter):
6751 Accept any window as argument (Bug#12452).
6753 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6755 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6756 to ns_term_init to avoid memory leak.
6758 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6759 explicit retain/release.
6760 (ns_term_init): Only allow one display. Initialize outerpool and
6763 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6765 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6766 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6767 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6768 the Microsoft problem in a different way, by altering ../nt/config.nt.
6770 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6785 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6786 by lisp.h. This completes removal of setjmp.h inclusion
6787 erroneously announced in the previous commit. (Bug#12446)
6789 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6792 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6793 not defined as a macro. The latter happens on MS-Windows.
6796 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6798 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6799 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6800 Some instances of '#include <setjmp.h>' removed, if the
6801 only reason for the instance was because "lisp.h" was included.
6802 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6803 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6804 and _longjmp with the new symbols. Emacs already uses _setjmp if
6805 available, so this change affects only POSIXish hosts that have
6806 sigsetjmp but not _setjmp, such as some versions of Solaris and
6807 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6808 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6809 (png_load_body) [HAVE_PNG]:
6810 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6811 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6812 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6813 since PNG requires jmp_buf. This is the only exception to the
6814 general rule that we now use sys_setjmp and sys_longjmp.
6815 This exception is OK since this code does not change the signal
6816 mask or longjmp out of a signal handler.
6818 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6820 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6821 Include "syssignal.h", for 'main_thread'.
6823 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6825 Avoid out-of-range marker position (Bug#12426).
6826 * insdel.c (replace_range, replace_range_2):
6827 Adjust markers before overlays, as suggested by comments.
6828 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6829 Remove redundant check before calling offset_intervals.
6831 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6833 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6834 current buffer (Bug#12387).
6836 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6838 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6840 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6842 Use a more backwards-compatible timer format (Bug#12430).
6843 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6844 vector element, not from the 4th, since PSECS is now at the end.
6845 (Fcurrent_idle_time): Doc fix.
6847 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6849 Function to mark objects and remove killed buffers at once.
6850 * alloc.c (discard_killed_buffers): Rename to ...
6851 (mark_discard_killed buffers) ... new name. Add marking
6852 of remaining objects. Fix comment. Adjust users.
6853 (mark_object): Do not touch frame buffer lists here.
6854 * frame.c (delete_frame): Reset frame buffer lists here.
6856 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6858 Better workaround for GNOME bug when --enable-gcc-warnings.
6859 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6860 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6861 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6863 Simplify SIGIO usage (Bug#12408).
6864 The code that dealt with SIGIO was crufty and confusing, e.g., it
6865 played tricks like "#undef SIGIO" but these tricks were not used
6866 consistently. Simplify mostly by not #undeffing standard symbols,
6867 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6868 or not as we please) rather than "defined SIGIO" (standard symbol
6869 that we probably shouldn't #undef).
6870 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6871 Modules that need it can include it.
6872 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6873 * dispextern.h (ignore_sigio): New decl.
6874 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6875 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6876 * emacs.c (shut_down_emacs):
6877 * keyboard.c (kbd_buffer_store_event_hold):
6878 Use ignore_sigio rather than invoking 'signal' directly.
6879 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6881 (FIONREAD, SIGIO): Do not #undef.
6882 (tty_read_avail_input): Use #error rather than a syntax error.
6883 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6884 for I_PIPE, used by SETUP_SLAVE_PTY.
6885 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6886 * sysdep.c (croak): Remove; no longer needed. This bit of
6887 temporary code, with Fred N. Fish's comment that it's temporary,
6888 has been in Emacs since at least 1992!
6889 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6890 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6891 * syssignal.h (croak): Remove decl.
6892 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6893 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6894 now that we're termios-only.
6895 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6896 * term.c (dissociate_if_controlling_tty): Use #error rather than
6899 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6900 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6901 to work around GNOME bug 683906.
6902 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6903 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6904 This works around GCC bug 54561.
6906 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6908 More fixes for 'volatile' and setjmp/longjmp.
6909 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6910 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6911 (png_load_body) [HAVE_PNG]:
6912 (jpeg_load_body) [HAVE_JPEG]:
6913 New function, with most of the old parent function's body.
6914 (png_load) [HAVE_PNG]:
6915 (jpeg_load) [HAVE_JPEG]:
6916 Invoke the new function, to avoid longjmp munging our locals.
6917 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6918 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6919 longjmp is passed 2, as the C standard doesn't guarantee this.
6920 Instead, store the failure code into mgr->failure_code.
6922 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6924 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6925 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6926 (syms_of_keyboard): Remove support for unread-command-char.
6928 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6930 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6931 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6932 violation. (Bug#12426)
6934 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6936 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6938 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6940 * eval.c: Add `inhibit-debugger'.
6941 (Qinhibit_debugger): New symbol.
6942 (call_debugger): Bind it instead of Qdebug_on_error.
6943 (maybe_call_debugger): Test Vinhibit_debugger.
6944 (syms_of_eval): Define inhibit-debugger.
6945 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6946 (syms_of_xdisp): Remove inhibit-debug-on-message.
6948 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6950 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6951 If a nonvolatile local variable is written before a _longjmp to
6952 the frame containing the variable, and is read after the _longjmp,
6953 the value read is indeterminate. Some local variables of type
6954 'struct handler' and 'struct catchtag' are used in this way, so
6955 mark each of their slots as volatile if the slot can be set before
6956 _longjmp and read afterwards.
6957 * lisp.h (struct handler): var and chosen_clause are now volatile.
6958 (struct catchtag): val, next, and pdlcount are now volatile.
6960 * bidi.c (bidi_push_it, bidi_pop_it):
6961 * fns.c (copy_hash_table):
6962 * image.c (define_image_type):
6963 * keyboard.c (kbd_buffer_store_event_hold):
6964 * process.c (Fprocess_send_eof):
6965 * xfaces.c (x_create_gc) [HAVE_NS]:
6966 * xgselect.c (xg_select):
6967 Prefer assignment to memcpy when either will do.
6969 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6970 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6971 time an item is removed. No need to mark this function 'inline';
6972 the compiler knows better than we do.
6974 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6976 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6977 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6978 to change_frame_size (Bug#12388).
6979 (windowDidResize:): Pass YES to updateFrameSize.
6981 * nsterm.h: Add delay parameter to updateFrameSize.
6983 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6985 Discard killed buffers from deleted window and frame objects.
6986 This reduces an amount of references to killed buffers and
6987 helps GC to reclaim them faster.
6988 * alloc.c (discard_killed_buffers): New function.
6989 (mark_object): Use it for deleted windows and frames.
6990 (mark_object): If symbol's value is set up for a killed buffer
6991 or deleted frame, restore its global binding.
6992 * data.c (swap_in_global_binding): Add GC notice.
6993 (swap_in_symval_forwarding): Use convenient set_blv_where.
6994 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6995 * window.h: ... to here.
6997 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6999 Convenient macro to check whether the buffer is live.
7000 * buffer.h (BUFFER_LIVE_P): New macro.
7001 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7002 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7004 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7006 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7007 composition cases (Bug#12364).
7009 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7010 overhang of succeeding glyphs overlapping box cursor.
7012 * w32term.c (x_draw_glyph_string): Likewise.
7014 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7016 Simplify, document, and port floating-point (Bug#12381).
7017 The porting part of this patch fixes bugs on non-IEEE platforms
7018 with frexp, ldexp, logb.
7019 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7021 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7022 support, by removing commented-out code and briefly listing the
7023 C89 functions excluded. The commented-out stuff was confusing
7024 maintenance, e.g., we thought we needed cbrt but it was commented out.
7025 (logb): Remove decl; no longer needed.
7026 (isfinite): New macro, if not already supplied.
7027 (isnan): Don't replace any existing macro.
7028 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7029 are present on all C89 platforms.
7030 (Ffrexp): Do not special-case zero, as frexp does the right thing
7032 (Flogb): Do not use logb, as it doesn't have the desired meaning
7033 on hosts that use non-base-2 floating point. Instead, stick with
7034 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7035 frexp, to avoid getting an unspecified result.
7037 * xdisp.c (Qinhibit_debug_on_message): Now static.
7039 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7041 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7042 NSBezierPath (Bug#12131).
7044 2012-09-10 Chong Yidong <cyd@gnu.org>
7046 * fns.c (Fdelq, Fdelete): Doc fix.
7048 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7050 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7051 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7053 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7055 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7056 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7059 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7061 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7062 left fringe if the window has a left margin. This avoids leaving
7063 traces of the cursor because its leftmost pixel is not drawn over.
7065 * dispnew.c (update_window_line): When the left margin area of a
7066 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7067 that screen line. (Bug#12277)
7069 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7071 Assume C89 or later for math functions (Bug#12381).
7072 This simplifies the code, and makes it a bit smaller and faster,
7073 and (most important) makes it easier to clean up signal handling
7074 since we can stop worring about floating-point exceptions in
7075 library code. That was a problem before C89, but the problem
7076 went away many years ago on all practical Emacs targets.
7077 * data.c, image.c, lread.c, print.c:
7078 Don't include <math.h>; no longer needed.
7079 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7080 might be autoconfigured, as that never happens.
7082 * doprnt.c (DBL_MAX_10_EXP):
7083 * print.c (DBL_DIG):
7084 Remove. C89 or later always defines these.
7085 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7086 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7087 (arith_error, domain_error, domain_error2):
7088 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7089 no longer needed -- we simply return what C returns. All uses removed.
7090 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7092 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7093 Remove. All uses expanded, as these macros are no longer used
7094 more than once and are now more trouble than they're worth.
7095 (Ftan): Use tan, not sin / cos.
7096 (Flogb): Assume C89 frexp.
7097 (fmod_float): Assume C89 fmod.
7098 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7099 (init_floatfns): Remove. All uses removed.
7101 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7103 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7104 compositeToPoint for OSX < 10.6 (Bug#12390).
7106 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7108 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7109 This produces more-accurate results.
7111 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7113 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7114 changes (Bug#12088).
7116 2012-09-08 Chong Yidong <cyd@gnu.org>
7118 * syntax.c (Fstring_to_syntax): Doc fix.
7120 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7122 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7123 in the internal border.
7124 (x_set_window_size): Remove static variables and their usage.
7125 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7126 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7127 Remove fringe/internal border adjustment (Bug#11052).
7128 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7129 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7130 (ns_fix_rect_ibw): Remove.
7131 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7132 (ns_dumpglyphs_box_or_relief): Ditto.
7133 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7135 (ns_dumpglyphs_image): Ditto.
7136 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7138 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7139 their usage. Add fringe_extended_p and its use as in other terms.
7140 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7141 scroll bar was removed.
7142 (updateFrameSize): New function.
7143 (windowDidResize): Move code to updateFrameSize and call it.
7145 * nsterm.h (EmacsView): Add updateFrameSize.
7147 2012-09-07 Chong Yidong <cyd@gnu.org>
7149 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7151 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7153 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7155 More signal-handler cleanup (Bug#12327).
7156 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7157 Problem introduced when merging patches. Noted by Eli Zaretskii in
7158 <http://bugs.gnu.org/12327#67>.
7159 * floatfns.c: Comment fix.
7160 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7161 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7162 and anyway the declaration is harmless even if SIGDANGER is not defined.
7163 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7164 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7165 source files not surprisingly expected syssignal.h to define, or
7166 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7167 Include <sys/ioctl.h>, for FIONREAD.
7168 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7169 This eliminates a problem whereby other files mysteriously had
7170 to include "syssignal.h" before including "systty.h" if they
7171 wanted to use "#ifdef SIGIO".
7173 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7175 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7177 * w32.c (sigemptyset): Empty the set.
7178 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7180 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7182 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7184 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7185 (mark_object): Likewise for frame objects.
7187 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7189 * syssignal.h (handle_on_main_thread): Always declare,
7190 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7191 This ports to platforms without HAVE_PTHREAD.
7193 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7195 Signal-handler cleanup (Bug#12327).
7196 Emacs's signal handlers were written in the old 4.2BSD style with
7197 sigblock and sigmask and so forth, and this led to some
7198 inefficiencies and confusion. Rewrite these to use
7199 pthread_sigmask etc. without copying signal sets around. Also,
7200 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7201 'signal', and instead use functions that do not attempt to take
7202 over the system name space. This patch causes Emacs's text
7203 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7204 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7205 Do not include <signal.h> or "syssignal.h", as these
7206 modules do not use signals.
7207 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7208 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7209 Do not include <signal.h>, as "syssignal.h" does that for us now.
7210 * atimer.c (sigmask_atimers): New function.
7211 (block_atimers, unblock_atimers): New functions,
7212 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7214 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7215 no longer needed here.
7216 * emacs.c (main): Inspect existing signal handler with sigaction,
7217 so that there's no need to block and unblock SIGHUP.
7218 * sysdep.c (struct save_signal): New member 'action', replacing
7219 old member 'handler'.
7220 (save_signal_handlers, restore_signal_handlers):
7221 Use sigaction instead of 'signal' to save and restore.
7222 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7223 New function. All users of 'signal' modified to use set_sighandler
7224 if they're writeonly, and to use sys_signal if they're read+write.
7225 (emacs_sigaction_init, forwarded_signal): New functions.
7226 (sys_signal): Remove. All uses replaced by calls to sigaction
7227 and emacs_sigaction_init, or by direct calls to 'signal'.
7228 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7229 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7230 all uses replaced by pthread_sigmask etc. calls.
7231 * syssignal.h: Include <signal.h>.
7232 (emacs_sigaction_init, forwarded_signal): New decls.
7233 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7234 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7235 (sigmask, sys_sigmask): Remove; no longer needed.
7236 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7237 (sigblock, sigunblock, sigfree):
7238 (sigsetmask) [!defined sigsetmask]:
7239 Remove. All uses replaced by pthread_sigmask.
7240 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7241 no longer need to be replaced, and its typical old uses
7242 are now done via emacs_sigaction_init and sigaction.
7243 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7244 (sys_sigdel): Remove; unused.
7245 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7247 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7249 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7250 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7252 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7254 Explicitly mark buffer_defaults and buffer_local_symbols.
7255 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7256 mark_local_symbols here.
7257 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7258 since special buffers aren't marked here any more.
7259 (allocate_buffer): Chain new buffer with all_buffers here...
7260 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7262 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7263 (syms_of_buffer): Remove staticpro of the above.
7264 (init_buffer_once): Set names for buffer_defaults and
7265 buffer_local_symbols.
7267 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7269 Use bool for booleans in font-related modules.
7270 * font.c (font_intern_prop, font_style_to_value)
7271 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7272 (generate_otf_features, font_check_otf_features, font_check_otf)
7273 (font_match_p, font_list_entities, font_at):
7274 * fontset.c (fontset_id_valid_p, reorder_font_vector
7275 (fontset_find_font, Fset_fontset_font)
7276 (face_suitable_for_char_p) [0]:
7277 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7278 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7279 (m17n_flt_initialized, ftfont_shape_by_flt):
7280 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7281 * nsfont.m (nsfont_draw):
7282 * w32font.c (w32font_draw):
7283 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7284 Use bool for booleans.
7285 * font.h: Adjust to above API changes.
7286 (struct font, struct font_driver, struct font_driver_list):
7287 Use bool for booleans.
7288 (struct font): Remove useless member encoding_type.
7290 * fontset.c, xftfont.c: Omit unnecessary static decls.
7292 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7294 * alloc.c (mark_object): Revert window marking code
7295 since it's unsafe for the Fset_window_configuration.
7297 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7299 Fix race conditions with signal handlers and errno (Bug#12327).
7300 Be more systematic about preserving errno whenever a signal
7301 handler returns, even if it's not in the main thread. Do this by
7302 renaming signal handlers to distinguish between signal delivery
7303 and signal handling. All uses changed.
7304 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7305 * data.c (deliver_arith_signal): Rename from arith_error.
7306 * dispnew.c (deliver_window_change_signal): Rename from
7307 window_change_signal.
7308 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7309 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7310 * keyboard.c (deliver_input_available_signal): Rename from
7311 input_available_signal.
7312 (deliver_user_signal): Rename from handle_user_signal.
7313 (deliver_interrupt_signal): Rename from interrupt_signal.
7314 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7315 (deliver_child_signal): Rename from sigchld_handler.
7316 * atimer.c (handle_alarm_signal):
7317 * data.c (handle_arith_signal):
7318 * dispnew.c (handle_window_change_signal):
7319 * emacs.c (handle_fatal_signal, handle_danger_signal):
7320 * keyboard.c (handle_input_available_signal):
7321 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7322 * process.c (handle_pipe_signal, handle_child_signal):
7323 New functions, with the actual signal-handling code taken from the
7324 original respective signal handlers, sans the sporadic attempts to
7325 preserve errno, since that's now done by handle_on_main_thread.
7326 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7327 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7328 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7330 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7331 Move initialization of main_thread to sysdep.c's init_signals.
7332 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7333 our usage, and simplifies the mainline code.
7334 (record_child_status_change): New static function, as a helper
7335 for handle_child_signal, and with most of the old child handler's
7337 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7338 (handle_child_signal): Use the above.
7339 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7340 Moved here from emacs.c.
7341 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7342 code moved here from emacs.c's main function.
7343 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7344 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7345 This lets callers save and restore errno properly.
7347 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7349 Remove redundant or unused things here and there.
7350 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7351 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7352 * editfns.c (Fcompare_buffer_substrings): Likewise.
7353 * frame.h (struct terminal, struct font_driver_list):
7354 Remove redundant declarations.
7355 * window.h (Qleft, Qright): Likewise.
7357 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7359 Do not mark objects from deleted buffers, windows and frames.
7360 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7361 (mark_object): Likewise for windows and frames.
7363 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7365 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7366 buffer_defaults and buffer_local_symbols as valid objects.
7367 Return special value to denote them.
7369 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7371 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7372 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7373 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7374 (file_name_absolute_p, Fsubstitute_in_file_name):
7375 (check_executable, check_writable, Ffile_accessible_directory_p)
7376 (Fset_file_selinux_context, Fdefault_file_modes)
7377 (Finsert_file_contents, choose_write_coding_system)
7378 (Fwrite_region, build_annotations, a_write, e_write)
7380 * filelock.c (boot_time_initialized, get_boot_time)
7381 (get_boot_time_1, lock_file_1, within_one_second):
7382 * floatfns.c (in_float):
7383 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7384 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7385 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7386 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7387 * window.c (compare_window_configurations):
7388 Use bool for booleans.
7389 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7390 (Fdefault_file_modes): Now mode_t, not int, for modes.
7391 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7392 (internal_delete_file): Now returns void, not a (boolean) int,
7393 since nobody was looking at the return value.
7394 * lisp.h, window.h: Adjust to above API changes.
7396 * xdisp.c (set_message): Simplify and reindent last change.
7398 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7400 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7402 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7404 * eval.c (call_debugger): Make the function non-static so that we
7405 can call it from set_message.
7407 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7408 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7410 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7412 Give more-useful info on a fatal error (Bug#12328).
7413 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7414 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7415 of doing the work ourselves.
7416 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7417 do most of the work.
7418 (fatal_error_backtrace): New function, taken from the guts
7419 of the old fatal_error_signal, but with a new option to output
7421 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7422 info about the signal than just its number.
7423 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7424 * sysdep.c: Include <execinfo.h>
7425 (emacs_backtrace): New function, taken partly from the previous
7426 code of the 'die' function.
7427 (emacs_abort): Call fatal_error_backtrace rather than abort.
7429 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7431 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7432 eager (load-time) macro-expansion.
7433 * lisp.mk (lisp): Add macroexp.
7435 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7437 Simplify redefinition of 'abort' (Bug#12316).
7438 Do not try to redefine the 'abort' function. Instead, redo
7439 the code so that it calls 'emacs_abort' rather than 'abort'.
7440 This removes the need for the NO_ABORT configure-time macro
7441 and makes it easier to change the abort code to do a backtrace.
7442 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7443 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7444 Remove; sysdep.c's emacs_abort now takes its place.
7445 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7446 'abort' changed to use 'emacs_abort'.
7447 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7448 (abort) [!defined abort]: Rename to ...
7449 (emacs_abort): ... new name.
7450 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7451 the place of the old 'abort' in emacs.c.
7452 * w32.c, w32fns.c (abort): Do not #undef.
7453 * w32.c (emacs_abort): Rename from w32_abort.
7455 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7457 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7458 offsets[j].dv, since the y axis of the screen coordinates points
7459 down, while the y axis of the font definition coordinates points
7460 up. This fixes display of Arabic diacritics such as KASRA and
7461 KASRATAN. (Bug#11860)
7463 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7465 Be more systematic about _setjmp vs setjmp.
7466 * alloc.c (test_setjmp, mark_stack):
7467 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7468 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7469 (png_load, my_error_exit, jpeg_load):
7470 * process.c (send_process_trap, send_process):
7471 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7472 The underscored versions are up to 30x faster on some hosts.
7473 Formerly, the code used setjmp+longjmp sometimes and
7474 _setjmp+_longjmp at other times, with no particular reason to
7475 prefer setjmp+longjmp.
7477 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7479 Fix minor problem found by static checking.
7480 * buffer.c (Fdelete_all_overlays): Return nil.
7482 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7484 * buffer.c (Fdelete_all_overlays): New function.
7486 2012-09-03 Chong Yidong <cyd@gnu.org>
7488 * gtkutil.c: Add extern decl for Qxft.
7490 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7492 * emacs.c, eval.c: Use bool for boolean.
7493 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7494 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7495 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7496 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7497 (main, decode_env_path, Fdaemon_initialized):
7498 * eval.c (call_debugger, Finteractive_p, interactive_p):
7499 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7500 (maybe_call_debugger, Fbacktrace):
7501 * process.c (read_process_output, exec_sentinel):
7502 Use bool for booleans.
7503 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7504 All callers changed.
7505 * eval.c (interactive_p): Omit always-true boolean argument
7506 EXCLUDE_SUBRS_P. All callers changed.
7507 * dispextern.h, lisp.h: Reflect above API changes.
7508 * firstfile.c (dummy): Use the address of 'main', whose signature
7509 won't change, instead of the address of 'initialize', whose
7510 signature just changed from int to bool.
7511 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7512 * msdos.c (fatal_error_in_progress): ... from here.
7513 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7515 (redisplay_internal, unwind_redisplay): Simply clear
7516 REDISPLAYING_P when unwinding, instead of saving its previous,
7517 always-false value and then restoring it.
7519 Clean up some extern decls.
7520 Mostly, this hoists extern decls out of .c files and into .h files.
7521 That way, we're more likely to catch errors if the interfaces change.
7522 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7523 declare xg_mark_data.
7524 * dispextern.h (x_frame_parm_handlers):
7526 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7527 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7528 (Qultra_bold, Qoblique, Qitalic):
7529 Move extern decl here from .c file.
7530 * alloc.c (xg_mark_data) [USE_GTK]:
7532 * eval.c (Qlexical_binding):
7533 * fns.c (time) [!HAVE_UNISTD_H]:
7534 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7535 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7536 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7537 * lread.c (Qinternal_interpreter_environment):
7538 * minibuf.c (Qbuffer):
7539 * process.c (QCfamily, QCfilter):
7540 * widget.c (free_frame_faces):
7541 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7542 * xfont.c (x_clear_errors):
7543 * xterm.c (x_frame_parm_handlers):
7544 Remove now-redundant extern decls.
7545 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7546 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7548 * xfaces.c: Remove unnecessary static decls.
7549 * xterm.c (updating_frame): Remove decl of nonexistent object.
7551 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7552 when building globals.h, as the objects that are not built on
7553 this host are not needed to compile C files on this host.
7555 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7557 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7559 * frame.h: Add missing prototype for x_wm_set_size_hint.
7561 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7563 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7564 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7565 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7566 (Fsubstitute_command_keys):
7567 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7568 (save_excursion_save, save_excursion_restore)
7569 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7570 (format_time_string, general_insert_function)
7571 (make_buffer_string, make_buffer_string_both)
7572 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7573 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7574 (copy_text, insert_1, insert_1_both, insert_from_string)
7575 (insert_from_string_before_markers, insert_from_string_1)
7576 (insert_from_buffer, insert_from_buffer_1, replace_range)
7577 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7578 (del_range_2, modify_region):
7579 * intervals.c (intervals_equal, balance_possible_root_interval)
7580 (adjust_intervals_for_insertion, merge_properties_sticky)
7581 (graft_intervals_into_buffer, lookup_char_property)
7582 (adjust_for_invis_intang, set_point_both)
7583 (get_property_and_range, compare_string_intervals)
7584 (set_intervals_multibyte_1, set_intervals_multibyte):
7585 * keyboard.c (decode_timer):
7586 Use bool for boolean.
7587 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7588 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7590 2012-09-02 Chong Yidong <cyd@gnu.org>
7592 * keymap.c (push_key_description): Print M-TAB as C-M-i
7595 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7597 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7598 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7599 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7600 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7601 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7602 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7603 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7605 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7607 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7608 more than one grapheme cluster passed to the shaper: compute the
7609 offset adjustment values separately for each cluster. (Bug#11860)
7611 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7612 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7613 about implicit conversions from integer to pointer.
7615 2012-09-01 Daniel Colascione <dancol@dancol.org>
7617 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7618 system used too early.
7620 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7622 Better seed support for (random).
7623 * emacs.c (main): Call init_random.
7624 * fns.c (Frandom): Set the seed from a string argument, if given.
7625 Remove long-obsolete Gentzel cruft.
7626 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7627 (init_random): New function.
7629 2012-09-01 Daniel Colascione <dancol@dancol.org>
7631 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7632 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7633 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7634 x_wm_set_size_hint, x_query_colors, x_real_positions,
7635 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7636 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7637 all of which have been moved to common code.
7639 * xfaces.c: Include TERM_HEADER instead of listing all possible
7640 window-system headers.
7642 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7645 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7646 directly accessing frame internals.
7648 * w32font.h: Include font.h. Define syms_of_w32font and
7651 * process.c: Include TERM_HEADER instead of listing all possible
7652 window-system headers.
7654 * nsterm.h: Remove declarations now in frame.h.
7655 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7657 * menu.c: Include TERM_HEADER instead of listing all possible
7658 window-system headers.
7660 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7663 * keyboard.c: Include TERM_HEADER instead of listing all possible
7664 window-system headers.
7666 * image.c: Include TERM_HEADER instead of listing all possible
7667 window-system headers. Declare Vlibrary_cache when compiling for
7670 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7671 window system declarations.
7673 * frame.h: Move common functions here: set_frame_menubar,
7674 x_set_window_size, x_sync, x_get_focus_frame,
7675 x_set_mouse_position, x_set_mouse_pixel_position,
7676 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7677 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7678 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7679 x_activate_menubar, x_real_positions, x_bitmap_icon,
7680 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7683 * frame.c: Include TERM_HEADER instead of listing all possible
7684 window-system headers.
7686 * font.c: Include TERM_HEADER instead of listing all possible
7687 window-system headers.
7689 * emacs.c: Include TERM_HEADER.
7691 * dispnew.c: Include TERM_HEADER instead of listing all possible
7692 window-system headers.
7694 * ccl.h: Include character.h.
7696 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7697 the current window system; include in list of objects to link into
7700 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7702 Remove mark_ttys function and fix tty_display_info initialization.
7703 * lisp.h (mark_ttys): Remove prototype.
7704 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7705 to mark_ttys because all possible values of 'top_frame' slot are
7706 the frames which are reachable from Vframe_list.
7707 * term.c (mark_ttys): Remove.
7708 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7710 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7712 Change struct frame bitfields from unsigned char to unsigned.
7713 * frame.h (struct frame): Change type of 'display_preempted',
7714 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7715 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7716 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7717 bitfields from unsigned char to unsigned.
7719 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7721 Remove unused member of struct x_output and struct w32_output.
7722 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7723 * w32term.h (struct w32_output): Likewise.
7725 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7727 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7728 does not become zero (Bug#12234).
7730 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7732 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7733 for GCC 4.7.1 x86-64.
7735 2012-08-30 Glenn Morris <rgm@gnu.org>
7737 * lread.c (init_lread): For out-of-tree builds, only add the
7738 source directory's site-lisp dir to the load-path if it exists,
7739 consistent with in-tree builds. (Bug#12302)
7741 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7743 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7744 button_values to NULL. Call setStykeMask so dialogs get a close button.
7745 (windowShouldClose:): Set window_closed.
7746 (dealloc): New member, free button_values.
7747 (process_dialog:): Make member function. Remove window argument,
7748 replace window with self. Count buttons and allocate and store values
7750 (addButton:value:row:): value is int with the name tag. Call setTag
7751 with tag. Remove return self, declare return value as void.
7752 (addString:row:): Remove return self, declare return value as void.
7753 (addSplit): Remove return self, declare return value as void.
7754 (clicked:): Remove return self, declare return value as void.
7755 Set dialog_return to button_values[seltag]. Code formatting change.
7756 (initFromContents:isQuestion:): Adjust call to process_dialog.
7757 Code formatting change.
7758 (timeout_handler:): Set timer_fired to YES.
7759 (runDialogAt:): Set timer_fired to NO.
7760 Handle click on close button as quit.
7762 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7763 Add window_closed and button_values. Add void as return value for
7764 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7765 Add process_dialog as new member.
7767 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7769 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7770 is not one of the heaps we manage. (Bug#12242)
7772 2012-08-28 Glenn Morris <rgm@gnu.org>
7774 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7776 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7778 * window.c (Fset_window_configuration): Remove handling of
7779 auto-buffer-name window parameter. Install revision of reverted
7782 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7784 Do not allow to set major mode for a dead buffer.
7785 * buffer.c (Fset_buffer_major_mode): Signal an error
7786 if the buffer is dead.
7787 (Fother_buffer, other_buffer_safely): Remove redundant
7790 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7792 Always use set_buffer_if_live to restore original buffer at unwind.
7793 * buffer.h (record_unwind_current_buffer): New function.
7794 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7795 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7796 * undo.c, window.c: Adjust users.
7797 * buffer.c (set_buffer_if_live): Fix comment.
7799 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7801 Fix usage of set_buffer_internal.
7802 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7803 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7804 * coding.c (decode_coding): Omit redundant test.
7805 * fileio.c (decide_coding_unwind): Likewise.
7806 * fns.c (secure_hash): Likewise.
7807 * insdel.c (modify_region): Likewise.
7808 * keyboard.c (command_loop_1): Likewise.
7809 * print.c (PRINTFINISH): Likewise.
7810 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7812 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7814 * dispnew.c: Use bool for boolean.
7815 (frame_garbaged, display_completed, delayed_size_change)
7816 (fonts_changed_p, add_window_display_history)
7817 (add_frame_display_history, verify_row_hash)
7818 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7819 (row_equal_p, realloc_glyph_pool)
7820 (allocate_matrices_for_frame_redisplay)
7821 (showing_window_margins_p)
7822 (adjust_frame_glyphs_for_frame_redisplay)
7823 (build_frame_matrix_from_leaf_window, make_current)
7824 (mirrored_line_dance, mirror_line_dance, update_frame)
7825 (update_window_tree, update_single_window)
7826 (check_current_matrix_flags, update_window, update_text_area)
7827 (update_window_line, set_window_update_flags, scrolling_window)
7828 (update_frame_1, scrolling, buffer_posn_from_coords)
7829 (do_pending_window_change, change_frame_size)
7830 (change_frame_size_1, sit_for):
7831 Use bool for boolean.
7832 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7833 and remove last int (actually boolean) argument, which was always 0.
7834 All callers changed.
7835 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7836 * dispextern.h (struct composition_it): Use bool for boolean.
7837 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7838 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7839 * dired.c (file_name_completion):
7840 Use bool for boolean. (This was missed in an earlier change.)
7842 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7844 * window.c (Fset_window_configuration): Revert first part of
7847 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7849 * nsterm.h (NSPanel): New class variable dialog_return.
7851 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7852 Initialize dialog_return.
7853 (windowShouldClose:): Use stop instead of stopModalWithCode.
7854 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7855 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7857 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7860 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7862 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7863 * composite.c (find_composition, composition_gstring_p)
7864 (composition_reseat_it, find_automatic_composition):
7865 * data.c (let_shadows_buffer_binding_p)
7866 (let_shadows_global_binding_p, set_internal, make_blv)
7867 (Fmake_variable_buffer_local, Fmake_local_variable)
7868 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7869 (cons_to_signed, arith_driver):
7870 * dbusbind.c (xd_in_read_queued_messages):
7871 * dired.c (directory_files_internal, file_name_completion):
7872 Use bool for booleans.
7873 * dired.c (file_name_completion):
7874 * process.h (fd_callback):
7875 Omit int (actually boolean) argument. It wasn't being used.
7877 * composite.h, lisp.h: Reflect above API changes.
7879 * cmds.c, coding.c: Use bool for booleans.
7880 * cmds.c (move_point, Fself_insert_command):
7881 * coding.h (struct composition status, struct coding_system):
7882 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7883 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7884 (emacs_mule_char, decode_coding_emacs_mule)
7885 (encode_coding_emacs_mule, detect_coding_iso_2022)
7886 (decode_coding_iso_2022, encode_invocation_designation)
7887 (encode_designation_at_bol, encode_coding_iso_2022)
7888 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7889 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7890 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7891 (encode_coding_raw_text, detect_coding_charset)
7892 (decode_coding_charset, encode_coding_charset, detect_eol)
7893 (detect_coding, get_translation_table, produce_chars)
7894 (consume_chars, reused_workbuf_in_use)
7895 (make_conversion_work_buffer, code_conversion_save)
7896 (decode_coding_object, encode_coding_object)
7897 (detect_coding_system, char_encodable_p)
7898 (Funencodable_char_position, code_convert_region)
7899 (code_convert_string, code_convert_string_norecord)
7900 (Fset_coding_system_priority):
7901 * fileio.c (Finsert_file_contents):
7902 Use bool for booleans.
7903 * coding.h, lisp.h: Reflect above API changes.
7904 * coding.c: Remove unnecessary static function decls.
7905 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7906 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7907 not a boolean 'int', since callers never look at the return value.
7908 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7909 * coding.h (decoding_buffer_size, encoding_buffer_size)
7910 (emacs_mule_string_char): Remove unused extern decls.
7911 (struct iso_2022_spec, struct coding_system):
7912 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7913 (struct emacs_mule_spec): Remove unused field 'full_support'.
7914 All initializations removed.
7915 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7917 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7919 Fix spare memory change (Bug#12286).
7920 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7921 (valid_lisp_object_p): Likewise.
7923 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7925 * window.c (Fset_window_configuration): Record any window's old
7926 buffer if it's replaced (see Bug#8789). If the new current
7927 buffer doesn't appear in the selected window, go to its old
7930 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7932 Special MEM_TYPE_SPARE to denote reserved memory.
7933 * alloc.c (enum mem_type): New memory type.
7934 (refill_memory_reserve): Use new type for spare memory.
7935 This prevents live_cons_p and live_string_p from incorrect
7936 detection of uninitialized objects from spare memory as live.
7938 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7941 * Makefile.in (.PHONY): versioclean -> versionclean.
7943 Remove unused external symbols.
7944 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7945 * window.c (Qwindow_valid_p, decode_valid_window):
7946 Now static, not extern.
7947 * data.c (Qinterval): Remove; unused.
7948 (syms_of_data): Do not define 'interval'.
7949 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7950 * window.h (decode_valid_window):
7953 * character.c, charset.c, chartab.c: Use bool for booleans.
7954 * character.c (lisp_string_width, string_count_byte8)
7955 (string_escape_byte8):
7956 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7957 (load_charset_map_from_file, map_charset_chars)
7958 (Fdefine_charset_internal, define_charset_internal)
7959 (Fdeclare_equiv_charset, find_charsets_in_text)
7960 (Ffind_charset_region, char_charset, Fiso_charset):
7961 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7962 (sub_char_table_set, sub_char_table_set_range)
7963 (char_table_set_range, optimize_sub_char_table)
7964 (map_sub_char_table):
7965 Use bool for boolean.
7966 * character.c (str_to_unibyte): Omit last boolean argument; it was
7967 always 0. All callers changed.
7968 * character.h, charset.h: Adjust to match previous changes.
7969 * character.h (char_printable_p): Remove decl of nonexistent function.
7970 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7971 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7972 are all boolean, so make them single-bit bitfields.
7974 * lisp.h (ASET): Remove attempt to detect side effects.
7975 It was meant to be temporary and it often doesn't work,
7976 because when IDX has side effects the behavior of IDX==IDX
7977 is undefined. See Stefan Monnier in
7978 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7980 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7982 * lisp.h (functionp): New function (extracted from Ffunctionp).
7983 (FUNCTIONP): Use it.
7984 * eval.c (Ffunctionp): Use it.
7986 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7988 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7989 as that's faster and simpler than static storage. Don't bother
7990 with the g_main_context_query overhead if g_main_context_pending
7991 says no events are pending.
7992 (gfds, gfds_size): Remove these static vars.
7993 (xgselect_initialize): Remove; no longer needed.
7994 All uses and decls removed.
7996 * emacs.c (fatal_error_signal_hook): Remove.
7997 All uses removed. This leftover from old code was always 0.
7999 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8000 * casefiddle.c (casify_object, casify_region):
8001 * casetab.c (set_case_table):
8002 * category.c, category.h (word_boundary_p):
8003 * category.h (CHAR_HAS_CATEGORY):
8004 Use bool for booleans, instead of int.
8006 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8008 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8010 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8012 On assertion failure, print backtrace if available.
8013 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8014 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8015 * Makefile.in (LIB_EXECINFO): New macro.
8018 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8019 * bytecode.c (exec_byte_code):
8020 * callint.c (check_mark, Fcall_interactively):
8021 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8022 (getenv_internal, sync_process_alive, call_process_exited):
8023 * lisp.h (USE_SAFE_ALLOCA):
8024 Use bool for booleans, instead of int.
8025 * lisp.h, process.h: Adjust prototypes to match above changes.
8026 * callint.c (Fcall_interactively): Don't assume the mark's
8027 offset fits in 'int'.
8029 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8031 * buffer.c, buffer.h: Use bool for boolean.
8032 * buffer.c (reset_buffer_local_variables)
8033 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8034 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8035 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8036 (overlay_touches_p, overlay_strings, Foverlay_put)
8037 (report_overlay_modification, call_overlay_mod_hooks):
8038 (mmap_enlarge, mmap_set_vars):
8039 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8040 Use bool for booleans, instead of int.
8041 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8042 since the 1-or-0 return value is always ignored anyway.
8043 (mmap_initialized_p):
8044 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8045 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8047 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8049 * bidi.c: Use bool for boolean.
8050 This is a bit more readable, and makes the text segment of bidi.o
8051 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8052 Presumably it's faster too.
8053 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8055 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8056 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8057 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8058 (bidi_explicit_dir_char, bidi_level_of_next_char)
8059 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8060 Use bool for booleans, instead of int.
8061 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8062 (bidi_unshelve_cache): Adjust decls to match code.
8064 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8066 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8069 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8071 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8072 * atimer.h: Include <stdbool.h>.
8074 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8076 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8077 compile time tests instead of run time tests on systems that do
8079 (FRAME_MAC_P): Remove leftover from deleted code.
8080 * frame.c (syms_of_frame): Remove leftover from deleted code.
8082 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8084 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8086 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8088 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8089 Otherwise, the compiler complains about (A?B:C) where B is void
8090 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8091 (fontset_add): Return void, for FONTSET_ADD.
8093 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8095 * alloc.c: Use bool for booleans.
8096 (gc_in_progress, abort_on_gc)
8097 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8098 (dont_register_blocks) [GC_MALLOC_CHECK]:
8099 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8100 (check_string_bytes, make_specified_string, memory_full)
8101 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8102 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8103 (mark_stack, valid_pointer_p, make_pure_string)
8104 (Fgarbage_collect, survives_gc_p, gc_sweep):
8105 Use bool for booleans, instead of int.
8106 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8107 Remove unused local.
8108 * alloc.c (PURE_POINTER_P):
8109 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8110 * editfns.c (Fformat):
8111 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8113 * fns.c (sweep_weak_table):
8114 * lisp.h (suppress_checking, push_message, survives_gc_p)
8115 (make_pure_string, gc_in_progress, abort_on_gc):
8116 * lread.c (readchar, read1):
8117 * print.c (Fprin1_to_string):
8118 * xdisp.c (push_message):
8119 Use bool for booleans affected directly or indirectly by
8122 Make recently-introduced setters macros.
8123 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8124 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8125 (set_fontset_default, set_fontset_fallback): Rename from their
8126 upper-case counterparts, and make them functions rather than macros.
8127 This is more consistent with the other recently-introduced setters.
8128 These don't need to be inline, since they're local.
8130 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8132 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8133 the loop (Bug#12247).
8135 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8137 * lisp.h (vcopy): Use memcpy rather than our own loop.
8138 This fixes a performance regression introduced by the recent
8139 addition of vcopy. This means 'vcopy' will need to be modified
8140 for a copying collector, but that's OK. Also, tighten the
8141 checking in the assertion.
8143 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8145 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8146 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8147 non-base glyph for the width of the base character, according to
8148 what x_draw_composite_glyph_string_foreground expects.
8149 Generate WADJUST value according to composition_gstring_width's
8150 expectations, to produce correct width of the composed character.
8151 Reverse the sign of the DU offset produced by ScriptPlace.
8153 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8155 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8157 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8159 Avoid direct writes to contents member of struct Lisp_Vector.
8160 * lisp.h (vcopy): New function to copy data into vector.
8161 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8162 * fns.c (Ffillarray): Use ASET.
8163 * keyboard.c (timer_check_2): Use AREF and ASET.
8164 (append_tool_bar_item, Frecent_keys): Use vcopy.
8165 * lread.c (read_vector): Use ASET.
8166 * msdos.c (Frecent_doskeys): Use vcopy.
8167 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8168 (Finternal_merge_in_global_face): Use ASET and vcopy.
8169 * xfont.c (xfont_list_pattern): Likewise.
8171 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8173 * window.c (Fwindow_point): For the selected window always return
8174 the position of its buffer's point.
8175 (Fset_window_point): For the selected window always go in its
8176 buffer to the specified position.
8178 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8180 Setter macros for fontsets.
8181 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8182 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8183 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8186 2012-08-20 Glenn Morris <rgm@gnu.org>
8188 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8189 Don't assume that `ln -f' works.
8191 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8193 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8194 and later about non-assignments with no effect. See discussion at
8195 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8198 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8200 Inline setter functions for Lisp_Objects slots of struct specbinding.
8201 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8204 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8206 * window.c (select_window): Always make selected window's buffer
8209 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8211 Use AREF and ASET for docstrings of category tables.
8212 * category.h (CATEGORY_DOCSTRING): Use AREF.
8213 (SET_CATEGORY_DOCSTRING): Use ASET.
8214 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8216 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8218 Inline setter functions for hash table members.
8219 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8220 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8221 (set_hash_key_and_value, set_hash_index, set_hash_next)
8222 (set_hash_hash): New functions.
8223 * charset.c, fns.c: Adjust users.
8225 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8227 Inline getter and setter functions for per-buffer values.
8228 * buffer.h (per_buffer_default, set_per_buffer_default)
8229 (per_buffer_value, set_per_buffer_value): New functions.
8230 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8231 * buffer.c, data.c: Adjust users.
8233 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8235 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8237 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8239 Rely on <config.h> + <unistd.h> to declare 'environ',
8240 as gnulib does this if the system doesn't.
8241 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8242 Remove declaration. MS-Windows declares it on stdlib.h which is
8243 included by conf_post.h.
8244 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8245 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8246 * vm-limit.c: Include <unistd.h>, for 'environ'.
8248 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8249 (start_of_data): Remove decl; mem-limits.h provides it.
8251 * xdisp.c (handle_invisible_prop): Make it a bit faster
8252 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8254 2012-08-19 Chong Yidong <cyd@gnu.org>
8256 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8259 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8261 * .gdbinit: Use call instead of set when calling a function in the
8264 * data.c (set_internal): Don't use set_blv_found.
8265 (Fkill_local_variable): Likewise.
8267 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8269 * nsfont.m (ns_ascii_average_width): Ensure the string
8270 ascii_printable is initialized with a null-terminated character
8271 array. Otherwise, it can contain undesired extra characters.
8273 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8275 port new setting code to Sun C 5.8 2005/10/13
8276 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8277 Return void, not Lisp_Object. Otherwise, the compiler
8278 complains about (A?B:C) where B is void and C is Lisp_Object
8279 when compiling CHAR_TABLE_SET, due to the recent change to
8280 the API of sub_char_table_set_contents.
8282 2012-08-18 Chong Yidong <cyd@gnu.org>
8284 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8285 for the string case (Bug#3874).
8287 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8289 * buffer.h (BSET): Remove (Bug#12215).
8290 Replace all uses with calls to new setter functions.
8291 (bset_bidi_paragraph_direction, bset_case_canon_table)
8292 (bset_case_eqv_table, bset_directory, bset_display_count)
8293 (bset_display_time, bset_downcase_table)
8294 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8295 (bset_last_selected_window, bset_local_var_alist)
8296 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8297 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8299 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8300 (bset_auto_fill_function, bset_auto_save_file_format)
8301 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8302 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8303 (bset_cache_long_line_scans, bset_case_fold_search)
8304 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8305 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8306 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8307 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8308 (bset_header_line_format, bset_indicate_buffer_boundaries)
8309 (bset_indicate_empty_lines, bset_invisibility_spec)
8310 (bset_left_fringe_width, bset_major_mode, bset_mark)
8311 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8312 (bset_name, bset_overwrite_mode, bset_pt_marker)
8313 (bset_right_fringe_width, bset_save_length)
8314 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8315 (bset_scroll_up_aggressively, bset_selective_display)
8316 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8317 (bset_word_wrap, bset_zv_marker):
8318 * category.c (bset_category_table):
8319 * syntax.c (bset_syntax_table):
8320 New setter functions.
8322 * process.h (PSET): Remove (Bug#12215).
8323 Replace all uses with calls to new setter functions.
8324 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8325 (PROCESS_INLINE): New macro.
8326 (pset_childp): New setter function.
8327 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8328 * process.c (PROCESS_INLINE):
8329 Define to EXTERN_INLINE, so that the corresponding functions
8330 are compiled into code.
8331 (pset_buffer, pset_command, pset_decode_coding_system)
8332 (pset_decoding_buf, pset_encode_coding_system)
8333 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8334 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8335 (pset_type, pset_write_queue): New setter functions.
8337 * window.h (WSET): Remove (Bug#12215).
8338 Replace all uses with calls to new setter functions.
8339 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8340 (WINDOW_INLINE): New macro.
8341 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8342 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8343 (wset_total_lines, wset_vertical_scroll_bar)
8344 (wset_window_end_pos, wset_window_end_valid)
8345 (wset_window_end_vpos): New setter functions.
8346 * window.c (WINDOW_INLINE):
8347 Define to EXTERN_INLINE, so that the corresponding functions
8348 are compiled into code.
8349 (wset_combination_limit, wset_dedicated, wset_display_table)
8350 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8351 (wset_new_normal, wset_new_total, wset_next_buffers)
8352 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8353 (wset_prev_buffers, wset_right_fringe_width)
8354 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8355 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8356 (wset_window_parameters):
8357 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8358 (wset_column_number_displayed, wset_region_showing):
8359 New setter functions.
8361 * termhooks.h (TSET): Remove (Bug#12215).
8362 Replace all uses with calls to new setter functions.
8363 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8364 (TERMHOOKS_INLINE): New macro.
8365 (tset_charset_list, tset_selection_alist): New setter functions.
8366 * terminal.c (TERMHOOKS_INLINE):
8367 Define to EXTERN_INLINE, so that the corresponding functions
8368 are compiled into code.
8369 (tset_param_alist): New setter function.
8371 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8373 * keyboard.h (KSET): Remove (Bug#12215).
8374 Replace all uses with calls to new setter functions.
8375 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8376 (KEYBOARD_INLINE): New macro.
8377 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8378 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8379 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8380 New setter functions.
8381 * keyboard.c (KEYBOARD_INLINE):
8382 Define to EXTERN_INLINE, so that the corresponding functions
8383 are compiled into code.
8384 (kset_echo_string, kset_kbd_queue)
8385 (kset_keyboard_translate_table, kset_last_prefix_arg)
8386 (kset_last_repeatable_command, kset_local_function_key_map)
8387 (kset_overriding_terminal_local_map, kset_real_last_command)
8388 (kset_system_key_syms): New setter functions.
8390 * frame.h (FSET): Remove (Bug#12215).
8391 Replace all uses with calls to new setter functions.
8392 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8393 (FRAME_INLINE): New macro.
8394 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8395 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8396 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8397 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8398 (fset_param_alist, fset_root_window, fset_scroll_bars)
8399 (fset_selected_window, fset_title, fset_tool_bar_items)
8400 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8401 * frame.c (FRAME_INLINE):
8402 Define to EXTERN_INLINE, so that the corresponding functions
8403 are compiled into code.
8404 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8406 A few more naming-convention fixes for getters and setters.
8407 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8408 and rename from buffer_overlays_set_before.
8409 (set_buffer_overlays_after): Move here from buffer.h, and rename
8410 from buffer_overlays_set_after.
8411 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8413 (set_buffer_intervals): Rename from buffer_set_intervals.
8414 * intervals.c (set_interval_object): Move here from intervals.h,
8415 and rename from interval_set_object.
8416 (set_interval_left): Move here from intervals.h, and rename from
8418 (set_interval_right): Move here from intervals.h, and rename from
8420 (copy_interval_parent): Move here from intervals.h, and rename from
8421 interval_copy_parent.
8422 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8423 (set_interval_plist): Rename from interval_set_plist.
8424 Return void, not Lisp_Object, since no caller uses the result.
8425 * lisp.h (string_intervals): Rename from string_get_intervals.
8426 (set_string_intervals): Rename from string_set_intervals.
8428 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8429 (set_char_table_contents): Rename from char_table_set_contents.
8430 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8431 All uses changed. See the end of
8432 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8434 * lisp.h (CSET): Remove (Bug#12215).
8435 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8436 (set_char_table_purpose): New functions,
8437 replacing CSET. All uses changed. For example, replace
8438 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8439 "set_char_table_parent (char_table, parent);".
8440 The old version was confusing because it used the same name
8441 'parent' for two different things.
8443 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8445 Functions to get and set Lisp_Object fields of buffer-local variables.
8446 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8447 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8448 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8449 * data.c, eval.c, frame.c: Adjust users.
8451 2012-08-17 Chong Yidong <cyd@gnu.org>
8453 * xfaces.c (merge_face_vectors): If the target font specfies a
8454 font spec, make the font's attributes take precedence over
8455 directly-specified attributes.
8456 (merge_face_ref): Recognize :font.
8458 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8460 Do not use memcpy for copying intervals.
8461 * intervals.c (reproduce_interval): New function.
8462 (reproduce_tree, reproduce_tree_obj): Use it.
8463 (reproduce_tree_obj): Remove prototype.
8465 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8467 * lisp.h (duration_to_sec_usec): Remove unused decl.
8469 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8471 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8472 to an allocated instance of NSString, not to the class itself.
8474 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8476 * makefile.w32-in (C_CTYPE_H): New macro.
8477 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8478 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8479 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8481 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8483 Use ASCII tests for character types.
8484 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8486 Don't include <ctype.h>; was not needed.
8487 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8488 * sysdep.c, xfaces.c:
8489 Include <c-ctype.h> instead of <ctype.h>.
8490 * nsterm.m: Include <c-ctype.h>.
8491 * charset.c (read_hex):
8492 * doc.c (Fsnarf_documentation):
8493 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8494 (DRIVE_LETTER) [DOS_NT]:
8495 (Ffile_name_directory, Fexpand_file_name)
8496 (Fsubstitute_in_file_name):
8497 * font.c (font_parse_xlfd, font_parse_fcname):
8498 * frame.c (x_set_font_backend):
8499 * gtkutil.c (xg_get_font):
8500 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8501 * nsimage.m (hexchar):
8502 * nsterm.m (ns_xlfd_to_fontname):
8503 * sysdep.c (system_process_attributes):
8504 * xfaces.c (hash_string_case_insensitive):
8505 Use C-locale tests instead of locale-specific tests for character
8506 types, since we want the ASCII interpretation here, not the
8507 interpretation suitable for whatever happens to be the current locale.
8509 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8511 Consistently check windows for validity/liveness
8512 (Bug#11984, Bug#12025, Bug#12026).
8513 * lisp.h (CHECK_VALID_WINDOW): New macro.
8514 * window.c (decode_window): Rename to decode_live_window.
8515 (decode_valid_window, Fwindow_valid_p): New functions.
8516 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8517 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8518 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8519 (Fwindow_prev_sibling, Fwindow_combination_limit)
8520 (Fset_window_combination_limit, Fwindow_use_time)
8521 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8522 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8523 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8524 (Fwindow_hscroll, Fset_window_hscroll)
8525 (Fwindow_redisplay_end_trigger)
8526 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8527 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8528 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8529 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8530 (Fwindow_end, Fset_window_point, Fset_window_start)
8531 (Fpos_visible_in_window_p, Fwindow_line_height)
8532 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8533 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8534 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8535 (Fset_window_parameter, Fwindow_display_table)
8536 (Fset_window_display_table, Fdelete_other_windows_internal)
8537 (Fset_window_buffer, Fset_window_new_total)
8538 (Fset_window_new_normal, Fdelete_window_internal)
8539 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8540 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8541 (Fwindow_scroll_bars): Check whether argument window is a valid or
8542 live window. Update doc-strings.
8543 (syms_of_window): New symbol Qwindow_valid_p.
8544 * keyboard.c (Fposn_at_x_y): Check whether argument
8545 frame_or_window denotes a valid window.
8547 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8549 Fix previous char table change.
8550 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8551 * chartab.c (optimize_sub_char_table): Likewise.
8553 2012-08-16 Chong Yidong <cyd@gnu.org>
8555 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8557 * xfont.c (xfont_open):
8558 * xftfont.c (xftfont_open): Set the font's max_width field.
8560 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8561 min_width to space_width and average_width to the average over
8562 printable ASCII characters.
8563 (ns_char_width): Code cleanup.
8564 (ns_ascii_average_width): New utility function.
8566 * font.h (struct font): Update comments.
8568 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8570 Simple interface to set Lisp_Object fields of character tables.
8571 * lisp.h (CSET): New macro.
8572 (char_table_set_extras, char_table_set_contents)
8573 (sub_char_table_set_contents): New function.
8574 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8575 * syntax.c: Adjust users.
8577 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8579 * eval.c (eval_sub): Bind lexical-binding.
8580 * lread.c (Qlexical_binding): Make non-static.
8582 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8584 * nsmenu.m (popupSession): Remove.
8585 (pop_down_menu): Remove endModalSession.
8586 (timeout_handler:): New method.
8587 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8588 Call runModalForWindow. Check timer_fired when it returns.
8589 If not set, cancel timer and break out of loop.
8590 Otherwise loop again, with a new timeout.
8592 * nsterm.m: Include fcntl.h if present.
8593 (fd_entry, t_readfds, inNsSelect): Remove.
8594 (select_writefds, select_valid, select_timeout, selfds)
8595 (select_mutex, apploopnr): Add.
8596 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8597 Otherwise call kbd_buffer_store_event.
8598 (ns_send_appdefined): Remove release of fd_entry.
8599 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8600 Increment and decrement apploopnr.
8601 (ns_select): If no file descriptors, just do a NSTimer.
8602 Otherwise copy read/write masks and start select thread (fd_handler).
8603 Start main loop and wait for application defined event.
8604 Inform select thread to stop selecting after main loop is exited.
8605 (ns_term_init): Create selfds pipe and set non-blocking.
8606 Initialize select_mutex. Start the select thread (fd_handler).
8607 (fd_handler:): Loop forever, wait for info from the main thread
8608 to either start or stop selecting. When select returns, send
8609 and appdefined event.
8610 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8611 If not call kbd_buffer_store_event.
8613 * nsterm.h (EmacsApp): fd_handler takes id argument.
8614 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8616 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8618 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8620 * region-cache.c (move_cache_gap): Update gap_len using the actual
8621 growth of the boundaries array. Do not change cache_len.
8624 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8626 Generalize and cleanup font subsystem checks.
8627 * font.h (FONT_DEBUG, font_assert): Remove.
8628 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8629 Change font_assert to eassert. Use eassert where appropriate.
8631 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8633 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8635 2012-08-15 Chong Yidong <cyd@gnu.org>
8637 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8638 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8639 extract the font descriptor instead of just the font name.
8640 In that case, return a font spec instead of a string.
8641 (x_last_font_name): Move to this file from xfns.c.
8643 * xfns.c (Fx_select_font): The return value can also be a font
8644 spec. Move x_last_font_name management to gtkutil.c.
8646 * xfaces.c: Make font weight and style symbols non-static.
8648 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8650 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8653 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8655 * alloc.c (Fgarbage_collect): Use plural form consistently.
8657 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8659 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8660 iteration through the command loop. Fixes a problem whereby mouse
8661 movements are ignored until the first mouse click.
8663 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8665 Use bool, not int, for Lisp booleans.
8666 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8667 makes Emacs a bit smaller and presumably a bit faster.
8668 * lisp.h: Include <stdbool.h>.
8669 (struct Lisp_Boolfwd, defvar_bool):
8670 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8671 * regex.c [!emacs]: Include <stdbool.h>.
8672 (false, true): Remove; <stdbool.h> does this for us now.
8674 2012-08-14 Chong Yidong <cyd@gnu.org>
8676 * character.c (Fcharacterp): Doc fix (Bug#12076).
8678 * data.c (Findirect_variable): Doc fix (Bug#11040).
8680 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8682 * editfns.c (Fformat): Doc fix (Bug#12059).
8683 (Fsave_current_buffer): Doc fix (Bug#11542).
8685 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8687 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8690 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8692 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8693 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8694 * minibuf.c (choose_minibuf_frame, read_minibuf):
8695 * w32fns.c (x_create_tip_frame):
8696 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8697 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8699 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8701 * intervals.c (offset_intervals): Remove obsolete comment.
8703 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8705 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8707 2012-08-14 Gergely Risko <gergely@risko.hu>
8709 * coding.c (decode_coding): Record buffer modification before
8710 disabling undo_list (Bug#11773).
8712 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8714 Revert and cleanup some recent overlay changes.
8715 * buffer.h (enum overlay_type): Remove.
8716 (buffer_get_overlays, buffer_set_overlays): Likewise.
8717 (buffer_set_overlays_before, buffer_set_overlays_after):
8718 New function. Adjust users.
8719 (unchain_both): Add eassert.
8721 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8723 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8725 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8727 * gtkutil.c (xg_mark_data): Don't assume C99.
8729 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8731 * gtkutil.c (xg_frame_tb_info): New struct.
8732 (TB_INFO_KEY): New define.
8733 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8734 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8735 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8737 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8738 is up to date. Otherwise store new data.
8739 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8741 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8743 Use KSET for write access to Lisp_Object members of struct kboard.
8744 * keyboard.h (KSET): New macro.
8745 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8746 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8747 * xterm.c: Adjust users.
8749 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8751 Use BSET for write access to Lisp_Object members of struct buffer.
8752 * buffer.h (BSET): New macro.
8753 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8754 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8755 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8756 * window.c, xdisp.c, xfns.c: Adjust users.
8758 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8760 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8762 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8764 * nsterm.m (not_in_argv): New function.
8765 (application:openFile, application:openTempFile:):
8766 (application:openFileWithoutUI:, application:openFiles:): Open file
8767 if not_in_argv returns non-zero (bug#12171).
8769 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8770 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8771 Define for Gtk+ versions less than 3.2.
8772 (xg_get_font_name): Use those functions/macros here.
8773 Reported by Frans Oilinki <moilinki@gmail.com>.
8775 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8777 * unexmacosx.c (copy_data_segment): Copy initialized data in
8778 statically linked libraries from input file rather than memory.
8780 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8781 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8782 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8784 2012-08-10 Glenn Morris <rgm@gnu.org>
8786 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8787 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8789 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8791 Fix last change to allow compilation with low optimization levels.
8792 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8793 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8795 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8797 Use common inline syntax in intervals.h.
8798 * intervals.h (INTERVALS_INLINE): New macro.
8799 Change all users from LISP_INLINE.
8801 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8803 Define Qnone once for all platforms.
8804 * frame.c (Qnone): Define here.
8805 (syms_of_frame): DEFSYM it.
8806 * lisp.h (Qnone): New declaration.
8807 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8808 * xfns.c: Remove duplication. Adjust users.
8810 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8812 Remove unused macros from intervals.h.
8813 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8814 * intervals.c: Adjust comment.
8816 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8818 * w32fns.c <w32_unicode_gui>: New static variable.
8819 (globals_of_w32fns): Initialize it according to os_subtype.
8820 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8823 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8824 Eli Zaretskii <eliz@gnu.org>
8826 Fix bug #10299 with Unicode characters sent by customized
8827 keyboards created by MSKLC.
8828 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8829 (w32_init_class): Use it to initialize the Emacs class with either
8830 ANSI or Unicode API calls.
8831 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8833 (w32_wnd_proc): If the character code sent by WM_CHAR or
8834 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8835 original message. Call DefWindowProcW on NT and later.
8837 2012-08-10 Glenn Morris <rgm@gnu.org>
8839 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8841 * lisp.h (DIRECTORY_SEP): Let configure set it.
8843 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8845 Use TSET for write access to Lisp_Object slots of struct terminal.
8846 * termhooks.h (TSET): New macro.
8847 * coding.c, terminal.c, xselect.c: Adjust users.
8849 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8851 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8852 the failing expression, include them in the error message.
8853 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8854 * lisp.h (internal_condition_case_n): Update declaration.
8856 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8858 Inline functions to examine and change buffer overlays.
8859 * buffer.c (unchain_both): New function.
8860 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8861 (buffer_has_overlays): New function.
8862 (enum overlay_type): New enum.
8863 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8864 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8866 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8868 Inline functions to examine and change buffer intervals.
8869 * alloc.c (mark_interval_tree): Remove.
8870 (MARK_INTERVAL_TREE): Simplify.
8871 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8872 * intervals.c (buffer_balance_intervals): New function.
8873 (graft_intervals_into_buffer): Adjust indentation.
8874 (set_intervals_multibyte): Simplify.
8875 * buffer.h (BUF_INTERVALS): Remove.
8876 (buffer_get_intervals, buffer_set_intervals): New function.
8877 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8878 * intervals.c, textprop.c: Adjust users.
8880 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8882 Inline functions to examine and change string intervals.
8883 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8884 (string_get_intervals, string_set_intervals): New function.
8885 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8886 * lread.c, print.c, textprop.c: Adjust users.
8888 2012-08-08 Glenn Morris <rgm@gnu.org>
8890 * lisp.mk (lisp): Remove language/persian.elc.
8892 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8895 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8896 (NULL_INTERVAL_P): Likewise. Adjust users.
8897 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8898 Adjust comment. Move under #if 0.
8899 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8900 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8902 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8904 Check total length of intervals with eassert.
8905 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8906 * intervals.c: Change all users to eassert.
8908 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8910 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8911 Rename fields to match removal of FGET and WGET and disuse of
8912 INTERNAL_FIELD in Lisp_Cons.
8914 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8916 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8917 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8918 name since all xname users are fixed long time ago. Do not
8920 (set_symbol_name, set_symbol_function, set_symbol_plist):
8921 (set_symbol_next, set_overlay_plist): New function.
8922 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8923 (struct Lisp_Overlay): Likewise.
8924 (CVAR, MVAR, SVAR): Remove.
8925 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8926 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8927 * xterm.c: Adjust users.
8928 * .gdbinit: Change to use name field of struct Lisp_Symbol
8931 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8933 Basic functions to set Lisp_Object and pointer slots of intervals.
8934 * intervals.h (interval_set_parent, interval_set_object):
8935 (interval_set_left, interval_set_right, interval_set_plist):
8936 (interval_copy_parent): New function.
8937 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8938 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8940 (INTERVAL_SIZE): Remove. Adjust users.
8941 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8943 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8945 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8946 * process.h (PGET): Remove.
8947 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8948 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8950 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8952 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8953 * window.h (WGET): Remove.
8954 (struct window): Do not use INTERNAL_FIELD.
8955 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8956 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8957 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8958 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8959 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8962 2012-08-07 Chong Yidong <cyd@gnu.org>
8964 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8965 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8966 (Fdelete_window_internal): Signal an error if the window is not on
8967 a live frame (Bug#12025).
8969 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8971 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8972 * frame.h (FGET): Remove.
8973 (struct frame): Do not use INTERNAL_FIELD.
8974 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8975 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8976 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8977 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8979 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
8981 * w32.c: Silence compiler warnings.
8982 (map_w32_filename): Remove unused variable `is_fat'.
8983 (chase_symlinks): Add parentheses around expression.
8985 2012-08-06 Glenn Morris <rgm@gnu.org>
8987 * sysdep.c: Respect BROKEN_GETWD.
8989 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8990 Let configure handle it.
8991 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8993 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8995 Use GCALIGNMENT where appropriate.
8996 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8997 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8998 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9000 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9002 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9003 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9005 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9007 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9008 that should be sufficient for everyone.
9010 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9012 * keyboard.c (timer_check_2): Add break so timer_check returns next
9015 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9017 Fix Windows build errors introduced after converting to WGET and WSET.
9018 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9019 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9021 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9023 * nsterm.m (ns_frame_rehighlight): Use FSET.
9025 * nsmenu.m (ns_update_menubar): Use FSET.
9027 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9029 Separate read and write access to Lisp_Object slots of Lisp_Process.
9030 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9031 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9033 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9035 Separate read and write access to Lisp_Object slots of struct window.
9036 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9037 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9038 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9039 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9040 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9041 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9044 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9046 Fix Windows build errors introduced after converting to FGET and FSET.
9047 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9048 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9049 (w32_judge_scroll_bars): Change to use FSET.
9050 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9052 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9054 Fix replacement typo.
9055 * window.c (replace_window): Set root_window instead of
9056 selected_window. This fixes a total window subsystem
9057 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9059 2012-08-06 Glenn Morris <rgm@gnu.org>
9061 * lisp.mk (lisp): Add language/persian.elc.
9063 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9065 Separate read and write access to Lisp_Object slots of struct frame.
9066 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9067 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9068 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9069 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9070 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9072 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9074 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9076 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9078 Generalize common compile-time constants.
9079 * lisp.h (header_size, bool_header_size, word_size): Now here.
9080 (struct Lisp_Vector): Add comment.
9081 (struct Lisp_Bool_Vector): Move up to define handy constants.
9082 (VECSIZE, PSEUDOVECSIZE): Simplify.
9083 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9084 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9085 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9086 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9087 * xfont.c, xmenu.c: Use word_size where appropriate.
9089 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9091 * search.c (Freplace_match): Treat \? in the replacement text
9092 literally (Bug#8161).
9094 2012-08-05 Chong Yidong <cyd@gnu.org>
9096 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9097 * frame.c (Vdelete_frame_functions):
9098 * emacs.c (Vkill_emacs_hook): Doc fix.
9100 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9102 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9103 --with-x-toolkit=no builds.
9104 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9106 2012-08-04 Chong Yidong <cyd@gnu.org>
9108 * syntax.c (Fmodify_syntax_entry): Doc fix.
9110 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9112 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9113 * w32.c (init_environment): Change the default values of many
9114 environment variables in dflt_envvars[] to NULL, to avoid pushing
9115 them into environment when they were not already defined.
9116 Remove the code that deletes site-lisp subdirectories from the default
9117 value of EMACSLOADPATH, as it is no longer needed.
9118 (check_windows_init_file): Now external, not static.
9119 Use Vload_path as is, without adding anything, as this function is now
9120 called when Vload_path is already set up.
9122 * w32.h (check_windows_init_file): Add prototype.
9124 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9125 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9126 compatibility with Posix platforms.
9127 (main): Move the call to check_windows_init_file to here from
9129 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9130 any, in the DEFALT argument into the root of the Emacs build or
9131 installation tree, as appropriate.
9133 * callproc.c (init_callproc_1): Call decode_env_path instead of
9134 doing its equivalent by hand.
9135 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9136 the code that sets Vexec_path run on MS-Windows.
9138 * lread.c (init_lread): Add comments to #ifdef's.
9140 * msdos.c (dos_set_window_size, IT_update_begin)
9141 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9142 instead of direct references.
9144 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9146 Export DEFAULT_REHASH_* to GDB.
9147 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9148 Now constants, not macros.
9150 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9152 Remove unnecessary casts involving pointers.
9153 These casts are no longer needed now that we assume C89 or later,
9154 since they involve casting to or from void *.
9155 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9156 (make_pure_float, make_pure_vector):
9157 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9158 * macros.c (Fstart_kbd_macro):
9159 * menu.c (find_and_return_menu_selection):
9160 * minibuf.c (read_minibuf_noninteractive):
9161 * sysdep.c (closedir):
9162 * xdisp.c (x_produce_glyphs):
9163 * xfaces.c (compare_fonts_by_sort_order):
9164 * xfns.c (x_real_positions, select_visual):
9165 * xselect.c (x_stop_queuing_selection_requests)
9166 (x_get_window_property, x_get_window_property_as_lisp_data):
9167 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9168 Remove unnecessary pointer casts.
9169 * alloc.c (record_xmalloc): New function.
9170 * lisp.h (record_xmalloc): New decl.
9171 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9172 more like a function. This is because the pointer cast is not
9173 needed. All uses changed.
9174 * print.c (print_string, print_error_message): Avoid length recalc.
9176 Improve fix for macroexp crash with debugging (Bug#12118).
9177 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9178 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9179 not supposed to be invoked from the garbage collector.
9180 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9181 (gc_aset): New function, which is like ASET but can be
9182 used in the garbage collector.
9183 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9184 (set_hash_index): Use it instead of ASET.
9186 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9188 Support symlinks on latest versions of MS-Windows.
9189 * w32.c: Include winioctl.h and aclapi.h.
9190 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9191 (revert_to_self): Forward declarations of static functions.
9192 <static BOOL g_b_init_get_security_info>:
9193 <g_b_init_create_symbolic_link>: New static flags.
9194 (globals_of_w32): Initialize them to zero.
9195 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9196 (map_w32_filename): Improve commentary. Simplify switch.
9197 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9198 headers (most versions of MinGW w32api don't).
9199 (get_security_info, create_symbolic_link)
9200 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9202 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9203 in the argument file name.
9204 (sys_access): Call unc_volume_file_attributes only if
9205 GetFileAttributes fails with network-related error codes.
9206 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9207 have the required privileges.
9208 (get_file_security_desc_by_name): Rename from
9209 get_file_security_desc.
9210 (stat_worker): New function, with most of the guts of 'stat', and
9211 with addition of handling of symlinks and support for 'lstat'.
9212 If possible, get file's attributes and security information by
9213 handle, not by name. Produce S_IFLNK bit for symlinks, when
9214 called from 'lstat'.
9215 (stat, lstat): New functions, call 'stat_worker'.
9216 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9217 symlinks when the underlying filesystem supports them.
9219 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9221 Fix macroexp crash on Windows with debugging (Bug#12118).
9222 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9223 checking subscripts; problem introduced with the recent
9224 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9225 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9226 since it's used in non-static inline functions now.
9228 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9229 Don't assume buffer size fits in 'int'. Remove unused local.
9231 Use C99-style 'extern inline' if available.
9232 * buffer.h (BUFFER_INLINE):
9233 * category.h (CATEGORY_INLINE):
9234 * character.h (CHARACTER_INLINE):
9235 * charset.h (CHARSET_INLINE):
9236 * composite.h (COMPOSITE_INLINE):
9237 * dispextern.h (DISPEXTERN_INLINE):
9238 * lisp.h (LISP_INLINE):
9239 * systime.h (SYSTIME_INLINE):
9240 New macro, replacing 'static inline' in this header.
9241 * buffer.h, category.h, character.h, charset.h, composite.h:
9242 * dispextern.h, lisp.h, systime.h:
9243 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9244 * alloc.c (LISP_INLINE):
9245 * buffer.c (BUFFER_INLINE):
9246 * category.c (CATEGORY_INLINE):
9247 * character.c (CHARACTER_INLINE):
9248 * charset.c (CHARSET_INLINE):
9249 * composite.c (COMPOSITE_INLINE):
9250 * dispnew.c (DISPEXTERN_INLINE):
9251 * sysdep.c (SYSTIME_INLINE):
9252 Define to EXTERN_INLINE, so that the corresponding functions
9253 are compiled into code.
9254 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9255 (INLINE_HEADER_END): New macros.
9256 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9257 since it's used in non-static inline functions now.
9258 (VALMASK) [!USE_LSB_TAG]: Likewise.
9260 2012-08-02 Glenn Morris <rgm@gnu.org>
9262 * s/: Remove empty directory.
9264 * s/ms-w32.h: Move to ../nt/inc.
9265 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9266 Update for new ms-w32.h location.
9268 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9271 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9273 2012-08-02 Glenn Morris <rgm@gnu.org>
9275 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9276 hard-coding the path separator.
9278 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9280 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9281 This how ASET and AREF are supposed to work, and makes
9282 it easier to think about future improvements. See
9283 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9284 * charset.h (set_charset_attr): New function.
9285 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9286 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9287 (aref_addr): New function. All uses of &AREF(...) changed.
9288 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9289 (set_hash_index): New functions. All lvalue-style uses of
9290 HASH_KEY etc. changed.
9291 * keyboard.c (set_prop): New function. All lvalue-style uses
9294 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9296 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9297 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9298 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9299 * nsfns.m (ns_set_name_as_filename): Likewise.
9300 * nsmenu.m (ns_update_menubar): Likewise.
9301 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9303 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9305 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9306 Adapt to latest changes in field names of the corresponding Lisp
9309 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9311 2012-08-01 Glenn Morris <rgm@gnu.org>
9313 * s/msdos.h: Remove file.
9314 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9315 * Makefile.in (S_FILE): Remove.
9316 (config_h): Remove S_FILE.
9318 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9320 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9321 Remove; moved to nt/config.nt.
9323 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9325 Use INTERNAL_FIELD for conses and overlays.
9326 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9327 Remove obsolete comment.
9329 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9330 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9332 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9334 Use INTERNAL_FIELD for symbols.
9335 * lisp.h (SVAR): New macro. Adjust users.
9336 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9337 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9339 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9341 Use INTERNAL_FIELD for processes.
9342 * process.h (PVAR): New macro. Adjust style.
9343 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9344 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9346 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9348 Use INTERNAL_FIELD for windows.
9349 * window.h (WVAR): New macro.
9350 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9351 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9352 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9353 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9354 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9355 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9357 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9359 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9361 2012-08-01 Glenn Morris <rgm@gnu.org>
9363 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9364 Move to configure.ac.
9366 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9368 * makefile.w32-in (CONFIG_H): Update dependencies.
9369 (CONF_POST_H): New macro.
9371 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9373 2012-07-31 Glenn Morris <rgm@gnu.org>
9375 * Makefile.in (S_FILE): No longer set by configure.
9377 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9379 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9381 * process.h (NULL_DEVICE):
9382 * emacs.c (SEPCHAR):
9383 * editfns.c (USER_FULL_NAME): Let configure set them.
9385 * s/README, s/template.h: Remove files.
9387 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9389 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9390 Move to configure.ac.
9392 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9394 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9395 resulting renaming of 'struct frame' members.
9397 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9399 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9400 after introduction of FVAR.
9402 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9404 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9406 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9407 instead of compositeToPoint.
9408 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9410 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9412 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9414 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9415 * lisp.h (INTERNAL_FIELD): New macro.
9416 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9417 (BVAR): Change to use INTERNAL_FIELD.
9418 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9419 (KVAR): Change to use INTERNAL_FIELD.
9420 * frame.h (FVAR): New macro.
9421 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9422 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9423 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9424 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9425 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9427 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9429 Miscellaneous fixes for non-default X toolkits.
9430 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9431 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9432 Move under #ifdef USE_LUCID.
9433 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9434 definition and usage to avoid warnings.
9436 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9438 * nsterm.m (openFiles): Fix previous checkin.
9440 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9442 * indent.c (compute_motion): Remove unused local.
9444 2012-07-31 Glenn Morris <rgm@gnu.org>
9446 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9448 * conf_post.h [USG5_4]:
9449 Move remaining contents of s/usg5-4-common.h here.
9450 * s/usg5-4-common.h: Remove file.
9452 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9453 * s/irix6-5.h: Remove file.
9455 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9456 * s/darwin.h: Remove file.
9458 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9459 * s/hpux10-20.h: Remove file, which is now empty.
9461 2012-07-30 Glenn Morris <rgm@gnu.org>
9463 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9464 * Makefile.in (config_h): Add conf_post.h.
9465 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9467 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9469 * nsterm.m (ns_do_open_file): New variable.
9470 (ns_term_init): Set ns_do_open_file to YES after run returns.
9471 (openFile, openTempFile, openFileWithoutUI, openFiles):
9472 Open files only if ns_do_open_file.
9474 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9476 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9477 This no-op macro hasn't been needed for many years.
9478 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9480 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9481 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9482 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9483 gdb_make_enums_visible.
9484 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9485 (DIRECTORY_SEP): Now a constant, not a macro.
9487 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9489 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9490 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9492 * w32term.c <w32_keyboard_codepage>: Renamed from
9493 keyboard_codepage and now external. All users changed.
9495 * w32term.h: Add declaration of w32_keyboard_codepage.
9497 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9498 the codepage to translate keys to Unicode. If this argument is
9499 -1, use the value returned by GetConsoleCP. All callers changed.
9501 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9503 Update .PHONY listings in makefiles.
9504 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9505 bootstrap-clean, distclean, maintainer-clean, versioclean,
9508 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9509 This is a bit clearer. Fix some commentary typos.
9511 2012-07-30 Glenn Morris <rgm@gnu.org>
9513 * s/netbsd.h: Let configure include signal.h if needed.
9514 Remove file, which is now empty.
9516 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9517 Let configure set them.
9518 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9519 No more need to undefine.
9521 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9523 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9524 non-single-byte char when adding meta modifier. (Bug#12090)
9526 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9528 Convert safe_call to use variable number of arguments.
9529 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9530 (safe_call2): Fix comment.
9531 * lisp.h (safe_call): Adjust prototype.
9532 * coding.c (encode_coding_object): Change to use safe_call2.
9533 * xfaces.c (merge_face_heights): Change to use safe_call1.
9535 2012-07-30 Glenn Morris <rgm@gnu.org>
9537 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9538 does that unconditionally. Remove file, which is now empty.
9540 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9543 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9545 Export to GDB most of lisp.h's remaining object-like macros.
9546 * lisp.h (min, max): Move earlier, because they're used earlier now.
9547 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9548 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9549 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9550 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9551 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9552 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9553 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9554 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9555 Now constants, for GDB. They need not be macros.
9556 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9557 Now constants, for GDB, as well as macros, for static initializers.
9558 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9559 Move to after the definition of struct Lisp_Char_Table,
9560 since the former now needs that type defined.
9561 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9562 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9563 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9564 New enums, for gdb_make_enums_visible.
9565 (GLYPH_MODE_LINE_FACE): Remove; unused.
9566 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9567 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9568 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9569 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9570 enum maxargs, enum MAX_ALLOCA.
9571 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9572 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9573 no longer needed, now that they are done in lisp.h.
9575 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9577 Cleanup string bytes checking.
9578 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9579 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9580 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9581 (check_sblock, compact_small_strings): Simplify.
9583 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9585 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9586 These macros are confusing and no longer need to be defined, as
9587 the enum values now suffice. All uses replaced with definiens.
9588 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9590 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9592 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9593 ($(BLD)/w32console.$(O)): Update dependencies.
9595 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9597 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9598 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9600 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9602 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9604 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9605 setting sitelisp (Bug#12010).
9607 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9609 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9611 * w32heap.c (cache_system_info):
9612 * w32.c (sys_rename):
9613 * w32proc.c (find_child_console, sys_kill): All users changed.
9615 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9617 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9619 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9621 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9623 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9625 Cleanup statistics calculation in Fgarbage_collect.
9626 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9627 Fix zombies percentage calculation. Simplify elapsed time calculation.
9629 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9631 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9632 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9633 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9634 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9635 (replace_range, replace_range_2, del_range_2): Change to eassert.
9636 * marker.c (byte_char_debug_check): Adjust style.
9638 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9640 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9641 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9642 long-ago-commented-out code that talks about "WIN32".
9643 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9646 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9648 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9649 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9650 Simplify by using alignof.
9651 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9652 * lisp.h: Include <stdalign.h>.
9653 (GCALIGNMENT): New macro and constant.
9654 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9655 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9656 (stdalign): New macro, if not already defined.
9658 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9660 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9661 * w32inevt.c: Include w32inevt.h.
9662 (w32_read_console_input): New inline function, calls either
9663 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9664 w32_console_unicode_input.
9665 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9666 (w32_kbd_patch_key, key_event): Use the codepage returned by
9667 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9668 (key_event): use uChar.UnicodeChar only if
9669 w32_console_unicode_input is non-zero.
9671 * w32console.c: Include w32heap.h.
9672 <w32_console_unicode_input>: New global variable.
9673 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9674 family of Windows, zero otherwise.
9676 * w32inevt.h: Declare w32_console_unicode_input.
9678 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9679 --without-x. (Bug#11742)
9681 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9683 Adjust GDB to reflect pvec_type changes (Bug#12036).
9684 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9685 2012-07-04 changes to pseudovector representation.
9686 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9688 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9690 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9692 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9694 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9696 * alloc.c (listn): Fix the order the arguments are consed onto the
9699 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9700 enumeration constants, as PURE and HEAP are too general, and clash
9701 with other headers and sources, such as gmalloc.c and the
9702 MS-Windows system headers. All users changed.
9704 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9706 Revert last save_excursion_save and save_excursion_restore changes.
9707 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9708 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9710 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9712 Fix recently-introduced typos in Windows port.
9713 Reported by Martin Rudalics <rudalics@gmx.at>.
9714 * w32.c (init_environment): Replace comma with semicolon.
9715 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9717 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9719 Improve GDB symbol export (Bug#12036).
9720 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9721 arms of an 'if', not using conditional expressions; otherwise GDB
9722 complains about the types in the unevaluated arm when the argument
9723 is an integer literal.
9724 (xgetint): Simplify expression.
9725 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9726 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9727 Zaretskii in <http://bugs.gnu.org/12036#13>.
9728 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9729 needed now that we have gdb_make_enums_visible.
9730 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9731 (enum enum_USE_LSB_TAG):
9732 New enum types, packaging up enums that need to be exported to GDB.
9734 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9736 Utility function to make a list from specified amount of objects.
9737 * lisp.h (enum constype): New datatype.
9738 (listn): New prototype.
9739 * alloc.c (listn): New function.
9740 (Fmemory_use_count, syms_of_alloc): Use it.
9741 * buffer.c (syms_of_buffer): Likewise.
9742 * callint.c (syms_of_callint): Likewise.
9743 * charset.c (define_charset_internal): Likewise.
9744 * coding.c (syms_of_coding): Likewise.
9745 * keymap.c (syms_of_keymap): Likewise.
9746 * search.c (syms_of_search): Likewise.
9747 * syntax.c (syms_of_syntax): Likewise.
9748 * w32.c (init_environment): Likewise.
9749 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9750 * xdisp.c (syms_of_xdisp): Likewise.
9751 * xfns.c (syms_of_xfns): Likewise.
9753 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9755 Fast save_excursion_save and save_excursion_restore.
9756 * lisp.h (struct Lisp_Excursion): New data type.
9757 (PVEC_EXCURSION): New pseudovector type.
9758 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9759 to deal with it. Adjust comments.
9760 (init_marker, attach_marker): New prototype.
9761 (unchain_marker): Adjust prototype.
9762 * marker.c (attach_marker): Change to global.
9763 (init_marker): New function.
9764 * alloc.c (Fmake_marker, build_marker): Use it.
9765 (build_marker): More easserts.
9766 (mark_object): Handle struct Lisp_Excursion.
9767 * editfns.c (save_excursion_save, save_excursion_restore):
9768 Reimplement to use struct Lisp_Excursion. Add comments.
9770 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9772 Fix export of symbols to GDB (Bug#12036).
9773 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9774 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9775 emacs.c, as this is a more-suitable home. Had this been done earlier
9776 the fix for 12036 would have avoided some of the problems noted in
9777 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9778 would have been more obvious.
9779 * emacs.c: Do not include <verify.h>; no longer needed.
9780 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9781 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9782 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9783 Remove; now done in lisp.h.
9784 * lisp.h (PUBLISH_TO_GDB): New macro.
9785 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9786 (DATA_SEG_BITS): Use it.
9787 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9788 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9789 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9790 not be usable in #if. This simplifies things.
9792 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9794 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9796 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9798 Simplify export of symbols to GDB (Bug#12036).
9799 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9800 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9801 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9802 Adjust to changes in lisp.h and emacs.c, by using
9803 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9804 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9805 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9806 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9807 instead of gdb_valbits.
9808 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9809 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9810 instead of gdb_array_mark_flag.
9811 (xboolvector): Get size from $->size, not $->header.size.
9812 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9813 (xreload, hook-run, hookpost-run): Remove.
9814 * emacs.c: Include <verify.h>.
9815 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9816 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9818 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9819 (gdb_USE_LSB_TAG): New enum constants.
9820 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9821 Also define these as enum constants, so they're visible to GDB.
9822 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9823 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9824 as constants, so they're visible to GDB.
9825 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9826 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9827 Now enum constants, not macros, so they're visible to GDB.
9828 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9829 more convenient now. All uses changed.
9830 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9831 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9833 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9835 Explicitly free restriction data that are not needed anymore.
9836 * editfns.c (save_restriction_restore): Free restriction data.
9838 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9840 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9841 add argument, tune behavior, and adjust all callers.
9843 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9845 Use typedef for EMACS_INT, EMACS_UINT.
9846 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9847 than macros. This simplifies debugging in the usual case, since
9848 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9849 and it allows expressions involving EMACS_INT casts.
9850 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9852 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9854 * nsterm.m (ns_read_socket): Return early if there is a modal
9857 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9859 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9860 that FOCUS-FRAME can be omitted.
9862 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9864 Adjust buffer text indirection counters at the end of Fkill_buffer.
9865 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9866 buffer is definitely dead. This should really fix an issue reported
9867 by Christoph Scholtes again. (Bug#12007).
9868 (init_buffer_once): Initialize indirection counters of
9869 buffer_defaults and buffer_local_symbols (for sanity and safety).
9871 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9873 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9874 and continuation glyphs on tooltip frames, leave them at zero.
9875 Avoids continued lines in tooltips. (Bug#11832)
9877 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9879 Simplify copy_overlay.
9880 * buffer.c (copy_overlay): Simplify. Use build_marker.
9881 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9883 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9885 * print.c (print_object): Don't crash when a frame's name is nil
9886 or invalid. (Bug#12025)
9888 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9889 it signals an error when a tooltip frame is being created.
9891 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9893 Cleanup miscellaneous objects allocation and initialization.
9894 * alloc.c (allocate_misc): Change to static. Add argument to
9895 specify the subtype. Adjust comment and users.
9896 (build_overlay): New function.
9897 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9898 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9899 (allocate_misc): Remove prototype.
9900 (build_overlay): Add prototype.
9902 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9904 Swap buffer text indirection counters in Fbuffer_swap_text.
9905 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9906 This avoids crash reported by Christoph Scholtes at
9907 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9909 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9911 * nsmenu.m (Popdown_data): New struct.
9912 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9914 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9915 (initWithContentRect): Make imgView and contentView non-static
9916 and autorelease them. Also autorelease img and matrix (Bug#12005).
9917 (dealloc): Remove (Bug#12005).
9919 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9921 Adjust consing_since_gc when objects are explicitly freed.
9922 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9923 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9924 (free_cons, free_misc): Subtract object size from consing_since_gc.
9926 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9928 Simplify and cleanup markers positioning code.
9929 * marker.c (attach_marker): More useful eassert.
9930 (live_buffer, set_marker_internal): New function.
9931 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9932 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9934 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9936 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9937 as it's limited by the amount of memory, not by INT_MAX.
9939 2012-07-21 Eli Zaretskii <eliz@gnu.org>
9941 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9942 in special-event-map. See the discussion at
9943 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9946 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
9947 info.dwItemData. Fixes crashes on 64-bit Windows.
9948 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
9950 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9952 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
9953 (conversationIdentifier): Return value is NSInteger.
9954 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
9956 2012-07-21 Chong Yidong <cyd@gnu.org>
9958 * window.c (decode_any_window): Signal an error if the window is
9959 on a dead frame (Bug#11984).
9961 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9963 Add indirection counting to speed up Fkill_buffer.
9964 * buffer.h (struct buffer): New member.
9965 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9966 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9967 base buffer indirection counter.
9968 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9969 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9970 through buffer list if indirection counter is 0.
9972 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9974 Extend the value returned by Fgarbage_collect with heap statistics.
9975 * alloc.c (Qheap): New symbol.
9976 (syms_of_alloc): DEFSYM it.
9977 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9978 (Fmemory_free): Remove.
9979 (syms_of_alloc): Don't defsubr it.
9980 * buffer.c (Fcompact_buffer): Remove.
9981 (syms_of_buffer): Don't defsubr it.
9983 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9985 Make maybe_gc inline.
9986 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9987 * lisp.h (consing_since_gc, gc_relative_threshold)
9988 (memory_full_cons_threshold): Revert declaration.
9989 (maybe_gc): Remove prototype, define as inline.
9990 * alloc.c: Remove old commented-out code.
9991 (consing_since_gc, gc_relative_threshold)
9992 (memory_full_cons_threshold): Revert to global.
9995 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9997 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9998 * lisp.h (build_unibyte_string): New function.
9999 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10000 * sysdep.c, w32fns.c, xfns.c: Use it.
10001 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10002 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10003 Adjust users accordingly.
10004 * font.h (font_open_by_name): Adjust prototype.
10006 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10008 Cleanup calls to Fgarbage_collect.
10009 * lisp.h (maybe_gc): New prototype.
10010 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10011 Remove declarations.
10012 * alloc.c (maybe_gc): New function.
10013 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10015 * bytecode.c (MAYBE_GC): Use maybe_gc.
10016 * eval.c (eval_sub, Ffuncall): Likewise.
10017 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10018 to avoid dependency from auto-save feature.
10020 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10022 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10023 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10024 'for_each_per_buffer_object_at'.
10025 All uses changed. It's better to use upper-case for macros that
10026 cannot be implemented as functions, to give the reader a clue
10027 that they're special.
10029 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10031 * alloc.c (Fgarbage_collect): Tweak docstring.
10033 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10035 Tweak the value returned from Fgarbage_collect again.
10036 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10037 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10038 Adjust documentation.
10039 (total_vector_bytes): Rename to total_vector_slots, adjust
10041 (total_free_vector_bytes): Rename to total_free_vector_slots,
10043 (Qstring_bytes, Qvector_slots): New symbols.
10044 (syms_of_alloc): DEFSYM them.
10046 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10048 Buffer compaction primitive which may be used from Lisp.
10049 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10050 (syms_of_buffer): Register Fcompact_buffer.
10051 * alloc.c (Fgarbage_collect): Use compact_buffer.
10052 * buffer.h (compact_buffer): New prototype.
10053 (struct buffer_text): New member.
10055 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10057 New macro to iterate over all buffers, miscellaneous cleanups.
10058 * lisp.h (all_buffers): Remove declaration.
10059 * buffer.h (all_buffers): Add declaration, with comment.
10060 (for_each_buffer): New macro.
10061 * alloc.c (Fgarbage_collect, mark_object): Use it.
10062 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10063 (init_buffer): Likewise.
10064 * data.c (Fset_default): Likewise.
10065 * coding.c (code_conversion_restore): Remove redundant check
10067 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10069 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10071 Fix bug that created negative-length intervals.
10072 * intervals.c (merge_interval_right, merge_interval_left):
10073 Do not zero out this interval if it is absorbed by its children,
10074 as this interval's total length doesn't change in that case. See
10075 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10077 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10079 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10080 when invoking (make-bool-vector N t) and N is a positive
10081 multiple of 8 -- the last 8 bits were mistakenly cleared.
10083 Remove some struct layout assumptions in bool vectors.
10084 * alloc.c (bool_header_size): New constant.
10085 (header_size, word_size): Move earlier, as they're now used earlier.
10086 Use 'word_size' in a few more places, where it's appropriate.
10087 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10088 padding before the data member of a bool vector.
10089 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10090 than doing the check by hand with an abort ().
10092 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10094 * eval.c (Fdefvar): Don't check constants since we only set the var if
10095 it's not yet defined anyway (bug#11904).
10097 * lisp.h (last_undo_boundary): Declare new var.
10098 * keyboard.c (command_loop_1): Set it.
10099 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10100 were auto-added by the command loop (bug#11774).
10102 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10104 * w32font.c (Qsymbol): Remove local definition.
10105 (syms_of_w32font): Don't DEFSYM it.
10107 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10109 Fix sweep_vectors to handle large bool vectors correctly.
10110 * alloc.c (sweep_vectors): Account total_vector_bytes for
10111 bool vectors larger than VBLOCK_BYTES_MAX.
10113 2012-07-18 Chong Yidong <cyd@gnu.org>
10115 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10116 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10118 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10120 Return more descriptive data from Fgarbage_collect.
10121 Suggested by Stefan Monnier in
10122 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10123 * alloc.c (bounded_number): New function.
10124 (total_buffers, total_vectors): New variable.
10125 (total_string_size): Rename to total_string_bytes, adjust users.
10126 (total_vector_size): Rename to total_vector_bytes, adjust users.
10127 (sweep_vectors): Account total_vectors and total_vector_bytes.
10128 (Fgarbage_collect): New return value. Adjust documentation.
10129 (gc_sweep): Account total_buffers.
10130 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10131 (VECTOR_SIZE): Remove.
10132 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10133 (Qinterval, Qmisc): New symbols.
10134 (syms_of_data): Initialize them.
10135 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10136 (Qcons, Qbuffer): New declarations.
10138 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10140 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10141 Round up, not down. Improve doc.
10143 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10145 Restore old code in allocate_string_data to avoid Faset breakage.
10146 Reported by Julien Danjou <julien@danjou.info> in
10147 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10148 * alloc.c (allocate_string_data): Restore old code with minor
10149 adjustments, fix comment to explain this subtle issue.
10151 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10153 Remove FILE_SYSTEM_CASE.
10154 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10156 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10157 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10158 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10159 call-process-region passes it through expand-file-name.
10161 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10163 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10165 Fix crash when creating indirect buffer (Bug#11917)
10166 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10167 Don't handle unbound variables specially if non-zero.
10168 (Fbuffer_local_variables): Pass zero.
10169 (clone_per_buffer_values): Pass non-zero.
10171 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10173 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10174 to make the loop interruptible.
10176 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10178 * gnutls.c (emacs_gnutls_handshake): Only retry if
10179 GNUTLS_E_INTERRUPTED.
10181 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10183 Cleanup and convert miscellaneous checks to eassert.
10184 * alloc.c (mark_interval): Fix comment, partially rephrase
10185 old comment from intervals.h (see below).
10186 * intervals.c (find_interval, adjust_intervals_for_insertion)
10187 (delete_interval, adjust_intervals_for_deletion)
10188 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10189 Convert to eassert.
10190 (adjust_intervals_for_insertion, make_new_interval):
10191 Remove obsolete and unused code.
10192 * intervals.h (struct interval): Remove obsolete comment.
10193 * textprotp.c (erase_properties): Remove unused code.
10194 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10195 (Fremove_list_of_text_properties): Convert to eassert.
10197 2012-07-17 Chong Yidong <cyd@gnu.org>
10199 * editfns.c (Finsert_char): Doc fix.
10201 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10203 Fix previous change to make Fmemory_free always accurate.
10204 * alloc.c (make_interval): Update total_free_intervals.
10205 (make_float): Likewise for total_free_floats.
10206 (free_cons, Fcons): Likewise for total_free_conses.
10207 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10208 Likewise for total_free_vector_bytes.
10209 (Fmake_symbol): Likewise for total_free_symbols.
10210 (bytes_free): Remove.
10212 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10214 Simple free memory accounting feature.
10215 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10216 (sweep_vectors): Accumulate size of free vectors.
10217 (Fgarbage_collect): Setup bytes_free.
10218 (Fmemory_free): New function.
10219 (syms_of_alloc): Register it.
10221 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10223 Cleanup overlays checking.
10224 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10225 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10226 eassert and OVERLAYP.
10227 (sort_overlays): Change to use OVERLAYP.
10229 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10231 * editfns.c (Finsert_char): Make it interactive, and make the
10232 second arg optional. Copy interactive spec and docstring from
10235 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10237 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10238 Unlike the other wrapped functions, fabs has an unspecified
10241 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10243 * nsterm.m (keyDown): Interpret flags without left/right bits
10244 as the left key (Bug#11670).
10246 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10248 Remove empty and useless init functions.
10249 * lisp.h (init_character_once, init_fns, init_image)
10250 (init_filelock, init_sound): Remove prototype.
10251 * character.c (init_character_once): Remove.
10252 * filelock.c (init_filelock): Likewise.
10253 * fns.c (init_fns): Likewise.
10254 * image.c (init_image): Likewise.
10255 * sound.c (init_sound): Likewise.
10256 * emacs.c (main): Adjust accordingly.
10258 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10260 * gtkutil.h: Tiny cleanups.
10261 (use_old_gtk_file_dialog): Remove useless declaration.
10262 (xg_uses_old_file_dialog): Add suggested const attribute.
10264 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10266 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10267 (bidi_paragraph_init): Use it to limit search forward for a strong
10268 directional character in abnormally large paragraphs full of
10269 neutral or weak characters. (Bug#11943)
10271 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10273 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10274 the toolbar (Bug#9451).
10275 (xg_make_tool_item): Give the widget event box a transparent
10278 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10280 Cleanup basic allocation variables and functions.
10281 * alloc.c (ignore_warnings, init_intervals, init_float)
10282 (init_cons, init_symbol, init_marker): Remove.
10283 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10284 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10285 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10286 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10287 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10288 (staticidx, init_alloc_once, init_strings, free_ablock):
10289 Remove redundant initialization.
10290 * fns.c (init_weak_hash_tables): Remove.
10291 * lisp.h (init_weak_hash_tables): Remove prototype.
10293 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10295 Use zero_vector where appropriate.
10296 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10298 * lisp.h (zero_vector): New declaration.
10299 * font.c (null_vector): Remove.
10300 (syms_of_font): Remove initialization and staticpro.
10301 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10302 * keymap.c (Faccessible_keymaps): Likewise.
10304 2012-07-15 Leo Liu <sdl.web@gmail.com>
10306 * fringe.c: Fix typo in comments.
10308 2012-07-14 Leo Liu <sdl.web@gmail.com>
10310 * fringe.c: Add a new bitmap exclamation-mark.
10312 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10314 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10316 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10317 (HAVE_MENUS): Don't define, defined by editing config.in with
10319 (GMALLOC_INHIBIT_VALLOC): Don't define.
10320 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10322 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10324 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10326 2012-07-14 Glenn Morris <rgm@gnu.org>
10328 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10329 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10330 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10332 2012-07-13 Glenn Morris <rgm@gnu.org>
10334 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10336 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10337 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10339 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10341 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10342 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10343 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10344 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10346 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10347 as boolean expression.
10348 (x_set_window_size): Remove unused variable toolbar.
10349 (ns_get_color_default, ns_mod_to_lisp): Remove.
10350 (ns_mouse_position): Remove unused variables xchar and ychar.
10351 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10352 (ns_set_vertical_scroll_bar): Remove unused variable count.
10353 (ns_delete_terminal): Remove unused variable i.
10354 (ns_term_init): Remove unused variables r, g and b.
10355 (mouseDown): Remove unused variable window.
10356 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10357 (initFrameFromEmacs): Remove unused variable vbextra.
10358 (mouseEntered): Remove unused variables p and dpyinfo.
10359 (mouseExited): Remove unused variables p and r.
10360 (ns_define_frame_cursor, ns_clear_frame_area)
10361 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10362 (menuDown): Assign [sender tag] to variable and cast the variable.
10364 * nsterm.h (menuDown): Add id as type to argument sender.
10365 (ns_display_info_for_name): Add Lisp_Object argument.
10366 (ns_term_init): Add Lisp_Object argument.
10367 (ns_map_event_to_object): Add void argument.
10368 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10369 prototype with arguments and only declare if __OBJC__.
10370 (nxatoms_of_nsselect): Add void argument.
10371 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10372 (ns_alloc_autorelease_pool): Add void argument.
10373 (ns_release_autorelease_pool): Add void* argument.
10374 (ns_get_defaults_value): Add const char* argument.
10376 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10377 (initFromContents): Use SSDATA where appropriate.
10378 (ns_update_menubar): Add braces to ambigous if-else.
10379 (initWithTitle): Put () around assignment in if statement.
10380 (ns_menu_show): Remove unused variables window and keymap.
10381 (update_frame_tool_bar): Remove unused variable selected_p.
10382 (initWithContentRect): Remove unused variable this_cmd_name.
10384 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10386 (setXBMColor): Remove unused variable len.
10387 (setPixmapData): Put () around assignment in loop statement.
10389 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10390 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10392 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10393 around assignment in loop statement.
10394 (nsfont_open): Remove unused variable i.
10395 (nsfont_open): Remove unused variable len.
10396 (nsfont_draw): Remove unused variable cs.
10398 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10399 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10400 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10401 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10402 (Fns_font_name, Fns_perform_service)
10403 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10404 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10405 (ns_set_name): Remove unused variable view.
10406 (x_set_menu_bar_lines): Remove unused variable olines.
10407 (x_set_tool_bar_lines): Remove unused variable root_window.
10408 (Fns_list_colors): Put () around assignment in while statement.
10409 (Fns_perform_service): Remove unused variable len.
10410 (Fns_display_usable_bounds): Remove unused variable top.
10411 (syms_of_nsfns): Remove unused variable i.
10413 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10414 memcpy (Bug#11907).
10416 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10418 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10419 and free it with DestroyExceptionInfo (Bug#11558).
10421 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10423 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10424 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10425 Set here, not in nt/config.nt.
10427 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10429 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10430 cursor overflow into the last glyph on display line when the right
10431 fringe is off. (Bug#11832)
10433 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10435 * xdisp.c (produce_special_glyphs): Now static.
10436 * dispextern.h (produce_special_glyphs): Remove decl.
10438 2012-07-13 Glenn Morris <rgm@gnu.org>
10440 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10441 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10443 * s/usg5-4-common.h (USG, USG5):
10444 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10445 * s/sol2-6.h (SOLARIS2):
10446 * s/irix6-5.h (IRIX6_5):
10447 * s/hpux10-20.h (USG, USG5, HPUX):
10448 * s/gnu-linux.h (USG, GNU_LINUX):
10449 * s/freebsd.h (BSD_SYSTEM):
10450 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10451 * s/cygwin.h (CYGWIN):
10452 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10453 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10455 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10457 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10459 2012-07-13 Glenn Morris <rgm@gnu.org>
10461 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10463 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10465 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10466 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10468 2012-07-12 Glenn Morris <rgm@gnu.org>
10470 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10472 * process.c (init_process_emacs): Rename from init_process.
10473 The old name is also the name of a Mach system call.
10474 * lisp.h, emacs.c: Update for this name change.
10475 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10478 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10480 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10481 memmove call that removes glyphs covered by the left truncation
10482 glyph. Improve commentary.
10483 (display_line): Fix display of continuation glyphs on GUI frames
10484 when the right fringe is turned off and variable-size fonts are
10485 used in the window. Move the code that appends a stretch glyph to
10486 produce_special_glyphs, so that it could be used for truncation
10487 and continuation glyphs alike.
10488 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10489 glyph of a suitably computed width, to align the special glyphs at
10490 the window margin. Code moved from display_line. (Bug#11832)
10492 2012-07-12 Glenn Morris <rgm@gnu.org>
10494 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10496 * s/gnu-linux.h, s/hpux10-20.h:
10497 Do not unconditionally define HAVE_XRMSETDATABASE.
10499 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10501 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10503 Fix typos that broke OS X build.
10504 Reported by Randal L. Schwartz in
10505 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10506 * nsterm.m (ns_timeout): Add missing local decl.
10507 (ns_get_color): snprintf -> sprintf, to fix typo.
10509 2012-07-12 Glenn Morris <rgm@gnu.org>
10511 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10512 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10513 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10514 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10516 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10517 Move PTY_OPEN to configure.
10519 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10520 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10521 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10523 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10525 Use empty_unibyte_string where applicable.
10526 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10527 * lread.c (read1): Likewise.
10528 * xsettings.c (syms_of_xsettings): Likewise.
10530 2012-07-12 Glenn Morris <rgm@gnu.org>
10532 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10533 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10534 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10535 * s/hpux10-20.h (RUN_TIME_REMAP):
10536 * s/bsd-common.h (TABDLY): Move to configure.
10538 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10540 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10542 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10543 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10545 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10547 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10548 * s/template.h: Move NARROWPROTO to configure.
10550 2012-07-11 Glenn Morris <rgm@gnu.org>
10552 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10553 unused since 2011-01-17 change to systty.h.
10555 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10556 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10557 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10559 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10561 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10563 2012-07-11 Glenn Morris <rgm@gnu.org>
10565 * s/darwin.h, s/gnu-linux.h, s/template.h:
10566 Move INTERRUPT_INPUT to configure.
10568 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10570 Minor adjustments to interning code.
10571 * lisp.h (intern, intern_c_string): Redefine as static inline
10572 wrappers for intern_1 and intern_c_string_1, respectively.
10573 (intern_1, intern_c_string_1): Rename prototypes.
10574 * lread.c (intern_1, intern_c_string_1, oblookup):
10575 Simplify Vobarray checking.
10576 * font.c (font_intern_prop): Likewise. Adjust comment.
10577 * w32font.c (intern_font_name): Likewise.
10579 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10581 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10583 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10584 of Fcar/Fcdr if possible.
10585 * font.c (check_otf_features): Likewise.
10586 * fontset.c (Fnew_fontset): Likewise.
10587 * gnutls.c (Fgnutls_boot): Likewise.
10588 * minibuf.c (read_minibuf): Likewise.
10589 * msdos.c (IT_set_frame_parameters): Likewise.
10590 * xmenu.c (Fx_popup_dialog): Likewise.
10591 * w32menu.c (Fx_popup_dialog): Likewise.
10593 2012-07-11 Glenn Morris <rgm@gnu.org>
10595 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10596 since nothing has defined it on these platforms.
10598 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10599 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10601 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10602 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10603 Move CLASH_DETECTION to configure.
10605 * s/gnu.h: Remove file, which is now empty.
10607 * s/gnu.h, s/gnu-linux.h:
10608 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10610 2012-07-11 John Wiegley <johnw@newartisans.com>
10612 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10613 function attribute, so we only use it if it exists in the
10616 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10618 Avoid call to strlen in fast_c_string_match_ignore_case.
10619 * search.c (fast_c_string_match_ignore_case): Change to use
10620 length argument. Adjust users accordingly.
10621 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10623 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10625 Assume mkdir, rmdir.
10626 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10627 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10630 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10633 * s/hpux10-20.h (HAVE_PERROR): Remove.
10634 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10635 Remove dummy definition, as this problem was obsolete long ago.
10638 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10640 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10642 Avoid calls to strlen in font processing functions.
10643 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10644 (font_open_by_name): Change to use length argument.
10645 Adjust users accordingly.
10646 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10648 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10649 Change to return ptrdiff_t.
10650 (xfont_list_pattern, xfont_match): Use length returned by
10651 xfont_decode_coding_xlfd.
10652 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10654 2012-07-11 Glenn Morris <rgm@gnu.org>
10656 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10657 Move DONT_REOPEN_PTY to configure.
10659 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10660 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10662 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10664 Remove "#define unix" that is no longer needed (Bug#11905).
10665 * s/aix4-2.h (unix): Remove; no longer needed.
10667 EMACS_TIME simplification (Bug#11875).
10668 This replaces macros (which typically do not work in GDB)
10669 with functions, typedefs and enums, making the code easier to debug.
10670 The functional style also makes code easier to read and maintain.
10671 * systime.h: Include <sys/time.h> on all hosts, not just if
10672 WINDOWSNT, since 'struct timeval' is needed in general.
10673 (EMACS_TIME): Now a typedef, not a macro.
10674 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10676 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10677 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10678 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10679 (EMACS_TIME_LE): Now functions, not macros.
10680 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10681 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10682 which are not functions. All uses rewritten to use:
10683 (make_emacs_time): New function.
10684 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10685 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10686 not functions. All uses rewritten to use the following, respectively:
10687 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10688 (add_emacs_time, sub_emacs_time): New functions.
10689 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10690 * fileio.c (Fcopy_file):
10691 * xterm.c (XTflash): Get the current time closer to when it's used.
10692 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10694 * bytecode.c (targets): Suppress -Woverride-init warnings.
10696 Simplify by avoiding confusing use of strncpy etc.
10697 * doc.c (Fsnarf_documentation):
10698 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10699 * frame.c (Fmake_terminal_frame):
10700 * gtkutil.c (get_utf8_string):
10702 * nsmenu.m (ns_update_menubar):
10703 * regex.c (regerror):
10704 Prefer memcpy to strncpy and strncat when either will do.
10705 * fileio.c (Fsubstitute_in_file_name):
10706 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10707 (menu_separator_name_p):
10708 * nsmenu.m (ns_update_menubar):
10709 Prefer memcmp to strncmp when either will do.
10710 * nsterm.m: Include <ftoastr.h>.
10712 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10713 Prefer snprintf to strncpy.
10714 * nsterm.m (ns_term_init):
10715 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10716 * nsterm.m (ns_term_init):
10717 Avoid the need for strncpy, by using build_string or
10718 make_unibyte_string directly. Use dtoastr, not snprintf.
10719 * process.c (Fmake_network_process): Diagnose service names that
10720 are too long, rather than silently truncating them or creating
10721 non-null-terminated names.
10722 (Fnetwork_interface_info): Likewise, for interface names.
10723 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10724 Prefer sprintf to strncat.
10725 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10726 Prefer vsnprintf to vsprintf + strncpy.
10728 2012-07-10 Glenn Morris <rgm@gnu.org>
10730 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10731 Clarify fallback case.
10733 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10735 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10736 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10737 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10738 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10739 where argument type is known to be a Lisp_Cons.
10741 2012-07-10 Tom Tromey <tromey@redhat.com>
10743 * bytecode.c (BYTE_CODE_THREADED): New macro.
10744 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10745 (enum byte_code_op): New type.
10746 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10747 (exec_byte_code): Use them. Use token threading when applicable.
10749 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10751 Optimize pure C strings initialization.
10752 * lisp.h (make_pure_string): Fix prototype.
10753 (build_pure_c_string): New function, defined as static inline. This
10754 provides a better opportunity to optimize away calls to strlen when
10755 the function is called with compile-time constant argument.
10756 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10757 argument, adjust users accordingly. Use build_pure_c_string where
10759 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10760 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10761 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10763 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10765 Avoid calls to strlen in miscellaneous functions.
10766 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10767 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10768 * lread.c (openp): Likewise.
10770 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10772 Avoid calls to strlen in path processing functions.
10773 * fileio.c (file_name_as_directory): Add comment. Change to add
10774 srclen argument and return the length of result. Adjust users
10776 (directory_file_name): Fix comment. Change to add srclen argument,
10777 swap 1st and 2nd arguments to obey the common convention.
10778 Adjust users accordingly.
10779 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10781 2012-07-10 Glenn Morris <rgm@gnu.org>
10783 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10784 Move PENDING_OUTPUT_COUNT definition to configure.
10786 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10787 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10788 * s/gnu.h (DATA_START): Move definitions to configure.
10790 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10791 We include usg5-4-common.h, which defines them both.
10793 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10794 O_RDONLY already includes it).
10796 Stop ns builds setting the EMACSLOADPATH environment variable.
10797 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10798 Now it does not set EMACSLOADPATH, just returns the load-path string.
10799 * nsterm.h: Update accordingly.
10800 * lread.c [HAVE_NS]: Include nsterm.h.
10801 (init_lread) [HAVE_NS]: Use ns_load_path.
10802 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10804 2012-07-09 Glenn Morris <rgm@gnu.org>
10806 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10807 since the included bsd-common.h does so.
10809 Stop ns builds setting the EMACSPATH environment variable.
10810 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10811 (ns_init_paths): Do not set EMACSPATH.
10812 * nsterm.h (ns_exec_path): Add it.
10813 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10816 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10818 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10820 * process.c (wait_reading_process_output): 'waitchannels' was unset
10821 when read_kbd || !NILP (wait_for_cell); fix this.
10823 Add GCC-style 'const' attribute to functions that can use it.
10824 * character.h (char_resolve_modifier_mask):
10825 * keyboard.h (make_ctrl_char):
10826 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10827 (init_character_once, next_almost_prime, init_fns, init_image)
10828 (flush_pending_output, init_sound):
10829 * mem-limits.h (start_of_data):
10830 * menu.h (finish_menu_items):
10831 Add ATTRIBUTE_CONST.
10832 * emacs.c (DEFINE_DUMMY_FUNCTION):
10833 Declare the dummy function with ATTRIBUTE_CONST.
10834 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10835 Add decls with ATTRIBUTE_CONST.
10837 Minor improvements to make_formatted_string.
10838 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10839 where int is good enough, as vsprintf returns an int.
10840 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10842 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10844 Use make_formatted_string to avoid double length calculation.
10845 * lisp.h (make_formatted_string): New prototype.
10846 * alloc.c (make_formatted_string): New function.
10847 * buffer.c (Fgenerate_new_buffer_name): Use it.
10848 * dbusbind.c (syms_of_dbusbind): Likewise.
10849 * editfns.c (Fcurrent_time_zone): Likewise.
10850 * filelock.c (get_boot_time): Likewise.
10851 * frame.c (make_terminal_frame, set_term_frame_name)
10852 (x_report_frame_params): Likewise.
10853 * image.c (gs_load): Likewise.
10854 * minibuf.c (get_minibuffer): Likewise.
10855 * msdos.c (dos_set_window_size): Likewise.
10856 * process.c (make_process): Likewise.
10857 * xdisp.c (ensure_echo_area_buffers): Likewise.
10858 * xsettings.c (apply_xft_settings): Likewise.
10860 2012-07-09 Glenn Morris <rgm@gnu.org>
10862 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10863 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10864 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10865 * nsterm.h (ns_etc_directory): Add it.
10866 * callproc.c [HAVE_NS]: Include nsterm.h.
10867 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10869 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10871 Move marker debugging code under MARKER_DEBUG.
10872 * marker.c (MARKER_DEBUG): Move marker debugging code under
10873 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10874 for bootstrap with --enable-checking (~3x slowdown reported
10875 by Juanma Barranquero <lekktu@gmail.com>).
10876 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10878 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10880 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10881 See <http://bugs.gnu.org/11825#29>.
10883 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10885 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10886 has no font, use the frame's font. (Bug#11813)
10887 (display_line): Add commentary about displaying truncation glyphs
10889 (produce_special_glyphs): Move here from term.c.
10891 * term.c (produce_special_glyphs): Move to xdisp.c.
10893 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10896 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10898 * xdisp.c (display_line): Avoid warning about implicit declaration
10901 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10903 * lisp.h: Remove empty conditional.
10905 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10907 * lread.c (load_path_check): Now static.
10909 Fix some minor --with-ns problems found by static checking.
10910 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10911 (x_set_font) [!HAVE_X_WINDOWS]:
10912 * image.c (xpm_load_image) [HAVE_NS]:
10913 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10914 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10915 Remove unused local.
10916 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10917 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10918 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10919 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10920 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10921 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10922 Fix pointer signedness problem.
10923 * xfaces.c (FRAME_X_FONT_TABLE):
10924 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10926 2012-07-07 Glenn Morris <rgm@gnu.org>
10928 * lread.c (load_path_check): New function, split from init_lread.
10929 (init_lread): Reorganize. Motivation:
10930 If EMACSLOADPATH is set, check/warn about that rather than the
10931 defaults, which we are not going to use. Hence we can remove
10932 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10933 Don't warn if site-lisp directories are missing.
10934 If not installed, start from a blank load-path, since
10935 PATH_LOADSEARCH refers to the eventual installation directories.
10937 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10939 Support truncation and continuation glyphs on GUI frames, when
10940 fringes are disabled. (Bug#11832)
10941 * xdisp.c (init_iterator): Get dimensions of truncation and
10942 continuation glyphs even if on GUI frames.
10943 Adjust it->last_visible_x on GUI frames when the left or right fringes,
10944 or both, are absent.
10945 (start_display, move_it_in_display_line_to): Handle the case of a
10946 GUI frame without a fringe to display continuation or truncation
10948 (insert_left_trunc_glyphs): Support GUI frames: make sure
10949 truncation glyphs overwrite enough glyphs from the current line to
10950 have sufficient space in pixels.
10951 (display_line): Support truncation and continuation glyphs on GUI
10952 frames. If some spare pixels are left on the line after inserting
10953 the truncation glyphs, fill that space with a stretch glyph of a
10954 suitably computed width.
10956 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10957 produce_glyphs, to support GUI sessions.
10959 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10961 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10963 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10965 Do not require float-time's arg to fit in time_t (Bug#11825).
10966 This works better on hosts where time_t is unsigned, and where
10967 float-time is applied to the (negative) difference between two times.
10968 * editfns.c (decode_time_components): Last arg is now double *,
10969 not int *, and means to store all the result as a double, without
10970 worrying about whether the seconds part fits in time_t.
10971 All callers changed.
10972 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10973 All callers changed.
10974 (Ffloat_time): Do not fail merely because the specified time falls
10975 outside of time_t range.
10977 2012-07-07 Glenn Morris <rgm@gnu.org>
10979 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10980 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10981 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10983 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
10985 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10986 Update dependencies.
10988 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10990 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10992 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10993 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10994 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10995 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10996 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10997 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10999 * xfont.c (compare_font_names): Redo to omit the need for casts.
11001 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11003 * xfns.c (Fx_change_window_property): Doc fix.
11004 * w32fns.c (Fx_change_window_property): Doc fix.
11006 * w32fns.c (Fx_window_property): Accept the same arguments as the
11007 X Windows version. Doc fix.
11008 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11010 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11011 Eli Zaretskii <eliz@gnu.org>
11013 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11014 Windows-specific code from nt/config.nt moved here.
11015 Obsolete settings removed.
11017 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11019 * process.c: Avoid unnecessary calls to gettime.
11020 (wait_reading_process_output): Don't get the time of day
11021 when gobbling data immediately and not waiting, as there's no need
11022 for it in that case. This removes a FIXME.
11024 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11026 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11027 is defined (Bug#11768).
11029 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11031 Fix marker debugging code.
11032 * marker.c (byte_char_debug_check): Do not perform the check
11033 if buffer is not multibyte.
11034 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11035 Call byte_char_debug_check with correct arguments.
11037 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11039 Compile marker debugging code only if ENABLE_CHECKING is defined.
11040 * marker.c (byte_char_debug_check, count_markers):
11041 Use only if ENABLE_CHECKING is defined.
11042 (byte_debug_flag): Remove.
11043 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11044 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11046 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11048 Avoid code repetition in marker-related functions.
11049 * marker.c (attach_marker): New function.
11050 (Fset_marker, set_marker_restricted, set_marker_both)
11051 (set_marker_restricted_both): Use it.
11052 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11053 Consistently rename charno to charpos.
11054 (marker_position): Add eassert.
11055 (marker_byte_position): Convert to eassert.
11057 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11059 Simplify list operations in unchain_overlay and unchain_marker.
11060 * buffer.c (unchain_overlay): Simplify. Add comment.
11061 * marker.c (unchain_marker): Simplify. Fix comments.
11063 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11065 Introduce fast path for the widely used marker operation.
11066 * alloc.c (build_marker): New function.
11067 * lisp.h (build_marker): New prototype.
11068 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11069 * composite.c (autocmp_chars): Likewise.
11070 * editfns.c (buildmark): Remove.
11071 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11072 (save_restriction_save): Use build_marker.
11073 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11074 * window.c (save_window_save): Likewise.
11076 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11078 Do not use Fdelete_overlay in delete_all_overlays
11079 to avoid redundant calls to unchain_overlay.
11080 * buffer.c (drop_overlay): New function.
11081 (delete_all_overlays, Fdelete_overlay): Use it.
11082 * minibuf.c (get_minibuffer): Fix comment.
11084 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11086 Port to OpenBSD 5.1 amd64.
11087 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11088 This is needed for OpenBSD, and should be harmless on all BSD systems.
11089 Also, include <sys/sysctl.h>, as it should be available on all
11090 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11091 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11092 use p_pid member, not kp_proc.pid.
11094 2012-07-06 Glenn Morris <rgm@gnu.org>
11096 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11098 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11100 More xmalloc and related cleanup.
11101 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11102 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11103 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11104 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11105 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11106 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11107 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11108 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11109 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11111 Omit needless casts involving void * pointers and allocation.
11112 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11113 as the former is more robust if P's type is changed.
11114 Prefer xzalloc to xmalloc + memset 0.
11115 Simplify malloc-or-realloc to realloc.
11116 Don't worry about xmalloc returning a null pointer.
11117 Prefer xstrdup to xmalloc + strcpy.
11118 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11120 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11121 alloca of a constant.
11123 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11125 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11126 hscroll is larger than the line width. Fixes long and futile
11127 looping inside extend_face_to_end_of_line (on a TTY) producing
11128 glyphs that are not needed and thrown away.
11130 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11132 * marker.c (set_marker_restricted_both): Simplify by using
11135 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11137 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11139 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11141 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11142 not defined (Bug#11768).
11143 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11144 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11145 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11146 followed by gtk_box_set_homogeneous (Bug#11768).
11147 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11148 (update_theme_scrollbar_width, xg_create_scroll_bar):
11149 Use gtk_scrollbar_new (Bug#11768).
11150 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11151 (is_box_type): New function (Bug#11768).
11152 (xg_tool_item_stale_p): Call is_box_type.
11153 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11154 with default display (Bug#11768).
11156 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11158 * xdisp.c (window_hscroll_limited): New function.
11159 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11160 coordinates when window's hscroll is set to insanely large
11161 values. (Bug#11857)
11163 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11165 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11166 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11168 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11171 * lisp.h (xzalloc): New prototype. Omit needless casts.
11172 * alloc.c (xzalloc): New function. Omit needless casts.
11173 * charset.c: Omit needless casts. Convert all calls to
11174 xmalloc with following memset to xzalloc.
11175 * dispnew.c: Likewise.
11176 * fringe.c: Likewise.
11177 * image.c: Likewise.
11178 * sound.c: Likewise.
11179 * term.c: Likewise.
11180 * w32fns.c: Likewise.
11181 * w32font.c: Likewise.
11182 * w32term.c: Likewise.
11183 * xfaces.c: Likewise.
11184 * xfns.c: Likewise.
11185 * xterm.c: Likewise.
11186 * atimer.c: Omit needless casts.
11187 * buffer.c: Likewise.
11188 * callproc.c: Likewise.
11190 * coding.c: Likewise.
11191 * composite.c: Likewise.
11193 * doprnt.c: Likewise.
11194 * editfns.c: Likewise.
11195 * emacs.c: Likewise.
11196 * eval.c: Likewise.
11197 * filelock.c: Likewise.
11199 * gtkutil.c: Likewise.
11200 * keyboard.c: Likewise.
11201 * lisp.h: Likewise.
11202 * lread.c: Likewise.
11203 * minibuf.c: Likewise.
11204 * msdos.c: Likewise.
11205 * print.c: Likewise.
11206 * process.c: Likewise.
11207 * region-cache.c: Likewise.
11208 * search.c: Likewise.
11209 * sysdep.c: Likewise.
11210 * termcap.c: Likewise.
11211 * terminal.c: Likewise.
11212 * tparam.c: Likewise.
11213 * w16select.c: Likewise.
11215 * w32reg.c: Likewise.
11216 * w32select.c: Likewise.
11217 * w32uniscribe.c: Likewise.
11218 * widget.c: Likewise.
11219 * xdisp.c: Likewise.
11220 * xmenu.c: Likewise.
11221 * xrdb.c: Likewise.
11222 * xselect.c: Likewise.
11224 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11226 * fileio.c (time_error_value): Check the right error number.
11227 Problem reported by Troels Nielsen in
11228 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11230 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11232 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11233 This should be fixed in a better way; see Eli Zaretskii in
11234 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11235 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11237 * fileio.c (time_error_value): Rename from special_mtime.
11238 The old name's problems were noted by Eli Zaretskii in
11239 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11241 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11242 This variable's comment says Emacs needs at least one GDB-visible
11243 symbol of type enum pvec_type, to work around GDB problems.
11244 The symbol's value doesn't matter.
11246 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11247 that causes compilation to fail on pre-C99 compilers.
11249 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11251 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11252 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11254 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11256 * buffer.c (init_buffer_once): Fix initialization of
11257 headers for buffer_defaults and buffer_local_symbols.
11258 Reported by Juanma Barranquero <lekktu@gmail.com>.
11260 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11262 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11263 * lisp.h (enum pvec_type): Use fewer bits.
11264 (PSEUDOVECTOR_SIZE_BITS): New constant.
11265 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11266 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11267 change in pvec_type.
11268 (PSEUDOVECTOR_TYPEP): New macro.
11269 (TYPED_PSEUDOVECTORP): Use it.
11270 * fns.c (internal_equal): Adapt code to extract pvectype.
11271 * emacs.c (gdb_pvec_type): Update type.
11272 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11273 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11274 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11275 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11276 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11277 abusing vector->header.next.nbytes.
11278 (live_vector_p): Use PVEC_TYPE.
11279 (mark_object): Adapt code to extract pvectype. Use switch.
11281 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11283 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11284 Tighten new eassert a bit.
11286 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11288 Fix compilation with --enable-gcc-warnings and -O1
11289 optimization level.
11290 * doprnt.c (doprnt): Change type of tem to int, initialize
11291 to avoid compiler warning. Add eassert.
11292 * search.c (simple_search): Initialize match_byte to avoid
11293 compiler warning. Add eassert.
11295 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11297 Avoid weird behavior with large horizontal scrolls.
11298 Without this change, for example, large hscroll values would
11299 mess up Emacs's display on Fedora 15 x86, presumably due to
11300 overflows in int calculations in the display code.
11301 Also, if buffers had long lines, Emacs would freeze.
11302 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11303 (set_window_hscroll): New function, containing the old guts of
11304 Fset_window_hscroll. Return the clipped value.
11305 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11306 This avoids the need to check against PTRDIFF_MAX.
11308 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11310 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11312 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11314 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11316 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11317 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11318 since GCC 4.4.6 issues a bogus warning for them.
11320 Fix bugs in file timestamp newness comparisons.
11321 * fileio.c (Ffile_newer_than_file_p):
11322 * lread.c (Fload): Use full timestamp resolution of files,
11323 not just the 1-second resolution, so that files that are only
11324 slightly newer still count as newer.
11325 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11326 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11328 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11330 * fileio.c: Improve handling of file time marker. (Bug#11852)
11331 (special_mtime): New function.
11332 (Finsert_file_contents, Fverify_visited_file_modtime):
11333 Use it to set special mtime values consistently.
11335 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11337 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11338 marker for non-existing file. (Bug#11852)
11340 2012-07-03 Glenn Morris <rgm@gnu.org>
11342 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11343 and did not make it into globals.h).
11345 2012-07-03 Tom Tromey <tromey@redhat.com>
11347 * window.c (Fset_window_margins, Fset_window_fringes)
11348 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11349 * textprop.c (Fprevious_property_change): No longer static.
11350 * syntax.c (Fsyntax_table_p): No longer static.
11351 * process.c (Fget_process, Fprocess_datagram_address): No longer
11353 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11354 * keyboard.c (Fcommand_execute): No longer static.
11356 * insdel.c (Fcombine_after_change_execute): No longer static.
11357 * image.c (Finit_image_library): No longer static.
11358 * fileio.c (Fmake_symbolic_link): No longer static.
11359 * eval.c (Ffetch_bytecode): No longer static.
11360 * editfns.c (Fuser_full_name): No longer static.
11361 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11363 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11365 * dired.c (Ffile_attributes): No longer static.
11366 * composite.c (Fcomposition_get_gstring): No longer static.
11367 * callproc.c (Fgetenv_internal): No longer static.
11369 * ccl.h: Remove EXFUNs.
11370 * buffer.h: Remove EXFUNs.
11371 * dispextern.h: Remove EXFUNs.
11372 * intervals.h: Remove EXFUNs.
11373 * fontset.h: Remove EXFUN.
11374 * font.h: Remove EXFUNs.
11375 * dosfns.c (system_process_attributes): Remove EXFUN.
11376 * keymap.h: Remove EXFUNs.
11377 * lisp.h: Remove EXFUNs.
11378 * w32term.h: Remove EXFUNs.
11379 * window.h: Remove EXFUNs.
11380 * xsettings.h: Remove EXFUN.
11381 * xterm.h: Remove EXFUN.
11383 2012-07-03 Glenn Morris <rgm@gnu.org>
11385 * lisp.h (Frandom): Make it visible to C.
11386 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11387 buffer for invisible buffers. (Bug#1229)
11389 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11391 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11392 values which aren't power of 2.
11393 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11394 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11397 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11399 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11401 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11403 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11405 * alloc.c (allocate_vector_block): Remove redundant
11406 calls to mallopt if DOUG_LEA_MALLOC is defined.
11407 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11408 avoid calls to mallopt if zero_vector is returned.
11410 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11412 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11413 is enabled, avoid dereferencing NULL current_sblock if
11416 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11418 Cleanup basic buffer management.
11419 * buffer.h (struct buffer): Change layout to use generic vector
11420 marking code. Fix some comments. Change type of 'clip_changed'
11421 to bitfield. Remove unused #ifndef old.
11422 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11423 (GET_OVERLAYS_AT): Fix indentation.
11424 (for_each_per_buffer_object_at): New macro.
11425 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11426 (Fbuffer_local_variables): Use it.
11427 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11428 * alloc.c (allocate_buffer): Adjust to match new layout of
11429 struct buffer. Fix comment.
11430 (mark_overlay): New function.
11431 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11432 Lisp area of struct buffer.
11433 (mark_object): Use it. Adjust marking of misc objects
11434 and related comments.
11436 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11438 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11439 wrapper that is not needed because the wrapped code is a no-op (zero
11440 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11441 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11443 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11445 * alloc.c (mark_buffer): Simplify. Remove prototype.
11446 (mark_object): Add comment. Reorganize marking of vector-like
11447 objects. Use CHECK_LIVE for all vector-like objects except buffers
11448 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11449 Avoid redundant calls to mark_vectorlike for bool vectors.
11451 2012-06-30 Glenn Morris <rgm@gnu.org>
11453 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11455 * epaths.in (PATH_SITELOADSEARCH): New.
11456 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11457 This is rather than relying on --enable-locallisppath elements
11458 having "site-lisp" in their names. (Bug#10208#25, 11658)
11460 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11462 * w32proc.c (sys_select): Accept and ignore one more argument.
11464 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11466 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11467 (pselect) [!MS_DOS]: Redirect to sys_select.
11469 * sysdep.c: Don't include dos.h and dosfns.h.
11471 * process.c (sys_select):
11472 * msdos.c (sys_select): Accept one more argument and ignore it.
11474 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11475 adapt data types and code to that.
11478 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11479 which clashes with the gnulib function of the same name.
11481 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11483 * font.c (font_style_to_value, font_style_symbolic)
11484 (font_prop_validate_style): Add type checks for values in
11487 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11489 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11492 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11494 * xdisp.c (try_window_id): Undo last change.
11496 * w32.c (getwd): Adjust commentary about startup_dir.
11497 (init_environment): Always call sys_access, even in non-MSVC
11498 builds. Don't chdir to the directory of the Emacs executable.
11499 This undoes code from 1997 which was justified by the need to
11500 "avoid conflicts when removing and renaming directories". But its
11501 downside was that every relative file name was being interpreted
11502 relative to the directory of the Emacs executable, which can never
11503 be TRT. In particular, it broke sys_access when called with
11504 relative file names.
11505 (sys_access): Map GetLastError to errno.
11507 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11509 * window.h (struct window): Change type of 'fringes_outside_margins'
11510 to bitfield. Fix comment. Adjust users accordingly.
11511 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11513 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11516 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11518 * gnutls.c (emacs_gnutls_handshake):
11519 Add QUIT to make the loop interruptible.
11521 2012-06-29 Glenn Morris <rgm@gnu.org>
11523 * charset.c (init_charset): Make lack of etc/charsets fatal.
11525 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11527 * editfns.c (region_limit): Fix type mismatch.
11529 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11531 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11532 undefined. Convert from xassert to eassert.
11533 * nsmenu.m: Convert from xassert to eassert.
11534 * nsterm.m: Likewise.
11536 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11538 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11540 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11542 Avoid integer overflow on scroll-left and scroll-right.
11543 * window.c (HSCROLL_MAX): New macro.
11544 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11545 overflow when requested scroll falls outside ptrdiff_t range.
11547 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11549 * window.h (struct window): Change type of 'hscroll',
11550 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11551 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11552 Adjust users accordingly.
11553 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11554 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11555 from EMACS_INT to ptrdiff_t.
11556 (make_window): Omit redundant initialization.
11558 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11560 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11562 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11564 * window.h (struct window): Change type of 'use_time' and
11565 'sequence_number' from Lisp_Object to int.
11566 * frame.c (make_frame): Adjust users accordingly.
11567 * print.c (print_object): Likewise.
11568 * window.c (select_window, Fwindow_use_time, make_parent_window)
11569 (make_window): Likewise.
11571 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11573 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11574 enabled with --enable-checking=[all,glyphs] configure option.
11575 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11576 adjust comments accordingly.
11577 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11578 undefined, adjust comments accordingly.
11579 * image.c: Likewise.
11580 * scroll.c: Likewise.
11581 * w32fns.c: Likewise.
11582 * w32term.c: Likewise.
11583 * xdisp.c: Likewise.
11584 * xfaces.c: Likewise.
11585 * xfns.c: Likewise.
11586 * xterm.c: Likewise.
11588 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11590 Generalize run-time debugging checks.
11591 * dispextern.h (XASSERTS): Remove.
11592 * fontset.c (xassert): Remove.
11593 Convert from xassert to eassert.
11594 * alloc.c: Convert from xassert to eassert.
11595 * bidi.c: Likewise.
11596 * dispnew.c: Likewise.
11598 * fringe.c: Likewise.
11599 * ftfont.c: Likewise.
11600 * gtkutil.c: Likewise.
11601 * image.c: Likewise.
11602 * keyboard.c: Likewise.
11603 * menu.c: Likewise.
11604 * process.c: Likewise.
11605 * scroll.c: Likewise.
11606 * sound.c: Likewise.
11607 * term.c: Likewise.
11608 * w32console.c: Likewise.
11609 * w32fns.c: Likewise.
11610 * w32term.c: Likewise.
11611 * window.c: Likewise.
11612 * xdisp.c: Likewise.
11613 * xfaces.c: Likewise.
11614 * xfns.c: Likewise.
11615 * xselect.c: Likewise.
11616 * xterm.c: Likewise.
11618 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11620 * fns.c (maybe_resize_hash_table): Output message when growing the
11623 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11625 * alloc.c (allocate_string_data): Remove dead code.
11626 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11627 avoid GCC warning about unused macro.
11629 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11631 * alloc.c (allocate_string): Omit intervals initialization.
11632 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11633 as in make_pure_string and make_pure_c_string.
11635 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11637 * alloc.c (allocate_string): Fix last change.
11639 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11641 * alloc.c (allocate_string): Remove two redundant calls
11642 to memset, add explicit initialization where appropriate.
11644 2012-06-27 Glenn Morris <rgm@gnu.org>
11646 * lisp.mk (lisp): Remove paths.elc.
11648 2012-06-27 Chong Yidong <cyd@gnu.org>
11650 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11652 2012-06-26 John Wiegley <johnw@newartisans.com>
11654 * unexmacosx.c (copy_data_segment): Add two section names used
11655 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11657 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11658 when building with Clang.
11660 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11662 * eval.c (Fapply): Allow calling it with a single argument.
11664 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11666 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11667 _stricmp and _strnicmp.
11668 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11670 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11672 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11674 (allocate_process): Likewise for new process.
11675 (allocate_terminal): Change to use offsetof.
11676 (allocate_frame): Likewise.
11677 * frame.c (make_frame): Omit redundant initialization.
11678 * window.c (make_parent_window): Use memset.
11679 (make_window): Omit redundant initialization.
11680 * process.c (make_process): Omit redundant initialization.
11681 * terminal.c (create_terminal): Likewise.
11683 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11685 * term.c (delete_tty): Remove redundant call to memset.
11687 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11689 * alloc.c: Remove build_string.
11690 * lisp.h: Define build_string as static inline. This provides
11691 a better opportunity to optimize away calls to strlen when the
11692 function is called with compile-time constant argument.
11693 * image.c (imagemagick_error): Convert to build_string.
11694 * w32proc.c (sys_spawnve): Likewise.
11695 * xterm.c (x_term_init): Likewise.
11697 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11699 Use sprintf return value instead of invoking strlen on result.
11700 In the old days this wasn't portable, since some sprintf
11701 implementations returned char *. But they died out years ago and
11702 Emacs already assumes sprintf returns int.
11703 Similarly for float_to_string.
11704 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11705 * ccl.c (ccl_driver):
11706 * character.c (string_escape_byte8):
11707 * data.c (Fnumber_to_string):
11708 * doprnt.c (doprnt):
11709 * print.c (print_object):
11710 * xdisp.c (message_dolog):
11711 * xfns.c (syms_of_xfns):
11712 Use sprintf or float_to_string result to avoid need to call strlen.
11713 * data.c (Fnumber_to_string):
11714 Use make_unibyte_string, since the string must be ASCII.
11715 * lisp.h, print.c (float_to_string): Now returns int length.
11716 * term.c (produce_glyphless_glyph):
11717 Use sprintf result rather than recomputing it.
11719 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11720 * Makefile.in (ALL_CFLAGS):
11721 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11722 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11724 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11726 * dispextern.h (xstrcasecmp): Define to library function
11727 strcasecmp if available.
11728 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11730 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11732 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11733 Avoid comma operator.
11734 * menu.c (push_submenu_start, push_submenu_end)
11735 (push_left_right_boundary, push_menu_pane): Likewise.
11736 * msdos.c (dos_rawgetc): Likewise.
11738 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11740 * xfns.c (xic_create_fontsetname): Remove redundant calls
11743 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11745 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11746 sprintf already null-terminates its output.
11748 * xfns.c (x_window): Remove redundant cast.
11750 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11752 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11753 `const char *' to `char *' to avoid compiler warning.
11755 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11757 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11758 instead of truncating it to 63 (admittedly a generous limit).
11760 * process.c: Fix spelling and caps in comments.
11762 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11764 * emacs.c (setpgrp): Remove definition, unused.
11765 * sysdep.c (setpgrp): Remove definition, not used in this file.
11767 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11769 * makefile.w32-in: Update dependencies.
11771 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11773 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11774 (SYSTIME_H): Add nt/inc/sys/time.h.
11776 * systime.h [WINDOWSNT]: Include sys/time.h.
11778 * s/ms-w32.h (struct timespec): Definition moved from
11779 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11781 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11783 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11784 * buffer.h (buffer_slot_type_mismatch):
11785 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11786 * eval.c (unwind_to_catch):
11787 * image.c (my_png_error, my_error_exit):
11788 * keyboard.c (quit_throw_to_read_char, user_error)
11789 (Fexit_recursive_edit, Fabort_recursive_edit):
11790 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11791 (wrong_type_argument, buffer_overflow, __executable_start)
11792 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11793 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11794 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11796 (child_setup) [!DOS_NT]:
11797 * lread.c (end_of_file_error, invalid_syntax):
11798 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11799 * puresize.h (pure_write_error):
11800 * search.c (matcher_overflow):
11801 * sound.c (sound_perror, alsa_sound_perror):
11802 * sysdep.c, syssignal.h (croak):
11803 * term.c (maybe_fatal, vfatal):
11804 * textprop.c (text_read_only):
11805 * undo.c (user_error):
11806 * unexmacosx.c (unexec_error):
11807 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11808 Use _Noreturn rather than NO_RETURN.
11809 No need for separate decl merely because of _Noreturn.
11810 * sound.c (sound_warning, parse_sound):
11811 Remove unnecessary forward decls.
11813 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11815 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11816 * lisp.h (WAIT_READING_MAX): New macro.
11817 * dispnew.c (Fsleep_for, sit_for):
11818 * keyboard.c (kbd_buffer_get_event):
11819 * process.c (Faccept_process_output):
11820 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11821 This improves on the previous patch, which introduced a bug
11822 when time_t is unsigned and as wide as intmax_t.
11823 See <http://bugs.gnu.org/9000#51>.
11825 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11827 * dispnew.c (sit_for, Fsleep_for):
11828 * keyboard.c (kbd_buffer_get_event):
11829 * process.c (Faccept_process_output): Avoid compiler warnings when
11830 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11832 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11834 * makefile.w32-in: Update dependencies.
11836 * w32.c (ltime): Add return type and declare static.
11837 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11839 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11841 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11842 Privately reported by Herbert J. Skuhra.
11843 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11845 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11846 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11848 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11850 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11851 last argument of make_unibyte_string.
11853 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11854 language ID in the event parameters.
11856 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11857 event.code, not the obscure "character set ID".
11859 2012-06-23 Chong Yidong <cyd@gnu.org>
11861 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11863 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11865 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11866 * w32.c (fdutimens): New function.
11868 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11870 * s/ms-w32.h (pselect): Redirect to sys_select.
11872 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11874 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11875 in the logic of incrementing and decrementing the value of
11876 use_relocatable_buffers.
11878 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11880 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11881 Privately reported by Herbert J. Skuhra.
11882 [__FreeBSD__]: Remove "*/" typo after "#include".
11883 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11884 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11885 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11886 Don't assume EMACS_TIME and struct timeval are the same type.
11888 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11890 Support higher-resolution time stamps (Bug#9000).
11891 The time stamps are only nanosecond-resolution at the C level,
11892 since that's the best that any real-world system supports now.
11893 But they are picosecond-resolution at the Lisp level, as that's
11894 easy, and leaves room for future OS improvements.
11896 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11899 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11900 Don't get current time unless it's needed.
11902 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11903 now provides it if it's absent.
11904 (start_atimer): Port to higher-res time stamps.
11905 Check for time stamp overflow. Don't get current time more
11906 often than is needed.
11908 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11909 Include systime.h, not time.h.
11910 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11912 * dired.c: Include stat-time.h.
11913 (Ffile-attributes): File times now have higher resolution.
11915 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11916 (struct image): Timestamp now has higher resolution.
11918 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11919 has at least microseconds now. All uses removed.
11920 (update_frame, update_single_window, update_window, update_frame_1)
11921 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11922 (duration_to_sec_usec): Remove; no longer needed.
11924 * editfns.c (time_overflow): Now extern.
11925 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11926 (float-time, Fformat_time_string, Fcurrent_time_string)
11927 (Fcurrent_time_zone): Accept and generate higher-resolution
11929 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11930 (decode_time_components, lisp_seconds_argument): New functions.
11931 (make_time): Now static.
11932 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11933 Report an error if the time is invalid, rather than having the caller
11936 * fileio.c: Include <stat-time.h>
11937 (Fcopy_file): Copy higher-resolution time stamps.
11938 Prefer to set the time stamp via a file descriptor if that works.
11939 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11940 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11941 (Fvisited_file_modtime, Fset_visited_file_modtime):
11942 Support higher-resolution time stamps.
11944 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11946 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11948 * image.c (prepare_image_for_display, clear_image_cache)
11949 (lookup_image): Port to higer-resolution time stamps.
11951 * keyboard.c (start_polling, bind_polling_period):
11952 Check for time stamp overflow.
11953 (read_char, kbd_buffer_get_event, timer_start_idle)
11954 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11955 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11956 Port to higher-resolution time stamps. Do not assume time_t is signed.
11957 (decode_timer): New function. Timers are now vectors of length 9,
11958 not 8, to accommodate the picosecond component.
11959 (timer_check_2): Use it.
11961 * nsterm.m (select_timeout, timeval_subtract): Remove.
11962 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11963 as they're a bit more accurate and handle overflow better.
11964 (ns_select): Change prototype to be compatible with pselect.
11965 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11966 * nsterm.h (ns_select): Adjust prototype.
11968 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11969 us-resolution time stamps.
11970 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11972 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11974 * lisp.h (time_overflow): New decl.
11975 (wait_reading_process_output): First arg is now intmax_t, not int,
11976 to accommodate larger waits.
11978 * process.h (struct Lisp_Process.read_output_delay):
11979 Now counts nanoseconds, not microseconds.
11980 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11982 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11983 (wait_reading_process_output):
11984 Port to ns-resolution time stamps.
11985 (Faccept_process_output, wait_reading_process_output):
11986 Check for time stamp overflow. Do not assume time_t is signed.
11987 (select_wrapper): Remove; we now use pselect.
11988 (Fprocess_attributes): Now generates ns-resolution time stamps.
11990 * sysdep.c: Include utimens.h. Don't include utime.h
11991 or worry about struct utimbuf; gnulib does that for us now.
11992 (gettimeofday): Remove; gnulib provides a substitute.
11993 (make_timeval): New function.
11994 (set_file_times): Now sets ns-resolution time stamps.
11995 New arg FD; all uses changed.
11996 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11997 (system_process_attributes):
11998 Now returns ns-resolution time stamp. All uses changed.
11999 Check for time stamp overflow.
12001 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12002 provides a substitute now.
12004 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12005 since it guarantees struct timespec.
12006 (EMACS_TIME): Now struct timespec, so that we can support
12007 ns-resolution time stamps.
12008 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12009 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12010 (EMACS_USECS): Remove.
12011 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12012 so multiply the arg by 1000 before storing it.
12013 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12015 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12016 Port to ns-resolution time stamps.
12017 (EMACS_TIME_NEG_P): Remove; replaced by....
12018 (EMACS_TIME_SIGN): New macro.
12019 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12020 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12021 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12022 (make_timeval, make_lisp_time, decode_time_components): New decls.
12023 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12024 that it mishandled time_t overflow. You can't compare by subtracting!
12025 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12026 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12028 * term.c: Include <sys/time.h>.
12029 (timeval_to_Time): New function, for proper overflow wraparound.
12030 (term_mouse_position, term_mouse_click): Use it.
12032 * undo.c (record_first_change): Support higher-resolution time stamps
12033 in the undo buffer.
12034 (Fprimitive_undo): Use them when restoring time stamps.
12036 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12037 (w32_get_internal_run_time):
12038 Port to higher-resolution Emacs time stamps.
12039 (ltime): Now accepts single 64-bit integer, as that's more convenient
12042 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12044 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12045 for compatibility with pselect. Support ns-resolution time stamps.
12047 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12049 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12050 Check for time stamp overflow, and support ns-resolution time stamps.
12052 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12053 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12054 (timeval_subtract): Remove; no longer needed.
12055 (XTflash, XTring_bell, x_wait_for_event):
12056 Port to ns-resolution time stamps. Don't assume time_t is signed.
12058 2012-06-22 Chong Yidong <cyd@gnu.org>
12060 * xdisp.c (x_consider_frame_title): Revert last change.
12062 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12064 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12065 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12066 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12067 staticidx goes up to 1597 out of 1600 = 0x640.)
12069 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12071 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12072 Otherwise, the umask might be mistakenly 0 while handling input signals.
12074 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12076 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12078 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12080 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12081 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12082 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12083 access to `contents' member of Lisp_Vector objects with AREF and ASET
12086 2012-06-19 Chong Yidong <cyd@gnu.org>
12088 * frame.c (delete_frame): When selecting a frame on a different
12089 text terminal, do not alter the terminal's top-frame.
12091 * xdisp.c (format_mode_line_unwind_data): Record the target
12092 frame's selected window and its terminal's top-frame.
12093 (unwind_format_mode_line): Restore them.
12094 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12096 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12097 since tty frames can be explicitly named.
12098 (prepare_menu_bars): Likewise.
12100 * term.c (Ftty_top_frame): New function.
12102 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12104 Port byte-code-meter to modern targets.
12105 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12106 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12107 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12108 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12109 (METER_1, METER_2): Simplify.
12111 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12113 * data.c (Fdefalias): Return `symbol' (bug#11686).
12115 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12117 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12118 gets killed during executing of this function (Bug#11665).
12119 Try to always return Qt when the buffer has been actually killed.
12120 (Vkill_buffer_query_functions): In doc-string say that functions
12121 run by this hook should not change the current buffer.
12123 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12125 Fix recently-introduced process.c problems found by static checking.
12126 * process.c (write_queue_push, write_queue_pop, send_process):
12127 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12128 (write_queue_pop): Fix pointer signedness problem.
12129 (send_process): Remove unused local.
12131 2012-06-17 Chong Yidong <cyd@gnu.org>
12133 * xdisp.c (redisplay_internal): No need to redisplay terminal
12134 frames that are not on top.
12136 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12138 * process.c (make_process): Initialize write_queue.
12139 (write_queue_push, write_queue_pop): New functions.
12140 (send_process): Use them to maintain correct ordering of process
12141 writes (Bug#10815).
12143 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12145 * lisp.h (eassert): Assume C89 or later.
12146 This removes the need for CHECK.
12147 (CHECK): Remove. Its comments about always evaluating its
12148 argument were confusing, as 'eassert' typically does not evaluate
12151 * coding.c (produce_chars): Use ptrdiff_t, not int.
12153 * xterm.c (x_draw_underwave): Check for integer overflow.
12154 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12156 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12158 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12159 referenced (Bug#11583).
12161 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12163 Implement wave-style variant of underlining.
12164 * dispextern.h (face_underline_type): New enum.
12165 (face): Add field for underline type.
12166 * nsterm.m (ns_draw_underwave): New function.
12167 (ns_draw_text_decoration): Use it.
12168 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12170 (x_draw_glyph_string): Use them.
12171 * xfaces.c (Qline, Qwave): New Lisp objects.
12172 (check_lface_attrs, merge_face_ref)
12173 (Finternal_set_lisp_face_attribute, realize_x_face):
12174 Handle wave-style underline face attributes.
12175 * xterm.c (x_draw_underwave): New function.
12176 (x_draw_glyph_string): Use it.
12178 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12180 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12181 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12182 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12183 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12184 ($(BLD)/w32select.$(O)): Update dependencies.
12186 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12188 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12189 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12190 * character.c (_fetch_multibyte_char_p): Remove.
12191 * alloc.c: Include "character.h" before "buffer.h".
12192 * bidi.c: Likewise.
12193 * buffer.c: Likewise.
12194 * bytecode.c: Likewise.
12195 * callint.c: Likewise.
12196 * callproc.c: Likewise.
12197 * casefiddle.c: Likewise.
12198 * casetab.c: Likewise.
12199 * category.c: Likewise.
12200 * cmds.c: Likewise.
12201 * coding.c: Likewise.
12202 * composite.c: Likewise.
12203 * dired.c: Likewise.
12204 * dispnew.c: Likewise.
12206 * dosfns.c: Likewise.
12207 * editfns.c: Likewise.
12208 * emacs.c: Likewise.
12209 * fileio.c: Likewise.
12210 * filelock.c: Likewise.
12211 * font.c: Likewise.
12212 * fontset.c: Likewise.
12213 * fringe.c: Likewise.
12214 * indent.c: Likewise.
12215 * insdel.c: Likewise.
12216 * intervals.c: Likewise.
12217 * keyboard.c: Likewise.
12218 * keymap.c: Likewise.
12219 * lread.c: Likewise.
12220 * macros.c: Likewise.
12221 * marker.c: Likewise.
12222 * minibuf.c: Likewise.
12223 * nsfns.m: Likewise.
12224 * nsmenu.m: Likewise.
12225 * print.c: Likewise.
12226 * process.c: Likewise.
12227 * regex.c: Likewise.
12228 * region-cache.c: Likewise.
12229 * search.c: Likewise.
12230 * syntax.c: Likewise.
12231 * term.c: Likewise.
12232 * textprop.c: Likewise.
12233 * undo.c: Likewise.
12234 * unexsol.c: Likewise.
12235 * w16select.c: Likewise.
12236 * w32fns.c: Likewise.
12237 * w32menu.c: Likewise.
12238 * window.c: Likewise.
12239 * xdisp.c: Likewise.
12240 * xfns.c: Likewise.
12241 * xmenu.c: Likewise.
12243 * xselect.c: Likewise.
12245 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12247 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12248 If all the glyphs of the glyph row came from strings, and we have no
12249 cursor positioning clues, put the cursor on the first glyph of the
12251 (handle_face_prop): Use chunk-relative overlay string index when
12252 indexing into it->string_overlays array. (Bug#11653)
12253 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12254 the rightmost. (Bug#11720)
12256 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12258 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12259 (CATEGORY_MEMBER): Enforce 1/0 value.
12260 * category.c (_temp_category_set): Remove.
12262 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12264 * window.c (Fdelete_other_windows_internal)
12265 (Fdelete_window_internal): Don't access frame's mouse highlight
12266 info of the initial frame. (Bug#11677)
12268 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12270 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12271 Assume USE_2_TAGS_FOR_INTS.
12272 (xreload): Adjust $tagmask width to match recent lisp.h change.
12274 Simplify lisp.h in minor ways that should not affect code.
12275 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12276 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12277 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12278 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12279 (INTTYPEBITS): New macro, for clarity.
12280 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12281 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12282 Simplify now that USE_LSB_TAG is always defined.
12283 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12284 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12286 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12288 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12290 2012-06-13 Glenn Morris <rgm@gnu.org>
12292 * s/bsd-common.h (BSD4_3):
12293 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12295 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12297 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12299 (XLI, XIL): Define.
12300 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12302 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12303 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12304 * alloc.c (widen_to_Lisp_Object): Remove.
12305 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12306 * frame.c (delete_frame): Remove outdated comment.
12307 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12308 USE_LISP_UNION_TYPE.
12309 (Fw32_unregister_hot_key): Likewise.
12310 (Fw32_toggle_lock_key): Likewise.
12311 * w32menu.c (add_menu_item): Likewise.
12312 (w32_menu_display_help): Use XIL instead of checking
12313 USE_LISP_UNION_TYPE.
12314 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12315 (init_heap): Likewise.
12316 * w32term.c (w32_read_socket): Update comment.
12318 2012-06-13 Glenn Morris <rgm@gnu.org>
12320 * s/usg5-4-common.h, src/s/unixware.h:
12321 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12323 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12325 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12327 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12328 * alloc.c (make_number) [!defined make_number]:
12329 Remove, as lisp.h always defines this now.
12330 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12331 (roundup_size): Verify that it is a power of 2.
12332 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12333 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12334 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12335 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12336 USE_LSB_TAG now is always defined to be either 0 or 1.
12338 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12339 code works fine either way, and efficiency is not a concern here,
12340 as the union type is for debugging, not for production.
12341 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12342 Use an inline function on all platforms when using the union type,
12343 since this is simpler and 'static inline' can be used portably
12345 (LISP_INITIALLY_ZERO): New macro.
12346 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12347 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12349 2012-06-12 Glenn Morris <rgm@gnu.org>
12351 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12353 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12355 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12356 Move BROKEN_SIGIO to configure.
12358 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12359 Move NO_TERMIO to configure.
12361 2012-06-12 Chong Yidong <cyd@gnu.org>
12363 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12364 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12365 MagickExportImagePixels is undefined.
12367 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12369 * image.c (imagemagick_load_image): Remove unused label.
12371 2012-06-11 Glenn Morris <rgm@gnu.org>
12373 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12374 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12375 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12376 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12378 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12380 * alloc.c (make_byte_code): New function.
12381 (Fmake_byte_code): Use it. Don't purify here.
12382 * lread.c (read1): Use it as well to avoid extra allocation.
12384 2012-06-11 Chong Yidong <cyd@gnu.org>
12386 * image.c (imagemagick_load_image): Implement transparency.
12388 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12390 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12391 account for preceding backslashes. (Bug#11663)
12393 2012-06-09 Chong Yidong <cyd@gnu.org>
12395 * term.c: Support italics in capable terminals (Bug#9652).
12396 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12397 (turn_on_face): Output using TS_enter_italic_mode if available.
12398 Don't handle unused blinking and alt-charset cases.
12399 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12400 and tty_alt_charset_p cases.
12401 (tty_capable_p, init_tty): Support italics.
12403 * termchar.h (struct tty_display_info): Add field for italics.
12404 Remove unused blink field.
12406 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12409 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12410 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12411 tty_alt_charset_p. Add tty_italic_p.
12413 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12415 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12416 dbus_type_is_basic if available.
12417 (xd_extract_signed, xd_extract_unsigned): Rename from
12418 extract_signed and extract_unsigned, respectively. Adapt callers.
12420 2012-06-09 Chong Yidong <cyd@gnu.org>
12422 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12424 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12427 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12429 * xdisp.c (vmessage): Treat frame message as multibyte.
12430 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12431 would generate the diagnostic "Making \302\247 buffer-local while
12434 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12436 * dispnew.c (showing_window_margins_p): Undo last change, which
12437 was done due to an inadvertent commit.
12438 (adjust_frame_glyphs_for_frame_redisplay): Do call
12439 showing_window_margins_p.
12441 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12443 * eval.c (Fmake_var_non_special): New primitive.
12444 (syms_of_eval): Defsubr it.
12445 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12447 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12449 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12450 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12452 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12454 * alloc.c (allocate_vectorlike): Fix last change.
12456 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12458 Block-based vector allocation of small vectors.
12459 * lisp.h (struct vectorlike_header): New field `nbytes',
12460 adjust comment accordingly.
12461 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12462 to denote vector blocks. Adjust users (live_vector_p,
12463 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12464 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12465 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12466 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12467 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12468 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12469 (roundup_size): New constant.
12470 (struct vector_block): New data type.
12471 (vector_blocks, vector_free_lists, zero_vector): New variables.
12472 (all_vectors): Rename to `large_vectors'.
12473 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12474 (sweep_vectors): New functions.
12475 (allocate_vectorlike): Return `zero_vector' as the only vector of
12476 0 items. Allocate new vector from block if vector size is less than
12477 or equal to VBLOCK_BYTES_MAX.
12478 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12479 (init_alloc_once): Add call to init_vectors.
12481 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12483 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12485 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12487 * doprnt.c (doprnt): Truncate multibyte char correctly.
12488 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12489 would mishandle a string argument "Xc" if X was a multibyte
12490 character of length 2: it would truncate after X's first byte
12491 rather than including all of X.
12493 2012-06-06 Chong Yidong <cyd@gnu.org>
12495 * buffer.c (word_wrap): Doc fix.
12497 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12499 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12501 2012-06-03 Glenn Morris <rgm@gnu.org>
12503 * xdisp.c (tool-bar-style): Doc fix.
12505 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12507 * Makefile.in (PAXCTL): Define.
12508 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12509 binary via PaX flags if the paxctl utility is available.
12510 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12511 Restore PaX flags to their default. (Bug#11398)
12513 2012-06-03 Chong Yidong <cyd@gnu.org>
12515 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12516 buffer (Bug#11226).
12518 2012-06-03 Chong Yidong <cyd@gnu.org>
12520 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12521 (note_mode_line_or_margin_highlight): If there is no help echo,
12522 use mode-line-default-help-echo. Handle the case where the mouse
12523 position is past the end of the mode line string.
12525 * buffer.c (buffer_local_value_1): New function, split from
12526 Fbuffer_local_value; can return Qunbound.
12527 (Fbuffer_local_value): Use it.
12528 (Vmode_line_format): Docstring tweaks.
12530 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12532 * sysdep.c (system_process_attributes): Improve comment.
12534 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12536 * keyboard.c: Export real-this-command to Elisp.
12537 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12538 and DEFVAR it. Update all users.
12540 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12542 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12544 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12545 Convert pctcpu and pctmem to Lisp float properly.
12546 Let the compiler fold better, as 100.0/0x8000 is exact.
12548 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12550 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12553 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12555 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12557 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12559 For a 'struct window', replace some Lisp_Object fields to
12560 bitfields where appropriate, remove unused fields.
12561 * window.h (struct window): Remove unused 'last_mark_x' and
12562 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12563 change its type from Lisp_Object to bitfield.
12564 Change type of 'force_start', 'optional_new_start',
12565 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12566 fields from Lisp_Object to bitfield. Adjust users accordingly.
12568 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12570 Pacify gcc -Wdouble-precision when using Xaw.
12571 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12572 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12573 Use 'float' consistently, rather than 'float' in most places
12574 and 'double' in a couple of places.
12576 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12578 * xdisp.c (handle_stop): Detect whether we have overlay strings
12579 loaded by testing it->current.overlay_string_index to be
12580 non-negative, instead of checking whether n_overlay_strings is
12581 positive. (Bug#11587)
12583 2012-05-31 Chong Yidong <cyd@gnu.org>
12585 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12587 * doc.c (Fsubstitute_command_keys): Doc fix.
12589 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12591 * search.c (search_buffer): Remove calls to
12592 r_alloc_inhibit_buffer_relocation, as it is now called by
12593 maybe_unify_char, which was the cause of relocation of buffer text
12596 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12598 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12599 for the duration of call to load_charset, to avoid problems with
12600 callers of maybe_unify_char that access buffer text through C
12603 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12604 decrement the inhibition flag, instead of just setting or
12607 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12609 Remove obsolete '#define static' cruft.
12610 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12611 This #undef was "temporary" in 2000; it is no longer needed
12612 now that '#define static' has gone away.
12613 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12614 (gray_bitmap_bits): Remove; no longer needed.
12615 All uses replaced with definiens.
12616 * xterm.c: Include "bitmaps/gray.xbm".
12618 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12620 Clean up __executable_start, monstartup when --enable-profiling.
12621 The following changes affect the code only when profiling.
12622 * dispnew.c (__executable_start): Rename from safe_bcopy.
12623 Define only on platforms that need it.
12624 * emacs.c: Include <sys/gmon.h> when profiling.
12625 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12626 (__executable_start): Remove decl, since lisp.h does it now.
12627 (safe_bcopy): Remove decl; no longer has that name.
12628 (main): Coalesce #if into single bit of code, for simplicity.
12629 Cast pointers to uintptr_t, since standard libraries want integers
12631 * lisp.h (__executable_start): New decl.
12633 2012-05-31 Glenn Morris <rgm@gnu.org>
12635 * image.c (Fimagemagick_types): Doc fix.
12637 2012-05-30 Jim Meyering <meyering@redhat.com>
12639 * callproc.c (Fcall_process_region): Include directory component
12640 in mkstemp error message (Bug#11586).
12642 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12644 * alloc.c, lisp.h (make_pure_vector): Now static.
12646 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12648 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12649 Move to byte-run.el.
12650 (Fautoload): Do the hash-doc more carefully.
12651 * data.c (Fdefalias): Purify definition, except for keymaps.
12652 (Qdefun): Move from eval.c.
12653 * lisp.h (Qdefun): Remove.
12654 * lread.c (read1): Tiny simplification.
12656 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12658 Do not create empty overlays with the evaporate property (Bug#9642).
12659 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12660 Bug#9642, but explicitly check that the buffer the overlay would
12661 be moved to is live and rearrange lines to make sure that errors
12662 will not put the overlay in an inconsistent state.
12663 (Fdelete_overlay): Cosmetics.
12665 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12667 * w32term.c (my_bring_window_to_top): New function.
12668 (x_raise_frame): Use handle returned by DeferWindowPos, which
12669 could be different from the original one.
12670 Call my_bring_window_to_top instead of my_set_foreground_window.
12673 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12674 by calling BringWindowToTop.
12676 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12677 (WM_EMACS_END): Increase by one.
12679 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12681 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12682 This avoids undefined behavior that might cause the eassert
12683 to not catch an out-of-range value.
12685 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12687 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12688 Update dependencies.
12690 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12692 * bidi.c (bidi_mirror_char): Fix last change.
12694 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12696 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12697 when referring to sectname field in printf format.
12699 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12701 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12702 Only r_alloc_inhibit_buffer_relocation needed to be added;
12703 the others were already declared.
12705 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12706 before checking whether it's out of range. Put the check inside
12708 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12710 2012-05-27 Ken Brown <kbrown@cornell.edu>
12712 * callproc.c (Fcall_process): Restore a line that was accidentally
12713 commented out in the 2011-02-13 change (bug#11547).
12715 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12717 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12718 defined on ralloc.c.
12720 * buffer.c [REL_ALLOC]: Remove prototypes of
12721 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12722 they are now on lisp.h.
12724 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12726 * search.c (search_buffer): Use it to inhibit relocation of buffer
12727 text while re_search_2 is doing its job, because re_search_2 is
12728 passed C pointers to buffer text. (Bug#11519)
12730 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12731 Update value to 24.
12733 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12734 state after an additional call to move_it_in_display_line_to, keep
12735 the values of it->max_ascent and it->max_descent found for the
12737 (pos_visible_p): Revert the comparison against bottom_y to what it
12738 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12741 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12743 Fix coding-related core dumps with gcc -ftrapv.
12744 The code was computing A - B, where A and B are pointers, and B is
12745 random garbage. This can lead to core dumps on platforms that
12746 have special pointer registers, and it also leads to core dumps on
12747 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12748 A - B only when B is initialized properly.
12749 * coding.c (coding_set_source, coding_set_destination): Return void.
12750 (coding_change_source, coding_change_destinations): New functions,
12751 with the old behaviors of coding_set_source and coding_set_destination.
12752 All callers that need an offset changed to use these new functions.
12754 2012-05-26 Glenn Morris <rgm@gnu.org>
12756 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12758 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12760 Extend mouse support on W32 text-mode console.
12761 * xdisp.c (draw_row_with_mouse_face):
12762 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12764 * w32console.c: Include window.h.
12765 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12767 (initialize_w32_display): Initialize mouse-highlight data.
12769 * w32inevt.c: Include termchar.h and window.h.
12770 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12771 moves, call note_mouse_highlight. If help_echo changed, call
12772 gen_help_event to produce help-echo message in the echo area.
12773 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12776 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12778 * lread.c (read1): Simplify slightly to avoid an overflow warning
12779 with GCC 4.7.0 on x86-64.
12781 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12783 * bidi.c (bidi_mirror_char): Revert last change: an int is
12784 definitely wide enough here.
12786 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12788 Fix integer width and related bugs (Bug#9874).
12789 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12790 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12791 (string_bytes, check_sblock, allocate_string_data):
12792 (compact_small_strings, Fmake_bool_vector, make_string)
12793 (make_unibyte_string, make_multibyte_string)
12794 (make_string_from_bytes, make_specified_string)
12795 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12796 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12799 (allocate_pseudovector):
12800 Use int, not EMACS_INT, where int is wide enough.
12801 (inhibit_garbage_collection, Fgarbage_collect):
12802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12803 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12804 int might not be wide enough.
12805 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12806 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12807 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12808 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12809 (bidi_level_of_next_char, bidi_move_to_visually_next):
12810 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12811 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12812 (Fkill_buffer, Fset_buffer_major_mode)
12813 (advance_to_char_boundary, Fbuffer_swap_text)
12814 (Fset_buffer_multibyte, overlays_at, overlays_in)
12815 (overlay_touches_p, struct sortvec, record_overlay_string)
12816 (overlay_strings, recenter_overlay_lists)
12817 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12818 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12819 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12820 (Foverlay_recenter, last_overlay_modification_hooks_used)
12821 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12822 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12823 (validate_region): Omit unnecessary test for b <= e,
12824 since that's guaranteed by the previous test.
12825 (adjust_overlays_for_delete): Avoid pos + length overflow.
12826 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12827 (report_overlay_modification):
12828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12829 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12830 Omit pointer cast, which isn't needed anyway, and doesn't work
12831 after the EMACS_INT -> ptrdiff_t change.
12832 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12833 * buffer.h: Adjust decls to match defn changes elsewhere.
12834 (struct buffer_text, struct buffer):
12835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12836 Use EMACS_INT, not int, where int might not be wide enough.
12837 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12838 not int, to avoid needless 32-bit limit on 64-bit hosts.
12839 (exec_byte_code): Use tighter memory-full test, one that checks
12840 for alloca overflow. Don't compute the address of the object just
12841 before an array, as that's not portable. Use EMACS_INT, not
12842 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12843 * callint.c (Fcall_interactively):
12844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12845 * callproc.c (call_process_kill, Fcall_process):
12846 Don't assume pid_t fits into an Emacs fixnum.
12847 (call_process_cleanup, Fcall_process, child_setup):
12848 Don't assume pid_t fits into int.
12849 (call_process_cleanup, Fcall_process, delete_temp_file)
12850 (Fcall_process_region):
12851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12852 (Fcall_process): Simplify handling of volatile integers.
12853 Use int, not EMACS_INT, where int will do.
12854 * casefiddle.c (casify_object, casify_region, operate_on_word)
12855 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12856 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12857 (casify_object): Avoid integer overflow when overallocating buffer.
12858 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12859 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12860 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12861 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12862 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12863 integers are now checked earlier. All uses replaced with XINT.
12865 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12866 For CCL_MapSingle, check that content and value are in int range.
12867 (ccl_driver, Fregister_code_conversion_map):
12868 Check that Vcode_version_map_vector is a vector.
12869 (resolve_symbol_ccl_program): Check that vector header is in range.
12870 Always copy the vector, so that we can check its contents reliably
12871 now rather than having to recheck each instruction as it's being
12872 executed. Check that vector words fit in 'int'.
12873 (ccl_get_compiled_code, Fregister_ccl_program)
12874 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12875 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12876 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12877 contents are in range.
12878 (Fccl_execute_on_string): Check that status is in range.
12879 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12880 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12881 Accept and return EMACS_INT, not int, because callers can pass values
12882 out of 'int' range.
12883 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12884 (multibyte_chars_in_text, parse_str_as_multibyte)
12885 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12886 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12887 (string_escape_byte8, Fget_byte):
12888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12889 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12890 avoid mishandling large integers.
12891 * character.h: Adjust decls to match defn changes elsewhere.
12892 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12893 (Ffind_charset_region):
12894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12895 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12896 (load_charset_map_from_vector, Fdefine_charset_internal):
12897 Don't assume fixnum fits in int.
12898 (load_charset_map_from_vector, Fmap_charset_chars):
12899 Remove now-unnecessary CHECK_NATNUMs.
12900 (Fdefine_charset_internal): Check ranges here, more carefully.
12901 Don't rely on undefined behavior with signed left shift overflow.
12902 Don't assume unsigned int fits into fixnum, or that fixnum fits
12903 into unsigned int. Don't require max_code to be a valid fixnum;
12904 that's not true for gb10830 4-byte on a 32-bit host. Allow
12905 invalid_code to be a cons, for the same reason. Require code_offset
12906 to be a character. Avoid int overflow if max_char is close
12908 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12909 this is intended anyway and avoids some undefined behavior.
12910 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12911 INDEX_TO_CODE_POINT, as that's what it expects.
12912 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12913 * charset.h (DECODE_CHAR): Return int, not unsigned;
12914 this is what was intended anyway, and it avoids undefined behavior.
12915 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12916 integer-overflow issues.
12917 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12918 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12919 where the argument is EMACS_INT, and this behavior is not intended.
12920 * chartab.c (Fmake_char_table, Fset_char_table_range)
12921 (uniprop_get_decoder, uniprop_get_encoder):
12922 Don't assume fixnum fits in int.
12923 * cmds.c (move_point): New function, that does the gist of
12924 Fforward_char and Fbackward_char, but does so while checking
12925 for integer overflow more accurately.
12926 (Fforward_char, Fbackward_char): Use it.
12927 (Fforward_line, Fend_of_line, internal_self_insert)
12928 (internal_self_insert):
12929 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12930 Fix a FIXME, by checking for integer overflow when calculating
12931 target_clm and actual_clm.
12932 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12933 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12934 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12935 (coding_alloc_by_making_gap, alloc_destination)
12936 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12937 (encode_coding_utf_16, detect_coding_emacs_mule)
12938 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12939 (detect_coding_iso_2022, decode_coding_iso_2022)
12940 (encode_invocation_designation, encode_designation_at_bol)
12941 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12942 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12943 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12944 (encode_coding_ccl, encode_coding_raw_text)
12945 (detect_coding_charset, decode_coding_charset)
12946 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12947 (produce_composition, produce_charset, produce_annotation)
12948 (decode_coding, handle_composition_annotation)
12949 (handle_charset_annotation, consume_chars, decode_coding_gap)
12950 (decode_coding_object, encode_coding_object, detect_coding_system)
12951 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12952 (code_convert_region, code_convert_string)
12953 (Fdefine_coding_system_internal)
12954 (coding_set_source, coding_set_destination):
12955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12956 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12957 (Fdefine_coding_system_internal):
12958 Don't assume fixnums fit in int.
12959 (decode_coding_gap, decode_coding_object, encode_coding_object)
12960 (Fread_coding_system, Fdetect_coding_region)
12961 (Funencodable_char_position, Fcheck_coding_systems_region)
12962 (get_translation, handle_composition_annotation, consume_chars):
12963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12964 (consume_chars): Rewrite to not calculate an address outside buffer.
12965 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
12966 Don't access memory outside of the args array.
12967 (Fdefine_coding_system_internal): Check for charset-id overflow.
12968 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12969 result of ENCODE_CHAR.
12970 * coding.h: Adjust decls to match defn changes elsewhere.
12971 (struct coding_system):
12972 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12973 * composite.c (get_composition_id, find_composition)
12974 (run_composition_function, update_compositions)
12975 (compose_text, composition_gstring_put_cache)
12976 (composition_gstring_p, composition_gstring_width)
12977 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12978 (composition_compute_stop_pos, composition_reseat_it)
12979 (composition_update_it, struct position_record)
12980 (find_automatic_composition, composition_adjust_point)
12981 (Fcomposition_get_gstring, Ffind_composition_internal):
12982 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12983 (update_compositions):
12984 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12985 * composite.h: Adjust decls to match defn changes elsewhere.
12986 (struct composition):
12987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12988 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12989 Do not attempt to compute the address of the object just before a
12990 buffer; this is not portable.
12992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12993 (Faset): Use int, not EMACS_INT, where int is wide enough.
12994 (Fstring_to_number): Don't assume fixnums fit in int.
12995 (Frem): Don't assume arg is nonnegative.
12996 * dbusbind.c (xd_append_arg): Check for integers out of range.
12997 (Fdbus_call_method): Don't overflow the timeout int.
12998 (extract_signed, extract_unsigned): New functions.
12999 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13000 (xd_get_connection_references): Return ptrdiff_t, not int.
13002 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13003 (xd_read_message_1):
13004 Use int, not unsigned, where the dbus API uses int.
13005 (Fdbus_message_internal): Don't overflow mtype.
13006 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13007 * dired.c (directory_files_internal, file_name_completion, scmp)
13008 (file_name_completion_stat):
13009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13010 (file_name_completion): Don't overflow matchcount.
13011 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13012 * dispextern.h: Adjust decls to match defn changes elsewhere.
13013 (struct text_pos, struct glyph, struct bidi_saved_info)
13014 (struct bidi_string_data, struct bidi_it, struct composition_it)
13016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13017 (struct display_pos, struct composition_it, struct it):
13018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13019 * dispnew.c (increment_matrix_positions)
13020 (increment_row_positions, mode_line_string)
13021 (marginal_area_string):
13022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13023 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13024 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13025 (duration_to_sec_usec): New function, to check for overflow better.
13026 (Fsleep_for, sit_for): Use it.
13027 * doc.c (get_doc_string, store_function_docstring):
13028 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13029 (get_doc_string, Fsnarf_documentation):
13030 Use int, not EMACS_INT, where int is wide enough.
13032 Use SAFE_ALLOCA, not alloca.
13033 Check for overflow when converting EMACS_INT to off_t.
13034 * doprnt.c (doprnt):
13035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13036 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13037 Don't assume uid_t fits into fixnum.
13038 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13039 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13040 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13041 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13042 (general_insert_function)
13043 (Finsert_char, make_buffer_string, make_buffer_string_both)
13044 (update_buffer_properties, Fbuffer_substring)
13045 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13046 (Fsubst_char_in_region, check_translation)
13047 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13048 (transpose_markers, Ftranspose_regions):
13049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13050 (clip_to_bounds): Move to lisp.h as an inline function).
13051 (Fconstrain_to_field): Don't assume integers are nonnegative.
13052 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13053 (Fsubst_char_in_region, Fsave_restriction):
13054 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13055 (Femacs_pid): Don't assume pid_t fits into fixnum.
13056 (lo_time): Use int, not EMACS_INT, when int suffices.
13057 (lisp_time_argument): Check for usec out of range.
13058 (Fencode_time): Don't assume fixnum fits in int.
13059 (Fuser_login_name, Fuser_full_name): Signal an error
13060 if a uid argument is out of range, rather than relying on
13061 undefined behavior.
13062 (Fformat_time_string): Remove now-unnecessary check.
13063 lisp_time_argument checks for out-of-range usec now.
13064 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13065 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13066 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13067 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13068 (init_cmdargs, Fdump_emacs):
13069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13070 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13071 the bottom (typically) 32 bits of the fixnum.
13072 * eval.c (specpdl_size, call_debugger):
13073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13074 (when_entered_debugger, Fbacktrace_debug):
13075 Don't assume fixnum can fit in int.
13076 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13077 the object just before a buffer; this is not portable.
13078 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13079 (grow_specpdl, unbind_to):
13080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13081 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13082 (grow_specpdl): Simplify allocation by using xpalloc.
13083 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13084 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13085 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13086 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13087 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13088 (a_write, e_write):
13089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13090 (Fcopy_file, non_regular_nbytes, read_non_regular)
13091 (Finsert_file_contents):
13092 Use int, not EMACS_INT, where int is wide enough.
13093 (READ_BUF_SIZE): Verify that it fits in int.
13094 (Finsert_file_contents): Check that counts are in proper range,
13095 rather than assuming fixnums fit into ptrdiff_t etc.
13096 Don't assume fixnums fit into int.
13097 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13098 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13099 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13100 (string_char_to_byte, string_byte_to_char)
13101 (string_make_multibyte, string_to_multibyte)
13102 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13103 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13104 (substring_both, Fdelete, internal_equal, Ffillarray)
13105 (Fclear_string, mapcar1)
13106 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13107 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13108 (larger_vector, make_hash_table, maybe_resize_hash_table)
13109 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13110 (Fmaphash, secure_hash):
13111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13112 (concat): Check for string index and length overflow.
13113 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13116 (larger_vector): New API (vec, incr_min, size_max) replaces old
13117 one (vec, new_size, init). This catches size overflow.
13118 INIT was removed because it was always Qnil.
13119 All callers changed.
13120 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13121 the upper bound on a hash table index size.
13122 (make_hash_table, maybe_resize_hash_table): Use it.
13123 (secure_hash): Computer start_byte and end_byte only after
13124 they're known to be in ptrdiff_t range.
13125 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13126 (Ffont_get_glyphs, Ffont_at):
13127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13128 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13129 (Flist_fonts, Fopen_font):
13130 Don't assume fixnum can fit in int.
13131 (check_gstring): Don't assume index can fit in int.
13132 (font_match_p): Check that fixnum is a character, not a nonnegative
13133 fixnum, since the later code needs to stuff it into an int.
13134 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13135 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13136 conversion overflow issues.
13137 (Fopen_font): Check for integer out of range.
13138 (Ffont_get_glyphs): Don't assume index can fit in int.
13139 * font.h: Adjust decls to match defn changes elsewhere.
13140 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13142 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13143 printmax_t, where ptrdiff_t is wide enough.
13144 (Finternal_char_font):
13145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13146 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13147 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13148 (Fset_frame_position, x_set_frame_parameters)
13149 (x_set_line_spacing, x_set_border_width)
13150 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13151 Check that fixnums are in proper range for system types.
13152 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13154 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13155 Use SAFE_ALLOCA_LISP, not alloca.
13156 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13157 intptr_t is wide enough.
13158 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13159 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13160 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13161 Check for fixnum out of range.
13162 * ftfont.c (ftfont_list): Don't assume index fits in int.
13163 Check that fixnums are in proper range for system types.
13164 (ftfont_shape_by_flt):
13165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13166 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13168 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13169 Check that fixnums are in proper range for system types.
13170 * gnutls.h: Adjust decls to match defn changes elsewhere.
13171 * gtkutil.c (xg_dialog_run):
13172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13173 (update_frame_tool_bar):
13174 Check that fixnums are in proper range for system types.
13175 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13176 (lookup_image): Check that fixnums are in range for system types.
13177 * indent.c (last_known_column, last_known_column_point):
13178 (current_column_bol_cache):
13179 (skip_invisible, current_column, check_display_width):
13180 (check_display_width, scan_for_column, current_column_1)
13181 (Findent_to, Fcurrent_indentation, position_indentation)
13182 (indented_beyond_p, Fmove_to_column, compute_motion):
13183 (Fcompute_motion, Fvertical_motion):
13184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13185 (last_known_column_modified): Use EMACS_INT, not int.
13186 (check_display_width):
13188 Check that fixnums and floats are in proper range for system types.
13189 (compute_motion): Don't assume index or fixnum fits in int.
13190 (compute_motion, Fcompute_motion):
13191 Use int, not EMACS_INT, when it is wide enough.
13192 (vmotion): Omit local var start_hpos that is always 0; that way
13193 we don't need to worry about overflow in expressions involving it.
13194 * indent.h: Adjust decls to match defn changes elsewhere.
13196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13197 Use int, not EMACS_INT, where int is wide enough.
13198 Remove unused members ovstring_chars_done and tab_offset;
13200 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13201 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13202 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13203 (make_gap, copy_text, insert, insert_and_inherit)
13204 (insert_before_markers, insert_before_markers_and_inherit)
13205 (insert_1, count_combining_before, count_combining_after)
13206 (insert_1_both, insert_from_string)
13207 (insert_from_string_before_markers, insert_from_string_1)
13208 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13209 (adjust_after_replace, adjust_after_insert, replace_range)
13210 (replace_range_2, del_range, del_range_1, del_range_byte)
13211 (del_range_both, del_range_2, modify_region)
13212 (prepare_to_modify_buffer, signal_before_change)
13213 (signal_after_change, Fcombine_after_change_execute):
13214 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13215 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13216 (balance_an_interval, split_interval_right, split_interval_left)
13217 (find_interval, next_interval, update_interval)
13218 (adjust_intervals_for_insertion, delete_node, delete_interval)
13219 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13220 (static_offset_intervals, offset_intervals)
13221 (merge_interval_right, merge_interval_left, make_new_interval)
13222 (graft_intervals_into_buffer, temp_set_point_both)
13223 (temp_set_point, set_point, adjust_for_invis_intang)
13224 (set_point_both, move_if_not_intangible, get_property_and_range)
13225 (get_local_map, copy_intervals, copy_intervals_to_string)
13226 (compare_string_intervals, set_intervals_multibyte_1):
13227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13228 * intervals.h: Adjust decls to match defn changes elsewhere.
13230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13231 * keyboard.c (this_command_key_count, this_single_command_key_start)
13232 (before_command_key_count, before_command_echo_length, echo_now)
13233 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13234 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13235 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13236 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13238 (last_non_minibuf_size, last_point_position, echo_truncate)
13239 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13240 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13241 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13242 (stuff_buffered_input):
13243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13244 (last_auto_save, command_loop_1, read_char):
13245 Use EMACS_INT, not int, to avoid integer overflow.
13246 (record_char): Avoid overflow in total_keys computation.
13247 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13248 * keyboard.h: Adjust decls to match defn changes elsewhere.
13249 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13250 (Fkey_description, Fdescribe_vector, Flookup_key):
13251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13252 (click_position): New function, to check that positions are in range.
13253 (Fcurrent_active_maps):
13254 (describe_command):
13255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13256 (Faccessible_keymaps, Fkey_description):
13257 (preferred_sequence_p):
13258 Don't assume fixnum can fit into int.
13259 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13260 Check for integer overflow in size calculations.
13261 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13262 avoid mishandling large integers.
13263 * lisp.h: Adjust decls to match defn changes elsewhere.
13264 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13265 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13266 (struct Lisp_Marker):
13267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13268 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13269 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13270 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13271 All callers changed.
13272 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13273 Assume the arg has valid form, since it always does.
13274 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13275 unsigned integer system type.
13276 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13277 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13278 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13279 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13280 (duration_to_sec_usec): New decl.
13281 * lread.c (read_from_string_index, read_from_string_index_byte)
13282 (read_from_string_limit, readchar, unreadchar, openp)
13283 (read_internal_start, read1, oblookup):
13284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13285 (Fload, readevalloop, Feval_buffer, Feval_region):
13286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13287 (openp): Check for out-of-range argument to 'access'.
13288 (read1): Use int, not EMACS_INT, where int is wide enough.
13289 Don't assume fixnum fits into int.
13290 Fix off-by-one error that can read outside a buffer.
13291 (read_filtered_event): Use duration_to_sec_usec
13292 to do proper overflow checking on durations.
13293 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13294 in size calculation.
13295 (Fexecute_kbd_macro):
13296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13297 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13298 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13299 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13300 (set_marker_both, set_marker_restricted_both, marker_position)
13301 (marker_byte_position, Fbuffer_has_markers_at):
13302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13303 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13304 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13305 It now merely ensures that the menu is large enough, without
13306 necessarily growing it, as this avoids some integer overflow issues.
13307 All callers changed.
13308 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13309 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13310 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13311 Use SAFE_ALLOCA_LISP, not alloca.
13312 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13313 to EMACS_INT. Check that fixnums are in proper range for system types.
13314 * minibuf.c (minibuf_prompt_width, string_to_object)
13315 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13316 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13318 (get_minibuffer, read_minibuf_unwind):
13319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13320 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13321 this simplifies overflow checking. All callers changed.
13322 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13323 (Ftest_completion):
13324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13325 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13326 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13327 Check that fixnums are in proper range for system types.
13328 (Fx_create_frame, Fx_show_tip):
13329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13330 * nsfont.m (ns_findfonts, nsfont_list_family):
13331 Don't assume fixnum fits in long.
13332 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13334 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13336 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13338 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13339 (PRINTDECLARE, PRINTPREPARE):
13340 (strout, print_string):
13341 (print, print_preprocess, print_check_string_charset_prop)
13343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13345 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13347 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13348 (printchar, strout): Use xpalloc to catch size calculation overflow.
13349 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13350 (print_error_message): Use SAFE_ALLOCA, not alloca.
13351 (print_object): Use int, not EMACS_INT, where int is wide enough.
13352 (print_depth, new_backquote_output, print_number_index):
13353 Use ptrdiff_t, not int, where int might not be wide enough.
13354 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13355 (Fset_process_window_size, Fformat_network_address)
13356 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13358 Check that fixnums are in proper range for system types.
13359 (Fsignal_process): Simplify by avoiding a goto.
13360 Check for process-ids out of pid_t range rather than relying on
13361 undefined behavior.
13362 (process_tick, update_tick): Use EMACS_INT, not int.
13363 (Fformat_network_address, read_process_output, send_process)
13364 (Fprocess_send_region, status_notify):
13365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13366 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13367 (wait_reading_process_output, read_process_output, exec_sentinel):
13368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13369 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13370 (Faccept_process_output): Use duration_to_sec_usec to do proper
13371 overflow checking on durations.
13372 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13373 Don't assume pid_t fits in int.
13374 * process.h (struct Lisp_Process): Members tick and update_tick
13375 are now of type EMACS_INT, not int.
13376 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13377 configured --with-wide-int.
13378 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13379 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13380 * search.c (looking_at_1, string_match_1):
13381 (fast_string_match, fast_c_string_match_ignore_case)
13382 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13383 (scan_newline, find_before_next_newline, search_command)
13384 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13385 (set_search_regs, wordify):
13388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13389 (string_match_1, search_buffer, set_search_regs):
13391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13392 (wordify): Check for overflow in size calculation.
13393 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13394 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13395 Check that fixnums are in proper range for system types.
13396 * sound.c (struct sound_device)
13397 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13399 (Fplay_sound_internal):
13400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13401 * syntax.c (struct lisp_parse_state, find_start_modiff)
13402 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13403 (Fparse_partial_sexp):
13404 Don't assume fixnums can fit in int.
13405 (struct lisp_parse_state, find_start_pos, find_start_value)
13406 (find_start_value_byte, find_start_begv)
13407 (update_syntax_table, char_quoted, dec_bytepos)
13408 (find_defun_start, prev_char_comend_first, back_comment):
13409 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13410 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13411 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13412 (Finternal_describe_syntax_value): Check that match_lisp is a
13413 character, not an integer, since the code stuffs it into int.
13414 (scan_words, scan_sexps_forward):
13415 Check that fixnums are in proper range for system types.
13417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13418 (scan_sexps_forward):
13419 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13420 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13421 * syntax.h: Adjust decls to match defn changes elsewhere.
13422 (struct gl_state_s):
13423 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13424 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13425 MOST_POSITIVE_FIXNUM.
13426 * sysdep.c (wait_for_termination_1, wait_for_termination)
13427 (interruptible_wait_for_termination, mkdir):
13428 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13429 (emacs_read, emacs_write):
13430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13431 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13432 and double all fit in int.
13433 * term.c (set_tty_color_mode):
13434 Check that fixnums are in proper range for system types.
13435 * termhooks.h (struct input_event):
13436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13437 * textprop.c (validate_interval_range, interval_of)
13438 (Fadd_text_properties, set_text_properties_1)
13439 (Fremove_text_properties, Fremove_list_of_text_properties)
13440 (Ftext_property_any, Ftext_property_not_all)
13441 (copy_text_properties, text_property_list, extend_property_ranges)
13442 (verify_interval_modification):
13443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13444 (Fnext_single_char_property_change)
13445 (Fprevious_single_char_property_change):
13446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13447 (copy_text_properties):
13448 Check for integer overflow in index calculation.
13449 * undo.c (last_boundary_position, record_point, record_insert)
13450 (record_delete, record_marker_adjustment, record_change)
13451 (record_property_change):
13452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13453 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13455 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13456 (Fx_hide_tip, Fx_file_dialog):
13457 * w32menu.c (set_frame_menubar):
13458 Use ptrdiff_t, not int, for consistency with rest of code.
13459 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13460 (select_window, Fdelete_other_windows_internal)
13461 (window_scroll_pixel_based, window_scroll_line_based)
13462 (Frecenter, Fset_window_configuration):
13463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13464 (Fset_window_hscroll, run_window_configuration_change_hook)
13465 (set_window_buffer, temp_output_buffer_show, scroll_command)
13466 (Fscroll_other_window, Frecenter):
13467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13468 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13469 Don't assume fixnum fits in int.
13470 (Fset_window_scroll_bars):
13471 Check that fixnums are in proper range for system types.
13472 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13473 (string_pos, c_string_pos, number_of_chars, init_iterator)
13474 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13475 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13476 (compute_display_string_end, handle_face_prop)
13477 (face_before_or_after_it_pos, handle_invisible_prop)
13478 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13479 (display_prop_intangible_p, string_buffer_position_lim)
13480 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13481 (get_overlay_strings_1, get_overlay_strings)
13482 (iterate_out_of_display_property, forward_to_next_line_start)
13483 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13484 (get_next_display_element, set_iterator_to_next)
13485 (get_visually_first_element, compute_stop_pos_backwards)
13486 (handle_stop_backwards, next_element_from_buffer)
13487 (move_it_in_display_line_to, move_it_in_display_line)
13488 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13489 (add_to_log, message_dolog, message_log_check_duplicate)
13490 (message2, message2_nolog, message3, message3_nolog
13491 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13492 (current_message_1, truncate_echo_area, truncate_message_1)
13493 (set_message, set_message_1, store_mode_line_noprop)
13494 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13495 (text_outside_line_unchanged_p, check_point_in_composition)
13496 (reconsider_clip_changes)
13497 (redisplay_internal, set_cursor_from_row, try_scrolling)
13498 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13499 (redisplay_window, find_last_unchanged_at_beg_row)
13500 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13501 (trailing_whitespace_p, find_row_edges, display_line)
13502 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13503 (display_mode_element, store_mode_line_string)
13504 (pint2str, pint2hrstr, decode_mode_spec)
13505 (display_count_lines, display_string, draw_glyphs)
13506 (x_produce_glyphs, x_insert_glyphs)
13507 (rows_from_pos_range, mouse_face_from_buffer_pos)
13508 (fast_find_string_pos, mouse_face_from_string_pos)
13509 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13511 (safe_call, init_from_display_pos, handle_fontified_prop)
13512 (handle_single_display_spec, load_overlay_strings)
13513 (with_echo_area_buffer, setup_echo_area_for_printing)
13514 (display_echo_area, echo_area_display)
13515 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13516 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13517 (redisplay_window, dump_glyph_row, display_mode_line)
13518 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13519 (handle_display_spec, display_prop_string_p):
13520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13521 (handle_single_display_spec, build_desired_tool_bar_string)
13522 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13523 (get_specified_cursor_type):
13524 Check that fixnums are in proper range for system types.
13525 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13526 (Flookup_image_map):
13527 Don't assume fixnums fit in int.
13528 (compare_overlay_entries):
13529 Avoid mishandling comparisons due to subtraction overflow.
13530 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13531 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13532 (handle_tool_bar_click):
13533 Use int, not unsigned, since we prefer signed and the signedness
13534 doesn't matter here.
13535 (get_next_display_element, next_element_from_display_vector):
13536 Use int, not EMACS_INT, when int is wide enough.
13537 (start_hourglass): Use duration_to_sec_usec to do proper
13538 overflow checking on durations.
13539 * xfaces.c (Fbitmap_spec_p):
13540 Check that fixnums are in proper range for system types.
13541 (compare_fonts_by_sort_order):
13542 Avoid mishandling comparisons due to subtraction overflow.
13543 (Fx_family_fonts, realize_basic_faces):
13544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13546 Don't assume fixnum fits in int.
13547 Use SAFE_ALLOCA_LISP, not alloca.
13548 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13549 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13550 (face_at_buffer_position, face_for_overlay_string)
13551 (face_at_string_position):
13552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13553 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13554 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13556 Check that fixnums are in proper range for system types.
13557 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13558 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13560 (Fx_change_window_property): Don't assume fixnums fit in int.
13561 * xfont.c (xfont_chars_supported):
13562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13563 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13564 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13566 * xml.c (parse_region):
13567 * xrdb.c (magic_file_p):
13568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13569 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13570 (x_get_local_selection, x_reply_selection_request)
13571 (x_handle_selection_request, wait_for_property_change):
13572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13573 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13574 short is wide enough.
13575 (x_send_client_event): Don't assume fixnum fits in int.
13576 * xterm.c (x_x_to_emacs_modifiers):
13577 Don't assume EMACS_INT overflows nicely into int.
13578 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13579 may come from Lisp.
13580 (handle_one_xevent): NATNUMP can eval its arg twice.
13581 (x_connection_closed):
13582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13583 * xterm.h: Adjust decls to match defn changes elsewhere.
13584 (struct scroll_bar): Use struct vectorlike_header
13585 rather than rolling our own approximation.
13586 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13588 2012-05-25 Glenn Morris <rgm@gnu.org>
13590 * lisp.mk (lisp): Update for more files being compiled now.
13592 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13594 * lread.c: Remove `read_pure' which makes no difference.
13595 (read_pure): Remove var.
13596 (unreadpure): Remove function.
13597 (readevalloop): Don't call read_list with -1 flag.
13598 (read1, read_vector): Don't test read_pure any more.
13599 (read_list): Simplify.
13601 * fileio.c, character.h: Minor style tweaks.
13603 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13605 * window.h (clip_changed): Remove useless declaration.
13607 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13609 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13610 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13612 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13615 This directory predates autoconf and is no longer needed nowadays.
13616 Move its few remaining bits of functionality to where they're needed.
13617 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13618 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13619 * m/template.h: Remove.
13620 * Makefile.in (M_FILE): Remove. All uses removed.
13621 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13622 * lisp.h (USE_LSB_TAG):
13623 * mem-limits.h (EXCEEDS_LISP_PTR):
13624 Use VAL_MAX, not VALBITS, in #if.
13625 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13626 (EMACS_UINT): Define unconditionally now.
13627 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13628 (BITS_PER_EMACS_INT): New constants, replacing
13629 what used to be in config.h, but not useful in #if.
13630 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13631 define them any more.
13632 (VAL_MAX): New macro.
13634 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13635 BITS_PER_EMACS_INT, in #if.
13636 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13637 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13638 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13639 * s/ms-w32.h (DATA_START):
13640 Move here from removed file m/intel386.h.
13641 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13642 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13644 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13646 Assume C89 or later.
13647 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13648 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13650 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13651 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13652 * textprop.c, tparam.c (NULL): Remove.
13653 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13654 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13655 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13656 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13657 * xterm.c (input_signal_count): Assume volatile works.
13659 2012-05-21 Ken Brown <kbrown@cornell.edu>
13661 * xgselect.c (xg_select): Fix first argument in call to 'select'
13664 2012-05-20 Ken Brown <kbrown@cornell.edu>
13666 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13667 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13669 2012-05-19 Ken Brown <kbrown@cornell.edu>
13671 * xfns.c (x_in_use): Remove `static' qualifier.
13672 * xterm.h (x_in_use): Declare.
13673 * xgselect.c: Include xterm.h.
13674 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13675 and `display_arg' (bug#9754).
13677 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13679 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13681 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13682 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13684 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13686 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13688 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13689 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13691 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13692 reference to image_cache->refcount.
13693 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13695 2012-05-17 Juri Linkov <juri@jurta.org>
13697 * search.c (Fword_search_regexp, Fword_search_backward)
13698 (Fword_search_forward, Fword_search_backward_lax)
13699 (Fword_search_forward_lax): Move functions to isearch.el
13700 (bug#10145, bug#11381).
13702 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13704 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13706 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13708 * lread.c (init_obarray): Declare Qt and Qnil as special.
13710 2012-05-14 Glenn Morris <rgm@gnu.org>
13712 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13713 Put "libexec" before "bin", for the sake of init_callproc_1.
13715 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13717 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13719 * unexaix.c: Port to more-recent AIX compilers.
13720 (report_error, report_error_1, make_hdr, copy_sym)
13721 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13722 Make arguments const char *, not char *, to avoid violations of C
13723 standard and to fix some AIX warnings reported by Gilles Pion.
13725 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13727 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13728 already have overlays loaded.
13729 (handle_single_display_spec): Before returning without displaying
13730 fringe bitmap, synchronize the bidi iterator with the main display
13731 iterator, by calling iterate_out_of_display_property.
13732 (iterate_out_of_display_property): Detect buffer iteration by
13733 testing that it->string is a Lisp string.
13734 (get_next_display_element): When the current object is exhausted,
13735 and there's something on it->stack, call set_iterator_to_next to
13736 proceed with what's on the stack, instead of returning zero.
13737 (set_iterator_to_next): If called at the end of a Lisp string,
13738 proceed to consider_string_end without incrementing string
13739 position. Don't increment display vector index past the end of
13740 the display vector. (Bug#11417)
13741 (pos_visible_p): Don't report a position visible when move_it_to
13742 stopped at the last line of window, which happens to be scanned
13743 backwards by the bidi iteration. (Bug#11464)
13745 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13747 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13748 and right-margin display specs even if the spec is invalid or we
13749 are on a TTY, and thus unable to display on the fringes.
13750 That's because the text with the property will not be displayed anyway,
13751 so we need to signal to the caller that this is a "replacing"
13752 display spec. This fixes display when the spec is invalid or we
13755 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13757 * unexaix.c (make_hdr): Fix typo in prototype.
13758 This bug broke the build on AIX. Problem reported by Gilles Pion.
13760 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13762 * keyboard.c (kbd_buffer_get_event): Read special events also in
13763 batch mode. (Bug#11415)
13765 2012-05-12 Glenn Morris <rgm@gnu.org>
13767 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13769 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13771 * lisp.mk (lisp): Add newcomment.elc.
13773 2012-05-12 Glenn Morris <rgm@gnu.org>
13775 * Makefile.in (MKDIR_P): New, set by configure.
13776 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13778 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13780 Remove unused function hourglass_started.
13781 * dispextern.h (hourglass_started):
13782 * w32fns.c (hourglass_started):
13783 * xdisp.c (hourglass_started): Remove.
13785 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13787 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13788 Update dependencies.
13790 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13792 * xgselect.c (xg_select): Put maxfds+1 into a var.
13793 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13795 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13797 2012-05-10 Dave Abrahams <dave@boostpro.com>
13799 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13800 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13802 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13804 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13805 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13806 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13807 Initialize xd_registered_buses.
13809 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13811 Untag more efficiently if USE_LSB_TAG.
13812 This is based on a proposal by YAMAMOTO Mitsuharu in
13813 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13814 For an admittedly artificial (nth 8000 longlist) benchmark on
13815 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13816 Emacs's overall text size by 1%.
13817 * lisp.h (XUNTAG): New macro.
13818 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13819 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13820 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13821 * eval.c (Fautoload):
13822 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13823 * frame.h (XFRAME): Use XUNTAG.
13825 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13826 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13827 Remove unportable assumptions about print widths of types like
13829 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13830 intptr_t when converting between pointer and integer, to avoid GCC
13831 warnings about wrong width.
13833 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13835 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13836 stack for each reader_thread, instead of defaulting to 8MB
13837 determined by the linker. This avoids failures in creating
13838 subprocesses on Windows 7, see the discussion in this thread:
13839 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13841 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13843 Fix up display of the *Minibuf-0* buffer in the mini window.
13844 * keyboard.c (read_char): Don't clear the echo area if there's no
13846 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13847 contents of *Minibuf-0*) if there's no message displayed in its stead.
13849 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13851 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13854 2012-05-06 Chong Yidong <cyd@gnu.org>
13856 * lisp.mk (lisp): Update.
13858 2012-05-05 Jim Meyering <meyering@redhat.com>
13860 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13862 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13864 * data.c (PUT_ERROR): New macro.
13865 (syms_of_data): Use it. Add new error type `user-error'.
13866 * undo.c (user_error): New function.
13867 (Fprimitive_undo): Use it.
13868 * print.c (print_error_message): Adjust print style for `user-error'.
13869 * keyboard.c (user_error): New function.
13870 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13872 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13874 Do not limit current-time-string to years 1000..9999.
13875 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13876 (Fcurrent_time_string): Support any year that is supported by the
13877 underlying localtime representation. Don't use asctime, as it
13878 has undefined behavior for years outside the range -999..9999.
13880 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13882 Fix race conditions involving setenv, gmtime, localtime, asctime.
13883 Without this fix, interrupts could mess up code that uses these
13884 nonreentrant functions, since setting TZ invalidates existing
13885 tm_zone or tzname values, and since most of these functions return
13886 pointers to static storage.
13887 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13888 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13889 Grow the critical sections to include not just invoking
13890 localtime/gmtime, but also accessing these functions' results
13891 including their tm_zone values if any, and any related TZ setting.
13892 (format_time_string): Last arg is now struct tm *, not struct tm **,
13893 so that the struct tm is saved in the critical section.
13894 All callers changed. Simplify allocation of initial buffer, partly
13895 motivated by the fact that memory allocation needs to be outside
13896 the critical section.
13898 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13900 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13901 with RESET_INTERVAL.
13903 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13904 Remove duplicated buffer name initialization.
13906 2012-05-02 Jim Meyering <jim@meyering.net>
13908 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13910 * xfns.c (x_window): Use xstrdup (Bug#11375).
13912 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13914 * xdisp.c (pos_visible_p): If already at a newline from the
13915 display string before the 'while' loop, don't walk back the glyphs
13916 from it3.glyph_row. Solves assertion violation when the display
13917 string begins with a newline (egg.el). (Bug#11367)
13919 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13921 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13924 2012-05-01 Glenn Morris <rgm@gnu.org>
13926 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13927 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13928 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13929 All were removed before 23.1.
13931 * dispnew.c: Remove HAVE_LIBNCURSES test;
13932 it is always true on relevant platforms.
13934 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13935 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13937 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13939 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13941 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13942 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13945 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13947 Do not avoid creating empty evaporating overlays (Bug#9642).
13948 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13949 That is, do not delete an evaporating overlay if it becomes
13950 empty after its bounds are adjusted to fit within its buffer.
13951 This fix caused other problems, and I'm reverting it until we get
13952 to the bottom of them.
13954 2012-04-27 Chong Yidong <cyd@gnu.org>
13956 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13958 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13960 * xdisp.c (pos_visible_p): If the window start position is beyond
13961 ZV, start the display from buffer beginning. Prevents assertion
13962 violation in init_iterator when the minibuffer window is scrolled
13963 via the scroll bar.
13965 * window.c (window_scroll_pixel_based): Likewise.
13967 2012-04-27 Chong Yidong <cyd@gnu.org>
13969 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13971 2012-04-27 Glenn Morris <rgm@gnu.org>
13973 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13974 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13976 2012-04-27 Eli Zaretskii <eliz@gnu.org>
13978 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13979 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
13981 2012-04-26 Eli Zaretskii <eliz@gnu.org>
13983 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13984 display element, check also the underlying string or buffer
13985 character. (Bug#11341)
13987 * w32menu.c: Include w32heap.h.
13988 (add_menu_item): If the call to AppendMenuW (via
13989 unicode_append_menu) fails, disable Unicode menus only if we are
13990 running on Windows 9X/Me.
13992 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13994 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13995 (xgetint): Add missing shift for LSB tags.
13997 2012-04-24 Martin Rudalics <rudalics@gmx.at>
13999 * keyboard.c (read_char): Don't wipe echo area for select window
14000 events: These might get delayed via `mouse-autoselect-window'
14003 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14005 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14006 manipulation of :loaded-from data.
14008 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14010 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14011 now a cons (bug#11311).
14013 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14015 Do not create empty overlays with the evaporate property (Bug#9642).
14016 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14017 if it becomes empty after its bounds are adjusted to fit within
14018 its buffer. Without this fix, in a nonempty buffer (let ((o
14019 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14020 yields an empty overlay that has the evaporate property, which is
14021 not supposed to happen.
14023 Fix minor GTK3 problems found by static checking.
14024 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14025 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14026 (struct _EmacsFixedClass, emacs_fixed_get_type):
14027 Move decls here from emacsgtkfixed.h, since they needn't be public.
14028 (emacs_fixed_get_type): Now static.
14029 (emacs_fixed_class_init): Omit unused local.
14030 (emacs_fixed_child_type): Remove; unused.
14031 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14032 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14033 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14034 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14035 (EMACS_FIXED_GET_CLASS): Remove; unused.
14036 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14038 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14039 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14041 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14043 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14044 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14045 (__malloc_size_t, __malloc_ptrdiff_t):
14046 Remove. All uses removed, replaced by the definiens if needed,
14047 since we can assume C89 or better now.
14048 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14049 (protect_malloc_state, align, get_contiguous_space)
14050 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14051 (malloc_atfork_handler_child, malloc_enable_thread)
14052 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14053 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14054 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14055 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14056 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14057 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14058 Define using prototypes, not old style.
14059 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14060 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14061 (align): Don't assume that signed integer overflow wraps around.
14062 Omit unused local var.
14063 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14064 (_free_internal_nolock, memalign, mallochook, reallochook):
14065 Omit no-longer-needed casts.
14066 (valloc): Use getpagesize, not __getpagesize.
14067 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14068 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14070 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14072 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14074 Move functions from C to Lisp. Make non-blocking method calls
14075 the default. Implement further D-Bus standard interfaces.
14077 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14078 (QCdbus_request_name_allow_replacement)
14079 (QCdbus_request_name_replace_existing)
14080 (QCdbus_request_name_do_not_queue)
14081 (QCdbus_request_name_reply_primary_owner)
14082 (QCdbus_request_name_reply_in_queue)
14083 (QCdbus_request_name_reply_exists)
14084 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14085 (QCdbus_registered_serial, QCdbus_registered_method)
14086 (QCdbus_registered_signal): New Lisp objects.
14087 (XD_DEBUG_MESSAGE): Use sizeof.
14088 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14089 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14090 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14091 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14092 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14093 (xd_signature, xd_append_arg): Allow float for integer types.
14094 (xd_get_connection_references): New function.
14095 (xd_get_connection_address): Rename from xd_initialize.
14096 Return cached address.
14097 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14098 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14100 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14101 Return number of refcounts.
14102 (Fdbus_get_unique_name): Make stronger parameter check.
14103 (Fdbus_message_internal): New defun.
14104 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14105 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14106 (Fdbus_send_signal, Fdbus_register_service)
14107 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14108 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14109 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14110 (Vdbus_compiled_version, Vdbus_runtime_version)
14111 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14112 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14113 (Vdbus_message_type_signal): New defvars.
14114 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14117 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14119 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14120 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14121 Do not assume ptrdiff_t is the same width as 'int'.
14123 * alloc.c: Handle unusual debugging option combinations.
14124 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14125 since the two debugging options are incompatible.
14126 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14128 (mem_init, mem_insert, mem_insert_fixup):
14129 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14130 (NEED_MEM_INSERT): Remove; no longer needed.
14132 2012-04-22 Leo Liu <sdl.web@gmail.com>
14134 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14136 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14138 * sysdep.c [__FreeBSD__]: Minor cleanups.
14139 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14140 Use Emacs indenting style more consistently. Avoid some casts.
14141 Use 'double' consistently rather than mixing 'float' and 'double'.
14143 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14145 * sysdep.c (list_system_processes, system_process_attributes):
14146 Add implementation for FreeBSD (Bug#5243).
14148 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14150 * lisp.mk (lisp): Update.
14152 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14154 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14155 It is never used otherwise.
14157 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14159 * print.c (print_preprocess): Only check print_depth if print-circle
14161 (print_object): Check for cycles even when print-circle is nil and
14162 print-gensym is t, but only check print_depth if print-circle is nil.
14164 2012-04-20 Chong Yidong <cyd@gnu.org>
14166 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14167 set the status to "failed" and ensure that sentinel is run.
14169 2012-04-20 Glenn Morris <rgm@gnu.org>
14171 * process.c (Fset_process_inherit_coding_system_flag)
14172 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14173 (Fmake_network_process, Fmake_serial_process): Doc fix.
14175 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14177 * xdisp.c (string_buffer_position_lim): Limit starting position to
14179 (set_cursor_from_row): If called for a mode-line or header-line
14180 row, return zero immediately.
14181 (try_cursor_movement): If inside continuation line, don't back up
14182 farther than the first row after the header line, if any.
14183 Don't consider the header-line row as "partially visible", even if
14184 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14186 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14188 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14191 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14192 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14194 configure: new option --enable-gcc-warnings (Bug#11207)
14195 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14196 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14197 (ALL_CFLAGS): Use new macros rather than old.
14198 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14199 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14200 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14201 -Wunused-result, -Wunused-variable. This should go away once
14202 the Emacs and Gnulib regex code is merged.
14203 (xmalloc, xrealloc): Now static.
14205 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14207 * dired.c (Fsystem_groups): Remove unused local.
14209 2012-04-17 Glenn Morris <rgm@gnu.org>
14211 * dired.c (Fsystem_users): Doc fix.
14213 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14215 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14216 (syms_of_dired): Add them.
14218 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14220 Fix minor alloc.c problems found by static checking.
14221 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14222 New extern decls, to avoid calling undeclared functions.
14223 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14224 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14225 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14226 (NEED_MEM_INSERT): New macro.
14227 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14228 Remove one incorrect comment and fix another.
14230 Fix minor ralloc.c problems found by static checking.
14231 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14232 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14233 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14234 (r_alloc_sbrk): Now static.
14236 Improve ralloc.c interface checking.
14237 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14238 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14239 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14240 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14241 [REL_ALLOC]: ... to here, to check interface.
14242 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14243 Remove decls. This fixes an "It stinks!".
14245 * alloc.c (which_symbols): Fix alignment issue / type clash.
14247 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14249 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14250 (struct Lisp_Misc_Any): Likewise.
14251 (struct Lisp_Free): Likewise.
14252 * alloc.c (union aligned_Lisp_Symbol): Define.
14253 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14254 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14255 (union aligned_Lisp_Misc): Define.
14256 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14257 aligned_Lisp_Misc instead of union Lisp_Misc.
14258 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14260 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14262 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14263 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14264 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14265 * s/netbsd.h, s/sol2-6.h:
14266 Remove definition of GC_MARK_STACK, since the default now works.
14267 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14268 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14269 no longer the default.
14270 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14272 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14274 * lread.c (lisp_file_lexically_bound_p):
14275 Fix hang at ";-*-\n" (bug#11238).
14277 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14279 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14280 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14282 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14284 * nsterm.m (constrainFrameRect): Always constrain when there is only
14285 one screen (Bug#10962).
14287 2012-04-13 Ken Brown <kbrown@cornell.edu>
14289 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14291 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14293 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14295 2012-04-11 Daniel Colascione <dancol@dancol.org>
14297 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14298 against is gone. It's better to use vfork now so that when Cygwin
14299 gains a new, working vfork, we use it automatically (bug#10398).
14301 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14303 * window.c (save_window_save): Obey window-point-insertion-type.
14305 2012-04-11 Glenn Morris <rgm@gnu.org>
14307 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14309 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14311 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14313 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14315 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14316 (force_quit_count): New var.
14317 (handle_interrupt): Use it.
14319 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14321 * w32.c (w32_delayed_load): Record the full path of the library
14322 being loaded (bug#10424).
14324 2012-04-09 Glenn Morris <rgm@gnu.org>
14326 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14327 not just in the obarray, before snarfing them. (Bug#11036)
14329 * Makefile.in ($(leimdir)/leim-list.el):
14330 Pass EMACS rather than BUILT_EMACS.
14332 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14334 * process.c (make_process):
14335 * process.h: Add integer `gnutls_handshakes_tried' member to
14338 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14339 Add convenience `GNUTLS_LOG2i' macro.
14341 * gnutls.c (gnutls_log_function2i): Convenience log function.
14342 (emacs_gnutls_read): Use new log functions,
14343 `gnutls_handshakes_tried' process member, and
14344 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14345 attempts per process (connection).
14347 2012-04-09 Chong Yidong <cyd@gnu.org>
14349 * eval.c (Fuser_variable_p, user_variable_p_eh)
14350 (lisp_indirect_variable): Functions deleted.
14351 (Fdefvar): Caller changed.
14353 * callint.c (Finteractive, Fcall_interactively):
14354 * minibuf.c (Fread_variable): Callers changed.
14356 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14358 * xdisp.c (set_cursor_from_row): If the display string appears in
14359 the buffer at position that is closer to point than the position
14360 after the display string, display the cursor on the first glyph of
14361 the display string. Fixes cursor display when a 'display' text
14362 property immediately follows invisible text. (Bug#11094)
14364 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14366 composite.c: use 'double' consistently
14367 * composite.c (get_composition_id): Use 'double' consistently
14368 instead of converting 'float' to 'double' and vice versa; this is
14369 easier to understand and avoids a GCC warning.
14371 2012-04-09 Glenn Morris <rgm@gnu.org>
14373 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14374 preparation for dumping it with emacs. (Bug#4789)
14375 (leimdir): New variable.
14376 ($(leimdir)/leim-list.el): New rule.
14377 (emacs$(EXEEXT)): Depend on leim-list.el.
14379 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14380 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14381 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14383 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14385 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14388 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14390 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14391 Remove unused local variable.
14393 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14395 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14396 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14397 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14398 objects, as mark_maybe_pointer will catch them otherwise.
14399 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14400 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14402 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14404 Fix typo that broke non-Windows builds.
14405 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14407 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14409 Support building on MS-Windows with libxml2.
14411 * makefile.w32-in (OBJ2): Add xml.$(O).
14412 (GLOBAL_SOURCES): Add xml.c.
14413 ($(BLD)/xml.$(O)): New dependency list.
14415 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14416 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14417 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14418 [!WINDOWSNT]: New macros.
14419 (init_libxml2_functions, libxml2_loaded_p): New functions.
14420 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14421 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14422 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14423 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14425 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14426 Call init_libxml2_functions before calling libxml2 functions.
14427 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14429 * emacs.c: Don't include libxml/parser.h.
14430 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14431 xmlCleanupParser directly.
14433 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14435 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14437 * indent.c (Fvertical_motion): If there is a display string at
14438 point, use it.vpos to compute how many lines to backtrack after
14439 move_it_to point. (Bug#11133)
14441 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14443 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14444 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14445 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14446 macros related to unification of CJK characters. For the details,
14447 see the discussion following the message here:
14448 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14450 2012-04-04 Chong Yidong <cyd@gnu.org>
14452 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14454 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14456 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14457 instead of alloca. (Bug#11138)
14459 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14461 * w32menu.c (is_simple_dialog): Properly check lisp types.
14464 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14466 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14467 position we get to after a call to move_it_to fails the
14468 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14469 only if we wind up in a string from display property. (Bug#11063)
14471 * window.c (Fdelete_other_windows_internal): Invalidate the row
14472 and column information about mouse highlight, so that redisplay
14473 restores it after reallocating the glyph matrices. (Bug#7464)
14475 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14476 string comes from a `display' text property, use the buffer
14477 position of that property as if we actually saw that position in
14479 (move_it_by_lines): Remove the assertion that
14480 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14481 violated when there's a before-string at the beginning of a line.
14484 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14486 * xdisp.c (append_space_for_newline): If the default face was
14487 remapped, use the remapped face for the appended newline.
14488 (extend_face_to_end_of_line): Use the remapped default face for
14489 extending the face to the end of the line.
14490 (display_line): Call extend_face_to_end_of_line when the default
14491 face was remapped. (Bug#11068)
14493 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14495 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14497 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14499 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14501 2012-03-27 Glenn Morris <rgm@gnu.org>
14503 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14506 2012-03-26 Kenichi Handa <handa@m17n.org>
14508 * dispextern.h (struct glyph): Fix previous change. Change the
14509 bit length of glyphless.ch to 25 (Bug#11082).
14511 2012-03-26 Chong Yidong <cyd@gnu.org>
14513 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14514 (command_loop_1): Use it; inhibit selection update for
14515 handle-select-window too (Bug#8996).
14517 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14519 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14521 2012-03-25 Kenichi Handa <handa@m17n.org>
14523 * dispextern.h (struct glyph): Change the bit length of
14524 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14526 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14528 * s/ms-w32.h (tzname): Include time.h before redirecting to
14529 _tzname. Fixes the MSVC build. (Bug#9960)
14531 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14533 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14536 * xterm.c (XTread_socket): Only modify handling_signal if
14537 !SYNC_INPUT. (Bug#11080)
14539 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14541 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14542 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14543 when fetching a multibyte character consumes more bytes than
14544 CHAR_BYTES returns, due to unification of CJK characters in
14545 string_char. (Bug#11073)
14547 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14549 * process.c (wait_reading_process_output): Handle pty disconnect
14550 by refraining from sending oneself a SIGCHLD (bug#10933).
14552 2012-03-22 Chong Yidong <cyd@gnu.org>
14554 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14556 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14557 Mark string as coming from a prefix property.
14558 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14559 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14561 2012-03-21 Chong Yidong <cyd@gnu.org>
14563 * xfaces.c (Vface_remapping_alist): Doc fix.
14565 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14567 * w32proc.c (Fw32_set_console_codepage)
14568 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14571 2012-03-20 Chong Yidong <cyd@gnu.org>
14573 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14574 to reflect default non-nil value of redisplay-dont-pause.
14576 2012-03-19 Kenichi Handa <handa@m17n.org>
14578 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14579 it fit in a valid range (Bug#11003).
14581 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14583 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14584 that is not from display property, accept the row as a "cursor
14585 row" if one of the string's character has a non-nil `cursor'
14586 property. Fixes cursor positioning when there are newlines in
14587 overlay strings, e.g. in icomplete.el. (Bug#11035)
14589 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14591 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14593 2012-03-12 Chong Yidong <cyd@gnu.org>
14595 * eval.c (inhibit_lisp_code): Rename from
14596 inhibit_window_configuration_change_hook; move from window.c.
14598 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14599 * window.c (run_window_configuration_change_hook)
14600 (syms_of_window): Callers changed.
14602 2012-03-11 Chong Yidong <cyd@gnu.org>
14604 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14606 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14608 2012-03-10 Chong Yidong <cyd@gnu.org>
14610 * frame.c (other_visible_frames): Don't assume the selected frame
14611 is visible (Bug#10955).
14613 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14615 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14617 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14619 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14620 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14623 2012-03-03 Glenn Morris <rgm@gnu.org>
14625 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14627 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14629 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14630 position past the first glyph_row that ends at ZV. (Bug#10902)
14631 (redisplay_window, next_element_from_string): Fix typos in
14633 (redisplay_window): Pass to move_it_vertically the margin in
14634 pixels, not in screen lines.
14636 2012-03-02 Glenn Morris <rgm@gnu.org>
14638 * buffer.c (buffer-list-update-hook): Doc fix.
14640 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14642 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14643 push_it before setting up the iterator for the first overlay
14644 string, even if we have an empty string loaded.
14645 (next_overlay_string): If there's an empty string on the iterator
14646 stack, pop the stack. (Bug#10903)
14648 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14650 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14651 Suggested by Stefan Monnier in
14652 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14653 * alloc.c (widen_to_Lisp_Object): New static function.
14654 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14655 and widening them to Lisp_Objects. This would work even if
14656 USE_LSB_TAG is defined and wide integers are used, which might
14657 happen in a future version of Emacs.
14659 2012-02-25 Chong Yidong <cyd@gnu.org>
14661 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14664 * xselect.c (Fx_selection_exists_p): Doc fix.
14665 (x_clipboard_manager_save_all): Print an informative message
14666 before saving to clipboard manager.
14668 2012-02-24 Chong Yidong <cyd@gnu.org>
14670 * keyboard.c (process_special_events): Handle all X selection
14671 requests in kbd_buffer, not just the next one (Bug#8869).
14673 2012-02-23 Chong Yidong <cyd@gnu.org>
14675 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14676 call when setting menu-bar-lines and tool-bar-lines parameters.
14677 (unwind_create_frame_1): New helper function.
14679 * window.c (inhibit_window_configuration_change_hook): New var.
14680 (run_window_configuration_change_hook): Obey it.
14681 (syms_of_window): Initialize it.
14683 2012-02-22 Chong Yidong <cyd@gnu.org>
14685 * xterm.c (x_draw_image_relief): Add missing type check for
14686 Vtool_bar_button_margin (Bug#10743).
14688 2012-02-21 Chong Yidong <cyd@gnu.org>
14690 * fileio.c (Vfile_name_handler_alist): Doc fix.
14692 * buffer.c (Fget_file_buffer): Protect against invalid file
14693 handler return value.
14695 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14697 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14698 when computing $valmask.
14700 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14701 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14702 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14703 It's useless in that case, and it can cause problems on hosts
14704 that allocate halves of EMACS_INT values separately.
14705 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14706 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14707 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14708 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14709 it avoids undefined behavior on hosts where shifting right by more
14710 than the word width has undefined behavior.
14712 2012-02-19 Chong Yidong <cyd@gnu.org>
14714 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14715 (Funhandled_file_name_directory, Ffile_name_as_directory)
14716 (Fdirectory_file_name, Fexpand_file_name)
14717 (Fsubstitute_in_file_name): Protect against invalid file handler
14718 return values (Bug#10845).
14720 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14722 * .gdbinit (pitx): Fix incorrect references to fields of the
14725 2012-02-17 Chong Yidong <cyd@gnu.org>
14727 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14729 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14731 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14732 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14734 2012-02-15 Chong Yidong <cyd@gnu.org>
14736 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14737 marked as special. Also, starting docstrings with * is obsolete.
14739 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14741 * gnutls.c (emacs_gnutls_write): Fix last change.
14743 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14745 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14748 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14750 * keymap.c (Fsingle_key_description): Handle char ranges.
14752 2012-02-12 Chong Yidong <cyd@gnu.org>
14754 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14755 as that creates a dangerous corner case.
14757 * window.c (Fdelete_window_internal): Invalidate the mouse
14758 highlight (Bug#9904).
14760 2012-02-12 Glenn Morris <rgm@gnu.org>
14762 * xselect.c (Fx_own_selection_internal)
14763 (Fx_get_selection_internal, Fx_disown_selection_internal)
14764 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14765 * nsselect.m (Fx_own_selection_internal)
14766 (Fx_disown_selection_internal, Fx_selection_exists_p)
14767 (Fx_selection_owner_p, Fx_get_selection_internal):
14768 Sync docs and argument specs with the xselect.c versions.
14770 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14772 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14774 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14776 * w32select.c (Fx_selection_exists_p): Sync doc string and
14777 argument list with xselect.c. (Bug#10783)
14779 * w16select.c (Fx_selection_exists_p): Sync doc string and
14780 argument list with xselect.c. (Bug#10783)
14782 2012-02-10 Glenn Morris <rgm@gnu.org>
14784 * fns.c (Fsecure_hash): Doc fix.
14786 2012-02-09 Kenichi Handa <handa@m17n.org>
14788 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14790 2012-02-07 Chong Yidong <cyd@gnu.org>
14792 * buffer.c (Fbuffer_local_variables)
14793 (buffer_lisp_local_variables): Handle unbound vars correctly;
14794 don't let Qunbound leak into Lisp.
14796 2012-02-07 Glenn Morris <rgm@gnu.org>
14798 * image.c (Fimagemagick_types): Doc fix.
14800 * image.c (imagemagick-render-type): Change it from a lisp object
14801 to an integer. Move the doc here from the lisp manual.
14802 Treat all values not equal to 0 the same.
14804 2012-02-06 Chong Yidong <cyd@gnu.org>
14806 * doc.c (store_function_docstring): Avoid applying docstring of
14807 alias to base function (Bug#2603).
14809 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14811 * .gdbinit (pp1, pv1): Remove redundant defines.
14814 2012-02-04 Chong Yidong <cyd@gnu.org>
14816 * nsterm.m: Declare a global (Bug#10694).
14818 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14820 * w32.c (get_emacs_configuration_options):
14821 Include --enable-checking, if specified, in the return value.
14823 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14825 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14826 after rounding frame sizes. (Bug#9723)
14828 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14830 * keyboard.c (adjust_point_for_property): Don't position point
14831 before BEGV. (Bug#10696)
14833 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14835 Handle overflow when computing char display width (Bug#9496).
14836 * character.c (char_width): Return EMACS_INT, not int.
14837 (char_width, c_string_width): Check for overflow when
14838 computing the width; this is possible now that individual
14839 characters can have unbounded width. Problem introduced
14840 by merge from Emacs 23 on 2012-01-19.
14842 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14844 * dbusbind.c (Fdbus_register_method): Mention the return value
14845 :ignore in the docstring.
14847 2012-02-02 Glenn Morris <rgm@gnu.org>
14849 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14851 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14852 Unconditionally set to t. (Bug#10673)
14853 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14854 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14855 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14857 2012-02-02 Kenichi Handa <handa@m17n.org>
14859 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14860 0, do not call append_composite_glyph.
14862 2012-02-02 Kenichi Handa <handa@m17n.org>
14864 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14866 (x_produce_glyphs): If the component of a composition is a null
14867 string, set it->pixel_width to 1 to avoid zero-width glyph.
14869 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14871 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14872 first 2 arguments are identical. This makes inserting large
14873 output from a subprocess an order of magnitude faster on
14874 MS-Windows, where all sbrk'ed memory is always contiguous.
14876 2012-01-31 Glenn Morris <rgm@gnu.org>
14878 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14879 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14880 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14882 2012-01-29 Glenn Morris <rgm@gnu.org>
14884 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14886 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14888 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14890 2012-01-28 Chong Yidong <cyd@gnu.org>
14892 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14894 2012-01-26 Chong Yidong <cyd@gnu.org>
14896 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14898 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14899 repeat counts (Bug#10507).
14901 2012-01-26 Glenn Morris <rgm@gnu.org>
14903 * lread.c (syms_of_lread): Doc fix.
14905 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14907 * coding.c (encode_designation_at_bol): Change return value to
14910 2012-01-25 Chong Yidong <cyd@gnu.org>
14912 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14914 2012-01-21 Chong Yidong <cyd@gnu.org>
14916 * floatfns.c (Fcopysign): Make the second argument non-optional,
14917 since nil is not allowed anyway.
14919 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14921 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14922 (send_process): Likewise.
14924 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14926 * window.c (save_window_save, Fcurrent_window_configuration)
14927 (Vwindow_persistent_parameters): Do not use Qstate.
14928 Rewrite doc-strings.
14930 2012-01-19 Kenichi Handa <handa@m17n.org>
14932 * character.c (char_width): New function.
14933 (Fchar_width, c_string_width, lisp_string_width):
14934 Use char_width (Bug#9496).
14936 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14938 * window.c (Vwindow_persistent_parameters): New variable.
14939 (Fset_window_configuration, save_window_save): Handle persistent
14942 2012-01-14 Eli Zaretskii <eliz@gnu.org>
14944 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14945 thrashing the stack of the thread. (Bug#9087)
14947 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14949 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14951 2012-01-11 Eli Zaretskii <eliz@gnu.org>
14953 * xdisp.c (rows_from_pos_range): Handle the case where the
14954 highlight ends on a newline. (Bug#10464)
14955 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14956 he end column for display of highlight that ends on a newline
14959 2012-01-11 Glenn Morris <rgm@gnu.org>
14961 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14962 from load-path also when installation-directory is nil. (Bug#10208)
14964 2012-01-10 Glenn Morris <rgm@gnu.org>
14966 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14968 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14969 Update template values to be closer to their typical values these days.
14971 2012-01-09 Eli Zaretskii <eliz@gnu.org>
14973 * xdisp.c (rows_from_pos_range): Accept additional argument
14974 DISP_STRING, and accept any glyph in a row whose object is that
14975 string as eligible for mouse highlight. Fixes mouse highlight of
14976 display strings from overlays. (Bug#10464)
14978 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
14980 emacs: fix an auto-save permissions race condition (Bug#10400)
14981 * fileio.c (auto_saving_dir_umask): New static var.
14982 (Fmake_directory_internal): Use it.
14983 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14984 creating the directory. The old code temporarily assigns
14985 too-generous permissions to the directory.
14986 (do_auto_save_eh): Clear it.
14987 (Fdo_auto_save): Catch all errors, not just file errors, so
14988 that the var is always cleared.
14990 2012-01-07 Eli Zaretskii <eliz@gnu.org>
14992 * search.c (scan_buffer): Pass character positions to
14993 know_region_cache, not byte positions. (Bug#6540)
14995 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
14997 * w32.c (sys_rename): Report EXDEV when rename of a directory
14998 fails because the target is on another logical disk. (Bug#10284)
15000 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15002 * xterm.c (x_embed_request_focus): New function.
15004 * xterm.h: Add prototype.
15006 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15008 2012-01-05 Glenn Morris <rgm@gnu.org>
15010 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15012 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15014 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15015 Load gnutls_transport_set_lowat only if GnuTLS version is below
15017 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15018 GnuTLS versions below 2.11.1.
15020 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15022 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15023 to the doc string advising against its use for altering the way
15024 windows are scrolled.
15026 2011-12-28 Kenichi Handa <handa@m17n.org>
15028 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15029 coding-system ASCII compatible only when it does not produce BOM
15030 on encoding (Bug#10383).
15032 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15034 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15036 (create_and_show_popup_menu): Always use menu_position_func for
15039 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15041 * callint.c (Fcall_interactively): Don't truncate prompt string.
15043 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15045 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15046 property that ends at ZV, so that the bidi iteration could be
15047 resumed from there (after widening). (Bug#10360)
15049 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15051 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15053 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15055 * nsterm.m (x_free_frame_resources):
15056 Release f->output_data.ns->miniimage.
15057 (ns_index_color): Fix indentation. Do not retain
15058 color_table->colors[i].
15060 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15063 * nsfns.m (x_set_background_color): Assign return value from
15064 ns_index_color to face-background instead of NSColor*.
15065 (ns_implicitly_set_icon_type): Fix indentation.
15066 Change assignment in for loop to comparison.
15068 * emacs.c (ns_pool): New variable.
15069 (main): Assign ns_pool.
15070 (Fkill_emacs): Call ns_release_autorelease_pool.
15072 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15073 autorelease fdesc, release fdAttrs and tdict.
15074 (ns_get_covering_families): Release charset.
15075 (ns_findfonts): Release NSFontDescriptor created with new.
15076 (ns_uni_to_glyphs): Fix indentation.
15077 (setString): Release attrStr before assigning new value.
15079 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15081 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15083 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15084 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15086 2011-12-18 David Reitter <reitter@cmu.edu>
15088 * nsterm.m (ns_term_init): Subscribe for notifications
15089 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15090 to method trackingNotification in EmacsMenu.
15092 * nsmenu.m (trackingMenu): New variable.
15093 (trackingNotification): New method (from Aquamacs).
15094 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15095 from Aquamacs (Bug#7030).
15097 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15099 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15100 (symbol_to_nsstring): Fix indentation.
15101 (ns_symbol_to_pb): New function.
15102 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15103 (Fns_rotate_cut_buffers_internal): Remove.
15104 (Fns_store_selection_internal): Rename from
15105 Fns_store_cut_buffer_internal.
15106 (ns_get_foreign_selection, Fx_own_selection_internal)
15107 (Fx_disown_selection_internal, Fx_selection_exists_p)
15108 (Fns_get_selection_internal, Fns_store_selection_internal):
15109 Use ns_symbol_to_pb and check if return value is nil.
15110 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15111 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15112 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15113 renamed to Sns_store_selection_internal.
15114 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15115 and remove this function.
15116 (ns_handle_selection_clear): Remove, never used.
15117 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15120 2011-12-17 Ken Brown <kbrown@cornell.edu>
15122 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15123 GID is unknown (Bug#10257).
15125 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15127 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15128 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15129 which caused a build failure on GNU/Linux IA-64. This problem was
15130 introduced by my 2011-10-07 patch.
15132 2011-12-15 Juri Linkov <juri@jurta.org>
15134 * image.c (imagemagick_error): New function. (Bug#10112)
15135 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15136 Use `imagemagick_error' where ImageMagick functions return
15138 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15141 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15143 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15144 fill background (Bug#8992).
15146 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15148 * window.c (Vwindow_combination_resize)
15149 (Vwindow_combination_limit): Use t instead of non-nil in
15151 (Vrecenter_redisplay): Add first sentence of doc-string on
15153 (Frecenter): Fix doc-string typo.
15155 2011-12-11 Kenichi Handa <handa@m17n.org>
15157 * coding.c (Funencodable_char_position): Pay attention to the
15158 buffer text relocation (Bug#9389).
15160 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15162 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15163 gtk_init (Bug#10100).
15165 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15167 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15168 IT->string is nil. (Bug#10263)
15170 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15172 * nsterm.h (x_free_frame_resources): Declare.
15174 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15175 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15177 * nsterm.h (ns_get_defaults_value): Declare.
15179 * nsterm.m (ns_default): Call ns_get_defaults_value.
15181 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15183 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15186 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15188 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15189 that where the value of an _OBJC_* symbol points to is in the .bss
15190 section (Bug#10240).
15192 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15194 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15195 after the loop to call ccl_driver at least once (Bug#8619).
15197 2011-12-08 Kenichi Handa <handa@m17n.org>
15199 * ftfont.c (get_adstyle_property): Fix previous change
15202 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15204 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15205 dirs from the default value of EMACSLOADPATH (bug#10208).
15207 2011-12-07 Glenn Morris <rgm@gnu.org>
15209 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15210 installation and source directories as well. (Bug#10208)
15212 2011-12-06 Chong Yidong <cyd@gnu.org>
15214 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15216 2011-12-06 Glenn Morris <rgm@gnu.org>
15218 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15219 as an error, not just -1. (Bug#10217)
15221 2011-12-05 Chong Yidong <cyd@gnu.org>
15223 * keyboard.c (process_special_events): New function.
15224 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15226 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15228 * coding.c (encode_designation_at_bol): Don't use uninitialized
15229 local variable (Bug#9318).
15231 2011-12-05 Kenichi Handa <handa@m17n.org>
15233 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15234 return Qnil (Bug#8046, Bug#10193).
15236 2011-12-05 Kenichi Handa <handa@m17n.org>
15238 * coding.c (encode_designation_at_bol): New args charbuf_end and
15239 dst. Return the number of produced bytes. Callers changed.
15240 (coding_set_source): Return how many bytes coding->source was
15242 (coding_set_destination): Return how many bytes
15243 coding->destination was relocated.
15244 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15245 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15247 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15249 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15250 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15253 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15255 The following changes are to fix Bug#9318.
15257 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15258 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15259 (encode_coding_iso_2022, encode_coding_sjis)
15260 (encode_coding_big5, encode_coding_charset): Use the above macros.
15262 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15264 * lisp.h (process_quit_flag): Fix external declaration.
15266 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15268 Don't macro-inline non-performance-critical code.
15269 * eval.c (process_quit_flag): New function.
15270 * lisp.h (QUIT): Use it.
15272 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15274 * nsfns.m (get_geometry_from_preferences): New function.
15275 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15277 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15279 * emacs.c (Qkill_emacs): Define.
15280 (syms_of_emacs): Initialize it.
15281 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15282 Qquit_flag to `kill-emacs' instead.
15283 (quit_throw_to_read_char): Add parameter `from_signal'.
15284 All callers changed. Call Fkill_emacs if requested and safe.
15285 * lisp.h (QUIT): Call Fkill_emacs if requested.
15287 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15289 * widget.c (update_wm_hints): Return if wmshell is null.
15290 (widget_update_wm_size_hints): New function.
15292 * widget.h (widget_update_wm_size_hints): Declare.
15294 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15295 widget_update_wm_size_hints (Bug#10104).
15297 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15299 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15300 before a newline, prepare the bidi iterator for consuming the
15301 newline, and keep the current paragraph direction. (Bug#10183)
15302 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15304 2011-12-02 Juri Linkov <juri@jurta.org>
15306 * search.c (Fword_search_regexp): New Lisp function created from
15307 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15308 (Fword_search_backward, Fword_search_forward)
15309 (Fword_search_backward_lax, Fword_search_forward_lax):
15310 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15311 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15313 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15315 * fileio.c (Finsert_file_contents): Move after-change-function call
15316 to before the "handled:" label, since all "goto handled" appear in
15317 cases where the *-change-functions have already been properly called
15320 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15322 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15323 waiting for input. (Bug#10169)
15325 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15327 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15328 verifies glyph row's hash code--we have just reallocated the
15329 glyphs, so their contents can be complete garbage. (Bug#10164)
15331 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15333 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15335 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15337 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15338 attributes are tested _before_ calling verify_row_hash, to protect
15339 against GCC re-ordering of the tests. (Bug#10164)
15341 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15343 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15345 * xterm.c (handle_one_xevent): Only set async_visible and friends
15346 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15347 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15348 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15350 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15352 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15353 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15354 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15355 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15356 All uses changed to use GCPRO1 etc.
15357 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15358 Revert to old implementation (i.e., before 2011-03-11).
15360 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15362 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15363 of scroll runs so as to avoid assigning disabled bogus rows and
15364 unnecessary graphics copy operations.
15366 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15368 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15369 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15370 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15371 (malloc, free, realloc, calloc): Redirect to e_* only when
15374 * lisp.h (GCTYPEBITS): Move before first use.
15375 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15376 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15377 this macro definition.
15379 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15382 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15384 * gtkutil.c (xg_create_frame_widgets):
15385 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15386 present with Gtk+ 2.0.
15388 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15390 * fileio.c (Finsert_file_contents): Undo previous change; see
15391 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15393 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15395 Rename locals to avoid shadowing.
15396 * fileio.c (Finsert_file_contents):
15397 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15398 * process.c (wait_reading_process_output):
15399 Rename inner 'proc' to 'p' to avoid shadowing.
15400 Indent for consistency with usual Emacs style.
15402 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15404 * xdisp.c (redisplay_window): If cursor row is not fully visible
15405 after recentering, and scroll-conservatively is set to a large
15406 number, scroll window by a few more lines to make the cursor fully
15407 visible and out of scroll-margin. (Bug#10105)
15408 (start_display): Don't move to the next line if the display should
15409 start at a newline that is part of a display vector or an overlay
15410 string. (Bug#10119)
15412 2011-11-24 Juri Linkov <juri@jurta.org>
15414 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15415 after the `MagickPingImage' call. (Bug#10112)
15417 2011-11-23 Chong Yidong <cyd@gnu.org>
15419 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15421 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15423 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15424 making another buffer current. (Bug#10114)
15426 2011-11-23 Glenn Morris <rgm@gnu.org>
15428 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15430 2011-11-23 Chong Yidong <cyd@gnu.org>
15432 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15433 using it (Bug#5984).
15435 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15437 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15438 and header-lines, as they don't have one computed for them.
15441 * .gdbinit (prow): Make displayed values more self-explaining.
15442 Add row's hash code.
15444 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15446 * process.c (wait_reading_process_output): Fix asynchrounous
15447 GnuTLS socket handling on some versions of the GnuTLS library.
15448 (wait_reading_process_output): Add comment and URL.
15450 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15452 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15454 2011-11-21 Chong Yidong <cyd@gnu.org>
15456 * window.c (Fnext_window, Fprevious_window): Doc fix.
15458 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15460 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15462 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15464 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15466 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15468 * window.c (Fset_window_combination_limit): Rename argument
15470 (Vwindow_combination_limit): Remove "status" from doc-string.
15472 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15474 * m/ibms390.h: Remove.
15475 * m/ibms390x.h: Don't include "ibms390.h".
15477 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15479 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15480 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15482 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15484 * casetab.c (Fset_case_table):
15485 * charset.c (Fcharset_after): Fix typos.
15487 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15489 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15490 Otherwise, valgrind does not work on some platforms.
15491 Problem reported by Andreas Schwab in
15492 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15493 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15494 is set, removing the need for VIRT_ADDRESS_VARIES.
15495 (PURE_P): Use a more-efficient implementation that needs just one
15496 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15497 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15498 to 4 (xorl, subq, cmpq, setbe).
15499 * alloc.c (pure): Always extern now, since that's the
15500 VIRT_ADDR_VARIES behavior.
15501 (PURE_POINTER_P): Use a single comparison, not two, for
15502 consistency with the new puresize.h.
15503 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15504 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15505 Remove VIRT_ADDR_VARIES no longer needed.
15507 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15509 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15510 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15511 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15512 behave as if the cursor position were at the window margin.
15514 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15515 and the cursor position is out of bounds, behave as if the cursor
15516 position were at the window margin. (Bug#10075)
15518 2011-11-18 Chong Yidong <cyd@gnu.org>
15520 * window.c (Fwindow_combination_limit): Make first argument
15521 non-optional, since it is meaningless for live windows like the
15524 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15526 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15528 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15530 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15531 (graft_intervals_into_buffer): Simplify.
15533 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15535 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15536 hash values of the two rows.
15537 (copy_row_except_pointers): Preserve the used[] arrays and the
15538 hash values of the two rows. (Bug#10035)
15539 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15541 * xdisp.c (row_hash): New function, body extracted from
15542 compute_line_metrics.
15543 (compute_line_metrics): Call row_hash, instead of computing the
15546 * dispnew.c (verify_row_hash): Call row_hash for computing the
15547 hash code of a row, instead of duplicating code from xdisp.c.
15549 * dispextern.h (row_hash): Add prototype.
15551 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15553 * frame.c (delete_frame): Don't delete the terminal when the last
15554 X frame is closed if emacs is built with GTK toolkit.
15556 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15558 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15560 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15562 * window.c (Vwindow_splits): Rename to
15563 Vwindow_combination_resize. Suggested by Juri Linkov.
15564 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15567 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15569 * nsfns.m (Fns_font_name):
15570 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15572 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15574 * window.h (window): Rename slot "nest" to "combination_limit".
15575 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15576 (Fset_window_nest): Rename to Fset_window_combination_limit.
15577 (Vwindow_nest): Rename to Vwindow_combination_limit.
15578 (recombine_windows, make_parent_window, make_window)
15579 (Fsplit_window_internal, saved_window)
15580 (Fset_window_configuration, save_window_save): Rename all
15581 occurrences of window_nest to window_combination_limit.
15583 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15585 * image.c (imagemagick_load_image): Fix typo.
15587 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15589 * xdisp.c (display_line): Move the call to
15590 highlight_trailing_whitespace before the call to
15591 compute_line_metrics, since the latter needs to see the final
15592 faces of all the glyphs to compute ROW's hash value.
15593 Fixes assertion violations in row_equal_p. (Bug#10035)
15595 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15597 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15598 just return (bug#10044).
15600 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15602 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15603 with user-defined heap size. Bump the default size of the temacs
15604 heap to 27MB, to avoid memory warning when running temacs.
15605 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15607 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15608 current_matrix and desired_matrix. (Bug#9990)
15609 (verify_row_hash) [XASSERTS]: New function.
15610 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15611 that the hash value of glyph rows is correct.
15613 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15615 * window.h (window): Remove splits slot.
15616 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15617 (Fdelete_other_windows_internal, make_parent_window)
15618 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15619 (Fset_window_configuration, save_window_save): Don't deal with
15620 split status of windows.
15621 (saved_window): Remove splits slot.
15622 (Vwindow_splits): Rewrite doc-string.
15624 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15626 * xfns.c (unwind_create_frame):
15627 * nsfns.m (unwind_create_frame):
15628 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15629 Vframe_list (Bug#9999).
15631 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15633 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15635 2011-11-11 Kenichi Handa <handa@m17n.org>
15637 * callproc.c (Fcall_process): Set the member dst_multibyte of
15640 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15642 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15643 avoid a crash (bug#9496).
15645 2011-11-09 Chong Yidong <cyd@gnu.org>
15647 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15648 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15650 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15652 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15654 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15656 Avoid some portability problems by eschewing 'extern inline' functions.
15657 The trivial performance wins aren't worth the portability hassles; see
15658 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15660 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15661 (window_box_width, window_box_left, window_box_left_offset)
15662 (window_box_right, window_box_right_offset): Undo previous change,
15663 by removing the "extern"s.
15664 * intervals.c (adjust_intervals_for_insertion)
15665 (adjust_intervals_for_deletion): Undo previous change,
15666 making these static again.
15667 (offset_intervals, temp_set_point_both, temp_set_point)
15668 (copy_intervals_to_string): No longer inline.
15669 * xdisp.c (window_text_bottom_y, window_box_width)
15670 (window_box_height, window_box_left_offset)
15671 (window_box_right_offset, window_box_left, window_box_right)
15672 (window_box): No longer inline.
15674 2011-11-08 Chong Yidong <cyd@gnu.org>
15676 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15677 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15678 Signal an error if not a live window.
15679 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15680 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15682 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15684 * lisp.h (syms_of_abbrev): Remove declaration.
15685 Reported by CHENG Gao <chenggao@royau.me>.
15687 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15689 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15690 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15691 of temacs in GUI mode.
15693 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15695 * window.h: Declare delete_all_child_windows instead of
15696 delete_all_subwindows.
15697 * window.c (Fwindow_nest, Fset_window_nest)
15698 (Fset_window_new_total, Fset_window_new_normal)
15699 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15700 (delete_all_subwindows): Rename to delete_all_child_windows.
15701 (Fdelete_other_windows_internal, Fset_window_configuration):
15702 Call delete_all_child_windows instead of delete_all_subwindows.
15703 * frame.c (delete_frame): Call delete_all_child_windows instead
15704 of delete_all_subwindows.
15706 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15708 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15709 This is also needed for porting to any host where GC_MARK_STACK is
15710 not GC_MAKE_GCPROS_NOOPS.
15711 (which_symbols): Use it.
15713 2011-11-07 Kenichi Handa <handa@m17n.org>
15715 * coding.c (coding_set_destination): Check coding->src_pos only
15716 when coding->src_object is a buffer (bug#9910).
15718 * process.c (send_process): Set the member src_multibyte of coding
15719 to 0 (bug#9911) when sending a unibyte text.
15721 * callproc.c (Fcall_process): Set the member src_multibyte of
15722 process_coding to 0 (bug#9912).
15724 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15726 * xmenu.c (cleanup_widget_value_tree): New function.
15727 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15728 calling free_menubar_widget_value_tree directly (Bug#9830).
15730 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15732 Fix some portability problems with 'inline'.
15733 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15734 (window_box_width, window_box_left, window_box_left_offset)
15735 (window_box_right, window_box_right_offset): Declare extern.
15736 Otherwise, these inline functions do not conform to C99 and
15737 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15738 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15739 * intervals.c (adjust_intervals_for_insertion)
15740 (adjust_intervals_for_deletion): Now extern, because otherwise the
15741 extern inline functions 'offset_intervals' couldn't refer to it.
15742 (static_offset_intervals): Remove.
15743 (offset_intervals): Rewrite using the old contents of
15744 static_offset_intervals. The old version didn't conform to C99
15745 because an extern inline function contained a reference to an
15746 identifier with static linkage.
15748 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15750 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15753 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15755 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15756 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15757 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15758 return Qleft_to_right.
15760 2011-11-06 Chong Yidong <cyd@gnu.org>
15762 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15763 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15764 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15765 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15766 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15767 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15768 (Fwindow_vscroll): Doc fix.
15769 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15770 argument, since it makes no sense to pass a live window and for
15771 consistency with window-child.
15773 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15775 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15778 2011-11-05 Jason Rumney <jasonr@gnu.org>
15780 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15781 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15783 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15784 bitwise arithmetic preventing use of unicode-sip and non-truetype
15787 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15789 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15792 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15793 initialization code to keep similarity to xfns.c after changes
15796 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15798 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15799 (unwind_create_frame): New function (Bug#9943).
15800 (Fx_create_frame): Restructure code to be more similar to the one in
15801 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15802 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15803 Move terminal->reference_count++ just before making the frame official
15806 * nsterm.m (x_free_frame_resources): New function.
15807 (x_destroy_window): Move code to x_free_frame_resources.
15809 * xfns.c (unwind_create_frame): Fix comment.
15810 (Fx_create_frame, x_create_tip_frame):
15811 Move terminal->reference_count++ just before making the frame
15812 official. Move initialization of image_cache_refcount and
15813 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15815 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15817 Support MSVC build with newer versions of Visual Studio.
15818 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15819 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15822 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15823 which are not supported by MSVC.
15824 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15825 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15827 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15828 types in bitfields.
15829 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15831 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15833 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15835 Support MSVC build with newer versions of Visual Studio.
15836 * w32.c: Don't include w32api.h for MSVC.
15837 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15839 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15840 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15841 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15842 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15844 (alloca) [_MSC_VER]: Define to _alloca.
15846 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15848 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15850 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15852 * xdisp.c (note_mouse_highlight): If either of
15853 previous/next-single-property-change returns nil, treat that as
15854 the beginning or the end of the buffer. (Bug#9955)
15856 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15858 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15859 label is not null (Bug#9951).
15860 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15863 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15865 * window.c (Fwindow_body_size): Mention in the doc string that the
15866 return value is in frame's canonical units. (Bug#9949)
15868 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15870 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15872 * w32fns.c (unwind_create_frame): If needed, free the glyph
15873 matrices of the partially constructed frame. (Bug#9943)
15874 * xfns.c (unwind_create_frame): Likewise.
15876 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15878 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15879 Don't stop backward scan on the continuation glyph, even though
15880 its CHARPOS is positive.
15881 (mouse_face_from_buffer_pos, note_mouse_highlight):
15882 Rename cover_string to disp_string.
15884 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15886 * window.c (temp_output_buffer_show): Don't use
15887 Vtemp_buffer_show_specifiers.
15888 (Vtemp_buffer_show_specifiers): Remove unused variable.
15890 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15892 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15893 past the beginning of the current glyph matrix.
15895 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15897 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15898 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15899 HAVE_GTK3 (Bug#9869).
15901 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15902 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15904 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15906 * xterm.c: Declare x_handle_net_wm_state to return int.
15907 (handle_one_xevent): Check if we are iconified but don't have
15908 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15909 (get_current_wm_state): Return non-zero if not hidden,
15910 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15911 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15912 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15913 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15915 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15917 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15918 so that this new function doesn't get optimized away by a
15919 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15921 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15923 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15925 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15927 Fix the `xbytecode' command.
15928 * .gdbinit (xprintbytestr): New command.
15929 (xwhichsymbols): Rename from `which'; all callers changed.
15930 (xbytecode): Print the byte-code string as well.
15932 2011-10-29 Kim Storm <storm@cua.dk>
15934 * alloc.c (which_symbols): New function.
15936 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15938 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15941 2011-10-29 Glenn Morris <rgm@gnu.org>
15943 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15944 Not clear what it was for, and it causes various bugs. (Bug#9839)
15946 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15948 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15949 possible random value that matches one of those tested as
15950 condition to clear the mouse face.
15952 2011-10-28 Chong Yidong <cyd@gnu.org>
15954 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15956 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15958 * window.c (make_window): Initialize phys_cursor_on_p.
15960 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15962 * lisp.h (struct Lisp_Symbol): Update comments.
15964 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
15966 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15968 2011-10-28 Eli Zaretskii <eliz@gnu.org>
15970 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15971 <oslsachem@gmail.com> for helping to debug this.
15973 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15974 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15975 (g_b_init_get_glyph_outline_w): New static variables.
15976 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15977 (GetGlyphOutlineW_Proc): New typedefs.
15978 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15979 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15981 (w32font_open_internal, compute_metrics):
15982 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15983 instead of calling the "wide" APIs directly.
15985 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15987 * w32.h (syms_of_w32font): Add prototype.
15989 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
15991 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15992 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15993 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15994 (Fmove_to_window_line): Doc fix.
15996 2011-10-27 Chong Yidong <cyd@gnu.org>
15998 * process.c (make_process): Set gnutls_state to NULL.
16000 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16001 non-NULL, regardless of GNUTLS_INITSTAGE.
16002 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16003 an error. Set process slots as soon as we allocate them.
16005 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16007 2011-10-27 Chong Yidong <cyd@gnu.org>
16009 * gnutls.c (emacs_gnutls_deinit): New function.
16010 Deallocate credentials structures as well as calling gnutls_deinit.
16011 (Fgnutls_deinit, Fgnutls_boot): Use it.
16013 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16014 (deactivate_process): Call emacs_gnutls_deinit.
16016 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16018 * image.c (x_create_x_image_and_pixmap):
16019 * w32.c (sys_rename, w32_delayed_load):
16020 * w32font.c (fill_in_logfont):
16021 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16023 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16025 * w32fns.c (w32_default_color_map): New function,
16026 extracted from Fw32_default_color_map.
16027 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16029 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16031 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16033 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16035 * keyboard.c (test_undefined): New function (bug#9751).
16036 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16038 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16040 * sysdep.c (init_sys_modes): Fix the check for the controlling
16041 terminal (Bug#6649).
16043 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16045 * dispextern.h (struct bidi_it): New member next_en_type.
16047 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16048 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16049 current character, check also for next_en_type being WEAK_EN.
16050 (bidi_resolve_weak): Don't enter the expensive loop if the current
16051 position is before next_en_pos. Record the bidi type of the first
16052 non-ET, non-BN character we find, in addition to its position.
16053 (bidi_level_of_next_char): Invalidate next_en_type when
16054 next_en_pos is over-stepped.
16056 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16058 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16059 * editfns.c: Rewrite current-time-zone so that it invokes
16060 the equivalent of (format-time-string "%Z") to get the time zone name.
16061 This fixes a bug when the time zone name contains characters that
16062 need converting from the system time locale to Emacs internal format.
16063 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16064 that patch fixed format-time-string to do the conversion, but
16065 I forgot to fix current-time-zone.
16066 (format_time_string): New function, containing most of
16067 what Fformat_time_string used to contain.
16068 (Fformat_time_string): Rewrite in terms of format_time_string.
16069 This doesn't change this function's behavior.
16070 (current-time-zone): Rewrite to use format_time_string.
16071 This fixes the bug reported by Michael Schierl in
16072 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16073 Jason Rumney's 2007-06-07 change worked around this bug, but
16075 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16077 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16079 * xdisp.c (start_display): If the character at POS is displayed
16080 via a display vector, reset IT->current.dpvec_index to zero.
16081 (try_window_reusing_current_matrix): If a line ends in a display
16082 vector or the next line starts in a display vector, continue
16083 redrawing the window even though the character position of
16084 start_row was reached.
16087 2011-10-18 Chong Yidong <cyd@gnu.org>
16089 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16090 with nobreak-char-display too.
16092 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16094 Fix part 3 of bug#9771.
16095 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16096 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16097 non-neutral characters if the current character is a paragraph
16098 separator (a.k.a. Newline). This avoids running the same
16099 expensive loop twice, once when we consume the preceding newline
16100 and the other time when the line actually needs to be displayed.
16101 Avoid the loop when we see neutrals on the base embedding level
16102 following a character whose directionality is the same as the
16103 paragraph's. This avoids running the expensive loop when a line
16104 ends in a long sequence of neutrals, like control characters.
16105 Add assertion against STRONG_AL type. Slightly rearrange code
16106 that determines the type of a neutral given the first non-neutral
16108 (bidi_level_of_next_char): Set next_en_pos to zero when
16109 invalidating its info.
16111 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16113 * xdisp.c (push_display_prop): Determine whether to record string
16114 or buffer position by IT->string, not by IT->method. Allow
16115 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16116 (move_it_vertically_backward): Don't look for character position
16117 immediately after the newline when in a continuation line.
16120 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16122 * window.c (coordinates_in_window): Rewrite and delabelize
16123 vertical border check. (Bug#5357) (Bug#9618)
16125 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16127 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16128 errors in XSetWindowBorder (bug#9310).
16130 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16132 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16133 avoid crash when xmalloc overrun checking is enabled.
16135 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16137 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16138 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16139 cursor motion with <left> and <right> arrow keys.
16141 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16142 some callers set that themselves.
16144 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16146 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16147 display string and the previous row comes from the same string and
16148 is empty. (Bug#9739) (Bug#9738)
16150 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16152 * doc.c (get_doc_string): Encode file name (bug#9735).
16154 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16156 * bidi.c (bidi_level_of_next_char):
16157 * xdisp.c (get_visually_first_element): Remove old incorrect
16158 comments regarding the Unicode Line Separator character.
16160 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16162 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16164 * alloc.c (Fgc_status): Do not access beyond zombies array
16165 boundary if nzombies > MAX_ZOMBIES.
16166 * alloc.c (dump_zombies): Add missing format specifier.
16168 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16170 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16171 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16173 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16174 Some packages use them to denote characters with modifiers.
16176 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16178 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16179 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16180 matching a pp-number. Rename parameter var to var1.
16182 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16184 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16186 2011-10-08 Glenn Morris <rgm@gnu.org>
16188 * callint.c (Fcall_interactively): Give a more explicit error for the
16189 'c' case with a non-character input. (Bug#8479)
16191 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16193 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16195 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16196 lines that are hscrolled on the left.
16198 * dispnew.c (buffer_posn_from_coords): Account for a possible
16199 presence of header-line. (Bug#4426)
16201 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16203 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16204 Don't advertise functionality which we discourage or doesn't work.
16206 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16208 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16209 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16210 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16211 this makes Emacs dump core during garbage collection on rare
16212 occasions. sizeof is obviously inferior to offsetof here, so
16213 stick with offsetof.
16214 (GC_POINTER_ALIGNMENT): New macro.
16215 (mark_memory): Omit 3rd (offset) arg; caller changed.
16216 Don't assume EMACS_INT alignment is the same as pointer alignment.
16218 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16220 * keyboard.c (read_key_sequence_remapped): New var.
16221 (read_key_sequence): Compute remapping in the right buffer.
16222 (command_loop_1): Use read_key_sequence's remapping directly.
16224 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16226 * dired.c (file_name_completion): Don't expand file name.
16227 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16228 before checking file name handler.
16230 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16231 they've been requested explicitly (bug#9591).
16233 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16235 * keymap.c (Fsingle_key_description): Use make_specified_string
16236 instead of build_string to build string from push_key_description.
16239 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16241 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16242 This fixes a Y2038 bug on 64-bit hosts.
16243 * buffer.c (reset_buffer):
16244 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16245 (Fclear_buffer_auto_save_failure):
16246 Use 0, not -1, to represent an unset failure time, since time_t
16247 might not be signed.
16249 Remove dependency on glibc malloc internals.
16250 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16251 Move back here from lisp.h, but with their new implementations.
16252 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16253 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16254 * charset.c (charset_table_init): New static var.
16255 (syms_of_charset): Use it instead of xmalloc. This removes a
16256 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16257 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16258 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16259 Move back to alloc.c.
16260 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16261 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16263 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16265 * nsterm.m (windowDidResize): Call x_set_window_size only when
16266 ns_in_resize is true. Otherwise set pixelwidth/height and
16267 call change_frame_size (Bug#9628).
16269 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16271 Port --enable-checking=all to Fedora 14 x86-64.
16272 * charset.c (syms_of_charset): Also account for glibc malloc's
16273 internal overhead when calculating the initial malloc maximum.
16275 Port --enable-checking=all to Fedora 14 x86.
16276 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16278 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16279 (overrun_check_realloc, overrun_check_free):
16280 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16281 That way, xmalloc returns a properly-aligned pointer even if
16282 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16283 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16284 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16285 into account when calculating the initial malloc maximum.
16286 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16287 Move here from alloc.c, so that charset.c can use it too.
16288 Properly align; the old code wasn't right for common 32-bit hosts
16289 when configured with --enable-checking=all.
16290 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16291 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16293 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16295 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16298 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16300 * xdisp.c (compute_display_string_end): If there's no display
16301 string at CHARPOS, return -1.
16303 * bidi.c (bidi_fetch_char): When compute_display_string_end
16304 returns a negative value, treat the character as a normal
16305 character not covered by a display string. (Bug#9624)
16307 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16309 * lread.c (Fread_from_string): Fix typo in docstring.
16311 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16313 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16314 newline, reseat the iterator instead of bidi-iterating there one
16315 character at a time. (Bug#9610)
16316 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16317 TO_CHARPOS if the bidi iterator is at base embedding level.
16319 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16321 * lread.c (readevalloop): Use correct code for NBSP.
16322 (read1): Likewise. (Bug#9608)
16324 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16326 * dbusbind.c (Fdbus_register_signal): When service is not
16327 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16329 2011-09-25 Glenn Morris <rgm@gnu.org>
16331 * buffer.c (truncate-lines): Doc fix.
16333 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16335 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16336 (Fset_window_next_buffers): Doc fix.
16338 2011-09-24 Glenn Morris <rgm@gnu.org>
16340 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16342 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16344 Fix minor problems found by static checking.
16345 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16346 * indent.c (Fvertical_motion): Fix == vs = typo.
16348 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16350 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16351 Default value is now t. Doc fix.
16353 * indent.c (Fvertical_motion): Compute and apply the overshoot
16354 logic when moving up, not only when moving down. Fix the
16355 confusing name and values of the it_overshoot_expected variable;
16356 logic changes accordingly. (Bug#9254) (Bug#9549)
16358 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16359 CHARPOS is covered by a display string which includes newlines.
16360 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16361 is covered by a display string with embedded newlines.
16363 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16365 * dbusbind.c (Fdbus_register_signal): Add match rule to
16366 Vdbus_registered_objects_table. (Bug#9581)
16367 (Fdbus_register_method, Vdbus_registered_objects_table):
16370 2011-09-24 Jim Meyering <meyering@redhat.com>
16372 do not ignore write error for any output size
16373 The previous change was incomplete.
16374 While it makes emacs --batch detect the vast majority of stdout
16375 write failures, errors were still ignored whenever the output size is
16376 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16377 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16378 && echo FAIL: ignored write error
16379 FAIL: ignored write error
16380 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16381 && echo FAIL: ignored write error
16382 FAIL: ignored write error
16383 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16385 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16387 * emacs.c (Fkill_emacs): In noninteractive mode exit
16388 non-successfully if a write error occurred on stdout. (Bug#9574)
16390 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16392 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16395 * dispextern.h (struct it): Update the comment documenting what
16398 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16400 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16401 a display string, extend search for cursor position to end of row.
16402 (find_row_edges): If the row ends in a newline from a display
16403 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16404 Handle the case of a display string with multiple newlines.
16405 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16406 non-empty line. Fixes confusing cursor motion with arrow keys at
16407 the beginning of a line that starts with whitespace.
16409 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16411 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16414 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16416 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16417 boolean (Bug#9154).
16419 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16421 * xdisp.c (display_line): Record maximum and minimum buffer
16422 positions even if no glyphs were produced (e.g., by a zero-width
16423 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16424 buffer positions that will be removed from the glyph row because
16426 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16427 column is beyond frame width: don't subtract 1 "pixel" when
16428 computing width of the stretch.
16429 (reseat_at_next_visible_line_start): Undo the change made on
16430 2011-09-17 that saved paragraph information and restored it after
16431 the call to `reseat'. (Bug#9545)
16433 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16435 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16436 and turn window cursor on if cleared (Bug#9415).
16438 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16440 * search.c (boyer_moore): Take unibyte characters from pattern
16441 literally. (Bug#9458)
16443 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16445 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16447 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16449 Fix minor problem found by static checking.
16450 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16451 initialized, to pacify gcc -Wuninitialized.
16453 * fileio.c: Report proper errno when syscall falls.
16454 (Finsert_file_contents): Save and restore errno,
16455 so that report_file_error outputs the correct diagnostic.
16456 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16458 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16460 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16462 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16464 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16465 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16467 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16469 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16470 about the current paragraph and restore it after the call to reseat.
16472 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16473 (bidi_find_paragraph_start): Search back for paragraph beginning
16474 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16475 (bidi_move_to_visually_next): Only trigger paragraph-related
16476 computations when the last character is a newline or at EOB, not
16477 just any NEUTRAL_B. (Bug#9470)
16479 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16480 truncated lines if point is covered by a display string. (Bug#9524)
16482 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16484 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16485 (cons_to_x_long): New function.
16486 (lisp_data_to_selection_data): Use it. Correct the test for
16487 short-versus-long data; it was negated. Break out of vector
16488 loop, for efficiency, when a long datum is discovered.
16490 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16492 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16494 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16496 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16497 GCC PR/17406) by declaring this function with external scope.
16499 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16501 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16502 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16504 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16506 * editfns.c (Fformat): Correctly handle text properties on "%%".
16508 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16510 * xterm.c (x_draw_composite_glyph_string_foreground):
16511 * w32term.c (x_draw_composite_glyph_string_foreground):
16512 * term.c (encode_terminal_code):
16513 * composite.c (composition_update_it, get_composition_id):
16514 * xdisp.c (get_next_display_element)
16515 (fill_composite_glyph_string): Add comments about special meaning
16516 of TAB characters in a composition.
16518 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16520 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16521 This occurs when processing a multibyte format.
16522 Problem reported by Wolfgang Jenker.
16524 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16526 * xdisp.c (try_cursor_movement): Only check for exact match if
16527 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16529 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16531 Remove unused external symbols.
16532 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16533 * xdisp.c (calc_pixel_width_or_height): Now static.
16534 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16535 * indent.c (check_display_width):
16536 * w32term.c: Fix comment to match code.
16537 * xterm.c, xterm.h (x_catching_errors): Remove.
16539 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16541 * xselect.c: Use signed conversions more consistently (Bug#9498).
16542 (selection_data_to_lisp_data): Assume incoming selection data are
16543 signed integers, not unsigned. This is to be consistent with
16544 outgoing selection data, which was modified to use signed integers
16545 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16546 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16547 expects long, not unsigned long.
16549 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16551 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16552 computation of loop end. Reported by Johan Bockgård
16555 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16557 * frame.c (Fother_visible_frames_p): Function deleted.
16559 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16561 * indent.c (compute_motion): Process display vector front to back
16562 rather than the other way around. (Bug#2496)
16564 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16566 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16568 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16570 * minibuf.c (Fread_from_minibuffer): Doc fix.
16572 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16574 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16575 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16577 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16579 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16580 value for non-existent files.
16582 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16584 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16585 set its "size" to -1. This will set the modtime_size field of
16586 the corresponding buffer to -1, which is what
16587 verify-visited-file-modtime expects for files that do not exist.
16590 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16592 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16594 * lisp.h: ... from here. push_key_description is no longer
16595 defined in keyboard.c, so its declaration should not be in
16596 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16597 logically belongs with push_key_description.
16599 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16601 * buffer.h: Include <sys/types.h> instead of <time.h>.
16602 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16603 Problem reported by Herbert J. Skuhra.
16605 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16607 * xml.c (parse_region): Make the parsing work for
16608 non-comment-starting XML files again (bug#9144).
16610 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16612 * image.c (gif_load): Fix calculation of bottom and right corner.
16615 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16617 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16618 redisplay in small windows.
16620 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16622 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16624 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16626 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16627 Operate on live windows only.
16629 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16631 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16633 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16635 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16636 only under bidi iteration.
16638 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16640 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16642 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16644 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16645 Without this fix, the command to link temacs failed due to an
16646 undefined symbol __builtin_isnan. This is because
16647 /usr/include/iso/math_c99.h #defines isnan(x) to
16648 __builtin_isnan(x), but the bundled gcc, which identifies itself
16649 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16651 * floatfns.c (isnan): #undef, and then #define to a clone of
16653 (Fisnan): Always define, since it's always available now.
16654 (syms_of_floatfns): Always define isnan at the Lisp level.
16656 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16658 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16660 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16662 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16663 The previous code assumed that file offsets (off_t values) fit in
16664 EMACS_INT variables, which is not true on typical 32-bit hosts.
16665 The code messed up by falsely reporting buffer overflow in cases
16666 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16667 when "big" contains more than 2**29 bytes, even though this
16668 inserts just one byte and does not overflow the buffer.
16669 (Finsert_file_contents): Store file offsets as off_t
16670 values, not as EMACS_INT values. Check for overflow when
16671 converting between EMACS_INT and off_t. When checking for
16672 buffer overflow or for overlap, take the offsets into account.
16673 Don't use EMACS_INT for small values where int suffices.
16674 When checking for overlap, fix a typo: ZV was used where
16675 ZV_BYTE was intended.
16676 (Fwrite_region): Don't assume off_t fits into 'long'.
16677 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16679 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16681 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16683 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16685 sprintf-related integer and memory overflow issues (Bug#9412).
16687 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16688 (esprintf, exprintf, evxprintf): New functions.
16689 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16690 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16691 (modify_event_symbol): Do not assume that the length of
16692 name_alist_or_stem is safe to alloca and fits in int.
16693 (Fexecute_extended_command): Likewise for function name and binding.
16694 (Frecursion_depth): Wrap around reliably on integer overflow.
16695 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16696 since some callers pass EMACS_INT values.
16697 (Fsingle_key_description): Don't crash if symbol name contains more
16698 than MAX_ALLOCA bytes.
16699 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16700 (get_minibuffer): Arg is now EMACS_INT, not int.
16701 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16702 (esprintf, exprintf, evxprintf): New decls.
16703 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16705 * dbusbind.c (signature_cat): New function.
16706 (xd_signature, Fdbus_register_signal):
16707 Do not overrun buffer; instead, report string overflow.
16709 * dispnew.c (add_window_display_history): Don't overrun buffer.
16710 Truncate instead; this is OK since it's just a log.
16712 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16713 even if the time zone offset is outlandishly large.
16714 Don't mishandle offset == INT_MIN.
16716 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16717 when creating daemon; the previous buffer-overflow check was incorrect.
16719 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16720 which has the guts of the old verror function.
16722 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16723 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16725 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16726 (font_unparse_xlfd): Don't blindly alloca long strings.
16727 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16728 fits in int, when using sprintf. Use single snprintf to count
16729 length of string rather than counting it via multiple sprintfs;
16730 that's simpler and more reliable.
16731 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16732 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16733 sprintf, in case result does not fit in int.
16735 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16736 (fontset_from_font): Print it.
16738 * frame.c (tty_frame_count): Now printmax_t, not int.
16739 (make_terminal_frame, set_term_frame_name): Print it.
16740 (x_report_frame_params): In X, window IDs are unsigned long,
16741 not signed long, so print them as unsigned.
16742 (validate_x_resource_name): Check for implausibly long names,
16743 and don't assume name length fits in 'int'.
16744 (x_get_resource_string): Don't blindly alloca invocation name;
16745 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16748 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16749 (xg_check_special_colors, xg_set_geometry):
16750 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16752 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16753 Use esprintf, not sprintf, in case result does not fit in int.
16755 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16756 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16757 it as a large positive number.
16758 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16759 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16761 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16762 in case result does not fit in int.
16764 * print.c (float_to_string): Detect width overflow more reliably.
16765 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16766 buffer overrun. Don't assume list length fits in 'int'. Treat
16767 print length of 0 as 0, not as infinity; to be consistent with other
16768 uses of print length in this function. Don't overflow print length
16769 index. Don't assume hash table size fits in 'long', or that
16770 vectorlike size fits in 'unsigned long'.
16772 * process.c (make_process): Use printmax_t, not int, to format
16773 process-name gensyms.
16775 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16777 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16778 to avoid potential buffer overrun.
16780 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16781 if X resource line is longer than 512 bytes.
16783 * xfns.c (x_window): Make sprintf buffer a bit bigger
16784 to avoid potential buffer overrun.
16786 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16788 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16790 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16792 Integer overflow fixes for scrolling, etc.
16793 Without these, Emacs silently mishandles large integers sometimes.
16794 For example, "C-u 4294967297 M-x recenter" was treated as if
16795 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16797 * xdisp.c (try_window_id): Check Emacs fixnum range before
16798 converting to 'int'.
16800 * window.c (window_scroll_line_based, Frecenter):
16801 Check that an Emacs fixnum is in range before assigning it to 'int'.
16802 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16803 values converted from Emacs fixnums.
16804 (Frecenter): Don't wrap around a line count if it is out of 'int'
16805 range; instead, treat it as an extreme value.
16806 (Fset_window_configuration, compare_window_configurations):
16807 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16809 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16810 that can exceed INT_MAX. Check that EMACS_INT value is in range
16811 before assigning it to the (possibly-narrower) index.
16812 (match_limit): Don't assume that a fixnum can fit in 'int'.
16814 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16817 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16818 (Fvertical_motion): Don't wrap around LINES values that don't fit
16819 in 'int'. Instead, treat them as extreme values. This is good
16820 enough for windows, which can't have more than INT_MAX lines anyway.
16822 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16824 * Require libxml/parser.h to avoid compilation warning.
16826 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16828 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16829 since this reportedly can destroy thread storage.
16831 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16833 * syntax.c (find_defun_start): Update all cache variables if
16834 exiting early (Bug#9401).
16836 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16838 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16840 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16841 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16842 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16844 * term.c (tty_append_glyph): New function.
16845 (produce_stretch_glyph): Static function and its prototype deleted.
16847 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16850 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16852 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16853 when checking :margin (Bug#9390).
16854 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16855 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16856 so that the name doesn't mislead. All uses changed.
16858 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16860 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16863 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16865 * xdisp.c (move_it_to): Don't bail out early when reaching
16866 position beyond to_charpos, if we are scanning backwards.
16867 (move_it_vertically_backward): When DY == 0, make sure we get to
16868 the first character in the line after the newline.
16870 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16872 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16873 (ccl_driver): Do not generate an out-of-range pointer.
16874 (Fccl_execute_on_string): Remove unnecessary check for
16875 integer overflow, noted by Stefan Monnier in
16876 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16877 Remove a FIXME that didn't need fixing.
16878 Simplify the newly-introduced buffer reallocation code.
16880 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16882 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16884 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16886 Integer and memory overflow issues (Bug#9196).
16888 * doc.c (get_doc_string): Rework so that
16889 get_doc_string_buffer_size is the actual buffer size, rather than
16890 being 1 less than the actual buffer size; this makes xpalloc more
16893 * image.c (x_allocate_bitmap_record, cache_image):
16894 * xselect.c (Fx_register_dnd_atom):
16895 Simplify previous changes by using xpalloc.
16897 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16898 since either will do and ptrdiff_t is convenient with xpalloc.
16900 * charset.c (charset_table_size)
16901 (struct charset_sort_data.priority): Now ptrdiff_t.
16902 (charset_compare): Don't overflow if priorities differ greatly.
16903 (Fsort_charsets): Don't assume list length fits in int.
16904 Check for size-calculation overflow when allocating sort data.
16905 (syms_of_charset): Allocate an initial charset table that is
16906 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16908 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16910 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16911 The actual value is always <= INT_MAX, and leaving it unsigned made
16912 overflow checking harder.
16914 * dispextern.h (struct glyph_matrix.rows_allocated)
16915 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16916 with xpalloc. The values are still always <= INT_MAX.
16918 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16920 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16921 (SAFE_NALLOCA): New macro.
16923 * region-cache.c (struct boundary.pos, find_cache_boundary)
16924 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16925 (set_cache_region, invalidate_region_cache)
16926 (revalidate_region_cache, know_region_cache, region_cache_forward)
16927 (region_cache_backward, pp_cache):
16928 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16929 so that ptrdiff_t * can be passed to xpalloc.
16930 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16931 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16932 (pp_cache): Don't assume cache_len fits in int.
16933 * region-cache.h: Adjust extern decls to match.
16935 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16936 EMACS_INT, since either will do, for xpalloc.
16938 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16939 (xnmalloc, xnrealloc, xpalloc): New functions.
16941 * bidi.c (bidi_shelve_header_size): New constant.
16942 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16943 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16945 * bidi.c (bidi_cache_shrink):
16946 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16948 Don't update size of array until after memory allocation succeeds,
16949 because xmalloc/xrealloc may not return.
16950 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16951 now that we have proper integer overflow checking.
16952 (record_overlay_string, overlay_strings): Catch overflows when
16953 calculating size of overlay_str_buf.
16955 * callproc.c (Fcall_process): Check for size overflow when
16956 calculating size of args2.
16957 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16958 Normally we prefer signed values, but sticking with ptrdiff_t would
16959 require adding more-complicated checks.
16961 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16962 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16963 Redo buffer-overflow calculations to avoid integer overflow.
16964 Add a FIXME comment where memory seems to be over-allocated.
16966 * character.c (Fstring): Check for size-calculation overflow.
16968 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16969 unnecessary integer overflow. Check for size overflow.
16970 (encode_coding_object): Don't update size until xmalloc succeeds.
16972 * composite.c (get_composition_id): Check for overflow in glyph
16973 length calculations.
16975 Integer and memory overflow fixes for display code.
16976 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16977 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16978 (scrolling_window): Check for overflow in size calculations.
16979 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16980 Don't assume glyph table len fits in int.
16981 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16982 (row_table_size): Now ptrdiff_t, not int.
16983 (scrolling_window): Avoid overflow in size calculations.
16984 Don't update size until allocation succeeds.
16985 * fns.c (concat): Check for overflow in size calculations.
16986 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16987 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16988 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16990 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16991 (get_doc_string): Check for size calculation overflow.
16992 Don't update size until allocation succeeds.
16993 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16994 EMACS_INT, where ptrdiff_t will do.
16995 (Fsubstitute_command_keys): Check for string overflow.
16997 * editfns.c (set_time_zone_rule): Don't assume environment length
16999 (message_length): Now ptrdiff_t, not int.
17000 (Fmessage_box): Don't update size until allocation succeeds.
17001 Don't assume message length fits in int.
17002 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17004 * emacs.c (main): Do not reallocate argv, since there is a null at
17005 the end that can be overwritten, and this way there's no need to
17006 worry about size-calculation overflow.
17007 (sort_args): Check for size-calculation overflow.
17009 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17011 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17013 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17014 (x_set_scroll_bar_width, x_figure_window_size):
17015 Check for integer overflow.
17016 (x_set_alpha): Do not assume XINT fits in int.
17018 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17019 This is for the members text_lines, text_cols, total_lines, total_cols,
17020 where the system imposes an 'int' limit.
17022 * fringe.c (Fdefine_fringe_bitmap):
17023 Don't update size until alloc works.
17025 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17026 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17028 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17029 Check for size-calculation overflow.
17030 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17031 do, as we prefer signed integers.
17032 (id_to_widget.max_size, id_to_widget.used)
17033 (xg_store_widget_in_map, xg_remove_widget_from_map)
17034 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17035 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17036 Use and return ptrdiff_t, not int.
17037 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17038 * gtkutil.h: Change prototypes to match the above.
17040 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17041 are duplicate now that they've been promoted to lisp.h.
17042 (x_allocate_bitmap_record, x_alloc_image_color)
17043 (make_image_cache, cache_image, xpm_load):
17044 Don't update size until alloc is done.
17045 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17047 Check for size calculation overflow.
17048 (ct_colors_allocated_max): New constant.
17049 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17052 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17053 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17054 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17055 Use ptrdiff_t, not int, to count maps.
17056 (read_char_minibuf_menu_prompt): Check for overflow in size
17057 calculations. Don't update size until allocation succeeds.
17058 Redo calculations to avoid overflow.
17059 * keyboard.h: Change prototypes to match the above.
17061 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17063 (current_minor_maps): Check for size calculation overflow.
17064 * keymap.h: Change prototypes to match the above.
17066 * lread.c (read1, init_obarray): Don't update size until alloc done.
17068 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17069 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17071 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17072 Now ptrdiff_t, not int.
17073 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17074 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17076 * process.c (Fnetwork_interface_list): Check for overflow
17077 in size calculation.
17079 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17081 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17082 overflow. Don't bother calling xmalloc when xrealloc will do.
17084 * search.c (Freplace_match): Check for size calculation overflow.
17085 (Fset_match_data): Don't assume list lengths fit in 'int'.
17087 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17088 for command line length. Do not attempt to address one before the
17089 beginning of an array, as that's not portable.
17091 * term.c (max_frame_lines): Remove; unused.
17092 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17094 (encode_terminal_code, calculate_costs): Check for size
17095 calculation overflow.
17096 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17097 table lengths and related sizes. Don't update size until alloc
17098 done. Redo calculations to avoid overflow.
17099 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17101 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17102 subtracting pointers.
17103 (gobble_line): Check for overflow more carefully. Don't update size
17106 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17107 Don't update size until alloc done.
17108 Redo size calculations to avoid overflow.
17109 Check for size calculation overflow.
17110 (main) [DEBUG]: Fix typo in invoking tparam1.
17112 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17113 Use ptrdiff_t, not int, for sizes.
17114 (store_mode_line_noprop_char): Don't update size until alloc done.
17116 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17117 Use ptrdiff_t, not int, for sizes.
17118 (Finternal_make_lisp_face, cache_face):
17119 Check for size calculation overflow.
17120 (cache_face): Treat size calculation overflows as if they were
17121 memory exhaustion (the usual treatment), rather than aborting.
17123 * xfns.c (x_encode_text, x_set_name_internal)
17124 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17125 sizes, since they can exceed INT_MAX in size. Check for size
17126 calculation overflow.
17128 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17129 (xg_select): Check for size calculation overflow.
17130 Don't update size until alloc done.
17132 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17133 as sprintf is limited to int lengths.
17135 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17136 (X_LONG_MIN): New macros.
17137 Use them to make the following changes clearer.
17138 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17139 This change doesn't affect the value now, but it may help remind
17140 future maintainers not to raise the value too much later.
17141 (SELECTION_QUANTUM): Remove, replacing with ...
17142 (selection_quantum): ... new function, which avoids overflow.
17144 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17145 assumption that selection length fits in 'int'.
17146 (x_reply_selection_request, x_handle_selection_request)
17147 (x_get_window_property, receive_incremental_selection)
17148 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17149 (lisp_data_to_selection_data, clean_local_selection_data):
17150 Use ptrdiff_t, not int, to record length of selection.
17151 (x_reply_selection_request, x_get_window_property)
17152 (receive_incremental_selection, x_property_data_to_lisp):
17153 Redo calculations to avoid overflow.
17154 (x_reply_selection_request): When sending hint, ceiling it at
17155 X_LONG_MAX rather than relying on wraparound overflow to send
17157 (x_get_window_property, receive_incremental_selection)
17158 (lisp_data_to_selection_data, x_property_data_to_lisp):
17159 Check for size-calculation overflow.
17160 (x_get_window_property, receive_incremental_selection)
17161 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17162 Don't store size until memory allocation succeeds.
17163 (x_get_window_property): Plug memory leak on memory exhaustion.
17164 Don't double-block input; malloc is safe here. Don't assume 2**34
17165 - 4 fits in unsigned long. Add an xassert to check
17166 XGetWindowProperty overflow. Be more careful about overflow
17167 calculations, and distinguish size from memory overflow better.
17168 (receive_incremental_selection): When tracing, don't assume
17169 unsigned int is less than INT_MAX.
17170 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17171 harmful) conversions of unsigned short to int.
17172 (lisp_data_to_selection_data): Don't assume that integers
17173 in the range -65535 through -1 fit in an X unsigned short.
17174 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17175 result parameters unless successful. Rely on cons_to_unsigned
17176 to report problems with elements; the old code wasn't right anyway.
17177 (x_check_property_data): Check for int overflow; we cannot use
17178 a wider type due to X limits.
17179 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17181 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17183 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17184 (x_term_init): Check for size calculation overflow.
17185 (x_color_cells): Don't store size until memory allocation succeeds.
17186 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17187 Don't assume alloca size is less than MAX_ALLOCA.
17188 (x_term_init): Don't assume length fits in int (sprintf is limited
17191 Use ptrdiff_t for composition IDs.
17192 * character.c (lisp_string_width):
17193 * composite.c (composition_table_size, n_compositions)
17194 (get_composition_id, composition_gstring_from_id):
17195 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17196 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17197 * window.c (Frecenter):
17198 Use ptrdiff_t, not int, for composition IDs.
17199 * composite.c (get_composition_id): Check for integer overflow.
17200 * composite.h: Adjust prototypes to match the above changes.
17202 Use ptrdiff_t for hash table indexes.
17203 * category.c (hash_get_category_set):
17204 * ccl.c (ccl_driver):
17205 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17206 * coding.c (coding_system_charset_list, detect_coding_system):
17207 * coding.h (struct coding_system.id):
17208 * composite.c (get_composition_id, gstring_lookup_cache):
17209 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17210 * image.c (xpm_get_color_table_h):
17211 * lisp.h (hash_lookup, hash_put):
17212 * minibuf.c (Ftest_completion):
17213 Use ptrdiff_t for hash table indexes, not int (which is too
17214 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17215 32-bit --with-wide-int hosts).
17217 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17218 Add a FIXME comment about memory leaks.
17219 (syms_of_charset): Don't assume xmalloc returns.
17221 Don't assume that stated character widths fit in int.
17222 * character.c (Fchar_width, c_string_width, lisp_string_width):
17223 * character.h (CHAR_WIDTH):
17224 * indent.c (MULTIBYTE_BYTES_WIDTH):
17225 Use sanitize_char_width to avoid undefined and/or bad behavior
17226 with outlandish widths.
17227 * character.h (sanitize_tab_width): Rename from sanitize_width,
17228 now that we have two such functions. All uses changed.
17229 (sanitize_char_width): New inline function.
17231 Don't assume that tab-width fits in int.
17232 * character.h (sanitize_width): New inline function.
17233 (SANE_TAB_WIDTH): New macro.
17234 (ASCII_CHAR_WIDTH): Use it.
17235 * indent.c (sane_tab_width): Remove. All uses replaced by
17236 SANE_TAB_WIDTH (current_buffer).
17237 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17239 * fileio.c: Integer overflow issues with file modes.
17240 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17242 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17243 Remove unreachable code.
17244 (read_hex, load_charset_map_from_file): Check for integer overflow.
17246 * xterm.c: Don't go over XClientMessageEvent limit.
17247 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17248 (x_send_scroll_bar_event): Likewise. Check that the size does not
17249 exceed limits imposed by XClientMessageEvent, as well as the usual
17250 ptrdiff_t and size_t limits.
17252 * keyboard.c: Overflow, signedness and related fixes.
17253 (make_lispy_movement): Use same integer type in forward decl
17254 that is used in the definition.
17255 (read_key_sequence, keyremap_step):
17256 Change bufsize argument back to int, undoing my 2011-03-30 change.
17257 We prefer signed types, and int is wide enough here.
17258 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17259 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17260 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17261 length, not size_t. Use ptrdiff_t for index, not int.
17262 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17263 possibility of integer overflow.
17265 Overflow, signedness and related fixes for images.
17267 * dispextern.h (struct it.stack[0].u.image.image_id)
17268 (struct_it.image_id, struct image.id, struct image_cache.size)
17269 (struct image_cache.used, struct image_cache.ref_count):
17270 * gtkutil.c (update_frame_tool_bar):
17271 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17272 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17273 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17274 * nsmenu.m (update_frame_tool_bar):
17275 * xdisp.c (calc_pixel_width_or_height):
17276 * xfns.c (image_cache_refcount):
17277 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17278 on typical 64-bit hosts.
17280 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17281 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17282 Omit unnecessary casts to int.
17283 (parse_image_spec): Check that integers fall into 'int' range
17284 when the callers expect that.
17285 (image_ascent): Redo ascent calculation to avoid int overflow.
17286 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17287 (lookup_image): Remove unnecessary tests.
17288 (xbm_image_p): Locals are now of int, not EMACS_INT,
17289 since parse_image_check makes sure they fit into int.
17290 (png_load, gif_load, svg_load_image):
17291 Prefer int to unsigned where either will do.
17292 (tiff_handler): New function, combining the cores of the
17293 old tiff_error_handler and tiff_warning_handler.
17294 This function is rewritten to use vsnprintf and thereby avoid
17295 stack buffer overflows. It uses only the features of vsnprintf
17296 that are common to both POSIX and native Microsoft.
17297 (tiff_error_handler, tiff_warning_handler): Use it.
17298 (tiff_load, gif_load, imagemagick_load_image):
17299 Don't assume :index value fits in 'int'.
17300 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17301 (imagemagick_load_image): Check that crop parameters fit into
17302 the integer types that MagickCropImage accepts. Don't assume
17303 Vimagemagick_render_type has a nonnegative value. Don't assume
17304 size_t fits in 'long'.
17305 (gs_load): Use printmax_t to print the widest integers possible.
17306 Check for integer overflow when computing image height and width.
17308 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17310 * xdisp.c (redisplay_window): Don't force window start if point
17311 will be invisible in the resulting window. (Bug#9324)
17313 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17315 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17316 the display spec is of the form `(space ...)'.
17317 (handle_display_spec): Return the value returned by
17318 handle_single_display_spec, not just 1 or zero.
17319 (handle_single_display_spec): If the display spec is of the form
17320 `(space ...)', and specifies display in the text area, return 2
17322 (try_cursor_movement): Check for the need to scroll more
17323 accurately, and prefer exact match for point under bidi.
17324 Don't advance `row' beyond the last row of the window.
17326 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17327 into disp_prop; all users changed.
17329 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17330 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17331 for the text covered by the display property.
17333 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17335 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17336 Change return value to nil.
17337 (Frecord_buffer): Delete unused function.
17339 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17341 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17342 buffers, return left-to-right.
17343 (set_cursor_from_row): Consider candidate row a win if its glyph
17344 represents a newline and point is on that newline. Fixes cursor
17345 positioning on the newline at EOL of R2L text within L2R
17346 paragraph, and vice versa.
17347 (try_cursor_movement): Check continued rows, in addition to
17348 continuation rows. Fixes unwarranted scroll when point enters a
17349 continued line of R2L text within an L2R paragraph, or vice versa.
17350 (cursor_row_p): Consider the case of point being equal to
17351 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17352 from the end of a short line to the beginning of a continued line
17353 of R2L text within L2R paragraph.
17354 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17355 composed characters.
17357 * bidi.c (bidi_check_type): Use xassert.
17358 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17361 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17363 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17366 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17368 * nsfont.m (ns_otf_to_script): Fix typo.
17370 2011-08-22 Kenichi Handa <handa@m17n.org>
17372 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17373 extra slot even if the purpose is char-code-property-table.
17375 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17377 * xdisp.c (redisplay_window): When computing centering_position,
17378 account for the height of the header line. (Bug#8874)
17380 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17381 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17382 candidate is selected by the mouse, and that candidate has a
17383 composed character under the mouse.
17385 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17386 coordinates reported by pos-visible-in-window-p for a composed
17387 character in column zero.
17389 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17391 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17393 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17395 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17396 consider it a hit if to_charpos is anywhere in the range of the
17397 composed buffer positions.
17399 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17401 * image.c (gif_load): Don't assume that each subimage has the same
17402 dimensions as the base image. Handle disposal method that is
17403 "undefined" by the gif spec (Bug#9335).
17405 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17407 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17408 (Fcondition_case): Document `debug' symbol in error handler.
17410 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17412 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17413 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17414 from an Org mode buffer to a Speedbar frame.
17416 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17417 a composition, take its buffer position from IT->cmp_it.charpos.
17418 Fixes cursor positioning at the beginning of a line that begins
17419 with a composed character.
17421 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17423 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17424 character bidirectional type, use STRONG_L instead. Fixes crashes
17425 in a buffer produced by `describe-categories'.
17427 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17428 members before the level stack, so they would be saved and
17429 restored when copying iterator state. Fixes incorrect reordering
17430 around TABs covered by display properties.
17432 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17434 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17436 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17438 * eval.c (internal_condition_case, internal_condition_case_1)
17439 (internal_condition_case_2, internal_condition_case_n):
17440 Remove unnecessary aborts (Bug#9081).
17442 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17444 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17445 has no `load' handler, try opening the file locally. (Bug#9311)
17447 2011-08-16 Ken Brown <kbrown@cornell.edu>
17449 * gmalloc.c: Expand comment.
17451 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17453 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17454 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17456 2011-08-16 Ken Brown <kbrown@cornell.edu>
17458 Fix memory allocation problems in Cygwin build (Bug#9273).
17460 * unexcw.c ( __malloc_initialized): Declare external variable.
17461 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17463 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17465 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17467 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17468 in the static heap.
17469 [CYGWIN] (special_realloc): New function.
17470 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17471 requests to realloc storage in the static heap.
17473 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17475 * bidi.c (bidi_initialize): Remove unused local.
17477 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17480 * biditype.h: Remove file.
17481 * makefile.w32-in ($(BLD)/bidi.$(O)):
17482 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17484 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17486 * chartab.c: Improve commentary for the uniprop_table API.
17488 * bidi.c (bidi_paragraph_init): Support zero value of
17489 bidi_ignore_explicit_marks_for_paragraph_level.
17490 (bidi_initialize): Use uniprop_table instead of including
17491 biditype.h and bidimirror.h.
17493 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17494 coordinates of the iterator when restoring from ppos_it.
17497 2011-08-14 Kenichi Handa <handa@m17n.org>
17499 * process.c (create_process): Call setup_process_coding_systems
17500 after the pid of the process is set to -1 (Bug#8162).
17502 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17504 * xdisp.c (move_it_in_display_line_to): Don't invoke
17505 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17506 ppos_it. Fixes vertical cursor motion when line beginning is
17507 covered by an image. (Bug#9296)
17509 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17511 * nsterm.h (ns_run_ascript): Declare.
17512 (NSAPP_DATA2_RUNASSCRIPT): Define.
17514 * nsfns.m (as_script, as_result, as_status): New static variables.
17515 (ns_run_ascript): New function.
17516 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17517 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17518 the event loop. Get status from as_status (Bug#7276).
17520 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17521 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17522 the event loop (Bug#7276).
17524 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17526 * gnutls.c (QCgnutls_bootprop_priority)
17527 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17528 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17529 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17530 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17531 (QCgnutls_bootprop_verify_hostname_error)
17532 (QCgnutls_bootprop_callbacks_verify): Rename from
17533 Qgnutls_bootprop_..., all uses changed.
17535 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17538 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17540 * xfaces.c (Qframe_set_background_mode): Now static.
17541 * dispextern.h (Qframe_set_background_mode): Remove decl.
17543 * process.c (Fnetwork_interface_info): Declare local only if needed.
17545 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17547 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17548 (Fnetwork_interface_list): Allocate in increments of bytes instead
17549 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17550 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17552 (struct ifflag_def): notrailers is smart on OSX.
17553 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17554 Get hardware address with getifaddrs if available.
17556 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17558 * xdisp.c (iterate_out_of_display_property): xassert that
17559 IT->position is set to within IT->object's boundaries. Break from
17560 the loop as soon as EOB is reached; avoids infloops in redisplay
17561 when IT->position is set up wrongly due to some bug.
17562 Set IT->current to match the bidi iterator unconditionally.
17563 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17564 entry. Force push_it to save on the stack the current
17565 buffer/string position, to be restored by pop_it. Fix flags in
17566 the iterator structure wrt the object coming from a display
17567 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17568 properties. (Bug#9284)
17570 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17572 * fontset.c (fontset_get_font_group): Add proper type checks.
17575 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17577 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17578 and LC_VERSION_MIN_MACOSX.
17579 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17580 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17582 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17584 * xdisp.c (forward_to_next_line_start): Allow to use the
17585 no-display-properties-and-no-overlays under bidi display.
17586 Set disp_pos in the bidi iterator to avoid searches for display
17587 properties and overlays.
17589 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17591 * editfns.c (Fset_time_zone_rule): Document relationship with the
17594 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17595 the font entity extracted from the cache (Bug#8109).
17597 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17599 * composite.c (autocmp_chars): Don't reset point. That is done by
17600 restore_point_unwind (Bug#5984).
17602 2011-08-07 Juri Linkov <juri@jurta.org>
17604 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17605 to show the arg `TIME' instead of `TIMEVAL'.
17607 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17609 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17610 display property strides EOL and includes a newline, as in
17611 longlines-mode. (Bug#9254)
17612 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17613 word-wrap under bidirectional display. (Bug#9224)
17615 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17616 is non-zero, even if the data buffer is NULL. Fixes a crash in
17617 vertical-motion with longlines-mode. (Bug#9254)
17619 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17621 * bidi.c <bidi_cache_total_alloc>: Now static.
17622 (bidi_initialize): Initialize bidi_cache_total_alloc.
17624 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17627 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17628 amount allocated this far in `bidi_cache_total_alloc'.
17629 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17630 non-zero, only free the data buffer without restoring the cache
17631 contents. All callers changed.
17633 * dispextern.h (bidi_unshelve_cache): Update prototype.
17635 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17636 (move_it_in_display_line, move_it_to)
17637 (move_it_vertically_backward, move_it_by_lines): Replace the call
17638 to xfree to an equivalent call to bidi_unshelve_cache.
17639 (move_it_in_display_line_to): Fix logic of returning
17640 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17642 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17644 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17645 came from a string character with a `cursor' property. (Bug#9229)
17647 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17649 * Makefile.in (LIB_PTHREAD): New variable.
17650 (LIBES): Add LIB_PTHREAD (Bug#9216).
17652 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17653 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17655 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17657 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17659 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17661 * xterm.c (x_find_topmost_parent): New function.
17662 (x_set_frame_alpha): Find topmost parent window with
17663 x_find_topmost_parent and set the property there also (bug#9181).
17664 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17666 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17668 * callproc.c (Fcall_process): Avoid vfork clobbering
17669 the local vars buffer, coding_systems, current_dir.
17671 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17673 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17675 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17677 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17678 so that it is not optimized away.
17680 * xdisp.c (compute_display_string_pos): Remove unused local.
17682 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17684 Fix slow cursor motion and scrolling in large buffers with
17685 selective display, like Org Mode buffers. (Bug#9218)
17687 * dispextern.h (struct bidi_it): New member disp_prop_p.
17689 * xdisp.c: Remove one-slot cache of display string positions.
17690 (compute_display_string_pos): Accept an additional argument
17691 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17692 for a display string or property. If found, set DISP_PROP_P
17695 * bidi.c (bidi_fetch_char): Accept an additional argument
17696 DISP_PROP_P, and pass it to compute_display_string_pos.
17697 Only handle text covered by a display string if DISP_PROP_P is returned
17698 non-zero. All callers of bidi_fetch_char changed.
17700 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17702 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17704 2010-12-03 Don March <don@ohspite.net>
17706 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17707 last character M-[char] is translated to ESC [char] (bug#7541).
17709 2011-08-02 Kenichi Handa <handa@m17n.org>
17711 * lisp.h (uniprop_table): Extern it.
17713 * chartab.c (uniprop_table): Make it non-static.
17715 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17717 * xdisp.c (forward_to_next_line_start): Accept additional argument
17718 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17720 (reseat_at_next_visible_line_start): Use the bidi iterator state
17721 returned by forward_to_next_line_start to restore the state of
17722 it->bidi_it after backing up to previous newline. (Bug#9212)
17724 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17726 * regex.c (re_comp): Protoize.
17727 (re_exec): Fix return type.
17728 (regexec): Fix type of `ret'. (Bug#9203)
17730 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17732 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17733 This is needed if max-image-size is a floating-point number.
17735 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17737 * print.c (print_object): Print empty symbol as ##.
17739 * lread.c (read1): Read ## as empty symbol.
17741 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17743 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17744 setting frame foreground color (Bug#9175).
17745 (x_set_background_color): Likewise.
17747 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17748 contents (Bug#9176).
17749 (EmacsTooltip -init): Remove bezels and add shadows to
17752 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17753 or scroll bar (Bug#8470).
17755 * nsfont.m (nsfont_open): Remove assignment to voffset and
17756 unnecessary vars hshink, expand, hd, full_height, min_height.
17757 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17759 * nsterm.h (nsfont_info): Remove voffset field.
17761 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17763 Implement strike-through and overline on NextStep (Bug#8863).
17765 * nsfont.m (nsfont_open): Use underline position provided by font,
17766 instead of hard-coded value of 2.
17767 (nsfont_draw): Call ns_draw_text_decoration instead.
17769 * nsterm.h: Add declaration for ns_draw_text_decoration.
17771 * nsterm.m (ns_draw_text_decoration): New function for drawing
17772 underline, overline, and strike-through.
17773 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17774 ns_draw_text_decoration. Change treatment of cursor drawing to
17775 accommodate underlining, etc.
17777 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17779 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17782 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17784 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17785 Without this fix, if a signal arrives just after memory fills up,
17786 'malloc' might be invoked reentrantly.
17788 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17789 In other words, assume that every image size is allowed, on non-X
17790 hosts. This assumption is probably wrong, but it lets Emacs compile.
17792 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17794 * regex.c (re_iswctype): Convert return values to boolean.
17796 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17798 * xdisp.c (compute_display_string_pos): Don't use cached display
17799 string position if the buffer had its restriction changed.
17802 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17804 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17806 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17808 Integer signedness and overflow and related fixes. (Bug#9079)
17810 * bidi.c: Integer size and overflow fixes.
17811 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17812 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17813 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17814 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17815 (bidi_find_other_level_edge):
17816 Use ptrdiff_t instead of EMACS_INT where either will do.
17817 This works better on 32-bit hosts configured --with-wide-int.
17818 (bidi_cache_ensure_space): Check for size-calculation overflow.
17819 Use % rather than repeated addition, for better worst-case speed.
17820 Don't set bidi_cache_size until after xrealloc returns, because it
17822 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17823 (bidi_cache_ensure_space): Also check that the bidi cache size
17824 does not exceed that of the largest Lisp string or buffer. See Eli
17825 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17827 * alloc.c (__malloc_size_t): Remove.
17828 All uses replaced by size_t. See Andreas Schwab's note
17829 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17831 * image.c: Improve checking for integer overflow.
17832 (check_image_size): Assume that f is nonnull, since
17833 it is always nonnull in practice. This is one less thing to
17834 worry about when checking for integer overflow later.
17835 (x_check_image_size): New function, which checks for integer
17836 overflow issues inside X.
17837 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17838 This removes the need for a memory_full check.
17839 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17840 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17841 (xbm_read_bitmap_data): Change locals back to 'int', since
17842 their values must fit in 'int'.
17843 (xpm_load_image, png_load, tiff_load):
17844 Invoke x_create_x_image_and_pixmap earlier,
17845 to avoid much needless work if the image is too large.
17846 (tiff_load): Treat overly large images as if
17847 x_create_x_image_and_pixmap failed, not as malloc failures.
17848 (gs_load): Use x_check_image_size.
17850 * gtkutil.c: Omit integer casts.
17851 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17852 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17854 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17856 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17857 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17858 would wrongly return t on a 64-bit host.
17860 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17861 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17862 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17863 and therefore cause GCC to emit a bogus diagnostic in some cases.
17865 * image.c: Integer signedness and overflow and related fixes.
17866 This is not an exhaustive set of fixes, but it's time to
17867 record what I've got.
17868 (lookup_pixel_color, check_image_size): Remove redundant decls.
17869 (check_image_size): Don't assume that arbitrary EMACS_INT values
17870 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17871 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17872 (tiff_load, imagemagick_load_image):
17873 Check for overflow in size calculations.
17874 (x_create_x_image_and_pixmap): Remove unnecessary test for
17875 xmalloc returning NULL; that can't happen.
17876 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17877 (xpm_color_bucket): Use better integer hashing function.
17878 (xpm_cache_color): Don't possibly over-allocate memory.
17879 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17880 (gif_memory_source):
17881 Use ptrdiff_t, not int or size_t, to record sizes.
17882 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17883 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17884 either works, as we prefer signed integers.
17885 (tiff_read_from_memory, tiff_write_from_memory):
17886 Return tsize_t, not size_t, since that's what the TIFF API wants.
17887 (tiff_read_from_memory): Don't fail simply because the read would
17888 go past EOF; instead, return a short read.
17889 (tiff_load): Omit no-longer-needed casts.
17890 (Fimagemagick_types): Don't assume size fits into 'int'.
17892 Improve hashing quality when configured --with-wide-int.
17893 * fns.c (hash_string): New function, taken from sxhash_string.
17894 Do not discard information about ASCII character case; this
17895 discarding is no longer needed.
17896 (sxhash-string): Use it. Change sig to match it. Caller changed.
17897 * lisp.h: Declare it.
17898 * lread.c (hash_string): Remove, since we now use fns.c's version.
17899 The fns.c version returns a wider integer if --with-wide-int is
17900 specified, so this should help the quality of the hashing a bit.
17902 * emacs.c: Integer overflow minor fix.
17903 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17904 Define only if GNU_LINUX.
17905 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17907 * dispnew.c: Integer signedness and overflow fixes.
17908 Remove unnecessary forward decls, that were a maintenance hassle.
17909 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17911 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17912 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17913 (prepare_desired_row, line_draw_cost):
17914 Use int, not unsigned, where either works.
17915 (save_current_matrix, restore_current_matrix):
17916 Use ptrdiff_t, not size_t, where either works.
17917 (init_display): Check for overflow more accurately, and without
17918 relying on undefined behavior.
17920 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17921 Remove, replacing with the new symbols in lisp.h. All uses changed.
17922 * fileio.c (make_temp_name):
17923 * filelock.c (lock_file_1, lock_file):
17924 * xdisp.c (message_dolog):
17925 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17926 Use pMd etc. instead.
17927 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17928 replacing the pWIDE etc. symbols removed from editfns.c.
17930 * keyboard.h (num_input_events): Now uintmax_t.
17931 This is (very slightly) less likely to mess up due to wraparound.
17934 * buffer.c: Integer signedness fixes.
17935 (alloc_buffer_text, enlarge_buffer_text):
17936 Use ptrdiff_t rather than size_t when either will do, as we prefer
17939 * alloc.c: Integer signedness and overflow fixes.
17940 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17941 (__malloc_size_t): Default to size_t, not to int.
17942 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17943 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17944 Prefer ptrdiff_t to size_t when either would do, as we prefer
17946 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17947 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17948 Now const. Initialize with values that are in range even if char
17950 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17951 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17952 These functions do the right thing with sizes > 2**32.
17953 (check_depth): Now ptrdiff_t, not int.
17954 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17955 Adjust to new way of storing sizes. Check for size overflow bugs
17957 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17958 slightly wrong anyway, as it missed one instance of
17959 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17960 (refill_memory_reserve): Omit needless cast to size_t.
17961 (mark_object_loop_halt): Mark as externally visible.
17963 * xselect.c: Integer signedness and overflow fixes.
17964 (Fx_register_dnd_atom, x_handle_dnd_message):
17965 Use ptrdiff_t, not size_t, since we prefer signed.
17966 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17967 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17968 x_dnd_atoms_size and x_dnd_atoms_length.
17970 * doprnt.c: Prefer signed to unsigned when either works.
17972 * doprnt.c (doprnt):
17974 * xdisp.c (vmessage):
17975 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17976 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17977 prefer signed arithmetic to avoid comparison confusion.
17978 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17979 but is a bit tricky.
17981 Assume freestanding C89 headers, string.h, stdlib.h.
17982 * data.c, doprnt.c, floatfns.c, print.c:
17983 Include float.h unconditionally.
17984 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17985 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17986 * regex.c: Likewise for stddef.h, string.h.
17987 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17988 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17989 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17990 (STDC_HEADERS): Remove obsolete defines.
17991 * sysdep.c: Include limits.h unconditionally.
17993 Assume support for memcmp, memcpy, memmove, memset.
17994 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17995 * regex.c (memcmp, memcpy):
17996 Remove; we assume C89 now.
17998 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17999 (__malloc_safe_bcopy): Remove; no longer needed.
18001 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18002 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18003 well either way, and we prefer signed to unsigned.
18005 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18007 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18008 closes the connection while we're reading (bug#9182).
18010 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18012 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18013 are specified (Bug#9168).
18015 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18017 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18018 Found by GCC static checking and --with-wide-int on a 32-bit host.
18020 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18022 * xdisp.c (compute_display_string_pos): Fix logic of caching
18023 previous display string position. Initialize cached_prev_pos to
18024 -1. Fixes slow-down at the beginning of a buffer.
18026 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18028 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18029 for attrs[LFACE_FONTSET_INDEX].
18031 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18033 * xml.c (parse_region): Remove unused local
18034 that was recently introduced.
18036 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18038 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18039 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18041 * xdisp.c (move_it_in_display_line_to): Record the best matching
18042 position for TO_CHARPOS while scanning the line, and restore it on
18043 exit if none of the characters scanned was an exact match.
18044 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18045 when exact match is impossible due to invisible text, and the
18046 lines are truncated.
18048 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18050 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18053 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18055 Fix a significant slow-down of cursor motion with C-n, C-p,
18056 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18057 auto-repeat under bidi redisplay in fontified buffers.
18058 * xdisp.c (compute_stop_pos_backwards): New function.
18059 (next_element_from_buffer): Call compute_stop_pos_backwards to
18060 find a suitable prev_stop when we find ourselves before
18062 (reseat): Don't look for prev_stop, as that could mean a very long
18064 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18065 <cached_disp_overlay_modiff>: Cache for last found display string
18067 (compute_display_string_pos): Return the cached position if asked
18068 about the same buffer in the same area of character positions, and
18069 the buffer wasn't changed since the time the display string
18070 position was cached.
18072 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18074 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18075 is an integer, which is important for empty lines. (Bug#9149)
18077 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18079 * frame.c (Fmodify_frame_parameters): In tty case, update the
18080 default face if necessary (Bug#4238).
18082 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18084 * editfns.c (Fstring_to_char): No need to explain what a character
18085 is in the docstring (Bug#6576).
18087 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18089 * xml.c (parse_region): Make sure we always return a tree.
18091 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18093 * xml.c (parse_region): If a document contains only comments,
18096 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18098 * xml.c (make_dom): Return comments, too.
18100 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18103 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18104 and the surrounding thread.
18105 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18106 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18107 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18109 * s/openbsd.h (BROKEN_SIGIO): Define.
18110 * unexelf.c (unexec) [__OpenBSD__]:
18111 Don't update the .mdebug section of the Alpha COFF symbol table.
18113 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18115 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18118 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18120 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18121 This fixes some race conditions on the permissions of any newly
18124 * alloc.c (valid_pointer_p): Use pipe, not open.
18125 This fixes some permissions issues when debugging.
18127 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18128 If fchown fails to set both uid and gid, try to set just gid,
18129 as that is sometimes allowed. Adjust the file's mode to eliminate
18130 setuid or setgid bits that are inappropriate if fchown fails.
18132 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18134 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18135 to compare Lisp_Objects.
18136 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18137 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18138 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18140 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18142 * lread.c (read_integer): Unread even EOF character.
18143 (read1): Likewise. Properly record start position of symbol.
18145 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18146 symbol character follows.
18148 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18150 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18151 This works around a problem with the previous change to Fcopy_file.
18152 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18153 and without this change, GCC might complain about discarding
18154 fchown's return value.
18156 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18158 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18160 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18162 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18164 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18166 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18167 it's used from the C level.
18169 * process.c: Use the same condition for POLL_FOR_INPUT in both
18170 keyboard.c and process.c (bug#1858).
18172 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18174 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18175 (Fgnutls_boot): Use it.
18177 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18179 * doc.c (Fsubstitute_command_keys): Revert last change.
18181 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18183 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18184 quotes the next character, and doesn't affect other longer
18185 sequences (bug#8935).
18187 * lread.c (syms_of_lread): Clarify that is isn't only
18188 `eval-buffer' and `eval-defun' that's affected by
18189 `lexical-binding' (bug#8460).
18191 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18193 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18194 bidi redisplay when a line includes both an image and is truncated.
18196 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18198 Fix minor problems found by static checking.
18199 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18200 (elsz): Now a signed constant, not a size_t var. We prefer signed
18201 types to unsigned, to avoid integer comparison confusion. Without
18202 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18203 "cannot optimize loop, the loop counter may overflow", a symptom
18205 * indent.c (Fvertical_motion): Mark locals as initialized.
18206 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18208 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18210 * search.c (Fre_search_backward): Mention `case-fold-search' in
18211 all the re_search_* functions (bug#8138).
18213 * keyboard.c (Fopen_dribble_file): Document when the file is
18216 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18218 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18221 Support bidi reordering of display and overlay strings.
18222 * xdisp.c (compute_display_string_pos)
18223 (compute_display_string_end): Accept additional argument STRING.
18224 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18225 (reseat_to_string): Initialize bidi_it->string.s and
18226 bidi_it->string.schars.
18227 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18228 NULL (avoids a crash in bidi_paragraph_init).
18229 Initialize itb.string.lstring.
18230 (init_iterator): Call bidi_init_it only of a valid
18231 buffer position was specified. Initialize paragraph_embedding to
18233 (reseat_to_string): Initialize the bidi iterator.
18234 (display_string): If we need to ignore text properties of
18235 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18236 original value of -1 will not work with bidi.)
18237 (compute_display_string_pos): First arg is now struct
18238 `text_pos *'; all callers changed. Support display properties on
18240 (compute_display_string_end): Support display properties on Lisp
18242 (init_iterator, reseat_1, reseat_to_string): Initialize the
18243 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18244 when iterating on a string not from display properties).
18245 (compute_display_string_pos, compute_display_string_end):
18246 Fix calculation of the object to scan. Fixes an error when using
18248 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18249 base_level_stop; instead, set base_level_stop to BEGV.
18250 Fixes crashes in vertical-motion.
18251 (next_element_from_buffer): Improve commentary for when
18252 the iterator is before prev_stop.
18253 (init_iterator): Initialize bidi_p from the default value of
18254 bidi-display-reordering, not from buffer-local value. Use the
18255 buffer-local value only if initializing for buffer iteration.
18256 (handle_invisible_prop): Support invisible properties on strings
18257 that are being bidi-reordered.
18258 (set_iterator_to_next): Support bidi reordering of C strings and
18260 (next_element_from_string): Support bidi reordering of Lisp
18262 (handle_stop_backwards): Support Lisp strings as well.
18263 (display_string): Support display of R2L glyph rows.
18264 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18265 (init_iterator): Don't initialize it->bidi_p for strings
18267 (reseat_to_string): Initialize it->bidi_p for strings here.
18268 (next_element_from_string, next_element_from_c_string)
18269 (next_element_from_buffer): Add xassert's for correspondence
18270 between IT's object being iterated and it->bidi_it.string
18272 (face_before_or_after_it_pos): Support bidi iteration.
18273 (next_element_from_c_string): Handle the case of the first string
18274 character that is not the first one in the visual order.
18275 (get_visually_first_element): New function, refactored from common
18276 parts of next_element_from_buffer, next_element_from_string, and
18277 next_element_from_c_string.
18278 (tool_bar_lines_needed, redisplay_tool_bar)
18279 (display_menu_bar): Force left-to-right direction. Add a FIXME
18280 comment for making that be controlled by a user option.
18281 (push_it, pop_it): Save and restore the state of the
18282 bidi iterator. Save and restore the bidi_p flag.
18283 (pop_it): Iterate out of display property for string iteration as
18285 (iterate_out_of_display_property): Support iteration over strings.
18286 (handle_single_display_spec): Set up it->bidi_it for iteration
18287 over a display string, and call bidi_init_it.
18288 (handle_single_display_spec, next_overlay_string)
18289 (get_overlay_strings_1, push_display_prop): Set up the bidi
18290 iterator for displaying display or overlay strings.
18291 (forward_to_next_line_start): Don't use the shortcut if
18293 (back_to_previous_visible_line_start): If handle_display_prop
18294 pushed the iterator stack, restore the internal state of the bidi
18295 iterator by calling bidi_pop_it same number of times.
18296 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18297 and we are bidi-iterating, don't decrement the iterator position;
18298 instead, set the first_elt flag in the bidi iterator, to produce
18300 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18301 (push_display_prop): xassert that we are iterating a buffer.
18302 (push_it, pop_it): Save and restore paragraph_embedding member.
18303 (handle_single_display_spec, next_overlay_string)
18304 (get_overlay_strings_1, reseat_1, reseat_to_string)
18305 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18306 correctly. Don't assume unibyte strings are not bidi-reordered.
18307 (compute_display_string_pos)
18308 (compute_display_string_end): Fix handling the case of C string.
18309 (push_it, pop_it): Save and restore from_disp_prop_p.
18310 (handle_single_display_spec, push_display_prop): Set the
18311 from_disp_prop_p flag.
18312 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18313 (pop_it): Call iterate_out_of_display_property only if we are
18314 popping after iteration over a string that came from a display
18315 property. Fix a typo in popping stretch info. Add an assertion
18316 for verifying that the iterator position is in sync with the bidi
18318 (handle_single_display_spec, get_overlay_strings_1)
18319 (push_display_prop): Fix initialization of paragraph direction for
18320 string when that of the parent object is not yet determined.
18321 (reseat_1): Call bidi_init_it to resync the bidi
18322 iterator with IT's position. (Bug#7616)
18323 (find_row_edges): If ROW->start.pos gives position
18324 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18325 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18326 Reset the from_disp_prop_p flag.
18327 (SAVE_IT, RESTORE_IT): New macros.
18328 (pos_visible_p, face_before_or_after_it_pos)
18329 (back_to_previous_visible_line_start)
18330 (move_it_in_display_line_to, move_it_in_display_line)
18331 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18332 (try_scrolling, redisplay_window, display_line): Use them when
18333 saving a temporary copy of the iterator and restoring it back.
18334 (back_to_previous_visible_line_start, reseat_1)
18335 (init_iterator): Empty the bidi cache "stack".
18336 (move_it_in_display_line_to): If iterator ended up at
18337 EOL, but we never saw any buffer positions smaller than
18338 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18339 motion in bidi-reordered lines.
18340 (move_it_in_display_line_to): Record prev_method and prev_pos
18341 immediately before the call to set_iterator_to_next. Fixes cursor
18342 motion in bidi-reordered lines with stretch glyphs and strings
18343 displayed in margins. (Bug#8133) (Bug#8867)
18344 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18346 (pos_visible_p): Support positions in bidi-reordered lines.
18347 Save and restore bidi cache.
18349 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18350 (bidi_paragraph_info): Delete unused struct.
18351 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18352 (bidi_cache_start): New variable.
18353 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18355 (bidi_cache_fetch_state, bidi_cache_search)
18356 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18357 (bidi_cache_find, bidi_peek_at_next_level)
18358 (bidi_level_of_next_char, bidi_find_other_level_edge)
18359 (bidi_move_to_visually_next): Compare cache index with
18360 bidi_cache_start rather than with zero.
18361 (bidi_fetch_char): Accept new argument STRING; all callers
18362 changed. Support iteration over a string. Support strings with
18363 display properties. Support unibyte strings. Fix the type of
18364 `len' according to what STRING_CHAR_AND_LENGTH expects.
18365 (bidi_paragraph_init, bidi_resolve_explicit_1)
18366 (bidi_resolve_explicit, bidi_resolve_weak)
18367 (bidi_level_of_next_char, bidi_move_to_visually_next):
18368 Support iteration over a string.
18369 (bidi_set_sor_type, bidi_resolve_explicit_1)
18370 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18371 can now be zero (for strings); special values 0 and -1 were
18372 changed to -1 and -2, respectively.
18373 (bidi_char_at_pos): New function.
18374 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18375 Call it instead of FETCH_MULTIBYTE_CHAR.
18376 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18377 initialized to valid values.
18378 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18380 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18381 the test for valid cached positions. Fix the logic for looking up
18382 the sentinel state in the cache. GCPRO the Lisp string we are
18384 (bidi_push_it, bidi_pop_it): New functions.
18385 (bidi_initialize): Initialize the bidi cache start stack pointer.
18386 (bidi_cache_ensure_space): New function, refactored from part of
18387 bidi_cache_iterator_state. Don't assume the required size is just
18388 one BIDI_CACHE_CHUNK away.
18389 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18390 (bidi_count_bytes, bidi_char_at_pos): New functions.
18391 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18392 always valid if bidi_cache_idx is valid.
18393 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18394 is valid if it's going to be used.
18395 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18396 (bidi_cache_fetch_state, bidi_cache_search)
18397 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18398 (bidi_cache_iterator_state, bidi_cache_find)
18399 (bidi_find_other_level_edge, bidi_cache_start_stack):
18400 All variables related to cache indices are now EMACS_INT.
18402 * dispextern.h (struct bidi_string_data): New structure.
18403 (struct bidi_it): New member `string'. Make flag members be 1-bit
18404 fields, and put them last in the struct.
18405 (compute_display_string_pos, compute_display_string_end):
18407 (bidi_push_it, bidi_pop_it): Add prototypes.
18408 (struct iterator_stack_entry): New members bidi_p,
18409 paragraph_embedding, and from_disp_prop_p.
18410 (struct it): Member bidi_p is now a bit field 1 bit wide.
18411 (bidi_shelve_cache, bidi_unshelve_cache):
18412 Declare prototypes.
18414 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18415 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18416 and vector-like objects.
18418 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18419 cache around display iteration.
18421 * window.c (Fwindow_end, window_scroll_pixel_based)
18422 (displayed_window_lines, Frecenter): Save and restore the bidi
18423 cache around display iteration.
18425 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18427 * editfns.c (Fdelete_region): Clarify the use of the named
18428 parameters (bug#6788).
18430 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18432 * indent.c (Fvertical_motion): Set and restore w->pointm when
18433 saving and restoring the window's buffer (Bug#9006).
18435 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18437 * editfns.c (Fstring_to_char): Clarify just what is returned
18438 (bug#6576). Text by Eli Zaretskii.
18440 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18442 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18444 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18446 * buffer.c (mmap_find): Fix a typo.
18448 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18450 Fix execution of x selection hooks.
18451 * xselect.c (Qx_lost_selection_functions)
18452 (Qx_sent_selection_functions): New vars.
18453 (syms_of_xselect): DEFSYM them.
18454 (x_handle_selection_request): Pass Qx_sent_selection_functions
18455 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18456 (x_handle_selection_clear,x_clear_frame_selections):
18457 Pass Qx_lost_selection_functions rather than
18458 Vx_lost_selection_functions to Frun_hook_with_args.
18460 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18462 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18463 The old code sometimes used this field without initializing it.
18465 * alloc.c (gc_sweep): Don't read past end of array.
18466 In theory, the old code could also have corrupted Emacs internals,
18467 though it'd be very unlikely.
18469 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18471 * character.c (Fcharacterp): Don't advertise optional ignored
18472 argument. (Bug#4026)
18474 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18476 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18479 * window.c (Fset_window_start): Doc fix (bug#4199).
18480 (Fset_window_hscroll): Ditto.
18482 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18484 Fix minor new problems caught by GCC 4.6.1.
18485 * term.c (init_tty): Remove unused local.
18486 * xsettings.c (store_monospaced_changed): Define this function only
18487 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18488 not used otherwise.
18490 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18492 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18494 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18496 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18497 are the mini-buffer and the echo area (bug#3320).
18499 * term.c (init_tty): Remove support for supdup, c10 and perq
18500 terminals, which are no longer supported (bug#1482).
18502 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18504 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18506 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18508 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18509 for non-popups (Bug#3642).
18511 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18513 * alloc.c (reset_malloc_hooks): Protoize.
18514 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18515 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18516 * cm.c (losecursor): Likewise.
18517 * data.c (fmod): Likewise.
18518 * dispnew.c (swap_glyphs_in_rows): Likewise.
18519 * emacs.c (memory_warning_signal): Likewise.
18520 * floatfns.c (float_error): Likewise.
18521 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18522 (otf_open, font_otf_capability, generate_otf_features)
18523 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18525 * image.c (pbm_read_file): Likewise.
18526 * indent.c (string_display_width): Likewise.
18527 * intervals.c (check_for_interval, search_for_interval)
18528 (inc_interval_count, count_intervals, root_interval)
18529 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18530 * lread.c (defalias): Likewise.
18531 * ralloc.c (r_alloc_check): Likewise.
18532 * regex.c (set_image_of_range_1, set_image_of_range)
18533 (regex_grow_registers): Likewise.
18534 * sysdep.c (strerror): Likewise.
18535 * termcap.c (valid_filename_p, tprint, main): Likewise.
18536 * tparam.c (main): Likewise.
18537 * unexhp9k800.c (run_time_remap, save_data_space)
18538 (update_file_ptrs, read_header, write_header, calculate_checksum)
18539 (copy_file, copy_rest, display_header): Likewise.
18540 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18542 * xdisp.c (check_it): Likewise.
18543 * xfaces.c (register_color, unregister_color, unregister_colors):
18545 * xfns.c (print_fontset_result): Likewise.
18546 * xrdb.c (member, fatal, main): Likewise.
18548 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18550 Fix minor problems found by static checking (Bug#9031).
18551 * chartab.c (char_table_set_range, map_sub_char_table):
18552 Remove unused locals.
18553 (uniprop_table): Now static.
18554 * composite.c (_work_char): Remove unused static var.
18556 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18558 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18560 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18562 * gtkutil.c (qttip_cb): Remove code without function.
18564 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18566 * w32.c (pthread_sigmask): New stub.
18568 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18570 Use pthread_sigmask, not sigprocmask (Bug#9010).
18571 sigprocmask is portable only for single-threaded applications, and
18572 Emacs can be multi-threaded when it uses GTK.
18573 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18575 * callproc.c (Fcall_process):
18576 * process.c (create_process):
18577 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18578 Use pthread_sigmask, not sigprocmask.
18580 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18582 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18583 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18586 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18588 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18589 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18590 (xg_hide_tooltip): Fix comment.
18592 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18593 in registerServicesMenuSendTypes.
18594 (validRequestorForSendType): Don't check ns_return_types.
18596 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18599 2011-07-08 Jason Rumney <jasonr@gnu.org>
18601 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18602 SH_SHOW for hidden windows (Bug#5482).
18604 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18605 frame struct members of non-existent frames (Bug#6284).
18607 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18609 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18610 variable firstTime not needed on OSX >= 10.6.
18611 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18612 >= 10.5. Use setKnobProportion, setDoubleValue.
18614 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18615 (MAC_OS_X_VERSION_10_5): Define if not defined.
18616 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18617 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18618 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18620 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18621 cString and lossyCString on OSX >= 10.4.
18623 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18624 sizeToFit on OSX >= 10.2.
18626 * nsimage.m (allocInitFromFile): Don't use deprecated method
18627 bestRepresentationForDevice on OSX >= 10.6.
18629 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18632 * emacs.c: Declare unexec_init_emacs_zone.
18634 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18636 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18638 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18639 on svcsMenu (Bug#8842).
18641 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18643 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18645 * nsterm.m (QUTF8_STRING): Declare.
18646 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18647 (validRequestorForSendType): Return type is (id).
18648 Change indexOfObjectIdenticalTo to indexOfObject.
18649 Check if we have local selection before returning self (Bug#8842).
18650 (writeSelectionToPasteboard): Put local selection into paste board
18651 if we have a local selection (Bug#8842).
18652 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18654 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18655 (ns_get_local_selection): Declare.
18657 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18659 * keymap.c (describe_map_tree): Don't insert a double newline at
18660 the end of the buffer (bug#1169) and return whether we inserted
18663 * callint.c (Fcall_interactively): Change "reading args" to
18664 "providing args" to try to clarify what it does (bug#1010).
18666 2011-07-07 Kenichi Handa <handa@m17n.org>
18668 * composite.c (composition_compute_stop_pos): Ignore a static
18669 composition starting before CHARPOS (Bug#8915).
18671 * xdisp.c (handle_composition_prop): Likewise.
18673 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18675 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18678 2011-07-07 Kenichi Handa <handa@m17n.org>
18680 * character.h (unicode_category_t): New enum type.
18682 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18683 (Qchar_code_property_table): New variable.
18684 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18685 (UNIPROP_COMPRESSED_FORM_P): New macros.
18686 (char_table_ascii): Uncompress the compressed values.
18687 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18688 Uncompress the compressed values.
18689 (sub_char_table_ref_and_range): Likewise.
18690 (char_table_ref_and_range): Uncompress the compressed values.
18691 (sub_char_table_set): New arg is_uniprop. Callers changed.
18692 Uncompress the compressed values.
18693 (sub_char_table_set_range): Args changed. Callers changed.
18694 (char_table_set_range): Adjuted for the above change.
18695 (map_sub_char_table): Delete args default_val and parent. Add arg
18696 top. Give decoded values to a Lisp function.
18697 (map_char_table): Adjust for the above change. Give decoded
18698 values to a Lisp function. Gcpro more variables.
18699 (uniprop_table_uncompress)
18700 (uniprop_decode_value_run_length): New functions.
18701 (uniprop_decoder, uniprop_decoder_count): New variables.
18702 (uniprop_get_decoder, uniprop_encode_value_character)
18703 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18705 (uniprop_encoder, uniprop_encoder_count): New variables.
18706 (uniprop_get_encoder, uniprop_table)
18707 (Funicode_property_table_internal, Fget_unicode_property_internal)
18708 (Fput_unicode_property_internal): New functions.
18709 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18710 Sunicode_property_table_internal, Sget_unicode_property_internal,
18711 and Sput_unicode_property_internal. Defvar_lisp
18712 char-code-property-alist.
18714 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18715 Vunicode_category_table.
18717 * font.c (font_range): Adjust for the change of
18718 Vunicode_category_table.
18720 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18722 * m/iris4d.h: Remove file, move contents ...
18723 * s/irix6-5.h: ... here.
18725 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18727 Remove unportable assumption about struct layout (Bug#8884).
18728 * alloc.c (mark_buffer):
18729 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18730 (clone_per_buffer_values): Don't assume that
18731 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18732 This isn't true in general, and it's particularly not true
18733 if Emacs is configured with --with-wide-int.
18734 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18735 New macros, used in the buffer.c change.
18737 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18739 * xsettings.c: Use both GConf and GSettings if both are available.
18740 (store_config_changed_event): Add comment.
18741 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18742 (store_tool_bar_style_changed): New functions.
18743 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18744 (struct xsettings): Move font inside HAVE_XFT.
18745 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18746 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18747 Move inside HAVE_XFT.
18748 (something_changed_gsettingsCB): Rename from something_changedCB.
18749 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18751 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18752 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18753 (something_changed_gconfCB): Rename from something_changedCB.
18754 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18755 (parse_settings): Move check for font inside HAVE_XFT.
18756 (read_settings, apply_xft_settings): Add comment.
18757 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18758 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18759 call store_font_name_changed.
18760 (xft_settings_event): Add comment.
18761 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18762 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18763 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18764 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18765 (xsettings_initialize): Call init_gsettings last.
18766 (xsettings_get_system_font, xsettings_get_system_normal_font):
18769 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18771 Random fixes. E.g., (random) never returned negative values.
18772 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18773 subseconds part to the entropy, as that's a bit more random.
18774 Prefer signed to unsigned, since the signedness doesn't matter and
18775 in general we prefer signed. When given a limit, use a
18776 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18777 latter isn't right if USE_2_TAGS_FOR_INTS.
18778 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18779 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18781 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18783 * textprop.c (text_property_stickiness):
18784 Obey Vtext_property_default_nonsticky.
18785 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18786 * w32fns.c (syms_of_w32fns):
18787 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18789 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18791 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18792 This is more efficient than Ffile_directory_p and avoids a minor race.
18794 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18796 * buffer.c (Foverlay_put): Say what the return value is
18799 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18800 is a directory before asking whether to use the file name
18802 (barf_or_query_if_file_exists): Make the "File is a directory"
18803 error be more correct.
18805 * fns.c (Frequire): Remove the mention of the .gz files, since
18806 that's installation-specific, but keep the mention of
18807 `get-load-suffixes'.
18809 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18811 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18812 Report string overflow if the output is too long.
18814 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18816 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18817 (syms_of_gnutls): Remove duplicate DEFSYM for
18818 Qgnutls_bootprop_verify_hostname_error, an error for
18819 Qgnutls_bootprop_verify_error (which is no longer used).
18821 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18822 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18823 Also (re)move comments that are misplaced or no longer relevant.
18825 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18827 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18829 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18831 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18832 and background color parameters if they have been changed.
18834 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18836 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18838 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18840 * xsettings.c (SYSTEM_FONT): Define only when used.
18841 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18843 * keymap.c (access_keymap_1): Now static.
18845 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18847 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18848 leave any prefix arg for the up event (Bug#1586).
18850 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18852 * lread.c (syms_of_lread): Mention single symbols defined by
18853 `defvar' or `defconst' (bug#7154).
18855 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18856 (Frequire): Mention get-load-suffixes.
18858 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18860 * window.h (window): Remove clone_number slot.
18861 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18863 (make_parent_window, make_window, saved_window)
18864 (Fset_window_configuration, save_window_save): Don't deal with
18866 * buffer.c (Qclone_number): Remove declaration.
18867 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18869 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18871 Add multiple inheritance to keymaps.
18872 * keymap.c (Fmake_composed_keymap): New function.
18873 (Fset_keymap_parent): Simplify.
18874 (fix_submap_inheritance): Remove.
18875 (access_keymap_1): New function extracted from access_keymap to handle
18876 embedded parents and handle lists of maps.
18877 (access_keymap): Use it.
18878 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18879 (Fcopy_keymap): Handle embedded parents.
18880 (Fcommand_remapping, define_as_prefix): Simplify.
18881 (Fkey_binding): Simplify.
18882 (syms_of_keymap): Move minibuffer-local-completion-map,
18883 minibuffer-local-filename-completion-map,
18884 minibuffer-local-must-match-map, and
18885 minibuffer-local-filename-must-match-map to Elisp.
18886 (syms_of_keymap): Defsubr make-composed-keymap.
18887 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18888 (parse_menu_item): Trivial simplification.
18890 2011-07-01 Glenn Morris <rgm@gnu.org>
18892 * Makefile.in (SETTINGS_LIBS): Fix typo.
18894 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18896 * coding.c (Fencode_coding_string): Record the last coding system
18897 used, as the function doc string says (bug#8738).
18899 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18901 * xsettings.c (store_monospaced_changed): Take new font as arg and
18902 check for change against current_mono_font.
18903 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18904 (emacs_settings_constructor, emacs_settings_get_property)
18905 (emacs_settings_set_property, emacs_settings_class_init)
18906 (emacs_settings_init, gsettings_obj): Remove.
18907 (something_changedCB): New function for HAVE_GSETTINGS.
18908 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18909 with value as argument.
18910 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18911 g_settings_new (Bug#8967). Do not create gsettings_obj.
18912 Remove calls to g_settings_bind. Connect something_changedCB to
18915 * xgselect.c: Add defined (HAVE_GSETTINGS).
18916 (xgselect_initialize): Ditto.
18918 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18919 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18922 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18924 * eval.c (struct backtrace): Simplify and port the data structure.
18925 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18926 signed bit field, as this assumption is not portable and it makes
18927 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18928 "char debug_on_exit : 1" as this is not portable either; instead,
18929 use the portable "unsigned int debug_on_exit : 1". Remove unused
18930 member evalargs. Remove obsolete comments about cc bombing out.
18932 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18934 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18935 Let HAVE_GSETTINGS override HAVE_GCONF.
18936 (store_monospaced_changed): New function.
18937 (EMACS_SETTINGS): A new type derived from GObject to handle
18938 GSettings notifications.
18939 (emacs_settings_constructor, emacs_settings_get_property)
18940 (emacs_settings_set_property, emacs_settings_class_init):
18942 (gsettings_client, gsettings_obj): New variables.
18943 (GSETTINGS_SCHEMA): New define.
18944 (something_changedCB): Call store_monospaced_changed.
18945 (init_gsettings): New function.
18946 (xsettings_initialize): Call init_gsettings.
18947 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18950 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
18953 2011-06-29 Martin Rudalics <rudalics@gmx.at>
18955 * window.c (resize_root_window, grow_mini_window)
18956 (shrink_mini_window): Rename Qresize_root_window to
18957 Qwindow_resize_root_window and Qresize_root_window_vertically to
18958 Qwindow_resize_root_window_vertically.
18960 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18962 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18964 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
18966 * makefile.w32-in: Redesign dependencies so they reflect more
18967 clearly which files are directly included by each source file,
18968 and not through other includes.
18970 2011-06-27 Martin Rudalics <rudalics@gmx.at>
18972 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18973 (sort_overlays, overlay_strings): When an overlay's clone number
18974 matches the window's clone number process the overlay even if
18975 the overlay's window property doesn't match the current window.
18977 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18978 (Fwindow_hchild): Rename to Fwindow_left_child.
18979 (Fwindow_next): Rename to Fwindow_next_sibling.
18980 (Fwindow_prev): Rename to Fwindow_prev_sibling.
18981 (resize_window_check): Rename to window_resize_check.
18982 (resize_window_apply): Rename to window_resize_apply.
18983 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18984 (Fdelete_other_windows_internal, resize_frame_windows)
18985 (Fsplit_window_internal, Fdelete_window_internal)
18986 (grow_mini_window, shrink_mini_window)
18987 (Fresize_mini_window_internal): Fix callers accordingly.
18989 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18991 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18992 (emacs_fixed_set_min_size): Remove.
18993 (emacs_fixed_new): Take frame as argument.
18995 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18996 (_EmacsFixedPrivate): Remove minwidth/height.
18997 Add struct frame *f.
18998 (emacs_fixed_init): Initialize priv->f.
18999 (get_parent_class, emacs_fixed_set_min_size): Remove.
19000 (emacs_fixed_new): Set priv->f to argument.
19001 (emacs_fixed_get_preferred_width)
19002 (emacs_fixed_get_preferred_height): Use min_width/height from
19003 frames size_hint to set minimum and natural (Bug#8919).
19004 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19005 and use min_width/height from frames size_hint to set
19006 min_width/height (Bug#8919).
19008 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19009 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19012 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19014 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19015 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19018 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19020 * process.c (wait_reading_process_output): Bypass select if
19021 waiting for a cell while ignoring keyboard input, and input is
19022 pending. Suggested by Jan Djärv (Bug#8869).
19024 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19026 Use gnulib's dup2 module instead of rolling our own.
19027 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19029 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19031 * dispnew.c (scrolling_window): Before scrolling, turn off a
19032 mouse-highlight in the window being scrolled.
19034 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19036 Move DEFSYM to lisp.h and use everywhere.
19038 * character.h (DEFSYM): Move declaration...
19039 * lisp.h (DEFSYM): ...here.
19045 * w32select.c: Don't include character.h.
19047 * alloc.c (syms_of_alloc):
19048 * buffer.c (syms_of_buffer):
19049 * bytecode.c (syms_of_bytecode):
19050 * callint.c (syms_of_callint):
19051 * casefiddle.c (syms_of_casefiddle):
19052 * casetab.c (init_casetab_once):
19053 * category.c (init_category_once, syms_of_category):
19054 * ccl.c (syms_of_ccl):
19055 * cmds.c (syms_of_cmds):
19056 * composite.c (syms_of_composite):
19057 * dbusbind.c (syms_of_dbusbind):
19058 * dired.c (syms_of_dired):
19059 * dispnew.c (syms_of_display):
19060 * doc.c (syms_of_doc):
19061 * editfns.c (syms_of_editfns):
19062 * emacs.c (syms_of_emacs):
19063 * eval.c (syms_of_eval):
19064 * fileio.c (syms_of_fileio):
19065 * fns.c (syms_of_fns):
19066 * frame.c (syms_of_frame):
19067 * fringe.c (syms_of_fringe):
19068 * insdel.c (syms_of_insdel):
19069 * keymap.c (syms_of_keymap):
19070 * lread.c (init_obarray, syms_of_lread):
19071 * macros.c (syms_of_macros):
19072 * msdos.c (syms_of_msdos):
19073 * print.c (syms_of_print):
19074 * process.c (syms_of_process):
19075 * search.c (syms_of_search):
19076 * sound.c (syms_of_sound):
19077 * syntax.c (init_syntax_once, syms_of_syntax):
19078 * terminal.c (syms_of_terminal):
19079 * textprop.c (syms_of_textprop):
19080 * undo.c (syms_of_undo):
19081 * w32.c (globals_of_w32):
19082 * window.c (syms_of_window):
19083 * xdisp.c (syms_of_xdisp):
19084 * xfaces.c (syms_of_xfaces):
19085 * xfns.c (syms_of_xfns):
19086 * xmenu.c (syms_of_xmenu):
19087 * xsettings.c (syms_of_xsettings):
19088 * xterm.c (syms_of_xterm): Use DEFSYM.
19090 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19092 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19094 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19096 Integer and buffer overflow fixes (Bug#8873).
19098 * print.c (printchar, strout): Check for string overflow.
19099 (PRINTPREPARE, printchar, strout):
19100 Don't set size unless allocation succeeds.
19102 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19103 for sizes. Check for string overflow more accurately.
19104 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19106 * macros.c: Integer and buffer overflow fixes.
19107 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19108 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19109 Use ptrdiff_t, not int, for sizes.
19110 Don't increment bufsize until after realloc succeeds.
19111 Check for size-calculation overflow.
19112 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19114 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19116 * lread.c: Integer overflow fixes.
19117 (read_integer): Radix is now EMACS_INT, not int,
19118 to improve quality of diagnostics for out-of-range radices.
19119 Calculate buffer size correctly for out-of-range radices.
19120 (read1): Check for integer overflow in radices, and in
19121 read-circle numbers.
19122 (read_escape): Avoid int overflow.
19123 (Fload, openp, read_buffer_size, read1)
19124 (substitute_object_recurse, read_vector, read_list, map_obarray):
19125 Use ptrdiff_t, not int, for sizes.
19126 (read1): Use EMACS_INT, not int, for sizes.
19127 Check for size overflow.
19129 * image.c (cache_image): Check for size arithmetic overflow.
19131 * lread.c: Integer overflow issues.
19132 (saved_doc_string_size, saved_doc_string_length)
19133 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19134 Now ptrdiff_t, not int.
19135 (read1): Don't assume doc string length fits in int. Check for
19136 out-of-range doc string lengths.
19137 (read_list): Don't assume file position fits in int.
19138 (read_escape): Check for hex character overflow.
19140 2011-06-22 Leo Liu <sdl.web@gmail.com>
19142 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19143 Move to minibuffer.el.
19145 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19147 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19148 The following patches are for when GLYPH_DEBUG && !XASSERT.
19149 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19150 * dispnew.c (flush_stdout):
19151 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19152 Mark as externally visible.
19153 * dispnew.c (check_window_matrix_pointers): Now static.
19154 * dispnew.c (window_to_frame_vpos):
19155 * xfns.c (unwind_create_frame):
19156 * xterm.c (x_check_font): Remove unused local.
19157 * scroll.c (CHECK_BOUNDS):
19158 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19159 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19160 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19161 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19162 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19164 (debug_method_add): Use va_list and vsprintf rather than relying
19165 on undefined behavior with wrong number of arguments.
19166 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19167 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19168 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19169 since we're not interested in debugging glyphs with old libraries.
19170 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19171 GCC 4.6.0's static checking.
19173 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19175 Integer overflow and signedness fixes (Bug#8873).
19176 A few related buffer overrun fixes, too.
19178 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19180 * dispextern.h (struct face.stipple):
19181 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19182 (x_bitmap_mask, x_allocate_bitmap_record)
19183 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19184 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19185 (x_create_bitmap_from_xpm_data):
19186 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19187 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19189 * xfaces.c (load_pixmap):
19190 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19191 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19192 (.bitmaps_last, struct x_output.icon_bitmap):
19193 Use ptrdiff_t, not int, for bitmap indexes.
19194 (x_allocate_bitmap_record): Check for size overflow.
19195 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19197 Use ptrdiff_t, not int, for overlay counts.
19198 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19199 * editfns.c (overlays_around, get_pos_property):
19200 * textprop.c (get_char_property_and_overlay):
19201 * xdisp.c (next_overlay_change, note_mouse_highlight):
19202 * xfaces.c (face_at_buffer_position):
19203 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19204 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19205 (Fnext_overlay_change, Fprevious_overlay_change)
19206 (mouse_face_overlay_overlaps, Foverlays_in):
19207 Use ptrdiff_t, not int, for sizes.
19208 (overlays_at, overlays_in): Check for size-calculation overflow.
19210 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19212 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19213 (x_session_initialize): Do not assume string length fits in int.
19215 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19216 This is unlikely, but can occur if DPI is outlandish.
19218 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19219 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19221 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19222 * xrdb.c (magic_file_p, search_magic_path):
19223 Omit last arg SUFFIX; it was always 0. All callers changed.
19224 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19226 * xfont.c (xfont_match): Avoid need for strlen.
19228 * xfns.c: Don't assume strlen fits in int.
19229 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19231 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19232 not unsigned long, as we prefer signed integers. All callers changed.
19233 Detect integer overflow in repeat count.
19234 (message_dolog): Don't assume print length fits in 39 bytes.
19235 (display_mode_element): Don't assume strlen fits in int.
19237 * termcap.c: Don't assume sizes fit in int and never overflow.
19238 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19239 (gobble_line): Check for size-calculation overflow.
19241 * minibuf.c (Fread_buffer):
19242 * lread.c (intern, intern_c_string):
19243 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19244 Don't assume string length fits in int.
19246 * keyboard.c (parse_tool_bar_item):
19247 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19249 * font.c: Don't assume string length fits in int.
19250 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19251 Use ptrdiff_t, not int.
19252 (font_intern_prop): Don't assume string length fits in int.
19253 Don't assume integer property fits in fixnum.
19254 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19256 * filelock.c: Fix some buffer overrun and integer overflow issues.
19257 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19258 Reformulate so as not to need the command string.
19259 Invoke gzip -cd rather than gunzip, as it's more portable.
19260 (lock_info_type, lock_file_1, lock_file):
19261 Don't assume pid_t and time_t fit in unsigned long.
19262 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19263 (current_lock_owner): Prefer signed type for sizes.
19264 Use memcpy, not strncpy, where memcpy is what is really wanted.
19265 Don't assume (via atoi) that time_t and pid_t fit in int.
19266 Check for time_t and/or pid_t out of range, e.g., via a network share.
19267 Don't alloca where an auto var works fine.
19269 * fileio.c: Fix some integer overflow issues.
19270 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19271 Don't assume string length fits in int.
19272 (directory_file_name): Don't assume string length fits in long.
19273 (make_temp_name): Don't assume pid fits in int, or that its print
19274 length is less than 20.
19276 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19278 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19280 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19282 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19283 We prefer signed integers, even for size calculations.
19285 * emacs.c: Don't assume string length fits in 'int'.
19286 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19287 (main): Don't invoke strlen when not needed.
19289 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19290 (XD_DEBUG_MESSAGE): Don't waste a byte.
19292 * callproc.c (getenv_internal_1, getenv_internal)
19293 (Fgetenv_internal):
19294 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19296 * lread.c (invalid_syntax): Omit length argument.
19297 All uses changed. This doesn't fix a bug, but it simplifies the
19298 code away from its former Hollerith-constant appearance, and it's
19299 one less 'int' to worry about when looking at integer-overflow issues.
19300 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19302 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19303 This didn't break anything, but it didn't help either.
19304 It's confusing to put a bogus integer in a place where the actual
19305 value does not matter.
19306 (LIST_END_P): Remove unused macro and its bogus comment.
19307 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19309 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19310 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19312 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19313 We prefer signed types, and the value cannot exceed the EMACS_INT
19314 range anyway (because otherwise the length would not be representable).
19315 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19316 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19317 This avoids a GCC warning when WIDE_EMACS_INT.
19319 * indent.c (sane_tab_width): New function.
19320 (current_column, scan_for_column, Findent_to, position_indentation)
19321 (compute_motion): Use it. This is just for clarity.
19322 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19324 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19326 * lisp.h (lint_assume): New macro.
19327 * composite.c (composition_gstring_put_cache):
19328 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19330 * editfns.c, insdel.c:
19331 Omit unnecessary forward decls, to simplify future changes.
19333 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19335 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19337 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19338 Use much-faster test for byte-length change.
19339 Don't assume string byte-length fits in 'int'.
19340 Check that character arg fits in 'int'.
19341 (mapcar1): Declare byte as byte, for clarity.
19343 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19345 * fns.c (concat): Catch string overflow earlier.
19346 Do not rely on integer wraparound.
19348 * dispextern.h (struct it.overlay_strings_charpos)
19349 (struct it.selective): Now EMACS_INT, not int.
19350 * xdisp.c (forward_to_next_line_start)
19351 (back_to_previous_visible_line_start)
19352 (reseat_at_next_visible_line_start, next_element_from_buffer):
19353 Don't arbitrarily truncate the value of 'selective' to int.
19355 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19357 * composite.c: Don't truncate sizes to 'int'.
19358 (composition_gstring_p, composition_reseat_it)
19359 (composition_adjust_point): Use EMACS_INT, not int.
19360 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19361 not EMACS_UINT, for indexes.
19363 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19365 * buffer.c: Include <verify.h>.
19366 (struct sortvec.priority, struct sortstr.priority):
19367 Now EMACS_INT, not int.
19368 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19369 (struct sortstr.size, record_overlay_string)
19370 (struct sortstrlist.size, struct sortlist.used):
19371 Don't truncate size to int.
19372 (record_overlay_string): Check for size-calculation overflow.
19373 (init_buffer_once): Check at compile-time, not run-time.
19375 2011-06-22 Jim Meyering <meyering@redhat.com>
19377 Don't leak an XBM-image-sized buffer
19378 * image.c (xbm_load): Free the image buffer after using it.
19380 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19383 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19384 that Sun C diagnosed.
19385 * fns.c (secure_hash): Fix pointer signedness issue.
19386 * intervals.c (static_offset_intervals): New function.
19387 (offset_intervals): Use it.
19389 2011-06-21 Leo Liu <sdl.web@gmail.com>
19392 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19395 * fns.c (secure_hash): Rename from crypto_hash_function and change
19396 the first arg to accept symbols.
19397 (Fsecure_hash): New primitive.
19398 (syms_of_fns): New symbols.
19400 2011-06-20 Deniz Dogan <deniz@dogan.se>
19402 * process.c (Fset_process_buffer): Clarify return value in
19405 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19407 * dispnew.c (add_window_display_history): Use BVAR.
19409 * xdisp.c (debug_method_add): Use BVAR.
19410 (check_window_end, dump_glyph_matrix, dump_glyph)
19411 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19413 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19416 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19417 check till after the cache is created in init_frame_faces.
19419 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19421 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19423 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19425 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19426 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19427 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19429 Improve buffer-overflow checking (Bug#8873).
19430 * fileio.c (Finsert_file_contents):
19431 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19432 Remove the old (too-loose) buffer overflow checks.
19433 They weren't needed, since make_gap checks for buffer overflow.
19434 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19435 The old code merely checked for Emacs fixnum overflow, and relied
19436 on undefined (wraparound) behavior. The new code avoids undefined
19437 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19439 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19440 Tune. Don't use wider integers than needed. Don't use alloca.
19441 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19443 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19445 * insdel.c, lisp.h (buffer_overflow): New function.
19446 (insert_from_buffer_1, replace_range, replace_range_2):
19447 * insdel.c (make_gap_larger):
19448 * editfns.c (Finsert_char):
19449 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19451 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19453 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19455 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19457 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19458 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19460 * fileio.c: Don't assume EMACS_INT fits in off_t.
19461 (emacs_lseek): New static function.
19462 (Finsert_file_contents, Fwrite_region): Use it.
19463 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19465 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19467 * fns.c: Don't overflow int when computing a list length.
19468 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19469 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19470 truncation on 64-bit hosts. Check for QUIT every
19471 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19472 faster and is responsive enough.
19473 (Flength): Report an error instead of overflowing an integer.
19474 (Fsafe_length): Return a float if the value is not representable
19475 as a fixnum. This shouldn't happen except in contrived situations.
19476 (Fnthcdr, Fsort): Don't assume list length fits in int.
19477 (Fcopy_sequence): Don't assume vector length fits in int.
19479 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19480 (header_size, word_size): New constants.
19481 (allocate_vectorlike): Don't check size overflow here.
19482 (allocate_vector): Check it here instead, since this is the only
19483 caller of allocate_vectorlike that could cause overflow.
19484 Check that the new vector's length is representable as a fixnum.
19486 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19487 The previous code was bogus. For example, next_almost_prime (32)
19488 returned 39, which is undesirable as it is a multiple of 3; and
19489 next_almost_prime (24) returned 25, which is a multiple of 5 so
19490 why was the code bothering to check for multiples of 7?
19492 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19494 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19496 Variadic C functions now count arguments with ptrdiff_t.
19497 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19498 Back then I didn't know that the Emacs coding style prefers signed int.
19499 Also, in the meantime I found a few more instances where arguments
19500 were being counted with int, which may truncate counts on 64-bit
19501 machines, or EMACS_INT, which may be unnecessarily wide.
19502 * lisp.h (struct Lisp_Subr.function.aMANY)
19503 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19504 Arg counts are now ptrdiff_t, not size_t.
19505 All variadic functions and their callers changed accordingly.
19506 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19507 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19508 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19509 * callint.c (Fcall_interactively): Check arg count for overflow,
19510 to avoid potential buffer overrun. Use signed char, not 'int',
19511 for 'varies' array, so that we needn't bother to check its size
19512 calculation for overflow.
19513 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19514 * eval.c (apply_lambda):
19515 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19516 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19517 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19519 * callint.c (Fcall_interactively): Don't use index var as event count.
19521 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19522 * mem-limits.h (SIZE): Remove; no longer used.
19524 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19526 Remove unnecessary casts.
19527 * xterm.c (x_term_init):
19528 * xfns.c (x_set_border_pixel):
19529 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19530 These aren't needed now that we assume ANSI C.
19532 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19533 It's more likely to cause problems (due to unsigned overflow)
19536 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19538 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19540 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19542 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19544 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19546 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19548 GLYPH_CODE_FACE returns EMACS_INT, not int.
19549 * dispextern.h (merge_faces):
19550 * xfaces.c (merge_faces):
19551 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19552 Don't assume EMACS_INT fits in int.
19554 * character.h (CHAR_VALID_P): Remove unused parameter.
19555 * fontset.c, lisp.h, xdisp.c: All uses changed.
19557 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19559 * fns.c (concat): Minor tuning based on overflow analysis.
19560 This doesn't fix any bugs. Use int to hold character, instead
19561 of constantly refetching from Emacs object. Use XFASTINT, not
19562 XINT, for value known to be a character. Don't bother comparing
19563 a single byte to 0400, as it's always less.
19565 * floatfns.c (Fexpt):
19566 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19568 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19571 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19573 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19574 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19575 incorrectly succeed when S was a string, because 4294967386 was
19576 truncated before it was used.
19578 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19579 Otherwise, an out-of-range integer could cause undefined behavior
19582 * composite.c: Use int, not EMACS_INT, for characters.
19583 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19584 EMACS_INT, for values that are known to be in character range.
19585 This doesn't fix any bugs but is the usual style inside Emacs and
19586 may generate better code on 32-bit machines.
19588 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19589 This is for reasons similar to the recent CHAR_STRING fix.
19590 * charset.c (Fencode_char): Check that character arg is actually
19591 a character. Pass an int to ENCODE_CHAR.
19592 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19593 wider than 'int', as a compile-time check to prevent future regressions
19596 * character.c (char_string): Remove unnecessary casts.
19598 Make sure a 64-bit char is never passed to CHAR_STRING.
19599 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19600 by silently ignoring the top 32 bits, allowing some values
19601 that were far too large to be valid characters.
19602 * character.h: Include <verify.h>.
19603 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19604 arguments are no wider than unsigned, as a compile-time check
19605 to prevent future regressions in this area.
19607 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19608 (Fsubst_char_in_region):
19610 * xdisp.c (decode_mode_spec_coding):
19611 Adjust to CHAR_STRING's new requirement.
19612 * editfns.c (Finsert_char, Fsubst_char_in_region):
19613 * fns.c (concat): Check that character args are actually
19614 characters. Without this test, these functions did the wrong
19615 thing with wildly out-of-range values on 64-bit hosts.
19617 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19618 These casts should not be needed on 32-bit hosts, either.
19619 * keyboard.c (read_char):
19620 * lread.c (Fload): Remove casts to unsigned.
19622 * lisp.h (UNSIGNED_CMP): New macro.
19623 This fixes comparison bugs on 64-bit hosts.
19624 (ASCII_CHAR_P): Use it.
19625 * casefiddle.c (casify_object):
19626 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19627 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19628 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19629 * dispextern.h (FACE_FROM_ID):
19630 * keyboard.c (read_char): Use UNSIGNED_CMP.
19632 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19633 not to EMACS_INT, to avoid GCC warning.
19635 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19637 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19638 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19639 isn't needed on 32-bit machines.
19641 * buffer.c (Fgenerate_new_buffer_name):
19642 Use EMACS_INT for count, not int.
19643 (advance_to_char_boundary): Return EMACS_INT, not int.
19645 * data.c (Qcompiled_function): Now static.
19647 * window.c (window_body_lines): Now static.
19649 * image.c (gif_load): Rename local to avoid shadowing.
19651 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19652 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19653 * alloc.c (make_save_value): Integer argument is now of type
19654 ptrdiff_t, not int.
19655 (mark_object): Use ptrdiff_t, not int.
19656 * lisp.h (pD): New macro.
19657 * print.c (print_object): Use it.
19659 * alloc.c: Use EMACS_INT, not int, to count objects.
19660 (total_conses, total_markers, total_symbols, total_vector_size)
19661 (total_free_conses, total_free_markers, total_free_symbols)
19662 (total_free_floats, total_floats, total_free_intervals)
19663 (total_intervals, total_strings, total_free_strings):
19664 Now EMACS_INT, not int. All uses changed.
19665 (Fgarbage_collect): Compute overall total using a double, so that
19666 integer overflow is less likely to be a problem. Check for overflow
19667 when converting back to an integer.
19668 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19669 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19670 These were 'int' variables that could overflow on 64-bit hosts;
19671 they were never used, so remove them instead of repairing them.
19672 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19673 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19674 Previously, this ceilinged at INT_MAX, but that doesn't work on
19676 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19678 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19679 (allocate_vectorlike): Check for ptrdiff_t overflow.
19680 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19681 when a (possibly-narrower) signed value would do just as well.
19682 We prefer using signed arithmetic, to avoid comparison confusion.
19684 * alloc.c: Catch some string size overflows that we were missing.
19685 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19686 for convenience in STRING_BYTES_MAX.
19687 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19688 The definition here is exact; the one in lisp.h was approximate.
19689 (allocate_string_data): Check for string overflow. This catches
19690 some instances we weren't catching before. Also, it catches
19691 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19692 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19693 and ptrdiff_t and EMACS_INT are both 64 bits.
19695 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19696 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19697 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19699 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19701 * alloc.c (Fmake_string): Check for out-of-range init.
19703 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19705 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19707 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19709 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19710 xg_get_default_scrollbar_width.
19712 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19713 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19714 (style_changed_cb): Call update_theme_scrollbar_width and call
19715 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19716 all frames (Bug#8505).
19717 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19718 Call gtk_window_set_resizable if HAVE_GTK3.
19719 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19720 and height if HAVE_GTK3 (Bug#8505).
19721 (scroll_bar_width_for_theme): New variable.
19722 (update_theme_scrollbar_width): New function.
19723 (xg_get_default_scrollbar_width): Move code to
19724 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19725 (xg_initialize): Call update_theme_scrollbar_width.
19727 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19729 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19731 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19733 * frame.c (make_frame): Call other_buffer_safely instead of
19736 * window.c (temp_output_buffer_show): Call display_buffer with
19737 second argument Vtemp_buffer_show_specifiers and reset latter
19738 immediately after the call.
19739 (Vtemp_buffer_show_specifiers): New variable.
19740 (auto_window_vscroll_p, next_screen_context_lines)
19741 (Vscroll_preserve_screen_position): Remove leading asterisks from
19744 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19746 Fix minor problems found by GCC 4.6.0 static checking.
19747 * buffer.c (Qclone_number): Remove for now, as it's unused.
19748 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19749 (record_buffer): Remove unused local.
19750 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19751 (set_frame_buffer_list): Remove; unused.
19752 * frame.h (other_visible_frames): Remove decl.
19753 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19754 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19755 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19757 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19758 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19759 Define only if HAVE_GPM.
19760 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19761 (update_hints_inhibit): Remove; never set. All uses removed.
19762 * widgetprv.h (emacsFrameClassRec): Remove decl.
19763 * window.c (delete_deletable_window): Now returns void, since it
19764 wasn't returning anything.
19765 (compare_window_configurations): Remove unused locals.
19766 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19767 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19768 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19769 the same widths as pointers. This follows up on the 2011-05-06 patch.
19770 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19771 * xterm.h: Likewise.
19772 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19774 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19776 * makefile.w32-in: Update dependencies.
19777 (LISP_H): Add lib/intprops.h.
19779 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19781 * image.c (gif_load): Add animation frame delay to the metadata.
19782 (syms_of_image): Use DEFSYM. New symbol `delay'.
19784 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19786 * window.c (delete_deletable_window): Re-add.
19787 (Fset_window_configuration): Rewrite to handle dead buffers and
19788 consequently deletable windows.
19789 (window_tree, Fwindow_tree): Remove. Supply functionality in
19791 (compare_window_configurations): Simplify code.
19793 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19795 * image.c (imagemagick_load_image): Fix type mismatch.
19796 (Fimagemagick_types): Likewise.
19798 * window.h (replace_buffer_in_windows): Declare.
19800 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19802 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19803 Qclone_number. Remove external declaration of Qdelete_window.
19804 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19806 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19807 Run Qbuffer_list_update_hook if allowed.
19808 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19809 buffer list implementation.
19810 (other_buffer_safely): New function.
19811 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19812 calls to replace_buffer_in_windows and
19813 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19815 (record_buffer): Inhibit quitting and rewrite using quittable
19816 functions. Run Qbuffer_list_update_hook if allowed.
19817 (Frecord_buffer, Funrecord_buffer): New functions.
19818 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19819 Move switch-to-buffer to window.el.
19820 (bury-buffer): Move to window.el.
19821 (Vbuffer_list_update_hook): New variable.
19823 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19826 * window.h (resize_frame_windows): Move up in code.
19827 (Fwindow_frame): Remove EXFUN.
19828 (replace_buffer_in_all_windows): Remove prototype.
19829 (replace_buffer_in_windows_safely): Add prototype.
19831 * window.c: Declare Qdelete_window static again. Move down
19832 declaration of select_count.
19833 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19834 (Fother_window): Move to window.el.
19835 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19836 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19837 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19839 (replace_buffer_in_windows): Implement by calling
19840 Qreplace_buffer_in_windows.
19841 (replace_buffer_in_all_windows): Remove with some functionality
19842 moved into replace_buffer_in_windows_safely.
19843 (replace_buffer_in_windows_safely): New function.
19844 (select_window_norecord, select_frame_norecord): Move in front
19845 of run_window_configuration_change_hook. Remove now obsolete
19847 (Fset_window_buffer): Rewrite doc-string.
19848 Call Qrecord_window_buffer.
19849 (keys_of_window): Move binding for other-window to window.el.
19851 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19853 * dispextern.h (struct image): Replace data member, whose int_val
19854 and ptr_val fields were not used by anything, with a single
19857 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19858 (gif_clear_image, gif_load, imagemagick_load_image)
19859 (gs_clear_image, gs_load): Callers changed.
19861 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19863 * buffer.h: Include <time.h>, for time_t.
19864 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19866 Fix minor problems found by static checking.
19868 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19870 Make identifiers static if they are not used in other modules.
19871 * data.c (Qcompiled_function, Qframe, Qvector):
19872 * image.c (QimageMagick, Qsvg):
19873 * minibuf.c (Qmetadata):
19874 * window.c (resize_window_check, resize_root_window): Now static.
19875 * window.h (resize_window_check, resize_root_window): Remove decls.
19877 * window.c (window_deletion_count, delete_deletable_window):
19879 (window_body_lines): Now static.
19880 (Fdelete_other_windows_internal): Mark vars as initialized.
19881 Make sure 'resize_failed' is initialized.
19882 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19883 (resize_window_apply): Remove unused local.
19884 * window.h (delete_deletable_window): Remove decl.
19886 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19887 (imagemagick_load_image): Fix pointer signedness problem by changing
19888 last arg from unsigned char * to char *. All uses changed.
19889 Also, fix a local for similar reasons.
19890 Remove unused locals. Remove locals to avoid shadowing.
19891 (fn_rsvg_handle_free): Remove; unused.
19892 (svg_load, svg_load_image): Fix pointer signedness problem.
19893 (imagemagick_load_image): Don't use garbage pointer image_wand.
19895 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19897 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19899 * image.c (gif_load): Fix omitted cast error introduced by
19902 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19904 * window.h (resize_proportionally, orig_total_lines)
19905 (orig_top_line): Remove from window structure.
19906 (set_window_height, set_window_width, change_window_heights)
19907 (Fdelete_window): Remove prototypes.
19908 (resize_frame_windows): Remove duplicate declaration.
19910 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19912 * window.h (resize_frame_windows, resize_window_check)
19913 (delete_deletable_window, resize_root_window)
19914 (resize_frame_windows): Declare prototypes.
19916 * window.c (resize_window_apply): Make definition be "static" to
19917 match the prototype.
19919 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19921 * window.c: Remove declarations of Qwindow_size_fixed,
19922 window_min_size_1, window_min_size_2, window_min_size,
19923 size_window, window_fixed_size_p, enlarge_window, delete_window.
19924 Remove static from declaration of Qdelete_window, it's
19925 temporarily needed by Fbury_buffer.
19926 (replace_window): Don't assign orig_top_line and
19928 (Fdelete_window, delete_window): Remove. Window deletion is
19929 handled by window.el.
19930 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19931 Replace Fdelete_window calls with calls to Qdelete_window.
19932 (Fdelete_other_windows): Remove. Deleting other windows is
19933 handled by window.el.
19934 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19935 handled in window.el.
19936 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19937 Window minimum sizes are handled in window.el.
19938 (shrink_windows, size_window, set_window_height)
19939 (set_window_width, change_window_heights, window_height)
19940 (window_width, CURBEG, CURSIZE, enlarge_window)
19941 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19942 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19943 handled in window.el.
19944 (make_dummy_parent): Rename to make_parent_window and give it a
19945 second argument horflag.
19946 (make_window): Don't set resize_proportionally any more.
19947 (Fsplit_window): Remove. Windows are split in window.el.
19948 (save_restore_action, save_restore_orig_size)
19949 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19950 Resize mini windows in window.el.
19951 (grow_mini_window, shrink_mini_window): Implement by calling
19952 Qresize_root_window_vertically, resize_window_check and
19953 resize_window_apply.
19954 (saved_window, Fset_window_configuration, save_window_save):
19955 Do not handle orig_top_line, orig_total_lines, and
19956 resize_proportionally.
19957 (window_min_height, window_min_width): Move to window.el.
19958 (keys_of_window): Move bindings for delete-other-windows,
19959 split-window, delete-window and enlarge-window to window.el.
19961 * buffer.c: Temporarily extern Qdelete_window.
19962 (Fbury_buffer): Temporarily call Qdelete_window instead of
19963 Fdelete_window (Fbury_buffer will move to window.el soon).
19965 * frame.c (set_menu_bar_lines_1): Remove code handling
19966 orig_top_line and orig_total_lines.
19968 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19969 set_window_height but set heights directly.
19970 (change_frame_size_1): Use resize_frame_windows.
19972 * xdisp.c (init_xdisp): Don't use set_window_height but set
19975 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19976 Use resize_frame_windows instead of change_window_heights and run
19977 run_window_configuration_change_hook.
19979 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19980 instead of change_window_heights and run
19981 run_window_configuration_change_hook.
19983 2011-06-09 Martin Rudalics <rudalics@gmx.at>
19985 * window.c (replace_window): Rename second argument REPLACEMENT to
19986 NEW. New third argument SETFLAG. Rewrite.
19987 (delete_window, make_dummy_parent): Call replace_window with
19989 (window_list_1): Move down in code.
19990 (run_window_configuration_change_hook): Move set_buffer part
19991 before select_frame_norecord part in order to unwind correctly.
19992 Rename count1 to count.
19993 (recombine_windows, delete_deletable_window, resize_root_window)
19994 (Fdelete_other_windows_internal)
19995 (Frun_window_configuration_change_hook, make_parent_window)
19996 (resize_window_check, resize_window_apply, Fresize_window_apply)
19997 (resize_frame_windows, Fsplit_window_internal)
19998 (Fdelete_window_internal, Fresize_mini_window_internal):
20000 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20002 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20004 * window.h (window): Add some new members to window structure -
20005 normal_lines, normal_cols, new_total, new_normal, clone_number,
20006 splits, nest, prev_buffers, next_buffers.
20007 (WINDOW_TOTAL_SIZE): Move here from window.c.
20008 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20010 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20012 (make_dummy_parent): Set new members of windows structure.
20013 (make_window): Move down in code. Handle new members of window
20015 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20016 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20017 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20018 (Fset_window_prev_buffers, Fwindow_next_buffers)
20019 (Fset_window_next_buffers, Fset_window_clone_number):
20021 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20022 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20024 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20025 Argument WINDOW can be now internal window too.
20026 (Fwindow_use_time): Move up in code.
20027 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20028 Rewrite doc-string.
20029 (Fset_window_configuration, saved_window)
20030 (Fcurrent_window_configuration, save_window_save): Handle new
20031 members of window structure.
20032 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20033 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20034 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20035 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20036 Qget_mru_window, Qresize_root_window,
20037 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20038 Qauto_buffer_name; staticpro them.
20040 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20042 * window.c (Fwindow_total_size, Fwindow_left_column)
20043 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20044 (Fwindow_list_1): New functions.
20045 (window_box_text_cols): Replace with window_body_cols.
20046 (Fwindow_width, Fscroll_left, Fscroll_right):
20047 Use window_body_cols instead of window_box_text_cols.
20048 (delete_window, Fset_window_configuration):
20049 Call delete_all_subwindows with window as argument.
20050 (delete_all_subwindows): Take a window as argument and not a
20051 structure. Rewrite.
20052 (window_loop): Remove handling of GET_LRU_WINDOW and
20053 GET_LARGEST_WINDOW.
20054 (Fget_lru_window, Fget_largest_window): Move to window.el.
20056 * window.h: Extern window_body_cols instead of
20057 window_box_text_cols. delete_all_subwindows now takes a
20058 Lisp_Object as argument.
20060 * indent.c (compute_motion, Fcompute_motion):
20061 Use window_body_cols instead of window_box_text_cols.
20063 * frame.c (delete_frame): Call delete_all_subwindows with root
20064 window as argument.
20066 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20068 * fns.c (Fputhash): Document return value.
20070 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20072 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20074 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20076 Cons<->int and similar integer overflow fixes (Bug#8794).
20078 Check for overflow when converting integer to cons and back.
20079 * charset.c (Fdefine_charset_internal, Fdecode_char):
20080 Use cons_to_unsigned to catch overflow.
20081 (Fencode_char): Use INTEGER_TO_CONS.
20082 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20083 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20084 * data.c (long_to_cons, cons_to_long): Remove.
20085 (cons_to_unsigned, cons_to_signed): New functions.
20086 These signal an error for invalid or out-of-range values.
20087 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20088 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20089 * font.c (Ffont_variation_glyphs):
20090 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20091 * lisp.h: Include <intprops.h>.
20092 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20093 (cons_to_signed, cons_to_unsigned): New decls.
20094 (long_to_cons, cons_to_long): Remove decls.
20095 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20096 (Fprimitive_undo): Use CONS_TO_INTEGER.
20097 * xfns.c (Fx_window_property): Likewise.
20098 * xselect.c: Include <limits.h>.
20099 (x_own_selection, selection_data_to_lisp_data):
20100 Use INTEGER_TO_CONS.
20101 (x_handle_selection_request, x_handle_selection_clear)
20102 (x_get_foreign_selection, Fx_disown_selection_internal)
20103 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20104 (lisp_data_to_selection_data): Use cons_to_unsigned.
20105 (x_fill_property_data): Use cons_to_signed.
20106 Report values out of range.
20108 Check for buffer and string overflow more precisely.
20109 * buffer.h (BUF_BYTES_MAX): New macro.
20110 * lisp.h (STRING_BYTES_MAX): New macro.
20111 * alloc.c (Fmake_string):
20112 * character.c (string_escape_byte8):
20113 * coding.c (coding_alloc_by_realloc):
20114 * doprnt.c (doprnt):
20115 * editfns.c (Fformat):
20117 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20118 since they may not be the same number.
20119 * editfns.c (Finsert_char):
20120 * fileio.c (Finsert_file_contents):
20121 Likewise for BUF_BYTES_MAX.
20123 * image.c: Use ptrdiff_t, not int, for sizes.
20124 (slurp_file): Switch from int to ptrdiff_t.
20126 (slurp_file): Check that file size fits in both size_t (for
20127 malloc) and ptrdiff_t (for sanity and safety).
20129 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20130 if b->modtime has its maximal value.
20132 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20134 Don't assume time_t can fit into int.
20135 * buffer.h (struct buffer.modtime): Now time_t, not int.
20136 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20137 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20139 Minor fixes for signed vs unsigned integers.
20140 * character.h (MAYBE_UNIFY_CHAR):
20141 * charset.c (maybe_unify_char):
20142 * keyboard.c (read_char, reorder_modifiers):
20143 XINT -> XFASTINT, since the integer must be nonnegative.
20144 * ftfont.c (ftfont_spec_pattern):
20145 * keymap.c (access_keymap, silly_event_symbol_error):
20146 XUINT -> XFASTINT, since the integer must be nonnegative.
20147 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20148 since it makes no difference and we prefer signed.
20149 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20150 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20153 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20155 * window.h (Fwindow_frame): Declare.
20157 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20159 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20160 (SPARE_MEMORY): Always define.
20161 (LARGE_REQUEST): Remove.
20162 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20164 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20166 * lisp.h: Move EXFUNS for Fframe_root_window,
20167 Fframe_first_window and Fset_frame_selected_window to window.h.
20169 * window.h: Move EXFUNS for Fframe_root_window,
20170 Fframe_first_window and Fset_frame_selected_window here from
20173 * frame.c (Fwindow_frame, Fframe_first_window)
20174 (Fframe_root_window, Fframe_selected_window)
20175 (Fset_frame_selected_window): Move to window.c.
20176 (Factive_minibuffer_window): Move to minibuf.c.
20177 (Fother_visible_frames_p): New function.
20179 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20181 * window.c (decode_window, decode_any_window): Move up in code.
20182 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20183 (inhibit_frame_unsplittable): Remove unused variable.
20184 (Fwindow_buffer): Move up and rewrite doc-string.
20185 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20186 (Fwindow_prev): New functions.
20187 (Fwindow_frame): Move here from frame.c. Accept any window as
20189 (Fframe_root_window, Fframe_first_window)
20190 (Fframe_selected_window): Move here from frame.c. Accept frame
20191 or arbitrary window as argument. Update doc-strings.
20192 (Fminibuffer_window): Move up in code.
20193 (Fwindow_minibuffer_p): Move up in code and simplify.
20194 (Fset_frame_selected_window): Move here from frame.c.
20196 (Fselected_window, select_window, Fselect_window): Move up in
20197 code. Minor doc-string fixes.
20199 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20201 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20202 Do not assume that spare memory exists; that assumption is valid
20203 only if SYSTEM_MALLOC.
20204 (LARGE_REQUEST): New macro, so that the issue of large requests
20205 is separated from the issue of spare memory.
20207 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20209 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20212 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20214 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20217 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20219 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20221 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20223 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20224 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20226 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20228 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20230 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20232 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20233 (x_clipboard_manager_save): Add return value.
20234 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20235 New error handlers.
20236 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20237 Obey Vx_select_enable_clipboard_manager. Catch errors in
20238 x_clipboard_manager_save (Bug#8779).
20239 (Vx_select_enable_clipboard_manager): New variable.
20240 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20242 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20244 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20246 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20248 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20249 in the current matrix if keep_current_p is non-zero.
20251 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20253 * bidi.c (bidi_level_of_next_char): Fix last change.
20255 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20257 Support bidi reordering of text covered by display properties.
20259 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20260 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20261 (bidi_cache_search, bidi_cache_iterator_state)
20262 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20263 (bidi_level_of_next_char, bidi_move_to_visually_next):
20264 Support character positions inside a run of characters covered by a
20266 (bidi_paragraph_init, bidi_resolve_explicit_1)
20267 (bidi_level_of_next_char): Call bidi_fetch_char and
20268 bidi_fetch_char_advance instead of FETCH_CHAR and
20269 FETCH_CHAR_ADVANCE.
20270 (bidi_init_it): Initialize new members.
20271 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20273 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20274 instead of using explicit *_CHAR codes.
20275 (bidi_resolve_explicit, bidi_resolve_weak):
20276 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20277 bidirectional text is supported only in multibyte buffers.
20278 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20279 it to initialize the frame_window_p member of struct bidi_it.
20280 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20281 (bidi_resolve_explicit, bidi_resolve_weak)
20282 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20283 bidi_it->nchars is non-positive.
20284 (bidi_level_of_next_char): Don't try to lookup the cache for the
20285 next/previous character if nothing is cached there yet, or if we
20286 were just reseat()'ed to a new position.
20288 * xdisp.c (set_cursor_from_row): Set start and stop points
20289 according to the row's direction when priming the loop that looks
20290 for the glyph on which to display cursor.
20291 (single_display_spec_intangible_p): Function deleted.
20292 (display_prop_intangible_p): Reimplement to call
20293 handle_display_spec instead of single_display_spec_intangible_p.
20294 Accept 3 additional arguments needed by handle_display_spec.
20295 This fixes incorrect cursor motion across display property with complex
20296 values: lists, `(when COND...)' forms, etc.
20297 (single_display_spec_string_p): Support property values that are
20298 lists with the argument STRING its top-level element.
20299 (display_prop_string_p): Fix the condition for processing a
20300 property that is a list to be consistent with handle_display_spec.
20301 (handle_display_spec): New function, refactored from the
20302 last portion of handle_display_prop.
20303 (compute_display_string_pos): Accept additional argument
20304 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20305 value of a `display' property is a "replacing spec".
20306 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20307 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20308 the display property, but just return a value indicating whether
20309 the display property will replace the characters it covers.
20310 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20311 frame_window_p members of struct bidi_it.
20312 (compute_display_string_pos, compute_display_string_end):
20314 (push_it): Accept second argument POSITION, where pop_it should
20315 jump to continue iteration.
20316 (reseat_1): Initialize bidi_it.disp_pos.
20318 * keyboard.c (adjust_point_for_property): Adjust the call to
20319 display_prop_intangible_p to its new signature.
20321 * dispextern.h (struct bidi_it): New member frame_window_p.
20322 (bidi_init_it): Update prototypes.
20323 (display_prop_intangible_p): Update prototype.
20324 (compute_display_string_pos, compute_display_string_end):
20325 Declare prototypes.
20326 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20329 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20331 Malloc failure behavior now depends on size of allocation.
20332 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20333 * lisp.h: Change signatures accordingly.
20334 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20335 All callers changed. (Bug#8762)
20337 * gnutls.c: Use Emacs's memory allocators.
20338 Without this change, the gnutls library would invoke malloc etc.
20339 directly, which causes problems on non-SYNC_INPUT hosts, and which
20340 runs afoul of improving memory_full behavior. (Bug#8761)
20341 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20342 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20343 xfree instead of the default malloc, realloc, free.
20344 (Fgnutls_boot): No need to check for memory allocation failure,
20345 since xmalloc does that for us.
20347 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20348 * category.c (hash_get_category_set):
20349 * ccl.c (ccl_driver):
20350 * charset.c (Fdefine_charset_internal):
20351 * charset.h (struct charset.hash_index):
20352 * composite.c (get_composition_id, gstring_lookup_cache)
20353 (composition_gstring_put_cache):
20354 * composite.h (struct composition.hash_index):
20355 * dispextern.h (struct image.hash):
20356 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20357 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20358 (hashfn_equal, hashfn_user_defined, make_hash_table)
20359 (maybe_resize_hash_table, hash_lookup, hash_put)
20360 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20361 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20362 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20363 * image.c (make_image, search_image_cache, lookup_image)
20364 (xpm_put_color_table_h):
20365 * lisp.h (struct Lisp_Hash_Table):
20366 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20367 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20368 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20369 * alloc.c (allocate_vectorlike):
20370 Check for overflow in vector size calculations.
20371 * ccl.c (ccl_driver):
20372 Check for overflow when converting EMACS_INT to int.
20373 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20374 need to be updated by these changes.
20375 * fns.c (make_hash_table, maybe_resize_hash_table):
20376 Check for integer overflow with large hash tables.
20377 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20378 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20379 (SXHASH_REDUCE): New macro.
20380 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20381 Use it instead of discarding useful hash info with large hash values.
20382 (sxhash_float): New function.
20383 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20384 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20385 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20386 Rewrite to use FIXNUM_BITS, as this simplifies things.
20387 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20388 Adjust signatures to match updated version of code.
20389 (consing_since_gc): Now EMACS_INT, since a single hash table can
20390 use more than INT_MAX bytes.
20392 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20394 Make it possible to build with GCC-4.6+ -O2 -flto.
20396 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20398 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20400 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20401 Call minibuffer-inactive-mode.
20403 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20405 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20406 Update dependencies.
20408 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20410 * data.c (init_data): Remove code for UTS, this system is not
20413 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20415 Don't force ./temacs to start in terminal mode.
20417 * frame.c (make_initial_frame): Initialize faces in all cases, not
20418 only when CANNOT_DUMP is defined.
20419 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20421 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20423 * dispnew.c (add_window_display_history): Use const for the string
20424 pointer. Remove declaration, not needed.
20426 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20428 Use 'inline', not 'INLINE'.
20429 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20430 * alloc.c, fontset.c (INLINE): Remove.
20431 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20432 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20433 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20434 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20435 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20437 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20439 Make it possible to run ./temacs.
20441 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20442 syms_of_callproc does the same thing. Remove test for
20443 "initialized", do it in the caller.
20444 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20446 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20448 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20449 (read_minibuf): Use get_minibuffer.
20450 (syms_of_minibuf): Use DEFSYM.
20451 (Qmetadata): New var.
20452 * data.c (Qbuffer): Don't make it static.
20453 (syms_of_data): Use DEFSYM.
20455 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20457 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20458 (CCL_CODE_MIN): New macro.
20460 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20462 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20464 * eval.c (Qdebug): Now static.
20465 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20466 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20467 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20469 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20471 * image.c: Various fixes to ImageMagick code comments.
20472 (Fimagemagick_types): Doc fix.
20474 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20476 Minor fixes prompted by GCC 4.6.0 warnings.
20478 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20480 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20481 (x_clipboard_manager_save_all): Move extern decl to ...
20482 * xterm.h: ... here, so that it can be checked for consistency.
20484 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20486 * xselect.c (x_clipboard_manager_save_frame)
20487 (x_clipboard_manager_save_all): New functions.
20488 (Fx_clipboard_manager_save): Lisp function deleted.
20490 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20491 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20493 * xterm.h: Update prototype.
20495 2011-05-28 William Xu <william.xwl@gmail.com>
20497 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20498 exiting (Bug#8239).
20500 2011-05-28 Jim Meyering <meyering@redhat.com>
20502 Avoid a sign-extension bug in crypto_hash_function.
20503 * fns.c (to_uchar): Define.
20504 (crypto_hash_function): Use it to convert some newly-signed
20505 variables to unsigned, to avoid sign-extension bugs. For example,
20506 without this change, (md5 "truc") would evaluate to
20507 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20508 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20509 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20511 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20513 Integer overflow fixes.
20515 * dbusbind.c: Serial number integer overflow fixes.
20516 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20517 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20518 to hold a serial number that is too large for a fixnum.
20519 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20520 Check for serial numbers out of range. Decode any serial number
20521 that was so large that it became a float. (Bug#8722)
20523 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20524 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20525 Use XFASTINT rather than XUINT when numbers are nonnegative.
20526 (xd_append_arg, Fdbus_method_return_internal):
20527 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20528 arguments, check that Lisp number is nonnegative, rather than
20529 silently wrapping negative numbers around. (Bug#8722)
20530 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20533 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20535 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20537 ccl: Add integer overflow checks.
20538 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20539 (IN_INT_RANGE): New macros.
20540 (ccl_driver): Use them to check for integer overflow when
20541 decoding a CCL program. Many of the new checks are whether XINT (x)
20542 fits in int; it doesn't always, on 64-bit hosts. The new version
20543 doesn't catch all possible integer overflows, but it's an
20544 improvement. (Bug#8719)
20546 * alloc.c (make_event_array): Use XINT, not XUINT.
20547 There's no need for unsigned here.
20549 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20550 This follows up to the 2011-05-06 change that substituted uintptr_t
20551 for EMACS_INT. This case wasn't caught back then.
20553 Rework Fformat to avoid integer overflow issues.
20554 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20555 now (part of C89). Include <verify.h>.
20556 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20557 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20558 (Fformat): Avoid the prepass trying to compute sizes; it was only
20559 approximate and thus did not catch overflow reliably. Instead, walk
20560 through the format just once, formatting and computing sizes as we go,
20561 checking for integer overflow at every step, and allocating a larger
20562 buffer as needed. Keep track separately whether the format is
20563 multibyte. Keep only the most-recently calculated precision, rather
20564 than them all. Record whether each argument has been converted to
20565 string. Use EMACS_INT, not int, for byte and char and arg counts.
20566 Support field widths and precisions larger than INT_MAX. Avoid
20567 sprintf's undefined behavior with conversion specifications such as %#d
20568 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20569 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20570 formatting out-of-range floating point numbers with int
20571 formats. (Bug#8668)
20573 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20575 * data.c: Avoid integer truncation in expressions involving floats.
20576 * data.c: Include <intprops.h>.
20577 (arith_driver): When there's an integer overflow in an expression
20578 involving floating point, convert the integers to floating point
20579 so that the resulting value does not suffer from catastrophic
20580 integer truncation. For example, on a 64-bit host (* 4
20581 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20582 Do not rely on undefined behavior after integer overflow.
20584 merge count_size_as_multibyte, parse_str_to_multibyte
20585 * character.c, character.h (count_size_as_multibyte):
20586 Rename from parse_str_to_multibyte; all uses changed.
20587 Check for integer overflow.
20588 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20589 since it's now a duplicate of the other. This is more of
20590 a character than a buffer op, so better that it's in character.c.
20591 * fns.c, print.c: Adjust to above changes.
20593 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20595 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20597 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20599 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20600 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20601 (x_clipboard_manager_save): Now static.
20602 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20604 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20605 (crypto_hash_function): Now static.
20606 Fix pointer signedness problems. Avoid unnecessary initializations.
20608 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20610 * termhooks.h (Vselection_alist): Make it terminal-local.
20612 * terminal.c (create_terminal): Initialize it.
20614 * xselect.c: Support for clipboard managers.
20615 (Vselection_alist): Move to termhooks.h as terminal-local var.
20616 (LOCAL_SELECTION): New macro.
20617 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20618 (symbol_to_x_atom): Remove gratuitous arg.
20619 (x_handle_selection_request, lisp_data_to_selection_data)
20620 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20621 (x_own_selection, x_get_local_selection, x_convert_selection):
20622 New arg, specifying work frame. Use terminal-local Vselection_alist.
20623 (some_frame_on_display): Delete unused function.
20624 (Fx_own_selection_internal, Fx_get_selection_internal)
20625 (Fx_disown_selection_internal, Fx_selection_owner_p)
20626 (Fx_selection_exists_p): New optional frame arg.
20627 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20628 (x_handle_selection_clear): Don't treat other terminals with the
20629 same keyboard specially. Use the terminal-local Vselection_alist.
20630 (x_clear_frame_selections): Use Frun_hook_with_args.
20632 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20634 * xterm.h: Add support for those atoms.
20636 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20638 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20639 (converted_selections, conversion_fail_tag): New global variables.
20640 (x_selection_request_lisp_error): Free the above.
20641 (x_get_local_selection): Remove unnecessary code.
20642 (x_reply_selection_request): Args changed; handle arbitrary array
20643 of converted selections stored in converted_selections.
20644 Separate the XChangeProperty and SelectionNotify steps.
20645 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20646 (x_convert_selection): New function.
20647 (x_handle_selection_event): Simplify.
20648 (x_get_foreign_selection): Don't ignore incoming requests while
20649 waiting for an answer; this will fail when we implement
20650 SAVE_TARGETS, and seems unnecessary anyway.
20651 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20652 (Vx_sent_selection_functions): Doc fix.
20654 2011-05-26 Leo Liu <sdl.web@gmail.com>
20656 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20658 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20660 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20662 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20663 for fringe update if it has periodic bitmap.
20664 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20665 and fringe_bitmap_periodic_p.
20667 * fringe.c (get_fringe_bitmap_data): New function.
20668 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20669 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20670 row. Mark glyph row for fringe update if periodicity changed.
20672 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20673 for fringe update unless it has periodic bitmap.
20675 2011-05-25 Kenichi Handa <handa@m17n.org>
20677 * xdisp.c (get_next_display_element): Set correct it->face_id for
20678 a static composition.
20680 2011-05-24 Leo Liu <sdl.web@gmail.com>
20683 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20685 * fns.c (crypto_hash_function, Fsha1): New function.
20686 (Fmd5): Use crypto_hash_function.
20687 (syms_of_fns): Add Ssha1.
20689 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20691 * gnutls.c: Remove unused macros.
20692 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20693 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20694 Remove macros that are defined and never used.
20695 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20697 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20699 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20700 (Fx_get_selection_internal): Minor cleanup.
20701 (Fx_own_selection_internal): Rename arguments for consistency with
20704 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20706 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20708 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20710 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20712 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20714 * dispnew.c (scrolling_window): Don't exclude the case that the
20715 last enabled row in the desired matrix touches the bottom boundary.
20717 2011-05-21 Glenn Morris <rgm@gnu.org>
20719 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20720 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20721 and add some more files.
20723 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20725 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20726 report_file_error introduced by the change from 2011-05-07.
20728 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20730 * systime.h (Time): Define only if emacs is defined.
20731 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20732 where the include path doesn't have X11/X.h by default. See
20733 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20735 2011-05-20 Kenichi Handa <handa@m17n.org>
20737 * composite.c (find_automatic_composition): Fix previous change.
20739 2011-05-20 Glenn Morris <rgm@gnu.org>
20741 * lisp.mk: New file, split from Makefile.in.
20742 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20743 (shortlisp): Remove.
20744 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20746 2011-05-19 Glenn Morris <rgm@gnu.org>
20748 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20749 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20750 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20751 (lisp): Set the order to that of loadup.el.
20752 (shortlisp): Make it a copy of $lisp.
20753 (SOME_MACHINE_LISP): Remove.
20754 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20755 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20757 2011-05-18 Kenichi Handa <handa@m17n.org>
20759 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20760 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20761 (find_automatic_composition): Mostly rewrite for efficiency.
20763 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20765 * makefile.w32-in: Update dependencies.
20767 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20769 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20770 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20772 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20774 Fix some integer overflow issues, such as string length overflow.
20776 * insdel.c (count_size_as_multibyte): Check for string overflow.
20778 * character.c (lisp_string_width): Check for string overflow.
20779 Use EMACS_INT, not int, for string indexes and lengths; in
20780 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20781 the resulting string length overflows an EMACS_INT; instead,
20782 report a string overflow if no precision given. When checking for
20783 precision exhaustion, use a check that cannot possibly have
20784 integer overflow. (Bug#8675)
20785 * character.h (lisp_string_width): Adjust to new signature.
20787 * alloc.c (string_overflow): New function.
20788 (Fmake_string): Use it. This doesn't change behavior, but saves
20789 a few bytes and will simplify future changes.
20790 * character.c (string_escape_byte8): Likewise.
20791 * lisp.h (string_overflow): New decl.
20793 Fixups, following up to the user-interface timestamp change.
20794 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20795 for UI timestamps, instead of unsigned long.
20796 * msdos.c (mouse_get_pos): Likewise.
20797 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20798 * w32gui.h (Time): Define by including "systime.h" rather than by
20799 declaring it ourselves. (Bug#8664)
20801 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20802 * image.c (clear_image_cache): Likewise.
20804 * term.c (term_mouse_position): Don't assume time_t wraparound.
20806 Be more systematic about user-interface timestamps.
20807 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20808 and sometimes 'EMACS_UINT', to represent these timestamps.
20809 This change causes it to use 'Time' uniformly, as that's what X uses.
20810 This makes the code easier to follow, and makes it easier to catch
20811 integer overflow bugs such as Bug#8664.
20812 * frame.c (Fmouse_position, Fmouse_pixel_position):
20813 Use Time, not unsigned long, for user-interface timestamps.
20814 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20815 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20816 * keyboard.h (last_event_timestamp): Likewise.
20817 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20818 * menu.h (xmenu_show): Likewise.
20819 * term.c (term_mouse_position): Likewise.
20820 * termhooks.h (struct input_event.timestamp): Likewise.
20821 (struct terminal.mouse_position_hook): Likewise.
20822 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20823 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20824 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20825 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20826 what it was before.
20827 * menu.h, termhooks.h: Include "systime.h", for Time.
20829 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20830 Don't assume that the difference between two unsigned long values
20831 can fit into an integer. At this point, we know button_down_time
20832 <= event->timestamp, so the difference must be nonnegative, so
20833 there's no need to cast the result if double-click-time is
20834 nonnegative, as it should be; check that it's nonnegative, just in
20835 case. This bug is triggered when events are more than 2**31 ms
20836 apart (about 25 days). (Bug#8664)
20838 * xselect.c (last_event_timestamp): Remove duplicate decl.
20839 (x_own_selection): Remove needless cast to unsigned long.
20841 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20842 that always fit in int. Use a sentinel instead of a counter, to
20843 avoid a temp and to allay GCC's concerns about possible int overflow.
20844 * frame.h (struct frame): Use int for menu_bar_items_used
20845 instead of EMACS_INT, since it always fits in int.
20847 * menu.c (grow_menu_items): Check for int overflow.
20849 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20851 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20852 Before, the code was not consistent. These values cannot exceed
20853 2**31 - 1 so there's no need to make them unsigned.
20854 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20855 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20856 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20858 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20860 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20861 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20862 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20863 presumably because the widths might not match.
20865 * window.c (size_window): Avoid needless test at loop start.
20867 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20869 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20871 2011-05-12 Drew Adams <drew.adams@oracle.com>
20873 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20875 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20877 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20878 `width' to `bar_area_x' and `bar_area_width', respectively.
20879 (x_scroll_run): Take account of fringe background extension.
20881 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20882 Rename local vars `left' and `width' to `bar_area_x' and
20883 `bar_area_width', respectively.
20884 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20885 background extension.
20887 2011-05-10 Jim Meyering <meyering@redhat.com>
20889 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20891 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20893 * image.c (Finit_image_library): Return t for built-in image types,
20894 like pbm and xbm. (Bug#8640)
20896 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20898 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20900 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20902 * w32console.c (Fset_screen_color): Doc fix.
20903 (Fget_screen_color): New function.
20904 (syms_of_ntterm): Defsubr it.
20906 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20907 unlink the temporary file if Fcall_process didn't create it in the
20909 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20910 child process will be redirected to a file specified with `:file'.
20911 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20912 cue to call_process_cleanup not to close that handle.
20914 2011-05-07 Ben Key <bkey76@gmail.com>
20916 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20917 one of two shell specific rules, either bootstrap-temacs-CMD or
20918 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20919 to the previous implementation of the bootstrap-temacs rule.
20920 The bootstrap-temacs-CMD rule is similar to the previous
20921 implementation of the bootstrap-temacs rule except that it
20922 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20925 These changes, along with some changes to nt/configure.bat,
20926 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20927 earlier fix to add support for --cflags and --ldflags options
20928 that include quotes so that it works whether make uses cmd or
20931 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20933 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20934 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20936 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20937 a string. Handle both cases.
20938 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20939 (Fdbus_register_method): Use Qinvalid_function.
20941 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20943 * makefile.w32-in: Update dependencies.
20944 (LISP_H): Add inttypes.h and stdin.h.
20945 (PROCESS_H): Add unistd.h.
20947 2011-05-06 Eli Zaretskii <eliz@gnu.org>
20949 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20950 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20952 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
20954 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20956 * term.c (vfatal): Remove stray call to va_end.
20957 It's not needed and the C Standard doesn't allow it here anyway.
20959 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20960 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20962 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20965 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20967 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20969 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20971 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20973 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20975 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20976 * charset.c (Fdefine_charset_internal): Don't initialize
20977 charset.code_space[15]. The value was garbage, on hosts with
20978 32-bit int (Bug#8600).
20980 * lread.c (read_integer): Be more consistent with string-to-number.
20981 Use string_to_number to do the actual conversion; this avoids
20982 rounding errors and fixes some other screwups. Without this fix,
20983 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20984 (digit_to_number): Move earlier, for benefit of read_integer.
20985 Return -1 if the digit is out of range for the base, -2 if it is
20986 not a digit in any supported base. (Bug#8602)
20988 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20990 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20991 to match comment at start of function. This also removes a
20992 GCC warning about overflow in a 32+64-bit port.
20994 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20996 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20997 Reported by Stefan Monnier in
20998 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20999 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21000 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21002 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21003 (EMACS_UINTPTR): Likewise, with uintptr_t.
21005 * lisp.h: Prefer 64-bit EMACS_INT if available.
21006 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21007 on 32-bit hosts that have 64-bit int, so that they can access
21009 However, temporarily disable this change unless the temporary
21010 symbol WIDE_EMACS_INT is defined.
21012 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21014 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21015 This removes an assumption that EMACS_INT and long are the same
21016 width as pointers. The assumption is true for Emacs porting targets
21017 now, but we want to make other targets possible.
21018 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21019 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21020 In the rest of the code, change types of integers that hold casted
21021 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21022 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21023 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21024 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21025 No need to cast type when ORing.
21026 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21027 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21028 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21029 assume EMACS_INT is the same width as char *.
21030 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21031 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21032 Remove no-longer-needed casts.
21033 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21034 (xg_tool_bar_help_callback, xg_make_tool_item):
21035 Use EMACS_INTPTR to hold an integer
21036 that will be cast to void *; this can avoid a GCC warning
21037 if EMACS_INT is not the same width as void *.
21038 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21039 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21040 (current_message_1, set_message_1):
21041 Use a local to convert to proper width without a cast.
21042 * xmenu.c (dialog_selection_callback): Likewise.
21044 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21045 Also, don't assume VALBITS / RAND_BITS is less than 5,
21046 and don't rely on undefined behavior when shifting a 1 left into
21048 * lisp.h (get_random): Change signature to match.
21050 * lread.c (hash_string): Use size_t, not int, for hash computation.
21051 Normally we prefer signed values; but hashing is special, because
21052 it's better to use unsigned division on hash table sizes so that
21053 the remainder is nonnegative. Also, size_t is the natural width
21054 for hashing into memory. The previous code used 'int', which doesn't
21055 retain enough info to hash well into very large tables.
21056 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21058 * dbusbind.c: Don't possibly lose pointer info when converting.
21059 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21060 Use XPNTR rather than XHASH, so that the high-order bits of
21061 the pointer aren't lost when converting through void *.
21063 * eval.c (Fautoload): Don't double-shift a pointer.
21065 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21067 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21069 * gnutls.c (DEF_GNUTLS_FN):
21070 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21072 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21074 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21077 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21079 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21080 New version that can reserve upto 2GB of heap space.
21082 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21084 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21086 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21088 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21089 `gnutls_certificate_set_x509_key_file'.
21091 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21093 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21094 Update dependencies.
21096 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21098 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21099 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21100 Remove unused parameter `fildes'.
21101 * process.c (read_process_output, send_process): Don't pass it.
21103 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21105 Fix previous change: the library cache is defined in w32.c.
21106 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21107 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21109 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21111 Implement dynamic loading of GnuTLS on Windows.
21113 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21114 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21115 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21118 * gnutls.c (Qgnutls_dll): Define.
21119 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21120 (gnutls_*): Declare function pointers.
21121 (init_gnutls_functions): New function to initialize function pointers.
21122 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21123 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21124 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21125 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21126 (emacs_gnutls_write, emacs_gnutls_read)
21127 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21128 (Fgnutls_available_p): New function.
21129 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21130 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21131 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21133 * image.c: Include w32.h.
21134 (Vimage_type_cache): Delete.
21135 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21136 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21137 (w32_delayed_load): Move to w32.c.
21139 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21141 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21142 (w32_delayed_load): Move from image.c. When loading a library, record
21143 its filename in the :loaded-from property of the library id.
21144 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21145 Initialize and staticpro them.
21146 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21148 * process.c: Include lisp.h before w32.h, not after.
21149 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21150 instead of gnutls_record_check_pending.
21152 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21154 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21156 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21157 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21160 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21162 * xterm.c (x_set_frame_alpha): Do not set property on anything
21163 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21165 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21167 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21169 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21171 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21172 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21173 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21174 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21175 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21176 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21177 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21178 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21179 (Qgnutls_bootprop_callbacks_verify): Make static.
21181 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21183 * callproc.c: Indentation fixup.
21185 * sysdep.c (wait_for_termination_1): Make static.
21186 (wait_for_termination, interruptible_wait_for_termination):
21187 Move after wait_for_termination_1.
21189 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21191 * sysdep.c (interruptible_wait_for_termination): New function
21192 which is like wait_for_termination, but allows keyboard
21195 * callproc.c (Fcall_process): Add (:file "file") as an option for
21197 (Fcall_process_region): Ditto.
21199 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21201 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21202 rather than `XVECTOR (FOO)->size'.
21204 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21205 inttypes.h, as a gnulib replacement is used if it not available in
21208 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21210 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21211 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21212 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21214 * coding.c (coding_alloc_by_realloc): Error out if destination
21215 will grow beyond MOST_POSITIVE_FIXNUM.
21216 (decode_coding_emacs_mule): Abort if there isn't enough place in
21217 charbuf for the composition carryover bytes. Reserve an extra
21218 space for up to 2 characters produced in a loop.
21219 (decode_coding_iso_2022): Abort if there isn't enough place in
21220 charbuf for the composition carryover bytes.
21222 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21224 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21225 aborting when %lld or %lll format is passed.
21226 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21227 %llo or %llx format is passed. (Bug#8545)
21229 * window.c (window_scroll_line_based): Use a marker instead of
21230 simple variables to record original value of point. (Bug#7952)
21232 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21233 produced by %s or %c overflows available buffer space. (Bug#8545)
21235 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21237 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21238 (SIZE_MAX): Move defn after all includes, as they might #define it.
21240 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21242 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21244 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21246 * keyboard.c (Qdelayed_warnings_hook): Define.
21247 (command_loop_1): Run `delayed-warnings-hook'
21248 if Vdelayed_warnings_list is non-nil.
21249 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21250 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21252 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21254 * doprnt.c (doprnt): Don't return value smaller than the buffer
21255 size if the message was truncated. (Bug#8545).
21257 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21259 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21260 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21262 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21264 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21266 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21268 * makefile.w32-in: Update dependencies.
21270 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21272 Improve `doprnt' and its usage. (Bug#8545)
21273 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21274 `format_end'. Remove support for %l as a conversion specifier.
21275 Don't use xrealloc. Improve diagnostics when the %l size modifier
21276 is used. Update the commentary.
21278 * eval.c (verror): Simplify calculation of size_t.
21280 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21283 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21285 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21288 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21290 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21291 This makes this file independent of the recent pseudovector change.
21293 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21295 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21297 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21298 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21299 Remove unused local.
21300 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21302 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21303 GCC 4.6.0 optimizes based on type-based alias analysis.
21304 For example, if b is of type struct buffer * and v of type struct
21305 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21306 != &v->size, and therefore "v->size = 1; b->size = 2; return
21307 v->size;" must therefore return 1. This assumption is incorrect
21308 for Emacs, since it type-puns struct Lisp_Vector * with many other
21309 types. To fix this problem, this patch adds a new type struct
21310 vectorlike_header that documents the constraints on layout of vectors
21311 and pseudovectors, and helps optimizing compilers not get fooled
21312 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21313 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21314 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21316 (XSETPVECTYPE): Rewrite in terms of new macro.
21317 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21318 This is a bit clearer, and further avoids the possibility of
21319 undesirable aliasing.
21320 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21321 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21322 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21323 since Lisp_Subr is a special case (no "next" field).
21324 (ASIZE): Now uses header.size rather than size.
21325 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21326 to avoid the hassle of writing XVECTOR (foo)->header.size.
21327 (struct vectorlike_header): New type.
21328 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21329 object, to help avoid aliasing.
21330 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21331 (SUBRP): Likewise, since Lisp_Subr is a special case.
21332 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21333 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21334 (struct Lisp_Hash_Table): Combine first two members into a single
21335 struct vectorlike_header member. All uses of "size" and "next" members
21336 changed to be "header.size" and "header.next".
21337 * buffer.h (struct buffer): Likewise.
21338 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21339 * frame.h (struct frame): Likewise.
21340 * process.h (struct Lisp_Process): Likewise.
21341 * termhooks.h (struct terminal): Likewise.
21342 * window.c (struct save_window_data, struct saved_window): Likewise.
21343 * window.h (struct window): Likewise.
21344 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21345 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21346 * buffer.c (init_buffer_once): Likewise.
21347 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21349 * process.c (Fformat_network_address): Use local var for size,
21352 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21354 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21355 * data.c (atof): Remove decl; no longer used or needed.
21356 (digit_to_number): Move to lread.c.
21357 (Fstring_to_number): Use new string_to_number function, to be
21358 consistent with how the Lisp reader treats infinities and NaNs.
21359 Do not assume that floating-point numbers represent EMACS_INT
21360 without losing information; this is not true on most 64-bit hosts.
21361 Avoid double-rounding errors, by insisting on integers when
21362 parsing non-base-10 numbers, as the documentation specifies.
21363 * lisp.h (string_to_number): New decl, replacing ...
21364 (isfloat_string): Remove.
21365 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21366 (read1): Do not accept +. and -. as integers; this
21367 appears to have been a coding error. Similarly, do not accept
21368 strings like +-1e0 as floating point numbers. Do not report
21369 overflow for integer overflows unless the base is not 10 which
21370 means we have no simple and reliable way to continue.
21371 Break out the floating-point parsing into a new
21372 function string_to_number, so that Fstring_to_number parses
21373 floating point numbers consistently with the Lisp reader.
21374 (digit_to_number): Move here from data.c. Make it static inline.
21375 (E_CHAR, EXP_INT): Remove, replacing with ...
21376 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21377 (string_to_number): New function, replacing isfloat_string.
21378 This function checks for valid syntax and produces the resulting
21379 Lisp float number too. Rework it so that string-to-number
21380 no longer mishandles examples like "1.0e+". Use strtoumax,
21381 so that overflow for non-base-10 numbers is reported only when
21382 there's no portable and simple way to convert to floating point.
21384 * textprop.c (set_text_properties_1): Rewrite for clarity,
21385 and to avoid GCC warning about integer overflow.
21387 * intervals.h (struct interval): Use EMACS_INT for members
21388 where EMACS_UINT might cause problems. See
21389 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21390 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21391 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21393 (offset_intervals): Tell GCC not to worry about length overflow
21394 when negating a negative length.
21396 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21397 (overrun_check_free): Likewise.
21399 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21400 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21403 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21404 (gnutls_make_error): Rename local to avoid shadowing.
21405 (gnutls_emacs_global_deinit): ifdef out; not used.
21406 (Fgnutls_boot): Use const for pointer to readonly storage.
21407 Comment out unused local. Fix pointer signedness problems.
21409 * lread.c (openp): Don't stuff size_t into an 'int'.
21410 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21411 about possible signed overflow.
21413 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21414 (GDK_KEY_g): Don't define if already defined.
21415 (xg_prepare_tooltip): Avoid pointer signedness problem.
21416 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21418 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21419 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21421 * xfns.c (Fx_window_property): Simplify a bit,
21422 to make a bit faster and to avoid GCC 4.6.0 warning.
21423 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21425 * fns.c (internal_equal): Don't assume size_t fits in int.
21427 * alloc.c (compact_small_strings): Tighten assertion a little.
21429 Replace pEd with more-general pI, and fix some printf arg casts.
21430 * lisp.h (pI): New macro, generalizing old pEd macro to other
21431 conversion specifiers. For example, use "...%"pI"d..." rather
21432 than "...%"pEd"...".
21433 (pEd): Remove. All uses replaced with similar uses of pI.
21434 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21435 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21436 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21437 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21438 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21439 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21440 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21442 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21443 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21444 * print.c (safe_debug_print, print_object): Likewise.
21445 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21447 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21448 avoiding the 0 flag, which is not portable.
21449 * process.c (Fmake_network_process): Use pI to avoid cast.
21450 * region-cache.c (pp_cache): Likewise.
21451 * xdisp.c (decode_mode_spec): Likewise.
21452 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21453 behavior on 64-bit hosts with printf arg.
21454 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21455 (x_stop_queuing_selection_requests): Likewise.
21456 (x_get_window_property): Don't truncate byte count to an 'int'
21459 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21460 here, since it parses constructs like leading '-' and spaces,
21461 which are not wanted; and it overflows with large numbers.
21462 Instead, simply match F[0-9]+, which is what is wanted anyway.
21464 * alloc.c: Remove unportable assumptions about struct layout.
21465 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21466 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21467 (allocate_vectorlike, make_pure_vector): Use the new macros,
21468 plus offsetof, to remove unportable assumptions about struct layout.
21469 These assumptions hold on all porting targets that I know of, but
21470 they are not guaranteed, they're easy to remove, and removing them
21471 makes further changes easier.
21473 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21474 This doesn't fix a bug but makes the code clearer.
21475 (string_overrun_cookie): Now const. Use initializers that
21476 don't formally overflow signed char, to avoid warnings.
21477 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21478 can cause Emacs to crash when string overrun checking is enabled.
21479 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21480 multiple of sizeof (EMACS_INT); it need not be, if
21481 alignof(EMACS_INT) < sizeof (EMACS_INT).
21482 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21484 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21486 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21488 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21490 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21491 supposed to be handshaking. (Bug#8556)
21492 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21494 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21496 * lisp.h (Qdebug): List symbol.
21497 * eval.c (Qdebug): Restore global linkage.
21498 * keyboard.c (debug-on-event): New variable.
21499 (handle_user_signal): Break into debugger when debug-on-event
21500 matches the current signal symbol.
21502 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21504 * alloc.c (check_sblock, check_string_bytes)
21505 (check_string_free_list): Convert to standard C.
21507 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21509 * w32.c (emacs_gnutls_push): Fix typo.
21511 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21513 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21514 "cast to pointer from integer of different size".
21516 Improve doprnt and its use in verror. (Bug#8545)
21517 * doprnt.c (doprnt): Document the set of format control sequences
21518 supported by the function. Use SAFE_ALLOCA instead of always
21521 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21522 is one byte too soon. Don't use xrealloc; instead xfree and
21525 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21527 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21530 * gnutls.c: Renamed global_initialized to
21531 gnutls_global_initialized. Added internals for the
21532 :verify-hostname-error, :verify-error, and :verify-flags
21533 parameters of `gnutls-boot' and documented those parameters in the
21534 docstring. Start callback support.
21535 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21536 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21537 on error. Return error code.
21538 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21539 (emacs_gnutls_read): Likewise.
21540 (Fgnutls_boot): Return handshake error code.
21541 (emacs_gnutls_handle_error): New function.
21542 (wsaerror_to_errno): Likewise.
21544 * w32.h (emacs_gnutls_pull): Add prototype.
21545 (emacs_gnutls_push): Likewise.
21547 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21548 (emacs_gnutls_push): Likewise.
21550 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21552 * process.c (wait_reading_process_output): Check if GnuTLS
21553 buffered some data internally if no FDs are set for TLS
21556 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21557 (LIBS): Link to USER_LIBS.
21558 ($(BLD)/gnutls.$(0)): New target.
21560 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21562 * xdisp.c (handle_single_display_spec): Rename the
21563 display_replaced_before_p argument into display_replaced_p, to
21564 make it consistent with the commentary. Fix typos in the
21567 * textprop.c (syms_of_textprop): Remove dead code.
21568 (copy_text_properties): Delete obsolete commentary about an
21569 interface that was deleted long ago. Fix typos in the description
21572 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21573 to changes in oldXMenu/XMenu.h from 2011-04-16.
21574 <menu_help_message, prev_menu_help_message>: Constify.
21575 (IT_menu_make_room): menu->help_text is now `const char **';
21578 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21579 to changes in oldXMenu/XMenu.h from 2011-04-16.
21580 (struct XMenu): Declare `help_text' `const char **'.
21582 * xfaces.c <Qunspecified>: Make extern again.
21584 * syntax.c: Include sys/types.h before including regex.h, as
21587 * doc.c (get_doc_string): Improve the format passed to `error'.
21589 * doprnt.c (doprnt): Improve commentary.
21591 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21593 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21596 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21597 changes in globals.h immediately force recompilation.
21598 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21599 $(CURDIR)/s/ms-w32.h.
21600 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21602 * character.c (Fchar_direction): Function deleted.
21603 (syms_of_character): Don't defsubr it.
21604 <char-direction-table>: Deleted.
21606 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21608 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21609 * doprnt.c: Include limits.h.
21610 (SIZE_MAX): New macro.
21611 (doprnt): Return a size_t value. 2nd arg is now size_t.
21612 Many local variables are now size_t instead of int or unsigned.
21613 Improve overflow protection. Support `l' modifier for integer
21614 conversions. Support %l conversion. Don't assume an EMACS_INT
21615 argument for integer conversions and for %c.
21617 * lisp.h (doprnt): Restore prototype.
21619 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21620 $(SRC)/character.h.
21622 * Makefile.in (base_obj): Add back doprnt.o.
21624 * deps.mk (doprnt.o): Add back prerequisites.
21625 (callint.o): Depend on character.h.
21627 * eval.c (internal_lisp_condition_case): Include the handler
21628 representation in the error message.
21629 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21630 when breaking from the loop.
21632 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21634 * callint.c (Fcall_interactively): When displaying error message
21635 about invalid control letter, pass the character's codepoint, not
21636 a pointer to its multibyte form. Improve display of the character
21637 in octal and display also its hex code.
21639 * character.c (char_string): Use %x to display the (unsigned)
21640 codepoint of an invalid character, to avoid displaying a bogus
21643 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21644 `error', not SYMBOL_NAME itself.
21646 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21647 character arguments to `error'.
21649 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21650 to `error' in error message about FINAL_CHAR argument. Make sure
21651 FINAL_CHAR is a character, and use %c when it is passed as
21652 argument to `error'.
21654 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21656 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21658 * w32.c: Include <time.h>.
21659 (sys_localtime): New function.
21661 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21663 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21665 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21667 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21669 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21670 zombies (Bug#8467).
21672 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21674 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21675 gl_state.e_property when gl_state.object is Qt.
21677 * insdel.c (make_gap_larger): Remove limitation of buffer size
21680 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21682 * xdisp.c (lookup_glyphless_char_display)
21683 (produce_glyphless_glyph): Handle cons cell entry in
21684 glyphless-char-display.
21685 (Vglyphless_char_display): Document it.
21687 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21688 glyphless-char-display.
21690 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21692 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21694 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21696 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21697 definition for no-X builds.
21699 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21701 Static checks with GCC 4.6.0 and non-default toolkits.
21703 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21705 * process.c (keyboard_bit_set): Define only if SIGIO.
21706 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21707 (send_process): Repair possible setjmp clobbering.
21709 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21711 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21713 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21715 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21716 Define only if needed.
21718 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21719 by pacifying GCC about it. Maybe it's time to retire it?
21720 * xfaces.c (USG, __TIMEVAL__): Likewise.
21722 * dispextern.h (struct redisplay_interface): Rename param
21723 to avoid shadowing.
21724 * termhooks.h (struct terminal): Likewise.
21725 * xterm.c (xembed_send_message): Likewise.
21727 * insdel.c (make_gap_smaller): Define only if
21728 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21730 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21733 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21734 so that we aren't warned about unused symbols.
21736 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21738 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21740 * xfns.c (x_real_positions): Mark locals as initialized.
21742 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21744 * xterm.c: Fix problems found by static analysis with other toolkits.
21745 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21746 (x_dispatch_event): Declare static if USE_GTK, and
21747 define if USE_GTK || USE_X_TOOLKIT.
21748 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21749 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21750 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21751 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21753 * xmenu.c (menu_help_callback): Pointer type fixes.
21754 Use const pointers when pointing at readonly data. Avoid pointer
21755 signedness clashes.
21756 (FALSE): Remove unused macro.
21757 (update_frame_menubar): Remove unused decl.
21759 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21761 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21762 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21763 (single_menu_item): Rename local to avoid shadowing.
21765 * keyboard.c (make_lispy_event): Remove unused local var.
21767 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21768 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21770 * bitmaps: Change bitmaps from unsigned char back to the X11
21771 compatible char. Avoid the old compiler warnings about
21772 out-of-range initializers by using, for example, '\xab' rather
21775 * xgselect.c (xgselect_initialize): Check vs interface
21776 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21778 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21780 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21781 to read-only memory.
21783 * fns.c (vector): Remove; this old hack is no longer needed.
21785 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21787 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21789 * xrdb.c (x_load_resources): Omit unused local.
21791 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21792 (x_window): Rename locals to avoid shadowing.
21793 (USG): Use the kludged USG macro, to pacify gcc.
21795 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21796 (x_term_init): Remove local to avoid shadowing.
21798 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21800 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21801 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21803 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21805 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21807 Fix regex.c, syntax.c and friends for buffers > 2GB.
21808 * syntax.h (struct gl_state_s): Declare character position members
21811 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21813 * textprop.c (verify_interval_modification, interval_of):
21814 Declare arguments EMACS_INT.
21816 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21819 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21821 * indent.c (Fvertical_motion): Local variable it_start is now
21824 * regex.c (re_match, re_match_2, re_match_2_internal)
21825 (bcmp_translate, regcomp, regexec, print_double_string)
21826 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21827 (re_compile_pattern, re_exec): Declare arguments and local
21828 variables `size_t' and `ssize_t' and return values `regoff_t', as
21830 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21831 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21832 <compile_stack_type>: `size' and `avail' are now `size_t'.
21834 * regex.h <regoff_t>: Use ssize_t, not int.
21835 (re_search, re_search_2, re_match, re_match_2): Arguments that
21836 specify buffer/string position and length are now ssize_t and
21837 size_t. Return type is regoff_t.
21839 2011-04-16 Ben Key <bkey76@gmail.com>
21841 * nsfont.m: Fixed bugs in ns_get_family and
21842 ns_descriptor_to_entity that were caused by using free to
21843 deallocate memory blocks that were allocated by xmalloc (via
21844 xstrdup). This caused Emacs to crash when compiled with
21845 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21846 --enable-checking=xmallocoverrun). xfree is now used to
21847 deallocate these memory blocks.
21849 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21851 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21853 emacs_write: Accept and return EMACS_INT for sizes.
21854 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21856 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21857 Accept and return EMACS_INT.
21858 (emacs_gnutls_write): Return the number of bytes written on
21860 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21861 (emacs_read, emacs_write): Remove check for negative size, as the
21862 Emacs source code has been audited now.
21863 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21864 (emacs_read, emacs_write): Use it.
21865 * process.c (send_process): Adjust to the new signatures of
21866 emacs_write and emacs_gnutls_write. Do not attempt to store
21867 a byte offset into an 'int'; it might overflow.
21868 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21870 * sound.c: Don't assume sizes fit in 'int'.
21871 (struct sound_device.period_size, alsa_period_size):
21872 Return EMACS_INT, not int.
21873 (struct sound_device.write, vox_write, alsa_write):
21874 Accept EMACS_INT, not int.
21875 (wav_play, au_play): Use EMACS_INT to store sizes and to
21876 record read return values.
21878 2011-04-15 Ben Key <bkey76@gmail.com>
21880 * keyboard.c (Qundefined): Don't declare static since it is used
21882 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21883 static since they are used in nsfont.m.
21885 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21887 * process.c (Qprocessp): Don't declare static.
21888 * lisp.h (Qprocessp): Declare again.
21890 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21892 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21894 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21896 Improve C-level modularity by making more things 'static'.
21898 Don't publish debugger-only interfaces to other modules.
21899 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21900 (verify_bytepos, count_markers): Move decls to the only modules
21902 * region-cache.h (pp_cache): Likewise.
21903 * window.h (check_all_windows): Likewise.
21904 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21906 * sysdep.c (croak): Now static, if
21907 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21908 * syssignal.h (croak): Declare only if not static.
21910 * alloc.c (refill_memory_reserve): Now static if
21911 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21912 * lisp.h (refill_memory_reserve): Declare only if not static.
21914 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21915 Define only if USE_LUCID.
21917 * xrdb.c (x_customization_string, x_rm_string): Now static.
21919 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21920 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21922 * xdisp.c (draw_row_with_mouse_face): Now static.
21923 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21925 * window.h (check_all_windows): Mark externally visible.
21927 * window.c (window_deletion_count): Now static.
21929 * undo.c: Make symbols static if they're not exported.
21930 (last_undo_buffer, last_boundary_position, pending_boundary):
21933 * textprop.c (interval_insert_behind_hooks): Now static.
21934 (interval_insert_in_front_hooks): Likewise.
21936 * term.c: Make symbols static if they're not exported.
21937 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21938 (max_frame_lines, tty_set_terminal_modes):
21939 (tty_reset_terminal_modes, tty_turn_off_highlight):
21940 (get_tty_terminal): Now static.
21941 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21942 * termhooks.h (term_mouse_moveto): Do not declare if
21943 HAVE_WINDOW_SYSTEM.
21944 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21945 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21947 * sysdep.c: Make symbols static if they're not exported.
21948 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21950 (sigprocmask_set, full_mask): Remove; unused.
21951 (wait_debugging): Mark as visible.
21952 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21953 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21955 * syntax.c (syntax_temp): Define only if !__GNUC__.
21957 * sound.c (current_sound_device, current_sound): Now static.
21959 * search.c (searchbufs, searchbuf_head): Now static.
21961 * scroll.c (scroll_cost): Remove; unused.
21962 * dispextern.h (scroll_cost): Remove decl.
21964 * region-cache.h (pp_cache): Mark as externally visible.
21966 * process.c: Make symbols static if they're not exported.
21967 (process_tick, update_tick, create_process, chan_process):
21968 (Vprocess_alist, proc_buffered_char, datagram_access):
21969 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21970 (deactivate_process): Mark defn as static, as well as decl.
21971 * lisp.h (create_process): Remove decl.
21972 * process.h (chan_process, Vprocess_alist): Remove decls.
21974 * print.c: Make symbols static if they're not exported.
21975 (print_depth, new_backquote_output, being_printed, print_buffer):
21976 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21977 (print_interval, print_number_index, initial_stderr_stream):
21979 * lisp.h (Fprinc): Remove decl.
21980 (debug_output_compilation_hack): Mark as externally visible.
21982 * sysdep.c (croak): Move decl from here to syssignal.h.
21983 * syssignal.h (croak): Put it here, so the API can be checked when
21984 'croak' is called from dissociate_if_controlling_tty.
21986 * minibuf.c: Make symbols static if they're not exported.
21987 (minibuf_save_list, choose_minibuf_frame): Now static.
21988 * lisp.h (choose_minibuf_frame): Remove decl.
21990 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21992 * lread.c: Make symbols static if they're not exported.
21993 (read_objects, initial_obarray, oblookup_last_bucket_number):
21995 (make_symbol): Remove; unused.
21996 * lisp.h (initial_obarray, make_symbol): Remove decls.
21998 * keyboard.c: Make symbols static if they're not exported.
21999 (single_kboard, recent_keys_index, total_keys, recent_keys):
22000 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22001 (this_single_command_key_start, echoing, last_auto_save):
22002 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22003 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22004 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22005 (Vlispy_mouse_stem, double_click_count):
22007 (force_auto_save_soon): Define only if SIGDANGER.
22008 (ignore_mouse_drag_p): Now static if
22009 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22010 (print_help): Remove; unused.
22011 (stop_character, last_timer_event): Mark as externally visible.
22012 * keyboard.h (ignore_mouse_drag_p): Declare only if
22013 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22014 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22015 * lisp.h (echoing): Remove decl.
22016 (force_auto_save_soon): Declare only if SIGDANGER.
22017 * xdisp.c (redisplay_window): Simplify code, to make it more
22018 obvious that ignore_mouse_drag_p is not accessed if !defined
22019 USE_GTK && !defined HAVE_NS.
22021 * intervals.c: Make symbols static if they're not exported.
22022 (merge_properties_sticky, merge_interval_right, delete_interval):
22024 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22026 * insdel.c: Make symbols static if they're not exported.
22027 However, leave prepare_to_modify_buffer alone. It's never
22028 called from outside this function, but that appears to be a bug.
22029 (combine_after_change_list, combine_after_change_buffer):
22030 (adjust_after_replace, signal_before_change): Now static.
22031 (adjust_after_replace_noundo): Remove; unused.
22032 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22033 (signal_before_change): Remove decls.
22035 * indent.c (val_compute_motion, val_vmotion): Now static.
22037 * image.c: Make symbols static if they're not exported.
22038 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22040 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22041 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22043 * fringe.c (standard_bitmaps): Now static.
22044 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22046 * frame.c: Make symbols static if they're not exported.
22047 (x_report_frame_params, make_terminal_frame): Now static.
22048 (get_frame_param): Now static, unless HAVE_NS.
22049 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22050 (x_get_resource_string): Remove; not used.
22051 * frame.h (make_terminal_frame, x_report_frame_params):
22052 (x_get_resource_string); Remove decls.
22053 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22054 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22056 * font.c, fontset.c: Make symbols static if they're not exported.
22057 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22058 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22059 * font.c (font_close_object): Now static.
22060 * font.h (font_close_object): Remove.
22061 * fontset.c (FONTSET_OBJLIST): Remove.
22062 (free_realized_fontset) #if-0 the body, which does nothing.
22063 (face_suitable_for_char_p): #if-0, as it's never called.
22064 * fontset.h (face_suitable_for_char_p): Remove decl.
22065 * xfaces.c (face_at_string_position):
22066 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22067 since 0 is always ASCII.
22069 * fns.c (weak_hash_tables): Now static.
22071 * fileio.c: Make symbols static if they're not exported.
22072 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22073 (Vwrite_region_annotation_buffers): Now static.
22075 * eval.c: Make symbols static if they're not exported.
22076 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22077 * lisp.h (backtrace_list): Remove decl.
22079 * emacs.c: Make symbols static if they're not exported.
22080 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22081 (fatal_error_code, fatal_error_signal_hook, standard_args):
22083 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22084 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22085 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22086 * lisp.h (fatal_error_signal_hook): Remove decl.
22087 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22089 * editfns.c: Move a (normally-unused) function to its only use.
22090 * editfns.c, lisp.h (get_operating_system_release): Remove.
22091 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22092 worth the hassle of breaking this out.
22094 * xterm.c: Make symbols static if they're not exported.
22095 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22096 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22097 (x_destroy_window, x_delete_display):
22099 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22100 (x_mouse_leave): Remove; unused.
22101 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22102 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22103 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22105 (x_mouse_leave): Declare only if WINDOWSNT.
22106 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22107 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22110 * ftxfont.c: Make symbols static if they're not exported.
22111 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22113 * font.h (ftxfont_driver): Likewise.
22115 * xfns.c: Make symbols static if they're not exported.
22116 (x_last_font_name, x_display_info_for_name):
22117 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22118 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22119 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22120 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22121 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22122 (last_show_tip_args): Now static.
22123 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22124 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22125 (x_screen_planes): Remove; unused.
22126 * dispextern.h (x_screen_planes): Remove decl.
22128 * dispnew.c: Make symbols static if they're not exported.
22129 * dispextern.h (redraw_garbaged_frames, scrolling):
22130 (increment_row_positions): Remove.
22131 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22132 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22134 (redraw_garbaged_frames): Remove; unused.
22136 * xfaces.c: Make symbols static if they're not exported.
22137 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22139 * xterm.h (defined_color): Remove decls.
22140 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22141 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22142 (menu_face_changed_default, defined_color, free_realized_face):
22143 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22144 (ascii_face_of_lisp_face): Remove; unused.
22146 * xdisp.c: Make symbols static if they're not exported.
22147 * dispextern.h (scratch_glyph_row, window_box_edges):
22148 (glyph_to_pixel_coords, set_cursor_from_row):
22149 (get_next_display_element, set_iterator_to_next):
22150 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22151 (show_mouse_face): Remove decls
22152 * frame.h (message_buf_print): Likewise.
22153 * lisp.h (pop_message, set_message, check_point_in_composition):
22155 * xterm.h (set_vertical_scroll_bar): Likewise.
22156 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22157 (message_buf_print, scratch_glyph_row, displayed_buffer):
22158 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22159 (get_next_display_element, show_mouse_face, window_box_edges):
22160 (frame_to_window_pixel_xy, check_point_in_composition):
22161 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22162 (glyph_to_pixel_coords): Remove; unused.
22164 * dired.c (file_name_completion): Now static.
22166 * dbusbind.c (xd_in_read_queued_messages): Now static.
22168 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22169 * data.c (circular_list_error): Remove.
22171 * commands.h (last_point_position, last_point_position_buffer):
22172 (last_point_position_window): Remove decls.
22173 * keyboard.c: Make these variables static.
22175 * coding.h (coding, code_convert_region, encode_coding_gap):
22177 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22178 (iso_code_class, detect_coding, code_convert_region): Now static.
22179 (encode_coding_gap): Remove; unused.
22181 * chartab.c (chartab_chars, chartab_bits): Now static.
22183 * charset.h (charset_iso_8859_1): Remove decl.
22184 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22187 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22188 * ccl.c (Vccl_program_table): Now static.
22189 (check_ccl_update): Remove; unused.
22191 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22192 * category.h: ... from here.
22193 * category.c (check_category_table, set_category_set): Now static.
22195 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22196 * lisp.h: Remove these decls.
22198 * buffer.c (buffer_count): Remove unused var.
22200 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22201 so that it's not optimized away.
22202 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22203 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22204 exported only to the debugger.
22206 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22207 * atimer.h (run_all_atimers): Remove; not exported.
22209 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22210 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22211 was inaccessible from Lisp.
22212 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22213 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22215 alloc.c: Import and export fewer symbols, and remove unused items.
22216 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22218 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22219 it's not optimized away by whole-program optimization.
22220 (message_enable_multibyte, free_misc): Remove.
22221 (catchlist, handlerlist, mark_backtrace):
22222 Declare only if BYTE_MARK_STACK.
22223 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22224 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22225 (message_enable_multibyte): Remove decl.
22226 (free_misc, interval_free_list, float_block, float_block_index):
22227 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22228 (cons_free_list, last_marked_index):
22230 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22231 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22232 (mark_backtrace): Define only if BYTE_MARK_STACK.
22233 * xdisp.c (message_enable_multibyte): Now static.
22235 Declare Lisp_Object Q* variables to be 'static' if not exported.
22236 This makes it easier for human readers (and static analyzers)
22237 to see whether these variables are used from other modules.
22238 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22239 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22240 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22241 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22242 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22243 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22244 * xmenu.c, xselect.c:
22245 Declare Q* vars static if they are not used in other modules.
22246 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22247 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22248 Remove decls of unexported vars.
22249 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22251 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22253 Make Emacs functions such as Fatom 'static' by default.
22254 This makes it easier for human readers (and static analyzers)
22255 to see whether these functions can be called from other modules.
22256 DEFUN now defines a static function. To make the function external
22257 so that it can be used in other C modules, use the new macro DEFUE.
22258 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22259 (Finit_image_library):
22260 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22261 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22262 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22263 Remove decls, since these functions are now static.
22264 (Funintern, Fget_internal_run_time): New decls, since these functions
22265 were already external.
22267 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22268 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22269 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22270 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22271 * keyboard.c, keymap.c, lread.c:
22272 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22273 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22274 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22275 Mark functions with DEFUE instead of DEFUN,
22276 if they are used in other modules.
22277 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22278 decls for now-static functions.
22279 * buffer.h (Fdelete_overlay): Remove decl.
22280 * callproc.c (Fgetenv_internal): Mark as internal.
22281 * composite.c (Fremove_list_of_text_properties): Remove decl.
22282 (Fcomposition_get_gstring): New forward static decl.
22283 * composite.h (Fcomposite_get_gstring): Remove decl.
22284 * dired.c (Ffile_attributes): New forward static decl.
22285 * doc.c (Fdocumntation_property): New forward static decl.
22286 * eval.c (Ffetch_bytecode): New forward static decl.
22287 (Funintern): Remove extern decl; now in .h file where it belongs.
22288 * fileio.c (Fmake_symbolic_link): New forward static decl.
22289 * image.c (Finit_image_library): New forward static decl.
22290 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22291 * intervals.h (Fprevious_property_change):
22292 (Fremove_list_of_text_properties): Remove decls.
22293 * keyboard.c (Fthis_command_keys): Remove decl.
22294 (Fcommand_execute): New forward static decl.
22295 * keymap.c (Flookup_key): New forward static decl.
22296 (Fcopy_keymap): Now static.
22297 * keymap.h (Flookup_key): Remove decl.
22298 * process.c (Fget_process): New forward static decl.
22299 (Fprocess_datagram_address): Mark as internal.
22300 * syntax.c (Fsyntax_table_p): New forward static decl.
22301 (skip_chars): Remove duplicate decl.
22302 * textprop.c (Fprevious_property_change): New forward static decl.
22303 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22305 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22306 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22308 * editfns.c (Fformat): Remove unreachable code.
22310 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22312 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22315 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22317 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22318 when at ZV. (Bug#8487)
22320 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22322 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22324 * keyboard.c (parse_tool_bar_item): Likewise.
22325 * sound.c (sound_cleanup, alsa_close): Likewise.
22326 * termcap.c (tgetent): Likewise.
22327 * xfns.c (x_default_font_parameter): Likewise.
22328 * xsettings.c (read_and_apply_settings): Likewise.
22330 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22331 (overrun_check_free): Protoize.
22333 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22335 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22336 since callers should never pass a negative size.
22337 Change the signature to match that of plain 'read' and 'write'; see
22338 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22339 * lisp.h: Update prototypes of emacs_write and emacs_read.
22341 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22343 * xdisp.c (redisplay_window): Don't try to determine the character
22344 position of the scroll margin if the window start point w->startp
22345 is outside the buffer's accessible region. (Bug#8468)
22347 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22349 Fix write-region and its subroutines for buffers > 2GB.
22350 * fileio.c (a_write, e_write): Modify declaration of arguments and
22351 local variables to support buffers larger than 2GB.
22352 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22354 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22355 argument, local variables, and return value.
22357 * lisp.h: Update prototypes of emacs_write and emacs_read.
22359 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22361 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22363 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22365 Fix more problems found by GCC 4.6.0's static checks.
22367 * xdisp.c (vmessage): Use a better test for character truncation.
22369 * charset.c (load_charset_map): <, not <=, for optimization,
22370 and to avoid potential problems with integer overflow.
22371 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22372 * casetab.c (set_identity, shuffle): Likewise.
22373 * editfns.c (Fformat): Likewise.
22374 * syntax.c (skip_chars): Likewise.
22376 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22377 This also lets GCC 4.6.0 generate slightly better loop code.
22379 * callint.c (Fcall_interactively): <, not <=, for optimization.
22380 (Fcall_interactively): Count the number of arguments produced,
22381 not the number of arguments given. This is simpler and lets GCC
22382 4.6.0 generate slightly better code.
22384 * ftfont.c: Distingish more carefully between FcChar8 and char.
22385 The previous code passed unsigned char * to a functions like
22386 strlen and xstrcasecmp that expect char *, which does not
22387 conform to the C standard.
22388 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22389 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22390 char * when the C standard requires it.
22392 * keyboard.c (read_char): Remove unused var.
22394 * eval.c: Port to Windows vsnprintf (Bug#8435).
22395 Include <limits.h>.
22396 (SIZE_MAX): Define if the headers do not.
22397 (verror): Do not give up if vsnprintf returns a negative count.
22398 Instead, grow the buffer. This ports to Windows vsnprintf, which
22399 does not conform to C99. Problem reported by Eli Zaretskii.
22400 Also, simplify the allocation scheme, by avoiding the need for
22401 calling realloc, and removing the ALLOCATED variable.
22403 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22405 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22406 But keep the doprint source code for now, as we might revamp it
22407 and use it again (Bug#8435).
22408 * lisp.h (doprnt): Remove.
22409 * Makefile.in (base_obj): Remove doprnt.o.
22410 * deps.mk (doprnt.o): Remove.
22412 error: Print 32- and 64-bit integers portably (Bug#8435).
22413 Without this change, on typical 64-bit hosts error ("...%d...", N)
22414 was used to print both 32- and 64-bit integers N, which relied on
22415 undefined behavior.
22416 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22417 * lisp.h (error, verror): Mark as printf-like functions.
22418 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22419 Report overflow in size calculations when allocating printf buffer.
22420 Do not truncate output string at its first null byte.
22421 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22422 Truncate the output at a character boundary, since vsnprintf does not
22424 * charset.c (check_iso_charset_parameter): Convert internal
22425 character to string before calling 'error', since %c now has the
22427 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22428 overflow when computing char to be passed to 'error'. Do not
22429 pass Lisp_Object to 'error'; pass the integer instead.
22430 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22431 formatted with plain %d.
22433 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22435 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22437 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22439 * xterm.c (x_catch_errors): Remove duplicate declaration.
22441 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22443 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22445 2011-04-10 Jim Meyering <meyering@redhat.com>
22447 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22448 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22449 return ssize_t not "int", and use size_t as the buffer length.
22450 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22451 * gnutls.h: Update declarations.
22452 * process.c (read_process_output): Use ssize_t, to match.
22453 (send_process): Likewise.
22455 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22457 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22459 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22461 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22462 Use unsigned char, to match FcChar8 type definition.
22464 * xterm.c (handle_one_xevent):
22465 * xmenu.c (create_and_show_popup_menu):
22466 * xselect.c (x_decline_selection_request)
22467 (x_reply_selection_request): Avoid type-punned deref of X events.
22469 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22471 Fix some uses of `int' instead of EMACS_INT.
22472 * search.c (string_match_1, fast_string_match)
22473 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22474 (scan_buffer, find_next_newline_no_quit)
22475 (find_before_next_newline, search_command, Freplace_match)
22476 (Fmatch_data): Make some `int' variables be EMACS_INT.
22478 * xdisp.c (display_count_lines): 3rd argument and return value now
22479 EMACS_INT. All callers changed.
22480 (pint2hrstr): Last argument is now EMACS_INT.
22482 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22483 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22484 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22485 (decode_coding_utf_16, decode_coding_emacs_mule)
22486 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22487 (decode_coding_ccl, decode_coding_charset)
22488 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22489 (decode_coding_iso_2022, decode_coding_emacs_mule)
22490 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22491 <char_offset, last_offset>: Declare EMACS_INT.
22492 (encode_coding_utf_8, encode_coding_utf_16)
22493 (encode_coding_emacs_mule, encode_invocation_designation)
22494 (encode_designation_at_bol, encode_coding_iso_2022)
22495 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22496 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22498 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22499 (encode_invocation_designation): Last argument P_NCHARS is now
22501 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22502 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22504 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22507 * ccl.c (Fccl_execute_on_string): Declare some variables
22510 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22512 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22514 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22516 * process.c (Fformat_network_address): Doc fix.
22518 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22520 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22522 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22524 * keyboard.c (read_char): Call Lisp function help-form-show,
22525 instead of using internal_with_output_to_temp_buffer.
22526 (Qhelp_form_show): New var.
22527 (syms_of_keyboard): Use DEFSYM macro.
22529 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22531 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22533 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22535 * process.c (Flist_processes): Remove to Lisp.
22536 (list_processes_1): Delete.
22538 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22540 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22542 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22544 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22546 Fix more problems found by GCC 4.6.0's static checks.
22548 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22550 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22552 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22554 * xdisp.c (vmessage): Mark as a printf-like function.
22556 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22558 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22560 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22561 printf-like functions.
22562 (tiff_load): Add casts to remove these marks before passing them
22563 to system-supplied API.
22565 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22567 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22568 This avoids several warnings with gcc -Wstrict-overflow.
22569 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22570 directly, rather than having caller test rule sign. This avoids
22571 some unnecessary tests.
22572 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22573 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22574 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22576 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22577 (xfont_open): Avoid unnecessary tests.
22579 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22581 * composite.h, composite.c (composition_gstring_put_cache):
22582 Use EMACS_INT, not int, for length.
22584 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22585 breaking out part of COMPOSITION_DECODE_RULE.
22586 (COMPOSITION_DECODE_RULE): Use it.
22587 * composite.c (get_composition_id): Remove unused local vars,
22588 by using the new macro.
22590 * textprop.c (set_text_properties_1): Change while to do-while,
22591 since the condition is always true at first.
22593 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22594 (interval_deletion_adjustment): Return unsigned value.
22597 * process.c (list_processes_1, create_pty, read_process_output):
22598 (exec_sentinel): Remove vars that were set but not used.
22599 (create_pty): Remove unnecessary "volatile"s.
22600 (Fnetwork_interface_info): Avoid possibility of int overflow.
22601 (read_process_output): Do adaptive read buffering even if carryover.
22602 (read_process_output): Simplify nbytes computation if buffered.
22604 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22606 * syntax.c (scan_words): Remove var that was set but not used.
22607 (update_syntax_table): Use unsigned instead of int.
22609 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22610 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22611 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22613 * print.c (print_error_message): Avoid int overflow.
22615 * font.c (font_list_entities): Redo for clarity,
22616 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22618 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22619 (font_score): Avoid potential overflow in diff calculation.
22621 * fns.c (substring_both): Remove var that is set but not used.
22622 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22624 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22626 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22627 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22628 can always succeed if overflow has undefined behavior.
22630 * search.c (boyer_moore, wordify): Remove vars set but not used.
22631 (wordify): Omit three unnecessary tests.
22633 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22634 All callers changed. This avoids the need for an unused var.
22636 * casefiddle.c (casify_region): Remove var that is set but not used.
22638 * dired.c (file_name_completion): Remove var that is set but not used.
22640 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22642 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22643 (Finsert_file_contents): Remove unnecessary code checking fd.
22645 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22646 Check for integer overflow on size calculations.
22648 * buffer.c (Fprevious_overlay_change): Remove var that is set
22651 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22652 Remove vars that are set but not used.
22653 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22654 (timer_check_2): Mark vars as initialized.
22656 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22658 * image.c (lookup_image): Remove var that is set but not used.
22659 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22661 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22662 that are set but not used.
22664 * xfns.c (make_invisible_cursor): Don't return garbage
22665 if XCreateBitmapFromData fails (Bug#8410).
22667 * xselect.c (x_get_local_selection, x_handle_property_notify):
22668 Remove vars that are set but not used.
22670 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22671 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22673 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22674 Remove var that is set but not used.
22675 (scroll_bar_windows_size): Now size_t, not int.
22676 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22677 Check for overflow.
22679 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22680 (map_tty_color) [!defined MSDOS]: Likewise.
22682 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22684 * coding.c: Remove vars that are set but not used.
22685 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22686 All callers changed.
22687 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22688 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22689 (decode_coding_charset): Remove vars that are set but not used.
22691 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22692 that is set but not used.
22694 * print.c (print_object): Remove var that is set but not used.
22696 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22697 The gnulib version avoids calling malloc in the usual case,
22698 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22699 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22700 * filelock.c (current_lock_owner): Likewise.
22701 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22702 * sysdep.c: Include allocator.h, careadlinkat.h.
22703 (emacs_no_realloc_allocator): New static constant.
22704 (emacs_readlink): New function.
22705 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22706 ../lib/careadlinkat.h.
22708 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22710 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22711 first non-nil return value).
22713 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22715 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22716 if not defined (Bug#8403).
22718 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22720 * xdisp.c (display_count_lines): Remove parameter `start',
22721 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22722 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22723 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22724 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22725 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22726 and thereabouts. All callers changed.
22727 (get_per_char_metric): Remove parameter `f', unused since
22728 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22730 2011-04-02 Jim Meyering <meyering@redhat.com>
22732 do not dereference NULL upon failed strdup
22733 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22734 (ns_get_family): Likewise.
22736 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22738 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22740 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22742 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22745 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22747 Add lexical binding.
22749 * window.c (Ftemp_output_buffer_show): New fun.
22750 (Fsave_window_excursion):
22751 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22753 * lread.c (lisp_file_lexically_bound_p): New function.
22754 (Fload): Bind Qlexical_binding.
22755 (readevalloop): Remove `evalfun' arg.
22756 Bind Qinternal_interpreter_environment.
22757 (Feval_buffer): Bind Qlexical_binding.
22758 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22760 (syms_of_lread): Declare `lexical-binding'.
22762 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22764 * keyboard.c (eval_dyn): New fun.
22765 (menu_item_eval_property): Use it.
22767 * image.c (parse_image_spec): Use Ffunctionp.
22769 * fns.c (concat, mapcar1): Accept byte-code-functions.
22771 * eval.c (Fsetq): Handle lexical vars.
22772 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22773 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22774 (FletX, Flet): Obey lexical binding.
22775 (Fcommandp): Handle closures.
22776 (Feval): New `lexical' arg.
22777 (eval_sub): New function extracted from Feval. Use it almost
22778 everywhere where Feval was used. Look up vars in lexical env.
22780 (Ffunctionp): Move from subr.el.
22781 (Ffuncall): Handle closures.
22782 (apply_lambda): Remove `eval_flags'.
22783 (funcall_lambda): Handle closures and new byte-code-functions.
22784 (Fspecial_variable_p): New function.
22785 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22786 but without exporting it to Lisp.
22788 * doc.c (Fdocumentation, store_function_docstring):
22789 * data.c (Finteractive_form): Handle closures.
22791 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22794 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22796 (exec_byte_code): New function extracted from Fbyte_code to handle new
22797 calling convention for byte-code-functions. Add new byte-codes.
22799 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22801 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22803 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22805 * xdisp.c (redisplay_internal): Fix prototype.
22807 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22809 * xdisp.c (SCROLL_LIMIT): New macro.
22810 (try_scrolling): Use it when setting scroll_limit.
22811 Limit scrolling to 100 screen lines.
22812 (redisplay_window): Even when falling back on "recentering",
22813 position point in the window according to scroll-conservatively,
22814 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22816 (try_scrolling): When point is above the window, allow searching
22817 as far as scroll_max, or one screenful, to compute vertical
22818 distance from PT to the scroll margin position. This prevents
22819 try_scrolling from unnecessarily failing when
22820 scroll-conservatively is set to a value slightly larger than the
22821 window height. Clean up the case of PT below the margin at bottom
22822 of window: scroll_max can no longer be INT_MAX. When aggressive
22823 scrolling is in use, don't let point enter the opposite scroll
22824 margin as result of the scroll.
22825 (syms_of_xdisp) <scroll-conservatively>: Document the
22826 threshold of 100 lines for never-recentering scrolling.
22828 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22830 * dispextern.h (move_it_by_lines):
22831 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22832 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22833 (message_log_check_duplicate): Remove parameters `prev_bol' and
22834 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22835 (redisplay_internal): Remove parameter `preserve_echo_area',
22836 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22838 * indent.c (Fvertical_motion):
22839 * window.c (window_scroll_pixel_based, Frecenter):
22840 Don't pass `need_y_p' to `move_it_by_lines'.
22842 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22844 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22845 steal a few bits to be more compact.
22846 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22847 Remove unneeded casts.
22849 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22851 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22853 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22854 binding" message (bug#7967).
22856 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22858 Fix more problems found by GCC 4.6.0's static checks.
22860 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22861 Remove unused local var.
22863 * editfns.c (Fmessage_box): Remove unused local var.
22865 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22866 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22867 Omit unused local vars.
22868 * window.c (shrink_windows): Omit unused local var.
22869 * menu.c (digest_single_submenu): Omit unused local var.
22870 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22871 Omit unused local var.
22873 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22874 Don't assume string length fits in int.
22875 (keyremap_step, read_key_sequence): Use size_t for sizes.
22876 (read_key_sequence): Don't check last_real_key_start redundantly.
22878 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22879 instead of alloca (Bug#8344).
22881 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22882 (Fbacktrace_frame): Don't assume nframes fits in int.
22884 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22886 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22889 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22891 * cm.c (calccost): Turn while-do into do-while, for clarity.
22893 * keyboard.c (syms_of_keyboard): Use the same style as later
22894 in this function when indexing through an array. This also
22895 works around GCC bug 48267.
22897 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22899 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22901 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22902 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22904 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22905 This avoids undefined behavior on integer overflow, and is a bit
22906 more convenient anyway since it is compared to a size_t variable.
22908 Variadic C functions now count arguments with size_t, not int.
22909 This avoids an unnecessary limitation on 64-bit machines, which
22910 caused (substring ...) to crash on large vectors (Bug#8344).
22911 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22912 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22913 All variadic functions and their callers changed accordingly.
22914 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22915 * data.c (arith_driver, float_arith_driver): Likewise.
22916 * editfns.c (general_insert_function): Likewise.
22917 * eval.c (struct backtrace.nargs, interactive_p)
22918 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22919 (funcall_lambda, mark_backtrace): Likewise.
22920 * fns.c (concat): Likewise.
22921 * frame.c (x_set_frame_parameters): Likewise.
22922 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22923 0 if not found, not -1. All callers changed.
22925 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22926 (stack_copy_size): Now size_t, not int.
22927 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22929 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22931 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22932 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22933 All callers changed.
22935 * lisp.h (multibyte_char_to_unibyte):
22936 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22937 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22938 * character.h (CHAR_TO_BYTE8):
22939 * cmds.c (internal_self_insert):
22940 * editfns.c (general_insert_function):
22941 * keymap.c (push_key_description):
22942 * search.c (Freplace_match):
22943 * xdisp.c (message_dolog, set_message_1): All callers changed.
22945 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22947 * keyboard.c (safe_run_hook_funcall): New function.
22948 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22949 don't set the hook to nil, but remove the offending function instead.
22950 (Qcommand_hook_internal): Remove, unused.
22951 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22952 Vcommand_hook_internal.
22954 * eval.c (enum run_hooks_condition): Remove.
22955 (funcall_nil, funcall_not): New functions.
22956 (run_hook_with_args): Call each function through a `funcall' argument.
22957 Remove `cond' argument, now redundant.
22958 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22959 (Frun_hook_with_args_until_failure): Adjust accordingly.
22960 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22962 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22964 * dispextern.h (string_buffer_position): Remove declaration.
22966 * print.c (strout): Remove parameter `multibyte', unused since
22967 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22969 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22970 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22971 All callers changed.
22973 * w32.c (_wsa_errlist): Use braces for struct initializers.
22975 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22976 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22977 All callers changed.
22978 (string_buffer_position): Likewise. Also, make static (it's never
22979 used outside xdisp.c).
22980 (cursor_row_p): Remove parameter `w', unused since
22981 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22982 (decode_mode_spec): Remove parameter `precision', introduced during
22983 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22984 All callers changed.
22986 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22988 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22990 2011-03-27 Anders Lindgren <andlind@gmail.com>
22992 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22993 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22994 (ns_update_auto_hide_menu_bar): New functions.
22995 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22996 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22997 ns_constrain_all_frames.
22998 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22999 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23001 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23003 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23005 2011-03-27 Glenn Morris <rgm@gnu.org>
23007 * syssignal.h: Replace RETSIGTYPE with void.
23008 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23009 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23010 Replace SIGTYPE with void everywhere.
23011 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23012 * s/template.h (SIGTYPE): Remove commented out definition.
23014 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23016 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23017 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23019 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23021 * w32.c (read_unc_volume): Use parameter `henum', instead of
23022 global variable `wget_enum_handle'.
23024 * keymap.c (describe_vector): Remove parameters `indices' and
23025 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23026 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23028 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23030 * keyboard.c (timer_check): Remove parameter `do_it_now',
23031 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23032 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23033 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23035 * keyboard.c (read_char):
23036 * w32menu.c (w32_menu_display_help):
23037 * xmenu.c (show_help_event, menu_help_callback):
23038 Adjust calls to `show_help_echo'.
23040 * gtkutil.c (xg_maybe_add_timer):
23041 * keyboard.c (readable_events):
23042 * process.c (wait_reading_process_output):
23043 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23045 * insdel.c (adjust_markers_gap_motion):
23046 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23047 (gap_left, gap_right): Don't call it.
23049 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23051 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23052 incurred during fontification.
23054 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23056 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23057 (DEFVAR_PER_BUFFER): Don't pass it.
23059 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23060 (scrolling_window): Don't pass it.
23062 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23064 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23066 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23068 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23069 of variables specific to SELinux and computation of `encoded_absname'.
23071 * image.c (XPutPixel): Remove unused variable `height'.
23073 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23075 * unexw32.c (get_section_info): Remove unused variable `section'.
23077 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23078 (system_process_attributes): Remove unused variable `sess'.
23079 (sys_read): Remove unused variable `err'.
23081 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23082 (w32_wnd_proc): Remove unused variable `isdead'.
23083 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23084 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23085 (x_create_tip_frame): Remove unused variable `tem'.
23087 * w32inevt.c (w32_console_read_socket):
23088 Remove unused variable `no_events'.
23090 * w32term.c (x_draw_composite_glyph_string_foreground):
23091 Remove unused variable `width'.
23093 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23095 * w32term.c (x_set_glyph_string_clipping):
23096 Don't pass uninitialized region to CombineRgn.
23098 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23100 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23101 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23102 (Fx_close_connection): Remove unused variable `i'.
23104 * w32font.c (w32font_draw): Return number of glyphs.
23105 (w32font_open_internal): Remove unused variable `i'.
23106 (w32font_driver): Add missing initializer.
23108 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23109 (fill_in_menu): Remove unused variable `items_added'.
23111 * w32term.c (last_mouse_press_frame): Remove static global variable.
23112 (w32_clip_to_row): Remove unused variable `f'.
23113 (x_delete_terminal): Remove unused variable `i'.
23115 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23116 (NOTHING): Remove unused static global variable.
23117 (uniscribe_check_otf): Remove unused variable `table'.
23118 (uniscribe_font_driver): Add missing initializers.
23120 2011-03-23 Julien Danjou <julien@danjou.info>
23122 * term.c (Fsuspend_tty, Fresume_tty):
23123 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23124 * window.c (temp_output_buffer_show):
23125 * insdel.c (signal_before_change):
23126 * frame.c (Fhandle_switch_frame):
23127 * fileio.c (Fdo_auto_save):
23128 * emacs.c (Fkill_emacs):
23129 * editfns.c (save_excursion_restore):
23130 * cmds.c (internal_self_insert):
23131 * callint.c (Fcall_interactively):
23132 * buffer.c (Fkill_all_local_variables):
23133 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23135 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23136 unconditionally since it does the check itself.
23138 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23140 Fix more problems found by GCC 4.5.2's static checks.
23142 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23143 the first time through the loop, since we know p0 < p1 then.
23144 This also avoids a gcc -Wstrict-overflow warning.
23146 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23147 leading to a memory leak, possible in functions like
23148 load_charset_map_from_file that can allocate an unbounded number
23149 of objects (Bug#8318).
23151 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23152 that could (at least in theory) be that large.
23154 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23155 This is less likely to overflow, and avoids undefined behavior if
23156 overflow does occur. All callers changed. Use strtoul to scan
23157 for the unsigned long integer.
23158 (pint2hrstr): Simplify and tune code slightly.
23159 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23161 * scroll.c (do_scrolling): Work around GCC bug 48228.
23162 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23164 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23165 This also avoids a warning with gcc -Wstrict-overflow.
23166 (validate_x_resource_name): Simplify count usage.
23167 This also avoids a warning with gcc -Wstrict-overflow.
23169 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23172 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23174 * process.c (Fmake_network_process): Use socklen_t, not int,
23175 where POSIX says socklen_t is required in portable programs.
23176 This fixes a porting bug on hosts like 64-bit HP-UX, where
23177 socklen_t is wider than int (Bug#8277).
23178 (Fmake_network_process, server_accept_connection):
23179 (wait_reading_process_output, read_process_output):
23182 * process.c: Rename or move locals to avoid shadowing.
23183 (list_processes_1, Fmake_network_process):
23184 (read_process_output_error_handler, exec_sentinel_error_handler):
23185 Rename or move locals.
23186 (Fmake_network_process): Define label "retry_connect" only if needed.
23187 (Fnetwork_interface_info): Fix pointer signedness.
23188 (process_send_signal): Add cast to avoid pointer signedness problem.
23189 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23190 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23192 Make tparam.h and terminfo.c consistent.
23193 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23194 Include tparam.h instead, since it declares them.
23195 * cm.h (PC): Remove extern decl; tparam.h now does this.
23196 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23197 * terminfo.c: Include tparam.h, to check interfaces.
23198 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23199 (tparam): Adjust signature to match interface in tparam.h;
23200 this removes some undefined behavior. Check that outstring and len
23201 are zero, which they always are with Emacs.
23202 * tparam.h (PC, BC, UP): New extern decls.
23204 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23205 (xftfont_open): Rename locals to avoid shadowing.
23207 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23208 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23209 (OTF_TAG_SYM): Omit macro if not needed.
23210 (ftfont_list): Remove unused local.
23211 (get_adstyle_property, ftfont_pattern_entity):
23212 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23213 Rename locals to avoid shadowing.
23215 * xfont.c (xfont_list_family): Mark var as initialized.
23217 * xml.c (make_dom): Now static.
23219 * composite.c (composition_compute_stop_pos): Rename local to
23221 (composition_reseat_it): Remove unused locals.
23222 (find_automatic_composition, composition_adjust_point): Likewise.
23223 (composition_update_it): Mark var as initialized.
23224 (find_automatic_composition): Mark vars as initialized,
23225 with a FIXME (Bug#8290).
23227 character.h: Rename locals to avoid shadowing.
23228 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23229 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23230 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23231 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23232 to avoid shadowing.
23234 * textprop.c (property_change_between_p): Remove; unused.
23236 * intervals.c (interval_start_pos): Now static.
23238 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23240 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23241 Rename locals to avoid shadowing.
23243 * sound.c (wav_play, au_play, Fplay_sound_internal):
23244 Fix pointer signedness.
23245 (alsa_choose_format): Remove unused local var.
23246 (wav_play): Initialize a variable to 0, to prevent undefined
23247 behavior (Bug#8278).
23249 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23251 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23253 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23254 clobbering (Bug#8298).
23255 * sysdep.c (sys_subshell): Likewise.
23256 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23258 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23259 This should get cleaned up, so that child_setup has the
23260 same signature on all platforms.
23262 * callproc.c (call_process_cleanup): Now static.
23263 (relocate_fd): Rename locals to avoid shadowing.
23265 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23267 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23268 not to be necessary, and produces flickering.
23270 2011-03-20 Glenn Morris <rgm@gnu.org>
23272 * config.in: Remove file.
23274 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23276 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23277 are now in src/globals.h.
23278 (syms_of_minibuf): Remove spurious & from previous change.
23280 2011-03-20 Leo Liu <sdl.web@gmail.com>
23282 * minibuf.c (completing-read-function): New variable.
23283 (completing-read-default): Rename from completing-read.
23284 (completing-read): Call completing-read-function.
23286 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23288 * xfaces.c (Fx_load_color_file):
23289 Read color file from absolute filename (bug#8250).
23291 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23293 * makefile.w32-in: Update dependencies.
23295 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23297 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23299 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23301 Fix more problems found by GCC 4.5.2's static checks.
23303 * process.c (make_serial_process_unwind, send_process_trap):
23304 (sigchld_handler): Now static.
23306 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23307 That way, the code declares only the vars that it needs.
23308 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23309 * s/cygwin.h (PTY_ITERATION): Likewise.
23310 * s/darwin.h (PTY_ITERATION): Likewise.
23311 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23313 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23314 * process.c (allocate_pty): Don't declare stb unless it's needed.
23316 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23317 (CONSTANTLIM): Remove; unused.
23318 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23319 Define only if needed.
23321 * unexelf.c (unexec): Name an expression,
23322 to avoid gcc -Wbad-function-cast warning.
23323 Use a different way to cause a compilation error if anyone uses
23324 n rather than nn, a way that does not involve shadowing.
23325 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23327 * deps.mk (unexalpha.o): Remove; unused.
23329 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23330 * unexec.h: New file.
23331 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23332 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23333 Depend on unexec.h.
23334 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23335 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23336 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23337 Change as necessary to match prototype in unexec.h.
23339 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23341 (back_comment, skip_chars): Mark vars as initialized.
23343 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23344 Rename locals to avoid shadowing.
23346 * lread.c (read1): Rewrite so as not to use empty "else".
23347 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23349 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23351 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23352 warning when compiling print.c.
23354 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23355 instead of using an uninitialized var.
23356 (font_sort_entities): Mark var as initialized.
23358 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23360 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23361 pointers to constants.
23362 (font_parse_fcname): Remove unused vars.
23363 (font_delete_unmatched): Now static.
23364 (font_get_spec): Remove; unused.
23365 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23366 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23367 Rename or move locals to avoid shadowing.
23369 * fns.c (require_nesting_list, require_unwind): Now static.
23370 (Ffillarray): Rename locals to avoid shadowing.
23372 * floatfns.c (domain_error2): Define only if needed.
23373 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23375 * alloc.c (mark_backtrace): Move decl from here ...
23376 * lisp.h: ... to here, so that it can be checked.
23378 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23379 (Fdefvar): Rewrite so as not to use empty "else".
23380 (lisp_indirect_variable): Name an expression,
23381 to avoid gcc -Wbad-function-cast warning.
23382 (Fdefvar): Rename locals to avoid shadowing.
23384 * callint.c (quotify_arg, quotify_args): Now static.
23385 (Fcall_interactively): Rename locals to avoid shadowing.
23386 Use const pointer when appropriate.
23388 * lisp.h (get_system_name, get_operating_system_release):
23389 Move decls here, to check interfaces.
23390 * process.c (get_operating_system_release): Move decl to lisp.h.
23391 * xrdb.c (get_system_name): Likewise.
23392 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23393 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23394 some of which prompt warnings from gcc -Wbad-function-cast.
23395 (Fformat_time_string, Fencode_time, Finsert_char):
23396 (Ftranslate_region_internal, Fformat):
23397 Rename or remove local vars to avoid shadowing.
23398 (Ftranslate_region_internal): Mark var as initialized.
23400 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23403 * lisp.h (eassert): Check that the argument compiles, even if
23404 ENABLE_CHECKING is not defined.
23406 * data.c (Findirect_variable): Name an expression, to avoid
23407 gcc -Wbad-function-cast warning.
23408 (default_value, arithcompare, arith_driver, arith_error): Now static.
23409 (store_symval_forwarding): Rename local to avoid shadowing.
23410 (Fmake_variable_buffer_local, Fmake_local_variable):
23411 Mark variables as initialized.
23412 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23414 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23415 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23416 Rename locals to avoid shadowing.
23417 (mark_stack): Move local variables into the #ifdef region where
23419 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23420 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23422 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23423 (GC_STRING_CHARS): Remove; not used.
23424 (Fmemory_limit): Cast sbrk's returned value to char *.
23426 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23427 avoids undefined behavior in theory.
23429 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23431 Use functions, not macros, for up- and down-casing (Bug#8254).
23432 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23433 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23434 to use the following functions instead of these macros.
23435 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23436 EMACS_INT, since callers assume the returned value fits in int.
23437 (upcase1): Likewise, for UPCASE_TABLE.
23438 (uppercasep, lowercasep, upcase): New static inline functions.
23439 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23440 the race-condition problem in the old DOWNCASE.
23442 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23443 Rename locals to avoid shadowing.
23444 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23445 (regex_compile, re_search_2, re_match_2_internal):
23446 Remove unused local vars.
23447 (FREE_VAR): Rewrite so as not to use empty "else",
23448 which gcc can warn about.
23449 (regex_compile, re_match_2_internal): Mark locals as initialized.
23450 (RETALLOC_IF): Define only if needed.
23451 (WORDCHAR_P): Likewise. This one is never needed, but is used
23452 only in a comment talking about a compiler bug, so put inside
23453 the #if 0 of that comment.
23454 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23455 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23458 * search.c (boyer_moore): Rename locals to avoid shadowing.
23459 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23460 (PREV_CHAR_BOUNDARY): Likewise.
23462 * search.c (simple_search): Remove unused var.
23464 * dired.c (compile_pattern): Move decl from here ...
23465 * lisp.h: ... to here, so that it can be checked.
23466 (struct re_registers): New forward decl.
23468 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23470 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23472 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23473 Rename locals to avoid shadowing.
23474 (Fvertical_motion): Mark locals as initialized.
23476 * casefiddle.c (casify_object, casify_region): Now static.
23477 (casify_region): Mark local as initialized.
23479 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23481 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23482 New macros, so that the caller can use some names other than
23483 gcpro1, gcpro2, etc.
23484 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23486 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23487 argument, for consistency with GCPRO2_VAR, etc: it is now the
23488 prefix of the variable, not the variable itself. All uses
23490 * dired.c (directory_files_internal, file_name_completion):
23491 Rename locals to avoid shadowing.
23493 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23494 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23495 dired.c's scmp function, had undefined behavior.
23496 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23497 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23498 * buffer.h: ... to here, because these macros use current_buffer,
23499 and the new implementation with inline functions needs to have
23500 current_buffer in scope now, rather than later when the macros
23502 (downcase, upcase1): New static inline functions.
23503 (DOWNCASE, UPCASE1): Reimplement using these functions.
23504 This avoids undefined behavior in expressions like
23505 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23506 from race conditions in accessing the global variables
23507 case_temp1 and case_temp2.
23508 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23509 * lisp.h (case_temp1, case_temp2): Remove their decls.
23510 * character.h (ASCII_CHAR_P): Move from here ...
23511 * lisp.h: ... to here, so that the inline functions mentioned
23512 above can use them.
23514 * dired.c (directory_files_internal_unwind): Now static.
23516 * fileio.c (file_name_as_directory, directory_file_name):
23517 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23519 (file_name_as_directory): Use const pointers when appropriate.
23520 (Fexpand_file_name): Likewise. In particular, newdir might
23521 point at constant storage, so make it a const pointer.
23522 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23523 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23525 (Fset_file_times, Finsert_file_contents, auto_save_error):
23526 Rename locals to avoid shadowing.
23528 * minibuf.c (choose_minibuf_frame_1): Now static.
23529 (Ftry_completion, Fall_completions): Rename or remove locals
23530 to avoid shadowing.
23532 * marker.c (bytepos_to_charpos): Remove; unused.
23534 * lisp.h (verify_bytepos, count_markers): New decls,
23535 so that gcc does not warn that these functions aren't declared.
23537 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23538 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23539 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23540 (copy_text): Remove unused local var.
23542 * filelock.c (within_one_second): Now static.
23543 (lock_file_1): Rename local to avoid shadowing.
23545 * buffer.c (fix_overlays_before): Mark locals as initialized.
23546 (fix_start_end_in_overlays): Likewise. This function should be
23547 simplified by using pointers-to-pointers, but that's a different
23549 (switch_to_buffer_1): Now static.
23550 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23551 (report_overlay_modification): Rename locals to avoid shadowing.
23553 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23554 Fix pointer signedness issue.
23555 (sys_subshell): Mark local as volatile if checking for lint,
23556 to suppress a gcc -Wclobbered warning that does not seem to be right.
23557 (MAXPATHLEN): Define only if needed.
23559 * process.c (serial_open, serial_configure): Move decls from here ...
23560 * systty.h: ... to here, so that they can be checked.
23562 * fns.c (get_random, seed_random): Move extern decls from here ...
23563 * lisp.h: ... to here, so that they can be checked.
23565 * sysdep.c (reset_io): Now static.
23566 (wait_for_termination_signal): Remove; unused.
23568 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23569 (copy_keymap_item, append_key, push_text_char_description):
23571 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23572 (DENSE_TABLE_SIZE): Remove; unused.
23573 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23574 (describe_map_tree):
23575 Rename locals to avoid shadowing.
23577 * keyboard.c: Declare functions static if they are not used elsewhere.
23578 (echo_char, echo_dash, cmd_error, top_level_2):
23579 (poll_for_input, handle_async_input): Now static.
23580 (read_char, kbd_buffer_get_event, make_lispy_position):
23581 (make_lispy_event, make_lispy_movement, apply_modifiers):
23582 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23583 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23584 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23585 (read_key_sequence, read_char): Mark locals as initialized.
23586 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23588 * keyboard.h (make_ctrl_char): New decl.
23589 (mark_kboards): Move decl here ...
23590 * alloc.c (mark_kboards): ... from here.
23592 * lisp.h (force_auto_save_soon): New decl.
23594 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23595 (DEFINE_DUMMY_FUNCTION): New macro.
23596 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23598 (main): Add casts to avoid warnings
23599 if GCC considers string literals to be constants.
23601 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23603 * dbusbind.c: Pointer signedness fixes.
23604 (xd_signature, xd_append_arg, xd_initialize):
23605 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23606 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23607 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23608 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23610 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23611 if GCC considers string literals to be constants.
23612 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23614 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23616 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23617 (print_preprocess, print_object): New macro to fix last change.
23619 * print.c (print_preprocess): Don't forget font objects.
23621 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23623 * emacs.c (USAGE3): Doc fixes.
23625 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23627 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23630 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23632 * lisp.h (VWindow_system, Qfile_name_history):
23633 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23634 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23635 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23637 * w32select.c: Don't #include "keyboard.h".
23638 (run_protected): Add extern declaration for waiting_for_input.
23640 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23641 * w32console.c (detect_input_pending, read_input_pending)
23642 (encode_terminal_code):
23643 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23644 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23645 (w32_system_caret_y, Qfile_name_history):
23646 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23647 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23648 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23649 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23650 * w32proc.c (Qlocal, report_file_error):
23651 * w32term.c (Vwindow_system, updating_frame):
23652 * w32uniscribe.c (initialized, uniscribe_font_driver):
23653 Remove unneeded extern declarations.
23655 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23657 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23659 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23661 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23662 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23663 These macros can no longer be used for assignment.
23665 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23666 Assign struct members directly, instead of using BUF_BEGV etc.
23667 (record_buffer_markers, fetch_buffer_markers): New functions for
23668 recording and fetching special buffer markers.
23669 (set_buffer_internal_1, set_buffer_temp): Use them.
23671 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23673 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23675 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23676 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23678 * xdisp.c (hscroll_window_tree):
23679 (reconsider_clip_changes): Use PT instead of BUF_PT.
23681 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23683 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23684 $(EMACS_ROOT)/lib/intprops.h.
23686 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23688 Fix more problems found by GCC 4.5.2's static checks.
23690 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23691 to unsigned char * to avoid compiler diagnostic.
23692 (xg_free_frame_widgets): Make it clear that a local variable is
23693 needed only if USE_GTK_TOOLTIP.
23694 (gdk_window_get_screen): Make it clear that this macro is needed
23695 only if USE_GTK_TOOLTIP.
23696 (int_gtk_range_get_value): New function, which avoids a diagnostic
23697 from gcc -Wbad-function-cast.
23698 (xg_set_toolkit_scroll_bar_thumb): Use it.
23699 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23700 diagnostic from gcc -Wbad-function-cast.
23701 (get_utf8_string, xg_get_file_with_chooser):
23702 Rename locals to avoid shadowing.
23703 (create_dialog): Move locals to avoid shadowing.
23705 * xgselect.c (xg_select): Remove unused var.
23707 * image.c (four_corners_best): Mark locals as initialized.
23708 (gif_load): Initialize transparent_p to zero (Bug#8238).
23709 Mark another local as initialized.
23710 (my_png_error, my_error_exit): Mark with NO_RETURN.
23712 * image.c (clear_image_cache): Now static.
23713 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23714 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23715 (x_edge_detection): Remove unnecessary cast that
23716 gcc -Wbad-function-cast diagnoses.
23717 (gif_load): Fix pointer signedness.
23718 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23719 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23721 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23723 Improve quality of tests for time stamp overflow.
23724 For example, without this patch (encode-time 0 0 0 1 1
23725 1152921504606846976) returns the obviously-bogus value (-948597
23726 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23727 reports time overflow. See
23728 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23729 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23730 * editfns.c: Include limits.h and intprops.h.
23731 (TIME_T_MIN, TIME_T_MAX): New macros.
23732 (time_overflow): Move earlier, to before first use.
23733 (hi_time, lo_time): New functions, for an accurate test for
23734 out-of-range times.
23735 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23736 (Fget_internal_run_time): Don't assume time_t fits in int.
23737 (make_time): Use list2 instead of Fcons twice.
23738 (Fdecode_time): More accurate test for out-of-range times.
23739 (check_tm_member): New function.
23740 (Fencode_time): Use it, to test for out-of-range times.
23741 (lisp_time_argument): Don't rely on undefined left-shift and
23742 right-shift behavior when checking for time stamp overflow.
23744 * editfns.c (time_overflow): New function, refactoring common code.
23745 (Fformat_time_string, Fdecode_time, Fencode_time):
23746 (Fcurrent_time_string): Use it.
23748 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23749 * dired.c (make_time): Move to ...
23750 * editfns.c (make_time): ... here.
23751 * systime.h: Note the move.
23753 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23755 * fringe.c (update_window_fringes): Remove unused variables.
23757 * unexmacosx.c (copy_data_segment): Also copy __got section.
23760 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23762 * termcap.c [MSDOS]: Include "msdos.h".
23763 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23764 Constify `char *' arguments and their references according to
23765 prototypes in tparam.h.
23767 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23769 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23770 Adapt all references accordingly.
23772 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23774 2011-03-11 Tom Tromey <tromey@redhat.com>
23776 * buffer.c (syms_of_buffer): Remove obsolete comment.
23778 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23780 * termhooks.h (encode_terminal_code): Declare prototype.
23782 * msdos.c (encode_terminal_code): Don't declare prototype.
23784 * term.c (encode_terminal_code): Now external again, used by
23785 w32console.c and msdos.c.
23787 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23788 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23790 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23792 Fix some minor problems found by GCC 4.5.2's static checks.
23794 * fringe.c (update_window_fringes): Mark locals as initialized
23796 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23798 * alloc.c (mark_fringe_data): Move decl from here ...
23799 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23800 to check its interface.
23801 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23803 * fontset.c (free_realized_fontset): Now static.
23804 (Fset_fontset_font): Rename local to avoid shadowing.
23805 (fontset_font): Mark local as initialized.
23806 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23808 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23810 * xselect.c (x_disown_buffer_selections): Remove; not used.
23811 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23812 (x_own_selection, Fx_disown_selection_internal): Rename locals
23813 to avoid shadowing.
23814 (x_handle_dnd_message): Remove local to avoid shadowing.
23816 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23817 so that the caller can use some name other than gcpro1.
23818 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23819 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23820 (Fx_backspace_delete_keys_p):
23821 Use them to avoid shadowing, and rename vars to avoid shadowing.
23822 (x_decode_color, x_set_name, x_window): Now static.
23823 (Fx_create_frame): Add braces to silence GCC warning.
23824 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23825 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23826 Remove unused locals.
23827 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23828 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23829 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23832 * xterm.h (x_mouse_leave): New decl.
23834 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23835 Remove unused functions.
23836 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23837 (x_calc_absolute_position): Now static.
23838 (XTread_socket): Don't define label "out" unless it's used.
23839 Don't declare local "event" unless it's used.
23840 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23841 unless they are used.
23842 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23843 (x_fatal_error_signal): Remove; not used.
23844 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23845 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23846 (x_error_catcher, x_connection_closed, x_error_handler):
23847 (x_error_quitter, xembed_send_message, x_iconify_frame):
23848 (my_log_handler): Rename locals to avoid shadowing.
23849 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23850 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23852 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23853 Rename or move locals to avoid shadowing.
23854 (tty_defined_color, merge_face_heights): Now static.
23855 (free_realized_faces_for_fontset): Remove; not used.
23856 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23857 does not deduce is never used uninitialized.
23858 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23859 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23861 * terminal.c (store_terminal_param): Now static.
23863 * xmenu.c (menu_highlight_callback): Now static.
23864 (set_frame_menubar): Remove unused local.
23865 (xmenu_show): Rename parameter to avoid shadowing.
23866 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23867 since they might point to immutable storage.
23868 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23869 since it's unused otherwise.
23871 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23872 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23873 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23874 avoids a gcc -Wuninitialized diagnostic.
23875 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23876 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23877 does not deduce are never used uninitialized.
23879 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23881 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23882 * window.c (window_loop, size_window):
23883 (run_window_configuration_change_hook, enlarge_window): Likewise.
23885 * window.c (display_buffer): Now static.
23886 (size_window): Mark variables that gcc -Wuninitialized
23887 does not deduce are never used uninitialized.
23888 * window.h (check_all_windows): New decl, to forestall
23889 gcc -Wmissing-prototypes diagnostic.
23890 * dispextern.h (bidi_dump_cached_states): Likewise.
23892 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23894 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23895 Include <limits.h>.
23896 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23897 and to avoid gcc -Wuninitialized warning.
23898 (load_charset_map): Mark variables that gcc -Wuninitialized
23899 does not deduce are never used uninitialized.
23900 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23902 * coding.c (coding_set_source, coding_set_destination):
23903 Use "else { /* comment */ }" rather than "else /* comment */;"
23904 for clarity, and to avoid gcc -Wempty-body warning.
23905 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23906 a block, when the outer 'i' will do.
23907 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23908 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23909 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23910 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23911 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23912 Rename locals to avoid shadowing.
23913 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23914 * coding.c (emacs_mule_char, encode_invocation_designation):
23915 Now static, since they're not used elsewhere.
23916 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23917 (decode_coding_object, encode_coding_object, detect_coding_system):
23918 (decode_coding_emacs_mule): Mark variables that gcc
23919 -Wuninitialized does not deduce are never used uninitialized.
23920 (detect_coding_iso_2022): Initialize a local variable that might
23921 be used uninitialized. Leave a FIXME because it's not clear that
23922 this initialization is needed. (Bug#8211)
23923 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23924 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23925 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23926 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23927 Remove unused macros.
23929 * category.c (hash_get_category_set): Remove unused local var.
23930 (copy_category_table): Now static, since it's not used elsewhere.
23931 * character.c (string_count_byte8): Likewise.
23933 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23934 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23936 * chartab.c (copy_sub_char_table): Now static, since it's not used
23938 (sub_char_table_ref_and_range, char_table_ref_and_range):
23939 Rename locals to avoid shadowing.
23940 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
23942 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
23943 (BIDI_BOB): Remove unused macro.
23945 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23946 deduce are never used uninitialized.
23947 * term.c (encode_terminal_code): Likewise.
23949 * term.c (encode_terminal_code): Now static. Remove unused local.
23951 * tparam.h: New file.
23952 * term.c, tparam.h: Include it.
23953 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23954 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23955 Move these decls to tparam.h, and make them agree with what
23956 is actually in tparam.c. The previous trick of using incompatible
23957 decls in different modules does not conform to the C standard.
23958 All callers of tparam changed to use tparam's actual API.
23959 * tparam.c (tparam1, tparam, tgoto):
23960 Use const pointers where appropriate.
23962 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23963 * cm.h (struct cm): Likewise.
23964 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23965 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23966 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23967 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23968 (turn_on_face, init_tty): Likewise.
23969 * termchar.h (struct tty_display_info): Likewise.
23971 * term.c (term_mouse_position): Rename local to avoid shadowing.
23973 * alloc.c (mark_ttys): Move decl from here ...
23974 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23976 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23978 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23980 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
23982 * search.c (compile_pattern_1): Remove argument regp, unused since
23983 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23984 (compile_pattern): Don't pass it.
23986 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23988 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23989 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23991 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23993 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23995 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23996 gdk_window_get_screen, gdk_window_get_geometry,
23997 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23998 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23999 (xg_get_pixbuf_from_pixmap): New function.
24000 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24001 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24002 Call xg_get_pixbuf_from_pixmap instead of
24003 gdk_pixbuf_get_from_drawable.
24004 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24005 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24006 (xg_check_special_colors): Use GtkStyleContext and its functions
24008 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24009 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24010 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24011 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24012 Call gtk_widget_get_preferred_size.
24013 (xg_frame_resized): gdk_window_get_geometry only takes 5
24015 (xg_win_to_widget, xg_event_is_for_menubar):
24016 Call gdk_x11_window_lookup_for_display.
24017 (xg_set_widget_bg): New function.
24018 (delete_cb): New function.
24019 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24020 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24021 (xg_set_background_color): Call xg_set_widget_bg.
24022 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24023 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24024 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24025 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24027 (update_frame_tool_bar): Call gtk_widget_hide.
24028 (xg_initialize): Use GDK_KEY_g.
24030 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24032 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24034 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24035 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24036 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24038 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24040 * w32xfns.c (select_palette): Check success of RealizePalette against
24041 GDI_ERROR, not zero.
24043 See ChangeLog.11 for earlier changes.
24045 ;; Local Variables:
24049 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24051 This file is part of GNU Emacs.
24053 GNU Emacs is free software: you can redistribute it and/or modify
24054 it under the terms of the GNU General Public License as published by
24055 the Free Software Foundation, either version 3 of the License, or
24056 (at your option) any later version.
24058 GNU Emacs is distributed in the hope that it will be useful,
24059 but WITHOUT ANY WARRANTY; without even the implied warranty of
24060 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24061 GNU General Public License for more details.
24063 You should have received a copy of the GNU General Public License
24064 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.